/* TODO: we could set this to 0 based on the information in nir_shader, but
* this function is called before spirv_to_nir. */
const struct brw_vue_map *vue_map =
- anv_pipeline_get_fs_input_map(pipeline);
+ &anv_pipeline_get_last_vue_prog_data(pipeline)->vue_map;
key->input_slots_valid = vue_map->slots_valid;
/* Vulkan doesn't specify a default */
ANV_DECL_GET_PROG_DATA_FUNC(wm, MESA_SHADER_FRAGMENT)
ANV_DECL_GET_PROG_DATA_FUNC(cs, MESA_SHADER_COMPUTE)
-static inline const struct brw_vue_map *
-anv_pipeline_get_fs_input_map(const struct anv_pipeline *pipeline)
+static inline const struct brw_vue_prog_data *
+anv_pipeline_get_last_vue_prog_data(const struct anv_pipeline *pipeline)
{
if (anv_pipeline_has_stage(pipeline, MESA_SHADER_GEOMETRY))
- return &get_gs_prog_data(pipeline)->base.vue_map;
+ return &get_gs_prog_data(pipeline)->base;
else if (anv_pipeline_has_stage(pipeline, MESA_SHADER_TESS_EVAL))
- return &get_tes_prog_data(pipeline)->base.vue_map;
+ return &get_tes_prog_data(pipeline)->base;
else
- return &get_vs_prog_data(pipeline)->base.vue_map;
+ return &get_vs_prog_data(pipeline)->base;
}
VkResult
emit_3dstate_sbe(struct anv_pipeline *pipeline)
{
const struct brw_wm_prog_data *wm_prog_data = get_wm_prog_data(pipeline);
- const struct brw_vue_map *fs_input_map;
if (!anv_pipeline_has_stage(pipeline, MESA_SHADER_FRAGMENT)) {
anv_batch_emit(&pipeline->batch, GENX(3DSTATE_SBE), sbe);
return;
}
- fs_input_map = anv_pipeline_get_fs_input_map(pipeline);
+ const struct brw_vue_map *fs_input_map =
+ &anv_pipeline_get_last_vue_prog_data(pipeline)->vue_map;
struct GENX(3DSTATE_SBE) sbe = {
GENX(3DSTATE_SBE_header),
}
}
-/**
- * Get the brw_vue_prog_data for the last stage which outputs VUEs.
- */
-static inline struct brw_vue_prog_data *
-get_last_vue_prog_data(struct anv_pipeline *pipeline)
-{
- for (int s = MESA_SHADER_GEOMETRY; s >= 0; s--) {
- if (pipeline->shaders[s])
- return (struct brw_vue_prog_data *) pipeline->shaders[s]->prog_data;
- }
- return NULL;
-}
-
static void
emit_3dstate_clip(struct anv_pipeline *pipeline,
const VkPipelineViewportStateCreateInfo *vp_info,
clip.FrontWinding = vk_to_gen_front_face[rs_info->frontFace];
clip.CullMode = vk_to_gen_cullmode[rs_info->cullMode];
clip.ViewportZClipTestEnable = !pipeline->depth_clamp_enable;
- const struct brw_vue_prog_data *last = get_last_vue_prog_data(pipeline);
+ const struct brw_vue_prog_data *last =
+ anv_pipeline_get_last_vue_prog_data(pipeline);
if (last) {
clip.UserClipDistanceClipTestEnableBitmask = last->clip_distance_mask;
clip.UserClipDistanceCullTestEnableBitmask = last->cull_distance_mask;