nir/spirv: Don't multiply the push constant block size by 4
authorJason Ekstrand <jason.ekstrand@intel.com>
Wed, 13 Jul 2016 18:35:29 +0000 (11:35 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Wed, 13 Jul 2016 18:35:29 +0000 (11:35 -0700)
I have no idea why we were multiplying by 4 before.  The offsets we get
from SPIR-V are in bytes and so is nir->num_uniforms so there's no need to
do any adjustment whatsoever.

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Cc: "12.0" <mesa-stable@lists.freedesktop.org>
src/compiler/spirv/vtn_variables.c

index fe2494ba3b381dc5e7124b9c65051efa8f9fedd0..8b112b016c69f363db507d2d7ff8012497507998 100644 (file)
@@ -1173,7 +1173,7 @@ vtn_handle_variables(struct vtn_builder *b, SpvOp opcode,
       case SpvStorageClassPushConstant:
          var->mode = vtn_variable_mode_push_constant;
          assert(b->shader->num_uniforms == 0);
-         b->shader->num_uniforms = vtn_type_block_size(var->type) * 4;
+         b->shader->num_uniforms = vtn_type_block_size(var->type);
          break;
       case SpvStorageClassInput:
          var->mode = vtn_variable_mode_input;