diff options
| author | 2021-12-27 23:59:32 -0500 | |
|---|---|---|
| committer | 2021-12-29 19:03:50 -0500 | |
| commit | b84d429c2ec59e54a89d9d4e34b0df9f22172e8f (patch) | |
| tree | e275b74a6fb2d16219697cbad38925e2e660e058 /src/shader_recompiler/backend/glsl/glsl_emit_context.cpp | |
| parent | emit_glsl_integer: Use negation work around (diff) | |
| download | yuzu-b84d429c2ec59e54a89d9d4e34b0df9f22172e8f.tar.gz yuzu-b84d429c2ec59e54a89d9d4e34b0df9f22172e8f.tar.xz yuzu-b84d429c2ec59e54a89d9d4e34b0df9f22172e8f.zip | |
glsl_context_get_set: Add alternative cbuf type for broken drivers
some drivers have a bug bitwise converting floating point cbuf values to uint variables. This adds a workaround for these drivers to make all cbufs uint and convert to floating point as needed.
Diffstat (limited to 'src/shader_recompiler/backend/glsl/glsl_emit_context.cpp')
| -rw-r--r-- | src/shader_recompiler/backend/glsl/glsl_emit_context.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/shader_recompiler/backend/glsl/glsl_emit_context.cpp b/src/shader_recompiler/backend/glsl/glsl_emit_context.cpp index bc9d2a904..bb7f1a0fd 100644 --- a/src/shader_recompiler/backend/glsl/glsl_emit_context.cpp +++ b/src/shader_recompiler/backend/glsl/glsl_emit_context.cpp | |||
| @@ -428,9 +428,10 @@ void EmitContext::DefineConstantBuffers(Bindings& bindings) { | |||
| 428 | return; | 428 | return; |
| 429 | } | 429 | } |
| 430 | for (const auto& desc : info.constant_buffer_descriptors) { | 430 | for (const auto& desc : info.constant_buffer_descriptors) { |
| 431 | header += fmt::format( | 431 | const auto cbuf_type{profile.has_gl_cbuf_ftou_bug ? "uvec4" : "vec4"}; |
| 432 | "layout(std140,binding={}) uniform {}_cbuf_{}{{vec4 {}_cbuf{}[{}];}};", | 432 | header += fmt::format("layout(std140,binding={}) uniform {}_cbuf_{}{{{} {}_cbuf{}[{}];}};", |
| 433 | bindings.uniform_buffer, stage_name, desc.index, stage_name, desc.index, 4 * 1024); | 433 | bindings.uniform_buffer, stage_name, desc.index, cbuf_type, |
| 434 | stage_name, desc.index, 4 * 1024); | ||
| 434 | bindings.uniform_buffer += desc.count; | 435 | bindings.uniform_buffer += desc.count; |
| 435 | } | 436 | } |
| 436 | } | 437 | } |