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.
This commit is contained in:
Eric Anholt
2018-01-12 13:20:38 -08:00
parent e41e33fdb8
commit ff77ca8a3b
+5 -2
View File
@@ -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));