Video Core: initial Implementation of InstanceDraw Packaging

This commit is contained in:
Fernando Sahmkow
2019-09-15 11:48:54 -04:00
committed by FernandoS27
parent b31880dc5e
commit ba02d564f8
7 changed files with 192 additions and 11 deletions

View File

@ -811,8 +811,9 @@ public:
INSERT_PADDING_WORDS(0x21);
u32 vb_element_base;
u32 vb_base_instance;
INSERT_PADDING_WORDS(0x36);
INSERT_PADDING_WORDS(0x35);
union {
BitField<0, 1, u32> c0;
@ -1238,6 +1239,11 @@ public:
/// Write the value to the register identified by method.
void CallMethod(const GPU::MethodCall& method_call);
/// Write the value to the register identified by method.
void CallMethodFromMME(const GPU::MethodCall& method_call);
void FlushMMEInlineDraw();
/// Given a Texture Handle, returns the TSC and TIC entries.
Texture::FullTextureInfo GetTextureInfo(const Texture::TextureHandle tex_handle,
std::size_t offset) const;
@ -1263,6 +1269,18 @@ public:
return execute_on;
}
enum class MMMEDrawMode : u32 {
Undefined,
Array,
Indexed,
};
struct MMEDrawState {
MMMEDrawMode current_mode{MMMEDrawMode::Undefined};
u32 current_count;
u32 instance_count;
} mme_draw;
private:
void InitializeRegisterDefaults();
@ -1275,6 +1293,8 @@ private:
/// Start offsets of each macro in macro_memory
std::array<u32, 0x80> macro_positions = {};
std::array<bool, Regs::NUM_REGS> mme_inline{};
/// Memory for macro code
MacroMemory macro_memory;
@ -1402,6 +1422,7 @@ ASSERT_REG_POSITION(stencil_front_mask, 0x4E7);
ASSERT_REG_POSITION(frag_color_clamp, 0x4EA);
ASSERT_REG_POSITION(screen_y_control, 0x4EB);
ASSERT_REG_POSITION(vb_element_base, 0x50D);
ASSERT_REG_POSITION(vb_base_instance, 0x50E);
ASSERT_REG_POSITION(clip_distance_enabled, 0x544);
ASSERT_REG_POSITION(point_size, 0x546);
ASSERT_REG_POSITION(zeta_enable, 0x54E);