| 101 | } |
| 102 | |
| 103 | std::string ProgramBuilder::emitAndInstallFragProc(const FragmentProcessor* processor, |
| 104 | size_t transformedCoordVarsIdx, |
| 105 | const std::string& input) { |
| 106 | ProcessorGuard processorGuard(this, processor); |
| 107 | std::string output; |
| 108 | nameExpression(&output, "output"); |
| 109 | |
| 110 | // Enclose custom code in a block to avoid namespace conflicts |
| 111 | fragmentShaderBuilder()->codeAppendf("{ // Processor%d : %s\n", |
| 112 | programInfo->getProcessorIndex(processor), |
| 113 | processor->name().c_str()); |
| 114 | |
| 115 | std::vector<SamplerHandle> texSamplers; |
| 116 | FragmentProcessor::Iter fpIter(processor); |
| 117 | int samplerIndex = 0; |
| 118 | while (const auto subFP = fpIter.next()) { |
| 119 | for (size_t i = 0; i < subFP->numTextureSamplers(); ++i) { |
| 120 | std::string name = "TextureSampler_"; |
| 121 | name += std::to_string(samplerIndex++); |
| 122 | auto texture = subFP->textureAt(i); |
| 123 | texSamplers.emplace_back(emitSampler(texture, name)); |
| 124 | } |
| 125 | } |
| 126 | FragmentProcessor::TransformedCoordVars coords( |
| 127 | processor, GetPointer(transformedCoordVars, transformedCoordVarsIdx)); |
| 128 | FragmentProcessor::TextureSamplers textureSamplers(processor, GetPointer(texSamplers, 0)); |
| 129 | FragmentProcessor::EmitArgs args(fragmentShaderBuilder(), uniformHandler(), output, input, |
| 130 | subsetVarName, &coords, &textureSamplers); |
| 131 | |
| 132 | processor->emitCode(args); |
| 133 | fragmentShaderBuilder()->codeAppend("}"); |
| 134 | return output; |
| 135 | } |
| 136 | |
| 137 | void ProgramBuilder::emitAndInstallXferProc(const std::string& colorIn, |
| 138 | const std::string& coverageIn) { |
nothing calls this directly
no test coverage detected