}
static enum pipe_prim_type
-zink_rast_prim(const struct zink_context *ctx,
+zink_prim_type(const struct zink_context *ctx,
const struct pipe_draw_info *dinfo)
{
if (ctx->gfx_pipeline_state.shader_rast_prim != PIPE_PRIM_MAX)
return u_reduced_prim((enum pipe_prim_type)dinfo->mode);
}
+static enum pipe_prim_type
+zink_rast_prim(const struct zink_context *ctx,
+ const struct pipe_draw_info *dinfo)
+{
+ enum pipe_prim_type prim_type = zink_prim_type(ctx, dinfo);
+ assert(prim_type != PIPE_PRIM_MAX);
+
+ if (prim_type == PIPE_PRIM_TRIANGLES &&
+ ctx->rast_state->base.fill_front != PIPE_POLYGON_MODE_FILL) {
+ switch(ctx->rast_state->base.fill_front) {
+ case PIPE_POLYGON_MODE_POINT:
+ return PIPE_PRIM_POINTS;
+ case PIPE_POLYGON_MODE_LINE:
+ return PIPE_PRIM_LINES;
+ default:
+ unreachable("unexpected polygon mode");
+ }
+ }
+
+ return prim_type;
+}
+
template <zink_multidraw HAS_MULTIDRAW, zink_dynamic_state DYNAMIC_STATE, bool BATCH_CHANGED, bool DRAW_STATE>
void
zink_draw(struct pipe_context *pctx,
zink_set_last_vertex_key(ctx)->push_drawid = drawid_broken;
bool rast_prim_changed = false;
- if (mode_changed || ctx->gfx_pipeline_state.modules_changed) {
+ bool rast_state_changed = ctx->rast_state_changed;
+ if (mode_changed || ctx->gfx_pipeline_state.modules_changed ||
+ rast_state_changed) {
enum pipe_prim_type rast_prim = zink_rast_prim(ctx, dinfo);
if (rast_prim != ctx->gfx_pipeline_state.rast_prim) {
bool points_changed =
}
ctx->dsa_state_changed = false;
- bool rast_state_changed = ctx->rast_state_changed;
if (DYNAMIC_STATE != ZINK_NO_DYNAMIC_STATE && (BATCH_CHANGED || rast_state_changed)) {
VKCTX(CmdSetFrontFaceEXT)(batch->state->cmdbuf, (VkFrontFace)ctx->gfx_pipeline_state.dyn_state1.front_face);
VKCTX(CmdSetCullModeEXT)(batch->state->cmdbuf, ctx->gfx_pipeline_state.dyn_state1.cull_mode);
VKCTX(CmdSetLineWidth)(batch->state->cmdbuf, rast_state->line_width);
}
- if (BATCH_CHANGED || rast_state_changed || rast_prim_changed) {
+ if (BATCH_CHANGED || mode_changed ||
+ ctx->gfx_pipeline_state.modules_changed ||
+ rast_state_changed) {
bool depth_bias =
- ctx->gfx_pipeline_state.rast_prim == PIPE_PRIM_TRIANGLES &&
+ zink_prim_type(ctx, dinfo) == PIPE_PRIM_TRIANGLES &&
rast_state->offset_fill;
if (depth_bias) {