skia2/tests/sksl/dslfp/GrDSLFPTest_WhileStatement.dsl.cpp
John Stiles 119ad7329d Remove superfluous lines from DSL generated code.
The comma-warning issue has since been fixed, and we don't need to
use `(void) var;` when we have C++17's [[maybe_unused]] attribute.

Change-Id: I2078354f06801b024638e9c7d9ac699df20a8c48
Bug: skia:11854
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/401116
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2021-04-26 16:40:48 +00:00

61 lines
2.6 KiB
C++

/**************************************************************************************************
*** This file was autogenerated from GrDSLFPTest_WhileStatement.fp; do not modify.
**************************************************************************************************/
/* TODO(skia:11854): DSLCPPCodeGenerator is currently a work in progress. */
#include "GrDSLFPTest_WhileStatement.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_WhileStatement : public GrGLSLFragmentProcessor {
public:
GrGLSLDSLFPTest_WhileStatement() {}
void emitCode(EmitArgs& args) override {
[[maybe_unused]] const GrDSLFPTest_WhileStatement& _outer = args.fFp.cast<GrDSLFPTest_WhileStatement>();
using namespace SkSL::dsl;
StartFragmentProcessor(this, &args);
Var _color(kNo_Modifier, DSLType(kHalf4_Type), "color", Half4(1.0f));
Declare(_color);
While(_color.x() > 0.5f, _color.x() -= 0.25f);
While(_color.w() == 1.0f, Block(_color.x() -= 0.25f, If(_color.x() <= 0.0f, /*Then:*/ Break())));
While(_color.z() > 0.0f, Block(_color.z() -= 0.25f, If(_color.w() == 1.0f, /*Then:*/ Continue()), _color.y() = 0.0f));
Return(_color);
EndFragmentProcessor();
}
private:
void onSetData(const GrGLSLProgramDataManager& pdman, const GrFragmentProcessor& _proc) override {
}
};
std::unique_ptr<GrGLSLFragmentProcessor> GrDSLFPTest_WhileStatement::onMakeProgramImpl() const {
return std::make_unique<GrGLSLDSLFPTest_WhileStatement>();
}
void GrDSLFPTest_WhileStatement::onGetGLSLProcessorKey(const GrShaderCaps& caps, GrProcessorKeyBuilder* b) const {
}
bool GrDSLFPTest_WhileStatement::onIsEqual(const GrFragmentProcessor& other) const {
const GrDSLFPTest_WhileStatement& that = other.cast<GrDSLFPTest_WhileStatement>();
(void) that;
return true;
}
GrDSLFPTest_WhileStatement::GrDSLFPTest_WhileStatement(const GrDSLFPTest_WhileStatement& src)
: INHERITED(kGrDSLFPTest_WhileStatement_ClassID, src.optimizationFlags()) {
this->cloneAndRegisterAllChildProcessors(src);
}
std::unique_ptr<GrFragmentProcessor> GrDSLFPTest_WhileStatement::clone() const {
return std::make_unique<GrDSLFPTest_WhileStatement>(*this);
}
#if GR_TEST_UTILS
SkString GrDSLFPTest_WhileStatement::onDumpInfo() const {
return SkString();
}
#endif