v3d: Fix image_load_store clamping of signed integer stores.
authorEric Anholt <eric@anholt.net>
Wed, 30 Jan 2019 19:17:35 +0000 (11:17 -0800)
committerEric Anholt <eric@anholt.net>
Thu, 31 Jan 2019 16:39:40 +0000 (08:39 -0800)
This was copy-and-paste fail, that oddly showed up in the CTS's
reinterprets of r32f, rgba8, and srgba8 to rgba8i, but not r32ui and r32i
to rgba8i or reinterprets to other signed int formats.

Fixes: 6281f26f064a ("v3d: Add support for shader_image_load_store.")
src/broadcom/compiler/v3d_nir_lower_image_load_store.c

index e74206b394912542a2e7ebc7517860dc3c8ba479..2aa3cbad4956ada5a0b620c9cbddd27c2683dcae 100644 (file)
@@ -156,7 +156,7 @@ pack_sint(nir_builder *b, nir_ssa_def *color, const unsigned *bits,
           int num_components)
 {
         color = nir_channels(b, color, (1 << num_components) - 1);
-        color = nir_format_clamp_uint(b, color, bits);
+        color = nir_format_clamp_sint(b, color, bits);
         return pack_bits(b, color, bits, num_components, true);
 }