summaryrefslogtreecommitdiffstats
path: root/tools/gfx/immediate-renderer-base.cpp
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2021-03-24 13:57:55 -0700
committerGitHub <noreply@github.com>2021-03-24 13:57:55 -0700
commit98afb421f408aa8651afff3dba1b21fad71131fe (patch)
treea8610d12ac7d74a8772cb6ecdd810da8216baa67 /tools/gfx/immediate-renderer-base.cpp
parentd0f7b7f0ed1d0d1388ce944cd1ad906bbd9afb35 (diff)
Reimplement Vulkan shader objects. (#1764)
* Reimplement Vulkan shader objects. This change reimplements Vulkan shader objects in the `gfx` layer so that it is no longer layered on top of the `DescriptorSet` abstraction. Since this is the last implementation that uses `DescriptorSet`, the change also removes all `DescriptorSet` related API from public `gfx` interface. The Vulkan implementation now passes all test cases, but it still have two issues: 1. The PushConstant setting is not correct, this is because we don't seem to be able to get correct reflection data about the size of push constants for an entry-point. 2. The `shader-toy` example can't run on Vulkan, because it currently sets nullptr to `Texture` bindings, and this change doesn't properly handle setting resource to null in `ShaderObject`s yet. If we can use the `nullDescriptor` feature on vulkan, this implementation will be simple. However we still want to decide whether we want to use a Vulkan 1.2 feature for this. * Fix up
Diffstat (limited to 'tools/gfx/immediate-renderer-base.cpp')
-rw-r--r--tools/gfx/immediate-renderer-base.cpp23
1 files changed, 0 insertions, 23 deletions
diff --git a/tools/gfx/immediate-renderer-base.cpp b/tools/gfx/immediate-renderer-base.cpp
index 92daa19ef..9402f7834 100644
--- a/tools/gfx/immediate-renderer-base.cpp
+++ b/tools/gfx/immediate-renderer-base.cpp
@@ -110,14 +110,6 @@ public:
m_writer->bindRootShaderObject(PipelineType::Graphics, object);
}
- virtual SLANG_NO_THROW void SLANG_MCALL setDescriptorSet(
- IPipelineLayout* layout,
- UInt index,
- IDescriptorSet* descriptorSet) override
- {
- m_writer->setDescriptorSet(PipelineType::Graphics, layout, index, descriptorSet);
- }
-
virtual SLANG_NO_THROW void SLANG_MCALL
setViewports(uint32_t count, const Viewport* viewports) override
{
@@ -218,14 +210,6 @@ public:
m_writer->bindRootShaderObject(PipelineType::Compute, object);
}
- virtual SLANG_NO_THROW void SLANG_MCALL setDescriptorSet(
- IPipelineLayout* layout,
- UInt index,
- IDescriptorSet* descriptorSet) override
- {
- m_writer->setDescriptorSet(PipelineType::Compute, layout, index, descriptorSet);
- }
-
virtual SLANG_NO_THROW void SLANG_MCALL dispatchCompute(int x, int y, int z) override
{
m_writer->dispatchCompute(x, y, z);
@@ -310,13 +294,6 @@ public:
(PipelineType)cmd.operands[0],
m_writer.getObject<IShaderObject>(cmd.operands[1]));
break;
- case CommandName::SetDescriptorSet:
- m_renderer->setDescriptorSet(
- (gfx::PipelineType)cmd.operands[0],
- m_writer.getObject<IPipelineLayout>(cmd.operands[1]),
- (UInt)cmd.operands[2],
- m_writer.getObject<IDescriptorSet>(cmd.operands[3]));
- break;
case CommandName::SetFramebuffer:
m_renderer->setFramebuffer(m_writer.getObject<IFramebuffer>(cmd.operands[0]));
break;