Brandon Jones | c9610c5 | 2014-08-25 17:02:59 -0700 | [diff] [blame] | 1 | // |
| 2 | // Copyright (c) 2014 The ANGLE Project Authors. All rights reserved. |
| 3 | // Use of this source code is governed by a BSD-style license that can be |
| 4 | // found in the LICENSE file. |
| 5 | // |
| 6 | |
| 7 | // ProgramD3D.h: Defines the rx::ProgramD3D class which implements rx::ProgramImpl. |
| 8 | |
Geoff Lang | 0a73dd8 | 2014-11-19 16:18:08 -0500 | [diff] [blame] | 9 | #ifndef LIBANGLE_RENDERER_D3D_PROGRAMD3D_H_ |
| 10 | #define LIBANGLE_RENDERER_D3D_PROGRAMD3D_H_ |
Brandon Jones | c9610c5 | 2014-08-25 17:02:59 -0700 | [diff] [blame] | 11 | |
Jamie Madill | d3dfda2 | 2015-07-06 08:28:49 -0400 | [diff] [blame] | 12 | #include <string> |
| 13 | #include <vector> |
| 14 | |
Jamie Madill | 1377689 | 2015-04-28 12:39:06 -0400 | [diff] [blame] | 15 | #include "common/Optional.h" |
Daniel Bratell | 73941de | 2015-02-25 14:34:49 +0100 | [diff] [blame] | 16 | #include "compiler/translator/blocklayoutHLSL.h" |
Jamie Madill | 437d266 | 2014-12-05 14:23:35 -0500 | [diff] [blame] | 17 | #include "libANGLE/Constants.h" |
Jamie Madill | d3dfda2 | 2015-07-06 08:28:49 -0400 | [diff] [blame] | 18 | #include "libANGLE/formatutils.h" |
Geoff Lang | 2b5420c | 2014-11-19 14:20:15 -0500 | [diff] [blame] | 19 | #include "libANGLE/renderer/ProgramImpl.h" |
Geoff Lang | 7dd2e10 | 2014-11-10 15:19:26 -0500 | [diff] [blame] | 20 | #include "libANGLE/renderer/d3d/DynamicHLSL.h" |
Geoff Lang | 6941a55 | 2015-07-27 11:06:45 -0400 | [diff] [blame^] | 21 | #include "libANGLE/renderer/d3d/WorkaroundsD3D.h" |
Brandon Jones | c9610c5 | 2014-08-25 17:02:59 -0700 | [diff] [blame] | 22 | |
| 23 | namespace gl |
| 24 | { |
| 25 | struct LinkedUniform; |
Brandon Jones | 22502d5 | 2014-08-29 16:58:36 -0700 | [diff] [blame] | 26 | struct VariableLocation; |
Brandon Jones | c9610c5 | 2014-08-25 17:02:59 -0700 | [diff] [blame] | 27 | struct VertexFormat; |
| 28 | } |
| 29 | |
| 30 | namespace rx |
| 31 | { |
Jamie Madill | 93e13fb | 2014-11-06 15:27:25 -0500 | [diff] [blame] | 32 | class RendererD3D; |
Geoff Lang | 359ef26 | 2015-01-05 14:42:29 -0500 | [diff] [blame] | 33 | class UniformStorageD3D; |
| 34 | class ShaderExecutableD3D; |
Brandon Jones | c9610c5 | 2014-08-25 17:02:59 -0700 | [diff] [blame] | 35 | |
Jamie Madill | 2db1fbb | 2014-12-03 10:58:55 -0500 | [diff] [blame] | 36 | #if !defined(ANGLE_COMPILE_OPTIMIZATION_LEVEL) |
| 37 | // WARNING: D3DCOMPILE_OPTIMIZATION_LEVEL3 may lead to a DX9 shader compiler hang. |
| 38 | // It should only be used selectively to work around specific bugs. |
| 39 | #define ANGLE_COMPILE_OPTIMIZATION_LEVEL D3DCOMPILE_OPTIMIZATION_LEVEL1 |
| 40 | #endif |
| 41 | |
Brandon Jones | c9610c5 | 2014-08-25 17:02:59 -0700 | [diff] [blame] | 42 | class ProgramD3D : public ProgramImpl |
| 43 | { |
| 44 | public: |
Jamie Madill | 30d6c25 | 2014-11-13 10:03:33 -0500 | [diff] [blame] | 45 | ProgramD3D(RendererD3D *renderer); |
Brandon Jones | c9610c5 | 2014-08-25 17:02:59 -0700 | [diff] [blame] | 46 | virtual ~ProgramD3D(); |
| 47 | |
Jamie Madill | 30d6c25 | 2014-11-13 10:03:33 -0500 | [diff] [blame] | 48 | const std::vector<PixelShaderOutputVariable> &getPixelShaderKey() { return mPixelShaderKey; } |
Brandon Jones | 44151a9 | 2014-09-10 11:32:25 -0700 | [diff] [blame] | 49 | int getShaderVersion() const { return mShaderVersion; } |
Brandon Jones | eb99436 | 2014-09-24 10:27:28 -0700 | [diff] [blame] | 50 | GLenum getTransformFeedbackBufferMode() const { return mTransformFeedbackBufferMode; } |
Brandon Jones | 1a8a7e3 | 2014-10-01 12:49:30 -0700 | [diff] [blame] | 51 | |
| 52 | GLint getSamplerMapping(gl::SamplerType type, unsigned int samplerIndex, const gl::Caps &caps) const; |
| 53 | GLenum getSamplerTextureType(gl::SamplerType type, unsigned int samplerIndex) const; |
| 54 | GLint getUsedSamplerRange(gl::SamplerType type) const; |
| 55 | void updateSamplerMapping(); |
| 56 | bool validateSamplers(gl::InfoLog *infoLog, const gl::Caps &caps); |
Brandon Jones | 44151a9 | 2014-09-10 11:32:25 -0700 | [diff] [blame] | 57 | |
Brandon Jones | eb99436 | 2014-09-24 10:27:28 -0700 | [diff] [blame] | 58 | bool usesPointSize() const { return mUsesPointSize; } |
Brandon Jones | 44151a9 | 2014-09-10 11:32:25 -0700 | [diff] [blame] | 59 | bool usesPointSpriteEmulation() const; |
| 60 | bool usesGeometryShader() const; |
Cooper Partin | e6664f0 | 2015-01-09 16:22:24 -0800 | [diff] [blame] | 61 | bool usesInstancedPointSpriteEmulation() const; |
Brandon Jones | 22502d5 | 2014-08-29 16:58:36 -0700 | [diff] [blame] | 62 | |
| 63 | GLenum getBinaryFormat() { return GL_PROGRAM_BINARY_ANGLE; } |
Geoff Lang | 7dd2e10 | 2014-11-10 15:19:26 -0500 | [diff] [blame] | 64 | LinkResult load(gl::InfoLog &infoLog, gl::BinaryInputStream *stream); |
Geoff Lang | b543aff | 2014-09-30 14:52:54 -0400 | [diff] [blame] | 65 | gl::Error save(gl::BinaryOutputStream *stream); |
Brandon Jones | 22502d5 | 2014-08-29 16:58:36 -0700 | [diff] [blame] | 66 | |
Geoff Lang | 359ef26 | 2015-01-05 14:42:29 -0500 | [diff] [blame] | 67 | gl::Error getPixelExecutableForFramebuffer(const gl::Framebuffer *fbo, ShaderExecutableD3D **outExectuable); |
| 68 | gl::Error getPixelExecutableForOutputLayout(const std::vector<GLenum> &outputLayout, ShaderExecutableD3D **outExectuable, gl::InfoLog *infoLog); |
Jamie Madill | d3dfda2 | 2015-07-06 08:28:49 -0400 | [diff] [blame] | 69 | gl::Error getVertexExecutableForInputLayout(const gl::InputLayout &inputLayout, ShaderExecutableD3D **outExectuable, gl::InfoLog *infoLog); |
Geoff Lang | 359ef26 | 2015-01-05 14:42:29 -0500 | [diff] [blame] | 70 | ShaderExecutableD3D *getGeometryExecutable() const { return mGeometryExecutable; } |
Brandon Jones | eb99436 | 2014-09-24 10:27:28 -0700 | [diff] [blame] | 71 | |
Geoff Lang | 7dd2e10 | 2014-11-10 15:19:26 -0500 | [diff] [blame] | 72 | LinkResult compileProgramExecutables(gl::InfoLog &infoLog, gl::Shader *fragmentShader, gl::Shader *vertexShader, |
| 73 | int registers); |
Brandon Jones | 22502d5 | 2014-08-29 16:58:36 -0700 | [diff] [blame] | 74 | |
Geoff Lang | 7dd2e10 | 2014-11-10 15:19:26 -0500 | [diff] [blame] | 75 | LinkResult link(const gl::Data &data, gl::InfoLog &infoLog, |
| 76 | gl::Shader *fragmentShader, gl::Shader *vertexShader, |
| 77 | const std::vector<std::string> &transformFeedbackVaryings, |
| 78 | GLenum transformFeedbackBufferMode, |
| 79 | int *registers, std::vector<gl::LinkedVarying> *linkedVaryings, |
| 80 | std::map<int, gl::VariableLocation> *outputVariables); |
Brandon Jones | c9610c5 | 2014-08-25 17:02:59 -0700 | [diff] [blame] | 81 | |
Geoff Lang | 0ca5378 | 2015-05-07 13:49:39 -0400 | [diff] [blame] | 82 | void bindAttributeLocation(GLuint index, const std::string &name) override; |
| 83 | |
Brandon Jones | 1a8a7e3 | 2014-10-01 12:49:30 -0700 | [diff] [blame] | 84 | void initializeUniformStorage(); |
| 85 | gl::Error applyUniforms(); |
Gregoire Payen de La Garanderie | 68694e9 | 2015-03-24 14:03:37 +0000 | [diff] [blame] | 86 | gl::Error applyUniformBuffers(const gl::Data &data, GLuint uniformBlockBindings[]) override; |
Brandon Jones | 18bd410 | 2014-09-22 14:21:44 -0700 | [diff] [blame] | 87 | bool assignUniformBlockRegister(gl::InfoLog &infoLog, gl::UniformBlock *uniformBlock, GLenum shader, |
| 88 | unsigned int registerIndex, const gl::Caps &caps); |
Brandon Jones | 1a8a7e3 | 2014-10-01 12:49:30 -0700 | [diff] [blame] | 89 | void dirtyAllUniforms(); |
| 90 | |
| 91 | void setUniform1fv(GLint location, GLsizei count, const GLfloat *v); |
| 92 | void setUniform2fv(GLint location, GLsizei count, const GLfloat *v); |
| 93 | void setUniform3fv(GLint location, GLsizei count, const GLfloat *v); |
| 94 | void setUniform4fv(GLint location, GLsizei count, const GLfloat *v); |
| 95 | void setUniform1iv(GLint location, GLsizei count, const GLint *v); |
| 96 | void setUniform2iv(GLint location, GLsizei count, const GLint *v); |
| 97 | void setUniform3iv(GLint location, GLsizei count, const GLint *v); |
| 98 | void setUniform4iv(GLint location, GLsizei count, const GLint *v); |
| 99 | void setUniform1uiv(GLint location, GLsizei count, const GLuint *v); |
| 100 | void setUniform2uiv(GLint location, GLsizei count, const GLuint *v); |
| 101 | void setUniform3uiv(GLint location, GLsizei count, const GLuint *v); |
| 102 | void setUniform4uiv(GLint location, GLsizei count, const GLuint *v); |
| 103 | void setUniformMatrix2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); |
| 104 | void setUniformMatrix3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); |
| 105 | void setUniformMatrix4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); |
| 106 | void setUniformMatrix2x3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); |
| 107 | void setUniformMatrix3x2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); |
| 108 | void setUniformMatrix2x4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); |
| 109 | void setUniformMatrix4x2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); |
| 110 | void setUniformMatrix3x4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); |
| 111 | void setUniformMatrix4x3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); |
| 112 | |
| 113 | void getUniformfv(GLint location, GLfloat *params); |
| 114 | void getUniformiv(GLint location, GLint *params); |
| 115 | void getUniformuiv(GLint location, GLuint *params); |
Brandon Jones | c9610c5 | 2014-08-25 17:02:59 -0700 | [diff] [blame] | 116 | |
Geoff Lang | 359ef26 | 2015-01-05 14:42:29 -0500 | [diff] [blame] | 117 | const UniformStorageD3D &getVertexUniformStorage() const { return *mVertexUniformStorage; } |
| 118 | const UniformStorageD3D &getFragmentUniformStorage() const { return *mFragmentUniformStorage; } |
Brandon Jones | c9610c5 | 2014-08-25 17:02:59 -0700 | [diff] [blame] | 119 | |
Brandon Jones | 1a8a7e3 | 2014-10-01 12:49:30 -0700 | [diff] [blame] | 120 | bool linkUniforms(gl::InfoLog &infoLog, const gl::Shader &vertexShader, const gl::Shader &fragmentShader, |
| 121 | const gl::Caps &caps); |
| 122 | bool defineUniformBlock(gl::InfoLog &infoLog, const gl::Shader &shader, const sh::InterfaceBlock &interfaceBlock, const gl::Caps &caps); |
| 123 | |
Brandon Jones | c9610c5 | 2014-08-25 17:02:59 -0700 | [diff] [blame] | 124 | void reset(); |
| 125 | |
Geoff Lang | 7dd2e10 | 2014-11-10 15:19:26 -0500 | [diff] [blame] | 126 | unsigned int getSerial() const; |
| 127 | |
Jamie Madill | 437d266 | 2014-12-05 14:23:35 -0500 | [diff] [blame] | 128 | void initAttributesByLayout(); |
Jamie Madill | 476682e | 2015-06-30 10:04:29 -0400 | [diff] [blame] | 129 | void sortAttributesByLayout(const std::vector<TranslatedAttribute> &unsortedAttributes, |
Jamie Madill | f9327d3 | 2015-06-22 13:57:16 -0400 | [diff] [blame] | 130 | int sortedSemanticIndicesOut[gl::MAX_VERTEX_ATTRIBS], |
| 131 | const rx::TranslatedAttribute *sortedAttributesOut[gl::MAX_VERTEX_ATTRIBS]) const; |
Jamie Madill | 437d266 | 2014-12-05 14:23:35 -0500 | [diff] [blame] | 132 | |
Jamie Madill | d3dfda2 | 2015-07-06 08:28:49 -0400 | [diff] [blame] | 133 | void updateCachedInputLayout(const gl::Program *program, const gl::State &state); |
| 134 | const gl::InputLayout &getCachedInputLayout() const { return mCachedInputLayout; } |
| 135 | |
Brandon Jones | c9610c5 | 2014-08-25 17:02:59 -0700 | [diff] [blame] | 136 | private: |
Brandon Jones | eb99436 | 2014-09-24 10:27:28 -0700 | [diff] [blame] | 137 | class VertexExecutable |
| 138 | { |
| 139 | public: |
Jamie Madill | d3dfda2 | 2015-07-06 08:28:49 -0400 | [diff] [blame] | 140 | typedef std::vector<GLenum> Signature; |
| 141 | |
| 142 | VertexExecutable(const gl::InputLayout &inputLayout, |
| 143 | const Signature &signature, |
Geoff Lang | 359ef26 | 2015-01-05 14:42:29 -0500 | [diff] [blame] | 144 | ShaderExecutableD3D *shaderExecutable); |
Brandon Jones | eb99436 | 2014-09-24 10:27:28 -0700 | [diff] [blame] | 145 | ~VertexExecutable(); |
| 146 | |
Jamie Madill | d3dfda2 | 2015-07-06 08:28:49 -0400 | [diff] [blame] | 147 | bool matchesSignature(const Signature &signature) const; |
| 148 | static void getSignature(RendererD3D *renderer, |
| 149 | const gl::InputLayout &inputLayout, |
| 150 | Signature *signatureOut); |
Brandon Jones | eb99436 | 2014-09-24 10:27:28 -0700 | [diff] [blame] | 151 | |
Jamie Madill | d3dfda2 | 2015-07-06 08:28:49 -0400 | [diff] [blame] | 152 | const gl::InputLayout &inputs() const { return mInputs; } |
| 153 | const Signature &signature() const { return mSignature; } |
Geoff Lang | 359ef26 | 2015-01-05 14:42:29 -0500 | [diff] [blame] | 154 | ShaderExecutableD3D *shaderExecutable() const { return mShaderExecutable; } |
Brandon Jones | eb99436 | 2014-09-24 10:27:28 -0700 | [diff] [blame] | 155 | |
| 156 | private: |
Jamie Madill | d3dfda2 | 2015-07-06 08:28:49 -0400 | [diff] [blame] | 157 | gl::InputLayout mInputs; |
| 158 | Signature mSignature; |
Geoff Lang | 359ef26 | 2015-01-05 14:42:29 -0500 | [diff] [blame] | 159 | ShaderExecutableD3D *mShaderExecutable; |
Brandon Jones | eb99436 | 2014-09-24 10:27:28 -0700 | [diff] [blame] | 160 | }; |
| 161 | |
| 162 | class PixelExecutable |
| 163 | { |
| 164 | public: |
Geoff Lang | 359ef26 | 2015-01-05 14:42:29 -0500 | [diff] [blame] | 165 | PixelExecutable(const std::vector<GLenum> &outputSignature, ShaderExecutableD3D *shaderExecutable); |
Brandon Jones | eb99436 | 2014-09-24 10:27:28 -0700 | [diff] [blame] | 166 | ~PixelExecutable(); |
| 167 | |
| 168 | bool matchesSignature(const std::vector<GLenum> &signature) const { return mOutputSignature == signature; } |
| 169 | |
| 170 | const std::vector<GLenum> &outputSignature() const { return mOutputSignature; } |
Geoff Lang | 359ef26 | 2015-01-05 14:42:29 -0500 | [diff] [blame] | 171 | ShaderExecutableD3D *shaderExecutable() const { return mShaderExecutable; } |
Brandon Jones | eb99436 | 2014-09-24 10:27:28 -0700 | [diff] [blame] | 172 | |
| 173 | private: |
| 174 | std::vector<GLenum> mOutputSignature; |
Geoff Lang | 359ef26 | 2015-01-05 14:42:29 -0500 | [diff] [blame] | 175 | ShaderExecutableD3D *mShaderExecutable; |
Brandon Jones | eb99436 | 2014-09-24 10:27:28 -0700 | [diff] [blame] | 176 | }; |
| 177 | |
Brandon Jones | 1a8a7e3 | 2014-10-01 12:49:30 -0700 | [diff] [blame] | 178 | struct Sampler |
| 179 | { |
| 180 | Sampler(); |
| 181 | |
| 182 | bool active; |
| 183 | GLint logicalTextureUnit; |
| 184 | GLenum textureType; |
| 185 | }; |
| 186 | |
Geoff Lang | 492a7e4 | 2014-11-05 13:27:06 -0500 | [diff] [blame] | 187 | void defineUniformBase(const ShaderD3D *shader, const sh::Uniform &uniform, unsigned int uniformRegister); |
| 188 | void defineUniform(const ShaderD3D *shader, const sh::ShaderVariable &uniform, const std::string &fullName, |
Brandon Jones | 1a8a7e3 | 2014-10-01 12:49:30 -0700 | [diff] [blame] | 189 | sh::HLSLBlockEncoder *encoder); |
| 190 | bool indexSamplerUniform(const gl::LinkedUniform &uniform, gl::InfoLog &infoLog, const gl::Caps &caps); |
| 191 | bool indexUniforms(gl::InfoLog &infoLog, const gl::Caps &caps); |
| 192 | static bool assignSamplers(unsigned int startSamplerIndex, GLenum samplerType, unsigned int samplerCount, |
| 193 | std::vector<Sampler> &outSamplers, GLuint *outUsedRange); |
| 194 | |
| 195 | template <typename T> |
| 196 | void setUniform(GLint location, GLsizei count, const T* v, GLenum targetUniformType); |
| 197 | |
| 198 | template <int cols, int rows> |
| 199 | void setUniformMatrixfv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value, GLenum targetUniformType); |
| 200 | |
| 201 | template <typename T> |
| 202 | void getUniformv(GLint location, T *params, GLenum uniformType); |
| 203 | |
| 204 | template <typename VarT> |
| 205 | void defineUniformBlockMembers(const std::vector<VarT> &fields, const std::string &prefix, int blockIndex, |
| 206 | sh::BlockLayoutEncoder *encoder, std::vector<unsigned int> *blockUniformIndexes, |
| 207 | bool inRowMajorLayout); |
| 208 | |
Jamie Madill | 93e13fb | 2014-11-06 15:27:25 -0500 | [diff] [blame] | 209 | RendererD3D *mRenderer; |
Brandon Jones | c9610c5 | 2014-08-25 17:02:59 -0700 | [diff] [blame] | 210 | DynamicHLSL *mDynamicHLSL; |
| 211 | |
Brandon Jones | eb99436 | 2014-09-24 10:27:28 -0700 | [diff] [blame] | 212 | std::vector<VertexExecutable *> mVertexExecutables; |
| 213 | std::vector<PixelExecutable *> mPixelExecutables; |
Geoff Lang | 359ef26 | 2015-01-05 14:42:29 -0500 | [diff] [blame] | 214 | ShaderExecutableD3D *mGeometryExecutable; |
Brandon Jones | eb99436 | 2014-09-24 10:27:28 -0700 | [diff] [blame] | 215 | |
Brandon Jones | 22502d5 | 2014-08-29 16:58:36 -0700 | [diff] [blame] | 216 | std::string mVertexHLSL; |
Arun Patole | 44efa0b | 2015-03-04 17:11:05 +0530 | [diff] [blame] | 217 | D3DCompilerWorkarounds mVertexWorkarounds; |
Brandon Jones | 22502d5 | 2014-08-29 16:58:36 -0700 | [diff] [blame] | 218 | |
| 219 | std::string mPixelHLSL; |
Arun Patole | 44efa0b | 2015-03-04 17:11:05 +0530 | [diff] [blame] | 220 | D3DCompilerWorkarounds mPixelWorkarounds; |
Brandon Jones | 22502d5 | 2014-08-29 16:58:36 -0700 | [diff] [blame] | 221 | bool mUsesFragDepth; |
Jamie Madill | 30d6c25 | 2014-11-13 10:03:33 -0500 | [diff] [blame] | 222 | std::vector<PixelShaderOutputVariable> mPixelShaderKey; |
Brandon Jones | 22502d5 | 2014-08-29 16:58:36 -0700 | [diff] [blame] | 223 | |
Brandon Jones | 44151a9 | 2014-09-10 11:32:25 -0700 | [diff] [blame] | 224 | bool mUsesPointSize; |
| 225 | |
Geoff Lang | 359ef26 | 2015-01-05 14:42:29 -0500 | [diff] [blame] | 226 | UniformStorageD3D *mVertexUniformStorage; |
| 227 | UniformStorageD3D *mFragmentUniformStorage; |
Brandon Jones | 44151a9 | 2014-09-10 11:32:25 -0700 | [diff] [blame] | 228 | |
Brandon Jones | eb99436 | 2014-09-24 10:27:28 -0700 | [diff] [blame] | 229 | GLenum mTransformFeedbackBufferMode; |
Brandon Jones | eb99436 | 2014-09-24 10:27:28 -0700 | [diff] [blame] | 230 | |
Brandon Jones | 1a8a7e3 | 2014-10-01 12:49:30 -0700 | [diff] [blame] | 231 | std::vector<Sampler> mSamplersPS; |
| 232 | std::vector<Sampler> mSamplersVS; |
| 233 | GLuint mUsedVertexSamplerRange; |
| 234 | GLuint mUsedPixelSamplerRange; |
| 235 | bool mDirtySamplerMapping; |
Brandon Jones | eb99436 | 2014-09-24 10:27:28 -0700 | [diff] [blame] | 236 | |
Geoff Lang | 7a26a1a | 2015-03-25 12:29:06 -0400 | [diff] [blame] | 237 | // Cache for validateSamplers |
| 238 | std::vector<GLenum> mTextureUnitTypesCache; |
| 239 | |
| 240 | // Cache for getPixelExecutableForFramebuffer |
| 241 | std::vector<GLenum> mPixelShaderOutputFormatCache; |
| 242 | |
Brandon Jones | 44151a9 | 2014-09-10 11:32:25 -0700 | [diff] [blame] | 243 | int mShaderVersion; |
Geoff Lang | 7dd2e10 | 2014-11-10 15:19:26 -0500 | [diff] [blame] | 244 | |
Jamie Madill | 437d266 | 2014-12-05 14:23:35 -0500 | [diff] [blame] | 245 | int mAttributesByLayout[gl::MAX_VERTEX_ATTRIBS]; |
| 246 | |
Geoff Lang | 7dd2e10 | 2014-11-10 15:19:26 -0500 | [diff] [blame] | 247 | unsigned int mSerial; |
| 248 | |
Jamie Madill | 1377689 | 2015-04-28 12:39:06 -0400 | [diff] [blame] | 249 | Optional<bool> mCachedValidateSamplersResult; |
| 250 | |
Jamie Madill | 03260fa | 2015-06-22 13:57:22 -0400 | [diff] [blame] | 251 | std::vector<GLint> mVertexUBOCache; |
| 252 | std::vector<GLint> mFragmentUBOCache; |
Jamie Madill | d3dfda2 | 2015-07-06 08:28:49 -0400 | [diff] [blame] | 253 | VertexExecutable::Signature mCachedVertexSignature; |
| 254 | gl::InputLayout mCachedInputLayout; |
Jamie Madill | 03260fa | 2015-06-22 13:57:22 -0400 | [diff] [blame] | 255 | |
Geoff Lang | 7dd2e10 | 2014-11-10 15:19:26 -0500 | [diff] [blame] | 256 | static unsigned int issueSerial(); |
| 257 | static unsigned int mCurrentSerial; |
Brandon Jones | c9610c5 | 2014-08-25 17:02:59 -0700 | [diff] [blame] | 258 | }; |
| 259 | |
| 260 | } |
| 261 | |
Geoff Lang | 0a73dd8 | 2014-11-19 16:18:08 -0500 | [diff] [blame] | 262 | #endif // LIBANGLE_RENDERER_D3D_PROGRAMD3D_H_ |