Skip to content
Snippets Groups Projects
Commit 69c45ce7 authored by bunnei's avatar bunnei
Browse files

gl_rasterizer: Implement texture border color.

parent 6b3e5462
No related branches found
No related tags found
No related merge requests found
......@@ -601,7 +601,6 @@ void RasterizerOpenGL::SamplerInfo::Create() {
sampler.Create();
mag_filter = min_filter = Tegra::Texture::TextureFilter::Linear;
wrap_u = wrap_v = Tegra::Texture::WrapMode::Wrap;
border_color_r = border_color_g = border_color_b = border_color_a = 0;
// default is GL_LINEAR_MIPMAP_LINEAR
glSamplerParameteri(sampler.handle, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
......@@ -630,8 +629,12 @@ void RasterizerOpenGL::SamplerInfo::SyncWithConfig(const Tegra::Texture::TSCEntr
}
if (wrap_u == Tegra::Texture::WrapMode::Border || wrap_v == Tegra::Texture::WrapMode::Border) {
// TODO(Subv): Implement border color
ASSERT(false);
const GLvec4 new_border_color = {{config.border_color_r, config.border_color_g,
config.border_color_b, config.border_color_a}};
if (border_color != new_border_color) {
border_color = new_border_color;
glSamplerParameterfv(s, GL_TEXTURE_BORDER_COLOR, border_color.data());
}
}
}
......
......@@ -77,10 +77,7 @@ private:
Tegra::Texture::TextureFilter min_filter;
Tegra::Texture::WrapMode wrap_u;
Tegra::Texture::WrapMode wrap_v;
u32 border_color_r;
u32 border_color_g;
u32 border_color_b;
u32 border_color_a;
GLvec4 border_color;
};
/// Configures the color and depth framebuffer states and returns the dirty <Color, Depth>
......
......@@ -242,10 +242,10 @@ struct TSCEntry {
BitField<6, 2, TextureMipmapFilter> mip_filter;
};
INSERT_PADDING_BYTES(8);
u32 border_color_r;
u32 border_color_g;
u32 border_color_b;
u32 border_color_a;
float border_color_r;
float border_color_g;
float border_color_b;
float border_color_a;
};
static_assert(sizeof(TSCEntry) == 0x20, "TSCEntry has wrong size");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment