[Mesa-dev] [PATCH v2 29/31] glsl: do not count bindless samplers/images when linking uniforms

Nicolai Hähnle nhaehnle at gmail.com
Wed Apr 26 08:05:17 UTC 2017


On 24.04.2017 12:36, Samuel Pitoiset wrote:
> The ARB_bindless_texture spec says:
>
>     "Modify Section 2.14.8, Shader Execution, p. 122"
>
>     "(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 at gmail.com>

Reviewed-by: Nicolai Hähnle <nicolai.haehnle at amd.com>


> ---
>  src/compiler/glsl/link_uniforms.cpp | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/src/compiler/glsl/link_uniforms.cpp b/src/compiler/glsl/link_uniforms.cpp
> index 3331c85af4..9fb4a1c8f2 100644
> --- a/src/compiler/glsl/link_uniforms.cpp
> +++ b/src/compiler/glsl/link_uniforms.cpp
> @@ -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) {
>           /* Old-style (or bound) samplers 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) {
>           /* Old-style (or bound) images are counted as two components as
>            * specified by ARB_bindless_texture. */
>           this->num_shader_images += values / 2;
>


-- 
Lerne, wie die Welt wirklich ist,
Aber vergiss niemals, wie sie sein sollte.


More information about the mesa-dev mailing list