aboutsummaryrefslogtreecommitdiffstats
path: root/src/compiler/nir
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2020-03-27 13:08:21 -0500
committerMarge Bot <[email protected]>2020-03-30 15:46:19 +0000
commitfb64954d9dd55b45239c27af122bf60c3962d006 (patch)
tree800264c67a537cd644ef37e9147beac099cfbecc /src/compiler/nir
parent4e80151c5d75bf5d4b67b0791c3eb06515345a83 (diff)
nir: Validate that memory load/store ops work on whole bytes
Reviewed-by: Kenneth Graunke <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4338> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4338>
Diffstat (limited to 'src/compiler/nir')
-rw-r--r--src/compiler/nir/nir_validate.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/compiler/nir/nir_validate.c b/src/compiler/nir/nir_validate.c
index e0da743144a..7ecca048750 100644
--- a/src/compiler/nir/nir_validate.c
+++ b/src/compiler/nir/nir_validate.c
@@ -570,6 +570,33 @@ validate_intrinsic_instr(nir_intrinsic_instr *instr, validate_state *state)
break;
}
+ case nir_intrinsic_load_uniform:
+ case nir_intrinsic_load_ubo:
+ case nir_intrinsic_load_input:
+ case nir_intrinsic_load_per_vertex_input:
+ case nir_intrinsic_load_interpolated_input:
+ case nir_intrinsic_load_ssbo:
+ case nir_intrinsic_load_output:
+ case nir_intrinsic_load_per_vertex_output:
+ case nir_intrinsic_load_shared:
+ case nir_intrinsic_load_push_constant:
+ case nir_intrinsic_load_constant:
+ case nir_intrinsic_load_global:
+ case nir_intrinsic_load_scratch:
+ /* Memory load operations must load at least a byte */
+ validate_assert(state, nir_dest_bit_size(instr->dest) >= 8);
+ break;
+
+ case nir_intrinsic_store_output:
+ case nir_intrinsic_store_per_vertex_output:
+ case nir_intrinsic_store_ssbo:
+ case nir_intrinsic_store_shared:
+ case nir_intrinsic_store_global:
+ case nir_intrinsic_store_scratch:
+ /* Memory store operations must store at least a byte */
+ validate_assert(state, nir_src_bit_size(instr->src[0]) >= 8);
+ break;
+
default:
break;
}