asahi: Fix type confusion for fragment shader keys

We can't attempt to access the fs union member if this is not a FS.
That worked so far since there wasn't a VS shader key at all, but we're
about to introduce one.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23998>
This commit is contained in:
Asahi Lina
2023-06-28 19:10:41 +09:00
committed by Marge Bot
parent 90834353a1
commit 4a65b4bb14

View File

@@ -2455,9 +2455,7 @@ agx_compile_shader_nir(nir_shader *nir, struct agx_shader_key *key,
* Note: when epilogs are used, special handling is required since the sample
* count is dynamic when the main fragment shader is compiled.
*/
if (key->fs.nr_samples) {
assert(nir->info.stage == MESA_SHADER_FRAGMENT);
if (nir->info.stage == MESA_SHADER_FRAGMENT && key->fs.nr_samples) {
if (agx_nir_lower_sample_mask(nir, key->fs.nr_samples)) {
/* Clean up ixor(bcsel) patterns created from sample mask lowering.
* If this succeeds, we'll have expressions to constant fold to get the