config.blend_enable = pipeline->blend.enables != 0;
- /* Note: ez state may update based on the compiled FS, along with zsa
- * (FIXME: not done)
- */
+ /* Disable depth/stencil if we don't have a D/S attachment */
+ bool has_ds_attachment =
+ pipeline->subpass->ds_attachment.attachment != VK_ATTACHMENT_UNUSED;
+
+ /* Note: ez state may update based on the compiled FS, along with zsa */
config.early_z_updates_enable = false;
- if (ds_info && ds_info->depthTestEnable) {
+ if (ds_info && ds_info->depthTestEnable && has_ds_attachment) {
config.z_updates_enable = true;
config.early_z_enable = false;
config.depth_test_function = ds_info->depthCompareOp;
config.depth_test_function = VK_COMPARE_OP_ALWAYS;
}
- config.stencil_enable = ds_info ? ds_info->stencilTestEnable : false;
+ config.stencil_enable =
+ ds_info ? ds_info->stencilTestEnable && has_ds_attachment: false;
};
}
if (!ds_info || !ds_info->stencilTestEnable)
return;
+ if (pipeline->subpass->ds_attachment.attachment == VK_ATTACHMENT_UNUSED)
+ return;
+
const uint32_t dynamic_stencil_states = V3DV_DYNAMIC_STENCIL_COMPARE_MASK |
V3DV_DYNAMIC_STENCIL_WRITE_MASK |
V3DV_DYNAMIC_STENCIL_REFERENCE;