Introduction of set of functions to manage generation of texture fetch shader code.
A new set of routines have been added to GrGLShaderBuilder to emit texture fetches, taking into consideration the format of the texture to be accessed, and the channel swizzle.
Review URL: https://codereview.appspot.com/6446072
git-svn-id: http://skia.googlecode.com/svn/trunk@4919 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/gpu/gl/GrGpuGL_program.cpp b/src/gpu/gl/GrGpuGL_program.cpp
index 6d6d916..c959f66 100644
--- a/src/gpu/gl/GrGpuGL_program.cpp
+++ b/src/gpu/gl/GrGpuGL_program.cpp
@@ -596,12 +596,13 @@
void setup_custom_stage(GrGLProgram::Desc::StageDesc* stage,
const GrSamplerState& sampler,
+ const GrGLCaps& caps,
const GrCustomStage** customStages,
GrGLProgram* program, int index) {
const GrCustomStage* customStage = sampler.getCustomStage();
if (customStage) {
const GrProgramStageFactory& factory = customStage->getFactory();
- stage->fCustomStageKey = factory.glStageKey(*customStage);
+ stage->fCustomStageKey = factory.glStageKey(*customStage, caps);
customStages[index] = customStage;
} else {
stage->fCustomStageKey = 0;
@@ -746,7 +747,8 @@
}
}
- setup_custom_stage(&stage, sampler, customStages, fCurrentProgram.get(), s);
+ setup_custom_stage(&stage, sampler, this->glCaps(), customStages,
+ fCurrentProgram.get(), s);
} else {
stage.fOptFlags = 0;