diff options
author | Eric Anholt <eric@anholt.net> | 2018-01-12 13:20:38 -0800 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2018-01-12 21:58:04 -0800 |
commit | ff77ca8a3b67f6209af5d70711004cd1937bd711 (patch) | |
tree | eb6c3601fbc8fbf96384858829aad92b4f083670 | |
parent | e41e33fdb8737a92c008f8e165cf755bf7ecc78d (diff) |
broadcom/vc5: Fix up channel swizzling for textures on 4.x.
I had 3.x putting swizzling in the texture state only for 16-bit texture
returns, and in the shader for 32-bit. This may be due to having mixed up
the return channel setup on 3.x back before I had moved it into the
compiler. On 4.x, the non-border-color texwrap tests are passing nicely
with both 16 and 32-bit returns with swizzling in the texture state.
-rw-r--r-- | src/gallium/drivers/vc5/vc5_program.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/gallium/drivers/vc5/vc5_program.c b/src/gallium/drivers/vc5/vc5_program.c index 4d74089b81..ddb51b7f02 100644 --- a/src/gallium/drivers/vc5/vc5_program.c +++ b/src/gallium/drivers/vc5/vc5_program.c @@ -275,7 +275,8 @@ vc5_setup_shared_key(struct vc5_context *vc5, struct v3d_key *key, continue; key->tex[i].return_size = - vc5_get_tex_return_size(devinfo, sampler->format, + vc5_get_tex_return_size(devinfo, + sampler->format, sampler_state->compare_mode); /* For 16-bit, we set up the sampler to always return 2 @@ -284,13 +285,15 @@ vc5_setup_shared_key(struct vc5_context *vc5, struct v3d_key *key, */ if (key->tex[i].return_size == 16) { key->tex[i].return_channels = 2; + } else if (devinfo->ver > 40) { + key->tex[i].return_channels = 4; } else { key->tex[i].return_channels = vc5_get_tex_return_channels(devinfo, sampler->format); } - if (key->tex[i].return_size == 32) { + if (key->tex[i].return_size == 32 && devinfo->ver < 40) { memcpy(key->tex[i].swizzle, vc5_sampler->swizzle, sizeof(vc5_sampler->swizzle)); |