Check for SkSL ES3 capabilities in GrShaderCaps.
This lets us set the minimum bar for SkSL ES3 support in one place, rather than checking this set of bits in multiple spots. Change-Id: Icba58d8b6a93626ce2ffbe3c4b846cad4749cab5 Bug: skia:12347 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/440518 Commit-Queue: John Stiles <johnstiles@google.com> Auto-Submit: John Stiles <johnstiles@google.com> Reviewed-by: Brian Osman <brianosman@google.com>
This commit is contained in:
parent
3cb09c0904
commit
0733d48428
@ -197,12 +197,8 @@ DEF_SIMPLE_GPU_GM_CAN_FAIL(runtime_intrinsics_trig_es3,
|
||||
ctx, canvas, errorMsg,
|
||||
columns_to_width(3),
|
||||
rows_to_height(2)) {
|
||||
// We don't have an ES2 caps bit, so we check the caps bits for features that ES2 explicitly
|
||||
// doesn't support. Our ES2 bots should return false for these.
|
||||
if (!ctx->priv().caps()->shaderCaps()->shaderDerivativeSupport() ||
|
||||
!ctx->priv().caps()->shaderCaps()->integerSupport() ||
|
||||
!ctx->priv().caps()->shaderCaps()->nonsquareMatrixSupport()) {
|
||||
*errorMsg = "ES3 features are required.";
|
||||
if (!ctx->priv().caps()->shaderCaps()->supportsSkSLES3()) {
|
||||
*errorMsg = "SkSL ES3 is not supported.";
|
||||
return skiagm::DrawResult::kSkip;
|
||||
}
|
||||
|
||||
|
@ -97,6 +97,13 @@ public:
|
||||
// reduce the number of unique shaders generated.
|
||||
bool reducedShaderMode() const { return fReducedShaderMode; }
|
||||
|
||||
/**
|
||||
* SkSL ES3 requires support for derivatives, nonsquare matrices and bitwise integer operations.
|
||||
*/
|
||||
bool supportsSkSLES3() const {
|
||||
return fShaderDerivativeSupport && fNonsquareMatrixSupport && fIntegerSupport;
|
||||
}
|
||||
|
||||
// SkSL only.
|
||||
bool builtinFMASupport() const { return fBuiltinFMASupport; }
|
||||
|
||||
|
@ -123,11 +123,7 @@ static void test_gpu(skiatest::Reporter* r, GrDirectContext* ctx, const char* te
|
||||
}
|
||||
|
||||
static void test_es3(skiatest::Reporter* r, GrDirectContext* ctx, const char* testFile) {
|
||||
// We don't have an ES2 caps bit, so we check the caps bits for features that ES2 explicitly
|
||||
// doesn't support. Our ES2 bots should return false for these.
|
||||
if (!ctx->priv().caps()->shaderCaps()->shaderDerivativeSupport() ||
|
||||
!ctx->priv().caps()->shaderCaps()->integerSupport() ||
|
||||
!ctx->priv().caps()->shaderCaps()->nonsquareMatrixSupport()) {
|
||||
if (!ctx->priv().caps()->shaderCaps()->supportsSkSLES3()) {
|
||||
return;
|
||||
}
|
||||
// ES3-only tests never run on the CPU, because SkVM lacks support for many non-ES2 features.
|
||||
|
Loading…
Reference in New Issue
Block a user