nir: Don't include the full nir.h when not necessary.

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33439>
This commit is contained in:
Timur Kristóf 2025-02-07 00:58:16 +01:00
parent 1ebe06f8f0
commit 94996d546c
24 changed files with 33 additions and 15 deletions

View file

@ -12,6 +12,7 @@
#include "util/u_atomic.h"
#include "util/u_debug.h"
#include "nir_serialize.h"
#include "nir.h"
#include "radv_debug.h"
#include "radv_descriptor_set.h"
#include "radv_pipeline.h"

View file

@ -28,7 +28,8 @@
#ifndef NIR_CONSTANT_EXPRESSIONS_H
#define NIR_CONSTANT_EXPRESSIONS_H
#include "nir.h"
#include "nir_defines.h"
#include "nir_opcodes.h"
void nir_eval_const_opcode(nir_op op, nir_const_value *dest,
unsigned num_components, unsigned bit_size,

View file

@ -65,6 +65,7 @@ template = """\
#include "util/format_r11g11b10f.h"
#include "util/u_math.h"
#include "nir_constant_expressions.h"
#include "nir.h"
/**
* \brief Checks if the provided value is a denorm and flushes it to zero.

View file

@ -25,7 +25,6 @@
#define NIR_DEREF_H
#include "nir.h"
#include "nir_builder.h"
#ifdef __cplusplus
extern "C" {

View file

@ -24,6 +24,7 @@
#include "nir_instr_set.h"
#include "util/half_float.h"
#include "nir_vla.h"
#include "nir.h"
/* This function determines if uses of an instruction can safely be rewritten
* to use another identical instruction instead. Note that this function must

View file

@ -24,7 +24,8 @@
#ifndef NIR_INSTR_SET_H
#define NIR_INSTR_SET_H
#include "nir.h"
#include "nir_defines.h"
#include "util/set.h"
/**
* This file defines functions for creating, destroying, and manipulating an

View file

@ -25,7 +25,7 @@
#ifndef NIR_BLEND_H
#define NIR_BLEND_H
#include "compiler/nir/nir.h"
#include "compiler/nir/nir_defines.h"
#include "util/blend.h"
#include "util/format/u_formats.h"

View file

@ -22,6 +22,7 @@
*/
#include "nir_instr_set.h"
#include "nir.h"
/*
* Implements common subexpression elimination

View file

@ -22,7 +22,8 @@
*/
#include "nir_phi_builder.h"
#include "nir/nir_vla.h"
#include "nir_vla.h"
#include "nir.h"
struct nir_phi_builder {
nir_shader *shader;

View file

@ -24,7 +24,8 @@
#ifndef NIR_PHI_BUILDER_H
#define NIR_PHI_BUILDER_H
#include "nir.h"
#include "nir_defines.h"
#include "util/bitset.h"
/** A helper for placing phi nodes in a NIR shader
*

View file

@ -23,7 +23,8 @@
#ifndef _NIR_RANGE_ANALYSIS_H_
#define _NIR_RANGE_ANALYSIS_H_
#include "nir.h"
#include "nir_defines.h"
#include "util/u_hash_table.h"
enum ENUM_PACKED ssa_ranges {
unknown = 0,

View file

@ -22,6 +22,7 @@
*/
#include "nir_schedule.h"
#include "nir.h"
#include "util/dag.h"
#include "util/u_dynarray.h"

View file

@ -24,7 +24,7 @@
#ifndef NIR_SCHEDULE_H
#define NIR_SCHEDULE_H
#include "nir.h"
#include "nir_defines.h"
#ifdef __cplusplus
extern "C" {

View file

@ -25,7 +25,8 @@
#define _NIR_SERIALIZE_H
#include "util/blob.h"
#include "nir.h"
#include "nir_defines.h"
#include "nir_shader_compiler_options.h"
#ifdef __cplusplus
extern "C" {

View file

@ -21,8 +21,8 @@
* IN THE SOFTWARE.
*/
#include "nir.h"
#include "nir_deref.h"
#include "nir_builder.h"
static nir_variable *
find_var_member(struct nir_variable *var, unsigned member,

View file

@ -22,6 +22,7 @@
*/
#include "nir_worklist.h"
#include "nir.h"
void
nir_block_worklist_add_all(nir_block_worklist *w, nir_function_impl *impl)

View file

@ -27,7 +27,7 @@
#include "util/set.h"
#include "util/u_vector.h"
#include "util/u_worklist.h"
#include "nir.h"
#include "nir_defines.h"
#ifdef __cplusplus
extern "C" {

View file

@ -22,6 +22,7 @@
*/
#include "compiler/nir/nir.h"
#include "compiler/nir/nir_builder.h"
#include "compiler/nir/nir_deref.h"
#include "compiler/nir/nir_legacy.h"
#include "compiler/nir/nir_worklist.h"

View file

@ -29,6 +29,7 @@
#include "tgsi/tgsi_parse.h"
#include "compiler/nir/nir_serialize.h"
#include "compiler/nir/nir.h"
#include "util/blob.h"
#include "util/hash_table.h"

View file

@ -5,6 +5,7 @@
#include "nir_to_rc.h"
#include "compiler/nir/nir.h"
#include "compiler/nir/nir_builder.h"
#include "compiler/nir/nir_deref.h"
#include "compiler/nir/nir_legacy.h"
#include "compiler/nir/nir_worklist.h"

View file

@ -7,6 +7,7 @@
#include "ac_nir.h"
#include "ac_shader_util.h"
#include "compiler/nir/nir_serialize.h"
#include "compiler/nir/nir.h"
#include "nir/tgsi_to_nir.h"
#include "si_build_pm4.h"
#include "sid.h"

View file

@ -39,6 +39,7 @@
#include "util/u_memory.h"
#include "util/u_prim.h"
#include "nir_serialize.h"
#include "nir.h"
#include "nir/nir_draw_helpers.h"
/* for pipeline cache */
@ -1303,7 +1304,7 @@ create_gfx_program_separable(struct zink_context *ctx, struct zink_shader **stag
refs++;
}
}
/* We can do this add after the _mesa_set_adds above because we know the prog->shaders[] are
/* We can do this add after the _mesa_set_adds above because we know the prog->shaders[] are
* referenced by the draw state and zink_gfx_shader_free() can't be called on them while we're in here.
*/
p_atomic_add(&prog->base.reference.count, refs - 1);
@ -1366,7 +1367,7 @@ print_pipeline_stats(struct zink_screen *screen, VkPipeline pipeline, struct uti
VkPipelineInfoKHR pinfo = {
VK_STRUCTURE_TYPE_PIPELINE_INFO_KHR,
NULL,
pipeline
pipeline
};
unsigned exe_count = 0;
VkPipelineExecutablePropertiesKHR props[10] = {0};
@ -1403,7 +1404,7 @@ print_pipeline_stats(struct zink_screen *screen, VkPipeline pipeline, struct uti
mesa_loge("ZINK: failed to allocate stats!");
return;
}
for (unsigned i = 0; i < count; i++)
stats[i].sType = VK_STRUCTURE_TYPE_PIPELINE_EXECUTABLE_STATISTIC_KHR;
VKSCR(GetPipelineExecutableStatisticsKHR)(screen->dev, &info, &count, stats);
@ -2145,7 +2146,7 @@ zink_create_pipeline_lib(struct zink_screen *screen, struct zink_gfx_program *pr
mesa_loge("ZINK: failed to allocate gkey!");
return NULL;
}
gkey->optimal_key = state->optimal_key;
assert(gkey->optimal_key);
for (unsigned i = 0; i < ZINK_GFX_SHADER_COUNT; i++)

View file

@ -27,6 +27,7 @@
#include "util/disk_cache.h"
#include "util/mesa-sha1.h"
#include "nir/nir_serialize.h"
#include "nir/nir.h"
#include "anv_private.h"
#include "nir/nir_xfb_info.h"
#include "vk_util.h"

View file

@ -38,6 +38,7 @@
#include "vk_util.h"
#include "nir_serialize.h"
#include "nir.h"
#include "util/mesa-sha1.h"