The point of this change is to tunnel GrTextureAccess from GrCustomStage to GrGLProgramStage. Right now ...
12 years, 2 months ago
(2012-09-06 19:03:46 UTC)
#1
The point of this change is to tunnel GrTextureAccess from GrCustomStage to
GrGLProgramStage. Right now color table effect is the only effect type using
GrTextureAccess. It makes its (long-lived) GrGLProgramStage keep a reference to
a (short-lived) GrCustomStage in order to get at the GrTextureAccess owned by
the GrCustomStage. This is dangerous since the GrGLProgramStage can outlive the
GrCustomStage. Also it is a bit confusing since via the program cache
GrGLProgramStages are reused with multiple GrCustomStages (that have the same
stage key).
The rest of the stage subclass changes are simple and are due to virtual
emitFS() now taking a TextureSampler rather than a char* samplerName.
The follow up CL will determine a default GrTextureAccess in GenStageCode for
stages that don't currently provide them, eliminate GrGLShaderBuilder::fSwizzle,
and consolidate the custom/non-custom texture lookup functions in
GrGLShaderBuilder. Then a yet later change will make the stage subclasses
provide their own GrTextureAccesses.
https://codereview.appspot.com/6495099/diff/1/src/gpu/gl/GrGLProgram.h
File src/gpu/gl/GrGLProgram.h (right):
https://codereview.appspot.com/6495099/diff/1/src/gpu/gl/GrGLProgram.h#newcod...
src/gpu/gl/GrGLProgram.h:214: static GrGLProgramStage* GenStageCode(const
GrCustomStage* stage,
Soon StageDesc will not exist. It only has InConfigFlags which I plan to remove
ASAP and some flags about the texture matrix. The flags will go away when stages
are responsible for managing their own tex coords / matrices.
I think this function really belongs on the GrGLShaderBuilder.
https://codereview.appspot.com/6495099/diff/1/src/gpu/gl/GrGLProgramStage.h
File src/gpu/gl/GrGLProgramStage.h (left):
https://codereview.appspot.com/6495099/diff/1/src/gpu/gl/GrGLProgramStage.h#o...
src/gpu/gl/GrGLProgramStage.h:28: TODO: lifetime management.
I removed this comment because I think what we're doing today is fine. We don't
ref count these because only GrGLProgram ever owns them and it just deletes them
in its ~.
https://codereview.appspot.com/6495099/diff/1/src/gpu/gl/GrGLShaderBuilder.h
File src/gpu/gl/GrGLShaderBuilder.h (right):
https://codereview.appspot.com/6495099/diff/1/src/gpu/gl/GrGLShaderBuilder.h#...
src/gpu/gl/GrGLShaderBuilder.h:65: // TODO: Remove once GrTextureAccess is
required.
Will happen in next CL.
Issue 6495099: Introduce GrGLShaderBuilder::TextureSampler
(Closed)
Created 12 years, 2 months ago by bsalomon
Modified 12 years, 2 months ago
Reviewers: robertphillips, TomH
Base URL: http://skia.googlecode.com/svn/trunk/
Comments: 9