summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--slang-gfx.h21
-rw-r--r--tools/gfx/cuda/render-cuda.cpp11
-rw-r--r--tools/gfx/d3d12/render-d3d12.cpp22
-rw-r--r--tools/gfx/debug-layer.cpp14
-rw-r--r--tools/gfx/debug-layer.h9
-rw-r--r--tools/gfx/immediate-renderer-base.cpp22
-rw-r--r--tools/gfx/vulkan/render-vk.cpp22
7 files changed, 121 insertions, 0 deletions
diff --git a/slang-gfx.h b/slang-gfx.h
index 2fa24f903..5171c91a9 100644
--- a/slang-gfx.h
+++ b/slang-gfx.h
@@ -1361,6 +1361,23 @@ struct IndirectDrawIndexedArguments
uint32_t StartInstanceLocation;
};
+struct SamplePosition
+{
+ int8_t x;
+ int8_t y;
+};
+
+struct ClearResourceViewFlags
+{
+ enum Enum : uint32_t
+ {
+ None = 0,
+ ClearDepth = 1,
+ ClearStencil = 2,
+ FloatClearValues = 4
+ };
+};
+
class IRenderCommandEncoder : public ICommandEncoder
{
public:
@@ -1423,6 +1440,8 @@ public:
IBufferResource* countBuffer,
uint64_t countOffset) = 0;
virtual SLANG_NO_THROW void SLANG_MCALL setStencilReference(uint32_t referenceValue) = 0;
+ virtual SLANG_NO_THROW Result SLANG_MCALL setSamplePositions(
+ uint32_t samplesPerPixel, uint32_t pixelCount, const SamplePosition* samplePositions) = 0;
};
class IComputeCommandEncoder : public ICommandEncoder
@@ -1483,6 +1502,8 @@ public:
IBufferResource* const* buffers,
ResourceState src,
ResourceState dst) = 0;
+ virtual SLANG_NO_THROW void SLANG_MCALL clearResourceView(
+ IResourceView* view, ClearValue* clearValue, ClearResourceViewFlags::Enum flags) = 0;
};
enum class AccelerationStructureCopyMode
diff --git a/tools/gfx/cuda/render-cuda.cpp b/tools/gfx/cuda/render-cuda.cpp
index e9a9960ad..020cd82f2 100644
--- a/tools/gfx/cuda/render-cuda.cpp
+++ b/tools/gfx/cuda/render-cuda.cpp
@@ -1066,6 +1066,17 @@ public:
SLANG_UNUSED(subResourceDataCount);
SLANG_UNIMPLEMENTED_X("uploadTextureData");
}
+
+ virtual SLANG_NO_THROW void SLANG_MCALL clearResourceView(
+ IResourceView* view,
+ ClearValue* clearValue,
+ ClearResourceViewFlags::Enum flags) override
+ {
+ SLANG_UNUSED(view);
+ SLANG_UNUSED(clearValue);
+ SLANG_UNUSED(flags);
+ SLANG_UNIMPLEMENTED_X("clearResourceView");
+ }
};
ResourceCommandEncoderImpl m_resourceCommandEncoder;
diff --git a/tools/gfx/d3d12/render-d3d12.cpp b/tools/gfx/d3d12/render-d3d12.cpp
index bbe7e4bdc..029aee4c6 100644
--- a/tools/gfx/d3d12/render-d3d12.cpp
+++ b/tools/gfx/d3d12/render-d3d12.cpp
@@ -3400,6 +3400,17 @@ public:
SLANG_UNUSED(countOffset);
SLANG_UNIMPLEMENTED_X("drawIndirect");
}
+
+ virtual SLANG_NO_THROW Result SLANG_MCALL setSamplePositions(
+ uint32_t samplesPerPixel,
+ uint32_t pixelCount,
+ const SamplePosition* samplePositions) override
+ {
+ SLANG_UNUSED(samplesPerPixel);
+ SLANG_UNUSED(pixelCount);
+ SLANG_UNUSED(samplePositions);
+ SLANG_UNIMPLEMENTED_X("setSamplePositions");
+ }
};
RenderCommandEncoderImpl m_renderCommandEncoder;
@@ -3569,6 +3580,17 @@ public:
SLANG_UNUSED(subResourceDataCount);
SLANG_UNIMPLEMENTED_X("uploadTextureData");
}
+
+ virtual SLANG_NO_THROW void SLANG_MCALL clearResourceView(
+ IResourceView* view,
+ ClearValue* clearValue,
+ ClearResourceViewFlags::Enum flags) override
+ {
+ SLANG_UNUSED(view);
+ SLANG_UNUSED(clearValue);
+ SLANG_UNUSED(flags);
+ SLANG_UNIMPLEMENTED_X("clearResourceView");
+ }
};
ResourceCommandEncoderImpl m_resourceCommandEncoder;
diff --git a/tools/gfx/debug-layer.cpp b/tools/gfx/debug-layer.cpp
index 90997edda..5b4ee981c 100644
--- a/tools/gfx/debug-layer.cpp
+++ b/tools/gfx/debug-layer.cpp
@@ -1135,6 +1135,13 @@ void DebugRenderCommandEncoder::writeTimestamp(IQueryPool* pool, SlangInt index)
baseObject->writeTimestamp(static_cast<DebugQueryPool*>(pool)->baseObject, index);
}
+Result DebugRenderCommandEncoder::setSamplePositions(
+ uint32_t samplesPerPixel, uint32_t pixelCount, const SamplePosition* samplePositions)
+{
+ SLANG_GFX_API_FUNC;
+ return baseObject->setSamplePositions(samplesPerPixel, pixelCount, samplePositions);
+}
+
void DebugResourceCommandEncoder::endEncoding()
{
SLANG_GFX_API_FUNC;
@@ -1237,6 +1244,13 @@ void DebugResourceCommandEncoder::uploadTextureData(
getInnerObj(dst), subResourceRange, offset, extent, subResourceData, subResourceDataCount);
}
+void DebugResourceCommandEncoder::clearResourceView(
+ IResourceView* view, ClearValue* clearValue, ClearResourceViewFlags::Enum flags)
+{
+ SLANG_GFX_API_FUNC;
+ baseObject->clearResourceView(getInnerObj(view), clearValue, flags);
+}
+
void DebugRayTracingCommandEncoder::endEncoding()
{
SLANG_GFX_API_FUNC;
diff --git a/tools/gfx/debug-layer.h b/tools/gfx/debug-layer.h
index b7cb9e353..87f7b009d 100644
--- a/tools/gfx/debug-layer.h
+++ b/tools/gfx/debug-layer.h
@@ -357,6 +357,10 @@ public:
uint64_t countOffset) override;
virtual SLANG_NO_THROW void SLANG_MCALL setStencilReference(uint32_t referenceValue) override;
virtual SLANG_NO_THROW void SLANG_MCALL writeTimestamp(IQueryPool* pool, SlangInt index) override;
+ virtual SLANG_NO_THROW Result SLANG_MCALL setSamplePositions(
+ uint32_t samplesPerPixel,
+ uint32_t pixelCount,
+ const SamplePosition* samplePositions) override;
public:
DebugCommandBuffer* commandBuffer;
@@ -403,6 +407,11 @@ public:
ITextureResource::SubresourceData* subResourceData,
size_t subResourceDataCount) override;
+ virtual SLANG_NO_THROW void SLANG_MCALL clearResourceView(
+ IResourceView* view,
+ ClearValue* clearValue,
+ ClearResourceViewFlags::Enum flags) override;
+
public:
DebugCommandBuffer* commandBuffer;
bool isOpen = false;
diff --git a/tools/gfx/immediate-renderer-base.cpp b/tools/gfx/immediate-renderer-base.cpp
index 33a578a4f..95f683744 100644
--- a/tools/gfx/immediate-renderer-base.cpp
+++ b/tools/gfx/immediate-renderer-base.cpp
@@ -183,6 +183,17 @@ public:
SLANG_UNUSED(countOffset);
SLANG_UNIMPLEMENTED_X("ImmediateRenderBase::drawIndirect");
}
+
+ virtual SLANG_NO_THROW Result SLANG_MCALL setSamplePositions(
+ uint32_t samplesPerPixel,
+ uint32_t pixelCount,
+ const SamplePosition* samplePositions) override
+ {
+ SLANG_UNUSED(samplesPerPixel);
+ SLANG_UNUSED(pixelCount);
+ SLANG_UNUSED(samplePositions);
+ return SLANG_E_NOT_AVAILABLE;
+ }
};
RenderCommandEncoderImpl m_renderCommandEncoder;
@@ -335,6 +346,17 @@ public:
SLANG_UNUSED(subResourceDataCount);
SLANG_UNIMPLEMENTED_X("uploadTextureData");
}
+
+ virtual SLANG_NO_THROW void SLANG_MCALL clearResourceView(
+ IResourceView* view,
+ ClearValue* clearValue,
+ ClearResourceViewFlags::Enum flags) override
+ {
+ SLANG_UNUSED(view);
+ SLANG_UNUSED(clearValue);
+ SLANG_UNUSED(flags);
+ SLANG_UNIMPLEMENTED_X("clearResourceView");
+ }
};
ResourceCommandEncoderImpl m_resourceCommandEncoder;
diff --git a/tools/gfx/vulkan/render-vk.cpp b/tools/gfx/vulkan/render-vk.cpp
index 2a48e60d8..836e4e19e 100644
--- a/tools/gfx/vulkan/render-vk.cpp
+++ b/tools/gfx/vulkan/render-vk.cpp
@@ -3966,6 +3966,17 @@ public:
SLANG_UNUSED(countOffset);
SLANG_UNIMPLEMENTED_X("drawIndirect");
}
+
+ virtual SLANG_NO_THROW Result SLANG_MCALL setSamplePositions(
+ uint32_t samplesPerPixel,
+ uint32_t pixelCount,
+ const SamplePosition* samplePositions) override
+ {
+ SLANG_UNUSED(samplesPerPixel);
+ SLANG_UNUSED(pixelCount);
+ SLANG_UNUSED(samplePositions);
+ SLANG_UNIMPLEMENTED_X("setSamplePositions");
+ }
};
RefPtr<RenderCommandEncoder> m_renderCommandEncoder;
@@ -4333,6 +4344,17 @@ public:
SLANG_UNUSED(subResourceDataCount);
SLANG_UNIMPLEMENTED_X("uploadTextureData");
}
+
+ virtual SLANG_NO_THROW void SLANG_MCALL clearResourceView(
+ IResourceView* view,
+ ClearValue* clearValue,
+ ClearResourceViewFlags::Enum flags) override
+ {
+ SLANG_UNUSED(view);
+ SLANG_UNUSED(clearValue);
+ SLANG_UNUSED(flags);
+ SLANG_UNIMPLEMENTED_X("clearResourceView");
+ }
};
RefPtr<ResourceCommandEncoder> m_resourceCommandEncoder;