diff options
| author | bunnei <bunneidev@gmail.com> | 2018-03-24 02:01:03 -0400 |
|---|---|---|
| committer | bunnei <bunneidev@gmail.com> | 2018-03-26 21:16:52 -0400 |
| commit | ed2134784e173e071a124c768eea5dd12be8425c (patch) | |
| tree | 81321ef22c0e035872aa9f3e2aeb6a4b9753039c /src/video_core/renderer_opengl/gl_rasterizer.cpp | |
| parent | 8041d72a1ff403a4773bfccebdb7e3162061efd4 (diff) | |
gl_rasterizer: Implement AnalyzeVertexArray.
Diffstat (limited to 'src/video_core/renderer_opengl/gl_rasterizer.cpp')
| -rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer.cpp | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp index 286491b73..982e84768 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp @@ -14,7 +14,10 @@ #include "common/microprofile.h" #include "common/scope_exit.h" #include "common/vector_math.h" +#include "core/core.h" +#include "core/hle/kernel/process.h" #include "core/settings.h" +#include "video_core/engines/maxwell_3d.h" #include "video_core/renderer_opengl/gl_rasterizer.h" #include "video_core/renderer_opengl/gl_shader_gen.h" #include "video_core/renderer_opengl/renderer_opengl.h" @@ -146,7 +149,24 @@ static constexpr std::array<GLenum, 4> vs_attrib_types{ }; void RasterizerOpenGL::AnalyzeVertexArray(bool is_indexed) { - UNIMPLEMENTED(); + const auto& regs = Core::System().GetInstance().GPU().Maxwell3D().regs; + const auto& vertex_attributes = regs.vertex_attrib_format; + + if (is_indexed) { + UNREACHABLE(); + } + const u32 vertex_num = regs.vertex_buffer.count; + + vs_input_size = 0; + u32 max_offset{}; + for (const auto& attrib : vertex_attributes) { + if (max_offset >= attrib.offset) { + continue; + } + max_offset = attrib.offset; + vs_input_size = max_offset + attrib.SizeInBytes(); + } + vs_input_size *= vertex_num; } void RasterizerOpenGL::SetupVertexArray(u8* array_ptr, GLintptr buffer_offset) { |
