Edit

kc3-lang/angle/src/libANGLE/Uniform.h

Branch :

  • Show log

    Commit

  • Author : Jamie Madill
    Date : 2015-09-11 13:25:51
    Hash : 62d31cb6
    Message : Re^6-land "Move Uniform and UBO info to the gl::Program layer." This data was previously stored entirely in the Impl level. Move as much as possible to the GL level, using a read-only view in the Impl level. Some information in D3D-specific, and should be stored separately in the Impl. This patch has a lot of refactoring that splits the D3D and GL info, and moves as much validation as possible to the GL layer, where it is shared between the back-ends. Re-land with fix for dEQP unused uniforms. The fix involves storing a local copy of all uniform data in the GL layer. This will also let us validate sampler indexes during draw calls at the GL layer. Re-re-land with a fix for multiply defined symbols on Clang. Re-re-re-land with a fix for boolean uniforms and Uniform{1234}f. Re^4-land with a fix for boolean uniform arrays and UBO uniforms. Re^5-land with a fix for a test warning on Linux. Re^6-land with a fix for transposed matrix uniform arrays. BUG=angleproject:1123 TEST=end2end_tests, bots, dEQP GLES3.ubo and GLES2.uniform_api Change-Id: Ie6fcde1c16eb05d67191b629338b88302a2563f5 Reviewed-on: https://chromium-review.googlesource.com/298971 Tryjob-Request: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>

  • src/libANGLE/Uniform.h
  • //
    // Copyright (c) 2010-2013 The ANGLE Project Authors. All rights reserved.
    // Use of this source code is governed by a BSD-style license that can be
    // found in the LICENSE file.
    //
    
    #ifndef LIBANGLE_UNIFORM_H_
    #define LIBANGLE_UNIFORM_H_
    
    #include <string>
    #include <vector>
    
    #include "angle_gl.h"
    #include "common/debug.h"
    #include "common/MemoryBuffer.h"
    #include "compiler/translator/blocklayout.h"
    #include "libANGLE/angletypes.h"
    
    namespace gl
    {
    
    // Helper struct representing a single shader uniform
    struct LinkedUniform : public sh::Uniform
    {
        LinkedUniform();
        LinkedUniform(GLenum type, GLenum precision, const std::string &name, unsigned int arraySize, const int blockIndex, const sh::BlockMemberInfo &blockInfo);
        LinkedUniform(const sh::Uniform &uniform);
        LinkedUniform(const LinkedUniform &uniform);
        LinkedUniform &operator=(const LinkedUniform &uniform);
        ~LinkedUniform();
    
        size_t dataSize() const;
        uint8_t *data();
        const uint8_t *data() const;
        bool isSampler() const;
        bool isInDefaultBlock() const;
        bool isField() const;
        size_t getElementSize() const;
        uint8_t *getDataPtrToElement(size_t elementIndex);
        const uint8_t *getDataPtrToElement(size_t elementIndex) const;
    
        int blockIndex;
        sh::BlockMemberInfo blockInfo;
    
      private:
        mutable rx::MemoryBuffer mLazyData;
    };
    
    // Helper struct representing a single shader uniform block
    struct UniformBlock
    {
        UniformBlock();
        UniformBlock(const std::string &nameIn, bool isArrayIn, unsigned int arrayElementIn);
        UniformBlock(const UniformBlock &other) = default;
        UniformBlock &operator=(const UniformBlock &other) = default;
    
        std::string name;
        bool isArray;
        unsigned int arrayElement;
        unsigned int dataSize;
    
        bool vertexStaticUse;
        bool fragmentStaticUse;
    
        std::vector<unsigned int> memberUniformIndexes;
    
        unsigned int psRegisterIndex;
        unsigned int vsRegisterIndex;
    };
    
    }
    
    #endif   // LIBANGLE_UNIFORM_H_