summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2016-05-26 00:29:56 -0700
committerKenneth Graunke <[email protected]>2016-05-31 23:09:13 -0700
commita3dc99f3d48df3da1e997d95961747daed0ba6b9 (patch)
tree369ba2b90e88d355b5e21b2f6155b53d46042f14
parentebb81cd6839c5b0f7094e86f846958f10791f9bd (diff)
i965: Fix the passthrough TCS for isolines.
We weren't setting up several of the uniform values for the patch header, so we'd crash when uploading push constants. We at least need to initialize them to zero. We also had the isoline parameters reversed, so it would also render incorrectly (if it didn't crash). Fixes a new Piglit test(*) (isoline-no-tcs), as well as crashes in GL44-CTS.tessellation_shader.single.max_patch_vertices. (*) https://lists.freedesktop.org/archives/piglit/2016-May/019866.html Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Dave Airlie <[email protected]> Cc: [email protected]
-rw-r--r--src/mesa/drivers/dri/i965/brw_tcs.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_tcs.c b/src/mesa/drivers/dri/i965/brw_tcs.c
index 5a514ef21e9..83fc15754e1 100644
--- a/src/mesa/drivers/dri/i965/brw_tcs.c
+++ b/src/mesa/drivers/dri/i965/brw_tcs.c
@@ -225,19 +225,24 @@ brw_codegen_tcs_prog(struct brw_context *brw,
*/
const float **param = (const float **) prog_data.base.base.param;
static float zero = 0.0f;
- for (int i = 0; i < 4; i++) {
- param[7 - i] = &ctx->TessCtrlProgram.patch_default_outer_level[i];
- }
+ for (int i = 0; i < 8; i++)
+ param[i] = &zero;
if (key->tes_primitive_mode == GL_QUADS) {
+ for (int i = 0; i < 4; i++)
+ param[7 - i] = &ctx->TessCtrlProgram.patch_default_outer_level[i];
+
param[3] = &ctx->TessCtrlProgram.patch_default_inner_level[0];
param[2] = &ctx->TessCtrlProgram.patch_default_inner_level[1];
- param[1] = &zero;
- param[0] = &zero;
} else if (key->tes_primitive_mode == GL_TRIANGLES) {
+ for (int i = 0; i < 3; i++)
+ param[7 - i] = &ctx->TessCtrlProgram.patch_default_outer_level[i];
+
param[4] = &ctx->TessCtrlProgram.patch_default_inner_level[0];
- for (int i = 0; i < 4; i++)
- param[i] = &zero;
+ } else {
+ assert(key->tes_primitive_mode == GL_ISOLINES);
+ param[7] = &ctx->TessCtrlProgram.patch_default_outer_level[1];
+ param[6] = &ctx->TessCtrlProgram.patch_default_outer_level[0];
}
}