diff options
| author | 2021-05-21 01:12:58 -0400 | |
|---|---|---|
| committer | 2021-07-22 21:51:35 -0400 | |
| commit | faf4cd72c556421966782cece604b64fbafa5714 (patch) | |
| tree | cb279ca5a0b2fa96b4a6de5262b05c9cf3374f83 /src/shader_recompiler/backend/glsl | |
| parent | glsl: Fix "reg" allocing (diff) | |
| download | yuzu-faf4cd72c556421966782cece604b64fbafa5714.tar.gz yuzu-faf4cd72c556421966782cece604b64fbafa5714.tar.xz yuzu-faf4cd72c556421966782cece604b64fbafa5714.zip | |
glsl: Fix program linking and cbuf
Diffstat (limited to 'src/shader_recompiler/backend/glsl')
| -rw-r--r-- | src/shader_recompiler/backend/glsl/emit_context.cpp | 4 | ||||
| -rw-r--r-- | src/shader_recompiler/backend/glsl/emit_glsl_context_get_set.cpp | 4 |
2 files changed, 5 insertions, 3 deletions
diff --git a/src/shader_recompiler/backend/glsl/emit_context.cpp b/src/shader_recompiler/backend/glsl/emit_context.cpp index b0e46cc07..8eea6344f 100644 --- a/src/shader_recompiler/backend/glsl/emit_context.cpp +++ b/src/shader_recompiler/backend/glsl/emit_context.cpp | |||
| @@ -29,8 +29,8 @@ void EmitContext::DefineConstantBuffers() { | |||
| 29 | } | 29 | } |
| 30 | u32 binding{}; | 30 | u32 binding{}; |
| 31 | for (const auto& desc : info.constant_buffer_descriptors) { | 31 | for (const auto& desc : info.constant_buffer_descriptors) { |
| 32 | Add("layout(std140,binding={}) uniform cbuf_{}{{uint cbuf{}[];}};", binding, binding, | 32 | Add("layout(std140,binding={}) uniform cbuf_{}{{vec4 cbuf{}[{}];}};", binding, binding, |
| 33 | desc.index, desc.count); | 33 | desc.index, 4 * 1024); |
| 34 | ++binding; | 34 | ++binding; |
| 35 | } | 35 | } |
| 36 | } | 36 | } |
diff --git a/src/shader_recompiler/backend/glsl/emit_glsl_context_get_set.cpp b/src/shader_recompiler/backend/glsl/emit_glsl_context_get_set.cpp index e45dfa42e..73f0faf35 100644 --- a/src/shader_recompiler/backend/glsl/emit_glsl_context_get_set.cpp +++ b/src/shader_recompiler/backend/glsl/emit_glsl_context_get_set.cpp | |||
| @@ -32,7 +32,9 @@ void EmitGetCbufS16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] const IR | |||
| 32 | 32 | ||
| 33 | void EmitGetCbufU32(EmitContext& ctx, IR::Inst* inst, const IR::Value& binding, | 33 | void EmitGetCbufU32(EmitContext& ctx, IR::Inst* inst, const IR::Value& binding, |
| 34 | const IR::Value& offset) { | 34 | const IR::Value& offset) { |
| 35 | ctx.Add("uint {}=cbuf{}[{}];", *inst, binding.U32(), offset.U32()); | 35 | const auto u32_offset{offset.U32()}; |
| 36 | ctx.Add("uint {}=floatBitsToUint(cbuf{}[{}][{}]);", *inst, binding.U32(), u32_offset / 16, | ||
| 37 | (u32_offset / 4) % 4); | ||
| 36 | } | 38 | } |
| 37 | 39 | ||
| 38 | void EmitGetCbufF32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] const IR::Value& binding, | 40 | void EmitGetCbufF32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] const IR::Value& binding, |