diff options
| author | 2021-06-11 00:18:24 -0300 | |
|---|---|---|
| committer | 2021-07-22 21:51:35 -0400 | |
| commit | 8554a644df7ad909e418f3e96016e95abc55712f (patch) | |
| tree | 2f87cc57dd6adaaff71f925327de324d106a9255 | |
| parent | gl_buffer_cache: Use unorm internal formats for snorm texture buffer views (diff) | |
| download | yuzu-8554a644df7ad909e418f3e96016e95abc55712f.tar.gz yuzu-8554a644df7ad909e418f3e96016e95abc55712f.tar.xz yuzu-8554a644df7ad909e418f3e96016e95abc55712f.zip | |
spirv/convert: Catch more broken signed operations on Nvidia OpenGL
BitCast U32 to S32 before converting to float on drivers with broken
signed operations.
| -rw-r--r-- | src/shader_recompiler/backend/spirv/emit_spirv_convert.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/shader_recompiler/backend/spirv/emit_spirv_convert.cpp b/src/shader_recompiler/backend/spirv/emit_spirv_convert.cpp index fd74e475f..2c4250a0c 100644 --- a/src/shader_recompiler/backend/spirv/emit_spirv_convert.cpp +++ b/src/shader_recompiler/backend/spirv/emit_spirv_convert.cpp | |||
| @@ -205,6 +205,9 @@ Id EmitConvertF32S16(EmitContext& ctx, Id value) { | |||
| 205 | } | 205 | } |
| 206 | 206 | ||
| 207 | Id EmitConvertF32S32(EmitContext& ctx, Id value) { | 207 | Id EmitConvertF32S32(EmitContext& ctx, Id value) { |
| 208 | if (ctx.profile.has_broken_signed_operations) { | ||
| 209 | value = ctx.OpBitcast(ctx.S32[1], value); | ||
| 210 | } | ||
| 208 | return ctx.OpConvertSToF(ctx.F32[1], value); | 211 | return ctx.OpConvertSToF(ctx.F32[1], value); |
| 209 | } | 212 | } |
| 210 | 213 | ||
| @@ -237,6 +240,9 @@ Id EmitConvertF64S16(EmitContext& ctx, Id value) { | |||
| 237 | } | 240 | } |
| 238 | 241 | ||
| 239 | Id EmitConvertF64S32(EmitContext& ctx, Id value) { | 242 | Id EmitConvertF64S32(EmitContext& ctx, Id value) { |
| 243 | if (ctx.profile.has_broken_signed_operations) { | ||
| 244 | value = ctx.OpBitcast(ctx.S32[1], value); | ||
| 245 | } | ||
| 240 | return ctx.OpConvertSToF(ctx.F64[1], value); | 246 | return ctx.OpConvertSToF(ctx.F64[1], value); |
| 241 | } | 247 | } |
| 242 | 248 | ||