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 @@ ...@@ -32,14 +32,10 @@
#define ANGLE_PROGRAM_BINARY_LOAD ANGLE_ENABLED #define ANGLE_PROGRAM_BINARY_LOAD ANGLE_ENABLED
#endif #endif
// Append HLSL assembly to shader debug info. Defaults to enabled in Debug and off in Release. // Shader debug info
#if !defined(ANGLE_APPEND_ASSEMBLY_TO_SHADER_DEBUG_INFO) #if !defined(ANGLE_SHADER_DEBUG_INFO)
#if !defined(NDEBUG) #define ANGLE_SHADER_DEBUG_INFO ANGLE_DISABLED
#define ANGLE_APPEND_ASSEMBLY_TO_SHADER_DEBUG_INFO ANGLE_ENABLED #endif
#else
#define ANGLE_APPEND_ASSEMBLY_TO_SHADER_DEBUG_INFO ANGLE_DISABLED
#endif // !defined(NDEBUG)
#endif // !defined(ANGLE_APPEND_ASSEMBLY_TO_SHADER_DEBUG_INFO)
// Program link validation of precisions for uniforms. This feature was // Program link validation of precisions for uniforms. This feature was
// requested by developers to allow non-conformant shaders to be used which // requested by developers to allow non-conformant shaders to be used which
......
...@@ -12,9 +12,12 @@ ...@@ -12,9 +12,12 @@
#include "libANGLE/histogram_macros.h" #include "libANGLE/histogram_macros.h"
#include "third_party/trace_event/trace_event.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 namespace
{ {
#if ANGLE_SHADER_DEBUG_INFO == ANGLE_ENABLED
#ifdef CREATE_COMPILER_FLAG_INFO #ifdef CREATE_COMPILER_FLAG_INFO
#undef CREATE_COMPILER_FLAG_INFO #undef CREATE_COMPILER_FLAG_INFO
#endif #endif
...@@ -75,8 +78,10 @@ bool IsCompilerFlagSet(UINT mask, UINT flag) ...@@ -75,8 +78,10 @@ bool IsCompilerFlagSet(UINT mask, UINT flag)
return isFlagSet; return isFlagSet;
} }
} }
} // anonymous namespace
#endif // ANGLE_APPEND_ASSEMBLY_TO_SHADER_DEBUG_INFO == ANGLE_ENABLED #endif
}
namespace rx namespace rx
{ {
...@@ -242,9 +247,8 @@ gl::Error HLSLCompiler::compileToBinary(gl::InfoLog &infoLog, const std::string ...@@ -242,9 +247,8 @@ gl::Error HLSLCompiler::compileToBinary(gl::InfoLog &infoLog, const std::string
{ {
*outCompiledBlob = binary; *outCompiledBlob = binary;
#if ANGLE_SHADER_DEBUG_INFO == ANGLE_ENABLED
(*outDebugInfo) += "// COMPILER INPUT HLSL BEGIN\n\n" + hlsl + "\n// COMPILER INPUT HLSL END\n"; (*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) += "\n\n// ASSEMBLY BEGIN\n\n";
(*outDebugInfo) += "// Compiler configuration: " + configs[i].name + "\n// Flags:\n"; (*outDebugInfo) += "// Compiler configuration: " + configs[i].name + "\n// Flags:\n";
for (size_t fIx = 0; fIx < ArraySize(CompilerFlagInfos); ++fIx) for (size_t fIx = 0; fIx < ArraySize(CompilerFlagInfos); ++fIx)
...@@ -275,7 +279,7 @@ gl::Error HLSLCompiler::compileToBinary(gl::InfoLog &infoLog, const std::string ...@@ -275,7 +279,7 @@ gl::Error HLSLCompiler::compileToBinary(gl::InfoLog &infoLog, const std::string
return error; return error;
} }
(*outDebugInfo) += "\n" + disassembly + "\n// ASSEMBLY END\n"; (*outDebugInfo) += "\n" + disassembly + "\n// ASSEMBLY END\n";
#endif // ANGLE_APPEND_ASSEMBLY_TO_SHADER_DEBUG_INFO == ANGLE_ENABLED #endif
return gl::Error(GL_NO_ERROR); return gl::Error(GL_NO_ERROR);
} }
...@@ -329,4 +333,4 @@ gl::Error HLSLCompiler::disassembleBinary(ID3DBlob *shaderBinary, std::string *d ...@@ -329,4 +333,4 @@ gl::Error HLSLCompiler::disassembleBinary(ID3DBlob *shaderBinary, std::string *d
return gl::Error(GL_NO_ERROR); return gl::Error(GL_NO_ERROR);
} }
} // namespace rx }
...@@ -1294,21 +1294,20 @@ LinkResult ProgramD3D::compileProgramExecutables(const gl::Data &data, gl::InfoL ...@@ -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. // Auto-generate the geometry shader here, if we expect to be using point rendering in D3D11.
ShaderExecutableD3D *pointGS = nullptr;
if (usesGeometryShader(GL_POINTS)) 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()); const ShaderD3D *vertexShaderD3D = GetImplAs<ShaderD3D>(mData.getAttachedVertexShader());
if (usesGeometryShader() && mGeometryExecutable)
if (usesGeometryShader(GL_POINTS) && pointGS)
{ {
// Geometry shaders are currently only used internally, so there is no corresponding shader // 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 // object at the interface level. For now the geometry shader debug info is prepended to
// the vertex shader. // the vertex shader.
vertexShaderD3D->appendDebugInfo("// GEOMETRY SHADER BEGIN\n\n"); vertexShaderD3D->appendDebugInfo("// GEOMETRY SHADER BEGIN\n\n");
vertexShaderD3D->appendDebugInfo(pointGS->getDebugInfo()); vertexShaderD3D->appendDebugInfo(mGeometryExecutable->getDebugInfo());
vertexShaderD3D->appendDebugInfo("\nGEOMETRY SHADER END\n\n\n"); vertexShaderD3D->appendDebugInfo("\nGEOMETRY SHADER END\n\n\n");
} }
...@@ -1323,9 +1322,11 @@ LinkResult ProgramD3D::compileProgramExecutables(const gl::Data &data, gl::InfoL ...@@ -1323,9 +1322,11 @@ LinkResult ProgramD3D::compileProgramExecutables(const gl::Data &data, gl::InfoL
GetImplAs<ShaderD3D>(mData.getAttachedFragmentShader()); GetImplAs<ShaderD3D>(mData.getAttachedFragmentShader());
fragmentShaderD3D->appendDebugInfo(defaultPixelExecutable->getDebugInfo()); fragmentShaderD3D->appendDebugInfo(defaultPixelExecutable->getDebugInfo());
} }
#endif
bool linkSuccess = (defaultVertexExecutable && defaultPixelExecutable && bool linkSuccess =
(!usesGeometryShader(GL_POINTS) || pointGS)); (defaultVertexExecutable && defaultPixelExecutable &&
(!usesGeometryShader(GL_POINTS) || mGeometryExecutables[gl::PRIMITIVE_POINTS]));
return LinkResult(linkSuccess, gl::Error(GL_NO_ERROR)); return LinkResult(linkSuccess, gl::Error(GL_NO_ERROR));
} }
......
...@@ -192,11 +192,15 @@ bool ShaderD3D::postTranslateCompile(gl::Compiler *compiler, std::string *infoLo ...@@ -192,11 +192,15 @@ bool ShaderD3D::postTranslateCompile(gl::Compiler *compiler, std::string *infoLo
} }
} }
#if ANGLE_SHADER_DEBUG_INFO == ANGLE_ENABLED
mDebugInfo += mDebugInfo +=
std::string("// ") + GetShaderTypeString(mData.getShaderType()) + " SHADER BEGIN\n"; std::string("// ") + GetShaderTypeString(mData->getShaderType()) + " SHADER BEGIN\n";
mDebugInfo += "\n// GLSL BEGIN\n\n" + mData.getSource() + "\n\n// GLSL END\n\n\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"; mDebugInfo += "// INITIAL HLSL BEGIN\n\n" + translatedSource + "\n// INITIAL HLSL END\n\n\n";
// Successive steps will append more info // Successive steps will append more info
#else
mDebugInfo += translatedSource;
#endif
return true; return true;
} }
......
...@@ -390,6 +390,7 @@ void GL_APIENTRY GetTranslatedShaderSourceANGLE(GLuint shader, GLsizei bufsize, ...@@ -390,6 +390,7 @@ void GL_APIENTRY GetTranslatedShaderSourceANGLE(GLuint shader, GLsizei bufsize,
return; return;
} }
// Only returns extra info if ANGLE_GENERATE_SHADER_DEBUG_INFO is defined
shaderObject->getTranslatedSourceWithDebugInfo(bufsize, length, source); 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