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 | 63805b4 | 2015-08-25 13:17:39 -0400 | [diff] [blame] | 45 | typedef int SemanticIndexArray[gl::MAX_VERTEX_ATTRIBS]; |
| 46 | |
Jamie Madill | 5c6b7bf | 2015-08-17 12:53:35 -0400 | [diff] [blame] | 47 | ProgramD3D(const gl::Program::Data &data, RendererD3D *renderer); |
Brandon Jones | c9610c5 | 2014-08-25 17:02:59 -0700 | [diff] [blame] | 48 | virtual ~ProgramD3D(); |
| 49 | |
Jamie Madill | 30d6c25 | 2014-11-13 10:03:33 -0500 | [diff] [blame] | 50 | const std::vector<PixelShaderOutputVariable> &getPixelShaderKey() { return mPixelShaderKey; } |
Brandon Jones | 44151a9 | 2014-09-10 11:32:25 -0700 | [diff] [blame] | 51 | int getShaderVersion() const { return mShaderVersion; } |
Brandon Jones | 1a8a7e3 | 2014-10-01 12:49:30 -0700 | [diff] [blame] | 52 | |
| 53 | GLint getSamplerMapping(gl::SamplerType type, unsigned int samplerIndex, const gl::Caps &caps) const; |
| 54 | GLenum getSamplerTextureType(gl::SamplerType type, unsigned int samplerIndex) const; |
| 55 | GLint getUsedSamplerRange(gl::SamplerType type) const; |
| 56 | void updateSamplerMapping(); |
| 57 | bool validateSamplers(gl::InfoLog *infoLog, const gl::Caps &caps); |
Brandon Jones | 44151a9 | 2014-09-10 11:32:25 -0700 | [diff] [blame] | 58 | |
Brandon Jones | eb99436 | 2014-09-24 10:27:28 -0700 | [diff] [blame] | 59 | bool usesPointSize() const { return mUsesPointSize; } |
Brandon Jones | 44151a9 | 2014-09-10 11:32:25 -0700 | [diff] [blame] | 60 | bool usesPointSpriteEmulation() const; |
| 61 | bool usesGeometryShader() const; |
Cooper Partin | e6664f0 | 2015-01-09 16:22:24 -0800 | [diff] [blame] | 62 | bool usesInstancedPointSpriteEmulation() const; |
Brandon Jones | 22502d5 | 2014-08-29 16:58:36 -0700 | [diff] [blame] | 63 | |
| 64 | GLenum getBinaryFormat() { return GL_PROGRAM_BINARY_ANGLE; } |
Geoff Lang | 7dd2e10 | 2014-11-10 15:19:26 -0500 | [diff] [blame] | 65 | LinkResult load(gl::InfoLog &infoLog, gl::BinaryInputStream *stream); |
Geoff Lang | b543aff | 2014-09-30 14:52:54 -0400 | [diff] [blame] | 66 | gl::Error save(gl::BinaryOutputStream *stream); |
Brandon Jones | 22502d5 | 2014-08-29 16:58:36 -0700 | [diff] [blame] | 67 | |
Geoff Lang | 359ef26 | 2015-01-05 14:42:29 -0500 | [diff] [blame] | 68 | gl::Error getPixelExecutableForFramebuffer(const gl::Framebuffer *fbo, ShaderExecutableD3D **outExectuable); |
| 69 | 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] | 70 | gl::Error getVertexExecutableForInputLayout(const gl::InputLayout &inputLayout, ShaderExecutableD3D **outExectuable, gl::InfoLog *infoLog); |
Geoff Lang | 359ef26 | 2015-01-05 14:42:29 -0500 | [diff] [blame] | 71 | ShaderExecutableD3D *getGeometryExecutable() const { return mGeometryExecutable; } |
Brandon Jones | eb99436 | 2014-09-24 10:27:28 -0700 | [diff] [blame] | 72 | |
Jamie Madill | f5f4ad2 | 2015-09-02 18:32:38 +0000 | [diff] [blame^] | 73 | LinkResult link(const gl::Data &data, gl::InfoLog &infoLog) override; |
Jamie Madill | 36cfd6a | 2015-08-18 10:46:20 -0400 | [diff] [blame] | 74 | GLboolean validate(const gl::Caps &caps, gl::InfoLog *infoLog) override; |
Brandon Jones | c9610c5 | 2014-08-25 17:02:59 -0700 | [diff] [blame] | 75 | |
Brandon Jones | 1a8a7e3 | 2014-10-01 12:49:30 -0700 | [diff] [blame] | 76 | void initializeUniformStorage(); |
| 77 | gl::Error applyUniforms(); |
Jamie Madill | d1fe164 | 2015-08-21 16:26:04 -0400 | [diff] [blame] | 78 | gl::Error applyUniformBuffers(const gl::Data &data); |
Jamie Madill | e473dee | 2015-08-18 14:49:01 -0400 | [diff] [blame] | 79 | void assignUniformBlockRegister(gl::UniformBlock *uniformBlock, |
| 80 | GLenum shader, |
| 81 | unsigned int registerIndex, |
| 82 | const gl::Caps &caps); |
Brandon Jones | 1a8a7e3 | 2014-10-01 12:49:30 -0700 | [diff] [blame] | 83 | void dirtyAllUniforms(); |
| 84 | |
| 85 | void setUniform1fv(GLint location, GLsizei count, const GLfloat *v); |
| 86 | void setUniform2fv(GLint location, GLsizei count, const GLfloat *v); |
| 87 | void setUniform3fv(GLint location, GLsizei count, const GLfloat *v); |
| 88 | void setUniform4fv(GLint location, GLsizei count, const GLfloat *v); |
| 89 | void setUniform1iv(GLint location, GLsizei count, const GLint *v); |
| 90 | void setUniform2iv(GLint location, GLsizei count, const GLint *v); |
| 91 | void setUniform3iv(GLint location, GLsizei count, const GLint *v); |
| 92 | void setUniform4iv(GLint location, GLsizei count, const GLint *v); |
| 93 | void setUniform1uiv(GLint location, GLsizei count, const GLuint *v); |
| 94 | void setUniform2uiv(GLint location, GLsizei count, const GLuint *v); |
| 95 | void setUniform3uiv(GLint location, GLsizei count, const GLuint *v); |
| 96 | void setUniform4uiv(GLint location, GLsizei count, const GLuint *v); |
| 97 | void setUniformMatrix2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); |
| 98 | void setUniformMatrix3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); |
| 99 | void setUniformMatrix4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); |
| 100 | void setUniformMatrix2x3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); |
| 101 | void setUniformMatrix3x2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); |
| 102 | void setUniformMatrix2x4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); |
| 103 | void setUniformMatrix4x2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); |
| 104 | void setUniformMatrix3x4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); |
| 105 | void setUniformMatrix4x3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); |
| 106 | |
| 107 | void getUniformfv(GLint location, GLfloat *params); |
| 108 | void getUniformiv(GLint location, GLint *params); |
| 109 | void getUniformuiv(GLint location, GLuint *params); |
Brandon Jones | c9610c5 | 2014-08-25 17:02:59 -0700 | [diff] [blame] | 110 | |
Geoff Lang | 359ef26 | 2015-01-05 14:42:29 -0500 | [diff] [blame] | 111 | const UniformStorageD3D &getVertexUniformStorage() const { return *mVertexUniformStorage; } |
| 112 | const UniformStorageD3D &getFragmentUniformStorage() const { return *mFragmentUniformStorage; } |
Brandon Jones | c9610c5 | 2014-08-25 17:02:59 -0700 | [diff] [blame] | 113 | |
| 114 | void reset(); |
| 115 | |
Geoff Lang | 7dd2e10 | 2014-11-10 15:19:26 -0500 | [diff] [blame] | 116 | unsigned int getSerial() const; |
| 117 | |
Jamie Madill | 476682e | 2015-06-30 10:04:29 -0400 | [diff] [blame] | 118 | void sortAttributesByLayout(const std::vector<TranslatedAttribute> &unsortedAttributes, |
Jamie Madill | f9327d3 | 2015-06-22 13:57:16 -0400 | [diff] [blame] | 119 | int sortedSemanticIndicesOut[gl::MAX_VERTEX_ATTRIBS], |
| 120 | const rx::TranslatedAttribute *sortedAttributesOut[gl::MAX_VERTEX_ATTRIBS]) const; |
Jamie Madill | 63805b4 | 2015-08-25 13:17:39 -0400 | [diff] [blame] | 121 | const SemanticIndexArray &getSemanticIndexes() const { return mSemanticIndexes; } |
Jamie Madill | c349ec0 | 2015-08-21 16:53:12 -0400 | [diff] [blame] | 122 | const SemanticIndexArray &getAttributesByLayout() const { return mAttributesByLayout; } |
Jamie Madill | 437d266 | 2014-12-05 14:23:35 -0500 | [diff] [blame] | 123 | |
Jamie Madill | 63805b4 | 2015-08-25 13:17:39 -0400 | [diff] [blame] | 124 | void updateCachedInputLayout(const gl::State &state); |
Jamie Madill | d3dfda2 | 2015-07-06 08:28:49 -0400 | [diff] [blame] | 125 | const gl::InputLayout &getCachedInputLayout() const { return mCachedInputLayout; } |
| 126 | |
Brandon Jones | c9610c5 | 2014-08-25 17:02:59 -0700 | [diff] [blame] | 127 | private: |
Brandon Jones | eb99436 | 2014-09-24 10:27:28 -0700 | [diff] [blame] | 128 | class VertexExecutable |
| 129 | { |
| 130 | public: |
Jamie Madill | f8dd7b1 | 2015-08-05 13:50:08 -0400 | [diff] [blame] | 131 | typedef std::vector<bool> Signature; |
Jamie Madill | d3dfda2 | 2015-07-06 08:28:49 -0400 | [diff] [blame] | 132 | |
| 133 | VertexExecutable(const gl::InputLayout &inputLayout, |
| 134 | const Signature &signature, |
Geoff Lang | 359ef26 | 2015-01-05 14:42:29 -0500 | [diff] [blame] | 135 | ShaderExecutableD3D *shaderExecutable); |
Brandon Jones | eb99436 | 2014-09-24 10:27:28 -0700 | [diff] [blame] | 136 | ~VertexExecutable(); |
| 137 | |
Jamie Madill | d3dfda2 | 2015-07-06 08:28:49 -0400 | [diff] [blame] | 138 | bool matchesSignature(const Signature &signature) const; |
| 139 | static void getSignature(RendererD3D *renderer, |
| 140 | const gl::InputLayout &inputLayout, |
| 141 | Signature *signatureOut); |
Brandon Jones | eb99436 | 2014-09-24 10:27:28 -0700 | [diff] [blame] | 142 | |
Jamie Madill | d3dfda2 | 2015-07-06 08:28:49 -0400 | [diff] [blame] | 143 | const gl::InputLayout &inputs() const { return mInputs; } |
| 144 | const Signature &signature() const { return mSignature; } |
Geoff Lang | 359ef26 | 2015-01-05 14:42:29 -0500 | [diff] [blame] | 145 | ShaderExecutableD3D *shaderExecutable() const { return mShaderExecutable; } |
Brandon Jones | eb99436 | 2014-09-24 10:27:28 -0700 | [diff] [blame] | 146 | |
| 147 | private: |
Jamie Madill | d3dfda2 | 2015-07-06 08:28:49 -0400 | [diff] [blame] | 148 | gl::InputLayout mInputs; |
| 149 | Signature mSignature; |
Geoff Lang | 359ef26 | 2015-01-05 14:42:29 -0500 | [diff] [blame] | 150 | ShaderExecutableD3D *mShaderExecutable; |
Brandon Jones | eb99436 | 2014-09-24 10:27:28 -0700 | [diff] [blame] | 151 | }; |
| 152 | |
| 153 | class PixelExecutable |
| 154 | { |
| 155 | public: |
Geoff Lang | 359ef26 | 2015-01-05 14:42:29 -0500 | [diff] [blame] | 156 | PixelExecutable(const std::vector<GLenum> &outputSignature, ShaderExecutableD3D *shaderExecutable); |
Brandon Jones | eb99436 | 2014-09-24 10:27:28 -0700 | [diff] [blame] | 157 | ~PixelExecutable(); |
| 158 | |
| 159 | bool matchesSignature(const std::vector<GLenum> &signature) const { return mOutputSignature == signature; } |
| 160 | |
| 161 | const std::vector<GLenum> &outputSignature() const { return mOutputSignature; } |
Geoff Lang | 359ef26 | 2015-01-05 14:42:29 -0500 | [diff] [blame] | 162 | ShaderExecutableD3D *shaderExecutable() const { return mShaderExecutable; } |
Brandon Jones | eb99436 | 2014-09-24 10:27:28 -0700 | [diff] [blame] | 163 | |
| 164 | private: |
| 165 | std::vector<GLenum> mOutputSignature; |
Geoff Lang | 359ef26 | 2015-01-05 14:42:29 -0500 | [diff] [blame] | 166 | ShaderExecutableD3D *mShaderExecutable; |
Brandon Jones | eb99436 | 2014-09-24 10:27:28 -0700 | [diff] [blame] | 167 | }; |
| 168 | |
Brandon Jones | 1a8a7e3 | 2014-10-01 12:49:30 -0700 | [diff] [blame] | 169 | struct Sampler |
| 170 | { |
| 171 | Sampler(); |
| 172 | |
| 173 | bool active; |
| 174 | GLint logicalTextureUnit; |
| 175 | GLenum textureType; |
| 176 | }; |
| 177 | |
Jamie Madill | ea918db | 2015-08-18 14:48:59 -0400 | [diff] [blame] | 178 | bool defineUniforms(gl::InfoLog &infoLog, const gl::Caps &caps); |
Geoff Lang | 492a7e4 | 2014-11-05 13:27:06 -0500 | [diff] [blame] | 179 | void defineUniformBase(const ShaderD3D *shader, const sh::Uniform &uniform, unsigned int uniformRegister); |
| 180 | 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] | 181 | sh::HLSLBlockEncoder *encoder); |
| 182 | bool indexSamplerUniform(const gl::LinkedUniform &uniform, gl::InfoLog &infoLog, const gl::Caps &caps); |
| 183 | bool indexUniforms(gl::InfoLog &infoLog, const gl::Caps &caps); |
| 184 | static bool assignSamplers(unsigned int startSamplerIndex, GLenum samplerType, unsigned int samplerCount, |
| 185 | std::vector<Sampler> &outSamplers, GLuint *outUsedRange); |
| 186 | |
Jamie Madill | e473dee | 2015-08-18 14:49:01 -0400 | [diff] [blame] | 187 | void defineUniformBlocks(const gl::Caps &caps); |
| 188 | void defineUniformBlock(const gl::Shader &shader, |
| 189 | const sh::InterfaceBlock &interfaceBlock, |
| 190 | const gl::Caps &caps); |
| 191 | |
Brandon Jones | 1a8a7e3 | 2014-10-01 12:49:30 -0700 | [diff] [blame] | 192 | template <typename T> |
| 193 | void setUniform(GLint location, GLsizei count, const T* v, GLenum targetUniformType); |
| 194 | |
| 195 | template <int cols, int rows> |
| 196 | void setUniformMatrixfv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value, GLenum targetUniformType); |
| 197 | |
| 198 | template <typename T> |
| 199 | void getUniformv(GLint location, T *params, GLenum uniformType); |
| 200 | |
| 201 | template <typename VarT> |
| 202 | void defineUniformBlockMembers(const std::vector<VarT> &fields, const std::string &prefix, int blockIndex, |
| 203 | sh::BlockLayoutEncoder *encoder, std::vector<unsigned int> *blockUniformIndexes, |
| 204 | bool inRowMajorLayout); |
| 205 | |
Jamie Madill | ca03b35 | 2015-09-02 12:38:13 -0400 | [diff] [blame] | 206 | LinkResult compileProgramExecutables(gl::InfoLog &infoLog, |
| 207 | int registers, |
| 208 | const std::vector<PackedVarying> &packedVaryings); |
Jamie Madill | 31c8c56 | 2015-08-19 14:08:03 -0400 | [diff] [blame] | 209 | |
Jamie Madill | ccdf74b | 2015-08-18 10:46:12 -0400 | [diff] [blame] | 210 | void gatherTransformFeedbackVaryings(const std::vector<gl::LinkedVarying> &varyings); |
| 211 | |
Jamie Madill | 63805b4 | 2015-08-25 13:17:39 -0400 | [diff] [blame] | 212 | void initSemanticIndex(); |
| 213 | void initAttributesByLayout(); |
| 214 | |
Jamie Madill | 93e13fb | 2014-11-06 15:27:25 -0500 | [diff] [blame] | 215 | RendererD3D *mRenderer; |
Brandon Jones | c9610c5 | 2014-08-25 17:02:59 -0700 | [diff] [blame] | 216 | DynamicHLSL *mDynamicHLSL; |
| 217 | |
Brandon Jones | eb99436 | 2014-09-24 10:27:28 -0700 | [diff] [blame] | 218 | std::vector<VertexExecutable *> mVertexExecutables; |
| 219 | std::vector<PixelExecutable *> mPixelExecutables; |
Geoff Lang | 359ef26 | 2015-01-05 14:42:29 -0500 | [diff] [blame] | 220 | ShaderExecutableD3D *mGeometryExecutable; |
Brandon Jones | eb99436 | 2014-09-24 10:27:28 -0700 | [diff] [blame] | 221 | |
Brandon Jones | 22502d5 | 2014-08-29 16:58:36 -0700 | [diff] [blame] | 222 | std::string mVertexHLSL; |
Arun Patole | 44efa0b | 2015-03-04 17:11:05 +0530 | [diff] [blame] | 223 | D3DCompilerWorkarounds mVertexWorkarounds; |
Brandon Jones | 22502d5 | 2014-08-29 16:58:36 -0700 | [diff] [blame] | 224 | |
| 225 | std::string mPixelHLSL; |
Arun Patole | 44efa0b | 2015-03-04 17:11:05 +0530 | [diff] [blame] | 226 | D3DCompilerWorkarounds mPixelWorkarounds; |
Brandon Jones | 22502d5 | 2014-08-29 16:58:36 -0700 | [diff] [blame] | 227 | bool mUsesFragDepth; |
Jamie Madill | 30d6c25 | 2014-11-13 10:03:33 -0500 | [diff] [blame] | 228 | std::vector<PixelShaderOutputVariable> mPixelShaderKey; |
Brandon Jones | 22502d5 | 2014-08-29 16:58:36 -0700 | [diff] [blame] | 229 | |
Brandon Jones | 44151a9 | 2014-09-10 11:32:25 -0700 | [diff] [blame] | 230 | bool mUsesPointSize; |
| 231 | |
Geoff Lang | 359ef26 | 2015-01-05 14:42:29 -0500 | [diff] [blame] | 232 | UniformStorageD3D *mVertexUniformStorage; |
| 233 | UniformStorageD3D *mFragmentUniformStorage; |
Brandon Jones | 44151a9 | 2014-09-10 11:32:25 -0700 | [diff] [blame] | 234 | |
Brandon Jones | 1a8a7e3 | 2014-10-01 12:49:30 -0700 | [diff] [blame] | 235 | std::vector<Sampler> mSamplersPS; |
| 236 | std::vector<Sampler> mSamplersVS; |
| 237 | GLuint mUsedVertexSamplerRange; |
| 238 | GLuint mUsedPixelSamplerRange; |
| 239 | bool mDirtySamplerMapping; |
Brandon Jones | eb99436 | 2014-09-24 10:27:28 -0700 | [diff] [blame] | 240 | |
Geoff Lang | 7a26a1a | 2015-03-25 12:29:06 -0400 | [diff] [blame] | 241 | // Cache for validateSamplers |
| 242 | std::vector<GLenum> mTextureUnitTypesCache; |
| 243 | |
| 244 | // Cache for getPixelExecutableForFramebuffer |
| 245 | std::vector<GLenum> mPixelShaderOutputFormatCache; |
| 246 | |
Brandon Jones | 44151a9 | 2014-09-10 11:32:25 -0700 | [diff] [blame] | 247 | int mShaderVersion; |
Geoff Lang | 7dd2e10 | 2014-11-10 15:19:26 -0500 | [diff] [blame] | 248 | |
Jamie Madill | 63805b4 | 2015-08-25 13:17:39 -0400 | [diff] [blame] | 249 | SemanticIndexArray mSemanticIndexes; |
Jamie Madill | c349ec0 | 2015-08-21 16:53:12 -0400 | [diff] [blame] | 250 | SemanticIndexArray mAttributesByLayout; |
Jamie Madill | 437d266 | 2014-12-05 14:23:35 -0500 | [diff] [blame] | 251 | |
Geoff Lang | 7dd2e10 | 2014-11-10 15:19:26 -0500 | [diff] [blame] | 252 | unsigned int mSerial; |
| 253 | |
Jamie Madill | 1377689 | 2015-04-28 12:39:06 -0400 | [diff] [blame] | 254 | Optional<bool> mCachedValidateSamplersResult; |
| 255 | |
Jamie Madill | 03260fa | 2015-06-22 13:57:22 -0400 | [diff] [blame] | 256 | std::vector<GLint> mVertexUBOCache; |
| 257 | std::vector<GLint> mFragmentUBOCache; |
Jamie Madill | d3dfda2 | 2015-07-06 08:28:49 -0400 | [diff] [blame] | 258 | VertexExecutable::Signature mCachedVertexSignature; |
| 259 | gl::InputLayout mCachedInputLayout; |
Jamie Madill | 03260fa | 2015-06-22 13:57:22 -0400 | [diff] [blame] | 260 | |
Jamie Madill | ccdf74b | 2015-08-18 10:46:12 -0400 | [diff] [blame] | 261 | std::vector<gl::LinkedVarying> mTransformFeedbackLinkedVaryings; |
| 262 | |
Geoff Lang | 7dd2e10 | 2014-11-10 15:19:26 -0500 | [diff] [blame] | 263 | static unsigned int issueSerial(); |
| 264 | static unsigned int mCurrentSerial; |
Brandon Jones | c9610c5 | 2014-08-25 17:02:59 -0700 | [diff] [blame] | 265 | }; |
| 266 | |
| 267 | } |
| 268 | |
Geoff Lang | 0a73dd8 | 2014-11-19 16:18:08 -0500 | [diff] [blame] | 269 | #endif // LIBANGLE_RENDERER_D3D_PROGRAMD3D_H_ |