mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-06-19 08:28:21 +02:00
radv: gather clip/cull distances in the shader info pass
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
This commit is contained in:
parent
b16cf6c4c6
commit
a99d2d5564
2 changed files with 25 additions and 21 deletions
|
|
@ -2277,27 +2277,6 @@ scan_shader_output_decl(struct radv_shader_context *ctx,
|
|||
}
|
||||
|
||||
mask_attribs = ((1ull << attrib_count) - 1) << idx;
|
||||
if (stage == MESA_SHADER_VERTEX ||
|
||||
stage == MESA_SHADER_TESS_EVAL ||
|
||||
stage == MESA_SHADER_GEOMETRY) {
|
||||
if (idx == VARYING_SLOT_CLIP_DIST0) {
|
||||
if (stage == MESA_SHADER_VERTEX) {
|
||||
ctx->shader_info->vs.outinfo.clip_dist_mask = (1 << shader->info.clip_distance_array_size) - 1;
|
||||
ctx->shader_info->vs.outinfo.cull_dist_mask = (1 << shader->info.cull_distance_array_size) - 1;
|
||||
ctx->shader_info->vs.outinfo.cull_dist_mask <<= shader->info.clip_distance_array_size;
|
||||
}
|
||||
if (stage == MESA_SHADER_TESS_EVAL) {
|
||||
ctx->shader_info->tes.outinfo.clip_dist_mask = (1 << shader->info.clip_distance_array_size) - 1;
|
||||
ctx->shader_info->tes.outinfo.cull_dist_mask = (1 << shader->info.cull_distance_array_size) - 1;
|
||||
ctx->shader_info->tes.outinfo.cull_dist_mask <<= shader->info.clip_distance_array_size;
|
||||
}
|
||||
if (stage == MESA_SHADER_GEOMETRY) {
|
||||
ctx->shader_info->vs.outinfo.clip_dist_mask = (1 << shader->info.clip_distance_array_size) - 1;
|
||||
ctx->shader_info->vs.outinfo.cull_dist_mask = (1 << shader->info.cull_distance_array_size) - 1;
|
||||
ctx->shader_info->vs.outinfo.cull_dist_mask <<= shader->info.clip_distance_array_size;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ctx->output_mask |= mask_attribs;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -533,20 +533,45 @@ gather_info_output_decl(const nir_shader *nir, const nir_variable *var,
|
|||
struct radv_shader_info *info,
|
||||
const struct radv_nir_compiler_options *options)
|
||||
{
|
||||
struct radv_vs_output_info *vs_info = NULL;
|
||||
|
||||
switch (nir->info.stage) {
|
||||
case MESA_SHADER_FRAGMENT:
|
||||
gather_info_output_decl_ps(nir, var, info);
|
||||
break;
|
||||
case MESA_SHADER_VERTEX:
|
||||
if (!options->key.vs_common_out.as_ls &&
|
||||
!options->key.vs_common_out.as_es)
|
||||
vs_info = &info->vs.outinfo;
|
||||
|
||||
if (options->key.vs_common_out.as_ls)
|
||||
gather_info_output_decl_ls(nir, var, info);
|
||||
break;
|
||||
case MESA_SHADER_GEOMETRY:
|
||||
vs_info = &info->vs.outinfo;
|
||||
gather_info_output_decl_gs(nir, var, info);
|
||||
break;
|
||||
case MESA_SHADER_TESS_EVAL:
|
||||
if (!options->key.vs_common_out.as_es)
|
||||
vs_info = &info->tes.outinfo;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (vs_info) {
|
||||
switch (var->data.location) {
|
||||
case VARYING_SLOT_CLIP_DIST0:
|
||||
vs_info->clip_dist_mask =
|
||||
(1 << nir->info.clip_distance_array_size) - 1;
|
||||
vs_info->cull_dist_mask =
|
||||
(1 << nir->info.cull_distance_array_size) - 1;
|
||||
vs_info->cull_dist_mask <<= nir->info.clip_distance_array_size;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue