summaryrefslogtreecommitdiffstats
path: root/tools/gfx/d3d
Commit message (Collapse)AuthorAge
* Move switch statement bodies to their own lines (#5493)Ellie Hermaszewska2024-11-05
| | | | | | | | | * Move switch statement bodies to their own lines * format --------- Co-authored-by: Yong He <yonghe@outlook.com>
* formatEllie Hermaszewska2024-10-29
| | | | | | | * format * Minor test fixes * enable checking cpp format in ci
* Implement GLSL gimageDim & memory qualifiers with optional extension(s); ↵ArielG-NV2024-03-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | resolves #3587 for GLSL & SPIR-V targets #3631 (#3810) * [early push of code since memory qualifiers may be made into a seperate branch & pr and I rather make it simple to split the implementation if required] all type & functions impl. for GLSL image type added all memory qualifiers & tests for direct read/write [GLSL syntax] (DID NOT test or implement parameter qualifiers, that is next commit) * this inlcudes emit-glsl & emit-spirv for qualifier decorations * this also includes error handling * this includes parsing * full implementation other than Rect; all errors and basic tests are done & working what is left: 1. need to now add Rect type support (additional TextureImpl flag) 2. tests 3. testing infrastructure to support variety of types * testing framework now works with images of all types and imageBuffers -- next steps are actual tests * push code for mostly working image atomics; missing int64/uint64 tests and slightly broken feature likley due to missing code from master which I pushed for regular atomics * fix all remaining shader image atomic issues and tests to work with float & i64/u64 fully will now clean up code and squash the commits (since they are quite all over the place) * refactor code to work & look correct, fix all regressions Turned off tests for texture format R64 due to the shader use limitation of currently being only for storage buffers on most hardware (test fail cause, this is not allowed) Changed raygen.slang & nv-ray-tracing-motion-blur.slang since both cross-compiled with glslang, which does not respect layout(rgba8) for RWBuffer's, in this scenario making the type into a SPIR-V rgba32f, which is incorrect and a known problem, this causes different code to be outputted from Slang & HLSL+GLSL->Slang paths Clean up all code and better explain the "why" for the gimageDim definition we use various strings of Slang code, the gist is: 1. Parameters are structured as per IMAGE_PARAM keyword in spec, and we respect this in order to match specification (to allow easy code iteration) 2. sample parameters are required for functions 3. types are inconsistently named fixed regression of breaking l-value lowering when r-value should be lowered (lower-to-ir) fix compiler warnings remove unneeded lambdas `expr->type.isLeftValue = isMutableGLSLBufferBlockVarExpr(baseExpr) && (expr->type.hasReadOnlyOnTarget == false);` is an adjustment made such that a buffer block is mutable only if the block is mutable and the base expression is mutable (to handle case of readonly buffer block, immutable) * remove rectangle parameter * use proper const syntax and struct naming * adjust syntax * adjust modifier capabilitites: HLSL+GLSL --> GLSL. Notice most specifically, if the parent is a global struct we can put a memory qualifier, this does not include, struct inside a struct, with a member variable with a memory qualifier (since then you could use the struct in invalid ways). Added test for struct inside struct with member variable with memory qualifier. adjust syntax and remove code which will rot * adjust formatting for consistency * addressing review feedback addressing review feedback: change testing code to handle int and float/half correctly in all cases adjust testing code syntax as requested change vkdevice code to fit a different form as requested * adjust code as per requested for review: 1. adjusted testing code logic to handle non 0-1 values appropriately, notice int8_t will likley be the range and set order of {[0,127],[-1,-128]}, this is intentional 2. syntax adjustments for correctness * trying to fix falcor regressions * add back removed code for regression testing * test removing changes which may break falcor * Revert "test removing changes which may break falcor" This reverts commit 240da97f06c23e98a26ac23cf1d385995c67b251. * disable R64 support in attempt to fix falcor tests * Revert "disable R64 support in attempt to fix falcor tests" This reverts commit 317cb632eb2f47e980fc4aeafe418f8060f4c473. * disable major device changes (still trying to figure out falcor fails -- locally working different than CI) * test removing d3d changes * remove all format changes * add back removed code for regression testing * try something to get code to work with falcor * address review * Add way to handle constref/ref/encapsulated texture objects with memory qualifiers as a parameter. Fixed an issue (and improved codegen) for when we have a store(dst,load(src)) pattern, where dst is supposed to be equal to src for when resolving globalParam's (no need for work-arounds anymore) * move recent-fix/change to textureType loading into a proper optimization pass which now runs after SPIR-V legalization to catch odd SPIR-V emitting after legalizing types for SPIR-V * Revert most recent optimization pass change, add work around getting a unmangled global parameter address through a intrinsic op instead of spir-v intrinsic (works same as `__imagePointer()`) * remove unneeded changes * remove unneeded `__constref` in glsl.meta * move memory qualifier checks to visitInvoke of check-expr.cpp move GetLegalizedSPIRVGlobalParamAddr resolving to spirv-legalization pass move error for "if using non texture type with memory qualifer in param" earlier such that we error with this first. No point in telling user "you are not putting correct memory qualifiers" when memory qualifiers should not have been used. * add memory qualifier folding modifier 'MemoryQualifierCollectionModifier' to reduce searching and processing (later will be adapted to whole system) as suggested/asked. The utility is a method to track memory qualifiers without doing a expensive linked-list traversal (image's have 4 modifiers normally). * properly pass multiple qualifiers from checkModifier down to the `modifier`s list * addressing review comments: * change implementation to properly handle restrict modifier * add comments about implementation for clarity
* nsight Aftermath crash example (#2984)jsmall-nvidia2023-07-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Small fixes and improvements around reflection tool. * Make PrettyWriter printing a class. * Aftermath crash demo WIP. * Enable aftermath in test project. * Setting failCount. * Dumping out of source maps. * Improve comments. Simplify handling of compile products. * Other small fixes to aftermath example. * Added Emit SourceLocType. Track sourcemap association meaning. Improved documentation. * Small improvements. * Capture debug information for D3D11/D3D12/Vulkan. * Enable debug info. * Small improvements. * Improve aftermath example README.md.
* added D32_S8 format (#2885)kopaka18222023-05-19
| | | | | | | | | | | | | * added D32_S8 format * fixed isTypelessDepthFormat format for DXGI_FORMAT_R32G8X24_TYPELESS * added R32_FLOAT_X32_TYPELESS format to allow (depth component only) shader resource views for the D32_FLOAT_S8_UINT format. - unsure about the changed in the vk-util.cpp: No matching VK_Format? --------- Co-authored-by: Yong He <yonghe@outlook.com> Co-authored-by: jsmall-nvidia <jsmall@nvidia.com>
* vkd3d and dxvk integration (#2823)Ellie Hermaszewska2023-04-29
| | | | | | | | | | | | | | | | | | | | | | | | | * Add d3d sources for linux builds * Return NOT_IMPLEMENTED for shared handle support on Linux * Enable DirectX api on Linux * Do not report DX11 support without FXC * Initial version of SynchAPI emulation * Neaten dx library name handling * Neaten and use posix-synchapi * Add premake option for DirectX on Vulkan * s/SLANG_ENABLE_VKD3D_PROTON/SLANG_ENABLE_VKD3D * Skip failing tests on vkd3d * Regenerate vs projects * Silence unused var warning
* Minor tidyings around d3d usage (#2854)Ellie Hermaszewska2023-04-29
| | | | | | | | | | | | | | | | | | | | | | | * Remove unused COM annotation * Move SLANG_ENABLE_DXBC_SUPPORT to slang.h * Add DX11 simple compute test * Remove unnecessary COM parameter annotation * Run compute smoke test for DX12 * Ignore d3d11 tests when we do not have fxc * Do not try to find NVAPI on Linux * Add some logs to .gitignore * Minor cleanups in d3d12 headers * Fix tautological comparison (due to integer overflow) * Limit OutputDebugStringA to Windows
* Changes for vkd3d proton (#2813)Ellie Hermaszewska2023-04-20
| | | | | | | | | | | | | | | | | | | | | | | | * Add some caches to .gitignore * Remove appendWideChars Use String::toWString instead * s/Sleep/sleepCurrentThread * formatting * Expand set of shared libraries which have buggy dlclose Work around https://github.com/microsoft/DirectXShaderCompiler/issues/5119 and https://github.com/doitsujin/dxvk/issues/3330 libdxcompiler.so invokes UB on dlclose, the dxvk libs break GDB when closed * Add assert for specialization failure on DX11 As a band aid for https://github.com/shader-slang/slang/issues/2805 * More fine grained selection of directx features
* Some small fixes with Windows/DX usage (#2797)Ellie Hermaszewska2023-04-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Correct case of windows.h includes * Use Slang::SharedLibrary to load directx dlls * s/max/std::max/ * Factor common OS code in calcHasApi * Add DXIL test for compute/simple * s/false/FALSE for calls to WinAPI functions * Factor common OS code in gfxGetAdapters * 2 missing headers d3d12sdklayers for ID3DDebug climits for UINT_MAX * Define out unused function on Linux * Only try to load Vulkan and CUDA on Windows or Linux * simplify D3DUtil::getDxgiModule * Remove WIN32_LEAN_AND_MEAN &co from source files Add a global define * Set WIN32_LEAN_AND_MEAN &friends in headers Restore previous state also * regenerate vs projects
* GFX report live objects (#2609)skallweitNV2023-01-25
| | | | | | | * Add utility to call D3D ReportLiveObjects * Add gfxReportLiveObjects API call * Only warn on swapchain image references
* Add AdapterLUID to identify GPU adapters (#2492)skallweitNV2022-11-04
| | | | | * Add AdapterLUID to identify GPU adapters * Remove adapter option in render-test
* GFX: improve d3d12 performance. (#2408)Yong He2022-09-22
|
* GFX renaming work part 2: slang-gfx.h renames (#2194)lucy96chen2022-04-21
| | | | | | | | | | | | | * Fixed all build errors and type conversion warnings from renames in slang-gfx.h * Made necessary build fixes to the CUDA implementation * Renamed ITextureResource::Size to ITextureResource::Extents * More rename changes based on CI errors * More renames to fix CI build errors * Rerun tests
* Use GLSL scalar layout for constant buffers. (#2147)Yong He2022-02-28
|
* gfx: d3d12 performance optimizations. (#2140)Yong He2022-02-23
| | | | | | | | | | | * gfx: d3d12 performance optimizations. * Fix. * Fix unit test bug. * Add gfx interface for directly allocating GPU descriptor tables. Co-authored-by: Yong He <yhe@nvidia.com>
* gfx: defer downstream shader compilation until draw/dispatch. (#2139)Yong He2022-02-20
| | | Co-authored-by: Yong He <yhe@nvidia.com>
* gfx: Various Vulkan fixes. (#2129)Yong He2022-02-11
| | | | | | | | | * gfx: Various Vulkan fixes. * Fix test case. * Fix vulkan crash. Co-authored-by: Yong He <yhe@nvidia.com>
* Fixes to GFX. (#2083)Yong He2022-01-19
| | | | | | | * Fix binding null resource views in d3d12. * Fix array render target view creation. * Add support for more primitive topologies. Co-authored-by: Yong He <yhe@nvidia.com>
* Various fixes to gfx. (#2074)Yong He2022-01-10
| | | | | | | * Various gfx fixes. * Fixup. Co-authored-by: Yong He <yhe@nvidia.com>
* gfx: Implement remaining resource commands on D3D12. (#2054)Yong He2021-12-13
| | | | | Includes: `textureBarrier`, `copyTexture`, `uploadTextureData`, `copyTextureToBuffer`, and `textureSubresourceBarrier`. Co-authored-by: Yong He <yhe@nvidia.com>
* gfx: Add more fixed function states and instancing draw calls. (#2023)Yong He2021-11-22
| | | | | | | | | | | | | * gfx: Add more fixed function states and instancing draw calls. * Fix clang error. * Fix clang. * Fixes. * Add `AccelerationStructureCurrentSize` enum. Co-authored-by: Yong He <yhe@nvidia.com>
* gfx: add coverage for more resource commands. (#2020)Yong He2021-11-18
| | | | | | | | | | | | | | | * gfx: specify SubresourceRange for resource view creation. * Add gfx method for `resolveResource`. * Fix compile error. * `copyTextureToBuffer` and `textureSubresourceBarrier`. * Fix vulkan bug. * Fix test cras;h. Co-authored-by: Yong He <yhe@nvidia.com>
* Add BGRA8 Unorm SRGB to the list of supported formats (#2016)lucy96chen2021-11-15
| | | Co-authored-by: Yong He <yonghe@outlook.com>
* Use detected shader model in gfx/d3d12. (#1996)Yong He2021-10-29
| | | | | | | | | | | * Use detected shader model in gfx/d3d12. * Enable all d3d12 tests on Github. * Improve d3d12 software device detection. * Disable d3d12 tests on github for now. Co-authored-by: Yong He <yhe@nvidia.com>
* Expanded gfx::Format to include additional formats (#1982)lucy96chen2021-10-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Format list updated with additional formats supported by both D3D and Vulkan; D3DUtil::getMapFormat() and VkUtil::getVkFormat() updated to include additional formats; GFX_FORMAT() updated with all additional formats (BC compression unfinished) * Finished updating GFX_FORMAT with newly added formats and sizes; Pixel size is now tracked using the FormatPixelSize struct containing the values for bytes per block and pixels per block to accomodate BC formats; Updated gfxGetFormatSize and associated sub-calls to return FormatPixelSize instead of uint8_t; Most calls to gfxGetFormatSize() updated to reflect changes, a couple calls still unupdated * Changes to accommodate new formats finished, debugging slang-literal unit test * First format unit test working * One test added for BC1Unorm and RGBA8Unorm_SRGB, both passing * Refactored format testing code to merge BC1Unorm and RGBA8Unorm SRGB into a single file * All unit tests added for BC and Srgb formats * Most tests added and working; Added five additional formats (still need tests) and made the appropriate changes to support these; createTextureView() modified for D3D11, D3D12, and Vulkan to take into account the format specified in the texture view desc when the texture's format is typeless * Format enums renamed to more closely match their D3D counterparts; Added a universal float and uint buffer and buffer view for use across all Format tests * Remaining tests added; D3D12 tests pass, but Vulkan crashes in BC1_UNORM and D3D11 spits out a bunch of D3D11 Errors (but supposedly passes) * re-run premake * Added Sint versions of test shaders; Vulkan and D3D11 tests also pass * Size struct for format unit tests no longer use initializer lists * Fixed a Size struct missed in the previous pass * Fixed minor bugs causing tests to fail * Added documentation detailing all currently unsupported formats * Skip tests causing unsupported format warnings due to swiftshader * updated several test using old Format enum names * Revert change to compareComputeResult() that was added for debugging purposes * DEBUGGING: Added prints to identify which formats are failing on CI * Reverted attempted debugging changes; Fixed texture2d-gather.hlsl to use updated Format enums * Fixed incorrect array sizes in d3d11 _initSrvDesc() * Commented out further tests that produce unexpected results when tested for Vulkan with swiftshader * Revert "Merge branch 'expanded-format-support' of https://github.com/lucy96chen/slang into expanded-format-support" This reverts commit 20008f0d3ecc3b1405ecac8c138edaa3cd37ed6b, reversing changes made to 6081e95827315fee50e18409394d5abd62fac787. * Added a fuzzy comparison function for use with floats * submodule update * Revert messed up changes caused by previous revert after automatically merging on github
* Implement gfx inline ray tracing on D3D12. (#1902)Yong He2021-07-08
| | | | | | | * Update VS projects to 2019. * Empty commit to trigger build * Implement gfx inline ray tracing on D3D12.
* [gfx] Support StructuredBuffer<IInterface>. (#1851)Yong He2021-05-21
| | | Co-authored-by: T. Foley <tfoleyNV@users.noreply.github.com>
* Half texture support (#1836)jsmall-nvidia2021-05-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * #include an absolute path didn't work - because paths were taken to always be relative. * Split out StringEscapeUtil. * Added StringEscapeUtil. * Fix typo in unix quoting type. * Small comment improvements. * Try to fix linux linking issue. * Fix typo. * Attempt to fix linux link issue. * Update VS proj even though nothing really changed. * Fix another typo issue. * Fix for windows issue. Fixed bug. * Make separate Utils for escaping. * Fix typo. * Split out into StringEscapeHandler. * Windows shell does handle removing quotes (so remove code to remove them). * Handle unescaping if not initiating using the shell. * Slight improvement around shell like decoding. * Simplify command extraction. * Add shared-library category type. * Fix bug in command extraction. * Typo in transcendental category. * Enable unit-test on in smoke test category. * Make parsing failing output as a failing test. * Fixes for transcendental tests. Disable tests that do not work. * Changed category parsing. * Removed the TestResult parameter from _gatherTestsForFile. Made testsList only output. * Remove testing if all tests were disabled. * Make args of CommandLine always unescaped. * Add category. * Don't need escaping on unix/linux. * Remove some no longer used functions. * Add requireSMVersion to CUDAExtensionTracker. * half-calc.slang now works for CUDA. * bit-cast-16-bit works on CUDA. * WIP handling of CUDA vector<half> types. * Half swizzle CUDA. * Half vector test. * Fix swizzle half bug. * Fix compilation issue with narrowing to Index. * Add unary ops. * Add some vector scalar maths ops. * Add half vector conversions for CUDA. * Fix erroneous comment. * Support for half comparisons. * First pass test for half compare. * Fix bug in CUDA specialized emit control. Updated tests to have pre and post inc/dec. * Removed unneeded parts of the cuda prelude. * Half structured buffer works on CUDA. * Added name lookup for Gfx::Format * Support half texture type in test system. * Test for half reading on CUDA. * Add half formats to Vk and D3D utils. * Fix getAt for CUDA - where there might not be a .x member in a vector.
* Improve robustness of gfx lifetime management. (#1788)Yong He2021-04-08
| | | | | | | | | * Improve robustness of gfx lifetime management. * fix clang error * fix clang error * Fix clang warning
* Remove `DescriptorSet` from D3D11 and GL devices. (#1761)Yong He2021-03-18
|
* Swapchain resize and rename to `IDevice` (#1741)Yong He2021-03-10
| | | | | * Swapchain resize * Fix.
* Refactor `gfx` to surface `CommandBuffer` interface. (#1735)Yong He2021-03-04
| | | | | | | | | | | | | * 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>
* Explicit swapchain interface in `gfx`. (#1726)Yong He2021-02-24
| | | | | | | | | * Explicit swapchain interface in `gfx`. * Correctly return nullptr when `IRenderer` creation failed. * Fix crashes on CUDA tests. * Cleanups.
* Make gfx library visible to external user. (#1719)Yong He2021-02-19
| | | | | * Make gfx library visible to external user. * Fixup
* COM-ify all slang-gfx interfaces. (#1656)Yong He2021-01-14
| | | * COM-ify all slang-gfx interfaces.
* Refactor GUI/Window utils out of gfx library (#1649)Yong He2021-01-06
| | | Co-authored-by: Yong He <yhe@nvidia.com>
* Renamed UnownedStringSlice::size to getLength to make match String. (#1254)jsmall-nvidia2020-03-02
|
* Refactor render-test to make cross platform (#1053)jsmall-nvidia2019-09-13
* First pass of render-test refactor. * Make window construction a function that can choose an implementation. * Remove OpenGL as currently has windows dependency. * Disable Vulkan as Renderer impl has dependency on windows. * Pass Window in as parameter of 'update'. * Add win-window.cpp as was missing. * Fix warning on windows about signs during comparison.