glsl: do not count bindless samplers/images when linking uniforms
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Wed, 19 Apr 2017 19:57:02 +0000 (21:57 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Sat, 6 May 2017 14:40:19 +0000 (16:40 +0200)
From section 2.14.8 of the ARB_bindless_texture spec:

    "(modify second paragraph, p. 126) ... against the
     MAX_COMBINED_TEXTURE_IMAGE_UNITS limit.  Samplers accessed
     using texture handles (section 3.9.X) are not counted against
     this limit."

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
src/compiler/glsl/link_uniforms.cpp

index f6335b0f9eb50f6cb8798108698c59d23cb0d58c..b34c8706a7f669b3aa8305c5c272223f7eacf8a9 100644 (file)
@@ -339,11 +339,11 @@ private:
       const unsigned values = type->component_slots();
       if (type->contains_subroutine()) {
          this->num_shader_subroutines += values;
-      } else if (type->contains_sampler()) {
+      } else if (type->contains_sampler() && !current_var->data.bindless) {
          /* Samplers (bound or bindless) are counted as two components as
           * specified by ARB_bindless_texture. */
          this->num_shader_samplers += values / 2;
-      } else if (type->contains_image()) {
+      } else if (type->contains_image() && !current_var->data.bindless) {
          /* Images (bound or bindless) are counted as two components as
           * specified by ARB_bindless_texture. */
          this->num_shader_images += values / 2;