From 93e5b718e8497a0a70eb14dffe120c9ca6d99fd8 Mon Sep 17 00:00:00 2001 From: skallweitNV <64953474+skallweitNV@users.noreply.github.com> Date: Wed, 8 May 2024 19:19:08 +0200 Subject: [gfx] Cache mutable root shader object in Vulkan (#4119) * fix comment * add caching of mutable root shader objects in vulkan * Fix. --------- Co-authored-by: Yong He --- tools/gfx/vulkan/vk-device.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'tools/gfx/vulkan/vk-device.cpp') diff --git a/tools/gfx/vulkan/vk-device.cpp b/tools/gfx/vulkan/vk-device.cpp index aac7631cb..b3124231d 100644 --- a/tools/gfx/vulkan/vk-device.cpp +++ b/tools/gfx/vulkan/vk-device.cpp @@ -2400,8 +2400,8 @@ Result DeviceImpl::createMutableShaderObject( { auto layoutImpl = static_cast(layout); - RefPtr result = new MutableShaderObjectImpl(); - SLANG_RETURN_ON_FAIL(result->init(this, layoutImpl)); + RefPtr result; + SLANG_RETURN_ON_FAIL(ShaderObjectImpl::create(this, layoutImpl, result.writeRef())); returnComPtr(outObject, result); return SLANG_OK; @@ -2409,8 +2409,9 @@ Result DeviceImpl::createMutableShaderObject( Result DeviceImpl::createMutableRootShaderObject(IShaderProgram* program, IShaderObject** outObject) { - RefPtr result = - new MutableRootShaderObject(this, static_cast(program)); + RefPtr result = new MutableRootShaderObjectImpl(); + auto programImpl = static_cast(program); + SLANG_RETURN_ON_FAIL(result->init(this, programImpl->m_rootObjectLayout)); returnComPtr(outObject, result); return SLANG_OK; } -- cgit v1.2.3