Edit

kc3-lang/angle/src/libANGLE/renderer/d3d/TextureStorage.h

Branch :

  • Show log

    Commit

  • Author : Gregoire Payen de La Garanderie
    Date : 2015-04-14 11:11:12
    Hash : 752ce192
    Message : D3D11: Use DX generateMips to generate mipmaps whenever possible. BUG=angleproject:974 Change-Id: I95937fe7a0833de77c52f838ebb3ecba55dfbf8a Reviewed-on: https://chromium-review.googlesource.com/265640 Tested-by: Gregoire Payen de La Garanderie <Gregory.Payen@imgtec.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>

  • src/libANGLE/renderer/d3d/TextureStorage.h
  • //
    // Copyright (c) 2002-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.
    //
    
    // TextureStorage.h: Defines the abstract rx::TextureStorage class.
    
    #ifndef LIBANGLE_RENDERER_D3D_TEXTURESTORAGE_H_
    #define LIBANGLE_RENDERER_D3D_TEXTURESTORAGE_H_
    
    #include "libANGLE/Error.h"
    
    #include "common/debug.h"
    #include "libANGLE/Error.h"
    
    #include <GLES2/gl2.h>
    #include <stdint.h>
    
    namespace gl
    {
    struct ImageIndex;
    struct Box;
    struct PixelUnpackState;
    }
    
    namespace rx
    {
    class SwapChainD3D;
    class RenderTargetD3D;
    class ImageD3D;
    
    class TextureStorage : angle::NonCopyable
    {
      public:
        TextureStorage();
        virtual ~TextureStorage() {};
    
        virtual int getTopLevel() const = 0;
        virtual bool isRenderTarget() const = 0;
        virtual bool isManaged() const = 0;
        virtual bool supportsNativeMipmapFunction() const = 0;
        virtual int getLevelCount() const = 0;
    
        virtual gl::Error getRenderTarget(const gl::ImageIndex &index, RenderTargetD3D **outRT) = 0;
        virtual gl::Error generateMipmap(const gl::ImageIndex &sourceIndex, const gl::ImageIndex &destIndex) = 0;
    
        virtual gl::Error copyToStorage(TextureStorage *destStorage) = 0;
        virtual gl::Error setData(const gl::ImageIndex &index, ImageD3D *image, const gl::Box *destBox, GLenum type,
                                  const gl::PixelUnpackState &unpack, const uint8_t *pixelData) = 0;
    
        unsigned int getRenderTargetSerial(const gl::ImageIndex &index) const;
        unsigned int getTextureSerial() const;
    
        // This is a no-op for most implementations of TextureStorage. Some (e.g. TextureStorage11_2D) might override it.
        virtual gl::Error useLevelZeroWorkaroundTexture(bool useLevelZeroTexture) { return gl::Error(GL_NO_ERROR); }
    
      protected:
        void initializeSerials(unsigned int rtSerialsToReserve, unsigned int rtSerialsLayerStride);
    
      private:
        unsigned int mFirstRenderTargetSerial;
        unsigned int mRenderTargetSerialsLayerStride;
    };
    
    }
    
    #endif // LIBANGLE_RENDERER_D3D_TEXTURESTORAGE_H_