From 6386efa1dd1b8de596b7f7f9d26dd0b8c4748da4 Mon Sep 17 00:00:00 2001 From: Brian Osman Date: Wed, 5 Jun 2019 10:59:00 -0400 Subject: [PATCH] Remove unused "DropsTileOnZeroDivide" caps bit Change-Id: I545d75a5b95833c6a78f225769ea30656700f785 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/218543 Reviewed-by: Brian Salomon Commit-Queue: Brian Osman --- src/gpu/GrShaderCaps.cpp | 2 -- src/gpu/GrShaderCaps.h | 3 --- src/gpu/gl/GrGLCaps.cpp | 3 --- src/sksl/SkSLIRGenerator.cpp | 1 - src/sksl/SkSLUtil.h | 5 ----- tests/SkSLGLSLTest.cpp | 8 +++----- 6 files changed, 3 insertions(+), 19 deletions(-) diff --git a/src/gpu/GrShaderCaps.cpp b/src/gpu/GrShaderCaps.cpp index cdf2c54b82..24c7b49170 100644 --- a/src/gpu/GrShaderCaps.cpp +++ b/src/gpu/GrShaderCaps.cpp @@ -23,7 +23,6 @@ GrShaderCaps::GrShaderCaps(const GrContextOptions& options) { fDualSourceBlendingSupport = false; fIntegerSupport = false; fImageLoadStoreSupport = false; - fDropsTileOnZeroDivide = false; fFBFetchSupport = false; fFBFetchNeedsCustomOutput = false; fUsesPrecisionModifiers = false; @@ -101,7 +100,6 @@ void GrShaderCaps::dumpJSON(SkJSONWriter* writer) const { GR_STATIC_ASSERT(SK_ARRAY_COUNT(kAdvBlendEqInteractionStr) == kLast_AdvBlendEqInteraction + 1); writer->appendBool("FB Fetch Support", fFBFetchSupport); - writer->appendBool("Drops tile on zero divide", fDropsTileOnZeroDivide); writer->appendBool("Uses precision modifiers", fUsesPrecisionModifiers); writer->appendBool("Can use any() function", fCanUseAnyFunctionInShader); writer->appendBool("Can use min() and abs() together", fCanUseMinAndAbsTogether); diff --git a/src/gpu/GrShaderCaps.h b/src/gpu/GrShaderCaps.h index 4c7e3ce4e6..18ba8a5bfb 100644 --- a/src/gpu/GrShaderCaps.h +++ b/src/gpu/GrShaderCaps.h @@ -65,8 +65,6 @@ public: const char* fbFetchExtensionString() const { return fFBFetchExtensionString; } - bool dropsTileOnZeroDivide() const { return fDropsTileOnZeroDivide; } - bool flatInterpolationSupport() const { return fFlatInterpolationSupport; } bool preferFlatInterpolation() const { return fPreferFlatInterpolation; } @@ -261,7 +259,6 @@ private: bool fDualSourceBlendingSupport : 1; bool fIntegerSupport : 1; bool fImageLoadStoreSupport : 1; - bool fDropsTileOnZeroDivide : 1; bool fFBFetchSupport : 1; bool fFBFetchNeedsCustomOutput : 1; bool fUsesPrecisionModifiers : 1; diff --git a/src/gpu/gl/GrGLCaps.cpp b/src/gpu/gl/GrGLCaps.cpp index 59f06d9444..4d972076d5 100644 --- a/src/gpu/gl/GrGLCaps.cpp +++ b/src/gpu/gl/GrGLCaps.cpp @@ -2794,9 +2794,6 @@ void GrGLCaps::applyDriverCorrectnessWorkarounds(const GrGLContextInfo& ctxInfo, shaderCaps->fFBFetchSupport = false; } - // Adreno GPUs have a tendency to drop tiles when there is a divide-by-zero in a shader - shaderCaps->fDropsTileOnZeroDivide = kQualcomm_GrGLVendor == ctxInfo.vendor(); - // On the NexusS and GalaxyNexus, the use of 'any' causes the compilation error "Calls to any // function that may require a gradient calculation inside a conditional block may return // undefined results". This appears to be an issue with the 'any' call since even the simple diff --git a/src/sksl/SkSLIRGenerator.cpp b/src/sksl/SkSLIRGenerator.cpp index 1a0f11fc7b..802e5b3904 100644 --- a/src/sksl/SkSLIRGenerator.cpp +++ b/src/sksl/SkSLIRGenerator.cpp @@ -131,7 +131,6 @@ static void fill_caps(const SKSL_CAPS_CLASS& caps, capsMap->insert(std::make_pair(String(#name), Program::Settings::Value(caps.name()))) CAP(fbFetchSupport); CAP(fbFetchNeedsCustomOutput); - CAP(dropsTileOnZeroDivide); CAP(flatInterpolationSupport); CAP(noperspectiveInterpolationSupport); CAP(sampleVariablesSupport); diff --git a/src/sksl/SkSLUtil.h b/src/sksl/SkSLUtil.h index 9c7375f37f..7655cb68a8 100644 --- a/src/sksl/SkSLUtil.h +++ b/src/sksl/SkSLUtil.h @@ -90,10 +90,6 @@ public: return false; } - bool dropsTileOnZeroDivide() const { - return false; - } - bool flatInterpolationSupport() const { return true; } @@ -338,7 +334,6 @@ public: result->fVersionDeclString = "#version 400"; result->fExternalTextureSupport = true; result->fFBFetchSupport = false; - result->fDropsTileOnZeroDivide = true; result->fCanUseAnyFunctionInShader = false; return result; } diff --git a/tests/SkSLGLSLTest.cpp b/tests/SkSLGLSLTest.cpp index c31e1f3471..1eb7b0d623 100644 --- a/tests/SkSLGLSLTest.cpp +++ b/tests/SkSLGLSLTest.cpp @@ -1012,18 +1012,16 @@ DEF_TEST(SkSLCaps, r) { "int x = 0;" "int y = 0;" "int z = 0;" - "int w = 0;" "if (sk_Caps.externalTextureSupport) x = 1;" "if (sk_Caps.fbFetchSupport) y = 1;" - "if (sk_Caps.dropsTileOnZeroDivide) z = 1;" - "if (sk_Caps.canUseAnyFunctionInShader) w = 1;" - "sk_FragColor = half4(x, y, z, w);" + "if (sk_Caps.canUseAnyFunctionInShader) z = 1;" + "sk_FragColor = half4(x, y, z, 0.0);" "}", *SkSL::ShaderCapsFactory::VariousCaps(), "#version 400\n" "out vec4 sk_FragColor;\n" "void main() {\n" - " sk_FragColor = vec4(1.0, 0.0, 1.0, 0.0);\n" + " sk_FragColor = vec4(1.0, 0.0, 0.0, 0.0);\n" "}\n"); }