Commit 57d116a4 by Jamie Madill

Revert "D3D: Generate more shader debug info by default."

Has a bug where we would return the wrong size for the query. BUG=angleproject:1179 This reverts commit 6de4d494. Change-Id: Ib58aaf0b58d8f20765f7267b29acd8c62d287525 Reviewed-on: https://chromium-review.googlesource.com/313552Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Tested-by: 's avatarJamie Madill <jmadill@chromium.org>
parent 04c66234
......@@ -32,14 +32,10 @@
#define ANGLE_PROGRAM_BINARY_LOAD ANGLE_ENABLED
#endif
// Append HLSL assembly to shader debug info. Defaults to enabled in Debug and off in Release.
#if !defined(ANGLE_APPEND_ASSEMBLY_TO_SHADER_DEBUG_INFO)
#if !defined(NDEBUG)
#define ANGLE_APPEND_ASSEMBLY_TO_SHADER_DEBUG_INFO ANGLE_ENABLED
#else
#define ANGLE_APPEND_ASSEMBLY_TO_SHADER_DEBUG_INFO ANGLE_DISABLED
#endif // !defined(NDEBUG)
#endif // !defined(ANGLE_APPEND_ASSEMBLY_TO_SHADER_DEBUG_INFO)
// Shader debug info
#if !defined(ANGLE_SHADER_DEBUG_INFO)
#define ANGLE_SHADER_DEBUG_INFO ANGLE_DISABLED
#endif
// Program link validation of precisions for uniforms. This feature was
// requested by developers to allow non-conformant shaders to be used which
......
......@@ -12,9 +12,12 @@
#include "libANGLE/histogram_macros.h"
#include "third_party/trace_event/trace_event.h"
#if ANGLE_APPEND_ASSEMBLY_TO_SHADER_DEBUG_INFO == ANGLE_ENABLED
// Definitions local to the translation unit
namespace
{
#if ANGLE_SHADER_DEBUG_INFO == ANGLE_ENABLED
#ifdef CREATE_COMPILER_FLAG_INFO
#undef CREATE_COMPILER_FLAG_INFO
#endif
......@@ -75,8 +78,10 @@ bool IsCompilerFlagSet(UINT mask, UINT flag)
return isFlagSet;
}
}
} // anonymous namespace
#endif // ANGLE_APPEND_ASSEMBLY_TO_SHADER_DEBUG_INFO == ANGLE_ENABLED
#endif
}
namespace rx
{
......@@ -242,9 +247,8 @@ gl::Error HLSLCompiler::compileToBinary(gl::InfoLog &infoLog, const std::string
{
*outCompiledBlob = binary;
#if ANGLE_SHADER_DEBUG_INFO == ANGLE_ENABLED
(*outDebugInfo) += "// COMPILER INPUT HLSL BEGIN\n\n" + hlsl + "\n// COMPILER INPUT HLSL END\n";
#if ANGLE_APPEND_ASSEMBLY_TO_SHADER_DEBUG_INFO == ANGLE_ENABLED
(*outDebugInfo) += "\n\n// ASSEMBLY BEGIN\n\n";
(*outDebugInfo) += "// Compiler configuration: " + configs[i].name + "\n// Flags:\n";
for (size_t fIx = 0; fIx < ArraySize(CompilerFlagInfos); ++fIx)
......@@ -275,7 +279,7 @@ gl::Error HLSLCompiler::compileToBinary(gl::InfoLog &infoLog, const std::string
return error;
}
(*outDebugInfo) += "\n" + disassembly + "\n// ASSEMBLY END\n";
#endif // ANGLE_APPEND_ASSEMBLY_TO_SHADER_DEBUG_INFO == ANGLE_ENABLED
#endif
return gl::Error(GL_NO_ERROR);
}
......@@ -329,4 +333,4 @@ gl::Error HLSLCompiler::disassembleBinary(ID3DBlob *shaderBinary, std::string *d
return gl::Error(GL_NO_ERROR);
}
} // namespace rx
}
......@@ -1294,21 +1294,20 @@ LinkResult ProgramD3D::compileProgramExecutables(const gl::Data &data, gl::InfoL
}
// Auto-generate the geometry shader here, if we expect to be using point rendering in D3D11.
ShaderExecutableD3D *pointGS = nullptr;
if (usesGeometryShader(GL_POINTS))
{
getGeometryExecutableForPrimitiveType(data, GL_POINTS, &pointGS, &infoLog);
getGeometryExecutableForPrimitiveType(data, GL_POINTS, nullptr, &infoLog);
}
#if ANGLE_SHADER_DEBUG_INFO == ANGLE_ENABLED
const ShaderD3D *vertexShaderD3D = GetImplAs<ShaderD3D>(mData.getAttachedVertexShader());
if (usesGeometryShader(GL_POINTS) && pointGS)
if (usesGeometryShader() && mGeometryExecutable)
{
// Geometry shaders are currently only used internally, so there is no corresponding shader
// object at the interface level. For now the geometry shader debug info is prepended to
// the vertex shader.
vertexShaderD3D->appendDebugInfo("// GEOMETRY SHADER BEGIN\n\n");
vertexShaderD3D->appendDebugInfo(pointGS->getDebugInfo());
vertexShaderD3D->appendDebugInfo(mGeometryExecutable->getDebugInfo());
vertexShaderD3D->appendDebugInfo("\nGEOMETRY SHADER END\n\n\n");
}
......@@ -1323,9 +1322,11 @@ LinkResult ProgramD3D::compileProgramExecutables(const gl::Data &data, gl::InfoL
GetImplAs<ShaderD3D>(mData.getAttachedFragmentShader());
fragmentShaderD3D->appendDebugInfo(defaultPixelExecutable->getDebugInfo());
}
#endif
bool linkSuccess = (defaultVertexExecutable && defaultPixelExecutable &&
(!usesGeometryShader(GL_POINTS) || pointGS));
bool linkSuccess =
(defaultVertexExecutable && defaultPixelExecutable &&
(!usesGeometryShader(GL_POINTS) || mGeometryExecutables[gl::PRIMITIVE_POINTS]));
return LinkResult(linkSuccess, gl::Error(GL_NO_ERROR));
}
......
......@@ -192,11 +192,15 @@ bool ShaderD3D::postTranslateCompile(gl::Compiler *compiler, std::string *infoLo
}
}
#if ANGLE_SHADER_DEBUG_INFO == ANGLE_ENABLED
mDebugInfo +=
std::string("// ") + GetShaderTypeString(mData.getShaderType()) + " SHADER BEGIN\n";
mDebugInfo += "\n// GLSL BEGIN\n\n" + mData.getSource() + "\n\n// GLSL END\n\n\n";
std::string("// ") + GetShaderTypeString(mData->getShaderType()) + " SHADER BEGIN\n";
mDebugInfo += "\n// GLSL BEGIN\n\n" + source + "\n\n// GLSL END\n\n\n";
mDebugInfo += "// INITIAL HLSL BEGIN\n\n" + translatedSource + "\n// INITIAL HLSL END\n\n\n";
// Successive steps will append more info
#else
mDebugInfo += translatedSource;
#endif
return true;
}
......
......@@ -390,6 +390,7 @@ void GL_APIENTRY GetTranslatedShaderSourceANGLE(GLuint shader, GLsizei bufsize,
return;
}
// Only returns extra info if ANGLE_GENERATE_SHADER_DEBUG_INFO is defined
shaderObject->getTranslatedSourceWithDebugInfo(bufsize, length, source);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment