mirror of
https://git.suyu.dev/suyu/suyu.git
synced 2024-11-30 02:32:46 +01:00
gl_rasterizer: Implement texture wrap mode p.
This commit is contained in:
parent
ce8291f6c5
commit
05f6f59ffb
2 changed files with 8 additions and 2 deletions
|
@ -580,7 +580,7 @@ bool RasterizerOpenGL::AccelerateDisplay(const Tegra::FramebufferConfig& config,
|
||||||
void RasterizerOpenGL::SamplerInfo::Create() {
|
void RasterizerOpenGL::SamplerInfo::Create() {
|
||||||
sampler.Create();
|
sampler.Create();
|
||||||
mag_filter = min_filter = Tegra::Texture::TextureFilter::Linear;
|
mag_filter = min_filter = Tegra::Texture::TextureFilter::Linear;
|
||||||
wrap_u = wrap_v = Tegra::Texture::WrapMode::Wrap;
|
wrap_u = wrap_v = wrap_p = Tegra::Texture::WrapMode::Wrap;
|
||||||
|
|
||||||
// default is GL_LINEAR_MIPMAP_LINEAR
|
// default is GL_LINEAR_MIPMAP_LINEAR
|
||||||
glSamplerParameteri(sampler.handle, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
glSamplerParameteri(sampler.handle, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
||||||
|
@ -607,8 +607,13 @@ void RasterizerOpenGL::SamplerInfo::SyncWithConfig(const Tegra::Texture::TSCEntr
|
||||||
wrap_v = config.wrap_v;
|
wrap_v = config.wrap_v;
|
||||||
glSamplerParameteri(s, GL_TEXTURE_WRAP_T, MaxwellToGL::WrapMode(wrap_v));
|
glSamplerParameteri(s, GL_TEXTURE_WRAP_T, MaxwellToGL::WrapMode(wrap_v));
|
||||||
}
|
}
|
||||||
|
if (wrap_p != config.wrap_p) {
|
||||||
|
wrap_p = config.wrap_p;
|
||||||
|
glSamplerParameteri(s, GL_TEXTURE_WRAP_R, MaxwellToGL::WrapMode(wrap_p));
|
||||||
|
}
|
||||||
|
|
||||||
if (wrap_u == Tegra::Texture::WrapMode::Border || wrap_v == Tegra::Texture::WrapMode::Border) {
|
if (wrap_u == Tegra::Texture::WrapMode::Border || wrap_v == Tegra::Texture::WrapMode::Border ||
|
||||||
|
wrap_p == Tegra::Texture::WrapMode::Border) {
|
||||||
const GLvec4 new_border_color = {{config.border_color_r, config.border_color_g,
|
const GLvec4 new_border_color = {{config.border_color_r, config.border_color_g,
|
||||||
config.border_color_b, config.border_color_a}};
|
config.border_color_b, config.border_color_a}};
|
||||||
if (border_color != new_border_color) {
|
if (border_color != new_border_color) {
|
||||||
|
|
|
@ -93,6 +93,7 @@ private:
|
||||||
Tegra::Texture::TextureFilter min_filter;
|
Tegra::Texture::TextureFilter min_filter;
|
||||||
Tegra::Texture::WrapMode wrap_u;
|
Tegra::Texture::WrapMode wrap_u;
|
||||||
Tegra::Texture::WrapMode wrap_v;
|
Tegra::Texture::WrapMode wrap_v;
|
||||||
|
Tegra::Texture::WrapMode wrap_p;
|
||||||
GLvec4 border_color;
|
GLvec4 border_color;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue