diff options
| author | bunnei <bunneidev@gmail.com> | 2018-06-06 21:39:47 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-06-06 21:39:47 -0400 |
| commit | 37f50c877374ac49eefb205cc55e7f6fc84cef29 (patch) | |
| tree | 0d9b2242e432454ee6d8fffa0fb82971e25fa6fe /src/video_core/renderer_opengl/gl_rasterizer.cpp | |
| parent | 4732e1f0644c2842f5548855085923a42fc95027 (diff) | |
| parent | 47629c89a872cb35919b1d264973e8d6633bb654 (diff) | |
Merge pull request #535 from Subv/gpu_swizzle
GPU: Support changing the texture swizzles for Maxwell textures.
Diffstat (limited to 'src/video_core/renderer_opengl/gl_rasterizer.cpp')
| -rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp index b23b8fb29..2e90ebcf4 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp @@ -681,6 +681,14 @@ u32 RasterizerOpenGL::SetupTextures(Maxwell::ShaderStage stage, GLuint program, Surface surface = res_cache.GetTextureSurface(texture); if (surface != nullptr) { state.texture_units[current_bindpoint].texture_2d = surface->texture.handle; + state.texture_units[current_bindpoint].swizzle.r = + MaxwellToGL::SwizzleSource(texture.tic.x_source); + state.texture_units[current_bindpoint].swizzle.g = + MaxwellToGL::SwizzleSource(texture.tic.y_source); + state.texture_units[current_bindpoint].swizzle.b = + MaxwellToGL::SwizzleSource(texture.tic.z_source); + state.texture_units[current_bindpoint].swizzle.a = + MaxwellToGL::SwizzleSource(texture.tic.w_source); } else { // Can occur when texture addr is null or its memory is unmapped/invalid state.texture_units[current_bindpoint].texture_2d = 0; |
