2020-09-23 15:46:29 +00:00
|
|
|
|
|
|
|
|
|
|
|
/**************************************************************************************************
|
|
|
|
*** This file was autogenerated from GrChildProcessorSampleMatrixMultipleUniforms.fp; do not modify.
|
|
|
|
**************************************************************************************************/
|
|
|
|
#include "GrChildProcessorSampleMatrixMultipleUniforms.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 GrGLSLChildProcessorSampleMatrixMultipleUniforms : public GrGLSLFragmentProcessor {
|
|
|
|
public:
|
|
|
|
GrGLSLChildProcessorSampleMatrixMultipleUniforms() {}
|
|
|
|
void emitCode(EmitArgs& args) override {
|
|
|
|
GrGLSLFPFragmentBuilder* fragBuilder = args.fFragBuilder;
|
|
|
|
const GrChildProcessorSampleMatrixMultipleUniforms& _outer = args.fFp.cast<GrChildProcessorSampleMatrixMultipleUniforms>();
|
|
|
|
(void) _outer;
|
|
|
|
auto matrixA = _outer.matrixA;
|
|
|
|
(void) matrixA;
|
|
|
|
auto matrixB = _outer.matrixB;
|
|
|
|
(void) matrixB;
|
|
|
|
matrixAVar = args.fUniformHandler->addUniform(&_outer, kFragment_GrShaderFlag, kFloat3x3_GrSLType, "matrixA");
|
|
|
|
matrixBVar = args.fUniformHandler->addUniform(&_outer, kFragment_GrShaderFlag, kFloat3x3_GrSLType, "matrixB");
|
2020-11-03 19:07:38 +00:00
|
|
|
SkString _matrix0(args.fUniformHandler->getUniformCStr(matrixAVar));
|
|
|
|
SkString _sample0 = this->invokeChildWithMatrix(0, args, _matrix0.c_str());
|
|
|
|
SkString _matrix1(args.fUniformHandler->getUniformCStr(matrixBVar));
|
|
|
|
SkString _sample1 = this->invokeChildWithMatrix(0, args, _matrix1.c_str());
|
2020-09-23 15:46:29 +00:00
|
|
|
fragBuilder->codeAppendf(
|
2020-12-15 14:44:51 +00:00
|
|
|
R"SkSL(return %s + %s;
|
2020-09-23 15:46:29 +00:00
|
|
|
)SkSL"
|
2020-12-15 14:44:51 +00:00
|
|
|
, _sample0.c_str(), _sample1.c_str());
|
2020-09-23 15:46:29 +00:00
|
|
|
}
|
|
|
|
private:
|
|
|
|
void onSetData(const GrGLSLProgramDataManager& pdman, const GrFragmentProcessor& _proc) override {
|
|
|
|
const GrChildProcessorSampleMatrixMultipleUniforms& _outer = _proc.cast<GrChildProcessorSampleMatrixMultipleUniforms>();
|
|
|
|
{
|
|
|
|
static_assert(1 == 1); pdman.setSkMatrix(matrixAVar, (_outer.matrixA));
|
|
|
|
static_assert(1 == 1); pdman.setSkMatrix(matrixBVar, (_outer.matrixB));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
UniformHandle matrixAVar;
|
|
|
|
UniformHandle matrixBVar;
|
|
|
|
};
|
2021-02-23 15:07:05 +00:00
|
|
|
std::unique_ptr<GrGLSLFragmentProcessor> GrChildProcessorSampleMatrixMultipleUniforms::onMakeProgramImpl() const {
|
|
|
|
return std::make_unique<GrGLSLChildProcessorSampleMatrixMultipleUniforms>();
|
2020-09-23 15:46:29 +00:00
|
|
|
}
|
|
|
|
void GrChildProcessorSampleMatrixMultipleUniforms::onGetGLSLProcessorKey(const GrShaderCaps& caps, GrProcessorKeyBuilder* b) const {
|
|
|
|
}
|
|
|
|
bool GrChildProcessorSampleMatrixMultipleUniforms::onIsEqual(const GrFragmentProcessor& other) const {
|
|
|
|
const GrChildProcessorSampleMatrixMultipleUniforms& that = other.cast<GrChildProcessorSampleMatrixMultipleUniforms>();
|
|
|
|
(void) that;
|
|
|
|
if (matrixA != that.matrixA) return false;
|
|
|
|
if (matrixB != that.matrixB) return false;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
GrChildProcessorSampleMatrixMultipleUniforms::GrChildProcessorSampleMatrixMultipleUniforms(const GrChildProcessorSampleMatrixMultipleUniforms& src)
|
|
|
|
: INHERITED(kGrChildProcessorSampleMatrixMultipleUniforms_ClassID, src.optimizationFlags())
|
|
|
|
, matrixA(src.matrixA)
|
|
|
|
, matrixB(src.matrixB) {
|
|
|
|
this->cloneAndRegisterAllChildProcessors(src);
|
|
|
|
}
|
|
|
|
std::unique_ptr<GrFragmentProcessor> GrChildProcessorSampleMatrixMultipleUniforms::clone() const {
|
|
|
|
return std::make_unique<GrChildProcessorSampleMatrixMultipleUniforms>(*this);
|
|
|
|
}
|
|
|
|
#if GR_TEST_UTILS
|
|
|
|
SkString GrChildProcessorSampleMatrixMultipleUniforms::onDumpInfo() const {
|
|
|
|
return SkStringPrintf("(matrixA=float3x3(%f, %f, %f, %f, %f, %f, %f, %f, %f), matrixB=float3x3(%f, %f, %f, %f, %f, %f, %f, %f, %f))", matrixA.rc(0, 0), matrixA.rc(1, 0), matrixA.rc(2, 0), matrixA.rc(0, 1), matrixA.rc(1, 1), matrixA.rc(2, 1), matrixA.rc(0, 2), matrixA.rc(1, 2), matrixA.rc(2, 2), matrixB.rc(0, 0), matrixB.rc(1, 0), matrixB.rc(2, 0), matrixB.rc(0, 1), matrixB.rc(1, 1), matrixB.rc(2, 1), matrixB.rc(0, 2), matrixB.rc(1, 2), matrixB.rc(2, 2));
|
|
|
|
}
|
|
|
|
#endif
|