vkCmdSetStencilCompareMask(batch->state->cmdbuf, VK_STENCIL_FACE_FRONT_AND_BACK, dsa_state->hw_state.stencil_front.compareMask);
}
}
+ screen->vk_CmdSetFrontFaceEXT(batch->state->cmdbuf, ctx->gfx_pipeline_state.front_face);
}
if (depth_bias)
rast_state.rasterizerDiscardEnable = state->rast_state->rasterizer_discard;
rast_state.polygonMode = state->rast_state->polygon_mode;
rast_state.cullMode = state->rast_state->cull_mode;
- rast_state.frontFace = state->rast_state->front_face;
+ rast_state.frontFace = state->front_face;
rast_state.depthBiasEnable = VK_TRUE;
rast_state.depthBiasConstantFactor = 0.0;
dynamicStateEnables[state_count++] = VK_DYNAMIC_STATE_STENCIL_OP_EXT;
dynamicStateEnables[state_count++] = VK_DYNAMIC_STATE_STENCIL_TEST_ENABLE_EXT;
dynamicStateEnables[state_count++] = VK_DYNAMIC_STATE_VERTEX_INPUT_BINDING_STRIDE_EXT;
+ dynamicStateEnables[state_count++] = VK_DYNAMIC_STATE_FRONT_FACE_EXT;
} else {
dynamicStateEnables[state_count++] = VK_DYNAMIC_STATE_VIEWPORT;
dynamicStateEnables[state_count++] = VK_DYNAMIC_STATE_SCISSOR;
bool dirty;
struct zink_depth_stencil_alpha_hw_state *depth_stencil_alpha_state; //non-dynamic state
+ VkFrontFace front_face;
VkShaderModule modules[PIPE_SHADER_TYPES - 1];
uint32_t module_hash;
if (sa->vertex_strides[idx_a] != sb->vertex_strides[idx_b])
return false;
}
+ if (sa->front_face != sb->front_face)
+ return false;
if (!!sa->depth_stencil_alpha_state != !!sb->depth_stencil_alpha_state ||
(sa && sb && memcmp(sa->depth_stencil_alpha_state, sb->depth_stencil_alpha_state, sizeof(struct zink_depth_stencil_alpha_hw_state))))
return false;
GET_PROC_ADDR(CmdSetStencilOpEXT);
GET_PROC_ADDR(CmdSetStencilTestEnableEXT);
GET_PROC_ADDR(CmdBindVertexBuffers2EXT);
+ GET_PROC_ADDR(CmdSetFrontFaceEXT);
}
if (screen->info.have_EXT_image_drm_format_modifier)
PFN_vkCmdSetStencilTestEnableEXT vk_CmdSetStencilTestEnableEXT;
PFN_vkCmdSetStencilOpEXT vk_CmdSetStencilOpEXT;
PFN_vkCmdBindVertexBuffers2EXT vk_CmdBindVertexBuffers2EXT;
+ PFN_vkCmdSetFrontFaceEXT vk_CmdSetFrontFaceEXT;
PFN_vkCreateDebugUtilsMessengerEXT vk_CreateDebugUtilsMessengerEXT;
PFN_vkDestroyDebugUtilsMessengerEXT vk_DestroyDebugUtilsMessengerEXT;
state->hw_state.polygon_mode = (VkPolygonMode)rs_state->fill_front; // same values
state->hw_state.cull_mode = (VkCullModeFlags)rs_state->cull_face; // same bits
- state->hw_state.front_face = rs_state->front_ccw ?
- VK_FRONT_FACE_COUNTER_CLOCKWISE :
- VK_FRONT_FACE_CLOCKWISE;
+ state->front_face = rs_state->front_ccw ?
+ VK_FRONT_FACE_COUNTER_CLOCKWISE :
+ VK_FRONT_FACE_CLOCKWISE;
state->offset_point = rs_state->offset_point;
state->offset_line = rs_state->offset_line;
if (clip_halfz != ctx->rast_state->base.clip_halfz)
ctx->last_vertex_stage_dirty = true;
+ if (ctx->gfx_pipeline_state.front_face != ctx->rast_state->front_face) {
+ ctx->gfx_pipeline_state.front_face = ctx->rast_state->front_face;
+ ctx->gfx_pipeline_state.dirty |= !zink_screen(pctx->screen)->info.have_EXT_extended_dynamic_state;
+ }
if (ctx->line_width != ctx->rast_state->line_width) {
ctx->line_width = ctx->rast_state->line_width;
ctx->gfx_pipeline_state.dirty = true;
struct zink_rasterizer_hw_state {
VkBool32 depth_clamp;
VkBool32 rasterizer_discard;
- VkFrontFace front_face;
VkPolygonMode polygon_mode;
VkCullModeFlags cull_mode;
VkProvokingVertexModeEXT pv_mode;
bool offset_point, offset_line, offset_tri;
float offset_units, offset_clamp, offset_scale;
float line_width;
+ VkFrontFace front_face;
struct zink_rasterizer_hw_state hw_state;
};