diff --git a/src/gpu/GrShaderCaps.cpp b/src/gpu/GrShaderCaps.cpp index 20bc708990..365476e768 100644 --- a/src/gpu/GrShaderCaps.cpp +++ b/src/gpu/GrShaderCaps.cpp @@ -22,6 +22,7 @@ GrShaderCaps::GrShaderCaps(const GrContextOptions& options) { fDualSourceBlendingSupport = false; fIntegerSupport = false; fNonsquareMatrixSupport = false; + fInverseHyperbolicSupport = false; fFBFetchSupport = false; fFBFetchNeedsCustomOutput = false; fUsesPrecisionModifiers = false; @@ -95,6 +96,7 @@ void GrShaderCaps::dumpJSON(SkJSONWriter* writer) const { writer->appendBool("Dual Source Blending Support", fDualSourceBlendingSupport); writer->appendBool("Integer Support", fIntegerSupport); writer->appendBool("Nonsquare Matrix Support", fNonsquareMatrixSupport); + writer->appendBool("Inverse Hyperbolic Support", fInverseHyperbolicSupport); static const char* kAdvBlendEqInteractionStr[] = { "Not Supported", diff --git a/src/gpu/GrShaderCaps.h b/src/gpu/GrShaderCaps.h index ab4fd3a6cd..a199d8a6ad 100644 --- a/src/gpu/GrShaderCaps.h +++ b/src/gpu/GrShaderCaps.h @@ -49,6 +49,9 @@ public: bool integerSupport() const { return fIntegerSupport; } bool nonsquareMatrixSupport() const { return fNonsquareMatrixSupport; } + // asinh(), acosh(), atanh() + bool inverseHyperbolicSupport() const { return fInverseHyperbolicSupport; } + /** * Some helper functions for encapsulating various extensions to read FB Buffer on openglES * @@ -283,6 +286,7 @@ private: bool fDualSourceBlendingSupport : 1; bool fIntegerSupport : 1; bool fNonsquareMatrixSupport : 1; + bool fInverseHyperbolicSupport : 1; bool fFBFetchSupport : 1; bool fFBFetchNeedsCustomOutput : 1; bool fUsesPrecisionModifiers : 1; diff --git a/src/gpu/d3d/GrD3DCaps.cpp b/src/gpu/d3d/GrD3DCaps.cpp index 06e620b373..3a014f3edf 100644 --- a/src/gpu/d3d/GrD3DCaps.cpp +++ b/src/gpu/d3d/GrD3DCaps.cpp @@ -246,6 +246,8 @@ void GrD3DCaps::initShaderCaps(int vendorID, const D3D12_FEATURE_DATA_D3D12_OPTI shaderCaps->fIntegerSupport = true; shaderCaps->fNonsquareMatrixSupport = true; + // TODO(skia:12352) HLSL does not expose asinh/acosh/atanh + shaderCaps->fInverseHyperbolicSupport = false; shaderCaps->fVertexIDSupport = true; shaderCaps->fInfinitySupport = true; shaderCaps->fBitManipulationSupport = true; diff --git a/src/gpu/gl/GrGLCaps.cpp b/src/gpu/gl/GrGLCaps.cpp index 5c7fb18ead..51aba867e0 100644 --- a/src/gpu/gl/GrGLCaps.cpp +++ b/src/gpu/gl/GrGLCaps.cpp @@ -388,6 +388,7 @@ void GrGLCaps::init(const GrContextOptions& contextOptions, ctxInfo.glslGeneration() >= k130_GrGLSLGeneration; shaderCaps->fNonsquareMatrixSupport = ctxInfo.glslGeneration() >= k130_GrGLSLGeneration; + shaderCaps->fInverseHyperbolicSupport = ctxInfo.glslGeneration() >= k130_GrGLSLGeneration; } else if (GR_IS_GR_GL_ES(standard)) { shaderCaps->fDualSourceBlendingSupport = ctxInfo.hasExtension("GL_EXT_blend_func_extended"); @@ -413,12 +414,14 @@ void GrGLCaps::init(const GrContextOptions& contextOptions, shaderCaps->fIntegerSupport = version >= GR_GL_VER(3, 0) && ctxInfo.glslGeneration() >= k330_GrGLSLGeneration; // We use this value for GLSL ES 3.0. shaderCaps->fNonsquareMatrixSupport = ctxInfo.glslGeneration() >= k330_GrGLSLGeneration; + shaderCaps->fInverseHyperbolicSupport = ctxInfo.glslGeneration() >= k330_GrGLSLGeneration; } else if (GR_IS_GR_WEBGL(standard)) { shaderCaps->fShaderDerivativeSupport = version >= GR_GL_VER(2, 0) || ctxInfo.hasExtension("GL_OES_standard_derivatives") || ctxInfo.hasExtension("OES_standard_derivatives"); shaderCaps->fIntegerSupport = (version >= GR_GL_VER(2, 0)); shaderCaps->fNonsquareMatrixSupport = ctxInfo.glslGeneration() >= k330_GrGLSLGeneration; + shaderCaps->fInverseHyperbolicSupport = ctxInfo.glslGeneration() >= k330_GrGLSLGeneration; } if (ctxInfo.hasExtension("GL_NV_conservative_raster")) { diff --git a/src/gpu/mtl/GrMtlCaps.mm b/src/gpu/mtl/GrMtlCaps.mm index fc18bfe520..37363b5da2 100644 --- a/src/gpu/mtl/GrMtlCaps.mm +++ b/src/gpu/mtl/GrMtlCaps.mm @@ -475,6 +475,7 @@ void GrMtlCaps::initShaderCaps() { shaderCaps->fIntegerSupport = true; shaderCaps->fNonsquareMatrixSupport = true; + shaderCaps->fInverseHyperbolicSupport = true; shaderCaps->fVertexIDSupport = true; shaderCaps->fInfinitySupport = true; diff --git a/src/gpu/vk/GrVkCaps.cpp b/src/gpu/vk/GrVkCaps.cpp index e94999073d..3dc09f6aa9 100644 --- a/src/gpu/vk/GrVkCaps.cpp +++ b/src/gpu/vk/GrVkCaps.cpp @@ -715,6 +715,7 @@ void GrVkCaps::initShaderCaps(const VkPhysicalDeviceProperties& properties, shaderCaps->fIntegerSupport = true; shaderCaps->fNonsquareMatrixSupport = true; + shaderCaps->fInverseHyperbolicSupport = true; shaderCaps->fVertexIDSupport = true; shaderCaps->fInfinitySupport = true; shaderCaps->fBitManipulationSupport = true; diff --git a/src/sksl/SkSLUtil.h b/src/sksl/SkSLUtil.h index f53061ff29..16f8825af1 100644 --- a/src/sksl/SkSLUtil.h +++ b/src/sksl/SkSLUtil.h @@ -174,6 +174,11 @@ public: return fNonsquareMatrixSupport; } + bool fInverseHyperbolicSupport = false; + bool inverseHyperbolicSupport() const { + return fInverseHyperbolicSupport; + } + bool fBuiltinFMASupport = false; bool builtinFMASupport() const { return fBuiltinFMASupport;