From 662ea4baba570d2f21a7b33d268204e9bdfa7fb9 Mon Sep 17 00:00:00 2001 From: Brian Salomon Date: Thu, 12 Jul 2018 14:53:49 -0400 Subject: Remove texel buffer support. Change-Id: Ia6f21afe714208979a5bc384e436b28ea2b9a297 Reviewed-on: https://skia-review.googlesource.com/141051 Reviewed-by: Robert Phillips Commit-Queue: Brian Salomon --- src/gpu/gl/GrGLProgram.cpp | 28 ++++++++-------------------- 1 file changed, 8 insertions(+), 20 deletions(-) (limited to 'src/gpu/gl/GrGLProgram.cpp') 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 geometryProcessor, std::unique_ptr 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(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(sampler.peekTexture())); } - for (int i = 0; i < processor.numBuffers(); ++i) { - const GrResourceIOProcessor::BufferAccess& access = processor.bufferAccess(i); - fGpu->bindTexelBuffer((*nextTexelBufferIdx)++, access.texelConfig(), - static_cast(access.buffer())); - } } void GrGLProgram::generateMipmaps(const GrResourceIOProcessor& processor) { -- cgit v1.2.3