Skip to content

Commit

Permalink
GPU/HW: Fix a couple of out-of-order UBO pushes
Browse files Browse the repository at this point in the history
  • Loading branch information
stenzek committed May 28, 2024
1 parent 2eb0085 commit 0397966
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/core/gpu_hw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2387,10 +2387,10 @@ bool GPU_HW::BlitVRAMReplacementTexture(const TextureReplacementTexture* tex, u3
0.0f, 0.0f, static_cast<float>(tex->GetWidth()) / static_cast<float>(m_vram_replacement_texture->GetWidth()),
static_cast<float>(tex->GetHeight()) / static_cast<float>(m_vram_replacement_texture->GetHeight())};

g_gpu_device->PushUniformBuffer(src_rect, sizeof(src_rect));
g_gpu_device->SetTextureSampler(0, m_vram_replacement_texture.get(), g_gpu_device->GetLinearSampler());
g_gpu_device->SetPipeline(m_vram_write_replacement_pipeline.get());
g_gpu_device->SetViewportAndScissor(dst_x, dst_y, width, height);
g_gpu_device->PushUniformBuffer(src_rect, sizeof(src_rect));
g_gpu_device->Draw(3, 0);

RestoreDeviceContext();
Expand Down Expand Up @@ -3460,13 +3460,13 @@ void GPU_HW::DownsampleFramebufferBoxFilter(GPUTexture* source, u32 left, u32 to
source->MakeReadyForSampling();

const u32 uniforms[4] = {left, top, 0u, 0u};
g_gpu_device->PushUniformBuffer(uniforms, sizeof(uniforms));

g_gpu_device->InvalidateRenderTarget(m_downsample_texture.get());
g_gpu_device->SetRenderTarget(m_downsample_texture.get());
g_gpu_device->SetPipeline(m_downsample_first_pass_pipeline.get());
g_gpu_device->SetTextureSampler(0, source, g_gpu_device->GetNearestSampler());
g_gpu_device->SetViewportAndScissor(0, 0, ds_width, ds_height);
g_gpu_device->PushUniformBuffer(uniforms, sizeof(uniforms));
g_gpu_device->Draw(3, 0);

RestoreDeviceContext();
Expand Down

0 comments on commit 0397966

Please sign in to comment.