Don't try to compile quadwrite shader if required extensions are missing

This commit is contained in:
baldurk
2019-02-01 15:55:47 +00:00
parent 0df9e33b6b
commit eccf1add8a
2 changed files with 11 additions and 8 deletions
+1
View File
@@ -689,6 +689,7 @@ extern bool IsGLES;
EXT_TO_CHECK(44, 99, ARB_query_buffer_object) \
EXT_TO_CHECK(45, 99, ARB_clip_control) \
EXT_TO_CHECK(45, 99, ARB_direct_state_access) \
EXT_TO_CHECK(45, 99, ARB_derivative_control) \
EXT_TO_CHECK(46, 99, ARB_polygon_offset_clamp) \
EXT_TO_CHECK(46, 99, ARB_texture_filter_anisotropic) \
EXT_TO_CHECK(46, 99, ARB_pipeline_statistics_query) \
+10 -8
View File
@@ -258,7 +258,7 @@ ResourceId GLReplay::RenderOverlay(ResourceId texid, CompType typeHint, DebugOve
{
std::string defines = "";
if(GLCoreVersion < 45)
if(!HasExt[ARB_derivative_control])
{
// dFdx fine functions not available before GLSL 450. Use normal dFdx, which might be coarse,
// so won't show quad overdraw properly
@@ -267,14 +267,16 @@ 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::string source =
GenerateGLSLShader(GetEmbeddedResource(glsl_quadwrite_frag), shaderType, glslVer, defines);
DebugData.quadoverdrawFragShader = CreateShader(eGL_FRAGMENT_SHADER, source);
DebugData.quadoverdrawFragShader = 0;
// needs these extensions
if(HasExt[ARB_gpu_shader5] && HasExt[ARB_shader_image_load_store])
{
std::string source =
GenerateGLSLShader(GetEmbeddedResource(glsl_quadwrite_frag), shaderType, glslVer, defines);
DebugData.quadoverdrawFragShader = CreateShader(eGL_FRAGMENT_SHADER, source);
}
}
else
{