diff options
| author | 2018-04-17 10:08:10 -0500 | |
|---|---|---|
| committer | 2018-04-17 10:16:50 -0500 | |
| commit | 7fc516cc1ad81b02308b5b23fd18562e651c770e (patch) | |
| tree | 5b3986b8db0c481f6e73e4b2ace16f1645d8d770 /src | |
| parent | Merge pull request #338 from bunnei/unrequire-shared-font (diff) | |
| download | yuzu-7fc516cc1ad81b02308b5b23fd18562e651c770e.tar.gz yuzu-7fc516cc1ad81b02308b5b23fd18562e651c770e.tar.xz yuzu-7fc516cc1ad81b02308b5b23fd18562e651c770e.zip | |
MaxwellToGL: Added a TODO and partial implementation of maxwell wrap mode 4 (Clamp, GL_CLAMP).
This clamp mode was removed from OpenGL as of 3.1, we can emulate it by using GL_CLAMP_TO_BORDER to get the border color of the texture, and then manually sampling the edge to mix them in the fragment shader.
Diffstat (limited to 'src')
| -rw-r--r-- | src/video_core/renderer_opengl/maxwell_to_gl.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/video_core/renderer_opengl/maxwell_to_gl.h b/src/video_core/renderer_opengl/maxwell_to_gl.h index 7909dcfc3..9d04a4d65 100644 --- a/src/video_core/renderer_opengl/maxwell_to_gl.h +++ b/src/video_core/renderer_opengl/maxwell_to_gl.h | |||
| @@ -74,6 +74,11 @@ inline GLenum WrapMode(Tegra::Texture::WrapMode wrap_mode) { | |||
| 74 | switch (wrap_mode) { | 74 | switch (wrap_mode) { |
| 75 | case Tegra::Texture::WrapMode::ClampToEdge: | 75 | case Tegra::Texture::WrapMode::ClampToEdge: |
| 76 | return GL_CLAMP_TO_EDGE; | 76 | return GL_CLAMP_TO_EDGE; |
| 77 | case Tegra::Texture::WrapMode::ClampOGL: | ||
| 78 | // TODO(Subv): GL_CLAMP was removed as of OpenGL 3.1, to implement GL_CLAMP, we can use | ||
| 79 | // GL_CLAMP_TO_BORDER to get the border color of the texture, and then sample the edge to | ||
| 80 | // manually mix them. However the shader part of this is not yet implemented. | ||
| 81 | return GL_CLAMP_TO_BORDER; | ||
| 77 | } | 82 | } |
| 78 | LOG_CRITICAL(Render_OpenGL, "Unimplemented texture wrap mode=%u", static_cast<u32>(wrap_mode)); | 83 | LOG_CRITICAL(Render_OpenGL, "Unimplemented texture wrap mode=%u", static_cast<u32>(wrap_mode)); |
| 79 | UNREACHABLE(); | 84 | UNREACHABLE(); |