*
*/
-#include "nir.h"
-
-/*
- * Have GCC/Clang warn when NIR headers use C99 extensions that are not
- * supported in C++, as they are not portable. In particular MSVC does not
- * support C99 structure field initializers.
- */
-#if defined(__GNUC__)
-# pragma GCC diagnostic push
-# if defined(__clang__)
-# pragma GCC diagnostic warning "-Wc99-extensions"
-# else
-# pragma GCC diagnostic warning "-Wpedantic"
-# endif
-#endif
-
+#include "glsl_to_nir.h"
#include "nir_control_flow.h"
#include "nir_builder.h"
-
-#if defined(__GNUC__)
-# pragma GCC diagnostic pop
-#endif
-
-#include "glsl_to_nir.h"
#include "compiler/glsl/ir_visitor.h"
#include "compiler/glsl/ir_hierarchical_visitor.h"
#include "compiler/glsl/ir.h"
v2.run(sh->ir);
visit_exec_list(sh->ir, &v1);
- nir_lower_outputs_to_temporaries(shader, nir_shader_get_entrypoint(shader));
-
shader->info.name = ralloc_asprintf(shader, "GLSL%d", shader_prog->Name);
if (shader_prog->Label)
shader->info.label = ralloc_strdup(shader, shader_prog->Label);
instr->num_components = type->vector_elements;
/* Setup destination register */
- unsigned bit_size = glsl_get_bit_size(type->base_type);
+ unsigned bit_size = glsl_get_bit_size(type);
nir_ssa_dest_init(&instr->instr, &instr->dest,
type->vector_elements, bit_size, NULL);
instr->num_components = type->vector_elements;
/* Setup destination register */
- unsigned bit_size = glsl_get_bit_size(type->base_type);
+ unsigned bit_size = glsl_get_bit_size(type);
nir_ssa_dest_init(&instr->instr, &instr->dest,
type->vector_elements, bit_size, NULL);
/* Atomic result */
assert(ir->return_deref);
- unsigned bit_size = glsl_get_bit_size(ir->return_deref->type->base_type);
+ unsigned bit_size = glsl_get_bit_size(ir->return_deref->type);
nir_ssa_dest_init(&instr->instr, &instr->dest,
ir->return_deref->type->vector_elements,
bit_size, NULL);
load_instr->num_components = ir->type->vector_elements;
load_instr->variables[0] = this->deref_head;
ralloc_steal(load_instr, load_instr->variables[0]);
- unsigned bit_size = glsl_get_bit_size(ir->type->base_type);
+ unsigned bit_size = glsl_get_bit_size(ir->type);
add_instr(&load_instr->instr, ir->type->vector_elements, bit_size);
}
case ir_binop_ubo_load: {
nir_intrinsic_instr *load =
nir_intrinsic_instr_create(this->shader, nir_intrinsic_load_ubo);
- unsigned bit_size = glsl_get_bit_size(ir->type->base_type);
+ unsigned bit_size = glsl_get_bit_size(ir->type);
load->num_components = ir->type->vector_elements;
load->src[0] = nir_src_for_ssa(evaluate_rvalue(ir->operands[0]));
load->src[1] = nir_src_for_ssa(evaluate_rvalue(ir->operands[1]));
intrin->intrinsic == nir_intrinsic_interp_var_at_sample)
intrin->src[0] = nir_src_for_ssa(evaluate_rvalue(ir->operands[1]));
- unsigned bit_size = glsl_get_bit_size(deref->type->base_type);
+ unsigned bit_size = glsl_get_bit_size(deref->type);
add_instr(&intrin->instr, deref->type->vector_elements, bit_size);
if (swizzle) {
nir_intrinsic_get_buffer_size);
load->num_components = ir->type->vector_elements;
load->src[0] = nir_src_for_ssa(evaluate_rvalue(ir->operands[0]));
- unsigned bit_size = glsl_get_bit_size(ir->type->base_type);
+ unsigned bit_size = glsl_get_bit_size(ir->type);
add_instr(&load->instr, ir->type->vector_elements, bit_size);
return;
}
assert(src_number == num_srcs);
- unsigned bit_size = glsl_get_bit_size(ir->type->base_type);
+ unsigned bit_size = glsl_get_bit_size(ir->type);
add_instr(&instr->instr, nir_tex_instr_dest_size(instr), bit_size);
}