aboutsummaryrefslogtreecommitdiff
path: root/src/video_core/renderer_vulkan/vk_rasterizer.cpp
diff options
context:
space:
mode:
authorGhost <>2025-07-13 19:27:39 +0200
committercrueter <crueter@eden-emu.dev>2025-07-13 19:27:39 +0200
commitc47f6615d3bda7b3c7d305701ec8af38333aeebf (patch)
tree8d92ffe8d88173b47e568b69cf8f8e5f755f445d /src/video_core/renderer_vulkan/vk_rasterizer.cpp
parent1cd51d65452d79a145cfdfc2b3d2729121184cd9 (diff)
[vk, opengl] Prevent GPU draw call if CBUF binding fails (cbuf0 error handling) (#2)
Add defensive checks to cancel draw calls early if any graphics storage buffer (CBUF) fails to bind properly. - Modified BindGraphicsStorageBuffer to return false on invalid buffer ID., - ConfigureImpl (both OpenGL and Vulkan) now propagates binding failure., - Pipeline::Configure returns false if CBUF binding fails., - PrepareDraw cancels rendering if pipeline configuration fails., This avoids undefined GPU behavior, draw corruption, or crashes caused by uninitialized or invalid constant buffer (CBUF0) access, particularly in games with faulty or missing shader bindings. Eden Collaborator: <edencollaborator@eden-emu.org> Authored-by: CamilleLaVey <camillelavey@eden-emu.org> Signed-off-by: Bix <bix@bixed.xyz> Co-authored-by: Bix <114880614+Bixbr@users.noreply.github.com> Co-authored-by: crueter <crueter@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/2 Co-authored-by: Ghost <> Co-committed-by: Ghost <>
Diffstat (limited to 'src/video_core/renderer_vulkan/vk_rasterizer.cpp')
-rw-r--r--src/video_core/renderer_vulkan/vk_rasterizer.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/video_core/renderer_vulkan/vk_rasterizer.cpp b/src/video_core/renderer_vulkan/vk_rasterizer.cpp
index a2492f1d74..0243693049 100644
--- a/src/video_core/renderer_vulkan/vk_rasterizer.cpp
+++ b/src/video_core/renderer_vulkan/vk_rasterizer.cpp
@@ -226,7 +226,8 @@ void RasterizerVulkan::PrepareDraw(bool is_indexed, Func&& draw_func) {
std::scoped_lock lock{buffer_cache.mutex, texture_cache.mutex};
// update engine as channel may be different.
pipeline->SetEngine(maxwell3d, gpu_memory);
- pipeline->Configure(is_indexed);
+ if (!pipeline->Configure(is_indexed))
+ return;
UpdateDynamicStates();