projects
/
mesa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
31ce84a
)
vc4: Avoid a null-deref if a sampler index isn't used.
author
Eric Anholt
<eric@anholt.net>
Mon, 18 Aug 2014 22:50:48 +0000
(15:50 -0700)
committer
Eric Anholt
<eric@anholt.net>
Tue, 19 Aug 2014 15:47:13 +0000
(08:47 -0700)
Part of fixing ARB_fragment_program/sparse-samplers
src/gallium/drivers/vc4/vc4_program.c
patch
|
blob
|
history
diff --git
a/src/gallium/drivers/vc4/vc4_program.c
b/src/gallium/drivers/vc4/vc4_program.c
index 20f7a4489dc20ce5ea758f96d57a4a055bbf9c79..fa598473aabd14ea5871f2dc8a19290cac6be419 100644
(file)
--- a/
src/gallium/drivers/vc4/vc4_program.c
+++ b/
src/gallium/drivers/vc4/vc4_program.c
@@
-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;
+ }
}
}