1 #ifndef SFN_EMITSSBOINSTRUCTION_H 2 #define SFN_EMITSSBOINSTRUCTION_H 3 4 #include "sfn_emitinstruction.h" 5 #include "sfn_instruction_gds.h" 6 #include "sfn_value_gpr.h" 7 8 namespace r600 { 9 10 class EmitSSBOInstruction: public EmitInstruction { 11 public: 12 EmitSSBOInstruction(ShaderFromNirProcessor& processor); 13 14 void set_ssbo_offset(int offset); 15 16 void set_require_rat_return_address(); 17 bool load_rat_return_address(); 18 bool load_atomic_inc_limits(); 19 20 private: 21 bool do_emit(nir_instr *instr); 22 23 bool emit_atomic(const nir_intrinsic_instr* instr); 24 bool emit_unary_atomic(const nir_intrinsic_instr* instr); 25 bool emit_atomic_add(const nir_intrinsic_instr* instr); 26 bool emit_atomic_inc(const nir_intrinsic_instr* instr); 27 bool emit_atomic_pre_dec(const nir_intrinsic_instr* instr); 28 29 bool emit_load_ssbo(const nir_intrinsic_instr* instr); 30 bool emit_store_ssbo(const nir_intrinsic_instr* instr); 31 32 bool emit_image_size(const nir_intrinsic_instr *intrin); 33 bool emit_image_load(const nir_intrinsic_instr *intrin); 34 bool emit_image_store(const nir_intrinsic_instr *intrin); 35 bool emit_ssbo_atomic_op(const nir_intrinsic_instr *intrin); 36 bool emit_buffer_size(const nir_intrinsic_instr *intrin); 37 38 bool fetch_return_value(const nir_intrinsic_instr *intrin); 39 40 bool make_stores_ack_and_waitack(); 41 42 ESDOp get_opcode(nir_intrinsic_op opcode); 43 RatInstruction::ERatOp get_rat_opcode(const nir_intrinsic_op opcode, pipe_format format) const; 44 45 GPRVector make_dest(const nir_intrinsic_instr* instr); 46 47 PGPRValue m_atomic_update; 48 49 bool m_require_rat_return_address; 50 GPRVector m_rat_return_address; 51 int m_ssbo_image_offset; 52 std::vector<RatInstruction *> m_store_ops; 53 }; 54 55 } 56 57 #endif // SFN_EMITSSBOINSTRUCTION_H 58