mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-08-24 07:26:34 +00:00
Fix textures not getting displayed when using GL_COMPARE_REF_TO_TEXTURE
This commit adds the GL_TEXTURE_COMPARE_MODE parameter to the TextureSamplerState struct, and sets its value to GL_NONE in SetSamplerState. This fixes the issue of depth textures that use GL_COMPARE_REF_TO_TEXTURE being displayed as solid black or white in the texture viewer.
This commit is contained in:
committed by
Baldur Karlsson
parent
40dab34a8f
commit
8f163be2dd
@@ -1168,6 +1168,11 @@ GLReplay::TextureSamplerState GLReplay::SetSamplerParams(GLenum target, GLuint t
|
||||
GL.glGetTextureParameterivEXT(texname, target, eGL_TEXTURE_MAG_FILTER, (GLint *)&ret.magFilter);
|
||||
GL.glGetTextureParameterivEXT(texname, target, eGL_TEXTURE_WRAP_S, (GLint *)&ret.wrapS);
|
||||
GL.glGetTextureParameterivEXT(texname, target, eGL_TEXTURE_WRAP_T, (GLint *)&ret.wrapT);
|
||||
GL.glGetTextureParameterivEXT(texname, target, eGL_TEXTURE_COMPARE_MODE, (GLint *)&ret.compareMode);
|
||||
|
||||
// disable depth comparison
|
||||
GLenum compareMode = eGL_NONE;
|
||||
GL.glTextureParameterivEXT(texname, target, eGL_TEXTURE_COMPARE_MODE, (GLint *)&compareMode);
|
||||
|
||||
// always want to clamp
|
||||
GLenum param = eGL_CLAMP_TO_EDGE;
|
||||
@@ -1210,6 +1215,7 @@ void GLReplay::RestoreSamplerParams(GLenum target, GLuint texname, TextureSample
|
||||
GL.glTextureParameterivEXT(texname, target, eGL_TEXTURE_WRAP_T, (GLint *)&state.wrapT);
|
||||
GL.glTextureParameterivEXT(texname, target, eGL_TEXTURE_MIN_FILTER, (GLint *)&state.minFilter);
|
||||
GL.glTextureParameterivEXT(texname, target, eGL_TEXTURE_MAG_FILTER, (GLint *)&state.magFilter);
|
||||
GL.glTextureParameterivEXT(texname, target, eGL_TEXTURE_COMPARE_MODE, (GLint *)&state.compareMode);
|
||||
}
|
||||
|
||||
bool GLReplay::GetMinMax(ResourceId texid, uint32_t sliceFace, uint32_t mip, uint32_t sample,
|
||||
|
||||
@@ -295,6 +295,7 @@ private:
|
||||
GLenum magFilter = eGL_NEAREST;
|
||||
GLenum wrapS = eGL_CLAMP_TO_EDGE;
|
||||
GLenum wrapT = eGL_CLAMP_TO_EDGE;
|
||||
GLenum compareMode = eGL_NONE;
|
||||
};
|
||||
|
||||
// sets the desired parameters, and returns the previous ones ready to restore
|
||||
|
||||
Reference in New Issue
Block a user