diff options
| author | Pierre Bourdon <delroth@gmail.com> | 2018-12-04 08:47:46 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-12-04 08:47:46 +0100 |
| commit | 59de8ea50338b39f604fde738229aaeb791cc459 (patch) | |
| tree | 17f445fc7a686cd28859e6c46fb1a32d64a56123 /Source/Core/VideoBackends/Software | |
| parent | c675ef148e6872115bd46cca5b5c51826c75b373 (diff) | |
| parent | 7afd5cc2fb7e45f2c497e5aed007a017b8461335 (diff) | |
Merge pull request #7592 from stenzek/imgui-prereq
VideoBackends: Share GX vertex/index/uniform buffers with utility draws
Diffstat (limited to 'Source/Core/VideoBackends/Software')
4 files changed, 28 insertions, 7 deletions
diff --git a/Source/Core/VideoBackends/Software/SWRenderer.cpp b/Source/Core/VideoBackends/Software/SWRenderer.cpp index 2c6a97027b..0b64022725 100644 --- a/Source/Core/VideoBackends/Software/SWRenderer.cpp +++ b/Source/Core/VideoBackends/Software/SWRenderer.cpp @@ -25,7 +25,8 @@ #include "VideoCommon/VideoConfig.h" SWRenderer::SWRenderer(std::unique_ptr<SWOGLWindow> window) - : ::Renderer(static_cast<int>(MAX_XFB_WIDTH), static_cast<int>(MAX_XFB_HEIGHT)), + : ::Renderer(static_cast<int>(MAX_XFB_WIDTH), static_cast<int>(MAX_XFB_HEIGHT), + AbstractTextureFormat::RGBA8), m_window(std::move(window)) { } diff --git a/Source/Core/VideoBackends/Software/SWVertexLoader.cpp b/Source/Core/VideoBackends/Software/SWVertexLoader.cpp index e62a0a2348..4a53b4041c 100644 --- a/Source/Core/VideoBackends/Software/SWVertexLoader.cpp +++ b/Source/Core/VideoBackends/Software/SWVertexLoader.cpp @@ -48,14 +48,29 @@ SWVertexLoader::~SWVertexLoader() { } -void SWVertexLoader::ResetBuffer(u32 stride) +void SWVertexLoader::UploadUtilityUniforms(const void* uniforms, u32 uniforms_size) +{ +} + +void SWVertexLoader::ResetBuffer(u32 vertex_stride, bool cull_all) { m_cur_buffer_pointer = m_base_buffer_pointer = m_local_vertex_buffer.data(); m_end_buffer_pointer = m_cur_buffer_pointer + m_local_vertex_buffer.size(); IndexGenerator::Start(m_local_index_buffer.data()); } -void SWVertexLoader::vFlush() +void SWVertexLoader::CommitBuffer(u32 num_vertices, u32 vertex_stride, u32 num_indices, + u32* out_base_vertex, u32* out_base_index) +{ + *out_base_vertex = 0; + *out_base_index = 0; +} + +void SWVertexLoader::UploadConstants() +{ +} + +void SWVertexLoader::DrawCurrentBatch(u32 base_index, u32 num_indices, u32 base_vertex) { DebugUtil::OnObjectBegin(); diff --git a/Source/Core/VideoBackends/Software/SWVertexLoader.h b/Source/Core/VideoBackends/Software/SWVertexLoader.h index abb4c86b7c..dabbdef168 100644 --- a/Source/Core/VideoBackends/Software/SWVertexLoader.h +++ b/Source/Core/VideoBackends/Software/SWVertexLoader.h @@ -23,9 +23,14 @@ public: std::unique_ptr<NativeVertexFormat> CreateNativeVertexFormat(const PortableVertexDeclaration& vdec) override; -private: - void ResetBuffer(u32 stride) override; - void vFlush() override; + void UploadUtilityUniforms(const void* uniforms, u32 uniforms_size) override; + +protected: + void ResetBuffer(u32 vertex_stride, bool cull_all) override; + void CommitBuffer(u32 num_vertices, u32 vertex_stride, u32 num_indices, u32* out_base_vertex, + u32* out_base_index) override; + void UploadConstants() override; + void DrawCurrentBatch(u32 base_index, u32 num_indices, u32 base_vertex) override; void SetFormat(u8 attributeIndex, u8 primitiveType); void ParseVertex(const PortableVertexDeclaration& vdec, int index); diff --git a/Source/Core/VideoBackends/Software/SWmain.cpp b/Source/Core/VideoBackends/Software/SWmain.cpp index a0ad349849..0ab16bdfa8 100644 --- a/Source/Core/VideoBackends/Software/SWmain.cpp +++ b/Source/Core/VideoBackends/Software/SWmain.cpp @@ -95,7 +95,7 @@ bool VideoSoftware::Initialize(const WindowSystemInfo& wsi) g_perf_query = std::make_unique<PerfQuery>(); g_texture_cache = std::make_unique<TextureCache>(); g_shader_cache = std::make_unique<VideoCommon::ShaderCache>(); - return g_shader_cache->Initialize(); + return g_renderer->Initialize() && g_shader_cache->Initialize(); } void VideoSoftware::Shutdown() |
