diff options
Diffstat (limited to 'src/3rdparty/angle/src/libANGLE/renderer/d3d/VertexDataManager.h')
-rw-r--r-- | src/3rdparty/angle/src/libANGLE/renderer/d3d/VertexDataManager.h | 57 |
1 files changed, 35 insertions, 22 deletions
diff --git a/src/3rdparty/angle/src/libANGLE/renderer/d3d/VertexDataManager.h b/src/3rdparty/angle/src/libANGLE/renderer/d3d/VertexDataManager.h index 898ed340b8..fb349c4cc2 100644 --- a/src/3rdparty/angle/src/libANGLE/renderer/d3d/VertexDataManager.h +++ b/src/3rdparty/angle/src/libANGLE/renderer/d3d/VertexDataManager.h @@ -30,9 +30,18 @@ class VertexBuffer; struct TranslatedAttribute { - TranslatedAttribute() : active(false), attribute(NULL), currentValueType(GL_NONE), - offset(0), stride(0), vertexBuffer(NULL), storage(NULL), - serial(0), divisor(0) {}; + TranslatedAttribute() + : active(false), + attribute(NULL), + currentValueType(GL_NONE), + offset(0), + stride(0), + vertexBuffer(NULL), + storage(NULL), + serial(0), + divisor(0) + {} + bool active; const gl::VertexAttribute *attribute; @@ -52,42 +61,46 @@ class VertexDataManager : angle::NonCopyable VertexDataManager(BufferFactoryD3D *factory); virtual ~VertexDataManager(); - gl::Error prepareVertexData(const gl::State &state, GLint start, GLsizei count, - TranslatedAttribute *outAttribs, GLsizei instances); + gl::Error prepareVertexData(const gl::State &state, + GLint start, + GLsizei count, + std::vector<TranslatedAttribute> *translatedAttribs, + GLsizei instances); private: - gl::Error reserveSpaceForAttrib(const gl::VertexAttribute &attrib, - const gl::VertexAttribCurrentValueData ¤tValue, + struct CurrentValueState + { + CurrentValueState(); + ~CurrentValueState(); + + StreamingVertexBufferInterface *buffer; + gl::VertexAttribCurrentValueData data; + size_t offset; + }; + + gl::Error reserveSpaceForAttrib(const TranslatedAttribute &translatedAttrib, GLsizei count, GLsizei instances) const; - void invalidateMatchingStaticData(const gl::VertexAttribute &attrib, - const gl::VertexAttribCurrentValueData ¤tValue) const; - - gl::Error storeAttribute(const gl::VertexAttribute &attrib, - const gl::VertexAttribCurrentValueData ¤tValue, - TranslatedAttribute *translated, + gl::Error storeAttribute(TranslatedAttribute *translated, GLint start, GLsizei count, GLsizei instances); - gl::Error storeCurrentValue(const gl::VertexAttribute &attrib, - const gl::VertexAttribCurrentValueData ¤tValue, + gl::Error storeCurrentValue(const gl::VertexAttribCurrentValueData ¤tValue, TranslatedAttribute *translated, - gl::VertexAttribCurrentValueData *cachedValue, - size_t *cachedOffset, - StreamingVertexBufferInterface *buffer); + CurrentValueState *cachedState); void hintUnmapAllResources(const std::vector<gl::VertexAttribute> &vertexAttributes); BufferFactoryD3D *const mFactory; StreamingVertexBufferInterface *mStreamingBuffer; + std::vector<CurrentValueState> mCurrentValueCache; - gl::VertexAttribCurrentValueData mCurrentValue[gl::MAX_VERTEX_ATTRIBS]; - - StreamingVertexBufferInterface *mCurrentValueBuffer[gl::MAX_VERTEX_ATTRIBS]; - std::size_t mCurrentValueOffsets[gl::MAX_VERTEX_ATTRIBS]; + // Cache variables + std::vector<TranslatedAttribute *> mActiveEnabledAttributes; + std::vector<size_t> mActiveDisabledAttributes; }; } |