v3dv: DepthBoundsTestEnable is dynamic now

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27609>
This commit is contained in:
Alejandro Piñeiro 2024-03-24 11:48:18 +01:00 committed by Marge Bot
parent 29c8aca881
commit 9fa023f111
4 changed files with 16 additions and 10 deletions

View file

@ -3005,7 +3005,8 @@ v3dv_cmd_buffer_emit_pre_draw(struct v3dv_cmd_buffer *cmd_buffer,
if (*dirty & (V3DV_CMD_DIRTY_PIPELINE) ||
BITSET_TEST(dyn->dirty, MESA_VK_DYNAMIC_RS_CULL_MODE) ||
BITSET_TEST(dyn->dirty, MESA_VK_DYNAMIC_RS_FRONT_FACE)) {
BITSET_TEST(dyn->dirty, MESA_VK_DYNAMIC_RS_FRONT_FACE) ||
BITSET_TEST(dyn->dirty, MESA_VK_DYNAMIC_DS_DEPTH_BOUNDS_TEST_ENABLE)) {
v3dv_X(device, cmd_buffer_emit_configuration_bits)(cmd_buffer);
}

View file

@ -2958,12 +2958,6 @@ pipeline_init(struct v3dv_pipeline *pipeline,
if (depth_clip_control)
pipeline->negative_one_to_one = depth_clip_control->negativeOneToOne;
/* 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(device->devinfo.ver >= 71 ||
!ds_info || !ds_info->depthBoundsTestEnable);
enable_depth_bias(pipeline, rs_info);
v3dv_X(device, pipeline_pack_state)(pipeline, cb_info, ds_info,

View file

@ -1965,10 +1965,24 @@ v3dX(cmd_buffer_emit_configuration_bits)(struct v3dv_cmd_buffer *cmd_buffer)
/* Seems like the hardware is backwards regarding this setting... */
config.clockwise_primitives = dyn->rs.front_face == VK_FRONT_FACE_COUNTER_CLOCKWISE;
}
/* 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(cmd_buffer->device->devinfo.ver >= 71 ||
!dyn->ds.depth.bounds_test.enable);
#if V3D_VERSION >= 71
bool has_depth =
pipeline->rendering_info.depth_attachment_format != VK_FORMAT_UNDEFINED;
config.depth_bounds_test_enable =
dyn->ds.depth.bounds_test.enable && has_depth;
#endif
}
BITSET_CLEAR(dyn->dirty, MESA_VK_DYNAMIC_RS_CULL_MODE);
BITSET_CLEAR(dyn->dirty, MESA_VK_DYNAMIC_RS_FRONT_FACE);
BITSET_CLEAR(dyn->dirty, MESA_VK_DYNAMIC_DS_DEPTH_BOUNDS_TEST_ENABLE);
}
void

View file

@ -246,9 +246,6 @@ pack_cfg_bits(struct v3dv_pipeline *pipeline,
}
config.z_clamp_mode = z_clamp_enable;
config.depth_bounds_test_enable =
ds_info && ds_info->depthBoundsTestEnable && has_depth;
#endif
};
}