i965/vec4: Make type_size() return 0 for samplers.
authorKenneth Graunke <kenneth@whitecape.org>
Fri, 12 Sep 2014 05:07:41 +0000 (22:07 -0700)
committerIan Romanick <ian.d.romanick@intel.com>
Fri, 12 Sep 2014 23:35:39 +0000 (16:35 -0700)
The FS backend has always used 0, and the VS backend has always used 1.
I think 1 is just working around other problems, and is incorrect.
Samplers are baked in; nothing uses the UNIFORM register we would
create, and we shouldn't upload any constant values for them.

Fixes ES3-CTS.shaders.struct.uniform.sampler_array_vertex.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Tested-by: Ian Romanick <ian.d.romanick@intel.com>
src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp

index d504e2e382808cc6f192f26cf24dcba8c3509779..473b3c53336374acb51bea4869c30564c736f4e7 100644 (file)
@@ -588,10 +588,10 @@ type_size(const struct glsl_type *type)
       }
       return size;
    case GLSL_TYPE_SAMPLER:
-      /* Samplers take up one slot in UNIFORMS[], but they're baked in
-       * at link time.
+      /* Samplers take up no register space, since they're baked in at
+       * link time.
        */
-      return 1;
+      return 0;
    case GLSL_TYPE_ATOMIC_UINT:
       return 0;
    case GLSL_TYPE_IMAGE: