const struct glsl_type *type;
- /* The value that declares this type. Used for finding decorations */
- struct vtn_value *val;
+ /* The SPIR-V id of the given type. */
+ uint32_t id;
/* Specifies the length of complex types.
*
};
};
+bool vtn_types_compatible(struct vtn_builder *b,
+ struct vtn_type *t1, struct vtn_type *t2);
+
struct vtn_variable;
enum vtn_access_mode {
jmp_buf fail_jump;
const uint32_t *spirv;
+ size_t spirv_word_count;
nir_shader *shader;
const struct spirv_to_nir_options *options;
vtn_set_instruction_result_type(struct vtn_builder *b, SpvOp opcode,
const uint32_t *w, unsigned count);
+static inline nir_constant *
+vtn_constant_value(struct vtn_builder *b, uint32_t value_id)
+{
+ return vtn_value(b, value_id, vtn_value_type_constant)->constant;
+}
+
struct vtn_ssa_value *vtn_ssa_value(struct vtn_builder *b, uint32_t value_id);
struct vtn_ssa_value *vtn_create_ssa_value(struct vtn_builder *b,
nir_op vtn_nir_alu_op_for_spirv_opcode(struct vtn_builder *b,
SpvOp opcode, bool *swap,
- nir_alu_type src, nir_alu_type dst);
+ unsigned src_bit_size, unsigned dst_bit_size);
void vtn_handle_alu(struct vtn_builder *b, SpvOp opcode,
const uint32_t *w, unsigned count);
+void vtn_handle_subgroup(struct vtn_builder *b, SpvOp opcode,
+ const uint32_t *w, unsigned count);
+
bool vtn_handle_glsl450_instruction(struct vtn_builder *b, uint32_t ext_opcode,
const uint32_t *words, unsigned count);
+struct vtn_builder* vtn_create_builder(const uint32_t *words, size_t word_count,
+ gl_shader_stage stage, const char *entry_point_name,
+ const struct spirv_to_nir_options *options);
+
+void vtn_handle_entry_point(struct vtn_builder *b, const uint32_t *w,
+ unsigned count);
+
+void vtn_handle_decoration(struct vtn_builder *b, SpvOp opcode,
+ const uint32_t *w, unsigned count);
+
static inline uint32_t
vtn_align_u32(uint32_t v, uint32_t a)
{
return (uint64_t)w[1] << 32 | w[0];
}
+bool vtn_handle_amd_gcn_shader_instruction(struct vtn_builder *b, uint32_t ext_opcode,
+ const uint32_t *words, unsigned count);
+
+bool vtn_handle_amd_shader_trinary_minmax_instruction(struct vtn_builder *b, uint32_t ext_opcode,
+ const uint32_t *words, unsigned count);
#endif /* _VTN_PRIVATE_H_ */