v3dv: ignore dynamic updates of depth bounds state

Depth bounds testing is not available in V3D 4.2 so we just ignore
this piece of state and assert if any pipeline attempts to enable
the feature.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6766>
This commit is contained in:
Iago Toral Quiroga 2020-05-13 11:21:12 +02:00 committed by Marge Bot
parent 9aaf07e5be
commit 21936e8493
5 changed files with 24 additions and 3 deletions

View file

@ -3428,6 +3428,16 @@ v3dv_CmdSetDepthBias(VkCommandBuffer commandBuffer,
cmd_buffer->state.dirty |= V3DV_CMD_DIRTY_DEPTH_BIAS;
}
void
v3dv_CmdSetDepthBounds(VkCommandBuffer commandBuffer,
float minDepthBounds,
float maxDepthBounds)
{
/* We do not support depth bounds testing so we just ingore this. We are
* already asserting that pipelines don't enable the feature anyway.
*/
}
void
v3dv_CmdBindDescriptorSets(VkCommandBuffer commandBuffer,
VkPipelineBindPoint pipelineBindPoint,

View file

@ -552,7 +552,7 @@ v3dv_GetPhysicalDeviceFeatures(VkPhysicalDevice physicalDevice,
.depthClamp = false,
.depthBiasClamp = false,
.fillModeNonSolid = false,
.depthBounds = false,
.depthBounds = false, /* Only available since V3D 4.3.16.2 */
.wideLines = false,
.largePoints = false,
.alphaToOne = false,

View file

@ -229,7 +229,6 @@ create_pipeline(struct v3dv_device *device,
VK_DYNAMIC_STATE_DEPTH_BIAS,
#if 0
VK_DYNAMIC_STATE_LINE_WIDTH,
VK_DYNAMIC_STATE_DEPTH_BOUNDS,
#endif
},
},

View file

@ -3049,7 +3049,6 @@ create_pipeline(struct v3dv_device *device,
VK_DYNAMIC_STATE_DEPTH_BIAS,
#if 0
VK_DYNAMIC_STATE_LINE_WIDTH,
VK_DYNAMIC_STATE_DEPTH_BOUNDS,
#endif
},
},

View file

@ -1541,6 +1541,14 @@ v3dv_dynamic_state_mask(VkDynamicState state)
return V3DV_DYNAMIC_BLEND_CONSTANTS;
case VK_DYNAMIC_STATE_DEPTH_BIAS:
return V3DV_DYNAMIC_DEPTH_BIAS;
/* Depth bounds testing is not available in in V3D 4.2 so here we are just
* ignoring this dynamic state. We are already asserting at pipeline creation
* time that depth bounds testing is not enabled.
*/
case VK_DYNAMIC_STATE_DEPTH_BOUNDS:
return 0;
default:
unreachable("Unhandled dynamic state");
}
@ -2313,6 +2321,11 @@ pipeline_init(struct v3dv_pipeline *pipeline,
const VkPipelineColorBlendStateCreateInfo *cb_info =
raster_enabled ? pCreateInfo->pColorBlendState : NULL;
/* V3D 4.2 doesn't support depth bounds testing so we don't advertise that
* feature and it shouldn't be used by any pipeline.
*/
assert(!ds_info || !ds_info->depthBoundsTestEnable);
pack_blend(pipeline, cb_info);
pack_cfg_bits(pipeline, ds_info, rs_info);
pack_stencil_cfg(pipeline, ds_info);