aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/gl/GrGLProgram.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gpu/gl/GrGLProgram.cpp')
-rw-r--r--src/gpu/gl/GrGLProgram.cpp28
1 files changed, 8 insertions, 20 deletions
diff --git a/src/gpu/gl/GrGLProgram.cpp b/src/gpu/gl/GrGLProgram.cpp
index 2a876d0851..52d53bde95 100644
--- a/src/gpu/gl/GrGLProgram.cpp
+++ b/src/gpu/gl/GrGLProgram.cpp
@@ -31,7 +31,6 @@ GrGLProgram::GrGLProgram(
GrGLuint programID,
const UniformInfoArray& uniforms,
const UniformInfoArray& textureSamplers,
- const UniformInfoArray& texelBuffers,
const VaryingInfoArray& pathProcVaryings,
std::unique_ptr<GrGLSLPrimitiveProcessor> geometryProcessor,
std::unique_ptr<GrGLSLXferProcessor> xferProcessor,
@@ -55,12 +54,10 @@ GrGLProgram::GrGLProgram(
, fInstanceStride(instanceStride)
, fGpu(gpu)
, fProgramDataManager(gpu, programID, uniforms, pathProcVaryings)
- , fNumTextureSamplers(textureSamplers.count())
- , fNumTexelBuffers(texelBuffers.count()) {
+ , fNumTextureSamplers(textureSamplers.count()) {
// Assign texture units to sampler uniforms one time up front.
GL_CALL(UseProgram(fProgramID));
fProgramDataManager.setSamplerUniforms(textureSamplers, 0);
- fProgramDataManager.setSamplerUniforms(texelBuffers, fNumTextureSamplers);
}
GrGLProgram::~GrGLProgram() {
@@ -82,15 +79,14 @@ void GrGLProgram::setData(const GrPrimitiveProcessor& primProc, const GrPipeline
// of GLProgram determine how to set coord transforms
// We must bind to texture units in the same order in which we set the uniforms in
- // GrGLProgramDataManager. That is first all texture samplers and then texel buffers.
- // Within each group we will bind them in primProc, fragProcs, XP order.
+ // GrGLProgramDataManager. That is, we bind textures for processors in this order:
+ // primProc, fragProcs, XP.
int nextTexSamplerIdx = 0;
- int nextTexelBufferIdx = fNumTextureSamplers;
fPrimitiveProcessor->setData(fProgramDataManager, primProc,
GrFragmentProcessor::CoordTransformIter(pipeline));
- this->bindTextures(primProc, &nextTexSamplerIdx, &nextTexelBufferIdx);
+ this->bindTextures(primProc, &nextTexSamplerIdx);
- this->setFragmentData(primProc, pipeline, &nextTexSamplerIdx, &nextTexelBufferIdx);
+ this->setFragmentData(primProc, pipeline, &nextTexSamplerIdx);
const GrXferProcessor& xp = pipeline.getXferProcessor();
SkIPoint offset;
@@ -102,7 +98,6 @@ void GrGLProgram::setData(const GrPrimitiveProcessor& primProc, const GrPipeline
static_cast<GrGLTexture*>(dstTexture));
}
SkASSERT(nextTexSamplerIdx == fNumTextureSamplers);
- SkASSERT(nextTexelBufferIdx == fNumTextureSamplers + fNumTexelBuffers);
}
void GrGLProgram::generateMipmaps(const GrPrimitiveProcessor& primProc,
@@ -117,15 +112,14 @@ void GrGLProgram::generateMipmaps(const GrPrimitiveProcessor& primProc,
void GrGLProgram::setFragmentData(const GrPrimitiveProcessor& primProc,
const GrPipeline& pipeline,
- int* nextTexSamplerIdx,
- int* nextTexelBufferIdx) {
+ int* nextTexSamplerIdx) {
GrFragmentProcessor::Iter iter(pipeline);
GrGLSLFragmentProcessor::Iter glslIter(fFragmentProcessors.get(), fFragmentProcessorCnt);
const GrFragmentProcessor* fp = iter.next();
GrGLSLFragmentProcessor* glslFP = glslIter.next();
while (fp && glslFP) {
glslFP->setData(fProgramDataManager, *fp);
- this->bindTextures(*fp, nextTexSamplerIdx, nextTexelBufferIdx);
+ this->bindTextures(*fp, nextTexSamplerIdx);
fp = iter.next();
glslFP = glslIter.next();
}
@@ -164,18 +158,12 @@ void GrGLProgram::setRenderTargetState(const GrPrimitiveProcessor& primProc,
}
void GrGLProgram::bindTextures(const GrResourceIOProcessor& processor,
- int* nextTexSamplerIdx,
- int* nextTexelBufferIdx) {
+ int* nextTexSamplerIdx) {
for (int i = 0; i < processor.numTextureSamplers(); ++i) {
const GrResourceIOProcessor::TextureSampler& sampler = processor.textureSampler(i);
fGpu->bindTexture((*nextTexSamplerIdx)++, sampler.samplerState(),
static_cast<GrGLTexture*>(sampler.peekTexture()));
}
- for (int i = 0; i < processor.numBuffers(); ++i) {
- const GrResourceIOProcessor::BufferAccess& access = processor.bufferAccess(i);
- fGpu->bindTexelBuffer((*nextTexelBufferIdx)++, access.texelConfig(),
- static_cast<GrGLBuffer*>(access.buffer()));
- }
}
void GrGLProgram::generateMipmaps(const GrResourceIOProcessor& processor) {