[Mesa-dev] [PATCH 3/4] glsl/nir: fix variable type for image intrinsics and ubos

Timothy Arceri tarceri at itsqueeze.com
Wed Apr 4 00:29:36 UTC 2018



On 04/04/18 10:13, Jason Ekstrand wrote:
> .
> On Tue, Apr 3, 2018 at 6:21 AM, Karol Herbst <kherbst at redhat.com 
> <mailto:kherbst at redhat.com>> wrote:
> 
>     If the bindless image is passed through a struct we ended up getting the
>     glsl_type of the struct, not the image.
> 
>     variable_referenced points to the declaration of the struct, so it
>     won't work
>     for bindless images. So just drop it.
> 
>     Signed-off-by: Karol Herbst <kherbst at redhat.com
>     <mailto:kherbst at redhat.com>>
>     ---
>       src/compiler/glsl/glsl_to_nir.cpp | 2 +-
>       1 file changed, 1 insertion(+), 1 deletion(-)
> 
>     diff --git a/src/compiler/glsl/glsl_to_nir.cpp
>     b/src/compiler/glsl/glsl_to_nir.cpp
>     index 8e2d96a2361..1fc0cac4736 100644
>     --- a/src/compiler/glsl/glsl_to_nir.cpp
>     +++ b/src/compiler/glsl/glsl_to_nir.cpp
>     @@ -893,7 +893,7 @@ nir_visitor::visit(ir_call *ir)
>                exec_node *param = ir->actual_parameters.get_head();
>                ir_dereference *image = (ir_dereference *)param;
>                const glsl_type *type =
>     -            image->variable_referenced()->type->without_array();
>     +            image->type->without_array();
> 
> 
> Do we still need without_array()?  If that really is the dereferenced 
> type, it should be an image type already.

The struct member type is set in ir.cpp without removing the array:

    this->type = this->record->type->field_type(field);

> 
> 
>                instr->variables[0] = evaluate_deref(&instr->instr, image);
>                param = param->get_next();
>     --
>     2.14.3
> 
>     _______________________________________________
>     mesa-dev mailing list
>     mesa-dev at lists.freedesktop.org <mailto:mesa-dev at lists.freedesktop.org>
>     https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>     <https://lists.freedesktop.org/mailman/listinfo/mesa-dev>
> 
> 
> 
> 
> _______________________________________________
> 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