anv/pipeline: Replace get_fs_input_map with get_last_vue_prog_data
This lets us delete a helper from genX_pipeline.c Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
This commit is contained in:
@@ -270,7 +270,7 @@ populate_wm_prog_key(const struct anv_pipeline *pipeline,
|
||||
/* 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 */
|
||||
|
@@ -1498,15 +1498,15 @@ ANV_DECL_GET_PROG_DATA_FUNC(gs, MESA_SHADER_GEOMETRY)
|
||||
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
|
||||
|
@@ -286,7 +286,6 @@ static void
|
||||
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);
|
||||
@@ -296,7 +295,8 @@ emit_3dstate_sbe(struct anv_pipeline *pipeline)
|
||||
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),
|
||||
@@ -846,19 +846,6 @@ emit_cb_state(struct anv_pipeline *pipeline,
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 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,
|
||||
@@ -886,7 +873,8 @@ emit_3dstate_clip(struct anv_pipeline *pipeline,
|
||||
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;
|
||||
|
Reference in New Issue
Block a user