• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //
2 // Copyright 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 
9 #ifndef LIBANGLE_RENDERER_D3D_PROGRAMD3D_H_
10 #define LIBANGLE_RENDERER_D3D_PROGRAMD3D_H_
11 
12 #include <string>
13 #include <vector>
14 
15 #include "compiler/translator/hlsl/blocklayoutHLSL.h"
16 #include "libANGLE/Constants.h"
17 #include "libANGLE/formatutils.h"
18 #include "libANGLE/renderer/ProgramImpl.h"
19 #include "libANGLE/renderer/d3d/DynamicHLSL.h"
20 #include "libANGLE/renderer/d3d/RendererD3D.h"
21 #include "platform/autogen/FeaturesD3D_autogen.h"
22 
23 namespace rx
24 {
25 class RendererD3D;
26 class UniformStorageD3D;
27 class ShaderExecutableD3D;
28 
29 #if !defined(ANGLE_COMPILE_OPTIMIZATION_LEVEL)
30 // WARNING: D3DCOMPILE_OPTIMIZATION_LEVEL3 may lead to a DX9 shader compiler hang.
31 // It should only be used selectively to work around specific bugs.
32 #    define ANGLE_COMPILE_OPTIMIZATION_LEVEL D3DCOMPILE_OPTIMIZATION_LEVEL1
33 #endif
34 
35 enum class HLSLRegisterType : uint8_t
36 {
37     None                = 0,
38     Texture             = 1,
39     UnorderedAccessView = 2
40 };
41 
42 // Helper struct representing a single shader uniform
43 // TODO(jmadill): Make uniform blocks shared between all programs, so we don't need separate
44 // register indices.
45 struct D3DUniform : private angle::NonCopyable
46 {
47     D3DUniform(GLenum type,
48                HLSLRegisterType reg,
49                const std::string &nameIn,
50                const std::vector<unsigned int> &arraySizesIn,
51                bool defaultBlock);
52     ~D3DUniform();
53 
54     bool isSampler() const;
55     bool isImage() const;
56     bool isImage2D() const;
isArrayD3DUniform57     bool isArray() const { return !arraySizes.empty(); }
58     unsigned int getArraySizeProduct() const;
59     bool isReferencedByShader(gl::ShaderType shaderType) const;
60 
61     const uint8_t *firstNonNullData() const;
62     const uint8_t *getDataPtrToElement(size_t elementIndex) const;
63 
64     // Duplicated from the GL layer
65     const gl::UniformTypeInfo &typeInfo;
66     std::string name;  // Names of arrays don't include [0], unlike at the GL layer.
67     std::vector<unsigned int> arraySizes;
68 
69     // Pointer to a system copies of the data. Separate pointers for each uniform storage type.
70     gl::ShaderMap<uint8_t *> mShaderData;
71 
72     // Register information.
73     HLSLRegisterType regType;
74     gl::ShaderMap<unsigned int> mShaderRegisterIndexes;
75     unsigned int registerCount;
76 
77     // Register "elements" are used for uniform structs in ES3, to appropriately identify single
78     // uniforms
79     // inside aggregate types, which are packed according C-like structure rules.
80     unsigned int registerElement;
81 
82     // Special buffer for sampler values.
83     std::vector<GLint> mSamplerData;
84 };
85 
86 struct D3DInterfaceBlock
87 {
88     D3DInterfaceBlock();
89     D3DInterfaceBlock(const D3DInterfaceBlock &other);
90 
activeInShaderD3DInterfaceBlock91     bool activeInShader(gl::ShaderType shaderType) const
92     {
93         return mShaderRegisterIndexes[shaderType] != GL_INVALID_INDEX;
94     }
95 
96     gl::ShaderMap<unsigned int> mShaderRegisterIndexes;
97 };
98 
99 struct D3DUniformBlock : D3DInterfaceBlock
100 {
101     D3DUniformBlock();
102     D3DUniformBlock(const D3DUniformBlock &other);
103 
104     gl::ShaderMap<bool> mUseStructuredBuffers;
105     gl::ShaderMap<unsigned int> mByteWidths;
106     gl::ShaderMap<unsigned int> mStructureByteStrides;
107 };
108 
109 struct ShaderStorageBlock
110 {
111     std::string name;
112     unsigned int arraySize     = 0;
113     unsigned int registerIndex = 0;
114 };
115 
116 struct D3DUBOCache
117 {
118     unsigned int registerIndex;
119     int binding;
120 };
121 
122 struct D3DUBOCacheUseSB : D3DUBOCache
123 {
124     unsigned int byteWidth;
125     unsigned int structureByteStride;
126 };
127 
128 struct D3DVarying final
129 {
130     D3DVarying();
131     D3DVarying(const std::string &semanticNameIn,
132                unsigned int semanticIndexIn,
133                unsigned int componentCountIn,
134                unsigned int outputSlotIn);
135 
136     D3DVarying(const D3DVarying &)            = default;
137     D3DVarying &operator=(const D3DVarying &) = default;
138 
139     std::string semanticName;
140     unsigned int semanticIndex;
141     unsigned int componentCount;
142     unsigned int outputSlot;
143 };
144 
145 class ProgramD3DMetadata final : angle::NonCopyable
146 {
147   public:
148     ProgramD3DMetadata(RendererD3D *renderer,
149                        const gl::ShaderMap<const ShaderD3D *> &attachedShaders,
150                        EGLenum clientType);
151     ~ProgramD3DMetadata();
152 
153     int getRendererMajorShaderModel() const;
154     bool usesBroadcast(const gl::State &data) const;
155     bool usesSecondaryColor() const;
156     bool usesPointCoord() const;
157     bool usesFragCoord() const;
158     bool usesPointSize() const;
159     bool usesInsertedPointCoordValue() const;
160     bool usesViewScale() const;
161     bool hasMultiviewEnabled() const;
162     bool usesVertexID() const;
163     bool usesViewID() const;
164     bool canSelectViewInVertexShader() const;
165     bool addsPointCoordToVertexShader() const;
166     bool usesTransformFeedbackGLPosition() const;
167     bool usesSystemValuePointSize() const;
168     bool usesMultipleFragmentOuts() const;
169     bool usesCustomOutVars() const;
170     bool usesSampleMask() const;
171     const ShaderD3D *getFragmentShader() const;
172     FragDepthUsage getFragDepthUsage() const;
173     uint8_t getClipDistanceArraySize() const;
174     uint8_t getCullDistanceArraySize() const;
175 
176   private:
177     const int mRendererMajorShaderModel;
178     const std::string mShaderModelSuffix;
179     const bool mUsesInstancedPointSpriteEmulation;
180     const bool mUsesViewScale;
181     const bool mCanSelectViewInVertexShader;
182     const gl::ShaderMap<const ShaderD3D *> mAttachedShaders;
183     const EGLenum mClientType;
184 };
185 
186 using D3DUniformMap = std::map<std::string, D3DUniform *>;
187 
188 class ProgramD3D : public ProgramImpl
189 {
190   public:
191     ProgramD3D(const gl::ProgramState &data, RendererD3D *renderer);
192     ~ProgramD3D() override;
193 
getPixelShaderKey()194     const std::vector<PixelShaderOutputVariable> &getPixelShaderKey() { return mPixelShaderKey; }
195 
196     GLint getSamplerMapping(gl::ShaderType type,
197                             unsigned int samplerIndex,
198                             const gl::Caps &caps) const;
199     gl::TextureType getSamplerTextureType(gl::ShaderType type, unsigned int samplerIndex) const;
200     gl::RangeUI getUsedSamplerRange(gl::ShaderType type) const;
201 
202     enum SamplerMapping
203     {
204         WasDirty,
205         WasClean,
206     };
207 
208     SamplerMapping updateSamplerMapping();
209 
210     GLint getImageMapping(gl::ShaderType type,
211                           unsigned int imageIndex,
212                           bool readonly,
213                           const gl::Caps &caps) const;
214     gl::RangeUI getUsedImageRange(gl::ShaderType type, bool readonly) const;
215 
usesPointSize()216     bool usesPointSize() const { return mUsesPointSize; }
217     bool usesPointSpriteEmulation() const;
218     bool usesGeometryShader(const gl::State &state, gl::PrimitiveMode drawMode) const;
219     bool usesGeometryShaderForPointSpriteEmulation() const;
220     bool usesGetDimensionsIgnoresBaseLevel() const;
221     bool usesInstancedPointSpriteEmulation() const;
222 
223     std::unique_ptr<LinkEvent> load(const gl::Context *context,
224                                     gl::BinaryInputStream *stream,
225                                     gl::InfoLog &infoLog) override;
226     void save(const gl::Context *context, gl::BinaryOutputStream *stream) override;
227     void setBinaryRetrievableHint(bool retrievable) override;
228     void setSeparable(bool separable) override;
229 
230     angle::Result getVertexExecutableForCachedInputLayout(d3d::Context *context,
231                                                           ShaderExecutableD3D **outExectuable,
232                                                           gl::InfoLog *infoLog);
233     angle::Result getGeometryExecutableForPrimitiveType(d3d::Context *errContext,
234                                                         const gl::State &state,
235                                                         gl::PrimitiveMode drawMode,
236                                                         ShaderExecutableD3D **outExecutable,
237                                                         gl::InfoLog *infoLog);
238     angle::Result getPixelExecutableForCachedOutputLayout(d3d::Context *context,
239                                                           ShaderExecutableD3D **outExectuable,
240                                                           gl::InfoLog *infoLog);
241     angle::Result getComputeExecutableForImage2DBindLayout(const gl::Context *glContext,
242                                                            d3d::Context *context,
243                                                            ShaderExecutableD3D **outExecutable,
244                                                            gl::InfoLog *infoLog);
245     std::unique_ptr<LinkEvent> link(const gl::Context *context,
246                                     const gl::ProgramLinkedResources &resources,
247                                     gl::InfoLog &infoLog,
248                                     const gl::ProgramMergedVaryings &mergedVaryings) override;
249     GLboolean validate(const gl::Caps &caps, gl::InfoLog *infoLog) override;
250 
251     void updateUniformBufferCache(const gl::Caps &caps);
252 
253     unsigned int getAtomicCounterBufferRegisterIndex(GLuint binding,
254                                                      gl::ShaderType shaderType) const;
255 
256     unsigned int getShaderStorageBufferRegisterIndex(GLuint blockIndex,
257                                                      gl::ShaderType shaderType) const;
258     const std::vector<D3DUBOCache> &getShaderUniformBufferCache(gl::ShaderType shaderType) const;
259     const std::vector<D3DUBOCacheUseSB> &getShaderUniformBufferCacheUseSB(
260         gl::ShaderType shaderType) const;
261 
262     void dirtyAllUniforms();
263 
264     void setUniform1fv(GLint location, GLsizei count, const GLfloat *v) override;
265     void setUniform2fv(GLint location, GLsizei count, const GLfloat *v) override;
266     void setUniform3fv(GLint location, GLsizei count, const GLfloat *v) override;
267     void setUniform4fv(GLint location, GLsizei count, const GLfloat *v) override;
268     void setUniform1iv(GLint location, GLsizei count, const GLint *v) override;
269     void setUniform2iv(GLint location, GLsizei count, const GLint *v) override;
270     void setUniform3iv(GLint location, GLsizei count, const GLint *v) override;
271     void setUniform4iv(GLint location, GLsizei count, const GLint *v) override;
272     void setUniform1uiv(GLint location, GLsizei count, const GLuint *v) override;
273     void setUniform2uiv(GLint location, GLsizei count, const GLuint *v) override;
274     void setUniform3uiv(GLint location, GLsizei count, const GLuint *v) override;
275     void setUniform4uiv(GLint location, GLsizei count, const GLuint *v) override;
276     void setUniformMatrix2fv(GLint location,
277                              GLsizei count,
278                              GLboolean transpose,
279                              const GLfloat *value) override;
280     void setUniformMatrix3fv(GLint location,
281                              GLsizei count,
282                              GLboolean transpose,
283                              const GLfloat *value) override;
284     void setUniformMatrix4fv(GLint location,
285                              GLsizei count,
286                              GLboolean transpose,
287                              const GLfloat *value) override;
288     void setUniformMatrix2x3fv(GLint location,
289                                GLsizei count,
290                                GLboolean transpose,
291                                const GLfloat *value) override;
292     void setUniformMatrix3x2fv(GLint location,
293                                GLsizei count,
294                                GLboolean transpose,
295                                const GLfloat *value) override;
296     void setUniformMatrix2x4fv(GLint location,
297                                GLsizei count,
298                                GLboolean transpose,
299                                const GLfloat *value) override;
300     void setUniformMatrix4x2fv(GLint location,
301                                GLsizei count,
302                                GLboolean transpose,
303                                const GLfloat *value) override;
304     void setUniformMatrix3x4fv(GLint location,
305                                GLsizei count,
306                                GLboolean transpose,
307                                const GLfloat *value) override;
308     void setUniformMatrix4x3fv(GLint location,
309                                GLsizei count,
310                                GLboolean transpose,
311                                const GLfloat *value) override;
312 
313     void getUniformfv(const gl::Context *context, GLint location, GLfloat *params) const override;
314     void getUniformiv(const gl::Context *context, GLint location, GLint *params) const override;
315     void getUniformuiv(const gl::Context *context, GLint location, GLuint *params) const override;
316 
getShaderUniformStorage(gl::ShaderType shaderType)317     UniformStorageD3D *getShaderUniformStorage(gl::ShaderType shaderType) const
318     {
319         return mShaderUniformStorages[shaderType].get();
320     }
321 
322     unsigned int getSerial() const;
323 
getAttribLocationToD3DSemantics()324     const AttribIndexArray &getAttribLocationToD3DSemantics() const
325     {
326         return mAttribLocationToD3DSemantic;
327     }
328 
329     void updateCachedInputLayout(UniqueSerial associatedSerial, const gl::State &state);
330     void updateCachedOutputLayout(const gl::Context *context, const gl::Framebuffer *framebuffer);
331     void updateCachedComputeImage2DBindLayout(const gl::Context *context);
332 
isSamplerMappingDirty()333     bool isSamplerMappingDirty() { return mDirtySamplerMapping; }
334 
335     // Checks if we need to recompile certain shaders.
336     bool hasVertexExecutableForCachedInputLayout();
337     bool hasGeometryExecutableForPrimitiveType(const gl::State &state, gl::PrimitiveMode drawMode);
338     bool hasPixelExecutableForCachedOutputLayout();
339     bool hasComputeExecutableForCachedImage2DBindLayout();
340 
anyShaderUniformsDirty()341     bool anyShaderUniformsDirty() const { return mShaderUniformsDirty.any(); }
342 
areShaderUniformsDirty(gl::ShaderType shaderType)343     bool areShaderUniformsDirty(gl::ShaderType shaderType) const
344     {
345         return mShaderUniformsDirty[shaderType];
346     }
getD3DUniforms()347     const std::vector<D3DUniform *> &getD3DUniforms() const { return mD3DUniforms; }
348     void markUniformsClean();
349 
getState()350     const gl::ProgramState &getState() const { return mState; }
351 
hasShaderStage(gl::ShaderType shaderType)352     bool hasShaderStage(gl::ShaderType shaderType) const
353     {
354         return mState.getExecutable().getLinkedShaderStages()[shaderType];
355     }
356 
357     void assignImage2DRegisters(gl::ShaderType shaderType,
358                                 unsigned int startImageIndex,
359                                 int startLogicalImageUnit,
360                                 bool readonly);
361     bool hasNamedUniform(const std::string &name);
362 
usesVertexID()363     bool usesVertexID() const { return mUsesVertexID; }
364 
365   private:
366     // These forward-declared tasks are used for multi-thread shader compiles.
367     class GetExecutableTask;
368     class GetVertexExecutableTask;
369     class GetPixelExecutableTask;
370     class GetGeometryExecutableTask;
371     class GetComputeExecutableTask;
372     class GraphicsProgramLinkEvent;
373     class ComputeProgramLinkEvent;
374 
375     class LoadBinaryTask;
376     class LoadBinaryLinkEvent;
377 
378     class VertexExecutable
379     {
380       public:
381         enum HLSLAttribType
382         {
383             FLOAT,
384             UNSIGNED_INT,
385             SIGNED_INT,
386         };
387 
388         typedef std::vector<HLSLAttribType> Signature;
389 
390         VertexExecutable(const gl::InputLayout &inputLayout,
391                          const Signature &signature,
392                          ShaderExecutableD3D *shaderExecutable);
393         ~VertexExecutable();
394 
395         bool matchesSignature(const Signature &signature) const;
396         static void getSignature(RendererD3D *renderer,
397                                  const gl::InputLayout &inputLayout,
398                                  Signature *signatureOut);
399 
inputs()400         const gl::InputLayout &inputs() const { return mInputs; }
signature()401         const Signature &signature() const { return mSignature; }
shaderExecutable()402         ShaderExecutableD3D *shaderExecutable() const { return mShaderExecutable; }
403 
404       private:
405         static HLSLAttribType GetAttribType(GLenum type);
406 
407         gl::InputLayout mInputs;
408         Signature mSignature;
409         ShaderExecutableD3D *mShaderExecutable;
410     };
411 
412     class PixelExecutable
413     {
414       public:
415         PixelExecutable(const std::vector<GLenum> &outputSignature,
416                         ShaderExecutableD3D *shaderExecutable);
417         ~PixelExecutable();
418 
matchesSignature(const std::vector<GLenum> & signature)419         bool matchesSignature(const std::vector<GLenum> &signature) const
420         {
421             return mOutputSignature == signature;
422         }
423 
outputSignature()424         const std::vector<GLenum> &outputSignature() const { return mOutputSignature; }
425 
shaderExecutable()426         ShaderExecutableD3D *shaderExecutable() const { return mShaderExecutable; }
427 
428       private:
429         const std::vector<GLenum> mOutputSignature;
430         ShaderExecutableD3D *mShaderExecutable;
431     };
432 
433     class ComputeExecutable
434     {
435       public:
436         ComputeExecutable(const gl::ImageUnitTextureTypeMap &signature,
437                           std::unique_ptr<ShaderExecutableD3D> shaderExecutable);
438         ~ComputeExecutable();
439 
matchesSignature(const gl::ImageUnitTextureTypeMap & signature)440         bool matchesSignature(const gl::ImageUnitTextureTypeMap &signature) const
441         {
442             return mSignature == signature;
443         }
444 
signature()445         const gl::ImageUnitTextureTypeMap &signature() const { return mSignature; }
shaderExecutable()446         ShaderExecutableD3D *shaderExecutable() const { return mShaderExecutable.get(); }
447 
448       private:
449         gl::ImageUnitTextureTypeMap mSignature;
450         std::unique_ptr<ShaderExecutableD3D> mShaderExecutable;
451     };
452 
453     struct Sampler
454     {
455         Sampler();
456 
457         bool active;
458         GLint logicalTextureUnit;
459         gl::TextureType textureType;
460     };
461 
462     struct Image
463     {
464         Image();
465         bool active;
466         GLint logicalImageUnit;
467     };
468 
469     void initializeUniformStorage(const gl::ShaderBitSet &availableShaderStages);
470 
471     void defineUniformsAndAssignRegisters(const gl::Context *context);
472     void defineUniformBase(const gl::Shader *shader,
473                            const sh::ShaderVariable &uniform,
474                            D3DUniformMap *uniformMap);
475     void assignAllSamplerRegisters();
476     void assignSamplerRegisters(size_t uniformIndex);
477 
478     static void AssignSamplers(unsigned int startSamplerIndex,
479                                const gl::UniformTypeInfo &typeInfo,
480                                unsigned int samplerCount,
481                                std::vector<Sampler> &outSamplers,
482                                gl::RangeUI *outUsedRange);
483 
484     void assignAllImageRegisters();
485     void assignAllAtomicCounterRegisters();
486     void assignImageRegisters(size_t uniformIndex);
487     static void AssignImages(unsigned int startImageIndex,
488                              int startLogicalImageUnit,
489                              unsigned int imageCount,
490                              std::vector<Image> &outImages,
491                              gl::RangeUI *outUsedRange);
492 
493     template <typename DestT>
494     void getUniformInternal(GLint location, DestT *dataOut) const;
495 
496     template <typename T>
497     void setUniformImpl(D3DUniform *targetUniform,
498                         const gl::VariableLocation &locationInfo,
499                         GLsizei count,
500                         const T *v,
501                         uint8_t *targetData,
502                         GLenum uniformType);
503 
504     template <typename T>
505     void setUniformInternal(GLint location, GLsizei count, const T *v, GLenum uniformType);
506 
507     template <int cols, int rows>
508     void setUniformMatrixfvInternal(GLint location,
509                                     GLsizei count,
510                                     GLboolean transpose,
511                                     const GLfloat *value);
512 
513     std::unique_ptr<LinkEvent> compileProgramExecutables(const gl::Context *context,
514                                                          gl::InfoLog &infoLog);
515     std::unique_ptr<LinkEvent> compileComputeExecutable(const gl::Context *context,
516                                                         gl::InfoLog &infoLog);
517 
518     angle::Result loadBinaryShaderExecutables(d3d::Context *contextD3D,
519                                               gl::BinaryInputStream *stream,
520                                               gl::InfoLog &infoLog);
521 
522     void gatherTransformFeedbackVaryings(const gl::VaryingPacking &varyings,
523                                          const BuiltinInfo &builtins);
524     D3DUniform *getD3DUniformFromLocation(GLint location);
525     const D3DUniform *getD3DUniformFromLocation(GLint location) const;
526 
527     void initAttribLocationsToD3DSemantic(const gl::Context *context);
528 
529     void reset();
530     void initializeUniformBlocks();
531     void initializeShaderStorageBlocks(const gl::Context *context);
532 
533     void updateCachedInputLayoutFromShader(const gl::Context *context);
534     void updateCachedOutputLayoutFromShader();
535     void updateCachedImage2DBindLayoutFromShader(gl::ShaderType shaderType);
536     void updateCachedVertexExecutableIndex();
537     void updateCachedPixelExecutableIndex();
538     void updateCachedComputeExecutableIndex();
539 
540     void linkResources(const gl::Context *context, const gl::ProgramLinkedResources &resources);
541 
542     RendererD3D *mRenderer;
543     DynamicHLSL *mDynamicHLSL;
544 
545     std::vector<std::unique_ptr<VertexExecutable>> mVertexExecutables;
546     std::vector<std::unique_ptr<PixelExecutable>> mPixelExecutables;
547     angle::PackedEnumMap<gl::PrimitiveMode, std::unique_ptr<ShaderExecutableD3D>>
548         mGeometryExecutables;
549     std::vector<std::unique_ptr<ComputeExecutable>> mComputeExecutables;
550 
551     gl::ShaderMap<std::string> mShaderHLSL;
552     gl::ShaderMap<CompilerWorkaroundsD3D> mShaderWorkarounds;
553 
554     FragDepthUsage mFragDepthUsage;
555     bool mUsesSampleMask;
556     bool mHasMultiviewEnabled;
557     bool mUsesVertexID;
558     bool mUsesViewID;
559     std::vector<PixelShaderOutputVariable> mPixelShaderKey;
560 
561     // Common code for all dynamic geometry shaders. Consists mainly of the GS input and output
562     // structures, built from the linked varying info. We store the string itself instead of the
563     // packed varyings for simplicity.
564     std::string mGeometryShaderPreamble;
565 
566     bool mUsesPointSize;
567     bool mUsesFlatInterpolation;
568 
569     gl::ShaderMap<std::unique_ptr<UniformStorageD3D>> mShaderUniformStorages;
570 
571     gl::ShaderMap<std::vector<Sampler>> mShaderSamplers;
572     gl::ShaderMap<gl::RangeUI> mUsedShaderSamplerRanges;
573     bool mDirtySamplerMapping;
574 
575     gl::ShaderMap<std::vector<Image>> mImages;
576     gl::ShaderMap<std::vector<Image>> mReadonlyImages;
577     gl::ShaderMap<gl::RangeUI> mUsedImageRange;
578     gl::ShaderMap<gl::RangeUI> mUsedReadonlyImageRange;
579     gl::ShaderMap<gl::RangeUI> mUsedAtomicCounterRange;
580 
581     // Cache for pixel shader output layout to save reallocations.
582     std::vector<GLenum> mPixelShaderOutputLayoutCache;
583     Optional<size_t> mCachedPixelExecutableIndex;
584 
585     AttribIndexArray mAttribLocationToD3DSemantic;
586 
587     unsigned int mSerial;
588 
589     gl::ShaderMap<std::vector<D3DUBOCache>> mShaderUBOCaches;
590     gl::ShaderMap<std::vector<D3DUBOCacheUseSB>> mShaderUBOCachesUseSB;
591     VertexExecutable::Signature mCachedVertexSignature;
592     gl::InputLayout mCachedInputLayout;
593     Optional<size_t> mCachedVertexExecutableIndex;
594 
595     std::vector<D3DVarying> mStreamOutVaryings;
596     std::vector<D3DUniform *> mD3DUniforms;
597     std::map<std::string, int> mImageBindingMap;
598     std::map<std::string, int> mAtomicBindingMap;
599     std::vector<D3DUniformBlock> mD3DUniformBlocks;
600     std::vector<D3DInterfaceBlock> mD3DShaderStorageBlocks;
601     gl::ShaderMap<std::vector<ShaderStorageBlock>> mShaderStorageBlocks;
602     std::array<unsigned int, gl::IMPLEMENTATION_MAX_ATOMIC_COUNTER_BUFFER_BINDINGS>
603         mComputeAtomicCounterBufferRegisterIndices;
604 
605     gl::ShaderMap<std::vector<sh::ShaderVariable>> mImage2DUniforms;
606     gl::ShaderMap<gl::ImageUnitTextureTypeMap> mImage2DBindLayoutCache;
607     Optional<size_t> mCachedComputeExecutableIndex;
608 
609     gl::ShaderBitSet mShaderUniformsDirty;
610 
611     static unsigned int issueSerial();
612     static unsigned int mCurrentSerial;
613 
614     UniqueSerial mCurrentVertexArrayStateSerial;
615 };
616 }  // namespace rx
617 
618 #endif  // LIBANGLE_RENDERER_D3D_PROGRAMD3D_H_
619