microsoft/compiler: Fix array-of-array handling for derefs of textures/images

Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14342>
This commit is contained in:
Jesse Natalie 2021-12-30 17:52:11 -08:00 committed by Marge Bot
parent c9719b6d2e
commit a7311ceafe

View file

@ -3609,6 +3609,12 @@ emit_deref(struct ntd_context* ctx, nir_deref_instr* instr)
if (!base || !offset)
return false;
if (glsl_type_is_array(instr->type)) {
offset = dxil_emit_binop(&ctx->mod, DXIL_BINOP_MUL, offset,
dxil_module_get_int32_const(&ctx->mod, glsl_get_aoa_size(instr->type)), 0);
if (!offset)
return false;
}
binding = dxil_emit_binop(&ctx->mod, DXIL_BINOP_ADD, base, offset, 0);
}