Commit a60e4973 by Tobin Ehlis Committed by Commit Bot

Revert "Vulkan:Include precision qualifier in GLSL"

This reverts commit 93e72f5f. Reason for revert: This is having a negative impact on gfxbench Manhattan 3.1 tests (20-30%) with only a minor improvement (~4%) in TRex offscreen. Pulling out for now and need to re-evaluate best solution here. Original change's description: > Vulkan:Include precision qualifier in GLSL > > With this initial implementation, it's possible to get precision > qualifier mis-matches in the generated GLSL 4.50. According to the > spec this is allowed. From GLSLangSpec 4.50 section 4.7 "Precision and > Precision Qualifiers": > > For the purposes of determining if an output from one shader stage > matches an input of the next stage, the precision qualifier need not > match. > > However, when converted to SPIR-V and run through the shader validation > any mismatches will cause shader validation errors. Initially just > ignoring those errors with this commit. > > Bug: angleproject:3078 > Change-Id: Ia2b04f90f0a7b6b1302c1b1b3e32bcfd8db9ed49 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2057749 > Reviewed-by: Jamie Madill <jmadill@chromium.org> > Reviewed-by: Tobin Ehlis <tobine@google.com> > Reviewed-by: Tim Van Patten <timvp@google.com> > Commit-Queue: Tobin Ehlis <tobine@google.com> TBR=tobine@google.com,timvp@google.com,jmadill@chromium.org # Not skipping CQ checks because original CL landed > 1 day ago. Bug: angleproject:3078 Change-Id: I84984e2a963bde573f0f1de585001ceb83623c89 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2079334Reviewed-by: 's avatarTobin Ehlis <tobine@google.com> Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
parent 78da538a
...@@ -27,7 +27,6 @@ TOutputVulkanGLSL::TOutputVulkanGLSL(TInfoSinkBase &objSink, ...@@ -27,7 +27,6 @@ TOutputVulkanGLSL::TOutputVulkanGLSL(TInfoSinkBase &objSink,
sh::GLenum shaderType, sh::GLenum shaderType,
int shaderVersion, int shaderVersion,
ShShaderOutput output, ShShaderOutput output,
bool forceHighp,
ShCompileOptions compileOptions) ShCompileOptions compileOptions)
: TOutputGLSL(objSink, : TOutputGLSL(objSink,
clampingStrategy, clampingStrategy,
...@@ -40,8 +39,7 @@ TOutputVulkanGLSL::TOutputVulkanGLSL(TInfoSinkBase &objSink, ...@@ -40,8 +39,7 @@ TOutputVulkanGLSL::TOutputVulkanGLSL(TInfoSinkBase &objSink,
compileOptions), compileOptions),
mNextUnusedBinding(0), mNextUnusedBinding(0),
mNextUnusedInputLocation(0), mNextUnusedInputLocation(0),
mNextUnusedOutputLocation(0), mNextUnusedOutputLocation(0)
mForceHighp(forceHighp)
{} {}
void TOutputVulkanGLSL::writeLayoutQualifier(TIntermTyped *variable) void TOutputVulkanGLSL::writeLayoutQualifier(TIntermTyped *variable)
...@@ -170,17 +168,4 @@ void TOutputVulkanGLSL::writeStructType(const TStructure *structure) ...@@ -170,17 +168,4 @@ void TOutputVulkanGLSL::writeStructType(const TStructure *structure)
} }
} }
bool TOutputVulkanGLSL::writeVariablePrecision(TPrecision precision)
{
if (precision == EbpUndefined)
return false;
TInfoSinkBase &out = objSink();
if (mForceHighp)
out << getPrecisionString(EbpHigh);
else
out << getPrecisionString(precision);
return true;
}
} // namespace sh } // namespace sh
...@@ -25,7 +25,6 @@ class TOutputVulkanGLSL : public TOutputGLSL ...@@ -25,7 +25,6 @@ class TOutputVulkanGLSL : public TOutputGLSL
sh::GLenum shaderType, sh::GLenum shaderType,
int shaderVersion, int shaderVersion,
ShShaderOutput output, ShShaderOutput output,
bool forceHighp,
ShCompileOptions compileOptions); ShCompileOptions compileOptions);
void writeStructType(const TStructure *structure); void writeStructType(const TStructure *structure);
...@@ -49,7 +48,6 @@ class TOutputVulkanGLSL : public TOutputGLSL ...@@ -49,7 +48,6 @@ class TOutputVulkanGLSL : public TOutputGLSL
void writeVariableType(const TType &type, void writeVariableType(const TType &type,
const TSymbol *symbol, const TSymbol *symbol,
bool isFunctionArgument) override; bool isFunctionArgument) override;
bool writeVariablePrecision(TPrecision) override;
// Every resource that requires set & binding layout qualifiers is assigned set 0 and an // Every resource that requires set & binding layout qualifiers is assigned set 0 and an
// arbitrary binding when outputting GLSL. Every input/output that requires a location // arbitrary binding when outputting GLSL. Every input/output that requires a location
...@@ -59,9 +57,6 @@ class TOutputVulkanGLSL : public TOutputGLSL ...@@ -59,9 +57,6 @@ class TOutputVulkanGLSL : public TOutputGLSL
uint32_t mNextUnusedBinding; uint32_t mNextUnusedBinding;
uint32_t mNextUnusedInputLocation; uint32_t mNextUnusedInputLocation;
uint32_t mNextUnusedOutputLocation; uint32_t mNextUnusedOutputLocation;
private:
bool mForceHighp;
}; };
} // namespace sh } // namespace sh
...@@ -71,7 +71,6 @@ TOutputVulkanGLSLForMetal::TOutputVulkanGLSLForMetal(TInfoSinkBase &objSink, ...@@ -71,7 +71,6 @@ TOutputVulkanGLSLForMetal::TOutputVulkanGLSLForMetal(TInfoSinkBase &objSink,
shaderType, shaderType,
shaderVersion, shaderVersion,
output, output,
false,
compileOptions) compileOptions)
{} {}
......
...@@ -67,10 +67,9 @@ bool TranslatorMetal::translate(TIntermBlock *root, ...@@ -67,10 +67,9 @@ bool TranslatorMetal::translate(TIntermBlock *root,
PerformanceDiagnostics *perfDiagnostics) PerformanceDiagnostics *perfDiagnostics)
{ {
TInfoSinkBase &sink = getInfoSink().obj; TInfoSinkBase &sink = getInfoSink().obj;
TOutputVulkanGLSL outputGLSL(sink, getArrayIndexClampingStrategy(), getHashFunction(), TOutputVulkanGLSL outputGLSL(sink, getArrayIndexClampingStrategy(), getHashFunction(),
getNameMap(), &getSymbolTable(), getShaderType(), getNameMap(), &getSymbolTable(), getShaderType(),
getShaderVersion(), getOutputType(), false, compileOptions); getShaderVersion(), getOutputType(), compileOptions);
const TVariable *driverUniforms = nullptr; const TVariable *driverUniforms = nullptr;
if (!TranslatorVulkan::translateImpl(root, compileOptions, perfDiagnostics, &driverUniforms, if (!TranslatorVulkan::translateImpl(root, compileOptions, perfDiagnostics, &driverUniforms,
......
...@@ -1043,14 +1043,9 @@ bool TranslatorVulkan::translate(TIntermBlock *root, ...@@ -1043,14 +1043,9 @@ bool TranslatorVulkan::translate(TIntermBlock *root,
{ {
TInfoSinkBase &sink = getInfoSink().obj; TInfoSinkBase &sink = getInfoSink().obj;
TOutputVulkanGLSL outputGLSL(sink, getArrayIndexClampingStrategy(), getHashFunction(),
bool precisionEmulation = false; getNameMap(), &getSymbolTable(), getShaderType(),
if (!emulatePrecisionIfNeeded(root, sink, &precisionEmulation, SH_GLSL_VULKAN_OUTPUT)) getShaderVersion(), getOutputType(), compileOptions);
return false;
TOutputVulkanGLSL outputGLSL(
sink, getArrayIndexClampingStrategy(), getHashFunction(), getNameMap(), &getSymbolTable(),
getShaderType(), getShaderVersion(), getOutputType(), precisionEmulation, compileOptions);
if (!translateImpl(root, compileOptions, perfDiagnostics, nullptr, &outputGLSL)) if (!translateImpl(root, compileOptions, perfDiagnostics, nullptr, &outputGLSL))
{ {
......
...@@ -124,9 +124,9 @@ constexpr const char *kSkippedMessages[] = { ...@@ -124,9 +124,9 @@ constexpr const char *kSkippedMessages[] = {
"VUID-vkDestroySemaphore-semaphore-parameter", "VUID-vkDestroySemaphore-semaphore-parameter",
// http://anglebug.com/4063 // http://anglebug.com/4063
"VUID-VkDeviceCreateInfo-pNext-pNext", "VUID-VkDeviceCreateInfo-pNext-pNext",
"VUID-VkPipelineRasterizationStateCreateInfo-pNext-pNext", "VUID_Undefined", "VUID-VkPipelineRasterizationStateCreateInfo-pNext-pNext",
// http://anglebug.com/3078 "VUID_Undefined",
"UNASSIGNED-CoreValidation-Shader-InterfaceTypeMismatch"}; };
// Suppress validation errors that are known // Suppress validation errors that are known
// return "true" if given code/prefix/message is known, else return "false" // return "true" if given code/prefix/message is known, else return "false"
......
...@@ -567,14 +567,6 @@ ...@@ -567,14 +567,6 @@
2830 ANDROID VULKAN : dEQP-GLES3.functional.rasterization.fbo.texture_2d.primitives.lines = FAIL 2830 ANDROID VULKAN : dEQP-GLES3.functional.rasterization.fbo.texture_2d.primitives.lines = FAIL
2830 ANDROID VULKAN : dEQP-GLES3.functional.rasterization.primitives.line* = FAIL 2830 ANDROID VULKAN : dEQP-GLES3.functional.rasterization.primitives.line* = FAIL
2808 ANDROID VULKAN : dEQP-GLES3.functional.shaders.builtin_variable.fragcoord_w = FAIL 2808 ANDROID VULKAN : dEQP-GLES3.functional.shaders.builtin_variable.fragcoord_w = FAIL
3078 ANDROID VULKAN : dEQP-GLES3.functional.shaders.operator.unary_operator.minus.lowp_uint_fragment = FAIL
3078 ANDROID VULKAN : dEQP-GLES3.functional.shaders.operator.unary_operator.minus.lowp_uvec2_fragment = FAIL
3078 ANDROID VULKAN : dEQP-GLES3.functional.shaders.operator.unary_operator.minus.lowp_uvec3_fragment = FAIL
3078 ANDROID VULKAN : dEQP-GLES3.functional.shaders.operator.unary_operator.minus.lowp_uvec4_fragment = FAIL
3078 ANDROID VULKAN : dEQP-GLES3.functional.shaders.operator.unary_operator.minus.mediump_uint_fragment = FAIL
3078 ANDROID VULKAN : dEQP-GLES3.functional.shaders.operator.unary_operator.minus.mediump_uvec2_fragment = FAIL
3078 ANDROID VULKAN : dEQP-GLES3.functional.shaders.operator.unary_operator.minus.mediump_uvec3_fragment = FAIL
3078 ANDROID VULKAN : dEQP-GLES3.functional.shaders.operator.unary_operator.minus.mediump_uvec4_fragment = FAIL
// Pixel driver issues // Pixel driver issues
4024 PIXEL2ORXL VULKAN : dEQP-GLES3.functional.draw.random.5 = SKIP 4024 PIXEL2ORXL VULKAN : dEQP-GLES3.functional.draw.random.5 = SKIP
......
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