Commit 3862bd9d authored by Jesse Natalie's avatar Jesse Natalie Committed by Erik Faye-Lund
Browse files

microsoft/clc: Switch from size_lod intrinsic to just size with lod src

parent 5604c310
...@@ -286,8 +286,7 @@ clc_lower_input_image_deref(nir_builder *b, struct clc_image_lower_context *cont ...@@ -286,8 +286,7 @@ clc_lower_input_image_deref(nir_builder *b, struct clc_image_lower_context *cont
break; break;
} }
case nir_intrinsic_image_deref_size: case nir_intrinsic_image_deref_size: {
case nir_intrinsic_image_deref_size_lod: {
nir_ssa_def *image_deref = NULL; nir_ssa_def *image_deref = NULL;
for (unsigned i = 0; i < IMAGE_UNIFORM_TYPE_COUNT; ++i) { for (unsigned i = 0; i < IMAGE_UNIFORM_TYPE_COUNT; ++i) {
if (uniform_deref_dests[i]) { if (uniform_deref_dests[i]) {
...@@ -314,9 +313,7 @@ clc_lower_input_image_deref(nir_builder *b, struct clc_image_lower_context *cont ...@@ -314,9 +313,7 @@ clc_lower_input_image_deref(nir_builder *b, struct clc_image_lower_context *cont
if (in_var->data.access & ACCESS_NON_WRITEABLE) { if (in_var->data.access & ACCESS_NON_WRITEABLE) {
// Size query on non-readable resource, convert to txs // Size query on non-readable resource, convert to txs
b->cursor = nir_before_instr(&intrinsic->instr); b->cursor = nir_before_instr(&intrinsic->instr);
unsigned num_src = 1; unsigned num_src = 2;
if (intrinsic->intrinsic == nir_intrinsic_image_deref_size_lod)
num_src = 2;
nir_tex_instr *tex = nir_tex_instr_create(b->shader, num_src); nir_tex_instr *tex = nir_tex_instr_create(b->shader, num_src);
tex->op = nir_texop_txs; tex->op = nir_texop_txs;
...@@ -324,10 +321,8 @@ clc_lower_input_image_deref(nir_builder *b, struct clc_image_lower_context *cont ...@@ -324,10 +321,8 @@ clc_lower_input_image_deref(nir_builder *b, struct clc_image_lower_context *cont
tex->sampler_dim = glsl_get_sampler_dim(in_var->type); tex->sampler_dim = glsl_get_sampler_dim(in_var->type);
tex->src[0].src = nir_src_for_ssa(image_deref); tex->src[0].src = nir_src_for_ssa(image_deref);
tex->src[0].src_type = nir_tex_src_texture_deref; tex->src[0].src_type = nir_tex_src_texture_deref;
if (intrinsic->intrinsic == nir_intrinsic_image_deref_size_lod) {
tex->src[1].src = nir_src_for_ssa(intrinsic->src[1].ssa); tex->src[1].src = nir_src_for_ssa(intrinsic->src[1].ssa);
tex->src[1].src_type = nir_tex_src_lod; tex->src[1].src_type = nir_tex_src_lod;
}
tex->dest_type = nir_type_uint; tex->dest_type = nir_type_uint;
nir_ssa_dest_init(&tex->instr, &tex->dest, nir_tex_instr_dest_size(tex), 32, NULL); nir_ssa_dest_init(&tex->instr, &tex->dest, nir_tex_instr_dest_size(tex), 32, NULL);
......
...@@ -2956,12 +2956,9 @@ emit_image_deref_size(struct ntd_context *ctx, nir_intrinsic_instr *intr) ...@@ -2956,12 +2956,9 @@ emit_image_deref_size(struct ntd_context *ctx, nir_intrinsic_instr *intr)
if (!handle) if (!handle)
return false; return false;
const struct dxil_value *lod = get_int32_undef(&ctx->mod); const struct dxil_value *lod = get_src(ctx, &intr->src[1], 0, nir_type_uint);
if (intr->intrinsic == nir_intrinsic_image_deref_size_lod) {
lod = get_src(ctx, &intr->src[1], 0, nir_type_uint);
if (!lod) if (!lod)
return false; return false;
}
struct texop_parameters params = { struct texop_parameters params = {
.tex = handle, .tex = handle,
...@@ -3230,7 +3227,6 @@ emit_intrinsic(struct ntd_context *ctx, nir_intrinsic_instr *intr) ...@@ -3230,7 +3227,6 @@ emit_intrinsic(struct ntd_context *ctx, nir_intrinsic_instr *intr)
case nir_intrinsic_image_deref_store: case nir_intrinsic_image_deref_store:
return emit_image_deref_store(ctx, intr); return emit_image_deref_store(ctx, intr);
case nir_intrinsic_image_deref_size: case nir_intrinsic_image_deref_size:
case nir_intrinsic_image_deref_size_lod:
return emit_image_deref_size(ctx, intr); return emit_image_deref_size(ctx, intr);
case nir_intrinsic_load_num_work_groups: case nir_intrinsic_load_num_work_groups:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment