diff options
| author | Yong He <yonghe@outlook.com> | 2021-12-09 10:46:41 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-12-09 10:46:41 -0800 |
| commit | 1c99a986ae12a3f1ce4cee86191052183d37208a (patch) | |
| tree | e9903d1e569badef813e3f5f33696683bd34f3b0 /tools/gfx/vulkan | |
| parent | 4ca37fea2829ad9c623b94d77bb0311f76ad0971 (diff) | |
Remove `PipelineType` from gfx header. (#2051)
Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'tools/gfx/vulkan')
| -rw-r--r-- | tools/gfx/vulkan/render-vk.cpp | 15 | ||||
| -rw-r--r-- | tools/gfx/vulkan/vk-util.cpp | 15 | ||||
| -rw-r--r-- | tools/gfx/vulkan/vk-util.h | 2 |
3 files changed, 4 insertions, 28 deletions
diff --git a/tools/gfx/vulkan/render-vk.cpp b/tools/gfx/vulkan/render-vk.cpp index f949742ea..c48faeb7b 100644 --- a/tools/gfx/vulkan/render-vk.cpp +++ b/tools/gfx/vulkan/render-vk.cpp @@ -2279,9 +2279,8 @@ public: class ShaderProgramImpl : public ShaderProgramBase { public: - ShaderProgramImpl(VKDevice* device, PipelineType pipelineType) + ShaderProgramImpl(VKDevice* device) : m_device(device) - , m_pipelineType(pipelineType) { for (auto& shaderModule : m_modules) shaderModule = VK_NULL_HANDLE; @@ -2306,8 +2305,6 @@ public: BreakableReference<VKDevice> m_device; - PipelineType m_pipelineType; - Array<VkPipelineShaderStageCreateInfo, 8> m_stageCreateInfos; Array<ComPtr<ISlangBlob>, 8> m_codeBlobs; //< To keep storage of code in scope Array<VkShaderModule, 8> m_modules; @@ -4033,8 +4030,7 @@ public: void prepareDraw() { auto pipeline = static_cast<PipelineStateImpl*>(m_currentPipeline.Ptr()); - if (!pipeline || static_cast<ShaderProgramImpl*>(pipeline->m_program.Ptr()) - ->m_pipelineType != PipelineType::Graphics) + if (!pipeline) { assert(!"Invalid render pipeline"); return; @@ -4195,9 +4191,7 @@ public: virtual SLANG_NO_THROW void SLANG_MCALL dispatchCompute(int x, int y, int z) override { auto pipeline = static_cast<PipelineStateImpl*>(m_currentPipeline.Ptr()); - if (!pipeline || - static_cast<ShaderProgramImpl*>(pipeline->m_program.Ptr())->m_pipelineType != - PipelineType::Compute) + if (!pipeline) { assert(!"Invalid compute pipeline"); return; @@ -7893,8 +7887,7 @@ static VkImageViewType _calcImageViewType(ITextureResource::Type type, const ITe Result VKDevice::createProgram(const IShaderProgram::Desc& desc, IShaderProgram** outProgram) { - RefPtr<ShaderProgramImpl> shaderProgram = new ShaderProgramImpl(this, desc.pipelineType); - shaderProgram->m_pipelineType = desc.pipelineType; + RefPtr<ShaderProgramImpl> shaderProgram = new ShaderProgramImpl(this); shaderProgram->slangProgram = desc.slangProgram; m_deviceObjectsWithPotentialBackReferences.add(shaderProgram); diff --git a/tools/gfx/vulkan/vk-util.cpp b/tools/gfx/vulkan/vk-util.cpp index 574e1b9c4..0f6dfaf32 100644 --- a/tools/gfx/vulkan/vk-util.cpp +++ b/tools/gfx/vulkan/vk-util.cpp @@ -148,21 +148,6 @@ VkShaderStageFlags VulkanUtil::getShaderStage(SlangStage stage) } } -VkPipelineBindPoint VulkanUtil::getPipelineBindPoint(PipelineType pipelineType) -{ - switch (pipelineType) - { - case gfx::PipelineType::Graphics: - return VK_PIPELINE_BIND_POINT_GRAPHICS; - case gfx::PipelineType::Compute: - return VK_PIPELINE_BIND_POINT_COMPUTE; - case gfx::PipelineType::RayTracing: - return VK_PIPELINE_BIND_POINT_RAY_TRACING_KHR; - default: - return VkPipelineBindPoint(-1); - } -} - VkImageLayout VulkanUtil::getImageLayoutFromState(ResourceState state) { switch (state) diff --git a/tools/gfx/vulkan/vk-util.h b/tools/gfx/vulkan/vk-util.h index 95f463a7a..cdf7bcc79 100644 --- a/tools/gfx/vulkan/vk-util.h +++ b/tools/gfx/vulkan/vk-util.h @@ -42,8 +42,6 @@ struct VulkanUtil static VkShaderStageFlags getShaderStage(SlangStage stage); - static VkPipelineBindPoint getPipelineBindPoint(PipelineType pipelineType); - static VkImageLayout getImageLayoutFromState(ResourceState state); static inline bool isDepthFormat(VkFormat format) |
