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:
parent
ff8b52df55
commit
ec79349bad
@ -21,6 +21,7 @@ GrShaderCaps::GrShaderCaps(const GrContextOptions& options) {
|
|||||||
fDstReadInShaderSupport = false;
|
fDstReadInShaderSupport = false;
|
||||||
fDualSourceBlendingSupport = false;
|
fDualSourceBlendingSupport = false;
|
||||||
fIntegerSupport = false;
|
fIntegerSupport = false;
|
||||||
|
fNonsquareMatrixSupport = false;
|
||||||
fFBFetchSupport = false;
|
fFBFetchSupport = false;
|
||||||
fFBFetchNeedsCustomOutput = false;
|
fFBFetchNeedsCustomOutput = false;
|
||||||
fUsesPrecisionModifiers = false;
|
fUsesPrecisionModifiers = false;
|
||||||
@ -90,6 +91,7 @@ void GrShaderCaps::dumpJSON(SkJSONWriter* writer) const {
|
|||||||
writer->appendBool("Dst Read In Shader Support", fDstReadInShaderSupport);
|
writer->appendBool("Dst Read In Shader Support", fDstReadInShaderSupport);
|
||||||
writer->appendBool("Dual Source Blending Support", fDualSourceBlendingSupport);
|
writer->appendBool("Dual Source Blending Support", fDualSourceBlendingSupport);
|
||||||
writer->appendBool("Integer Support", fIntegerSupport);
|
writer->appendBool("Integer Support", fIntegerSupport);
|
||||||
|
writer->appendBool("Nonsquare Matrix Support", fNonsquareMatrixSupport);
|
||||||
|
|
||||||
static const char* kAdvBlendEqInteractionStr[] = {
|
static const char* kAdvBlendEqInteractionStr[] = {
|
||||||
"Not Supported",
|
"Not Supported",
|
||||||
|
@ -47,6 +47,7 @@ public:
|
|||||||
bool dstReadInShaderSupport() const { return fDstReadInShaderSupport; }
|
bool dstReadInShaderSupport() const { return fDstReadInShaderSupport; }
|
||||||
bool dualSourceBlendingSupport() const { return fDualSourceBlendingSupport; }
|
bool dualSourceBlendingSupport() const { return fDualSourceBlendingSupport; }
|
||||||
bool integerSupport() const { return fIntegerSupport; }
|
bool integerSupport() const { return fIntegerSupport; }
|
||||||
|
bool nonsquareMatrixSupport() const { return fNonsquareMatrixSupport; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Some helper functions for encapsulating various extensions to read FB Buffer on openglES
|
* Some helper functions for encapsulating various extensions to read FB Buffer on openglES
|
||||||
@ -273,6 +274,7 @@ private:
|
|||||||
bool fDstReadInShaderSupport : 1;
|
bool fDstReadInShaderSupport : 1;
|
||||||
bool fDualSourceBlendingSupport : 1;
|
bool fDualSourceBlendingSupport : 1;
|
||||||
bool fIntegerSupport : 1;
|
bool fIntegerSupport : 1;
|
||||||
|
bool fNonsquareMatrixSupport : 1;
|
||||||
bool fFBFetchSupport : 1;
|
bool fFBFetchSupport : 1;
|
||||||
bool fFBFetchNeedsCustomOutput : 1;
|
bool fFBFetchNeedsCustomOutput : 1;
|
||||||
bool fUsesPrecisionModifiers : 1;
|
bool fUsesPrecisionModifiers : 1;
|
||||||
|
@ -375,6 +375,8 @@ void GrGLCaps::init(const GrContextOptions& contextOptions,
|
|||||||
|
|
||||||
shaderCaps->fIntegerSupport = version >= GR_GL_VER(3, 0) &&
|
shaderCaps->fIntegerSupport = version >= GR_GL_VER(3, 0) &&
|
||||||
ctxInfo.glslGeneration() >= k130_GrGLSLGeneration;
|
ctxInfo.glslGeneration() >= k130_GrGLSLGeneration;
|
||||||
|
|
||||||
|
shaderCaps->fNonsquareMatrixSupport = ctxInfo.glslGeneration() >= k130_GrGLSLGeneration;
|
||||||
} else if (GR_IS_GR_GL_ES(standard)) {
|
} else if (GR_IS_GR_GL_ES(standard)) {
|
||||||
shaderCaps->fDualSourceBlendingSupport = ctxInfo.hasExtension("GL_EXT_blend_func_extended");
|
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) &&
|
shaderCaps->fIntegerSupport = version >= GR_GL_VER(3, 0) &&
|
||||||
ctxInfo.glslGeneration() >= k330_GrGLSLGeneration; // We use this value for GLSL ES 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)) {
|
} else if (GR_IS_GR_WEBGL(standard)) {
|
||||||
shaderCaps->fShaderDerivativeSupport = version >= GR_GL_VER(2, 0) ||
|
shaderCaps->fShaderDerivativeSupport = version >= GR_GL_VER(2, 0) ||
|
||||||
ctxInfo.hasExtension("GL_OES_standard_derivatives") ||
|
ctxInfo.hasExtension("GL_OES_standard_derivatives") ||
|
||||||
ctxInfo.hasExtension("OES_standard_derivatives");
|
ctxInfo.hasExtension("OES_standard_derivatives");
|
||||||
shaderCaps->fIntegerSupport = (version >= GR_GL_VER(2, 0));
|
shaderCaps->fIntegerSupport = (version >= GR_GL_VER(2, 0));
|
||||||
|
shaderCaps->fNonsquareMatrixSupport = ctxInfo.glslGeneration() >= k330_GrGLSLGeneration;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ctxInfo.hasExtension("GL_NV_conservative_raster")) {
|
if (ctxInfo.hasExtension("GL_NV_conservative_raster")) {
|
||||||
|
@ -472,6 +472,7 @@ void GrMtlCaps::initShaderCaps() {
|
|||||||
shaderCaps->fDstReadInShaderSupport = shaderCaps->fFBFetchSupport;
|
shaderCaps->fDstReadInShaderSupport = shaderCaps->fFBFetchSupport;
|
||||||
|
|
||||||
shaderCaps->fIntegerSupport = true;
|
shaderCaps->fIntegerSupport = true;
|
||||||
|
shaderCaps->fNonsquareMatrixSupport = true;
|
||||||
shaderCaps->fVertexIDSupport = false;
|
shaderCaps->fVertexIDSupport = false;
|
||||||
|
|
||||||
// Metal uses IEEE float and half floats so assuming those values here.
|
// Metal uses IEEE float and half floats so assuming those values here.
|
||||||
|
@ -714,6 +714,7 @@ void GrVkCaps::initShaderCaps(const VkPhysicalDeviceProperties& properties,
|
|||||||
shaderCaps->fDualSourceBlendingSupport = features.features.dualSrcBlend;
|
shaderCaps->fDualSourceBlendingSupport = features.features.dualSrcBlend;
|
||||||
|
|
||||||
shaderCaps->fIntegerSupport = true;
|
shaderCaps->fIntegerSupport = true;
|
||||||
|
shaderCaps->fNonsquareMatrixSupport = true;
|
||||||
shaderCaps->fVertexIDSupport = true;
|
shaderCaps->fVertexIDSupport = true;
|
||||||
shaderCaps->fFPManipulationSupport = true;
|
shaderCaps->fFPManipulationSupport = true;
|
||||||
|
|
||||||
|
@ -164,6 +164,11 @@ public:
|
|||||||
return fIntegerSupport;
|
return fIntegerSupport;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool fNonsquareMatrixSupport = false;
|
||||||
|
bool nonsquareMatrixSupport() const {
|
||||||
|
return fNonsquareMatrixSupport;
|
||||||
|
}
|
||||||
|
|
||||||
bool fBuiltinFMASupport = false;
|
bool fBuiltinFMASupport = false;
|
||||||
bool builtinFMASupport() const {
|
bool builtinFMASupport() const {
|
||||||
return fBuiltinFMASupport;
|
return fBuiltinFMASupport;
|
||||||
|
Loading…
Reference in New Issue
Block a user