diff options
author | Eric Anholt <[email protected]> | 2017-11-02 19:04:12 -0700 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2017-11-07 09:40:25 -0800 |
commit | bd24f4890f7f4b4a2c2c6e92163f655904b8709a (patch) | |
tree | 0b294c99daed9db78718c348da095e5eee0f8980 /src/gallium/drivers/vc5/vc5_emit.c | |
parent | 3d5e62dcfaeb2382f42116612e24f7240f1e521d (diff) |
broadcom/vc5: Skip emitting textures that aren't used.
Fixes crashes when ARB_fp uses texture[1] but not 0, as in piglit's
fp-fragment-position.
Diffstat (limited to 'src/gallium/drivers/vc5/vc5_emit.c')
-rw-r--r-- | src/gallium/drivers/vc5/vc5_emit.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/gallium/drivers/vc5/vc5_emit.c b/src/gallium/drivers/vc5/vc5_emit.c index 094d5482954..de4737eeec8 100644 --- a/src/gallium/drivers/vc5/vc5_emit.c +++ b/src/gallium/drivers/vc5/vc5_emit.c @@ -201,8 +201,10 @@ emit_one_texture(struct vc5_context *vc5, struct vc5_texture_stateobj *stage_tex static void emit_textures(struct vc5_context *vc5, struct vc5_texture_stateobj *stage_tex) { - for (int i = 0; i < stage_tex->num_textures; i++) - emit_one_texture(vc5, stage_tex, i); + for (int i = 0; i < stage_tex->num_textures; i++) { + if (stage_tex->textures[i]) + emit_one_texture(vc5, stage_tex, i); + } } void |