Commit fef58979 authored by Roland Scheidegger's avatar Roland Scheidegger

st/mesa: use vertex id lowering according to pipe cap bit.

Tested with llvmpipe by setting the cap bit temporarily, seems to work,
though no driver requests it for now.
parent 97dc3d82
......@@ -674,6 +674,10 @@ void st_init_extensions(struct pipe_screen *screen,
consts->NativeIntegers = GL_TRUE;
consts->MaxClipPlanes = 8;
if (screen->get_param(screen, PIPE_CAP_VERTEXID_NOBASE)) {
consts->VertexID_is_zero_based = GL_TRUE;
}
/* Extensions that either depend on GLSL 1.30 or are a subset thereof. */
extensions->ARB_conservative_depth = GL_TRUE;
extensions->ARB_shading_language_packing = GL_TRUE;
......
......@@ -4195,8 +4195,8 @@ const unsigned _mesa_sysval_to_semantic[SYSTEM_VALUE_MAX] = {
*/
TGSI_SEMANTIC_VERTEXID,
TGSI_SEMANTIC_INSTANCEID,
0,
0,
TGSI_SEMANTIC_VERTEXID_NOBASE,
TGSI_SEMANTIC_BASEVERTEX,
/* Geometry shader
*/
......@@ -4907,6 +4907,10 @@ st_translate_program(
TGSI_SEMANTIC_SAMPLEMASK);
assert(_mesa_sysval_to_semantic[SYSTEM_VALUE_INVOCATION_ID] ==
TGSI_SEMANTIC_INVOCATIONID);
assert(_mesa_sysval_to_semantic[SYSTEM_VALUE_VERTEX_ID_ZERO_BASE] ==
TGSI_SEMANTIC_VERTEXID_NOBASE);
assert(_mesa_sysval_to_semantic[SYSTEM_VALUE_BASE_VERTEX] ==
TGSI_SEMANTIC_BASEVERTEX);
t = CALLOC_STRUCT(st_translate);
if (!t) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment