blob: c149201bd3d44079296f063cd72443ea06809675 [file] [log] [blame]
/*#pragma settings NoInline*/
/**************************************************************************************************
*** This file was autogenerated from GrFunctionArgTypes.fp; do not modify.
**************************************************************************************************/
#include "GrFunctionArgTypes.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 GrGLSLFunctionArgTypes : public GrGLSLFragmentProcessor {
public:
GrGLSLFunctionArgTypes() {}
void emitCode(EmitArgs& args) override {
GrGLSLFPFragmentBuilder* fragBuilder = args.fFragBuilder;
const GrFunctionArgTypes& _outer = args.fFp.cast<GrFunctionArgTypes>();
(void) _outer;
SkString takes_float_name = fragBuilder->getMangledFunctionName("takes_float");
const GrShaderVar takes_float_args[] = { GrShaderVar("f1", kFloat_GrSLType), GrShaderVar("f2", kFloat2_GrSLType), GrShaderVar("f3", kFloat3_GrSLType), GrShaderVar("f4", kFloat4_GrSLType) };
SkString takes_float_matrix_name = fragBuilder->getMangledFunctionName("takes_float_matrix");
const GrShaderVar takes_float_matrix_args[] = { GrShaderVar("m2", kFloat2x2_GrSLType), GrShaderVar("m3", kFloat3x3_GrSLType), GrShaderVar("m4", kFloat4x4_GrSLType) };
SkString takes_half_name = fragBuilder->getMangledFunctionName("takes_half");
const GrShaderVar takes_half_args[] = { GrShaderVar("h1", kHalf_GrSLType), GrShaderVar("h2", kHalf2_GrSLType), GrShaderVar("h3", kHalf3_GrSLType), GrShaderVar("h4", kHalf4_GrSLType) };
SkString takes_half_matrix_name = fragBuilder->getMangledFunctionName("takes_half_matrix");
const GrShaderVar takes_half_matrix_args[] = { GrShaderVar("m2", kHalf2x2_GrSLType), GrShaderVar("m3", kHalf3x3_GrSLType), GrShaderVar("m4", kHalf4x4_GrSLType) };
SkString takes_bool_name = fragBuilder->getMangledFunctionName("takes_bool");
const GrShaderVar takes_bool_args[] = { GrShaderVar("b", kBool_GrSLType), GrShaderVar("b2", kBool2_GrSLType), GrShaderVar("b3", kBool3_GrSLType), GrShaderVar("b4", kBool4_GrSLType) };
SkString takes_int_name = fragBuilder->getMangledFunctionName("takes_int");
const GrShaderVar takes_int_args[] = { GrShaderVar("i", kInt_GrSLType), GrShaderVar("i2", kInt2_GrSLType), GrShaderVar("i3", kInt3_GrSLType), GrShaderVar("i4", kInt4_GrSLType) };
fragBuilder->emitFunction(kBool_GrSLType, takes_float_name.c_str(), {takes_float_args, 4},
R"SkSL(return true;
)SkSL");
fragBuilder->emitFunction(kBool_GrSLType, takes_float_matrix_name.c_str(), {takes_float_matrix_args, 3},
R"SkSL(return true;
)SkSL");
fragBuilder->emitFunction(kBool_GrSLType, takes_half_name.c_str(), {takes_half_args, 4},
R"SkSL(return true;
)SkSL");
fragBuilder->emitFunction(kBool_GrSLType, takes_half_matrix_name.c_str(), {takes_half_matrix_args, 3},
R"SkSL(return true;
)SkSL");
fragBuilder->emitFunction(kBool_GrSLType, takes_bool_name.c_str(), {takes_bool_args, 4},
R"SkSL(return true;
)SkSL");
fragBuilder->emitFunction(kBool_GrSLType, takes_int_name.c_str(), {takes_int_args, 4},
R"SkSL(return true;
)SkSL");
fragBuilder->codeAppendf(
R"SkSL(return ((((%s(1.0, float2(2.0), float3(3.0), float4(4.0)) && %s(float2x2(2.0), float3x3(3.0), float4x4(4.0))) && %s(1.0, half2(2.0), half3(3.0), half4(4.0))) && %s(half2x2(2.0), half3x3(3.0), half4x4(4.0))) && %s(true, bool2(true), bool3(true), bool4(true))) && %s(1, int2(2), int3(3), int4(4)) ? half4(1.0) : half4(0.0);
)SkSL"
, takes_float_name.c_str(), takes_float_matrix_name.c_str(), takes_half_name.c_str(), takes_half_matrix_name.c_str(), takes_bool_name.c_str(), takes_int_name.c_str());
}
private:
void onSetData(const GrGLSLProgramDataManager& pdman, const GrFragmentProcessor& _proc) override {
}
};
std::unique_ptr<GrGLSLFragmentProcessor> GrFunctionArgTypes::onMakeProgramImpl() const {
return std::make_unique<GrGLSLFunctionArgTypes>();
}
void GrFunctionArgTypes::onGetGLSLProcessorKey(const GrShaderCaps& caps, GrProcessorKeyBuilder* b) const {
}
bool GrFunctionArgTypes::onIsEqual(const GrFragmentProcessor& other) const {
const GrFunctionArgTypes& that = other.cast<GrFunctionArgTypes>();
(void) that;
return true;
}
GrFunctionArgTypes::GrFunctionArgTypes(const GrFunctionArgTypes& src)
: INHERITED(kGrFunctionArgTypes_ClassID, src.optimizationFlags()) {
this->cloneAndRegisterAllChildProcessors(src);
}
std::unique_ptr<GrFragmentProcessor> GrFunctionArgTypes::clone() const {
return std::make_unique<GrFunctionArgTypes>(*this);
}
#if GR_TEST_UTILS
SkString GrFunctionArgTypes::onDumpInfo() const {
return SkString();
}
#endif