zink: Handle aoa derefs of images
Only the index of the inner array was used. cc: mesa-stable Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28250>
This commit is contained in:
committed by
Marge Bot
parent
50a6c5d5fa
commit
995727e575
@@ -79,10 +79,6 @@ spec@!opengl 2.1@polygon-stipple-fs,Fail
|
||||
|
||||
spec@!opengl 3.0@clearbuffer-depth-cs-probe,Fail
|
||||
|
||||
spec@arb_arrays_of_arrays@execution@image_store@basic-imagestore-mixed-const-non-const-uniform-index,Fail
|
||||
spec@arb_arrays_of_arrays@execution@image_store@basic-imagestore-mixed-const-non-const-uniform-index2,Fail
|
||||
spec@arb_arrays_of_arrays@execution@image_store@basic-imagestore-non-const-uniform-index,Fail
|
||||
|
||||
spec@arb_framebuffer_object@fbo-blit-scaled-linear,Fail
|
||||
|
||||
|
||||
|
||||
@@ -142,10 +142,6 @@ spec@!opengl 1.0@rasterpos,Fail
|
||||
spec@!opengl 1.0@rasterpos@glsl_vs_gs_linked,Fail
|
||||
spec@!opengl 1.0@rasterpos@glsl_vs_tes_linked,Fail
|
||||
|
||||
|
||||
spec@arb_arrays_of_arrays@execution@image_store@basic-imagestore-mixed-const-non-const-uniform-index,Fail
|
||||
spec@arb_arrays_of_arrays@execution@image_store@basic-imagestore-mixed-const-non-const-uniform-index2,Fail
|
||||
spec@arb_arrays_of_arrays@execution@image_store@basic-imagestore-non-const-uniform-index,Fail
|
||||
spec@arb_gpu_shader_fp64@execution@conversion@frag-conversion-explicit-dmat2-mat2,Fail
|
||||
spec@arb_gpu_shader_fp64@execution@conversion@frag-conversion-explicit-dmat2x3-mat2x3,Fail
|
||||
spec@arb_gpu_shader_fp64@execution@conversion@frag-conversion-explicit-dmat2x4-mat2x4,Fail
|
||||
|
||||
@@ -13,9 +13,6 @@ glx@extension string sanity,Fail
|
||||
# #6322
|
||||
spec@arb_framebuffer_object@fbo-blit-scaled-linear,Fail
|
||||
|
||||
spec@arb_arrays_of_arrays@execution@image_store@basic-imagestore-mixed-const-non-const-uniform-index2,Fail
|
||||
spec@arb_arrays_of_arrays@execution@image_store@basic-imagestore-mixed-const-non-const-uniform-index,Fail
|
||||
spec@arb_arrays_of_arrays@execution@image_store@basic-imagestore-non-const-uniform-index,Fail
|
||||
spec@arb_bindless_texture@compiler@samplers@arith-bound-sampler-texture2d.frag,Crash
|
||||
|
||||
spec@arb_framebuffer_no_attachments@arb_framebuffer_no_attachments-query,Fail
|
||||
|
||||
@@ -13,10 +13,6 @@ glx@extension string sanity,Fail
|
||||
# #6322
|
||||
spec@arb_framebuffer_object@fbo-blit-scaled-linear,Fail
|
||||
|
||||
|
||||
spec@arb_arrays_of_arrays@execution@image_store@basic-imagestore-mixed-const-non-const-uniform-index2,Fail
|
||||
spec@arb_arrays_of_arrays@execution@image_store@basic-imagestore-mixed-const-non-const-uniform-index,Fail
|
||||
spec@arb_arrays_of_arrays@execution@image_store@basic-imagestore-non-const-uniform-index,Fail
|
||||
spec@arb_bindless_texture@compiler@samplers@arith-bound-sampler-texture2d.frag,Crash
|
||||
|
||||
spec@arb_framebuffer_no_attachments@arb_framebuffer_no_attachments-query,Fail
|
||||
|
||||
@@ -13,9 +13,6 @@ glx@extension string sanity,Fail
|
||||
# #6322
|
||||
spec@arb_framebuffer_object@fbo-blit-scaled-linear,Fail
|
||||
|
||||
spec@arb_arrays_of_arrays@execution@image_store@basic-imagestore-mixed-const-non-const-uniform-index2,Fail
|
||||
spec@arb_arrays_of_arrays@execution@image_store@basic-imagestore-mixed-const-non-const-uniform-index,Fail
|
||||
spec@arb_arrays_of_arrays@execution@image_store@basic-imagestore-non-const-uniform-index,Fail
|
||||
spec@arb_bindless_texture@compiler@samplers@arith-bound-sampler-texture2d.frag,Crash
|
||||
|
||||
spec@arb_framebuffer_no_attachments@arb_framebuffer_no_attachments-query,Fail
|
||||
|
||||
@@ -13,9 +13,6 @@ glx@extension string sanity,Fail
|
||||
# #6322
|
||||
spec@arb_framebuffer_object@fbo-blit-scaled-linear,Fail
|
||||
|
||||
spec@arb_arrays_of_arrays@execution@image_store@basic-imagestore-mixed-const-non-const-uniform-index2,Fail
|
||||
spec@arb_arrays_of_arrays@execution@image_store@basic-imagestore-mixed-const-non-const-uniform-index,Fail
|
||||
spec@arb_arrays_of_arrays@execution@image_store@basic-imagestore-non-const-uniform-index,Fail
|
||||
spec@arb_bindless_texture@compiler@samplers@arith-bound-sampler-texture2d.frag,Crash
|
||||
|
||||
spec@arb_framebuffer_no_attachments@arb_framebuffer_no_attachments-query,Fail
|
||||
|
||||
@@ -117,9 +117,6 @@ spec@!opengl 3.2@gl-3.2-adj-prims line cull-front pv-first,Fail
|
||||
spec@!opengl 3.2@gl-3.2-adj-prims pv-first,Fail
|
||||
spec@!opengl 3.2@minmax,Fail
|
||||
spec@!opengl 3.3@minmax,Fail
|
||||
spec@arb_arrays_of_arrays@execution@image_store@basic-imagestore-mixed-const-non-const-uniform-index,Fail
|
||||
spec@arb_arrays_of_arrays@execution@image_store@basic-imagestore-mixed-const-non-const-uniform-index2,Fail
|
||||
spec@arb_arrays_of_arrays@execution@image_store@basic-imagestore-non-const-uniform-index,Fail
|
||||
spec@arb_bindless_texture@compiler@samplers@arith-bound-sampler-texture2d.frag,Crash
|
||||
spec@arb_framebuffer_object@fbo-blit-scaled-linear,Fail
|
||||
spec@arb_gpu_shader5@arb_gpu_shader5-interpolateatsample-dynamically-nonuniform,Fail
|
||||
|
||||
@@ -3981,8 +3981,11 @@ emit_deref_array(struct ntv_context *ctx, nir_deref_instr *deref)
|
||||
}
|
||||
|
||||
SpvStorageClass storage_class = get_storage_class(var);
|
||||
SpvId base, type;
|
||||
SpvId type;
|
||||
nir_alu_type atype = nir_type_uint;
|
||||
|
||||
SpvId base = get_src(ctx, &deref->parent, &atype);
|
||||
|
||||
switch (var->data.mode) {
|
||||
|
||||
case nir_var_mem_ubo:
|
||||
@@ -4024,6 +4027,26 @@ emit_deref_array(struct ntv_context *ctx, nir_deref_instr *deref)
|
||||
if (itype == nir_type_float)
|
||||
index = emit_bitcast(ctx, get_uvec_type(ctx, 32, 1), index);
|
||||
|
||||
if (var->data.mode == nir_var_uniform || var->data.mode == nir_var_image) {
|
||||
nir_deref_instr *aoa_deref = nir_src_as_deref(deref->parent);
|
||||
uint32_t inner_stride = glsl_array_size(aoa_deref->type);
|
||||
|
||||
while (aoa_deref->deref_type != nir_deref_type_var) {
|
||||
assert(aoa_deref->deref_type == nir_deref_type_array);
|
||||
|
||||
SpvId aoa_index = get_src(ctx, &aoa_deref->arr.index, &itype);
|
||||
if (itype == nir_type_float)
|
||||
aoa_index = emit_bitcast(ctx, get_uvec_type(ctx, 32, 1), aoa_index);
|
||||
|
||||
aoa_deref = nir_src_as_deref(aoa_deref->parent);
|
||||
|
||||
uint32_t stride = glsl_get_aoa_size(aoa_deref->type) / inner_stride;
|
||||
aoa_index = emit_binop(ctx, SpvOpIMul, get_uvec_type(ctx, 32, 1), aoa_index,
|
||||
emit_uint_const(ctx, 32, stride));
|
||||
index = emit_binop(ctx, SpvOpIAdd, get_uvec_type(ctx, 32, 1), index, aoa_index);
|
||||
}
|
||||
}
|
||||
|
||||
SpvId ptr_type = spirv_builder_type_pointer(&ctx->builder,
|
||||
storage_class,
|
||||
type);
|
||||
|
||||
Reference in New Issue
Block a user