summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i965/brw_tcs.c
diff options
context:
space:
mode:
authorKenneth Graunke <kenneth@whitecape.org>2016-06-01 00:08:55 -0700
committerKenneth Graunke <kenneth@whitecape.org>2016-06-15 12:47:37 -0700
commitc319512e16f19bf1f558670981bbb4af510ba9f4 (patch)
treec4cbb1aeacdb25fc37eebf194d9a5be2d865ddf8 /src/mesa/drivers/dri/i965/brw_tcs.c
parent2b867264d2cce59bd65bd3599ff0e3c5439bc9d4 (diff)
downloadexternal_mesa3d-c319512e16f19bf1f558670981bbb4af510ba9f4.zip
external_mesa3d-c319512e16f19bf1f558670981bbb4af510ba9f4.tar.gz
external_mesa3d-c319512e16f19bf1f558670981bbb4af510ba9f4.tar.bz2
i965: Use a uniform for gl_PatchVerticesIn in the TCS on Gen8+.
We still need to recompile the passthrough shader when this value changes, as it also affects the output vertex count. But otherwise, we can eliminate recompiles on Gen8+. We probably want to do this for Gen7 as well, but that requires rewriting the input release code to use a loop, which is a trade-off I'd need to consider in more detail. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Alejandro PiƱeiro <apinheiro@igalia.com> Cc: mesa-stable@lists.freedesktop.org
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_tcs.c')
-rw-r--r--src/mesa/drivers/dri/i965/brw_tcs.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_tcs.c b/src/mesa/drivers/dri/i965/brw_tcs.c
index 7fc8eb4..8a5dd7e 100644
--- a/src/mesa/drivers/dri/i965/brw_tcs.c
+++ b/src/mesa/drivers/dri/i965/brw_tcs.c
@@ -337,7 +337,8 @@ brw_upload_tcs_prog(struct brw_context *brw,
memset(&key, 0, sizeof(key));
- key.input_vertices = ctx->TessCtrlProgram.patch_vertices;
+ if (brw->gen < 8 || !tcp)
+ key.input_vertices = ctx->TessCtrlProgram.patch_vertices;
key.outputs_written = per_vertex_slots;
key.patch_outputs_written = per_patch_slots;
@@ -389,7 +390,8 @@ brw_tcs_precompile(struct gl_context *ctx,
brw_setup_tex_for_precompile(brw, &key.tex, prog);
/* Guess that the input and output patches have the same dimensionality. */
- key.input_vertices = shader_prog->TessCtrl.VerticesOut;
+ if (brw->gen < 8)
+ key.input_vertices = shader_prog->TessCtrl.VerticesOut;
key.tes_primitive_mode =
shader_prog->_LinkedShaders[MESA_SHADER_TESS_EVAL] ?