mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-08-26 00:16:45 +00:00
Use comparison state not shadow sampler type for pipeline state
This commit is contained in:
@@ -1625,7 +1625,7 @@ AddressMode MakeAddressMode(GLenum addr)
|
||||
return AddressMode::Wrap;
|
||||
}
|
||||
|
||||
TextureFilter MakeFilter(GLenum minf, GLenum magf, bool shadowSampler, float maxAniso)
|
||||
TextureFilter MakeFilter(GLenum minf, GLenum magf, float maxAniso)
|
||||
{
|
||||
TextureFilter ret;
|
||||
|
||||
@@ -1653,7 +1653,6 @@ TextureFilter MakeFilter(GLenum minf, GLenum magf, bool shadowSampler, float max
|
||||
|
||||
ret.magnify = (magf == eGL_LINEAR) ? FilterMode::Linear : FilterMode::Point;
|
||||
}
|
||||
ret.filter = shadowSampler ? FilterFunction::Comparison : FilterFunction::Normal;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -601,7 +601,7 @@ Topology MakePrimitiveTopology(GLenum Topo);
|
||||
GLenum MakeGLPrimitiveTopology(Topology Topo);
|
||||
BufferCategory MakeBufferCategory(GLenum bufferTarget);
|
||||
AddressMode MakeAddressMode(GLenum addr);
|
||||
TextureFilter MakeFilter(GLenum minf, GLenum magf, bool shadowSampler, float maxAniso);
|
||||
TextureFilter MakeFilter(GLenum minf, GLenum magf, float maxAniso);
|
||||
ShaderStage MakeShaderStage(GLenum type);
|
||||
CompareFunction MakeCompareFunc(GLenum func);
|
||||
StencilOperation MakeStencilOp(GLenum op);
|
||||
|
||||
@@ -1195,8 +1195,6 @@ void GLReplay::SavePipelineState(uint32_t eventId)
|
||||
GLenum target = eGL_NONE;
|
||||
TextureType resType = TextureType::Unknown;
|
||||
|
||||
bool shadow = false;
|
||||
|
||||
for(size_t s = 0; s < ARRAY_COUNT(refls); s++)
|
||||
{
|
||||
if(refls[s] == NULL)
|
||||
@@ -1209,9 +1207,6 @@ void GLReplay::SavePipelineState(uint32_t eventId)
|
||||
{
|
||||
GLenum t = eGL_NONE;
|
||||
|
||||
if(strstr(res.variableType.descriptor.name.c_str(), "Shadow"))
|
||||
shadow = true;
|
||||
|
||||
switch(res.resType)
|
||||
{
|
||||
case TextureType::Unknown: target = eGL_NONE; break;
|
||||
@@ -1432,7 +1427,16 @@ void GLReplay::SavePipelineState(uint32_t eventId)
|
||||
}
|
||||
|
||||
pipe.samplers[unit].filter =
|
||||
MakeFilter((GLenum)minf, (GLenum)magf, shadow, pipe.samplers[unit].maxAnisotropy);
|
||||
MakeFilter((GLenum)minf, (GLenum)magf, pipe.samplers[unit].maxAnisotropy);
|
||||
|
||||
v = 0;
|
||||
if(samp != 0)
|
||||
drv.glGetSamplerParameteriv(samp, eGL_TEXTURE_COMPARE_MODE, &v);
|
||||
else
|
||||
drv.glGetTextureParameterivEXT(tex, target, eGL_TEXTURE_COMPARE_MODE, &v);
|
||||
pipe.samplers[unit].filter.filter = (GLenum)v == eGL_COMPARE_REF_TO_TEXTURE
|
||||
? FilterFunction::Comparison
|
||||
: FilterFunction::Normal;
|
||||
|
||||
if(samp != 0)
|
||||
drv.glGetSamplerParameterfv(samp, eGL_TEXTURE_MAX_LOD, &pipe.samplers[unit].maxLOD);
|
||||
|
||||
Reference in New Issue
Block a user