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 <kenneth@whitecape.org> Reviewed-by: Dave Airlie <airlied@redhat.com> Cc: mesa-stable@lists.freedesktop.org
This commit is contained in:
@@ -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];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user