radv: Use correct num formats to detect whether we should be use 1.0 or 1.
authorBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Fri, 15 Feb 2019 17:02:46 +0000 (18:02 +0100)
committerBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Fri, 15 Feb 2019 20:24:16 +0000 (20:24 +0000)
normalized and scaled formats also return floats.

Fixes: 4b3549c0846 ("radv: reduce the number of loaded channels for vertex input fetches")
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
src/amd/vulkan/radv_nir_to_llvm.c

index f1fc392292ada103cf7aad2b91797d85a3a78f34..b4b09c9fed6cc225bea64aa8a98c72701c919754 100644 (file)
@@ -2118,7 +2118,8 @@ handle_vs_input_decl(struct radv_shader_context *ctx,
                unsigned attrib_format = ctx->options->key.vs.vertex_attribute_formats[attrib_index];
                unsigned data_format = attrib_format & 0x0f;
                unsigned num_format = (attrib_format >> 4) & 0x07;
-               bool is_float = num_format == V_008F0C_BUF_NUM_FORMAT_FLOAT;
+               bool is_float = num_format != V_008F0C_BUF_NUM_FORMAT_UINT &&
+                               num_format != V_008F0C_BUF_NUM_FORMAT_SINT;
 
                if (ctx->options->key.vs.instance_rate_inputs & (1u << attrib_index)) {
                        uint32_t divisor = ctx->options->key.vs.instance_rate_divisors[attrib_index];