summaryrefslogtreecommitdiffstats
path: root/src/intel
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2016-06-09 18:48:07 -0700
committerJason Ekstrand <[email protected]>2016-06-22 12:26:43 -0700
commit4061fde66e9feefa051a02fe258d69fe817e6a8c (patch)
tree8e076123948d19d256d05524b4ab59d888782721 /src/intel
parentce24097abe1427463ac300a686e4c36ea07464fc (diff)
isl/state: Add assertions for buffer surface restrictions
Acked-by: Chad Versace <[email protected]> Cc: "12.0" <[email protected]>
Diffstat (limited to 'src/intel')
-rw-r--r--src/intel/isl/isl_surface_state.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/intel/isl/isl_surface_state.c b/src/intel/isl/isl_surface_state.c
index 15b2fa9cadc..ca5061225f4 100644
--- a/src/intel/isl/isl_surface_state.c
+++ b/src/intel/isl/isl_surface_state.c
@@ -435,6 +435,17 @@ isl_genX(buffer_fill_state_s)(void *state,
{
uint32_t num_elements = info->size / info->stride;
+ if (GEN_GEN >= 7) {
+ if (info->format == ISL_FORMAT_RAW) {
+ assert(num_elements <= (1ull << 31));
+ assert((num_elements & 3) == 0);
+ } else {
+ assert(num_elements <= (1ull << 27));
+ }
+ } else {
+ assert(num_elements <= (1ull << 27));
+ }
+
struct GENX(RENDER_SURFACE_STATE) surface_state = {
.SurfaceType = SURFTYPE_BUFFER,
.SurfaceArray = false,