mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2024-11-23 18:24:13 +08:00
zink: set depth clamp
this is correct according to spec Reviewed-by: Adam Jackson <ajax@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18911>
This commit is contained in:
parent
2d6fa1dcdf
commit
0b81ff0193
@ -638,7 +638,7 @@ zink_draw(struct pipe_context *pctx,
|
||||
|
||||
if ((BATCH_CHANGED || rast_state_changed) && DYNAMIC_STATE >= ZINK_DYNAMIC_STATE3) {
|
||||
VKCTX(CmdSetDepthClipEnableEXT)(batch->state->cmdbuf, rast_state->hw_state.depth_clip);
|
||||
VKCTX(CmdSetDepthClampEnableEXT)(batch->state->cmdbuf, !rast_state->hw_state.depth_clip);
|
||||
VKCTX(CmdSetDepthClampEnableEXT)(batch->state->cmdbuf, rast_state->hw_state.depth_clamp);
|
||||
VKCTX(CmdSetPolygonModeEXT)(batch->state->cmdbuf, (VkPolygonMode)rast_state->hw_state.polygon_mode);
|
||||
VKCTX(CmdSetDepthClipNegativeOneToOneEXT)(batch->state->cmdbuf, !rast_state->hw_state.clip_halfz);
|
||||
VKCTX(CmdSetProvokingVertexModeEXT)(batch->state->cmdbuf, rast_state->hw_state.pv_last ?
|
||||
|
@ -153,7 +153,7 @@ zink_create_gfx_pipeline(struct zink_screen *screen,
|
||||
VkPipelineRasterizationStateCreateInfo rast_state = {0};
|
||||
rast_state.sType = VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO;
|
||||
|
||||
rast_state.depthClampEnable = true;
|
||||
rast_state.depthClampEnable = hw_rast_state->depth_clamp;
|
||||
rast_state.rasterizerDiscardEnable = state->dyn_state2.rasterizer_discard;
|
||||
rast_state.polygonMode = hw_rast_state->polygon_mode;
|
||||
rast_state.cullMode = state->dyn_state1.cull_mode;
|
||||
@ -174,7 +174,6 @@ zink_create_gfx_pipeline(struct zink_screen *screen,
|
||||
} else {
|
||||
static bool warned = false;
|
||||
warn_missing_feature(warned, "VK_EXT_depth_clip_enable");
|
||||
rast_state.depthClampEnable = !hw_rast_state->depth_clip;
|
||||
}
|
||||
|
||||
VkPipelineRasterizationProvokingVertexStateCreateInfoEXT pv_state;
|
||||
@ -663,7 +662,6 @@ zink_create_gfx_pipeline_library(struct zink_screen *screen, struct zink_gfx_pro
|
||||
VkPipelineRasterizationStateCreateInfo rast_state = {0};
|
||||
rast_state.sType = VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO;
|
||||
rast_state.depthBiasEnable = VK_TRUE;
|
||||
rast_state.depthClampEnable = VK_TRUE;
|
||||
|
||||
VkPipelineDepthStencilStateCreateInfo depth_stencil_state = {0};
|
||||
depth_stencil_state.sType = VK_STRUCTURE_TYPE_PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO;
|
||||
|
@ -591,6 +591,7 @@ zink_create_rasterizer_state(struct pipe_context *pctx,
|
||||
|
||||
assert(rs_state->depth_clip_far == rs_state->depth_clip_near);
|
||||
state->hw_state.depth_clip = rs_state->depth_clip_near;
|
||||
state->hw_state.depth_clamp = rs_state->depth_clamp;
|
||||
state->hw_state.pv_last = !rs_state->flatshade_first;
|
||||
state->hw_state.clip_halfz = rs_state->clip_halfz;
|
||||
|
||||
|
@ -255,6 +255,7 @@ struct zink_rasterizer_hw_state {
|
||||
unsigned polygon_mode : 2; //VkPolygonMode
|
||||
unsigned line_mode : 2; //VkLineRasterizationModeEXT
|
||||
unsigned depth_clip:1;
|
||||
unsigned depth_clamp:1;
|
||||
unsigned pv_last:1;
|
||||
unsigned line_stipple_enable:1;
|
||||
unsigned clip_halfz:1;
|
||||
|
Loading…
Reference in New Issue
Block a user