struct {
uint32_t primitive_mode; /* GL_TRIANGLES, GL_QUADS or GL_ISOLINES */
uint32_t spacing; /* GL_EQUAL, GL_FRACTIONAL_EVEN, GL_FRACTIONAL_ODD */
- uint32_t vertex_order; /* GL_CW or GL_CCW */
+ /** Is the vertex order counterclockwise? */
+ bool ccw;
bool point_mode;
} tes;
};
prog_data.output_topology = BRW_TESS_OUTPUT_TOPOLOGY_LINE;
} else {
/* Hardware winding order is backwards from OpenGL */
- switch (tep->program.info.tes.vertex_order) {
- case GL_CCW:
- prog_data.output_topology = BRW_TESS_OUTPUT_TOPOLOGY_TRI_CW;
- break;
- case GL_CW:
- prog_data.output_topology = BRW_TESS_OUTPUT_TOPOLOGY_TRI_CCW;
- break;
- default:
- unreachable("invalid domain shader vertex order");
- }
+ prog_data.output_topology =
+ tep->program.info.tes.ccw ? BRW_TESS_OUTPUT_TOPOLOGY_TRI_CW
+ : BRW_TESS_OUTPUT_TOPOLOGY_TRI_CCW;
}
/* Allocate the references to the uniforms that will end up in the
case MESA_SHADER_TESS_EVAL: {
dst->info.tes.primitive_mode = dst_sh->info.TessEval.PrimitiveMode;
dst->info.tes.spacing = dst_sh->info.TessEval.Spacing;
- dst->info.tes.vertex_order = dst_sh->info.TessEval.VertexOrder;
+ dst->info.tes.ccw = dst_sh->info.TessEval.VertexOrder == GL_CCW;
dst->info.tes.point_mode = dst_sh->info.TessEval.PointMode;
dst->ClipDistanceArraySize = src->TessEval.ClipDistanceArraySize;
dst->CullDistanceArraySize = src->TessEval.CullDistanceArraySize;
}
ureg_property(ureg, TGSI_PROPERTY_TES_VERTEX_ORDER_CW,
- sttep->Base.info.tes.vertex_order == GL_CW);
+ !sttep->Base.info.tes.ccw);
ureg_property(ureg, TGSI_PROPERTY_TES_POINT_MODE,
sttep->Base.info.tes.point_mode);