radv/llvm: fix enabled_channels for compressed exports
authorRhys Perry <pendingchaos02@gmail.com>
Thu, 11 Mar 2021 11:40:51 +0000 (11:40 +0000)
committerRhys Perry <pendingchaos02@gmail.com>
Thu, 11 Mar 2021 13:54:18 +0000 (13:54 +0000)
The old values seemed to work fine, but the ISA docs recommend 0x0,0x3,0xc
and 0xf:

COMPR==1: export half-dword enable. Valid values are: 0x0,3,c,f
[0] enables VSRC0 : R,G from one VGPR (R in low bits, G high)
[2] enables VSRC1 : B,A from one VGPR (B in low bits, A high)

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9459>

src/amd/vulkan/radv_nir_to_llvm.c

index b2dec61..3aa646c 100644 (file)
@@ -1433,7 +1433,7 @@ si_llvm_init_export_args(struct radv_shader_context *ctx,
                        break;
 
                case V_028714_SPI_SHADER_FP16_ABGR:
-                       args->enabled_channels = 0x5;
+                       args->enabled_channels = 0xf;
                        packf = ac_build_cvt_pkrtz_f16;
                        if (is_16bit) {
                                for (unsigned chan = 0; chan < 4; chan++)
@@ -1444,17 +1444,17 @@ si_llvm_init_export_args(struct radv_shader_context *ctx,
                        break;
 
                case V_028714_SPI_SHADER_UNORM16_ABGR:
-                       args->enabled_channels = 0x5;
+                       args->enabled_channels = 0xf;
                        packf = ac_build_cvt_pknorm_u16;
                        break;
 
                case V_028714_SPI_SHADER_SNORM16_ABGR:
-                       args->enabled_channels = 0x5;
+                       args->enabled_channels = 0xf;
                        packf = ac_build_cvt_pknorm_i16;
                        break;
 
                case V_028714_SPI_SHADER_UINT16_ABGR:
-                       args->enabled_channels = 0x5;
+                       args->enabled_channels = 0xf;
                        packi = ac_build_cvt_pk_u16;
                        if (is_16bit) {
                                for (unsigned chan = 0; chan < 4; chan++)
@@ -1465,7 +1465,7 @@ si_llvm_init_export_args(struct radv_shader_context *ctx,
                        break;
 
                case V_028714_SPI_SHADER_SINT16_ABGR:
-                       args->enabled_channels = 0x5;
+                       args->enabled_channels = 0xf;
                        packi = ac_build_cvt_pk_i16;
                        if (is_16bit) {
                                for (unsigned chan = 0; chan < 4; chan++)