summaryrefslogtreecommitdiff
path: root/examples/gpu-printing/main.cpp
AgeCommit message (Collapse)Author
2025-01-07Add backtraces to examples (#5973)Anders Leino
* examples: Log stack trace on exceptions For now, this is only implemented on Windows. This helps to address #5520. * examples: Print log file if there is any * format code --------- Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com> Co-authored-by: Yong He <yonghe@outlook.com>
2024-11-13Correct include dir for libslang (#5539)Ellie Hermaszewska
This stops adding the repo root to the include path for anything linking with slang. This enabled a bunch of convenient includes, but might lead to confusing behavior for anyone including slang. Not to mention differences including it from an install vs source. Co-authored-by: Yong He <yonghe@outlook.com>
2024-10-29formatEllie Hermaszewska
* format * Minor test fixes * enable checking cpp format in ci
2024-08-30capture component type (#4967)kaizhangNV
* Refactor the IComponentType recording Refactor the `IComponentType` recording by creating a abstract class `IComponentTypeRecorder` to record all the methods of `IComponentType`, so that `ICompositeComponentType`, `IModule`, 'IEntryPoint', 'ITypeConformance' can share the same recording implementation. Capture the out IComponentType from linkWithOptions() link() specialize() renameEntryPoint() * fix bugs * Finish the unimeplemented functions in json consumer Fix the address print to use 64 bit hex. Fix the reference count issue when allocating new recorder object. * Disable few examples using reflection APIs * Add gpu-printing example into slang-test * Replace of using std::unique_ptr with RefPtr
2024-07-17Move the file public header files to `include` dir (#4636)kaizhangNV
* Move the file public header files to `include` dir Close the issue (#4635). Move the following headers files to a `include` dir located at root dir of slang repo: slang-com-helper.h -> include/slang-com-helper.h slang-com-ptr.h -> include/slang-com-ptr.h slang-gfx.h -> include/slang-gfx.h slang.h -> include/slang.h Change cmake/SlangTarget.cmake to add include path to every target, and change the source file to use "#include <slang.h>" to include the public headers. The source code update is by the script like follow: ``` fileNames_slang=$(grep -r "\".*slang\.h\"" source/ -l) for fileName in "${fileNames_slang[@]}" do echo "$fileName" sed -i "s/\".*slang\.h\"/\"slang\.h\"/" $fileName done ``` * Fix the test issues * Fix cpu test issues by adding include seach path * Update cmake to not add include path for every target Also change "#include <slang.h>" to "include "slang.h" " to make the coding style consistent with other slang code. * Change public include to private include for unit-test and slang-glslang
2024-07-01Resource searching for examples (#4518)venkataram-nv
2023-01-27Add ASAN support + fixes (#2614)skallweitNV
* Add ASAN support to premake * Fix StringRepresentation when ASAN is enabled * Fix deep recursion in slang-generate * Fix hello-world example * Fix gpu-printing example * Linux fix * Try fixing linux * Add missing include
2022-02-09Various fixes to gfx. (#2120)Yong He
* Various fixes to gfx. * Fix. * Fixes. * Fix. Co-authored-by: Yong He <yhe@nvidia.com>
2022-01-10Various fixes to gfx. (#2074)Yong He
* Various gfx fixes. * Fixup. Co-authored-by: Yong He <yhe@nvidia.com>
2022-01-04Buffer allocation backend. (#2045)ZanderMajercik
* removed initialization of upload resource for CPU visible buffers (D3D12, Vulkan) * reverted slang-gfx.h change * declared DescBase::hasCpuAccessFlag() const to make backend changes compile under gcc * commit before checking master branch * commit before merge * commit before checking master * commit before merging upstream * revert vulkan changes * commit before testing on master * commit before merge with master * reverted bad merge changes * reverted more bad merge changes in render-d3d12.cpp * reverted buffer transition in _uploadBufferData * implemented bufferBarrier() in render-d3d12.cpp * reverted uneccesary transition in createBuffer * create staging buffer even when AccessFlag::None passed to D3D11 createBufferResource * renamed AccessFlags to MemoryType Co-authored-by: Yong He <yonghe@outlook.com>
2021-12-09Remove `PipelineType` from gfx header. (#2051)Yong He
Co-authored-by: Yong He <yhe@nvidia.com>
2021-06-30[gfx] Add inline ray tracing support. (#1899)Yong He
2021-04-24Remove resource `Usage` from `gfx` interface. (#1813)Yong He
* Fix `model-viewer` crash when using Vulkan. Fixing an issue in shader object layout creation for to make sure a correct descriptor set layout is calculated for types that need an implicit constant buffer. * Fix formatting. * Fixes. * Fix memory leak in vulkan. * Remove resource `Usage` from `gfx` interface.
2021-04-05Transient root shader object. (#1782)Yong He
2021-03-31`gfx` explicit transient resource management. (#1774)Yong He
2021-03-24Reimplement Vulkan shader objects. (#1764)Yong He
* Reimplement Vulkan shader objects. This change reimplements Vulkan shader objects in the `gfx` layer so that it is no longer layered on top of the `DescriptorSet` abstraction. Since this is the last implementation that uses `DescriptorSet`, the change also removes all `DescriptorSet` related API from public `gfx` interface. The Vulkan implementation now passes all test cases, but it still have two issues: 1. The PushConstant setting is not correct, this is because we don't seem to be able to get correct reflection data about the size of push constants for an entry-point. 2. The `shader-toy` example can't run on Vulkan, because it currently sets nullptr to `Texture` bindings, and this change doesn't properly handle setting resource to null in `ShaderObject`s yet. If we can use the `nullDescriptor` feature on vulkan, this implementation will be simple. However we still want to decide whether we want to use a Vulkan 1.2 feature for this. * Fix up
2021-03-10Swapchain resize and rename to `IDevice` (#1741)Yong He
* Swapchain resize * Fix.
2021-03-08Refactor window library. (#1739)Yong He
* Refactor window library. * Fix project file * Fix warnings.
2021-03-04Refactor `gfx` to surface `CommandBuffer` interface. (#1735)Yong He
* Refactor `gfx` to surface `CommandBuffer` interface. * Fixes. * Fix code review issues, and make vulkan runnable on devices without VK_EXT_extended_dynamic_states. * Update solution files * Move out-of-date examples to examples/experimental Co-authored-by: Yong He <yhe@nvidia.com>
2021-02-24Explicit swapchain interface in `gfx`. (#1726)Yong He
* Explicit swapchain interface in `gfx`. * Correctly return nullptr when `IRenderer` creation failed. * Fix crashes on CUDA tests. * Cleanups.
2021-02-19Make gfx library visible to external user. (#1719)Yong He
* Make gfx library visible to external user. * Fixup
2021-02-04[gfx] Shader-object driven shader compilation. (#1688)Yong He
2021-01-26Integrate reflection more deeply into gfx layer (#1677)Tim Foley
2021-01-17Make `gfx` compile to a DLL. (#1660)Yong He
* Make `gfx` compile to a DLL. * Fix cuda * Fix cuda build * Bug gl screen capture bug.
2021-01-14COM-ify all slang-gfx interfaces. (#1656)Yong He
* COM-ify all slang-gfx interfaces.
2021-01-11Make `gfx::Renderer` a COM interface. (#1653)Yong He
* Make `gfx::Renderer` a COM interface. This is a first step towards making the `gfx` library expose a COM compatible DLL interface. Remaining classes will come as separate PRs. * Fixup project files * Fix calling conventions * Make gfx::create*Renderer() functions increase ref count by 1 * Make renderer createFunc return via out parameter
2021-01-06Refactor GUI/Window utils out of gfx library (#1649)Yong He
Co-authored-by: Yong He <yhe@nvidia.com>
2020-02-03Initial steps on GPU printing example (#1197)Tim Foley
* Initial steps on GPU printing example This change is checkpointing work on a new Slang example that shows how a "GPU `printf()`" can be implemented almost entirely in user space thanks to a combination of Slang language and API features. The example is not perfect as it stands today due to limitations in our current handling of hashed string literals: * At call sites where a string literal is passed, we currently have to explicitly invoke `getStringHash()` to get the hash code, because we don't currently support `String` as a function argument/parameter type. * On the implementation side, because strings are passed as their `int` hash codes, we can't tell them apart from ordinary `int` arguments. The current code handles this by assuming an `int` is *always* a hashed string, which obviously isn't appropriate. There are plenty of other limitations in the implementation presented, but the above are the two main things I'd like to address in follow-up work. I would like to checkpoint this work on the application first, in order to keep work on the Slang implementation and the example as separate as possible. * typo