mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-04-23 00:50:36 +02:00
vc4: Avoid a null-deref if a sampler index isn't used.
Part of fixing ARB_fragment_program/sparse-samplers
This commit is contained in:
parent
31ce84a81f
commit
c8097afe29
1 changed files with 5 additions and 2 deletions
|
|
@ -1270,8 +1270,11 @@ static void
|
|||
vc4_setup_shared_key(struct vc4_key *key, struct vc4_texture_stateobj *texstate)
|
||||
{
|
||||
for (int i = 0; i < texstate->num_textures; i++) {
|
||||
struct pipe_resource *prsc = texstate->textures[i]->texture;
|
||||
key->tex_format[i] = prsc->format;
|
||||
struct pipe_sampler_view *sampler = texstate->textures[i];
|
||||
if (sampler) {
|
||||
struct pipe_resource *prsc = sampler->texture;
|
||||
key->tex_format[i] = prsc->format;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue