return PIPE_POLYGON_MODE_LINE;
case GL_FILL:
return PIPE_POLYGON_MODE_FILL;
+ case GL_FILL_RECTANGLE_NV:
+ return PIPE_POLYGON_MODE_FILL_RECTANGLE;
default:
assert(0);
return 0;
{
struct gl_context *ctx = st->ctx;
struct pipe_rasterizer_state *raster = &st->state.rasterizer;
- const struct gl_vertex_program *vertProg = ctx->VertexProgram._Current;
- const struct gl_fragment_program *fragProg = ctx->FragmentProgram._Current;
- uint i;
+ const struct gl_program *vertProg = ctx->VertexProgram._Current;
+ const struct gl_program *fragProg = ctx->FragmentProgram._Current;
memset(raster, 0, sizeof(*raster));
* that we need to replace GENERIC[k] attrib with an automatically
* computed texture coord.
*/
- for (i = 0; i < MAX_TEXTURE_COORD_UNITS; i++) {
- if (ctx->Point.CoordReplace[i]) {
- raster->sprite_coord_enable |= 1 << i;
- }
- }
+ raster->sprite_coord_enable = ctx->Point.CoordReplace &
+ ((1u << MAX_TEXTURE_COORD_UNITS) - 1);
if (!st->needs_texcoord_semantic &&
- fragProg->Base.InputsRead & VARYING_BIT_PNTC) {
+ fragProg->info.inputs_read & VARYING_BIT_PNTC) {
raster->sprite_coord_enable |=
1 << st_get_generic_varying_index(st, VARYING_SLOT_PNTC);
}
/* ST_NEW_VERTEX_PROGRAM
*/
if (vertProg) {
- if (vertProg->Base.Id == 0) {
- if (vertProg->Base.OutputsWritten & BITFIELD64_BIT(VARYING_SLOT_PSIZ)) {
+ if (vertProg->Id == 0) {
+ if (vertProg->info.outputs_written &
+ BITFIELD64_BIT(VARYING_SLOT_PSIZ)) {
/* generated program which emits point size */
raster->point_size_per_vertex = TRUE;
}
}
- else if (ctx->VertexProgram.PointSizeEnabled) {
- /* user-defined program and GL_VERTEX_PROGRAM_POINT_SIZE set */
+ else if (ctx->API != API_OPENGLES2) {
+ /* PointSizeEnabled is always set in ES2 contexts */
raster->point_size_per_vertex = ctx->VertexProgram.PointSizeEnabled;
}
+ else {
+ /* ST_NEW_TESSEVAL_PROGRAM | ST_NEW_GEOMETRY_PROGRAM */
+ /* We have to check the last bound stage and see if it writes psize */
+ struct gl_program *last = NULL;
+ if (ctx->GeometryProgram._Current)
+ last = ctx->GeometryProgram._Current;
+ else if (ctx->TessEvalProgram._Current)
+ last = ctx->TessEvalProgram._Current;
+ else if (ctx->VertexProgram._Current)
+ last = ctx->VertexProgram._Current;
+ if (last)
+ raster->point_size_per_vertex =
+ !!(last->info.outputs_written &
+ BITFIELD64_BIT(VARYING_SLOT_PSIZ));
+ }
}
if (!raster->point_size_per_vertex) {
/* clamp size now */
/* _NEW_MULTISAMPLE | _NEW_BUFFERS */
raster->force_persample_interp =
!st->force_persample_in_shader &&
- _mesa_is_multisample_enabled(ctx) &&
+ raster->multisample &&
ctx->Multisample.SampleShading &&
ctx->Multisample.MinSampleShadingValue *
- ctx->DrawBuffer->Visual.samples > 1;
+ _mesa_geometric_samples(ctx->DrawBuffer) > 1;
/* _NEW_SCISSOR */
raster->scissor = ctx->Scissor.EnableFlags;
}
const struct st_tracked_state st_update_rasterizer = {
- "st_update_rasterizer", /* name */
- {
- (_NEW_BUFFERS |
- _NEW_LIGHT |
- _NEW_LINE |
- _NEW_MULTISAMPLE |
- _NEW_POINT |
- _NEW_POLYGON |
- _NEW_PROGRAM |
- _NEW_SCISSOR |
- _NEW_FRAG_CLAMP |
- _NEW_TRANSFORM), /* mesa state dependencies*/
- (ST_NEW_VERTEX_PROGRAM |
- ST_NEW_RASTERIZER), /* state tracker dependencies */
- },
update_raster_state /* update function */
};