From 59f3fdc0a372d19ce4e989514ee3e9ecbcbf234c Mon Sep 17 00:00:00 2001 From: lucy96chen <47800040+lucy96chen@users.noreply.github.com> Date: Wed, 9 Feb 2022 12:23:00 -0800 Subject: Added a simple test for getFormatSupportedResourceStates() (#2118) * Checkpoint * Fixed problem with global variables in supported resource states test, test is functional for both Vulkan and D3D12 * Removed a comment * Added a loop over all existing formats * Rerun tests --- slang-gfx.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'slang-gfx.h') diff --git a/slang-gfx.h b/slang-gfx.h index 3489dd398..37eb64935 100644 --- a/slang-gfx.h +++ b/slang-gfx.h @@ -418,6 +418,13 @@ public: add(states...); } + ResourceStateSet operator&(const ResourceStateSet& that) const + { + ResourceStateSet result; + result.m_bitFields = this->m_bitFields & that.m_bitFields; + return result; + } + private: uint64_t m_bitFields = 0; void add() {} @@ -1632,6 +1639,10 @@ public: ITextureResource* const* textures, ResourceState src, ResourceState dst) = 0; + void textureBarrier(ITextureResource* texture, ResourceState src, ResourceState dst) + { + textureBarrier(1, &texture, src, dst); + } virtual SLANG_NO_THROW void SLANG_MCALL textureSubresourceBarrier( ITextureResource* texture, SubresourceRange subresourceRange, @@ -1642,6 +1653,10 @@ public: IBufferResource* const* buffers, ResourceState src, ResourceState dst) = 0; + void bufferBarrier(IBufferResource* buffer, ResourceState src, ResourceState dst) + { + bufferBarrier(1, &buffer, src, dst); + } virtual SLANG_NO_THROW void SLANG_MCALL clearResourceView( IResourceView* view, ClearValue* clearValue, ClearResourceViewFlags::Enum flags) = 0; virtual SLANG_NO_THROW void SLANG_MCALL resolveResource( -- cgit v1.2.3