/************************************************************************************************** *** This file was autogenerated from GrDSLFPTest_Swizzle.fp; do not modify. **************************************************************************************************/ /* TODO(skia:11854): DSLCPPCodeGenerator is currently a work in progress. */ #include "GrDSLFPTest_Swizzle.h" #include "src/core/SkUtils.h" #include "src/gpu/GrTexture.h" #include "src/gpu/glsl/GrGLSLFragmentProcessor.h" #include "src/gpu/glsl/GrGLSLFragmentShaderBuilder.h" #include "src/gpu/glsl/GrGLSLProgramBuilder.h" #include "src/sksl/SkSLCPP.h" #include "src/sksl/SkSLUtil.h" #include "src/sksl/dsl/priv/DSLFPs.h" #include "src/sksl/dsl/priv/DSLWriter.h" class GrGLSLDSLFPTest_Swizzle : public GrGLSLFragmentProcessor { public: GrGLSLDSLFPTest_Swizzle() {} void emitCode(EmitArgs& args) override { [[maybe_unused]] const GrDSLFPTest_Swizzle& _outer = args.fFp.cast(); using namespace SkSL::dsl; StartFragmentProcessor(this, &args); Var _v(kNo_Modifier, DSLType(kHalf4_Type), "v", Half4(1.0f, 2.0f, 3.0f, 4.0f)); Var _b(kNo_Modifier, DSLType(kBool4_Type), "b", Bool4(true, true, true, true)); Declare(_v); _v = Half4(_v.x(), 1.0f, 1.0f, 1.0f); _v = Half4(Swizzle(_v, X, Y), 1.0f, 1.0f); _v = Half4(_v.x(), 1.0f, 1.0f, 1.0f); _v = Half4(0.0f, _v.y(), 1.0f, 1.0f); _v = Half4(Swizzle(_v, X, Y, Z), 1.0f); _v = Half4(Swizzle(_v, X, Y), 1.0f, 1.0f); _v = Half4(_v.x(), 0.0f, _v.z(), 1.0f); _v = Half4(_v.x(), 1.0f, 0.0f, 1.0f); _v = Half4(1.0f, Swizzle(_v, Y, Z), 1.0f); _v = Half4(0.0f, _v.y(), 1.0f, 1.0f); _v = Half4(1.0f, 1.0f, _v.z(), 1.0f); _v = Half4(Swizzle(_v, X, Y, Z), 1.0f); _v = Swizzle(_v, W, W, W, W); _v = Half4(Swizzle(_v, X, Y), 1.0f, 0.0f); _v = Swizzle(_v, X, Z, Z, X); _v = Half4(_v.x(), 0.0f, _v.z(), 1.0f); _v = Half4(_v.x(), 1.0f, 1.0f, _v.w()); _v = Half4(_v.x(), 1.0f, 0.0f, 1.0f); _v = Half4(1.0f, Swizzle(_v, Y, Z, W)); _v = Half4(0.0f, Swizzle(_v, Y, Z), 1.0f); _v = Half4(0.0f, _v.y(), 1.0f, _v.w()); _v = Half4(1.0f, _v.y(), 1.0f, 1.0f); _v = Half4(0.0f, 0.0f, Swizzle(_v, Z, W)); _v = Half4(0.0f, 0.0f, _v.z(), 1.0f); _v = Half4(0.0f, 1.0f, 1.0f, _v.w()); _v = Half4(0.0f, Swizzle(_v, Z, Y, X)); _v = Half4(0.0f, 0.0f, Swizzle(_v, X, W)); _v = Half4(1.0f, 1.0f, Swizzle(_v, W, X)); _v = Half4(Swizzle(_v, Z, Y), 1.0f, 1.0f); _v = Half4(Swizzle(_v, X, X), 1.0f, 1.0f); _v = Swizzle(_v, W, Z, W, Z); Declare(_b); _b = Bool4(_b.x(), true, true, true); _b = Bool4(Swizzle(_b, X, Y), false, true); _b = Bool4(_b.x(), true, true, false); _b = Bool4(false, _b.y(), true, true); _b = Bool4(Swizzle(_b, X, Y, Z), true); _b = Bool4(Swizzle(_b, X, Y), true, true); _b = Bool4(_b.x(), false, _b.z(), true); _b = Bool4(_b.x(), true, false, false); _b = Bool4(true, Swizzle(_b, Y, Z), false); _b = Bool4(false, _b.y(), true, false); _b = Bool4(true, true, _b.z(), false); _b = Bool4(Swizzle(_b, X, Y, Z), true); _b = Swizzle(_b, W, W, W, W); _b = Bool4(Swizzle(_b, X, Y), true, false); _b = Swizzle(_b, X, Z, Z, X); _b = Bool4(_b.x(), false, _b.z(), true); _b = Bool4(_b.x(), true, true, _b.w()); _b = Bool4(_b.x(), true, false, true); _b = Bool4(true, Swizzle(_b, Y, Z, W)); _b = Bool4(false, Swizzle(_b, Y, Z), true); _b = Bool4(false, _b.y(), true, _b.w()); _b = Bool4(true, _b.y(), true, true); _b = Bool4(false, false, Swizzle(_b, Z, W)); _b = Bool4(false, false, _b.z(), true); _b = Bool4(false, true, true, _b.w()); Return(Half4(Half2(Swizzle(_b, X, Y)), 0.0f, _v.z())); EndFragmentProcessor(); } private: void onSetData(const GrGLSLProgramDataManager& pdman, const GrFragmentProcessor& _proc) override { } }; std::unique_ptr GrDSLFPTest_Swizzle::onMakeProgramImpl() const { return std::make_unique(); } void GrDSLFPTest_Swizzle::onGetGLSLProcessorKey(const GrShaderCaps& caps, GrProcessorKeyBuilder* b) const { } bool GrDSLFPTest_Swizzle::onIsEqual(const GrFragmentProcessor& other) const { const GrDSLFPTest_Swizzle& that = other.cast(); (void) that; return true; } GrDSLFPTest_Swizzle::GrDSLFPTest_Swizzle(const GrDSLFPTest_Swizzle& src) : INHERITED(kGrDSLFPTest_Swizzle_ClassID, src.optimizationFlags()) { this->cloneAndRegisterAllChildProcessors(src); } std::unique_ptr GrDSLFPTest_Swizzle::clone() const { return std::make_unique(*this); } #if GR_TEST_UTILS SkString GrDSLFPTest_Swizzle::onDumpInfo() const { return SkString(); } #endif