Add caps bit for nonsquare matrix availability.

Change-Id: Ifddf49096943260eefa8d313a8a90a74ddb27097
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/403078
Commit-Queue: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
This commit is contained in:
John Stiles 2021-05-03 09:21:12 -04:00 committed by Skia Commit-Bot
parent ff8b52df55
commit ec79349bad
6 changed files with 15 additions and 0 deletions

View File

@ -21,6 +21,7 @@ GrShaderCaps::GrShaderCaps(const GrContextOptions& options) {
fDstReadInShaderSupport = false;
fDualSourceBlendingSupport = false;
fIntegerSupport = false;
fNonsquareMatrixSupport = false;
fFBFetchSupport = false;
fFBFetchNeedsCustomOutput = false;
fUsesPrecisionModifiers = false;
@ -90,6 +91,7 @@ void GrShaderCaps::dumpJSON(SkJSONWriter* writer) const {
writer->appendBool("Dst Read In Shader Support", fDstReadInShaderSupport);
writer->appendBool("Dual Source Blending Support", fDualSourceBlendingSupport);
writer->appendBool("Integer Support", fIntegerSupport);
writer->appendBool("Nonsquare Matrix Support", fNonsquareMatrixSupport);
static const char* kAdvBlendEqInteractionStr[] = {
"Not Supported",

View File

@ -47,6 +47,7 @@ public:
bool dstReadInShaderSupport() const { return fDstReadInShaderSupport; }
bool dualSourceBlendingSupport() const { return fDualSourceBlendingSupport; }
bool integerSupport() const { return fIntegerSupport; }
bool nonsquareMatrixSupport() const { return fNonsquareMatrixSupport; }
/**
* Some helper functions for encapsulating various extensions to read FB Buffer on openglES
@ -273,6 +274,7 @@ private:
bool fDstReadInShaderSupport : 1;
bool fDualSourceBlendingSupport : 1;
bool fIntegerSupport : 1;
bool fNonsquareMatrixSupport : 1;
bool fFBFetchSupport : 1;
bool fFBFetchNeedsCustomOutput : 1;
bool fUsesPrecisionModifiers : 1;

View File

@ -375,6 +375,8 @@ void GrGLCaps::init(const GrContextOptions& contextOptions,
shaderCaps->fIntegerSupport = version >= GR_GL_VER(3, 0) &&
ctxInfo.glslGeneration() >= k130_GrGLSLGeneration;
shaderCaps->fNonsquareMatrixSupport = ctxInfo.glslGeneration() >= k130_GrGLSLGeneration;
} else if (GR_IS_GR_GL_ES(standard)) {
shaderCaps->fDualSourceBlendingSupport = ctxInfo.hasExtension("GL_EXT_blend_func_extended");
@ -399,11 +401,13 @@ 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;
} 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;
}
if (ctxInfo.hasExtension("GL_NV_conservative_raster")) {

View File

@ -472,6 +472,7 @@ void GrMtlCaps::initShaderCaps() {
shaderCaps->fDstReadInShaderSupport = shaderCaps->fFBFetchSupport;
shaderCaps->fIntegerSupport = true;
shaderCaps->fNonsquareMatrixSupport = true;
shaderCaps->fVertexIDSupport = false;
// Metal uses IEEE float and half floats so assuming those values here.

View File

@ -714,6 +714,7 @@ void GrVkCaps::initShaderCaps(const VkPhysicalDeviceProperties& properties,
shaderCaps->fDualSourceBlendingSupport = features.features.dualSrcBlend;
shaderCaps->fIntegerSupport = true;
shaderCaps->fNonsquareMatrixSupport = true;
shaderCaps->fVertexIDSupport = true;
shaderCaps->fFPManipulationSupport = true;

View File

@ -164,6 +164,11 @@ public:
return fIntegerSupport;
}
bool fNonsquareMatrixSupport = false;
bool nonsquareMatrixSupport() const {
return fNonsquareMatrixSupport;
}
bool fBuiltinFMASupport = false;
bool builtinFMASupport() const {
return fBuiltinFMASupport;