mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-24 21:50:12 +01:00
llvmpipe/fs: move some tgsi checks in nir path to nir code.
This just does the equivalent checks using NIR instead of tgsi translated info. Reviewed-by: Emma Anholt <emma@anholt.net> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24804>
This commit is contained in:
parent
156d509ca4
commit
e32510be82
1 changed files with 9 additions and 5 deletions
|
|
@ -504,6 +504,14 @@ llvmpipe_nir_is_linear_compat(struct nir_shader *shader,
|
|||
struct lp_tgsi_info *info)
|
||||
{
|
||||
int num_tex = info->num_texs;
|
||||
|
||||
if (util_bitcount64(shader->info.inputs_read) > LP_MAX_LINEAR_INPUTS)
|
||||
return false;
|
||||
|
||||
if (!shader->info.outputs_written || shader->info.fs.color_is_dual_source ||
|
||||
(shader->info.outputs_written & ~BITFIELD64_BIT(FRAG_RESULT_DATA0)))
|
||||
return false;
|
||||
|
||||
info->num_texs = 0;
|
||||
nir_foreach_function_impl(impl, shader) {
|
||||
if (!llvmpipe_nir_fn_is_linear_compat(shader, impl, info))
|
||||
|
|
@ -521,11 +529,7 @@ llvmpipe_nir_is_linear_compat(struct nir_shader *shader,
|
|||
void
|
||||
llvmpipe_fs_analyse_nir(struct lp_fragment_shader *shader)
|
||||
{
|
||||
if (shader->info.base.num_inputs <= LP_MAX_LINEAR_INPUTS &&
|
||||
shader->info.base.num_outputs == 1 &&
|
||||
shader->info.base.output_semantic_name[0] == TGSI_SEMANTIC_COLOR &&
|
||||
shader->info.base.output_semantic_index[0] == 0 &&
|
||||
!shader->info.indirect_textures &&
|
||||
if (!shader->info.indirect_textures &&
|
||||
!shader->info.sampler_texture_units_different &&
|
||||
shader->info.num_texs <= LP_MAX_LINEAR_TEXTURES &&
|
||||
llvmpipe_nir_is_linear_compat(shader->base.ir.nir, &shader->info)) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue