summaryrefslogtreecommitdiff
path: root/slang-gfx.h
diff options
context:
space:
mode:
authorlucy96chen <47800040+lucy96chen@users.noreply.github.com>2022-02-09 12:23:00 -0800
committerGitHub <noreply@github.com>2022-02-09 12:23:00 -0800
commit59f3fdc0a372d19ce4e989514ee3e9ecbcbf234c (patch)
tree5914b550bc689a252dd3dfde3651bfa5b915a70a /slang-gfx.h
parent160111a0e27c9325ddfc49a53fbb82d3c6f06c90 (diff)
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
Diffstat (limited to 'slang-gfx.h')
-rw-r--r--slang-gfx.h15
1 files changed, 15 insertions, 0 deletions
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(