VkPrimitiveTopology topology;
bool32_t disableVertexReuse;
bool32_t primitiveRestartEnable;
- uint32_t primitiveRestartIndex;
} VkPipelineIaStateCreateInfo;
typedef struct {
cmd_buffer->vp_state = NULL;
cmd_buffer->cb_state = NULL;
cmd_buffer->ds_state = NULL;
+ memset(&cmd_buffer->state_vf, 0, sizeof(cmd_buffer->state_vf));
memset(&cmd_buffer->descriptors, 0, sizeof(cmd_buffer->descriptors));
result = anv_batch_bo_create(device, &cmd_buffer->last_batch_bo);
[VK_INDEX_TYPE_UINT32] = INDEX_DWORD,
};
+ struct GEN8_3DSTATE_VF vf = {
+ GEN8_3DSTATE_VF_header,
+ .CutIndex = (indexType == VK_INDEX_TYPE_UINT16) ? UINT16_MAX : UINT32_MAX,
+ };
+ GEN8_3DSTATE_VF_pack(NULL, cmd_buffer->state_vf, &vf);
+
+ cmd_buffer->dirty |= ANV_CMD_BUFFER_INDEX_BUFFER_DIRTY;
+
anv_batch_emit(&cmd_buffer->batch, GEN8_3DSTATE_INDEX_BUFFER,
.IndexFormat = vk_to_gen_index_type[indexType],
.MemoryObjectControlState = GEN8_MOCS,
.ColorCalcStatePointerValid = true);
}
+ if (cmd_buffer->dirty & (ANV_CMD_BUFFER_PIPELINE_DIRTY | ANV_CMD_BUFFER_INDEX_BUFFER_DIRTY)) {
+ anv_batch_emit_merge(&cmd_buffer->batch,
+ cmd_buffer->state_vf, pipeline->state_vf);
+ }
+
cmd_buffer->vb_dirty &= ~vb_emit;
cmd_buffer->dirty = 0;
}
.topology = VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP,
.disableVertexReuse = false,
.primitiveRestartEnable = false,
- .primitiveRestartIndex = 0
};
/* We don't use a vertex shader for clearing, but instead build and pass
.topology = VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP,
.disableVertexReuse = false,
.primitiveRestartEnable = false,
- .primitiveRestartIndex = 0
};
/* We don't use a vertex shader for clearing, but instead build and pass
if (extra && extra->use_rectlist)
topology = _3DPRIM_RECTLIST;
- anv_batch_emit(&pipeline->batch, GEN8_3DSTATE_VF,
- .IndexedDrawCutIndexEnable = info->primitiveRestartEnable,
- .CutIndex = info->primitiveRestartIndex);
+ struct GEN8_3DSTATE_VF vf = {
+ GEN8_3DSTATE_VF_header,
+ .IndexedDrawCutIndexEnable = info->primitiveRestartEnable,
+ };
+ GEN8_3DSTATE_VF_pack(NULL, pipeline->state_vf, &vf);
+
anv_batch_emit(&pipeline->batch, GEN8_3DSTATE_VF_TOPOLOGY,
.PrimitiveTopologyType = topology);
}
#define ANV_CMD_BUFFER_DS_DIRTY (1 << 3)
#define ANV_CMD_BUFFER_CB_DIRTY (1 << 4)
#define ANV_CMD_BUFFER_VP_DIRTY (1 << 5)
+#define ANV_CMD_BUFFER_INDEX_BUFFER_DIRTY (1 << 6)
struct anv_vertex_binding {
struct anv_buffer * buffer;
struct anv_dynamic_ds_state * ds_state;
struct anv_dynamic_vp_state * vp_state;
struct anv_dynamic_cb_state * cb_state;
+ uint32_t state_vf[GEN8_3DSTATE_VF_length];
struct anv_vertex_binding vertex_bindings[MAX_VBS];
struct anv_descriptor_set_binding descriptors[MAX_SETS];
};
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];