From e050035e0b7d3f257a46bc1cb644163026cb1b23 Mon Sep 17 00:00:00 2001 From: Yong He Date: Thu, 25 Mar 2021 09:41:53 -0700 Subject: Improve Vulkan shader-objects implementation. (#1765) * Improve Vulkan shader-objects implementation. 1. Null bindings no longer crashes. 2. No longer copies push constants to staging CPU buffer before setting it into command buffer. The entry-point shader object now directly sets it into command buffer upon `bindObject` call. * Update comments * Fix * Re-enable 3 tests. Improved vulkan implementation so that each shader object is responsible for creating descriptor sets on-demand. Fixed slang reflection to correctly report `ParameterBlock` binding. * Fix gcc compile error. --- examples/hello-world/main.cpp | 1 - examples/shader-object/main.cpp | 1 - examples/shader-toy/main.cpp | 1 - 3 files changed, 3 deletions(-) (limited to 'examples') diff --git a/examples/hello-world/main.cpp b/examples/hello-world/main.cpp index 023c16304..b3bee9c07 100644 --- a/examples/hello-world/main.cpp +++ b/examples/hello-world/main.cpp @@ -244,7 +244,6 @@ Slang::Result initialize() // platforms/APIs. // IDevice::Desc deviceDesc = {}; - deviceDesc.deviceType = DeviceType::Vulkan; gfx::Result res = gfxCreateDevice(&deviceDesc, gDevice.writeRef()); if(SLANG_FAILED(res)) return res; diff --git a/examples/shader-object/main.cpp b/examples/shader-object/main.cpp index 4945de27b..aaafc010a 100644 --- a/examples/shader-object/main.cpp +++ b/examples/shader-object/main.cpp @@ -136,7 +136,6 @@ int main() // interacting with the graphics API. Slang::ComPtr device; IDevice::Desc deviceDesc = {}; - deviceDesc.deviceType = DeviceType::Vulkan; SLANG_RETURN_ON_FAIL(gfxCreateDevice(&deviceDesc, device.writeRef())); // Now we can load the shader code. diff --git a/examples/shader-toy/main.cpp b/examples/shader-toy/main.cpp index 8e377b42f..c4424b294 100644 --- a/examples/shader-toy/main.cpp +++ b/examples/shader-toy/main.cpp @@ -315,7 +315,6 @@ Result initialize() gWindow->events.sizeChanged = Slang::Action<>(this, &ShaderToyApp::windowSizeChanged); IDevice::Desc deviceDesc; - deviceDesc.deviceType = DeviceType::Vulkan; Result res = gfxCreateDevice(&deviceDesc, gDevice.writeRef()); if(SLANG_FAILED(res)) return res; -- cgit v1.2.3