diff options
| author | 2018-08-14 18:53:11 -0400 | |
|---|---|---|
| committer | 2018-08-14 20:43:02 -0400 | |
| commit | dc876fd63a55ef7ec28a989d7da8ade4da508a89 (patch) | |
| tree | 007f5307c9c98219b08b78203601629f0c20a7e8 /src | |
| parent | Merge pull request #1055 from lioncash/init (diff) | |
| download | yuzu-dc876fd63a55ef7ec28a989d7da8ade4da508a89.tar.gz yuzu-dc876fd63a55ef7ec28a989d7da8ade4da508a89.tar.xz yuzu-dc876fd63a55ef7ec28a989d7da8ade4da508a89.zip | |
maxwell_to_gl: Properly handle UnsignedInt/SignedInt sizes.
Diffstat (limited to 'src')
| -rw-r--r-- | src/video_core/renderer_opengl/maxwell_to_gl.h | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/src/video_core/renderer_opengl/maxwell_to_gl.h b/src/video_core/renderer_opengl/maxwell_to_gl.h index 83ea0cfc0..8f719fdd8 100644 --- a/src/video_core/renderer_opengl/maxwell_to_gl.h +++ b/src/video_core/renderer_opengl/maxwell_to_gl.h | |||
| @@ -24,16 +24,25 @@ using Maxwell = Tegra::Engines::Maxwell3D::Regs; | |||
| 24 | 24 | ||
| 25 | inline GLenum VertexType(Maxwell::VertexAttribute attrib) { | 25 | inline GLenum VertexType(Maxwell::VertexAttribute attrib) { |
| 26 | switch (attrib.type) { | 26 | switch (attrib.type) { |
| 27 | case Maxwell::VertexAttribute::Type::UnsignedInt: | ||
| 27 | case Maxwell::VertexAttribute::Type::UnsignedNorm: { | 28 | case Maxwell::VertexAttribute::Type::UnsignedNorm: { |
| 28 | 29 | ||
| 29 | switch (attrib.size) { | 30 | switch (attrib.size) { |
| 30 | case Maxwell::VertexAttribute::Size::Size_8: | 31 | case Maxwell::VertexAttribute::Size::Size_8: |
| 31 | case Maxwell::VertexAttribute::Size::Size_8_8: | 32 | case Maxwell::VertexAttribute::Size::Size_8_8: |
| 33 | case Maxwell::VertexAttribute::Size::Size_8_8_8: | ||
| 32 | case Maxwell::VertexAttribute::Size::Size_8_8_8_8: | 34 | case Maxwell::VertexAttribute::Size::Size_8_8_8_8: |
| 33 | return GL_UNSIGNED_BYTE; | 35 | return GL_UNSIGNED_BYTE; |
| 36 | case Maxwell::VertexAttribute::Size::Size_16: | ||
| 34 | case Maxwell::VertexAttribute::Size::Size_16_16: | 37 | case Maxwell::VertexAttribute::Size::Size_16_16: |
| 38 | case Maxwell::VertexAttribute::Size::Size_16_16_16: | ||
| 35 | case Maxwell::VertexAttribute::Size::Size_16_16_16_16: | 39 | case Maxwell::VertexAttribute::Size::Size_16_16_16_16: |
| 36 | return GL_UNSIGNED_SHORT; | 40 | return GL_UNSIGNED_SHORT; |
| 41 | case Maxwell::VertexAttribute::Size::Size_32: | ||
| 42 | case Maxwell::VertexAttribute::Size::Size_32_32: | ||
| 43 | case Maxwell::VertexAttribute::Size::Size_32_32_32: | ||
| 44 | case Maxwell::VertexAttribute::Size::Size_32_32_32_32: | ||
| 45 | return GL_UNSIGNED_INT; | ||
| 37 | case Maxwell::VertexAttribute::Size::Size_10_10_10_2: | 46 | case Maxwell::VertexAttribute::Size::Size_10_10_10_2: |
| 38 | return GL_UNSIGNED_INT_2_10_10_10_REV; | 47 | return GL_UNSIGNED_INT_2_10_10_10_REV; |
| 39 | } | 48 | } |
| @@ -43,16 +52,25 @@ inline GLenum VertexType(Maxwell::VertexAttribute attrib) { | |||
| 43 | return {}; | 52 | return {}; |
| 44 | } | 53 | } |
| 45 | 54 | ||
| 55 | case Maxwell::VertexAttribute::Type::SignedInt: | ||
| 46 | case Maxwell::VertexAttribute::Type::SignedNorm: { | 56 | case Maxwell::VertexAttribute::Type::SignedNorm: { |
| 47 | 57 | ||
| 48 | switch (attrib.size) { | 58 | switch (attrib.size) { |
| 49 | case Maxwell::VertexAttribute::Size::Size_32_32_32: | 59 | case Maxwell::VertexAttribute::Size::Size_8: |
| 50 | return GL_INT; | ||
| 51 | case Maxwell::VertexAttribute::Size::Size_8_8: | 60 | case Maxwell::VertexAttribute::Size::Size_8_8: |
| 61 | case Maxwell::VertexAttribute::Size::Size_8_8_8: | ||
| 52 | case Maxwell::VertexAttribute::Size::Size_8_8_8_8: | 62 | case Maxwell::VertexAttribute::Size::Size_8_8_8_8: |
| 53 | return GL_BYTE; | 63 | return GL_BYTE; |
| 64 | case Maxwell::VertexAttribute::Size::Size_16: | ||
| 54 | case Maxwell::VertexAttribute::Size::Size_16_16: | 65 | case Maxwell::VertexAttribute::Size::Size_16_16: |
| 66 | case Maxwell::VertexAttribute::Size::Size_16_16_16: | ||
| 67 | case Maxwell::VertexAttribute::Size::Size_16_16_16_16: | ||
| 55 | return GL_SHORT; | 68 | return GL_SHORT; |
| 69 | case Maxwell::VertexAttribute::Size::Size_32: | ||
| 70 | case Maxwell::VertexAttribute::Size::Size_32_32: | ||
| 71 | case Maxwell::VertexAttribute::Size::Size_32_32_32: | ||
| 72 | case Maxwell::VertexAttribute::Size::Size_32_32_32_32: | ||
| 73 | return GL_INT; | ||
| 56 | case Maxwell::VertexAttribute::Size::Size_10_10_10_2: | 74 | case Maxwell::VertexAttribute::Size::Size_10_10_10_2: |
| 57 | return GL_INT_2_10_10_10_REV; | 75 | return GL_INT_2_10_10_10_REV; |
| 58 | } | 76 | } |
| @@ -62,9 +80,6 @@ inline GLenum VertexType(Maxwell::VertexAttribute attrib) { | |||
| 62 | return {}; | 80 | return {}; |
| 63 | } | 81 | } |
| 64 | 82 | ||
| 65 | case Maxwell::VertexAttribute::Type::UnsignedInt: | ||
| 66 | return GL_UNSIGNED_INT; | ||
| 67 | |||
| 68 | case Maxwell::VertexAttribute::Type::Float: | 83 | case Maxwell::VertexAttribute::Type::Float: |
| 69 | return GL_FLOAT; | 84 | return GL_FLOAT; |
| 70 | } | 85 | } |