anv/pipeline: Make the has_push_constants computation more accurate
authorJason Ekstrand <jason.ekstrand@intel.com>
Thu, 22 Oct 2015 04:45:49 +0000 (21:45 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Thu, 22 Oct 2015 04:50:16 +0000 (21:50 -0700)
The computation used to only look for uniforms that weren't samplers.  Now
it also filters out arrays of samplers.

src/vulkan/anv_pipeline.c

index 80f8a4ff76ffcca2fa990503edf0f3cc61597005..f035f5b8f5eaaaaffb3783fa9ee8e3688f769187 100644 (file)
@@ -354,7 +354,11 @@ anv_pipeline_compile(struct anv_pipeline *pipeline,
 
    bool have_push_constants = false;
    nir_foreach_variable(var, &nir->uniforms) {
-      if (!glsl_type_is_sampler(var->type)) {
+      const struct glsl_type *type = var->type;
+      if (glsl_type_is_array(type))
+         type = glsl_get_array_element(type);
+
+      if (!glsl_type_is_sampler(type)) {
          have_push_constants = true;
          break;
       }