mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 07:08:04 +02:00
microsoft/compiler: Fix warnings produced by GCC in release mode
Inline some variables/functions that are only used for asserts. Reviewed-by: Adam Jackson <ajax@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8248>
This commit is contained in:
parent
33a6c01e12
commit
bb6a1f5b1e
2 changed files with 6 additions and 11 deletions
|
|
@ -2506,7 +2506,7 @@ create_instr(struct dxil_module *m, enum instr_type type,
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool
|
static inline bool
|
||||||
legal_arith_type(const struct dxil_type *type)
|
legal_arith_type(const struct dxil_type *type)
|
||||||
{
|
{
|
||||||
switch (type->type) {
|
switch (type->type) {
|
||||||
|
|
|
||||||
|
|
@ -874,7 +874,6 @@ var_fill_const_array_with_vector_or_scalar(struct ntd_context *ctx,
|
||||||
unsigned int offset)
|
unsigned int offset)
|
||||||
{
|
{
|
||||||
assert(glsl_type_is_vector_or_scalar(type));
|
assert(glsl_type_is_vector_or_scalar(type));
|
||||||
enum glsl_base_type base_type = glsl_get_base_type(type);
|
|
||||||
unsigned int components = glsl_get_vector_elements(type);
|
unsigned int components = glsl_get_vector_elements(type);
|
||||||
unsigned bit_size = glsl_get_bit_size(type);
|
unsigned bit_size = glsl_get_bit_size(type);
|
||||||
unsigned int increment = bit_size / 8;
|
unsigned int increment = bit_size / 8;
|
||||||
|
|
@ -893,7 +892,7 @@ var_fill_const_array_with_vector_or_scalar(struct ntd_context *ctx,
|
||||||
memcpy(dst, &c->values[comp].u16, sizeof(c->values[0].u16));
|
memcpy(dst, &c->values[comp].u16, sizeof(c->values[0].u16));
|
||||||
break;
|
break;
|
||||||
case 8:
|
case 8:
|
||||||
assert(glsl_base_type_is_integer(base_type));
|
assert(glsl_base_type_is_integer(glsl_get_base_type(type)));
|
||||||
memcpy(dst, &c->values[comp].u8, sizeof(c->values[0].u8));
|
memcpy(dst, &c->values[comp].u8, sizeof(c->values[0].u8));
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|
@ -2304,12 +2303,11 @@ static bool
|
||||||
emit_store_shared(struct ntd_context *ctx, nir_intrinsic_instr *intr)
|
emit_store_shared(struct ntd_context *ctx, nir_intrinsic_instr *intr)
|
||||||
{
|
{
|
||||||
const struct dxil_value *zero, *index;
|
const struct dxil_value *zero, *index;
|
||||||
unsigned bit_size = nir_src_bit_size(intr->src[0]);
|
|
||||||
|
|
||||||
/* All shared mem accesses should have been lowered to scalar 32bit
|
/* All shared mem accesses should have been lowered to scalar 32bit
|
||||||
* accesses.
|
* accesses.
|
||||||
*/
|
*/
|
||||||
assert(bit_size == 32);
|
assert(nir_src_bit_size(intr->src[0]) == 32);
|
||||||
assert(nir_src_num_components(intr->src[0]) == 1);
|
assert(nir_src_num_components(intr->src[0]) == 1);
|
||||||
|
|
||||||
zero = dxil_module_get_int32_const(&ctx->mod, 0);
|
zero = dxil_module_get_int32_const(&ctx->mod, 0);
|
||||||
|
|
@ -2354,12 +2352,11 @@ static bool
|
||||||
emit_store_scratch(struct ntd_context *ctx, nir_intrinsic_instr *intr)
|
emit_store_scratch(struct ntd_context *ctx, nir_intrinsic_instr *intr)
|
||||||
{
|
{
|
||||||
const struct dxil_value *zero, *index;
|
const struct dxil_value *zero, *index;
|
||||||
unsigned bit_size = nir_src_bit_size(intr->src[0]);
|
|
||||||
|
|
||||||
/* All scratch mem accesses should have been lowered to scalar 32bit
|
/* All scratch mem accesses should have been lowered to scalar 32bit
|
||||||
* accesses.
|
* accesses.
|
||||||
*/
|
*/
|
||||||
assert(bit_size == 32);
|
assert(nir_src_bit_size(intr->src[0]) == 32);
|
||||||
assert(nir_src_num_components(intr->src[0]) == 1);
|
assert(nir_src_num_components(intr->src[0]) == 1);
|
||||||
|
|
||||||
zero = dxil_module_get_int32_const(&ctx->mod, 0);
|
zero = dxil_module_get_int32_const(&ctx->mod, 0);
|
||||||
|
|
@ -2974,9 +2971,8 @@ emit_shared_atomic(struct ntd_context *ctx, nir_intrinsic_instr *intr,
|
||||||
enum dxil_rmw_op op, nir_alu_type type)
|
enum dxil_rmw_op op, nir_alu_type type)
|
||||||
{
|
{
|
||||||
const struct dxil_value *zero, *index;
|
const struct dxil_value *zero, *index;
|
||||||
unsigned bit_size = nir_src_bit_size(intr->src[1]);
|
|
||||||
|
|
||||||
assert(bit_size == 32);
|
assert(nir_src_bit_size(intr->src[1]) == 32);
|
||||||
|
|
||||||
zero = dxil_module_get_int32_const(&ctx->mod, 0);
|
zero = dxil_module_get_int32_const(&ctx->mod, 0);
|
||||||
if (!zero)
|
if (!zero)
|
||||||
|
|
@ -3009,9 +3005,8 @@ static bool
|
||||||
emit_shared_atomic_comp_swap(struct ntd_context *ctx, nir_intrinsic_instr *intr)
|
emit_shared_atomic_comp_swap(struct ntd_context *ctx, nir_intrinsic_instr *intr)
|
||||||
{
|
{
|
||||||
const struct dxil_value *zero, *index;
|
const struct dxil_value *zero, *index;
|
||||||
unsigned bit_size = nir_src_bit_size(intr->src[1]);
|
|
||||||
|
|
||||||
assert(bit_size == 32);
|
assert(nir_src_bit_size(intr->src[1]) == 32);
|
||||||
|
|
||||||
zero = dxil_module_get_int32_const(&ctx->mod, 0);
|
zero = dxil_module_get_int32_const(&ctx->mod, 0);
|
||||||
if (!zero)
|
if (!zero)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue