.BlendConstantColorAlpha = pCreateInfo->blendConst[3]
};
- GEN7_COLOR_CALC_STATE_pack(NULL, state->state_color_calc, &color_calc_state);
+ GEN7_COLOR_CALC_STATE_pack(NULL, state->color_calc_state, &color_calc_state);
*pState = anv_dynamic_cb_state_to_handle(state);
};
struct anv_dynamic_rs_state {
- uint32_t state_sf[GEN8_3DSTATE_SF_length];
- uint32_t state_raster[GEN8_3DSTATE_RASTER_length];
+ struct {
+ uint32_t sf[GEN8_3DSTATE_SF_length];
+ uint32_t raster[GEN8_3DSTATE_RASTER_length];
+ } gen8;
};
struct anv_dynamic_ds_state {
- uint32_t state_wm_depth_stencil[GEN8_3DSTATE_WM_DEPTH_STENCIL_length];
- uint32_t state_color_calc[GEN8_COLOR_CALC_STATE_length];
+ struct {
+ uint32_t wm_depth_stencil[GEN8_3DSTATE_WM_DEPTH_STENCIL_length];
+ uint32_t color_calc_state[GEN8_COLOR_CALC_STATE_length];
+ } gen8;
};
struct anv_dynamic_cb_state {
- uint32_t state_color_calc[GEN8_COLOR_CALC_STATE_length];
+ uint32_t color_calc_state[GEN8_COLOR_CALC_STATE_length];
};
uint32_t vb_used;
uint32_t binding_stride[MAX_VBS];
- uint32_t state_sf[GEN8_3DSTATE_SF_length];
- uint32_t state_vf[GEN8_3DSTATE_VF_length];
- uint32_t state_raster[GEN8_3DSTATE_RASTER_length];
- uint32_t state_wm_depth_stencil[GEN8_3DSTATE_WM_DEPTH_STENCIL_length];
-
uint32_t cs_thread_width_max;
uint32_t cs_right_mask;
+
+ struct {
+ uint32_t sf[GEN8_3DSTATE_SF_length];
+ uint32_t vf[GEN8_3DSTATE_VF_length];
+ uint32_t raster[GEN8_3DSTATE_RASTER_length];
+ uint32_t wm_depth_stencil[GEN8_3DSTATE_WM_DEPTH_STENCIL_length];
+ } gen8;
};
struct anv_graphics_pipeline_create_info {
if (cmd_buffer->state.dirty & (ANV_CMD_BUFFER_PIPELINE_DIRTY |
ANV_CMD_BUFFER_RS_DIRTY)) {
anv_batch_emit_merge(&cmd_buffer->batch,
- cmd_buffer->state.rs_state->state_sf,
- pipeline->state_sf);
+ cmd_buffer->state.rs_state->gen8.sf,
+ pipeline->gen8.sf);
anv_batch_emit_merge(&cmd_buffer->batch,
- cmd_buffer->state.rs_state->state_raster,
- pipeline->state_raster);
+ cmd_buffer->state.rs_state->gen8.raster,
+ pipeline->gen8.raster);
}
if (cmd_buffer->state.ds_state &&
(cmd_buffer->state.dirty & (ANV_CMD_BUFFER_PIPELINE_DIRTY |
ANV_CMD_BUFFER_DS_DIRTY))) {
anv_batch_emit_merge(&cmd_buffer->batch,
- cmd_buffer->state.ds_state->state_wm_depth_stencil,
- pipeline->state_wm_depth_stencil);
+ cmd_buffer->state.ds_state->gen8.wm_depth_stencil,
+ pipeline->gen8.wm_depth_stencil);
}
if (cmd_buffer->state.dirty & (ANV_CMD_BUFFER_CB_DIRTY |
struct anv_state state;
if (cmd_buffer->state.ds_state == NULL)
state = anv_cmd_buffer_emit_dynamic(cmd_buffer,
- cmd_buffer->state.cb_state->state_color_calc,
+ cmd_buffer->state.cb_state->color_calc_state,
GEN8_COLOR_CALC_STATE_length, 64);
else if (cmd_buffer->state.cb_state == NULL)
state = anv_cmd_buffer_emit_dynamic(cmd_buffer,
- cmd_buffer->state.ds_state->state_color_calc,
+ cmd_buffer->state.ds_state->gen8.color_calc_state,
GEN8_COLOR_CALC_STATE_length, 64);
else
state = anv_cmd_buffer_merge_dynamic(cmd_buffer,
- cmd_buffer->state.ds_state->state_color_calc,
- cmd_buffer->state.cb_state->state_color_calc,
+ cmd_buffer->state.ds_state->gen8.color_calc_state,
+ cmd_buffer->state.cb_state->color_calc_state,
GEN8_COLOR_CALC_STATE_length, 64);
anv_batch_emit(&cmd_buffer->batch,
if (cmd_buffer->state.dirty & (ANV_CMD_BUFFER_PIPELINE_DIRTY |
ANV_CMD_BUFFER_INDEX_BUFFER_DIRTY)) {
anv_batch_emit_merge(&cmd_buffer->batch,
- cmd_buffer->state.state_vf, pipeline->state_vf);
+ cmd_buffer->state.state_vf, pipeline->gen8.vf);
}
cmd_buffer->state.vb_dirty &= ~vb_emit;
GEN8_3DSTATE_VF_header,
.IndexedDrawCutIndexEnable = info->primitiveRestartEnable,
};
- GEN8_3DSTATE_VF_pack(NULL, pipeline->state_vf, &vf);
+ GEN8_3DSTATE_VF_pack(NULL, pipeline->gen8.vf, &vf);
anv_batch_emit(&pipeline->batch, GEN8_3DSTATE_VF_TOPOLOGY,
.PrimitiveTopologyType = topology);
/* FINISHME: VkBool32 rasterizerDiscardEnable; */
- GEN8_3DSTATE_SF_pack(NULL, pipeline->state_sf, &sf);
+ GEN8_3DSTATE_SF_pack(NULL, pipeline->gen8.sf, &sf);
struct GEN8_3DSTATE_RASTER raster = {
GEN8_3DSTATE_RASTER_header,
.ViewportZClipTestEnable = info->depthClipEnable
};
- GEN8_3DSTATE_RASTER_pack(NULL, pipeline->state_raster, &raster);
-
anv_batch_emit(&pipeline->batch, GEN8_3DSTATE_SBE,
.ForceVertexURBEntryReadLength = false,
.ForceVertexURBEntryReadOffset = false,
.NumberofSFOutputAttributes =
pipeline->wm_prog_data.num_varying_inputs);
+ GEN8_3DSTATE_RASTER_pack(NULL, pipeline->gen8.raster, &raster);
}
static void
/* We're going to OR this together with the dynamic state. We need
* to make sure it's initialized to something useful.
*/
- memset(pipeline->state_wm_depth_stencil, 0,
- sizeof(pipeline->state_wm_depth_stencil));
+ memset(pipeline->gen8.wm_depth_stencil, 0,
+ sizeof(pipeline->gen8.wm_depth_stencil));
return;
}
.BackfaceStencilTestFunction = vk_to_gen_compare_op[info->back.stencilCompareOp],
};
- GEN8_3DSTATE_WM_DEPTH_STENCIL_pack(NULL, pipeline->state_wm_depth_stencil, &wm_depth_stencil);
+ GEN8_3DSTATE_WM_DEPTH_STENCIL_pack(NULL, pipeline->gen8.wm_depth_stencil, &wm_depth_stencil);
}
VkResult
.LineWidth = pCreateInfo->lineWidth,
};
- GEN8_3DSTATE_SF_pack(NULL, state->state_sf, &sf);
+ GEN8_3DSTATE_SF_pack(NULL, state->gen8.sf, &sf);
bool enable_bias = pCreateInfo->depthBias != 0.0f ||
pCreateInfo->slopeScaledDepthBias != 0.0f;
.GlobalDepthOffsetClamp = pCreateInfo->depthBiasClamp
};
- GEN8_3DSTATE_RASTER_pack(NULL, state->state_raster, &raster);
+ GEN8_3DSTATE_RASTER_pack(NULL, state->gen8.raster, &raster);
*pState = anv_dynamic_rs_state_to_handle(state);
.BackfaceStencilWriteMask = pCreateInfo->stencilWriteMask & 0xff,
};
- GEN8_3DSTATE_WM_DEPTH_STENCIL_pack(NULL, state->state_wm_depth_stencil,
+ GEN8_3DSTATE_WM_DEPTH_STENCIL_pack(NULL, state->gen8.wm_depth_stencil,
&wm_depth_stencil);
struct GEN8_COLOR_CALC_STATE color_calc_state = {
.BackFaceStencilReferenceValue = pCreateInfo->stencilBackRef
};
- GEN8_COLOR_CALC_STATE_pack(NULL, state->state_color_calc, &color_calc_state);
+ GEN8_COLOR_CALC_STATE_pack(NULL, state->gen8.color_calc_state, &color_calc_state);
*pState = anv_dynamic_ds_state_to_handle(state);