Only sync in the first time we see a readconst

Thsi is partialy wrong. We need to save the state into the submission context itself, not the rasterizer since we can yield and process another sumission (if im not understanding wrong).
This commit is contained in:
Lander Gallastegi 2025-04-28 21:35:10 +02:00
parent c642e4f1be
commit f260a61d26

View File

@ -456,6 +456,8 @@ bool Rasterizer::BindResources(const Pipeline* pipeline) {
buffer_infos.clear(); buffer_infos.clear();
image_infos.clear(); image_infos.clear();
bool fault_enable = false;
// Bind resource buffers and textures. // Bind resource buffers and textures.
Shader::Backend::Bindings binding{}; Shader::Backend::Bindings binding{};
Shader::PushData push_data = MakeUserData(liverpool->regs); Shader::PushData push_data = MakeUserData(liverpool->regs);
@ -467,12 +469,13 @@ bool Rasterizer::BindResources(const Pipeline* pipeline) {
BindBuffers(*stage, binding, push_data); BindBuffers(*stage, binding, push_data);
BindTextures(*stage, binding); BindTextures(*stage, binding);
fault_process_pending |= stage->dma_types != Shader::IR::Type::Void; fault_enable |= stage->dma_types != Shader::IR::Type::Void;
} }
pipeline->BindResources(set_writes, buffer_barriers, push_data); pipeline->BindResources(set_writes, buffer_barriers, push_data);
if (fault_process_pending) { if (!fault_process_pending && fault_enable) {
fault_process_pending = true;
// We only use fault buffer for DMA right now. // We only use fault buffer for DMA right now.
// First, import any queued host memory, then sync every mapped // First, import any queued host memory, then sync every mapped
// region that is cached on GPU memory. // region that is cached on GPU memory.