From 1c99a986ae12a3f1ce4cee86191052183d37208a Mon Sep 17 00:00:00 2001 From: Yong He Date: Thu, 9 Dec 2021 10:46:41 -0800 Subject: Remove `PipelineType` from gfx header. (#2051) Co-authored-by: Yong He --- tools/gfx/vulkan/render-vk.cpp | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) (limited to 'tools/gfx/vulkan/render-vk.cpp') 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 m_device; - PipelineType m_pipelineType; - Array m_stageCreateInfos; Array, 8> m_codeBlobs; //< To keep storage of code in scope Array m_modules; @@ -4033,8 +4030,7 @@ public: void prepareDraw() { auto pipeline = static_cast(m_currentPipeline.Ptr()); - if (!pipeline || static_cast(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(m_currentPipeline.Ptr()); - if (!pipeline || - static_cast(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 shaderProgram = new ShaderProgramImpl(this, desc.pipelineType); - shaderProgram->m_pipelineType = desc.pipelineType; + RefPtr shaderProgram = new ShaderProgramImpl(this); shaderProgram->slangProgram = desc.slangProgram; m_deviceObjectsWithPotentialBackReferences.add(shaderProgram); -- cgit v1.2.3