diff options
| author | 2018-07-23 23:26:48 -0400 | |
|---|---|---|
| committer | 2018-07-23 23:34:42 -0400 | |
| commit | 69c45ce71c5a600f0372746348875a626e06898b (patch) | |
| tree | 5515b9dcc8fc4122e63b9eb7f7accdf5c3801d85 /src | |
| parent | maxwell_to_gl: Implement Texture::WrapMode::Border. (diff) | |
| download | yuzu-69c45ce71c5a600f0372746348875a626e06898b.tar.gz yuzu-69c45ce71c5a600f0372746348875a626e06898b.tar.xz yuzu-69c45ce71c5a600f0372746348875a626e06898b.zip | |
gl_rasterizer: Implement texture border color.
Diffstat (limited to 'src')
| -rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer.cpp | 9 | ||||
| -rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer.h | 5 | ||||
| -rw-r--r-- | src/video_core/textures/texture.h | 8 |
3 files changed, 11 insertions, 11 deletions
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp index 56d9c575b..5d5ad84b7 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp | |||
| @@ -601,7 +601,6 @@ void RasterizerOpenGL::SamplerInfo::Create() { | |||
| 601 | sampler.Create(); | 601 | sampler.Create(); |
| 602 | mag_filter = min_filter = Tegra::Texture::TextureFilter::Linear; | 602 | mag_filter = min_filter = Tegra::Texture::TextureFilter::Linear; |
| 603 | wrap_u = wrap_v = Tegra::Texture::WrapMode::Wrap; | 603 | wrap_u = wrap_v = Tegra::Texture::WrapMode::Wrap; |
| 604 | border_color_r = border_color_g = border_color_b = border_color_a = 0; | ||
| 605 | 604 | ||
| 606 | // default is GL_LINEAR_MIPMAP_LINEAR | 605 | // default is GL_LINEAR_MIPMAP_LINEAR |
| 607 | glSamplerParameteri(sampler.handle, GL_TEXTURE_MIN_FILTER, GL_LINEAR); | 606 | glSamplerParameteri(sampler.handle, GL_TEXTURE_MIN_FILTER, GL_LINEAR); |
| @@ -630,8 +629,12 @@ void RasterizerOpenGL::SamplerInfo::SyncWithConfig(const Tegra::Texture::TSCEntr | |||
| 630 | } | 629 | } |
| 631 | 630 | ||
| 632 | if (wrap_u == Tegra::Texture::WrapMode::Border || wrap_v == Tegra::Texture::WrapMode::Border) { | 631 | if (wrap_u == Tegra::Texture::WrapMode::Border || wrap_v == Tegra::Texture::WrapMode::Border) { |
| 633 | // TODO(Subv): Implement border color | 632 | const GLvec4 new_border_color = {{config.border_color_r, config.border_color_g, |
| 634 | ASSERT(false); | 633 | config.border_color_b, config.border_color_a}}; |
| 634 | if (border_color != new_border_color) { | ||
| 635 | border_color = new_border_color; | ||
| 636 | glSamplerParameterfv(s, GL_TEXTURE_BORDER_COLOR, border_color.data()); | ||
| 637 | } | ||
| 635 | } | 638 | } |
| 636 | } | 639 | } |
| 637 | 640 | ||
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.h b/src/video_core/renderer_opengl/gl_rasterizer.h index c406142e4..ab06e2d95 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.h +++ b/src/video_core/renderer_opengl/gl_rasterizer.h | |||
| @@ -77,10 +77,7 @@ private: | |||
| 77 | Tegra::Texture::TextureFilter min_filter; | 77 | Tegra::Texture::TextureFilter min_filter; |
| 78 | Tegra::Texture::WrapMode wrap_u; | 78 | Tegra::Texture::WrapMode wrap_u; |
| 79 | Tegra::Texture::WrapMode wrap_v; | 79 | Tegra::Texture::WrapMode wrap_v; |
| 80 | u32 border_color_r; | 80 | GLvec4 border_color; |
| 81 | u32 border_color_g; | ||
| 82 | u32 border_color_b; | ||
| 83 | u32 border_color_a; | ||
| 84 | }; | 81 | }; |
| 85 | 82 | ||
| 86 | /// Configures the color and depth framebuffer states and returns the dirty <Color, Depth> | 83 | /// Configures the color and depth framebuffer states and returns the dirty <Color, Depth> |
diff --git a/src/video_core/textures/texture.h b/src/video_core/textures/texture.h index d1c755033..c6bd2f4b9 100644 --- a/src/video_core/textures/texture.h +++ b/src/video_core/textures/texture.h | |||
| @@ -242,10 +242,10 @@ struct TSCEntry { | |||
| 242 | BitField<6, 2, TextureMipmapFilter> mip_filter; | 242 | BitField<6, 2, TextureMipmapFilter> mip_filter; |
| 243 | }; | 243 | }; |
| 244 | INSERT_PADDING_BYTES(8); | 244 | INSERT_PADDING_BYTES(8); |
| 245 | u32 border_color_r; | 245 | float border_color_r; |
| 246 | u32 border_color_g; | 246 | float border_color_g; |
| 247 | u32 border_color_b; | 247 | float border_color_b; |
| 248 | u32 border_color_a; | 248 | float border_color_a; |
| 249 | }; | 249 | }; |
| 250 | static_assert(sizeof(TSCEntry) == 0x20, "TSCEntry has wrong size"); | 250 | static_assert(sizeof(TSCEntry) == 0x20, "TSCEntry has wrong size"); |
| 251 | 251 | ||