mirror of
https://github.com/skyline-emu/skyline.git
synced 2024-11-26 02:44:17 +01:00
Move maxwell3d to common constant buffer code
This commit is contained in:
parent
8f0a6e78c5
commit
62c86b7690
@ -33,16 +33,6 @@ namespace skyline::gpu::interconnect::maxwell3d {
|
|||||||
view.PurgeCaches();
|
view.PurgeCaches();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void FlushHostCallback() {
|
|
||||||
// TODO: here we should trigger `Execute()`, however that doesn't currently work due to Read being called mid-draw and attached objects not handling this case
|
|
||||||
Logger::Warn("GPU dirty buffer reads for attached buffers are unimplemented");
|
|
||||||
}
|
|
||||||
|
|
||||||
void ConstantBuffer::Read(CommandExecutor &executor, span<u8> dstBuffer, size_t srcOffset) {
|
|
||||||
ContextLock lock{executor.tag, view};
|
|
||||||
view.Read(lock.IsFirstUsage(), FlushHostCallback, dstBuffer, srcOffset);
|
|
||||||
}
|
|
||||||
|
|
||||||
ConstantBuffers::ConstantBuffers(DirtyManager &manager, const ConstantBufferSelectorState::EngineRegisters &constantBufferSelectorRegisters) : selectorState{manager, constantBufferSelectorRegisters} {}
|
ConstantBuffers::ConstantBuffers(DirtyManager &manager, const ConstantBufferSelectorState::EngineRegisters &constantBufferSelectorRegisters) : selectorState{manager, constantBufferSelectorRegisters} {}
|
||||||
|
|
||||||
void ConstantBuffers::MarkAllDirty() {
|
void ConstantBuffers::MarkAllDirty() {
|
||||||
|
@ -29,19 +29,6 @@ namespace skyline::gpu::interconnect::maxwell3d {
|
|||||||
void PurgeCaches();
|
void PurgeCaches();
|
||||||
};
|
};
|
||||||
|
|
||||||
struct ConstantBuffer {
|
|
||||||
BufferView view;
|
|
||||||
|
|
||||||
void Read(CommandExecutor &executor, span <u8> dstBuffer, size_t srcOffset);
|
|
||||||
|
|
||||||
template<typename T>
|
|
||||||
T Read(CommandExecutor &executor, size_t srcOffset) {
|
|
||||||
T object;
|
|
||||||
Read(executor, span<T>{object}.template cast<u8>(), srcOffset);
|
|
||||||
return object;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
using ConstantBufferSet = std::array<std::array<ConstantBuffer, engine::ShaderStageConstantBufferCount>, engine::ShaderStageCount>;
|
using ConstantBufferSet = std::array<std::array<ConstantBuffer, engine::ShaderStageConstantBufferCount>, engine::ShaderStageCount>;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user