[Mesa-dev] [PATCH 27/64] isl/state: Add assertions for buffer surface restrictions
Nanley Chery
nanleychery at gmail.com
Wed Jul 6 16:58:05 UTC 2016
Hi Jason,
On Sat, Jun 11, 2016 at 09:02:42AM -0700, Jason Ekstrand wrote:
> ---
> src/intel/isl/isl_surface_state.c | 11 +++++++++++
> 1 file changed, 11 insertions(+)
>
> diff --git a/src/intel/isl/isl_surface_state.c b/src/intel/isl/isl_surface_state.c
> index 8f223d1..ca13175 100644
> --- a/src/intel/isl/isl_surface_state.c
> +++ b/src/intel/isl/isl_surface_state.c
> @@ -416,6 +416,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));
I just ran into this assertion while running a crucible test. It
seems to be incorrect.
According to the PRMs, the number of elements for raw bufffer
surfaces range from 1 to 2^30. Shouldn't the 1ull be left-shifted
by 30 instead of 31?
(Note: adjusting the shift amount shouldn't fix the test.)
- Nanley
> + 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,
> --
> 2.5.0.400.gff86faf
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
More information about the mesa-dev
mailing list