aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/mtl/GrMtlCaps.mm
diff options
context:
space:
mode:
authorGravatar Brian Osman <brianosman@google.com>2017-11-16 14:02:11 +0000
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-11-16 14:02:23 +0000
commit24f9c19172e149602551cd6716b3cc264c1d40ef (patch)
tree48f622c34b80fa9d6595f1050b313033ec8e4104 /src/gpu/mtl/GrMtlCaps.mm
parent554c1f0508a95b5411036a95d1bb62c0d5fdeae8 (diff)
Revert "Fix precision caps and rrect/ellipse effect precisions"
This reverts commit e42180022720f2fcfd3c634cad855506a7940591. Reason for revert: Also may be responsible for layout test failures? Playing it safe. Original change's description: > Fix precision caps and rrect/ellipse effect precisions > > Replaces all the complex precision caps with a single flag that says > whether "float" == fp32. Updates the ellipse and rrect effects to > use float coords, and use the scale workaround when float != fp32. > > Bug: skia:7190 > Change-Id: Ieccff9f38acd05e5cec78fe90d01a5da901a9307 > Reviewed-on: https://skia-review.googlesource.com/70961 > Commit-Queue: Chris Dalton <csmartdalton@google.com> > Reviewed-by: Ethan Nicholas <ethannicholas@google.com> > Reviewed-by: Brian Salomon <bsalomon@google.com> TBR=egdaniel@google.com,bsalomon@google.com,csmartdalton@google.com,ethannicholas@google.com Change-Id: Idca2f0390e7a0eb85010255183f2f27332b8d26d No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia:7190 Reviewed-on: https://skia-review.googlesource.com/72540 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
Diffstat (limited to 'src/gpu/mtl/GrMtlCaps.mm')
-rw-r--r--src/gpu/mtl/GrMtlCaps.mm17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/gpu/mtl/GrMtlCaps.mm b/src/gpu/mtl/GrMtlCaps.mm
index 2354b85e64..d431f0a1e1 100644
--- a/src/gpu/mtl/GrMtlCaps.mm
+++ b/src/gpu/mtl/GrMtlCaps.mm
@@ -229,10 +229,21 @@ void GrMtlCaps::initShaderCaps() {
shaderCaps->fTexelFetchSupport = false;
shaderCaps->fVertexIDSupport = false;
shaderCaps->fImageLoadStoreSupport = false;
+ shaderCaps->fShaderPrecisionVaries = false; // ???
- // Metal uses IEEE float and half floats so assuming those values here.
- shaderCaps->fFloatIs32Bits = true;
- shaderCaps->fHalfIs32Bits = false;
+ // Metal uses IEEE float and half floats so using those values here.
+ for (int s = 0; s < kGrShaderTypeCount; ++s) {
+ auto& highp = shaderCaps->fFloatPrecisions[s][kHigh_GrSLPrecision];
+ highp.fLogRangeLow = highp.fLogRangeHigh = 127;
+ highp.fBits = 23;
+
+ auto& mediump = shaderCaps->fFloatPrecisions[s][kMedium_GrSLPrecision];
+ mediump.fLogRangeLow = mediump.fLogRangeHigh = 15;
+ mediump.fBits = 10;
+
+ shaderCaps->fFloatPrecisions[s][kLow_GrSLPrecision] = mediump;
+ }
+ shaderCaps->initSamplerPrecisionTable();
shaderCaps->fMaxVertexSamplers =
shaderCaps->fMaxFragmentSamplers = 16;