Commit f758b1a2 authored by Alejandro Piñeiro's avatar Alejandro Piñeiro Committed by Marge Bot

v3dv: support for depthBiasClamp

Gets tests like the following working:
dEQP-VK.dynamic_state.rs_state.depth_bias_clamp
Reviewed-by: Iago Toral's avatarIago Toral Quiroga <itoral@igalia.com>
Part-of: <!8928>
parent f7575fa7
Pipeline #268612 waiting for manual action with stages
......@@ -53,6 +53,7 @@ const struct v3dv_dynamic_state default_dynamic_state = {
.blend_constants = { 0.0f, 0.0f, 0.0f, 0.0f },
.depth_bias = {
.constant_factor = 0.0f,
.depth_bias_clamp = 0.0f,
.slope_factor = 0.0f,
},
.line_width = 1.0f,
......@@ -3481,6 +3482,7 @@ emit_depth_bias(struct v3dv_cmd_buffer *cmd_buffer)
bias.depth_offset_units = dynamic->depth_bias.constant_factor;
if (pipeline->depth_bias.is_z16)
bias.depth_offset_units *= 256.0f;
bias.limit = dynamic->depth_bias.depth_bias_clamp;
}
cmd_buffer->state.dirty &= ~V3DV_CMD_DIRTY_DEPTH_BIAS;
......@@ -4693,6 +4695,7 @@ v3dv_CmdSetDepthBias(VkCommandBuffer commandBuffer,
V3DV_FROM_HANDLE(v3dv_cmd_buffer, cmd_buffer, commandBuffer);
cmd_buffer->state.dynamic.depth_bias.constant_factor = depthBiasConstantFactor;
cmd_buffer->state.dynamic.depth_bias.depth_bias_clamp = depthBiasClamp;
cmd_buffer->state.dynamic.depth_bias.slope_factor = depthBiasSlopeFactor;
cmd_buffer->state.dirty |= V3DV_CMD_DIRTY_DEPTH_BIAS;
}
......
......@@ -847,7 +847,7 @@ v3dv_GetPhysicalDeviceFeatures(VkPhysicalDevice physicalDevice,
.multiDrawIndirect = false,
.drawIndirectFirstInstance = true,
.depthClamp = false,
.depthBiasClamp = false,
.depthBiasClamp = true,
.fillModeNonSolid = true,
.depthBounds = false, /* Only available since V3D 4.3.16.2 */
.wideLines = true,
......
......@@ -2123,6 +2123,8 @@ pipeline_init_dynamic_state(
!(dynamic_states & V3DV_DYNAMIC_DEPTH_BIAS)) {
dynamic->depth_bias.constant_factor =
pRasterizationState->depthBiasConstantFactor;
dynamic->depth_bias.depth_bias_clamp =
pRasterizationState->depthBiasClamp;
dynamic->depth_bias.slope_factor =
pRasterizationState->depthBiasSlopeFactor;
}
......
......@@ -724,6 +724,7 @@ struct v3dv_dynamic_state {
struct {
float constant_factor;
float depth_bias_clamp;
float slope_factor;
} depth_bias;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment