[Mesa-dev] [PATCH v2 16/31] glsl: allow bindless samplers/images as vertex shader inputs

Nicolai Hähnle nhaehnle at gmail.com
Wed Apr 26 07:36:09 UTC 2017


On 24.04.2017 12:35, Samuel Pitoiset wrote:
> The ARB_bindless_texture spec says:
>
>    "Modify Section 4.3.4, Inputs, p. 34"
>
>    "(modify third paragraph of the section to allow sampler and
>     image types) ...  Vertex shader inputs can only be float,
>     single-precision floating-point scalars, single-precision
>     floating-point vectors, matrices, signed and unsigned integers
>     and integer vectors, sampler and image types."
>
> Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>

Patches 14-16:

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

> ---
>  src/compiler/glsl/ast_to_hir.cpp | 16 ++++++++++++++++
>  1 file changed, 16 insertions(+)
>
> diff --git a/src/compiler/glsl/ast_to_hir.cpp b/src/compiler/glsl/ast_to_hir.cpp
> index 423a6b98c1..02f7d5f71c 100644
> --- a/src/compiler/glsl/ast_to_hir.cpp
> +++ b/src/compiler/glsl/ast_to_hir.cpp
> @@ -5034,6 +5034,16 @@ ast_declarator_list::hir(exec_list *instructions,
>               *    vectors, matrices, signed and unsigned integers and integer
>               *    vectors. Vertex shader inputs cannot be arrays or
>               *    structures."
> +             *
> +             * The ARB_bindless_texture spec says:
> +             *
> +             *    "Modify Section 4.3.4, Inputs, p. 34"
> +             *
> +             *    "(modify third paragraph of the section to allow sampler and
> +             *     image types) ...  Vertex shader inputs can only be float,
> +             *     single-precision floating-point scalars, single-precision
> +             *     floating-point vectors, matrices, signed and unsigned
> +             *     integers and integer vectors, sampler and image types."
>               */
>              const glsl_type *check_type = var->type->without_array();
>
> @@ -5050,6 +5060,12 @@ ast_declarator_list::hir(exec_list *instructions,
>              case GLSL_TYPE_DOUBLE:
>                 if (check_type->is_double() && (state->is_version(410, 0) || state->ARB_vertex_attrib_64bit_enable))
>                    break;
> +            case GLSL_TYPE_SAMPLER:
> +               if (check_type->is_sampler() && state->has_bindless())
> +                  break;
> +            case GLSL_TYPE_IMAGE:
> +               if (check_type->is_image() && state->has_bindless())
> +                  break;
>              /* FALLTHROUGH */
>              default:
>                 _mesa_glsl_error(& loc, state,
>


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


More information about the mesa-dev mailing list