do { \
uint32_t *dw; \
\
- assert(ARRAY_SIZE(dwords0) == ARRAY_SIZE(dwords1)); \
+ static_assert(ARRAY_SIZE(dwords0) == ARRAY_SIZE(dwords1), "mismatch merge"); \
dw = anv_batch_emit_dwords((batch), ARRAY_SIZE(dwords0)); \
for (uint32_t i = 0; i < ARRAY_SIZE(dwords0); i++) \
dw[i] = (dwords0)[i] | (dwords1)[i]; \
struct {
uint32_t sf[4];
uint32_t raster[5];
- uint32_t wm_depth_stencil[4];
+ uint32_t wm_depth_stencil[3];
} gen8;
+
+ struct {
+ uint32_t wm_depth_stencil[4];
+ } gen9;
};
struct anv_graphics_pipeline_create_info {
pipeline->gen8.raster);
}
- /* Stencil reference values were moves from COLOR_CALC_STATE in gen8 to
+ /* Stencil reference values moved from COLOR_CALC_STATE in gen8 to
* 3DSTATE_WM_DEPTH_STENCIL in gen9. That means the dirty bits gets split
* across different state packets for gen8 and gen9. We handle that by
* using a big old #if switch here.
GEN9_3DSTATE_WM_DEPTH_STENCIL_pack(NULL, dwords, &wm_depth_stencil);
anv_batch_emit_merge(&cmd_buffer->batch, dwords,
- pipeline->gen8.wm_depth_stencil);
+ pipeline->gen9.wm_depth_stencil);
}
#endif
emit_ds_state(struct anv_pipeline *pipeline,
const VkPipelineDepthStencilStateCreateInfo *info)
{
+ uint32_t *dw = ANV_GEN == 8 ?
+ pipeline->gen8.wm_depth_stencil : pipeline->gen9.wm_depth_stencil;
+
if (info == NULL) {
/* We're going to OR this together with the dynamic state. We need
* to make sure it's initialized to something useful.
*/
- /* FIXME: gen9 wm_depth_stencil */
memset(pipeline->gen8.wm_depth_stencil, 0,
sizeof(pipeline->gen8.wm_depth_stencil));
+ memset(pipeline->gen9.wm_depth_stencil, 0,
+ sizeof(pipeline->gen9.wm_depth_stencil));
return;
}
.BackfaceStencilTestFunction = vk_to_gen_compare_op[info->back.stencilCompareOp],
};
- GENX(3DSTATE_WM_DEPTH_STENCIL_pack)(NULL, pipeline->gen8.wm_depth_stencil, &wm_depth_stencil);
+ GENX(3DSTATE_WM_DEPTH_STENCIL_pack)(NULL, dw, &wm_depth_stencil);
}
VkResult