aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMike Blumenkrantz <[email protected]>2020-06-17 15:06:27 -0400
committerMarge Bot <[email protected]>2020-07-13 21:13:45 +0000
commitd4f4546ada7417b0164ceb4f93a652a41438b15b (patch)
treea021f166635d6d9bf387b27f7d4bdfcff22022ae /src
parent359c9384837f332edb3140f43675c761341b8bcd (diff)
zink: use type of src[0] for ntv store and load ops
in some cases (e.g., gl_ClipDistance) the nir_variable type doesn't match the needed destination type, so we can simplify this code to just use the destination type fixes [email protected]@execution@interpolation@interpolation-none-gl_backcolor-smooth-vertex Reviewed-by: Erik Faye-Lund <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5852>
Diffstat (limited to 'src')
-rw-r--r--src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c b/src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c
index b80f09ccccd..af8cb2d68d6 100644
--- a/src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c
+++ b/src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c
@@ -1586,9 +1586,8 @@ emit_load_deref(struct ntv_context *ctx, nir_intrinsic_instr *intr)
{
SpvId ptr = get_src(ctx, intr->src);
- nir_variable *var = nir_intrinsic_get_var(intr, 0);
SpvId result = spirv_builder_emit_load(&ctx->builder,
- get_glsl_type(ctx, var->type),
+ get_glsl_type(ctx, nir_src_as_deref(intr->src[0])->type),
ptr);
unsigned num_components = nir_dest_num_components(intr->dest);
unsigned bit_size = nir_dest_bit_size(intr->dest);
@@ -1602,8 +1601,7 @@ emit_store_deref(struct ntv_context *ctx, nir_intrinsic_instr *intr)
SpvId ptr = get_src(ctx, &intr->src[0]);
SpvId src = get_src(ctx, &intr->src[1]);
- nir_variable *var = nir_intrinsic_get_var(intr, 0);
- SpvId type = get_glsl_type(ctx, glsl_without_array(var->type));
+ SpvId type = get_glsl_type(ctx, nir_src_as_deref(intr->src[0])->type);
SpvId result = emit_bitcast(ctx, type, src);
spirv_builder_emit_store(&ctx->builder, ptr, result);
}