diff options
author | wolfbeast <mcwerewolf@gmail.com> | 2018-07-11 23:29:50 +0200 |
---|---|---|
committer | wolfbeast <mcwerewolf@gmail.com> | 2018-07-11 23:31:02 +0200 |
commit | 70dd5e7c66b1fe3f82e5b4db2406050baba15f05 (patch) | |
tree | 3f012200ef3c934f33db1a4ef2b790fae3141860 /gfx/angle/src/libANGLE/renderer/d3d/d3d11/TextureStorage11.h | |
parent | 3b7ffb477eec078c7036c92c6a51bb5de6de4f28 (diff) | |
parent | 8481fa25d246f1968d0a254ee3c6cdd82c60781a (diff) | |
download | UXP-70dd5e7c66b1fe3f82e5b4db2406050baba15f05.tar UXP-70dd5e7c66b1fe3f82e5b4db2406050baba15f05.tar.gz UXP-70dd5e7c66b1fe3f82e5b4db2406050baba15f05.tar.lz UXP-70dd5e7c66b1fe3f82e5b4db2406050baba15f05.tar.xz UXP-70dd5e7c66b1fe3f82e5b4db2406050baba15f05.zip |
Merge branch 'ANGLE-rollback'
This resolves #624
Note: Cherry-picked some fixes on top of the ANGLE version that we want to keep.
Diffstat (limited to 'gfx/angle/src/libANGLE/renderer/d3d/d3d11/TextureStorage11.h')
-rwxr-xr-x | gfx/angle/src/libANGLE/renderer/d3d/d3d11/TextureStorage11.h | 55 |
1 files changed, 20 insertions, 35 deletions
diff --git a/gfx/angle/src/libANGLE/renderer/d3d/d3d11/TextureStorage11.h b/gfx/angle/src/libANGLE/renderer/d3d/d3d11/TextureStorage11.h index 46eb8458b..8d968adb0 100755 --- a/gfx/angle/src/libANGLE/renderer/d3d/d3d11/TextureStorage11.h +++ b/gfx/angle/src/libANGLE/renderer/d3d/d3d11/TextureStorage11.h @@ -59,8 +59,8 @@ class TextureStorage11 : public TextureStorage virtual UINT getSubresourceIndex(const gl::ImageIndex &index) const; gl::Error generateSwizzles(const gl::SwizzleState &swizzleTarget); - void markLevelDirty(int mipLevel); - void markDirty(); + void invalidateSwizzleCacheLevel(int mipLevel); + void invalidateSwizzleCache(); gl::Error updateSubresourceLevel(ID3D11Resource *texture, unsigned int sourceSubresource, const gl::ImageIndex &index, const gl::Box ©Area); @@ -94,10 +94,6 @@ class TextureStorage11 : public TextureStorage virtual gl::Error getSwizzleRenderTarget(int mipLevel, ID3D11RenderTargetView **outRTV) = 0; gl::Error getSRVLevel(int mipLevel, bool blitSRV, ID3D11ShaderResourceView **outSRV); - // Get a version of a depth texture with only depth information, not stencil. - virtual gl::Error createDropStencilTexture(); - gl::Error initDropStencilTexture(const gl::ImageIndexIterator &it); - // The baseLevel parameter should *not* have mTopLevel applied. virtual gl::Error createSRV(int baseLevel, int mipLevels, DXGI_FORMAT format, ID3D11Resource *texture, ID3D11ShaderResourceView **outSRV) const = 0; @@ -117,7 +113,6 @@ class TextureStorage11 : public TextureStorage unsigned int mTextureDepth; gl::SwizzleState mSwizzleCache[gl::IMPLEMENTATION_MAX_TEXTURE_LEVELS]; - ID3D11Texture2D *mDropStencilTexture; private: const UINT mBindFlags; @@ -125,14 +120,13 @@ class TextureStorage11 : public TextureStorage struct SRVKey { - SRVKey(int baseLevel, int mipLevels, bool swizzle, bool dropStencil); + SRVKey(int baseLevel = 0, int mipLevels = 0, bool swizzle = false); bool operator<(const SRVKey &rhs) const; - int baseLevel = 0; // Without mTopLevel applied. - int mipLevels = 0; - bool swizzle = false; - bool dropStencil = false; + int baseLevel; // Without mTopLevel applied. + int mipLevels; + bool swizzle; }; typedef std::map<SRVKey, ID3D11ShaderResourceView *> SRVCache; @@ -148,35 +142,30 @@ class TextureStorage11_2D : public TextureStorage11 public: TextureStorage11_2D(Renderer11 *renderer, SwapChain11 *swapchain); TextureStorage11_2D(Renderer11 *renderer, GLenum internalformat, bool renderTarget, GLsizei width, GLsizei height, int levels, bool hintLevelZeroOnly = false); - ~TextureStorage11_2D() override; + virtual ~TextureStorage11_2D(); - gl::Error getResource(ID3D11Resource **outResource) override; - gl::Error getMippedResource(ID3D11Resource **outResource) override; - gl::Error getRenderTarget(const gl::ImageIndex &index, RenderTargetD3D **outRT) override; + virtual gl::Error getResource(ID3D11Resource **outResource); + virtual gl::Error getMippedResource(ID3D11Resource **outResource); + virtual gl::Error getRenderTarget(const gl::ImageIndex &index, RenderTargetD3D **outRT); - gl::Error copyToStorage(TextureStorage *destStorage) override; + virtual gl::Error copyToStorage(TextureStorage *destStorage); - void associateImage(Image11 *image, const gl::ImageIndex &index) override; - void disassociateImage(const gl::ImageIndex &index, Image11 *expectedImage) override; - bool isAssociatedImageValid(const gl::ImageIndex &index, Image11 *expectedImage) override; - gl::Error releaseAssociatedImage(const gl::ImageIndex &index, Image11 *incomingImage) override; + virtual void associateImage(Image11* image, const gl::ImageIndex &index); + virtual void disassociateImage(const gl::ImageIndex &index, Image11* expectedImage); + virtual bool isAssociatedImageValid(const gl::ImageIndex &index, Image11* expectedImage); + virtual gl::Error releaseAssociatedImage(const gl::ImageIndex &index, Image11* incomingImage); - gl::Error useLevelZeroWorkaroundTexture(bool useLevelZeroTexture) override; + virtual gl::Error useLevelZeroWorkaroundTexture(bool useLevelZeroTexture); protected: - gl::Error getSwizzleTexture(ID3D11Resource **outTexture) override; - gl::Error getSwizzleRenderTarget(int mipLevel, ID3D11RenderTargetView **outRTV) override; - - gl::Error createDropStencilTexture() override; + virtual gl::Error getSwizzleTexture(ID3D11Resource **outTexture); + virtual gl::Error getSwizzleRenderTarget(int mipLevel, ID3D11RenderTargetView **outRTV); gl::Error ensureTextureExists(int mipLevels); private: - gl::Error createSRV(int baseLevel, - int mipLevels, - DXGI_FORMAT format, - ID3D11Resource *texture, - ID3D11ShaderResourceView **outSRV) const override; + virtual gl::Error createSRV(int baseLevel, int mipLevels, DXGI_FORMAT format, ID3D11Resource *texture, + ID3D11ShaderResourceView **outSRV) const; ID3D11Texture2D *mTexture; RenderTarget11 *mRenderTarget[gl::IMPLEMENTATION_MAX_TEXTURE_LEVELS]; @@ -312,8 +301,6 @@ class TextureStorage11_Cube : public TextureStorage11 virtual gl::Error getSwizzleTexture(ID3D11Resource **outTexture); virtual gl::Error getSwizzleRenderTarget(int mipLevel, ID3D11RenderTargetView **outRTV); - gl::Error createDropStencilTexture() override; - gl::Error ensureTextureExists(int mipLevels); private: @@ -397,8 +384,6 @@ class TextureStorage11_2DArray : public TextureStorage11 virtual gl::Error getSwizzleTexture(ID3D11Resource **outTexture); virtual gl::Error getSwizzleRenderTarget(int mipLevel, ID3D11RenderTargetView **outRTV); - gl::Error createDropStencilTexture() override; - private: virtual gl::Error createSRV(int baseLevel, int mipLevels, DXGI_FORMAT format, ID3D11Resource *texture, ID3D11ShaderResourceView **outSRV) const; |