Looks alright to me, albeit seems a bit weird your hw can have offset of 255 but only max stride of 128 - max offset being larger than max stride doesn't really make a whole lot of sense. (Could you handle stride 255 maybe?)
I think in d3d10 these properties are intrinsically tied together, the max struct size can be 2048, so this dictates both the max stride (2048) as well as the max offset (2047 if it's a 8bit value). Not so coincidentally, these values are also the required minimum values of newer GL versions. Then again there's hw like r600 which can only support 2047 in reality for stride, at least natively... Might even be common that hw uses the same field width for stride as well as offsets... In any case, Reviewed-by: Roland Scheidegger <srol...@vmware.com> Am 06.09.2018 um 16:31 schrieb mathias.froehl...@gmx.net: > From: Mathias Fröhlich <mathias.froehl...@web.de> > > Introduce a new capability for the maximum value of > pipe_vertex_element::src_offset. Initially just every driver > backend returns the value previously set from _mesa_init_constants. > So this shall end up in no functional change. > > Signed-off-by: Mathias Fröhlich <mathias.froehl...@web.de> > --- > src/gallium/auxiliary/util/u_screen.c | 3 +++ > src/gallium/docs/source/screen.rst | 3 +++ > src/gallium/include/pipe/p_defines.h | 1 + > src/mesa/state_tracker/st_extensions.c | 6 ++++++ > 4 files changed, 13 insertions(+) > > diff --git a/src/gallium/auxiliary/util/u_screen.c > b/src/gallium/auxiliary/util/u_screen.c > index c41e28820b..d97c3cf5d9 100644 > --- a/src/gallium/auxiliary/util/u_screen.c > +++ b/src/gallium/auxiliary/util/u_screen.c > @@ -318,6 +318,9 @@ u_pipe_screen_get_param_defaults(struct pipe_screen > *pscreen, > case PIPE_CAP_TEXTURE_MIRROR_CLAMP_TO_EDGE: > return 0; > > + case PIPE_CAP_MAX_VERTEX_ELEMENT_SRC_OFFSET: > + return 2047; > + > default: > unreachable("bad PIPE_CAP_*"); > } > diff --git a/src/gallium/docs/source/screen.rst > b/src/gallium/docs/source/screen.rst > index 93415a5df1..6e5d123107 100644 > --- a/src/gallium/docs/source/screen.rst > +++ b/src/gallium/docs/source/screen.rst > @@ -466,6 +466,9 @@ subpixel precision bias in bits during conservative > rasterization. > * ``PIPE_CAP_MAX_COMBINED_HW_ATOMIC_COUNTER_BUFFERS``: Maximum total number > of > atomic counter buffers. A value of 0 means the sum of all per-shader stage > maximums (see ``PIPE_SHADER_CAP_MAX_HW_ATOMIC_COUNTER_BUFFERS``). > +* ``PIPE_CAP_MAX_VERTEX_ELEMENT_SRC_OFFSET``: The maximum supported value for > + of pipe_vertex_element::src_offset. > + > > .. _pipe_capf: > > diff --git a/src/gallium/include/pipe/p_defines.h > b/src/gallium/include/pipe/p_defines.h > index bdd3f4680f..3a686c4cc3 100644 > --- a/src/gallium/include/pipe/p_defines.h > +++ b/src/gallium/include/pipe/p_defines.h > @@ -821,6 +821,7 @@ enum pipe_cap > PIPE_CAP_MAX_COMBINED_SHADER_BUFFERS, > PIPE_CAP_MAX_COMBINED_HW_ATOMIC_COUNTERS, > PIPE_CAP_MAX_COMBINED_HW_ATOMIC_COUNTER_BUFFERS, > + PIPE_CAP_MAX_VERTEX_ELEMENT_SRC_OFFSET, > }; > > /** > diff --git a/src/mesa/state_tracker/st_extensions.c > b/src/mesa/state_tracker/st_extensions.c > index 244c12595e..43ef6a40f9 100644 > --- a/src/mesa/state_tracker/st_extensions.c > +++ b/src/mesa/state_tracker/st_extensions.c > @@ -403,6 +403,12 @@ void st_init_limits(struct pipe_screen *screen, > c->MaxVertexAttribStride > = screen->get_param(screen, PIPE_CAP_MAX_VERTEX_ATTRIB_STRIDE); > > + /* The value cannot be larger than that since > pipe_vertex_buffer::src_offset > + * is only 16 bits. > + */ > + temp = screen->get_param(screen, PIPE_CAP_MAX_VERTEX_ELEMENT_SRC_OFFSET); > + c->MaxVertexAttribRelativeOffset = MIN2(0xffff, temp); > + > c->StripTextureBorder = GL_TRUE; > > c->GLSLSkipStrictMaxUniformLimitCheck = > _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev