skia2/tests/sksl/fp/golden/GrModuloOp.cpp
John Stiles 4691b0f82b Fix crash when compiling FP files containing the modulo operator.
Change-Id: Idfbe128978575ab84b54485bffe2d82570ee099f
Bug: skia:10870
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/330620
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2020-10-29 22:55:28 +00:00

56 lines
1.8 KiB
C++

/**************************************************************************************************
*** This file was autogenerated from GrModuloOp.fp; do not modify.
**************************************************************************************************/
#include "GrModuloOp.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"
class GrGLSLModuloOp : public GrGLSLFragmentProcessor {
public:
GrGLSLModuloOp() {}
void emitCode(EmitArgs& args) override {
GrGLSLFPFragmentBuilder* fragBuilder = args.fFragBuilder;
const GrModuloOp& _outer = args.fFp.cast<GrModuloOp>();
(void) _outer;
fragBuilder->codeAppendf(
R"SkSL(%s.x = half(1.0 %% sqrt(2.0));
)SkSL"
, args.fOutputColor);
}
private:
void onSetData(const GrGLSLProgramDataManager& pdman, const GrFragmentProcessor& _proc) override {
}
};
GrGLSLFragmentProcessor* GrModuloOp::onCreateGLSLInstance() const {
return new GrGLSLModuloOp();
}
void GrModuloOp::onGetGLSLProcessorKey(const GrShaderCaps& caps, GrProcessorKeyBuilder* b) const {
}
bool GrModuloOp::onIsEqual(const GrFragmentProcessor& other) const {
const GrModuloOp& that = other.cast<GrModuloOp>();
(void) that;
return true;
}
bool GrModuloOp::usesExplicitReturn() const {
return false;
}
GrModuloOp::GrModuloOp(const GrModuloOp& src)
: INHERITED(kGrModuloOp_ClassID, src.optimizationFlags()) {
this->cloneAndRegisterAllChildProcessors(src);
}
std::unique_ptr<GrFragmentProcessor> GrModuloOp::clone() const {
return std::make_unique<GrModuloOp>(*this);
}
#if GR_TEST_UTILS
SkString GrModuloOp::onDumpInfo() const {
return SkString();
}
#endif