[Mesa-dev] [PATCH v2 1/2] glsl: add missing types for buffer images

Ilia Mirkin imirkin at alum.mit.edu
Tue Mar 29 23:07:06 UTC 2016


Tested-by: Ilia Mirkin <imirkin at alum.mit.edu>

Fixes the compilation issues here. Thanks for cleaning up after me :)

On Tue, Mar 29, 2016 at 5:11 PM, Samuel Pitoiset
<samuel.pitoiset at gmail.com> wrote:
> Spotted while trying to run dEQP tests related to
> ARB_shader_image_load_store.
>
> v2: fix index in names array
>
> Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
> Cc: Samuel Iglesias Gonsálvez <siglesias at igalia.com>
> ---
>  src/compiler/glsl/ast_to_hir.cpp | 21 ++++++++++++---------
>  1 file changed, 12 insertions(+), 9 deletions(-)
>
> diff --git a/src/compiler/glsl/ast_to_hir.cpp b/src/compiler/glsl/ast_to_hir.cpp
> index 29a4642..77b4544 100644
> --- a/src/compiler/glsl/ast_to_hir.cpp
> +++ b/src/compiler/glsl/ast_to_hir.cpp
> @@ -2354,10 +2354,11 @@ get_type_name_for_precision_qualifier(const glsl_type *type)
>           }
>           case GLSL_SAMPLER_DIM_BUF: {
>              assert(type->base_type == GLSL_TYPE_SAMPLER);
> -            static const char *const names[4] = {
> -              "samplerBuffer", NULL, NULL, NULL
> +            static const char *const names[8] = {
> +              "samplerBuffer", NULL, NULL, NULL,
> +              "imageBuffer", NULL, NULL, NULL
>              };
> -            return names[type_idx];
> +            return names[offset + type_idx];
>           }
>           case GLSL_SAMPLER_DIM_EXTERNAL: {
>              assert(type->base_type == GLSL_TYPE_SAMPLER);
> @@ -2416,10 +2417,11 @@ get_type_name_for_precision_qualifier(const glsl_type *type)
>           }
>           case GLSL_SAMPLER_DIM_BUF: {
>              assert(type->base_type == GLSL_TYPE_SAMPLER);
> -            static const char *const names[4] = {
> -              "isamplerBuffer", NULL, NULL, NULL
> +            static const char *const names[8] = {
> +              "isamplerBuffer", NULL, NULL, NULL,
> +              "iimageBuffer", NULL, NULL, NULL
>              };
> -            return names[type_idx];
> +            return names[offset + type_idx];
>           }
>           default:
>              unreachable("Unsupported isampler/iimage dimensionality");
> @@ -2471,10 +2473,11 @@ get_type_name_for_precision_qualifier(const glsl_type *type)
>           }
>           case GLSL_SAMPLER_DIM_BUF: {
>              assert(type->base_type == GLSL_TYPE_SAMPLER);
> -            static const char *const names[4] = {
> -              "usamplerBuffer", NULL, NULL, NULL
> +            static const char *const names[8] = {
> +              "usamplerBuffer", NULL, NULL, NULL,
> +              "uimageBuffer", NULL, NULL, NULL
>              };
> -            return names[type_idx];
> +            return names[offset + type_idx];
>           }
>           default:
>              unreachable("Unsupported usampler/uimage dimensionality");
> --
> 2.7.4
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list