From ba02d564f8a0b0167b96f247b6ad9d2bde05b6c8 Mon Sep 17 00:00:00 2001 From: Fernando Sahmkow Date: Sun, 15 Sep 2019 11:48:54 -0400 Subject: Video Core: initial Implementation of InstanceDraw Packaging --- src/video_core/engines/maxwell_3d.h | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to 'src/video_core/engines/maxwell_3d.h') diff --git a/src/video_core/engines/maxwell_3d.h b/src/video_core/engines/maxwell_3d.h index e5ec90717..1547d930e 100644 --- a/src/video_core/engines/maxwell_3d.h +++ b/src/video_core/engines/maxwell_3d.h @@ -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 macro_positions = {}; + std::array 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); -- cgit v1.2.3