d3d12: Fix GCC warnings for missing function prototypes

Most of these are adding 'static', for functions that are local
to a translation unit but weren't declared static.

There's one instance of a missing include for bringing the prototype
into the translation unit, one function missing a return type (default-int),
and one which added inline to avoid it being considered unused in some sources.

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7780>
This commit is contained in:
Jesse Natalie
2020-11-25 17:18:26 -08:00
committed by Marge Bot
parent 30e5abe5f5
commit c1c1bad582
8 changed files with 18 additions and 16 deletions

View File

@@ -24,6 +24,7 @@
#include "nir.h"
#include "nir_builder.h"
#include "d3d12_compiler.h"
#include "d3d12_nir_passes.h"
#include "program/prog_statevars.h"
struct lower_state {

View File

@@ -25,7 +25,7 @@
#include "nir_builder.h"
#include "nir_builtin_builder.h"
bool
static bool
lower_sample_tex_compare_filter(const nir_instr *instr,
UNUSED const void *_options)
{

View File

@@ -580,7 +580,7 @@ d3d12_create_bare_samplers(nir_shader *nir)
}
}
bool
static bool
lower_bool_input_filter(const nir_instr *instr,
UNUSED const void *_options)
{
@@ -779,7 +779,7 @@ d3d12_fix_io_uint_type(struct nir_shader *s, uint64_t in_mask, uint64_t out_mask
return progress;
}
bool
static bool
lower_load_ubo_packed_filter(const nir_instr *instr,
UNUSED const void *_options) {
if (instr->type != nir_instr_type_intrinsic)

View File

@@ -50,7 +50,7 @@ dxil_buffer_emit_vbr_bits(struct dxil_buffer *b, uint64_t data,
bool
dxil_buffer_align(struct dxil_buffer *b);
static bool
static inline bool
dxil_buffer_emit_abbrev_id(struct dxil_buffer *b, uint32_t id)
{
return dxil_buffer_emit_bits(b, id, b->abbrev_width);

View File

@@ -64,7 +64,7 @@ dxil_module_release(struct dxil_module *m)
dxil_buffer_finish(&m->buf);
}
bool
static bool
emit_bits64(struct dxil_buffer *b, uint64_t data, unsigned width)
{
if (data > UINT32_MAX) {
@@ -1996,7 +1996,7 @@ emit_undef_value(struct dxil_module *m)
return emit_record_no_abbrev(&m->buf, CST_CODE_UNDEF, NULL, 0);
}
uint64_t
static uint64_t
encode_signed(int64_t value)
{
return value >= 0 ?
@@ -2104,7 +2104,7 @@ emit_consts(struct dxil_module *m)
return true;
}
bool
static bool
emit_module_consts(struct dxil_module *m)
{
return enter_subblock(m, DXIL_CONST_BLOCK, 4) &&
@@ -2988,7 +2988,7 @@ emit_cast(struct dxil_module *m, struct dxil_instr *instr)
data, ARRAY_SIZE(data));
}
bool
static bool
emit_branch(struct dxil_module *m, struct dxil_instr *instr)
{
assert(instr->type == INSTR_BR);
@@ -3014,7 +3014,7 @@ emit_branch(struct dxil_module *m, struct dxil_instr *instr)
data, ARRAY_SIZE(data));
}
bool
static bool
emit_phi(struct dxil_module *m, struct dxil_instr *instr)
{
assert(instr->type == INSTR_PHI);

View File

@@ -417,7 +417,7 @@ lower_store_ssbo(nir_builder *b, nir_intrinsic_instr *intr)
return true;
}
void
static void
lower_load_vec32(nir_builder *b, nir_ssa_def *index, unsigned num_comps, nir_ssa_def **comps, nir_intrinsic_op op)
{
for (unsigned i = 0; i < num_comps; i++) {
@@ -719,7 +719,7 @@ dxil_nir_lower_ubo_to_temp(nir_shader *nir)
return progress;
}
bool
static bool
lower_load_ubo(nir_builder *b, nir_intrinsic_instr *intr)
{
assert(intr->dest.is_ssa);
@@ -788,6 +788,7 @@ dxil_nir_lower_loads_stores_to_dxil(nir_shader *nir)
return progress;
}
static bool
lower_shared_atomic(nir_builder *b, nir_intrinsic_instr *intr,
nir_intrinsic_op dxil_op)
{

View File

@@ -25,7 +25,7 @@
#include "nir_builder.h"
#include "nir_builtin_builder.h"
bool
static bool
lower_sample_to_txf_for_integer_tex_filter(const nir_instr *instr,
UNUSED const void *_options)
{
@@ -42,7 +42,7 @@ lower_sample_to_txf_for_integer_tex_filter(const nir_instr *instr,
return (tex->dest_type & (nir_type_int | nir_type_uint));
}
nir_ssa_def *
static nir_ssa_def *
dx_get_texture_lod(nir_builder *b, nir_tex_instr *tex)
{
nir_tex_instr *tql;
@@ -249,7 +249,7 @@ load_bordercolor(nir_builder *b, nir_tex_instr *tex, dxil_wrap_sampler_state *ac
return nir_build_imm(b, ndest_comp, 32, const_value);
}
nir_tex_instr *
static nir_tex_instr *
create_txf_from_tex(nir_builder *b, nir_tex_instr *tex)
{
nir_tex_instr *txf;

View File

@@ -1996,7 +1996,7 @@ emit_alu(struct ntd_context *ctx, nir_alu_instr *alu)
}
}
const struct dxil_value *
static const struct dxil_value *
load_ubo(struct ntd_context *ctx, const struct dxil_value *handle,
const struct dxil_value *offset, enum overload_type overload)
{
@@ -4031,7 +4031,7 @@ emit_module(struct ntd_context *ctx, nir_shader *s, const struct nir_to_dxil_opt
dxil_emit_module(&ctx->mod);
}
unsigned int
static unsigned int
get_dxil_shader_kind(struct nir_shader *s)
{
switch (s->info.stage) {