[Mesa-dev] [PATCH v2 13/23] nir/glsl_to_nir: set the bit-size in the result of evaluate_rvalue
Jason Ekstrand
jason at jlekstrand.net
Fri Apr 1 20:45:21 UTC 2016
On Thu, Mar 31, 2016 at 3:00 AM, Samuel Iglesias Gonsálvez <
siglesias at igalia.com> wrote:
> From: Iago Toral Quiroga <itoral at igalia.com>
>
> Found while testing UBO loads in scenarios like this:
>
> (assign (x) (var_ref vec_ctor)
> (expression float d2f
> (expression double ubo_load (constant uint (0)) (constant uint
> (0)))))
>
> Without this patch, the src expression of d2f would be evaluated to a
> bitsize
> of 32, which is not correct and would hit an assert in nir_validate.
> ---
> src/compiler/nir/glsl_to_nir.cpp | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/src/compiler/nir/glsl_to_nir.cpp
> b/src/compiler/nir/glsl_to_nir.cpp
> index c77b430..8c75843 100644
> --- a/src/compiler/nir/glsl_to_nir.cpp
> +++ b/src/compiler/nir/glsl_to_nir.cpp
> @@ -1190,6 +1190,7 @@ nir_visitor::evaluate_rvalue(ir_rvalue* ir)
> load_instr->dest.ssa.bit_size =
> glsl_get_bit_size(ir->type->base_type);
> }
>
> + this->result->bit_size = glsl_get_bit_size(ir->type->base_type);
>
I don't think this is the correct solution. Make everything 32-bit and
then stomp it various places to fix bugs. We need to make every instance
if init_ssa_dest do the right thing (I would recommend doing a full
audit). In particular, add_instr probably needs a bit_size parameter.
> return this->result;
> }
>
> --
> 2.5.0
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20160401/c78c9d6a/attachment-0001.html>
More information about the mesa-dev
mailing list