isl/state: Add assertions for buffer surface restrictions

Acked-by: Chad Versace <chad.versace@intel.com>
Cc: "12.0" <mesa-stable@lists.freedesktop.org>
This commit is contained in:
Jason Ekstrand 2016-06-09 18:48:07 -07:00
parent ce24097abe
commit 4061fde66e

View file

@ -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,