Moved all HLSL-related code from ProgramBinary to DynamicHLSL.
DynamicHLSL encapsulates all HLSL generation we need outside the
the shader translator, such as for linking between input and output
stages and point sprite geometry shaders.
BUG=angle:560
Change-Id: Ib5079aa102000a7c37b166bcbe26b09cc82f8932
Reviewed-on: https://chromium-review.googlesource.com/185191
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
diff --git a/src/libGLESv2/ProgramBinary.h b/src/libGLESv2/ProgramBinary.h
index a374e09..54f9920 100644
--- a/src/libGLESv2/ProgramBinary.h
+++ b/src/libGLESv2/ProgramBinary.h
@@ -32,6 +32,7 @@
class Renderer;
struct TranslatedAttribute;
class UniformStorage;
+class DynamicHLSL;
}
namespace gl
@@ -144,8 +145,6 @@
void initAttributesByLayout();
void sortAttributesByLayout(rx::TranslatedAttribute attributes[gl::MAX_VERTEX_ATTRIBS], int sortedSemanticIndices[MAX_VERTEX_ATTRIBS]) const;
- static std::string decorateAttribute(const std::string &name); // Prepend an underscore
-
const UniformArray &getUniforms() const { return mUniforms; }
const rx::UniformStorage &getVertexUniformStorage() const { return *mVertexUniformStorage; }
const rx::UniformStorage &getFragmentUniformStorage() const { return *mFragmentUniformStorage; }
@@ -153,12 +152,7 @@
private:
DISALLOW_COPY_AND_ASSIGN(ProgramBinary);
- int packVaryings(InfoLog &infoLog, const sh::ShaderVariable *packing[][4], FragmentShader *fragmentShader);
- bool linkVaryings(InfoLog &infoLog, int registers, const sh::ShaderVariable *packing[][4],
- std::string& pixelHLSL, std::string& vertexHLSL,
- FragmentShader *fragmentShader, VertexShader *vertexShader);
- std::string generateVaryingHLSL(FragmentShader *fragmentShader, const std::string &varyingSemantic) const;
-
+ bool linkVaryings(InfoLog &infoLog, FragmentShader *fragmentShader, VertexShader *vertexShader);
bool linkAttributes(InfoLog &infoLog, const AttributeBindings &attributeBindings, FragmentShader *fragmentShader, VertexShader *vertexShader);
typedef sh::BlockMemberInfoArray::const_iterator BlockInfoItr;
@@ -180,9 +174,6 @@
void defineOutputVariables(FragmentShader *fragmentShader);
void initializeUniformStorage();
- std::string generateGeometryShaderHLSL(int registers, const sh::ShaderVariable *packing[][4], FragmentShader *fragmentShader, VertexShader *vertexShader) const;
- std::string generatePointSpriteHLSL(int registers, const sh::ShaderVariable *packing[][4], FragmentShader *fragmentShader, VertexShader *vertexShader) const;
-
template <typename T>
bool setUniform(GLint location, GLsizei count, const T* v, GLenum targetUniformType);
@@ -195,6 +186,7 @@
static TextureType getTextureType(GLenum samplerType, InfoLog &infoLog);
rx::Renderer *const mRenderer;
+ DynamicHLSL *mDynamicHLSL;
rx::ShaderExecutable *mPixelExecutable;
rx::ShaderExecutable *mVertexExecutable;
@@ -222,10 +214,8 @@
UniformArray mUniforms;
UniformBlockArray mUniformBlocks;
- typedef std::vector<VariableLocation> UniformIndex;
- UniformIndex mUniformIndex;
- typedef std::map<int, VariableLocation> ShaderVariableIndex;
- ShaderVariableIndex mOutputVariables;
+ std::vector<VariableLocation> mUniformIndex;
+ std::map<int, VariableLocation> mOutputVariables;
rx::UniformStorage *mVertexUniformStorage;
rx::UniformStorage *mFragmentUniformStorage;
@@ -236,6 +226,7 @@
static unsigned int issueSerial();
static unsigned int mCurrentSerial;
};
+
}
#endif // LIBGLESV2_PROGRAM_BINARY_H_