maxwell_to_gl: Use GL_CLAMP to emulate Clamp wrap mode

This commit is contained in:
ReinUsesLisp 2019-05-21 20:29:41 -03:00
parent b76df62c00
commit a89cc0bafc
3 changed files with 4 additions and 7 deletions

View file

@ -175,11 +175,8 @@ inline GLenum WrapMode(Tegra::Texture::WrapMode wrap_mode) {
return GL_CLAMP_TO_EDGE; return GL_CLAMP_TO_EDGE;
case Tegra::Texture::WrapMode::Border: case Tegra::Texture::WrapMode::Border:
return GL_CLAMP_TO_BORDER; return GL_CLAMP_TO_BORDER;
case Tegra::Texture::WrapMode::ClampOGL: case Tegra::Texture::WrapMode::Clamp:
// TODO(Subv): GL_CLAMP was removed as of OpenGL 3.1, to implement GL_CLAMP, we can use return GL_CLAMP;
// GL_CLAMP_TO_BORDER to get the border color of the texture, and then sample the edge to
// manually mix them. However the shader part of this is not yet implemented.
return GL_CLAMP_TO_BORDER;
case Tegra::Texture::WrapMode::MirrorOnceClampToEdge: case Tegra::Texture::WrapMode::MirrorOnceClampToEdge:
return GL_MIRROR_CLAMP_TO_EDGE; return GL_MIRROR_CLAMP_TO_EDGE;
case Tegra::Texture::WrapMode::MirrorOnceBorder: case Tegra::Texture::WrapMode::MirrorOnceBorder:

View file

@ -52,7 +52,7 @@ vk::SamplerAddressMode WrapMode(Tegra::Texture::WrapMode wrap_mode) {
return vk::SamplerAddressMode::eClampToEdge; return vk::SamplerAddressMode::eClampToEdge;
case Tegra::Texture::WrapMode::Border: case Tegra::Texture::WrapMode::Border:
return vk::SamplerAddressMode::eClampToBorder; return vk::SamplerAddressMode::eClampToBorder;
case Tegra::Texture::WrapMode::ClampOGL: case Tegra::Texture::WrapMode::Clamp:
// TODO(Rodrigo): GL_CLAMP was removed as of OpenGL 3.1, to implement GL_CLAMP, we can use // TODO(Rodrigo): GL_CLAMP was removed as of OpenGL 3.1, to implement GL_CLAMP, we can use
// eClampToBorder to get the border color of the texture, and then sample the edge to // eClampToBorder to get the border color of the texture, and then sample the edge to
// manually mix them. However the shader part of this is not yet implemented. // manually mix them. However the shader part of this is not yet implemented.

View file

@ -251,7 +251,7 @@ enum class WrapMode : u32 {
Mirror = 1, Mirror = 1,
ClampToEdge = 2, ClampToEdge = 2,
Border = 3, Border = 3,
ClampOGL = 4, Clamp = 4,
MirrorOnceClampToEdge = 5, MirrorOnceClampToEdge = 5,
MirrorOnceBorder = 6, MirrorOnceBorder = 6,
MirrorOnceClampOGL = 7, MirrorOnceClampOGL = 7,