mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-04 22:49:13 +02:00
llvmpipe: fix crash when doing FB fetch + gl_FragDepth write in one shader
Reproducible by piglit test from this MR: https://gitlab.freedesktop.org/mesa/piglit/-/merge_requests/576 Signed-off-by: Pavel Asyutchenko <sventeam@yandex.ru> Reviewed-by: Dave Airlie <airlied@redhat.com> Cc: mesa-stable Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12705>
This commit is contained in:
parent
48499a8d44
commit
7ffb152276
3 changed files with 8 additions and 5 deletions
|
|
@ -473,7 +473,7 @@ static void emit_load_var(struct lp_build_nir_context *bld_base,
|
|||
break;
|
||||
case nir_var_shader_out:
|
||||
if (bld->fs_iface && bld->fs_iface->fb_fetch) {
|
||||
bld->fs_iface->fb_fetch(bld->fs_iface, &bld_base->base, var->data.driver_location, result);
|
||||
bld->fs_iface->fb_fetch(bld->fs_iface, &bld_base->base, var->data.location, result);
|
||||
return;
|
||||
}
|
||||
for (unsigned i = 0; i < num_components; i++) {
|
||||
|
|
|
|||
|
|
@ -258,7 +258,7 @@ struct lp_build_fs_iface {
|
|||
|
||||
void (*fb_fetch)(const struct lp_build_fs_iface *iface,
|
||||
struct lp_build_context *bld,
|
||||
unsigned cbuf,
|
||||
int location,
|
||||
LLVMValueRef result[4]);
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -452,10 +452,13 @@ static LLVMValueRef fs_interp(const struct lp_build_fs_iface *iface,
|
|||
}
|
||||
|
||||
static void fs_fb_fetch(const struct lp_build_fs_iface *iface,
|
||||
struct lp_build_context *bld,
|
||||
unsigned cbuf,
|
||||
LLVMValueRef result[4])
|
||||
struct lp_build_context *bld,
|
||||
int location,
|
||||
LLVMValueRef result[4])
|
||||
{
|
||||
assert(location >= FRAG_RESULT_DATA0 && location <= FRAG_RESULT_DATA7);
|
||||
const int cbuf = location - FRAG_RESULT_DATA0;
|
||||
|
||||
struct lp_build_fs_llvm_iface *fs_iface = (struct lp_build_fs_llvm_iface *)iface;
|
||||
struct gallivm_state *gallivm = bld->gallivm;
|
||||
LLVMBuilderRef builder = gallivm->builder;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue