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 | |
Daniel Bratell | 73941de | 2015-02-25 14:34:49 +0100 | [diff] [blame] | 15 | #include "compiler/translator/blocklayoutHLSL.h" |
Jamie Madill | 437d266 | 2014-12-05 14:23:35 -0500 | [diff] [blame] | 16 | #include "libANGLE/Constants.h" |
Jamie Madill | d3dfda2 | 2015-07-06 08:28:49 -0400 | [diff] [blame] | 17 | #include "libANGLE/formatutils.h" |
Geoff Lang | 2b5420c | 2014-11-19 14:20:15 -0500 | [diff] [blame] | 18 | #include "libANGLE/renderer/ProgramImpl.h" |
Geoff Lang | 7dd2e10 | 2014-11-10 15:19:26 -0500 | [diff] [blame] | 19 | #include "libANGLE/renderer/d3d/DynamicHLSL.h" |
Geoff Lang | 6941a55 | 2015-07-27 11:06:45 -0400 | [diff] [blame] | 20 | #include "libANGLE/renderer/d3d/WorkaroundsD3D.h" |
Brandon Jones | c9610c5 | 2014-08-25 17:02:59 -0700 | [diff] [blame] | 21 | |
Brandon Jones | c9610c5 | 2014-08-25 17:02:59 -0700 | [diff] [blame] | 22 | namespace rx |
| 23 | { |
Jamie Madill | 93e13fb | 2014-11-06 15:27:25 -0500 | [diff] [blame] | 24 | class RendererD3D; |
Geoff Lang | 359ef26 | 2015-01-05 14:42:29 -0500 | [diff] [blame] | 25 | class UniformStorageD3D; |
| 26 | class ShaderExecutableD3D; |
Brandon Jones | c9610c5 | 2014-08-25 17:02:59 -0700 | [diff] [blame] | 27 | |
Jamie Madill | 2db1fbb | 2014-12-03 10:58:55 -0500 | [diff] [blame] | 28 | #if !defined(ANGLE_COMPILE_OPTIMIZATION_LEVEL) |
| 29 | // WARNING: D3DCOMPILE_OPTIMIZATION_LEVEL3 may lead to a DX9 shader compiler hang. |
| 30 | // It should only be used selectively to work around specific bugs. |
| 31 | #define ANGLE_COMPILE_OPTIMIZATION_LEVEL D3DCOMPILE_OPTIMIZATION_LEVEL1 |
| 32 | #endif |
| 33 | |
Jamie Madill | 62d31cb | 2015-09-11 13:25:51 -0400 | [diff] [blame] | 34 | // Helper struct representing a single shader uniform |
Jamie Madill | 6cbf438 | 2015-09-22 19:12:11 -0400 | [diff] [blame^] | 35 | struct D3DUniform : angle::NonCopyable |
Jamie Madill | 62d31cb | 2015-09-11 13:25:51 -0400 | [diff] [blame] | 36 | { |
| 37 | D3DUniform(GLenum typeIn, |
| 38 | const std::string &nameIn, |
| 39 | unsigned int arraySizeIn, |
| 40 | bool defaultBlock); |
| 41 | ~D3DUniform(); |
| 42 | |
| 43 | bool isSampler() const; |
| 44 | unsigned int elementCount() const { return std::max(1u, arraySize); } |
| 45 | bool isReferencedByVertexShader() const; |
| 46 | bool isReferencedByFragmentShader() const; |
| 47 | |
| 48 | // Duplicated from the GL layer |
| 49 | GLenum type; |
| 50 | std::string name; |
| 51 | unsigned int arraySize; |
| 52 | |
| 53 | // Pointer to a system copy of the data. |
| 54 | // TODO(jmadill): remove this in favor of gl::LinkedUniform::data(). |
| 55 | uint8_t *data; |
| 56 | |
| 57 | // Has the data been updated since the last sync? |
| 58 | bool dirty; |
| 59 | |
| 60 | // Register information. |
| 61 | unsigned int vsRegisterIndex; |
| 62 | unsigned int psRegisterIndex; |
| 63 | unsigned int registerCount; |
| 64 | |
| 65 | // Register "elements" are used for uniform structs in ES3, to appropriately identify single |
| 66 | // uniforms |
| 67 | // inside aggregate types, which are packed according C-like structure rules. |
| 68 | unsigned int registerElement; |
| 69 | }; |
| 70 | |
Brandon Jones | c9610c5 | 2014-08-25 17:02:59 -0700 | [diff] [blame] | 71 | class ProgramD3D : public ProgramImpl |
| 72 | { |
| 73 | public: |
Jamie Madill | 63805b4 | 2015-08-25 13:17:39 -0400 | [diff] [blame] | 74 | typedef int SemanticIndexArray[gl::MAX_VERTEX_ATTRIBS]; |
| 75 | |
Jamie Madill | 5c6b7bf | 2015-08-17 12:53:35 -0400 | [diff] [blame] | 76 | ProgramD3D(const gl::Program::Data &data, RendererD3D *renderer); |
Brandon Jones | c9610c5 | 2014-08-25 17:02:59 -0700 | [diff] [blame] | 77 | virtual ~ProgramD3D(); |
| 78 | |
Jamie Madill | 30d6c25 | 2014-11-13 10:03:33 -0500 | [diff] [blame] | 79 | const std::vector<PixelShaderOutputVariable> &getPixelShaderKey() { return mPixelShaderKey; } |
Brandon Jones | 44151a9 | 2014-09-10 11:32:25 -0700 | [diff] [blame] | 80 | int getShaderVersion() const { return mShaderVersion; } |
Brandon Jones | 1a8a7e3 | 2014-10-01 12:49:30 -0700 | [diff] [blame] | 81 | |
| 82 | GLint getSamplerMapping(gl::SamplerType type, unsigned int samplerIndex, const gl::Caps &caps) const; |
| 83 | GLenum getSamplerTextureType(gl::SamplerType type, unsigned int samplerIndex) const; |
| 84 | GLint getUsedSamplerRange(gl::SamplerType type) const; |
| 85 | void updateSamplerMapping(); |
Brandon Jones | 44151a9 | 2014-09-10 11:32:25 -0700 | [diff] [blame] | 86 | |
Brandon Jones | eb99436 | 2014-09-24 10:27:28 -0700 | [diff] [blame] | 87 | bool usesPointSize() const { return mUsesPointSize; } |
Brandon Jones | 44151a9 | 2014-09-10 11:32:25 -0700 | [diff] [blame] | 88 | bool usesPointSpriteEmulation() const; |
| 89 | bool usesGeometryShader() const; |
Cooper Partin | e6664f0 | 2015-01-09 16:22:24 -0800 | [diff] [blame] | 90 | bool usesInstancedPointSpriteEmulation() const; |
Brandon Jones | 22502d5 | 2014-08-29 16:58:36 -0700 | [diff] [blame] | 91 | |
| 92 | GLenum getBinaryFormat() { return GL_PROGRAM_BINARY_ANGLE; } |
Geoff Lang | 7dd2e10 | 2014-11-10 15:19:26 -0500 | [diff] [blame] | 93 | LinkResult load(gl::InfoLog &infoLog, gl::BinaryInputStream *stream); |
Geoff Lang | b543aff | 2014-09-30 14:52:54 -0400 | [diff] [blame] | 94 | gl::Error save(gl::BinaryOutputStream *stream); |
Brandon Jones | 22502d5 | 2014-08-29 16:58:36 -0700 | [diff] [blame] | 95 | |
Geoff Lang | 359ef26 | 2015-01-05 14:42:29 -0500 | [diff] [blame] | 96 | gl::Error getPixelExecutableForFramebuffer(const gl::Framebuffer *fbo, ShaderExecutableD3D **outExectuable); |
| 97 | 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] | 98 | gl::Error getVertexExecutableForInputLayout(const gl::InputLayout &inputLayout, ShaderExecutableD3D **outExectuable, gl::InfoLog *infoLog); |
Geoff Lang | 359ef26 | 2015-01-05 14:42:29 -0500 | [diff] [blame] | 99 | ShaderExecutableD3D *getGeometryExecutable() const { return mGeometryExecutable; } |
Brandon Jones | eb99436 | 2014-09-24 10:27:28 -0700 | [diff] [blame] | 100 | |
Jamie Madill | f5f4ad2 | 2015-09-02 18:32:38 +0000 | [diff] [blame] | 101 | LinkResult link(const gl::Data &data, gl::InfoLog &infoLog) override; |
Jamie Madill | 36cfd6a | 2015-08-18 10:46:20 -0400 | [diff] [blame] | 102 | GLboolean validate(const gl::Caps &caps, gl::InfoLog *infoLog) override; |
Brandon Jones | c9610c5 | 2014-08-25 17:02:59 -0700 | [diff] [blame] | 103 | |
Jamie Madill | 62d31cb | 2015-09-11 13:25:51 -0400 | [diff] [blame] | 104 | void gatherUniformBlockInfo(std::vector<gl::UniformBlock> *uniformBlocks, |
| 105 | std::vector<gl::LinkedUniform> *uniforms) override; |
| 106 | |
Brandon Jones | 1a8a7e3 | 2014-10-01 12:49:30 -0700 | [diff] [blame] | 107 | void initializeUniformStorage(); |
| 108 | gl::Error applyUniforms(); |
Jamie Madill | d1fe164 | 2015-08-21 16:26:04 -0400 | [diff] [blame] | 109 | gl::Error applyUniformBuffers(const gl::Data &data); |
Brandon Jones | 1a8a7e3 | 2014-10-01 12:49:30 -0700 | [diff] [blame] | 110 | void dirtyAllUniforms(); |
| 111 | |
| 112 | void setUniform1fv(GLint location, GLsizei count, const GLfloat *v); |
| 113 | void setUniform2fv(GLint location, GLsizei count, const GLfloat *v); |
| 114 | void setUniform3fv(GLint location, GLsizei count, const GLfloat *v); |
| 115 | void setUniform4fv(GLint location, GLsizei count, const GLfloat *v); |
| 116 | void setUniform1iv(GLint location, GLsizei count, const GLint *v); |
| 117 | void setUniform2iv(GLint location, GLsizei count, const GLint *v); |
| 118 | void setUniform3iv(GLint location, GLsizei count, const GLint *v); |
| 119 | void setUniform4iv(GLint location, GLsizei count, const GLint *v); |
| 120 | void setUniform1uiv(GLint location, GLsizei count, const GLuint *v); |
| 121 | void setUniform2uiv(GLint location, GLsizei count, const GLuint *v); |
| 122 | void setUniform3uiv(GLint location, GLsizei count, const GLuint *v); |
| 123 | void setUniform4uiv(GLint location, GLsizei count, const GLuint *v); |
| 124 | void setUniformMatrix2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); |
| 125 | void setUniformMatrix3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); |
| 126 | void setUniformMatrix4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); |
| 127 | void setUniformMatrix2x3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); |
| 128 | void setUniformMatrix3x2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); |
| 129 | void setUniformMatrix2x4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); |
| 130 | void setUniformMatrix4x2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); |
| 131 | void setUniformMatrix3x4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); |
| 132 | void setUniformMatrix4x3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); |
| 133 | |
Geoff Lang | 359ef26 | 2015-01-05 14:42:29 -0500 | [diff] [blame] | 134 | const UniformStorageD3D &getVertexUniformStorage() const { return *mVertexUniformStorage; } |
| 135 | const UniformStorageD3D &getFragmentUniformStorage() const { return *mFragmentUniformStorage; } |
Brandon Jones | c9610c5 | 2014-08-25 17:02:59 -0700 | [diff] [blame] | 136 | |
Geoff Lang | 7dd2e10 | 2014-11-10 15:19:26 -0500 | [diff] [blame] | 137 | unsigned int getSerial() const; |
| 138 | |
Jamie Madill | 476682e | 2015-06-30 10:04:29 -0400 | [diff] [blame] | 139 | void sortAttributesByLayout(const std::vector<TranslatedAttribute> &unsortedAttributes, |
Jamie Madill | f9327d3 | 2015-06-22 13:57:16 -0400 | [diff] [blame] | 140 | int sortedSemanticIndicesOut[gl::MAX_VERTEX_ATTRIBS], |
| 141 | const rx::TranslatedAttribute *sortedAttributesOut[gl::MAX_VERTEX_ATTRIBS]) const; |
Jamie Madill | 63805b4 | 2015-08-25 13:17:39 -0400 | [diff] [blame] | 142 | const SemanticIndexArray &getSemanticIndexes() const { return mSemanticIndexes; } |
Jamie Madill | c349ec0 | 2015-08-21 16:53:12 -0400 | [diff] [blame] | 143 | const SemanticIndexArray &getAttributesByLayout() const { return mAttributesByLayout; } |
Jamie Madill | 437d266 | 2014-12-05 14:23:35 -0500 | [diff] [blame] | 144 | |
Jamie Madill | 63805b4 | 2015-08-25 13:17:39 -0400 | [diff] [blame] | 145 | void updateCachedInputLayout(const gl::State &state); |
Jamie Madill | d3dfda2 | 2015-07-06 08:28:49 -0400 | [diff] [blame] | 146 | const gl::InputLayout &getCachedInputLayout() const { return mCachedInputLayout; } |
| 147 | |
Brandon Jones | c9610c5 | 2014-08-25 17:02:59 -0700 | [diff] [blame] | 148 | private: |
Brandon Jones | eb99436 | 2014-09-24 10:27:28 -0700 | [diff] [blame] | 149 | class VertexExecutable |
| 150 | { |
| 151 | public: |
Jamie Madill | f8dd7b1 | 2015-08-05 13:50:08 -0400 | [diff] [blame] | 152 | typedef std::vector<bool> Signature; |
Jamie Madill | d3dfda2 | 2015-07-06 08:28:49 -0400 | [diff] [blame] | 153 | |
| 154 | VertexExecutable(const gl::InputLayout &inputLayout, |
| 155 | const Signature &signature, |
Geoff Lang | 359ef26 | 2015-01-05 14:42:29 -0500 | [diff] [blame] | 156 | ShaderExecutableD3D *shaderExecutable); |
Brandon Jones | eb99436 | 2014-09-24 10:27:28 -0700 | [diff] [blame] | 157 | ~VertexExecutable(); |
| 158 | |
Jamie Madill | d3dfda2 | 2015-07-06 08:28:49 -0400 | [diff] [blame] | 159 | bool matchesSignature(const Signature &signature) const; |
| 160 | static void getSignature(RendererD3D *renderer, |
| 161 | const gl::InputLayout &inputLayout, |
| 162 | Signature *signatureOut); |
Brandon Jones | eb99436 | 2014-09-24 10:27:28 -0700 | [diff] [blame] | 163 | |
Jamie Madill | d3dfda2 | 2015-07-06 08:28:49 -0400 | [diff] [blame] | 164 | const gl::InputLayout &inputs() const { return mInputs; } |
| 165 | const Signature &signature() const { return mSignature; } |
Geoff Lang | 359ef26 | 2015-01-05 14:42:29 -0500 | [diff] [blame] | 166 | ShaderExecutableD3D *shaderExecutable() const { return mShaderExecutable; } |
Brandon Jones | eb99436 | 2014-09-24 10:27:28 -0700 | [diff] [blame] | 167 | |
| 168 | private: |
Jamie Madill | d3dfda2 | 2015-07-06 08:28:49 -0400 | [diff] [blame] | 169 | gl::InputLayout mInputs; |
| 170 | Signature mSignature; |
Geoff Lang | 359ef26 | 2015-01-05 14:42:29 -0500 | [diff] [blame] | 171 | ShaderExecutableD3D *mShaderExecutable; |
Brandon Jones | eb99436 | 2014-09-24 10:27:28 -0700 | [diff] [blame] | 172 | }; |
| 173 | |
| 174 | class PixelExecutable |
| 175 | { |
| 176 | public: |
Geoff Lang | 359ef26 | 2015-01-05 14:42:29 -0500 | [diff] [blame] | 177 | PixelExecutable(const std::vector<GLenum> &outputSignature, ShaderExecutableD3D *shaderExecutable); |
Brandon Jones | eb99436 | 2014-09-24 10:27:28 -0700 | [diff] [blame] | 178 | ~PixelExecutable(); |
| 179 | |
| 180 | bool matchesSignature(const std::vector<GLenum> &signature) const { return mOutputSignature == signature; } |
| 181 | |
| 182 | const std::vector<GLenum> &outputSignature() const { return mOutputSignature; } |
Geoff Lang | 359ef26 | 2015-01-05 14:42:29 -0500 | [diff] [blame] | 183 | ShaderExecutableD3D *shaderExecutable() const { return mShaderExecutable; } |
Brandon Jones | eb99436 | 2014-09-24 10:27:28 -0700 | [diff] [blame] | 184 | |
| 185 | private: |
| 186 | std::vector<GLenum> mOutputSignature; |
Geoff Lang | 359ef26 | 2015-01-05 14:42:29 -0500 | [diff] [blame] | 187 | ShaderExecutableD3D *mShaderExecutable; |
Brandon Jones | eb99436 | 2014-09-24 10:27:28 -0700 | [diff] [blame] | 188 | }; |
| 189 | |
Brandon Jones | 1a8a7e3 | 2014-10-01 12:49:30 -0700 | [diff] [blame] | 190 | struct Sampler |
| 191 | { |
| 192 | Sampler(); |
| 193 | |
| 194 | bool active; |
| 195 | GLint logicalTextureUnit; |
| 196 | GLenum textureType; |
| 197 | }; |
| 198 | |
Jamie Madill | 6cbf438 | 2015-09-22 19:12:11 -0400 | [diff] [blame^] | 199 | typedef std::map<std::string, D3DUniform *> D3DUniformMap; |
Jamie Madill | 62d31cb | 2015-09-11 13:25:51 -0400 | [diff] [blame] | 200 | typedef std::map<std::string, sh::BlockMemberInfo> BlockInfoMap; |
Brandon Jones | 1a8a7e3 | 2014-10-01 12:49:30 -0700 | [diff] [blame] | 201 | |
Jamie Madill | 6cbf438 | 2015-09-22 19:12:11 -0400 | [diff] [blame^] | 202 | void defineUniformsAndAssignRegisters(); |
| 203 | void defineUniformBase(const ShaderD3D *shader, |
| 204 | const sh::Uniform &uniform, |
| 205 | D3DUniformMap *uniformMap); |
| 206 | void defineUniform(const ShaderD3D *shader, |
| 207 | const sh::ShaderVariable &uniform, |
| 208 | const std::string &fullName, |
| 209 | sh::HLSLBlockEncoder *encoder, |
| 210 | D3DUniformMap *uniformMap); |
Jamie Madill | 62d31cb | 2015-09-11 13:25:51 -0400 | [diff] [blame] | 211 | void assignAllSamplerRegisters(); |
| 212 | void assignSamplerRegisters(const D3DUniform *d3dUniform); |
| 213 | |
| 214 | static void AssignSamplers(unsigned int startSamplerIndex, |
| 215 | GLenum samplerType, |
| 216 | unsigned int samplerCount, |
| 217 | std::vector<Sampler> &outSamplers, |
| 218 | GLuint *outUsedRange); |
| 219 | |
| 220 | size_t defineUniformBlock(const sh::InterfaceBlock &interfaceBlock, BlockInfoMap *blockInfoOut); |
Jamie Madill | e473dee | 2015-08-18 14:49:01 -0400 | [diff] [blame] | 221 | |
Brandon Jones | 1a8a7e3 | 2014-10-01 12:49:30 -0700 | [diff] [blame] | 222 | template <typename T> |
| 223 | void setUniform(GLint location, GLsizei count, const T* v, GLenum targetUniformType); |
| 224 | |
| 225 | template <int cols, int rows> |
| 226 | void setUniformMatrixfv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value, GLenum targetUniformType); |
| 227 | |
Jamie Madill | ca03b35 | 2015-09-02 12:38:13 -0400 | [diff] [blame] | 228 | LinkResult compileProgramExecutables(gl::InfoLog &infoLog, |
| 229 | int registers, |
| 230 | const std::vector<PackedVarying> &packedVaryings); |
Jamie Madill | 31c8c56 | 2015-08-19 14:08:03 -0400 | [diff] [blame] | 231 | |
Jamie Madill | ccdf74b | 2015-08-18 10:46:12 -0400 | [diff] [blame] | 232 | void gatherTransformFeedbackVaryings(const std::vector<gl::LinkedVarying> &varyings); |
Jamie Madill | 62d31cb | 2015-09-11 13:25:51 -0400 | [diff] [blame] | 233 | D3DUniform *getD3DUniformByName(const std::string &name); |
| 234 | D3DUniform *getD3DUniformFromLocation(GLint location); |
Jamie Madill | ccdf74b | 2015-08-18 10:46:12 -0400 | [diff] [blame] | 235 | |
Jamie Madill | 63805b4 | 2015-08-25 13:17:39 -0400 | [diff] [blame] | 236 | void initSemanticIndex(); |
| 237 | void initAttributesByLayout(); |
| 238 | |
Jamie Madill | 62d31cb | 2015-09-11 13:25:51 -0400 | [diff] [blame] | 239 | void reset(); |
| 240 | |
Jamie Madill | 93e13fb | 2014-11-06 15:27:25 -0500 | [diff] [blame] | 241 | RendererD3D *mRenderer; |
Brandon Jones | c9610c5 | 2014-08-25 17:02:59 -0700 | [diff] [blame] | 242 | DynamicHLSL *mDynamicHLSL; |
| 243 | |
Brandon Jones | eb99436 | 2014-09-24 10:27:28 -0700 | [diff] [blame] | 244 | std::vector<VertexExecutable *> mVertexExecutables; |
| 245 | std::vector<PixelExecutable *> mPixelExecutables; |
Geoff Lang | 359ef26 | 2015-01-05 14:42:29 -0500 | [diff] [blame] | 246 | ShaderExecutableD3D *mGeometryExecutable; |
Brandon Jones | eb99436 | 2014-09-24 10:27:28 -0700 | [diff] [blame] | 247 | |
Brandon Jones | 22502d5 | 2014-08-29 16:58:36 -0700 | [diff] [blame] | 248 | std::string mVertexHLSL; |
Arun Patole | 44efa0b | 2015-03-04 17:11:05 +0530 | [diff] [blame] | 249 | D3DCompilerWorkarounds mVertexWorkarounds; |
Brandon Jones | 22502d5 | 2014-08-29 16:58:36 -0700 | [diff] [blame] | 250 | |
| 251 | std::string mPixelHLSL; |
Arun Patole | 44efa0b | 2015-03-04 17:11:05 +0530 | [diff] [blame] | 252 | D3DCompilerWorkarounds mPixelWorkarounds; |
Brandon Jones | 22502d5 | 2014-08-29 16:58:36 -0700 | [diff] [blame] | 253 | bool mUsesFragDepth; |
Jamie Madill | 30d6c25 | 2014-11-13 10:03:33 -0500 | [diff] [blame] | 254 | std::vector<PixelShaderOutputVariable> mPixelShaderKey; |
Brandon Jones | 22502d5 | 2014-08-29 16:58:36 -0700 | [diff] [blame] | 255 | |
Brandon Jones | 44151a9 | 2014-09-10 11:32:25 -0700 | [diff] [blame] | 256 | bool mUsesPointSize; |
| 257 | |
Geoff Lang | 359ef26 | 2015-01-05 14:42:29 -0500 | [diff] [blame] | 258 | UniformStorageD3D *mVertexUniformStorage; |
| 259 | UniformStorageD3D *mFragmentUniformStorage; |
Brandon Jones | 44151a9 | 2014-09-10 11:32:25 -0700 | [diff] [blame] | 260 | |
Brandon Jones | 1a8a7e3 | 2014-10-01 12:49:30 -0700 | [diff] [blame] | 261 | std::vector<Sampler> mSamplersPS; |
| 262 | std::vector<Sampler> mSamplersVS; |
| 263 | GLuint mUsedVertexSamplerRange; |
| 264 | GLuint mUsedPixelSamplerRange; |
| 265 | bool mDirtySamplerMapping; |
Brandon Jones | eb99436 | 2014-09-24 10:27:28 -0700 | [diff] [blame] | 266 | |
Geoff Lang | 7a26a1a | 2015-03-25 12:29:06 -0400 | [diff] [blame] | 267 | // Cache for getPixelExecutableForFramebuffer |
| 268 | std::vector<GLenum> mPixelShaderOutputFormatCache; |
| 269 | |
Brandon Jones | 44151a9 | 2014-09-10 11:32:25 -0700 | [diff] [blame] | 270 | int mShaderVersion; |
Geoff Lang | 7dd2e10 | 2014-11-10 15:19:26 -0500 | [diff] [blame] | 271 | |
Jamie Madill | 63805b4 | 2015-08-25 13:17:39 -0400 | [diff] [blame] | 272 | SemanticIndexArray mSemanticIndexes; |
Jamie Madill | c349ec0 | 2015-08-21 16:53:12 -0400 | [diff] [blame] | 273 | SemanticIndexArray mAttributesByLayout; |
Jamie Madill | 437d266 | 2014-12-05 14:23:35 -0500 | [diff] [blame] | 274 | |
Geoff Lang | 7dd2e10 | 2014-11-10 15:19:26 -0500 | [diff] [blame] | 275 | unsigned int mSerial; |
| 276 | |
Jamie Madill | 03260fa | 2015-06-22 13:57:22 -0400 | [diff] [blame] | 277 | std::vector<GLint> mVertexUBOCache; |
| 278 | std::vector<GLint> mFragmentUBOCache; |
Jamie Madill | d3dfda2 | 2015-07-06 08:28:49 -0400 | [diff] [blame] | 279 | VertexExecutable::Signature mCachedVertexSignature; |
| 280 | gl::InputLayout mCachedInputLayout; |
Jamie Madill | 03260fa | 2015-06-22 13:57:22 -0400 | [diff] [blame] | 281 | |
Jamie Madill | ccdf74b | 2015-08-18 10:46:12 -0400 | [diff] [blame] | 282 | std::vector<gl::LinkedVarying> mTransformFeedbackLinkedVaryings; |
Jamie Madill | 62d31cb | 2015-09-11 13:25:51 -0400 | [diff] [blame] | 283 | std::vector<D3DUniform *> mD3DUniforms; |
Jamie Madill | ccdf74b | 2015-08-18 10:46:12 -0400 | [diff] [blame] | 284 | |
Geoff Lang | 7dd2e10 | 2014-11-10 15:19:26 -0500 | [diff] [blame] | 285 | static unsigned int issueSerial(); |
| 286 | static unsigned int mCurrentSerial; |
Brandon Jones | c9610c5 | 2014-08-25 17:02:59 -0700 | [diff] [blame] | 287 | }; |
| 288 | |
| 289 | } |
| 290 | |
Geoff Lang | 0a73dd8 | 2014-11-19 16:18:08 -0500 | [diff] [blame] | 291 | #endif // LIBANGLE_RENDERER_D3D_PROGRAMD3D_H_ |