diff options
| author | skallweitNV <64953474+skallweitNV@users.noreply.github.com> | 2024-05-08 19:19:08 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-05-08 10:19:08 -0700 |
| commit | 93e5b718e8497a0a70eb14dffe120c9ca6d99fd8 (patch) | |
| tree | 61aba93a5d19ba74835129bd22b17bae652ee2de /tools/gfx/vulkan/vk-device.cpp | |
| parent | 4f2330d059ab5943ddf33bfed37be6a0378d43a8 (diff) | |
[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 <yonghe@outlook.com>
Diffstat (limited to 'tools/gfx/vulkan/vk-device.cpp')
| -rw-r--r-- | tools/gfx/vulkan/vk-device.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
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<ShaderObjectLayoutImpl*>(layout); - RefPtr<MutableShaderObjectImpl> result = new MutableShaderObjectImpl(); - SLANG_RETURN_ON_FAIL(result->init(this, layoutImpl)); + RefPtr<ShaderObjectImpl> 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<MutableRootShaderObject> result = - new MutableRootShaderObject(this, static_cast<ShaderProgramBase*>(program)); + RefPtr<MutableRootShaderObjectImpl> result = new MutableRootShaderObjectImpl(); + auto programImpl = static_cast<ShaderProgramImpl*>(program); + SLANG_RETURN_ON_FAIL(result->init(this, programImpl->m_rootObjectLayout)); returnComPtr(outObject, result); return SLANG_OK; } |
