diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/video_core/CMakeLists.txt | 1 | ||||
| -rw-r--r-- | src/video_core/renderer_opengl/maxwell_to_gl.h | 40 |
2 files changed, 41 insertions, 0 deletions
diff --git a/src/video_core/CMakeLists.txt b/src/video_core/CMakeLists.txt index 3dab81769..841f27d7f 100644 --- a/src/video_core/CMakeLists.txt +++ b/src/video_core/CMakeLists.txt | |||
| @@ -31,6 +31,7 @@ add_library(video_core STATIC | |||
| 31 | renderer_opengl/gl_state.h | 31 | renderer_opengl/gl_state.h |
| 32 | renderer_opengl/gl_stream_buffer.cpp | 32 | renderer_opengl/gl_stream_buffer.cpp |
| 33 | renderer_opengl/gl_stream_buffer.h | 33 | renderer_opengl/gl_stream_buffer.h |
| 34 | renderer_opengl/maxwell_to_gl.h | ||
| 34 | renderer_opengl/renderer_opengl.cpp | 35 | renderer_opengl/renderer_opengl.cpp |
| 35 | renderer_opengl/renderer_opengl.h | 36 | renderer_opengl/renderer_opengl.h |
| 36 | textures/decoders.cpp | 37 | textures/decoders.cpp |
diff --git a/src/video_core/renderer_opengl/maxwell_to_gl.h b/src/video_core/renderer_opengl/maxwell_to_gl.h new file mode 100644 index 000000000..54859b5a0 --- /dev/null +++ b/src/video_core/renderer_opengl/maxwell_to_gl.h | |||
| @@ -0,0 +1,40 @@ | |||
| 1 | // Copyright 2018 yuzu Emulator Project | ||
| 2 | // Licensed under GPLv2 or any later version | ||
| 3 | // Refer to the license.txt file included. | ||
| 4 | |||
| 5 | #pragma once | ||
| 6 | |||
| 7 | #include <array> | ||
| 8 | #include <glad/glad.h> | ||
| 9 | #include "common/common_types.h" | ||
| 10 | #include "common/logging/log.h" | ||
| 11 | #include "video_core/engines/maxwell_3d.h" | ||
| 12 | |||
| 13 | namespace MaxwellToGL { | ||
| 14 | |||
| 15 | using Maxwell = Tegra::Engines::Maxwell3D::Regs; | ||
| 16 | |||
| 17 | inline GLenum VertexType(Maxwell::VertexAttribute attrib) { | ||
| 18 | switch (attrib.type) { | ||
| 19 | case Maxwell::VertexAttribute::Type::UnsignedNorm: { | ||
| 20 | |||
| 21 | switch (attrib.size) { | ||
| 22 | case Maxwell::VertexAttribute::Size::Size_8_8_8_8: | ||
| 23 | return GL_UNSIGNED_BYTE; | ||
| 24 | } | ||
| 25 | |||
| 26 | LOG_CRITICAL(Render_OpenGL, "Unimplemented vertex size=%s", attrib.SizeString()); | ||
| 27 | UNREACHABLE(); | ||
| 28 | return {}; | ||
| 29 | } | ||
| 30 | |||
| 31 | case Maxwell::VertexAttribute::Type::Float: | ||
| 32 | return GL_FLOAT; | ||
| 33 | } | ||
| 34 | |||
| 35 | LOG_CRITICAL(Render_OpenGL, "Unimplemented vertex type=%s", attrib.TypeString()); | ||
| 36 | UNREACHABLE(); | ||
| 37 | return {}; | ||
| 38 | } | ||
| 39 | |||
| 40 | } // namespace MaxwellToGL | ||