Disable quad overdraw overlay on GLES

This commit is contained in:
baldurk
2018-10-04 15:08:59 +01:00
parent ec165964bc
commit 11cba8d36b
3 changed files with 28 additions and 7 deletions
+1 -1
View File
@@ -42,7 +42,7 @@
// descriptor set will be patched from 0 to whichever descriptor set we're using in code
layout(set = 0, binding = 0, r32ui) uniform coherent uimage2DArray overdrawImage;
#else // OPENGL and OPENGL_ES
layout(binding = 0, r32ui) uniform PRECISION coherent uimage2DArray overdrawImage;
layout(r32ui) uniform coherent uimage2DArray overdrawImage;
#endif
layout(early_fragment_tests) in;
+12 -1
View File
@@ -301,7 +301,18 @@ void GLReplay::InitDebugData()
DebugData.fixedcolFragShader = DebugData.quadoverdrawFragShader = 0;
if(glesShadersAreComplete && HasExt[ARB_shader_image_load_store] && HasExt[ARB_gpu_shader5])
if(IsGLES)
{
// quad overdraw not supported on GLES.
// 1.
// dFdx doesn't support uints - potentially workaroundable with float casts, but highly
// doubtful GLES compilers will do that properly without exploding.
// 2.
// quad overdraw write shader must be linked with user shaders in program, which requires
// matching ESSL version and features required for it aren't exposed as extensions to older
// versions but only in core versions.
}
else if(HasExt[ARB_shader_image_load_store] && HasExt[ARB_gpu_shader5])
{
GenerateGLSLShader(fs, shaderType, "", GetEmbeddedResource(glsl_quadresolve_frag), glslBaseVer);
+15 -5
View File
@@ -213,12 +213,12 @@ ResourceId GLReplay::RenderOverlay(ResourceId texid, CompType typeHint, DebugOve
DebugData.fixedcolFragShader = CreateShader(eGL_FRAGMENT_SHADER, sources);
}
// this is not supported on GLES shading language 100
if(shaderType == eShaderGLSL || glslVer >= 300)
// this is not supported on GLES
if(shaderType == eShaderGLSL)
{
std::string defines = "";
if(glslVer < 450)
if(GLCoreVersion < 45)
{
// dFdx fine functions not available before GLSL 450. Use normal dFdx, which might be coarse,
// so won't show quad overdraw properly
@@ -227,16 +227,20 @@ ResourceId GLReplay::RenderOverlay(ResourceId texid, CompType typeHint, DebugOve
RDCWARN("Quad overdraw requires GLSL 4.50 for dFd(xy)fine, using possibly coarse dFd(xy).");
}
else
{
glslVer = 450;
}
std::vector<std::string> sources;
GenerateGLSLShader(sources, shaderType, defines, GetEmbeddedResource(glsl_quadwrite_frag),
glslVer);
glslVer, false);
DebugData.quadoverdrawFragShader = CreateShader(eGL_FRAGMENT_SHADER, sources);
}
else
{
if(overlay == DebugOverlay::QuadOverdrawDraw || overlay == DebugOverlay::QuadOverdrawPass)
RDCWARN("Quad overdraw shader not supported on GLES with %d shader", glslVer);
RDCWARN("Quad overdraw not supported on GLES", glslVer);
}
// we bind the separable program created for each shader, and copy
@@ -1316,6 +1320,12 @@ ResourceId GLReplay::RenderOverlay(ResourceId texid, CompType typeHint, DebugOve
drv.glUseProgram(DebugData.overlayProg);
drv.glBindProgramPipeline(0);
GLint loc = drv.glGetUniformLocation(DebugData.overlayProg, "overdrawImage");
if(loc != -1)
drv.glUniform1ui(loc, 0);
else
RDCERR("Couldn't get location of overdrawImage");
drv.glBindFramebuffer(eGL_READ_FRAMEBUFFER, curdrawfbo);
SafeBlitFramebuffer(0, 0, texDetails.width, texDetails.height, 0, 0, texDetails.width,
texDetails.height, GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT,