panfrost: Handle NULL samplers

Fixes a NULL dereference in Piglit fp-fragment-position, getting the
test to pass.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13203>
This commit is contained in:
Alyssa Rosenzweig 2021-09-27 20:26:54 -04:00 committed by Marge Bot
parent 53ef20f08d
commit 5536852d60
2 changed files with 5 additions and 4 deletions

View File

@ -1429,8 +1429,11 @@ panfrost_emit_sampler_descriptors(struct panfrost_batch *batch,
SAMPLER);
struct mali_sampler_packed *out = (struct mali_sampler_packed *) T.cpu;
for (unsigned i = 0; i < ctx->sampler_count[stage]; ++i)
out[i] = ctx->samplers[stage][i]->hw;
for (unsigned i = 0; i < ctx->sampler_count[stage]; ++i) {
struct panfrost_sampler_state *st = ctx->samplers[stage][i];
out[i] = st ? st->hw : (struct mali_sampler_packed){0};
}
return T.gpu;
}

View File

@ -86,8 +86,6 @@ spec@arb_es2_compatibility@texwrap formats bordercolor,Fail
spec@arb_es2_compatibility@texwrap formats bordercolor@GL_RGB565- border color only,Fail
spec@arb_es2_compatibility@texwrap formats bordercolor-swizzled,Fail
spec@arb_es2_compatibility@texwrap formats bordercolor-swizzled@GL_RGB565- swizzled- border color only,Fail
spec@arb_fragment_program@fp-fragment-position,Crash
spec@arb_fragment_program@sparse-samplers,Crash
spec@arb_framebuffer_object@arb_framebuffer_object-depth-stencil-blit depth gl_depth32f_stencil8,Fail
spec@arb_framebuffer_object@arb_framebuffer_object-depth-stencil-blit depth_stencil gl_depth32f_stencil8,Fail
spec@arb_framebuffer_object@arb_framebuffer_object-depth-stencil-blit stencil gl_depth32f_stencil8,Fail