diff options
author | 2016-09-30 08:05:24 -0700 | |
---|---|---|
committer | 2016-09-30 08:05:24 -0700 | |
commit | d214d6ae69c1dd9ef49fdce8fac699d00bffcdcd (patch) | |
tree | 96deebd7874fe2960416042011a999455d4f82e2 /src/gpu/instanced/InstanceProcessor.cpp | |
parent | bc34404dc3feb4dac854aa43825646dd01139ccb (diff) |
Revert of Turned on SkSL->GLSL compiler (patchset #41 id:880001 of https://codereview.chromium.org/2288033003/ )
Reason for revert:
1) Chromium roll failures: https://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_rel_ng/builds/307297/steps/screenshot_sync_tests%20on%20NVIDIA%20GPU%20on%20Linux%20%28with%20patch%29%20on%20Linux/logs/stdio
2) G3 roll failures
3) iOS failures: https://uberchromegw.corp.google.com/i/client.skia/builders/Perf-iOS-Clang-iPad4-GPU-SGX554-Arm7-Release/builds/7177/steps/perf_skia%20on%20iOS-9.2/logs/stdio
Original issue's description:
> Turned on SkSL->GLSL compiler
> GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2288033003
>
> Committed: https://skia.googlesource.com/skia/+/9b0fe3d125f237d9884732a48414fa85fc71b4e3
> Committed: https://skia.googlesource.com/skia/+/b12b3c6908c62c908b3680be01e3b5bfd30de310
> Committed: https://skia.googlesource.com/skia/+/f008b0a59f45c0d4bea3e66faf3b01805009ec89
TBR=benjaminwagner@google.com,bsalomon@google.com,egdaniel@google.com,ethannicholas@google.com
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
Review-Url: https://codereview.chromium.org/2387643003
Diffstat (limited to 'src/gpu/instanced/InstanceProcessor.cpp')
-rw-r--r-- | src/gpu/instanced/InstanceProcessor.cpp | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/src/gpu/instanced/InstanceProcessor.cpp b/src/gpu/instanced/InstanceProcessor.cpp index 82116c4522..480155b683 100644 --- a/src/gpu/instanced/InstanceProcessor.cpp +++ b/src/gpu/instanced/InstanceProcessor.cpp @@ -107,10 +107,10 @@ public: void initParams(const SamplerHandle paramsBuffer) { fParamsBuffer = paramsBuffer; + fVertexBuilder->definef("PARAMS_IDX_MASK", "0x%xu", kParamsIdx_InfoMask); fVertexBuilder->appendPrecisionModifier(kHigh_GrSLPrecision); - fVertexBuilder->codeAppendf("int paramsIdx = int(%s & 0x%x);", - this->attr(Attrib::kInstanceInfo), - kParamsIdx_InfoMask); + fVertexBuilder->codeAppendf("int paramsIdx = int(%s & PARAMS_IDX_MASK);", + this->attr(Attrib::kInstanceInfo)); } const char* attr(Attrib attr) const { return fInstProc.getAttrib((int)attr).fName; } @@ -224,10 +224,10 @@ void GLSLInstanceProcessor::onEmitCode(EmitArgs& args, GrGPArgs* gpArgs) { v->codeAppendf("mat2x3 shapeMatrix = mat2x3(%s, %s);", inputs.attr(Attrib::kShapeMatrixX), inputs.attr(Attrib::kShapeMatrixY)); } else { - v->defineConstantf("int", "PERSPECTIVE_FLAG", "0x%x", kPerspective_InfoFlag); + v->definef("PERSPECTIVE_FLAG", "0x%xu", kPerspective_InfoFlag); v->codeAppendf("mat3 shapeMatrix = mat3(%s, %s, vec3(0, 0, 1));", inputs.attr(Attrib::kShapeMatrixX), inputs.attr(Attrib::kShapeMatrixY)); - v->codeAppendf("if (0 != (%s & PERSPECTIVE_FLAG)) {", + v->codeAppendf("if (0u != (%s & PERSPECTIVE_FLAG)) {", inputs.attr(Attrib::kInstanceInfo)); v->codeAppend ( "shapeMatrix[2] = "); inputs.fetchNextParam(kVec3f_GrSLType); @@ -237,7 +237,7 @@ void GLSLInstanceProcessor::onEmitCode(EmitArgs& args, GrGPArgs* gpArgs) { bool hasSingleShapeType = SkIsPow2(ip.batchInfo().fShapeTypes); if (!hasSingleShapeType) { - v->defineConstant("SHAPE_TYPE_BIT", kShapeType_InfoBit); + v->define("SHAPE_TYPE_BIT", kShapeType_InfoBit); v->codeAppendf("uint shapeType = %s >> SHAPE_TYPE_BIT;", inputs.attr(Attrib::kInstanceInfo)); } @@ -285,8 +285,8 @@ void GLSLInstanceProcessor::onEmitCode(EmitArgs& args, GrGPArgs* gpArgs) { if (ip.batchInfo().fInnerShapeTypes) { bool hasSingleInnerShapeType = SkIsPow2(ip.batchInfo().fInnerShapeTypes); if (!hasSingleInnerShapeType) { - v->defineConstantf("int", "INNER_SHAPE_TYPE_MASK", "0x%x", kInnerShapeType_InfoMask); - v->defineConstant("INNER_SHAPE_TYPE_BIT", kInnerShapeType_InfoBit); + v->definef("INNER_SHAPE_TYPE_MASK", "0x%xu", kInnerShapeType_InfoMask); + v->define("INNER_SHAPE_TYPE_BIT", kInnerShapeType_InfoBit); v->codeAppendf("uint innerShapeType = ((%s & INNER_SHAPE_TYPE_MASK) >> " "INNER_SHAPE_TYPE_BIT);", inputs.attr(Attrib::kInstanceInfo)); @@ -346,13 +346,13 @@ void GLSLInstanceProcessor::onEmitCode(EmitArgs& args, GrGPArgs* gpArgs) { } if (usedShapeDefinitions & kOval_ShapeFlag) { - v->defineConstant("OVAL_SHAPE_TYPE", (int)ShapeType::kOval); + v->definef("OVAL_SHAPE_TYPE", "%du", (int)ShapeType::kOval); } if (usedShapeDefinitions & kSimpleRRect_ShapeFlag) { - v->defineConstant("SIMPLE_R_RECT_SHAPE_TYPE", (int)ShapeType::kSimpleRRect); + v->definef("SIMPLE_R_RECT_SHAPE_TYPE", "%du", (int)ShapeType::kSimpleRRect); } if (usedShapeDefinitions & kNinePatch_ShapeFlag) { - v->defineConstant("NINE_PATCH_SHAPE_TYPE", (int)ShapeType::kNinePatch); + v->definef("NINE_PATCH_SHAPE_TYPE", "%du", (int)ShapeType::kNinePatch); } SkASSERT(!(usedShapeDefinitions & (kRect_ShapeFlag | kComplexRRect_ShapeFlag))); @@ -367,8 +367,8 @@ void GLSLInstanceProcessor::onEmitCode(EmitArgs& args, GrGPArgs* gpArgs) { inputs.attr(Attrib::kLocalRect), inputs.attr(Attrib::kLocalRect)); } if (ip.batchInfo().fHasLocalMatrix && ip.batchInfo().fHasParams) { - v->defineConstantf("int", "LOCAL_MATRIX_FLAG", "0x%x", kLocalMatrix_InfoFlag); - v->codeAppendf("if (0 != (%s & LOCAL_MATRIX_FLAG)) {", + v->definef("LOCAL_MATRIX_FLAG", "0x%xu", kLocalMatrix_InfoFlag); + v->codeAppendf("if (0u != (%s & LOCAL_MATRIX_FLAG)) {", inputs.attr(Attrib::kInstanceInfo)); if (!ip.batchInfo().fUsesLocalCoords) { inputs.skipParams(2); @@ -1179,7 +1179,7 @@ void GLSLInstanceProcessor::BackendMultisample::onInit(GrGLSLVaryingHandler* var } } if (kRect_ShapeFlag != fBatchInfo.fShapeTypes) { - v->defineConstantf("int", "SAMPLE_MASK_ALL", "0x%x", (1 << fEffectiveSampleCnt) - 1); + v->definef("SAMPLE_MASK_ALL", "0x%x", (1 << fEffectiveSampleCnt) - 1); varyingHandler->addFlatVarying("earlyAccept", &fEarlyAccept, kHigh_GrSLPrecision); } } @@ -1360,10 +1360,10 @@ void GLSLInstanceProcessor::BackendMultisample::onSetupInnerSimpleRRect(GrGLSLVe void GLSLInstanceProcessor::BackendMultisample::onEmitCode(GrGLSLVertexBuilder*, GrGLSLPPFragmentBuilder* f, const char*, const char*) { - f->defineConstant("SAMPLE_COUNT", fEffectiveSampleCnt); + f->define("SAMPLE_COUNT", fEffectiveSampleCnt); if (this->isMixedSampled()) { - f->defineConstantf("int", "SAMPLE_MASK_ALL", "0x%x", (1 << fEffectiveSampleCnt) - 1); - f->defineConstantf("int", "SAMPLE_MASK_MSB", "0x%x", 1 << (fEffectiveSampleCnt - 1)); + f->definef("SAMPLE_MASK_ALL", "0x%x", (1 << fEffectiveSampleCnt) - 1); + f->definef("SAMPLE_MASK_MSB", "0x%x", 1 << (fEffectiveSampleCnt - 1)); } if (kRect_ShapeFlag != (fBatchInfo.fShapeTypes | fBatchInfo.fInnerShapeTypes)) { |