d3d12: Move lower_sample_pos to microsoft/compiler
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19471>
This commit is contained in:
@@ -1433,7 +1433,7 @@ d3d12_create_shader(struct d3d12_context *ctx,
|
||||
next ? next->current->nir->info.inputs_read : 0);
|
||||
} else {
|
||||
NIR_PASS_V(nir, nir_lower_fragcoord_wtrans);
|
||||
NIR_PASS_V(nir, d3d12_lower_sample_pos);
|
||||
NIR_PASS_V(nir, dxil_nir_lower_sample_pos);
|
||||
dxil_sort_ps_outputs(nir);
|
||||
}
|
||||
|
||||
|
||||
@@ -888,27 +888,6 @@ d3d12_lower_triangle_strip(nir_shader *shader)
|
||||
NIR_PASS_V(shader, nir_lower_var_copies);
|
||||
}
|
||||
|
||||
static bool
|
||||
is_sample_pos(const nir_instr *instr, const void *_data)
|
||||
{
|
||||
if (instr->type != nir_instr_type_intrinsic)
|
||||
return false;
|
||||
nir_intrinsic_instr *intr = nir_instr_as_intrinsic(instr);
|
||||
return intr->intrinsic == nir_intrinsic_load_sample_pos;
|
||||
}
|
||||
|
||||
static nir_ssa_def *
|
||||
lower_sample_pos(nir_builder *b, nir_instr *instr, void *_data)
|
||||
{
|
||||
return nir_load_sample_pos_from_id(b, 32, nir_load_sample_id(b));
|
||||
}
|
||||
|
||||
bool
|
||||
d3d12_lower_sample_pos(nir_shader *s)
|
||||
{
|
||||
return nir_shader_lower_instructions(s, is_sample_pos, lower_sample_pos, NULL);
|
||||
}
|
||||
|
||||
static bool
|
||||
is_multisampling_instr(const nir_instr *instr, const void *_data)
|
||||
{
|
||||
|
||||
@@ -102,9 +102,6 @@ d3d12_lower_triangle_strip(nir_shader *shader);
|
||||
bool
|
||||
d3d12_lower_image_casts(nir_shader *s, struct d3d12_image_format_conversion_info *info);
|
||||
|
||||
bool
|
||||
d3d12_lower_sample_pos(nir_shader *s);
|
||||
|
||||
bool
|
||||
d3d12_disable_multisampling(nir_shader *s);
|
||||
|
||||
|
||||
@@ -2156,3 +2156,24 @@ dxil_nir_ensure_position_writes(nir_shader *s)
|
||||
nir_metadata_block_index | nir_metadata_dominance,
|
||||
NULL);
|
||||
}
|
||||
|
||||
static bool
|
||||
is_sample_pos(const nir_instr *instr, const void *_data)
|
||||
{
|
||||
if (instr->type != nir_instr_type_intrinsic)
|
||||
return false;
|
||||
nir_intrinsic_instr *intr = nir_instr_as_intrinsic(instr);
|
||||
return intr->intrinsic == nir_intrinsic_load_sample_pos;
|
||||
}
|
||||
|
||||
static nir_ssa_def *
|
||||
lower_sample_pos(nir_builder *b, nir_instr *instr, void *_data)
|
||||
{
|
||||
return nir_load_sample_pos_from_id(b, 32, nir_load_sample_id(b));
|
||||
}
|
||||
|
||||
bool
|
||||
dxil_nir_lower_sample_pos(nir_shader *s)
|
||||
{
|
||||
return nir_shader_lower_instructions(s, is_sample_pos, lower_sample_pos, NULL);
|
||||
}
|
||||
|
||||
@@ -77,6 +77,7 @@ bool dxil_nir_lower_ubo_array_one_to_static(nir_shader *s);
|
||||
bool dxil_nir_fix_io_uint_type(nir_shader *s, uint64_t in_mask, uint64_t out_mask);
|
||||
bool dxil_nir_lower_discard_and_terminate(nir_shader* s);
|
||||
bool dxil_nir_ensure_position_writes(nir_shader *s);
|
||||
bool dxil_nir_lower_sample_pos(nir_shader *s);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user