X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fmesa%2Fprogram%2Fir_to_mesa.cpp;h=c833a12f2aab1608d8b1c7c02d5a9882973231a7;hb=135b7e72601ab0c3923cafedcd30bb505e54f624;hp=c46a3d005411fe8f4338866465a428dedc3b0c84;hpb=4f1ebb8ddd0294698601a8c4fc38f1e39bfd51f6;p=mesa.git diff --git a/src/mesa/program/ir_to_mesa.cpp b/src/mesa/program/ir_to_mesa.cpp index c46a3d00541..c833a12f2aa 100644 --- a/src/mesa/program/ir_to_mesa.cpp +++ b/src/mesa/program/ir_to_mesa.cpp @@ -44,11 +44,11 @@ #include "main/mtypes.h" #include "main/shaderobj.h" +#include "main/uniforms.h" #include "program/hash_table.h" extern "C" { #include "main/shaderapi.h" -#include "main/uniforms.h" #include "program/prog_instruction.h" #include "program/prog_optimize.h" #include "program/prog_print.h" @@ -57,11 +57,13 @@ extern "C" { #include "program/sampler.h" } +static int swizzle_for_size(int size); + +namespace { + class src_reg; class dst_reg; -static int swizzle_for_size(int size); - /** * This struct is a corresponding struct to Mesa prog_src_register, with * wider fields. @@ -129,6 +131,8 @@ public: src_reg *reladdr; }; +} /* anonymous namespace */ + src_reg::src_reg(dst_reg reg) { this->file = reg.file; @@ -147,9 +151,11 @@ dst_reg::dst_reg(src_reg reg) this->reladdr = reg.reladdr; } +namespace { + class ir_to_mesa_instruction : public exec_node { public: - DECLARE_RZALLOC_CXX_OPERATORS(ir_to_mesa_instruction) + DECLARE_RALLOC_CXX_OPERATORS(ir_to_mesa_instruction) enum prog_opcode op; dst_reg dst; @@ -316,6 +322,8 @@ public: void *mem_ctx; }; +} /* anonymous namespace */ + static src_reg undef_src = src_reg(PROGRAM_UNDEFINED, 0, NULL); static dst_reg undef_dst = dst_reg(PROGRAM_UNDEFINED, SWIZZLE_NOOP); @@ -614,6 +622,7 @@ type_size(const struct glsl_type *type) * at link time. */ return 1; + case GLSL_TYPE_ATOMIC_UINT: case GLSL_TYPE_VOID: case GLSL_TYPE_ERROR: case GLSL_TYPE_INTERFACE: @@ -1489,6 +1498,9 @@ ir_to_mesa_visitor::visit(ir_expression *ir) case ir_quadop_bitfield_insert: case ir_binop_ldexp: case ir_triop_csel: + case ir_binop_carry: + case ir_binop_borrow: + case ir_binop_imul_high: assert(!"not supported"); break; @@ -2058,6 +2070,12 @@ ir_to_mesa_visitor::visit(ir_texture *ir) case ir_lod: assert(!"Unexpected ir_lod opcode"); break; + case ir_tg4: + assert(!"Unexpected ir_tg4 opcode"); + break; + case ir_query_levels: + assert(!"Unexpected ir_query_levels opcode"); + break; } const glsl_type *sampler_type = ir->sampler->type; @@ -2244,7 +2262,7 @@ ir_to_mesa_visitor::visit(ir_if *ir) visit_exec_list(&ir->else_instructions, this); } - if_inst = emit(ir->condition, OPCODE_ENDIF); + emit(ir->condition, OPCODE_ENDIF); } void @@ -2407,6 +2425,8 @@ print_program(struct prog_instruction *mesa_instructions, } } +namespace { + class add_uniform_to_shader : public program_resource_visitor { public: add_uniform_to_shader(struct gl_shader_program *shader_program, @@ -2436,6 +2456,8 @@ private: gl_shader_type shader_type; }; +} /* anonymous namespace */ + void add_uniform_to_shader::visit_field(const glsl_type *type, const char *name, bool row_major) @@ -2580,6 +2602,7 @@ _mesa_associate_uniform_storage(struct gl_context *ctx, format = uniform_native; columns = 1; break; + case GLSL_TYPE_ATOMIC_UINT: case GLSL_TYPE_ARRAY: case GLSL_TYPE_VOID: case GLSL_TYPE_STRUCT: