summaryrefslogtreecommitdiffstats
path: root/tools/gfx/vulkan/render-vk.cpp
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2021-07-28 12:24:12 -0700
committerGitHub <noreply@github.com>2021-07-28 12:24:12 -0700
commitc6f6ce12ec522b193b42bcd12d3a2540c7a6ff92 (patch)
treed5f77aa02df88c71ef4f898db40434bf4c1f3010 /tools/gfx/vulkan/render-vk.cpp
parent23d406f8a3b325f91fecd9ad52bd510ded5f49a7 (diff)
Experimental DXR1.0 support in gfx. (#1915)
* Experimental DXR1.0 support in gfx. - Add `dispatchRays` command. - Add `createRayTracingPipelineState` method to construct a D3D ray tracing state object from a linked slang program and user specified shader table. Limitations/simplifications: no local root signature support, shader table entries contains only shader identifiers and is specified at pipeline creation time, owned by the pipeline state object. * Root object binding for raytracing pipelines. * `maybeSpecializePipeline` implementation for raytracing pipelines. * Add ray-tracing-pipeline example. * Fixes. * Update README.md * Update comments on the lifespan of specialized pipelines Co-authored-by: Yong He <yhe@nvidia.com> Co-authored-by: jsmall-nvidia <jsmall@nvidia.com>
Diffstat (limited to 'tools/gfx/vulkan/render-vk.cpp')
-rw-r--r--tools/gfx/vulkan/render-vk.cpp27
1 files changed, 23 insertions, 4 deletions
diff --git a/tools/gfx/vulkan/render-vk.cpp b/tools/gfx/vulkan/render-vk.cpp
index bc0271aa6..592cbaac1 100644
--- a/tools/gfx/vulkan/render-vk.cpp
+++ b/tools/gfx/vulkan/render-vk.cpp
@@ -1266,7 +1266,7 @@ public:
vkPushConstantRange.size = ordinaryDataSize;
vkPushConstantRange.stageFlags = VK_SHADER_STAGE_ALL; // TODO: be more clever
- while(m_ownPushConstantRanges.getCount() <= pushConstantRangeIndex)
+ while((uint32_t)m_ownPushConstantRanges.getCount() <= pushConstantRangeIndex)
{
VkPushConstantRange emptyRange = { 0 };
m_ownPushConstantRanges.add(emptyRange);
@@ -2995,7 +2995,7 @@ public:
case slang::BindingType::ConstantBuffer:
{
BindingOffset objOffset = rangeOffset;
- for (uint32_t i = 0; i < count; ++i)
+ for (Index i = 0; i < count; ++i)
{
// Binding a constant buffer sub-object is simple enough:
// we just call `bindAsConstantBuffer` on it to bind
@@ -3016,7 +3016,7 @@ public:
case slang::BindingType::ParameterBlock:
{
BindingOffset objOffset = rangeOffset;
- for (uint32_t i = 0; i < count; ++i)
+ for (Index i = 0; i < count; ++i)
{
// The case for `ParameterBlock<X>` is not that different
// from `ConstantBuffer<X>`, except that we call `bindAsParameterBlock`
@@ -3047,7 +3047,7 @@ public:
//
SimpleBindingOffset objOffset = rangeOffset.pending;
SimpleBindingOffset objStride = rangeStride.pending;
- for (uint32_t i = 0; i < count; ++i)
+ for (Index i = 0; i < count; ++i)
{
// An existential-type sub-object is always bound just as a value,
// which handles its nested bindings and descriptor sets, but
@@ -4258,6 +4258,25 @@ public:
_memoryBarrier(count, structures, srcAccess, destAccess);
}
+ virtual SLANG_NO_THROW void SLANG_MCALL
+ bindPipeline(IPipelineState* pipeline, IShaderObject** outRootObject) override
+ {
+ SLANG_UNUSED(pipeline);
+ SLANG_UNUSED(outRootObject);
+ }
+
+ virtual SLANG_NO_THROW void SLANG_MCALL dispatchRays(
+ const char* rayGenShaderName,
+ int32_t width,
+ int32_t height,
+ int32_t depth) override
+ {
+ SLANG_UNUSED(rayGenShaderName);
+ SLANG_UNUSED(width);
+ SLANG_UNUSED(height);
+ SLANG_UNUSED(depth);
+ }
+
virtual SLANG_NO_THROW void SLANG_MCALL endEncoding() override
{
}