summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers
diff options
context:
space:
mode:
authorVasily Khoruzhick <[email protected]>2019-08-22 21:17:23 -0700
committerVasily Khoruzhick <[email protected]>2019-08-24 08:17:25 -0700
commitd30a98c89635316bd445264cafb18283a1eb83df (patch)
tree8f44a506ee9b4fc228323ad7cb146b19aa86b660 /src/gallium/drivers
parent8dd195e86570138684910a646e23e70284eacdf2 (diff)
lima/ppir: validate shader outputs
Mali4x0 supports only gl_FragColor. gl_FragDepth is not supported. Check that we don't get anything but gl_FragColor in shader outputs. Reviewed-by: Qiang Yu <[email protected]> Signed-off-by: Vasily Khoruzhick <[email protected]>
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r--src/gallium/drivers/lima/ir/pp/nir.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/gallium/drivers/lima/ir/pp/nir.c b/src/gallium/drivers/lima/ir/pp/nir.c
index 75a09f0d441..831c50b3cd0 100644
--- a/src/gallium/drivers/lima/ir/pp/nir.c
+++ b/src/gallium/drivers/lima/ir/pp/nir.c
@@ -699,6 +699,19 @@ bool ppir_compile_nir(struct lima_fs_shader_state *prog, struct nir_shader *nir,
}
}
+ /* Validate outputs, we support only gl_FragColor */
+ nir_foreach_variable(var, &nir->outputs) {
+ switch (var->data.location) {
+ case FRAG_RESULT_COLOR:
+ case FRAG_RESULT_DATA0:
+ break;
+ default:
+ ppir_error("unsupported output type\n");
+ goto err_out0;
+ break;
+ }
+ }
+
foreach_list_typed(nir_register, reg, node, &func->registers) {
ppir_reg *r = rzalloc(comp, ppir_reg);
if (!r)