mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-06 13:48:06 +02:00
gallivm: handle texture arrays in non-fragment shaders with lod.
We have to unwind the lod into the scalar path correctly. Fixes a crash with renderdoc demo Fixes:e168d148d7("gallivm/nir: handle non-uniform texture offsets") Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10676> (cherry picked from commit83a05caaf2)
This commit is contained in:
parent
4da22b39e7
commit
92bb5b148c
2 changed files with 5 additions and 3 deletions
|
|
@ -1300,7 +1300,7 @@
|
|||
"description": "gallivm: handle texture arrays in non-fragment shaders with lod.",
|
||||
"nominated": true,
|
||||
"nomination_type": 1,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"master_sha": null,
|
||||
"because_sha": "e168d148d76d780eda6f9aaa6c66608c4df3096c"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -1421,10 +1421,10 @@ static void emit_tex(struct lp_build_nir_context *bld_base,
|
|||
LLVMGetUndef(bld_base->base.vec_type),
|
||||
LLVMGetUndef(bld_base->base.vec_type),
|
||||
LLVMGetUndef(bld_base->base.vec_type) };
|
||||
LLVMValueRef texel[4], orig_offset;
|
||||
LLVMValueRef texel[4], orig_offset, orig_lod;
|
||||
unsigned i;
|
||||
orig_texel_ptr = params->texel;
|
||||
|
||||
orig_lod = params->lod;
|
||||
for (i = 0; i < 5; i++) {
|
||||
coords[i] = params->coords[i];
|
||||
}
|
||||
|
|
@ -1443,6 +1443,8 @@ static void emit_tex(struct lp_build_nir_context *bld_base,
|
|||
idx, "");
|
||||
params->type = lp_elem_type(bld_base->base.type);
|
||||
|
||||
if (orig_lod)
|
||||
params->lod = LLVMBuildExtractElement(gallivm->builder, orig_lod, idx, "");
|
||||
params->texel = texel;
|
||||
bld->sampler->emit_tex_sample(bld->sampler,
|
||||
gallivm,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue