From 6b775034dd8343c06369b64bf073d6a70f35f510 Mon Sep 17 00:00:00 2001 From: Dwayne Slater Date: Wed, 2 Mar 2016 22:16:38 -0500 Subject: Add immediate mode vertex submission --- src/video_core/pica.h | 66 +++++++++------------------------------------------ 1 file changed, 11 insertions(+), 55 deletions(-) (limited to 'src/video_core/pica.h') diff --git a/src/video_core/pica.h b/src/video_core/pica.h index 9077b1725..2e0c33201 100644 --- a/src/video_core/pica.h +++ b/src/video_core/pica.h @@ -1089,7 +1089,16 @@ struct Regs { } } command_buffer; - INSERT_PADDING_WORDS(0x20); + INSERT_PADDING_WORDS(0x07); + + enum class GPUMode : u32 { + Drawing = 0, + Configuring = 1 + }; + + GPUMode gpu_mode; + + INSERT_PADDING_WORDS(0x18); enum class TriangleTopology : u32 { List = 0, @@ -1278,6 +1287,7 @@ ASSERT_REG_POSITION(trigger_draw, 0x22e); ASSERT_REG_POSITION(trigger_draw_indexed, 0x22f); ASSERT_REG_POSITION(vs_default_attributes_setup, 0x232); ASSERT_REG_POSITION(command_buffer, 0x238); +ASSERT_REG_POSITION(gpu_mode, 0x245); ASSERT_REG_POSITION(triangle_topology, 0x25e); ASSERT_REG_POSITION(restart_primitive, 0x25f); ASSERT_REG_POSITION(gs, 0x280); @@ -1292,64 +1302,10 @@ static_assert(sizeof(Regs::ShaderConfig) == 0x30 * sizeof(u32), "ShaderConfig st static_assert(sizeof(Regs) <= 0x300 * sizeof(u32), "Register set structure larger than it should be"); static_assert(sizeof(Regs) >= 0x300 * sizeof(u32), "Register set structure smaller than it should be"); -/// Struct used to describe current Pica state -struct State { - /// Pica registers - Regs regs; - - /// Vertex shader memory - struct ShaderSetup { - struct { - // The float uniforms are accessed by the shader JIT using SSE instructions, and are - // therefore required to be 16-byte aligned. - Math::Vec4 MEMORY_ALIGNED16(f[96]); - - std::array b; - std::array, 4> i; - } uniforms; - - Math::Vec4 default_attributes[16]; - - std::array program_code; - std::array swizzle_data; - }; - - ShaderSetup vs; - ShaderSetup gs; - - struct { - union LutEntry { - // Used for raw access - u32 raw; - - // LUT value, encoded as 12-bit fixed point, with 12 fraction bits - BitField< 0, 12, u32> value; - - // Used by HW for efficient interpolation, Citra does not use these - BitField<12, 12, u32> difference; - - float ToFloat() { - return static_cast(value) / 4095.f; - } - }; - - std::array, 24> luts; - } lighting; - - /// Current Pica command list - struct { - const u32* head_ptr; - const u32* current_ptr; - u32 length; - } cmd_list; -}; - /// Initialize Pica state void Init(); /// Shutdown Pica state void Shutdown(); -extern State g_state; ///< Current Pica state - } // namespace -- cgit v1.2.3