radv: bitcast 16-bit outputs to integers
authorRhys Perry <pendingchaos02@gmail.com>
Thu, 6 Dec 2018 12:10:41 +0000 (12:10 +0000)
committerRhys Perry <pendingchaos02@gmail.com>
Tue, 19 Feb 2019 11:03:18 +0000 (11:03 +0000)
16-bit outputs are stored as 16-bit floats in the outputs array, so they
have to be bitcast.

Fixes: b722b29f10d ('radv: add support for 16bit input/output')
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
src/amd/vulkan/radv_nir_to_llvm.c

index ec11f6e729e9c96c302781d26e1baac9f50be3ae..ba355fbf6d78e0757ed698a003b1721babbdb8ab 100644 (file)
@@ -2507,7 +2507,7 @@ si_llvm_init_export_args(struct radv_shader_context *ctx,
                        if (is_16bit) {
                                for (unsigned chan = 0; chan < 4; chan++)
                                        values[chan] = LLVMBuildZExt(ctx->ac.builder,
-                                                                     values[chan],
+                                                                     ac_to_integer(&ctx->ac, values[chan]),
                                                                      ctx->ac.i32, "");
                        }
                        break;
@@ -2518,7 +2518,7 @@ si_llvm_init_export_args(struct radv_shader_context *ctx,
                        if (is_16bit) {
                                for (unsigned chan = 0; chan < 4; chan++)
                                        values[chan] = LLVMBuildSExt(ctx->ac.builder,
-                                                                     values[chan],
+                                                                     ac_to_integer(&ctx->ac, values[chan]),
                                                                      ctx->ac.i32, "");
                        }
                        break;