gallium: New cap PIPE_CAP_MAX_VERTEX_ELEMENT_SRC_OFFSET.

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.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
This commit is contained in:
Mathias Fröhlich 2018-09-06 16:13:42 +02:00
parent 240af61494
commit 4569bc6ad0
4 changed files with 12 additions and 0 deletions

View File

@ -323,6 +323,9 @@ u_pipe_screen_get_param_defaults(struct pipe_screen *pscreen,
case PIPE_CAP_MAX_TEXTURE_UPLOAD_MEMORY_BUDGET:
return 0;
case PIPE_CAP_MAX_VERTEX_ELEMENT_SRC_OFFSET:
return 2047;
default:
unreachable("bad PIPE_CAP_*");
}

View File

@ -475,6 +475,8 @@ subpixel precision bias in bits during conservative rasterization.
* ``PIPE_CAP_MAX_TEXTURE_UPLOAD_MEMORY_BUDGET: Maximum recommend memory size
for all active texture uploads combined. This is a performance hint.
0 means no limit.
* ``PIPE_CAP_MAX_VERTEX_ELEMENT_SRC_OFFSET``: The maximum supported value for
of pipe_vertex_element::src_offset.
.. _pipe_capf:

View File

@ -824,6 +824,7 @@ enum pipe_cap
PIPE_CAP_MAX_COMBINED_HW_ATOMIC_COUNTERS,
PIPE_CAP_MAX_COMBINED_HW_ATOMIC_COUNTER_BUFFERS,
PIPE_CAP_MAX_TEXTURE_UPLOAD_MEMORY_BUDGET,
PIPE_CAP_MAX_VERTEX_ELEMENT_SRC_OFFSET,
};
/**

View File

@ -404,6 +404,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 =