glsl: Optionally lower TES gl_PatchVerticesIn to a uniform.

i965 has no special hardware for this, so we need to pass this value in
as a uniform (unless the TES is linked against a TCS, in which case the
linker can just replace this with a constant).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Cc: mesa-stable@lists.freedesktop.org
This commit is contained in:
Kenneth Graunke
2016-05-26 20:21:58 -07:00
parent d794072b3e
commit 0be2105137
4 changed files with 26 additions and 3 deletions

View File

@@ -598,6 +598,13 @@ _mesa_fetch_state(struct gl_context *ctx, const gl_state_index state[],
}
return;
case STATE_TES_PATCH_VERTICES_IN:
if (ctx->TessCtrlProgram._Current)
val[0].i = ctx->TessCtrlProgram._Current->VerticesOut;
else
val[0].i = ctx->TessCtrlProgram.patch_vertices;
return;
/* XXX: make sure new tokens added here are also handled in the
* _mesa_program_state_flags() switch, below.
*/