d3d12: Move d3d12_nir_lower_vs_vertex_conversion() to a common place

So we can re-use it in dozen.

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15955>
This commit is contained in:
Louis-Francis Ratté-Boulianne
2022-06-14 03:09:51 -07:00
committed by Marge Bot
parent c378bbab75
commit b0b9b50077
6 changed files with 6 additions and 8 deletions
+1 -1
View File
@@ -113,7 +113,7 @@ compile_nir(struct d3d12_context *ctx, struct d3d12_shader_selector *sel,
screen->base.get_paramf(&screen->base, PIPE_CAPF_MAX_TEXTURE_LOD_BIAS));
if (key->vs.needs_format_emulation)
d3d12_nir_lower_vs_vertex_conversion(nir, key->vs.format_conversion);
dxil_nir_lower_vs_vertex_conversion(nir, key->vs.format_conversion);
uint32_t num_ubos_before_lower_to_ubo = nir->info.num_ubos;
uint32_t num_uniforms_before_lower_to_ubo = nir->num_uniforms;
@@ -93,9 +93,6 @@ d3d12_nir_invert_depth(nir_shader *s, unsigned viewport_mask);
bool
nir_lower_packed_ubo_loads(struct nir_shader *nir);
bool
d3d12_nir_lower_vs_vertex_conversion(nir_shader *s, enum pipe_format target_formats[]);
void
d3d12_lower_primitive_id(nir_shader *shader);
-1
View File
@@ -35,7 +35,6 @@ files_libd3d12 = files(
'd3d12_gs_variant.cpp',
'd3d12_lower_image_casts.c',
'd3d12_lower_point_sprite.c',
'd3d12_nir_lower_vs_vertex_conversion.c',
'd3d12_nir_passes.c',
'd3d12_pipeline_state.cpp',
'd3d12_query.cpp',
+1
View File
@@ -53,6 +53,7 @@ bool dxil_nir_lower_system_values(nir_shader *shader);
bool dxil_nir_split_typed_samplers(nir_shader *shader);
bool dxil_nir_lower_bool_input(struct nir_shader *s);
bool dxil_nir_lower_sysval_to_load_input(nir_shader *s, nir_variable **sysval_vars);
bool dxil_nir_lower_vs_vertex_conversion(nir_shader *s, enum pipe_format target_formats[]);
nir_ssa_def *
build_load_ubo_dxil(nir_builder *b, nir_ssa_def *buffer,
@@ -21,7 +21,7 @@
* USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include "d3d12_nir_passes.h"
#include "dxil_nir.h"
#include "nir_builder.h"
#include "nir_builtin_builder.h"
@@ -147,8 +147,8 @@ lower_vs_vertex_conversion_impl(nir_builder *b, nir_instr *instr, void *options)
* or PIPE_FORMAT_NONE if no conversion is needed
*/
bool
d3d12_nir_lower_vs_vertex_conversion(nir_shader *s,
enum pipe_format target_formats[])
dxil_nir_lower_vs_vertex_conversion(nir_shader *s,
enum pipe_format target_formats[])
{
assert(s->info.stage == MESA_SHADER_VERTEX);
+1
View File
@@ -29,6 +29,7 @@ files_libdxil_compiler = files(
'dxil_nir.c',
'dxil_nir_lower_int_cubemaps.c',
'dxil_nir_lower_int_samplers.c',
'dxil_nir_lower_vs_vertex_conversion.c',
'dxil_signature.c',
'dxil_nir_tess.c',
'nir_to_dxil.c',