mirror of
https://github.com/skyline-emu/skyline.git
synced 2024-12-23 17:22:00 +01:00
Implement constant buffer reading
This commit is contained in:
parent
afcfe8a7fa
commit
a9213debc7
@ -24,17 +24,22 @@ namespace skyline::gpu::interconnect::maxwell3d {
|
||||
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} {}
|
||||
|
||||
void ConstantBuffers::MarkAllDirty() {
|
||||
selectorState.MarkDirty(true);
|
||||
}
|
||||
|
||||
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 ConstantBuffers::Load(InterconnectContext &ctx, span<u32> data, u32 offset) {
|
||||
auto &view{*selectorState.UpdateGet(ctx).view};
|
||||
auto srcCpuBuf{data.cast<u8>()};
|
||||
|
@ -30,10 +30,10 @@ namespace skyline::gpu::interconnect::maxwell3d {
|
||||
struct ConstantBuffer {
|
||||
BufferView view;
|
||||
|
||||
void Read(CommandExecutor &executor, span<u8> dstBuffer, size_t srcOffset) const;
|
||||
void Read(CommandExecutor &executor, span<u8> dstBuffer, size_t srcOffset);
|
||||
|
||||
template<typename T>
|
||||
T Read(CommandExecutor &executor, size_t srcOffset) const {
|
||||
T Read(CommandExecutor &executor, size_t srcOffset) {
|
||||
T object;
|
||||
Read(executor, span<T>{object}.template cast<u8>(), srcOffset);
|
||||
return object;
|
||||
|
Loading…
Reference in New Issue
Block a user