69 lines
2.8 KiB
C++
69 lines
2.8 KiB
C++
|
|
||
|
|
||
|
/**************************************************************************************************
|
||
|
*** This file was autogenerated from GrDSLFPTest_ForStatement.fp; do not modify.
|
||
|
**************************************************************************************************/
|
||
|
/* TODO(skia:11854): DSLCPPCodeGenerator is currently a work in progress. */
|
||
|
#include "GrDSLFPTest_ForStatement.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"
|
||
|
|
||
|
#if defined(__clang__)
|
||
|
#pragma clang diagnostic ignored "-Wcomma"
|
||
|
#endif
|
||
|
|
||
|
class GrGLSLDSLFPTest_ForStatement : public GrGLSLFragmentProcessor {
|
||
|
public:
|
||
|
GrGLSLDSLFPTest_ForStatement() {}
|
||
|
void emitCode(EmitArgs& args) override {
|
||
|
const GrDSLFPTest_ForStatement& _outer = args.fFp.cast<GrDSLFPTest_ForStatement>();
|
||
|
(void) _outer;
|
||
|
|
||
|
using namespace SkSL::dsl;
|
||
|
StartFragmentProcessor(this, &args);
|
||
|
Var color(kNo_Modifier, DSLType(kHalf4_Type), "color", Half4(1.0));
|
||
|
Var a(kNo_Modifier, DSLType(kHalf_Type), "a", 0.0);
|
||
|
Var r(kNo_Modifier, DSLType(kHalf_Type), "r", -5.0);
|
||
|
Var b(kNo_Modifier, DSLType(kHalf_Type), "b", 5.0);
|
||
|
Declare(color);
|
||
|
For(Declare(a), a <= 1.0, ++a, /*Body:*/ color.w() = a);
|
||
|
For(Declare(r), r < 5.0, r += 1.0, /*Body:*/ Block(color.x() = r, If(color.x() == 0.0, /*Then:*/ Break())));
|
||
|
For(Declare(b), b >= 0.0, b -= 1.0, /*Body:*/ Block(color.z() = b, If(color.w() == 1.0, /*Then:*/ Continue()), color.y() = 0.0));
|
||
|
Return(color);
|
||
|
EndFragmentProcessor();
|
||
|
}
|
||
|
private:
|
||
|
void onSetData(const GrGLSLProgramDataManager& pdman, const GrFragmentProcessor& _proc) override {
|
||
|
}
|
||
|
};
|
||
|
std::unique_ptr<GrGLSLFragmentProcessor> GrDSLFPTest_ForStatement::onMakeProgramImpl() const {
|
||
|
return std::make_unique<GrGLSLDSLFPTest_ForStatement>();
|
||
|
}
|
||
|
void GrDSLFPTest_ForStatement::onGetGLSLProcessorKey(const GrShaderCaps& caps, GrProcessorKeyBuilder* b) const {
|
||
|
}
|
||
|
bool GrDSLFPTest_ForStatement::onIsEqual(const GrFragmentProcessor& other) const {
|
||
|
const GrDSLFPTest_ForStatement& that = other.cast<GrDSLFPTest_ForStatement>();
|
||
|
(void) that;
|
||
|
return true;
|
||
|
}
|
||
|
GrDSLFPTest_ForStatement::GrDSLFPTest_ForStatement(const GrDSLFPTest_ForStatement& src)
|
||
|
: INHERITED(kGrDSLFPTest_ForStatement_ClassID, src.optimizationFlags()) {
|
||
|
this->cloneAndRegisterAllChildProcessors(src);
|
||
|
}
|
||
|
std::unique_ptr<GrFragmentProcessor> GrDSLFPTest_ForStatement::clone() const {
|
||
|
return std::make_unique<GrDSLFPTest_ForStatement>(*this);
|
||
|
}
|
||
|
#if GR_TEST_UTILS
|
||
|
SkString GrDSLFPTest_ForStatement::onDumpInfo() const {
|
||
|
return SkString();
|
||
|
}
|
||
|
#endif
|