summaryrefslogtreecommitdiffstats
path: root/tools/gfx/vulkan
Commit message (Collapse)AuthorAge
...
* Check for extension support before enabling a feature (#3262)Ellie Hermaszewska2023-10-05
| | | Co-authored-by: Yong He <yonghe@outlook.com>
* More direct-SPIRV fixes. (#3257)Yong He2023-10-02
| | | | | | | | | * More direct-SPIRV fixes. * Fix array-reg-to-mem. --------- Co-authored-by: Yong He <yhe@nvidia.com>
* Use direct spirv in hello-world example. (#3207)Yong He2023-09-18
| | | | | | | | | | | | | | | * Use direct spirv in hello-world example. * Use vulkan 1.1 * Use vulkan 1.2. * fix. * Fix test. --------- Co-authored-by: Yong He <yhe@nvidia.com>
* Fix build with --enable-xlib=false (#3203)Ellie Hermaszewska2023-09-13
| | | | | | | | | * Fix build with --enable-xlib=false * Correct brace location --------- Co-authored-by: Yong He <yonghe@outlook.com>
* Add Mesh and Task shader support to GFX (#3190)Ellie Hermaszewska2023-09-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Bump vulkan headers Also just use vulkan-headers as a submodule * Add drawMeshTasks to gfx graphics pipelines * Add DispatchMesh overload with no payload, with GLSL intrinsic * Require spirv 1.4 for mesh shaders * Add vulkan mesh shader feature discovery * Add mesh shader stage bits to vk-util * Add mesh and task shader support to render-test * Add mesh and task tests * Preserve "payload" specifier in task shaders * Add mesh shader pipeline support to gfx * Add TODO * Add numThreads attribute for amplification stage * Add payload to task shader test * Drop dependency on d3dx12 * Allow passing payloads from task to mesh shaders * regenerate vs projects * check DispatchMesh name correctly * Add mesh shader tests to failing tests * Detect wave-ops feature on vulkan * Add fuse-product to expected failures This fails because the global varaible `count` is not initialized * Add required extension to WaveMaskMatch SPIR-V impl * Remove meshShader member from pipeline desc * Identify mesh shader support on d3d12
* Fix HLSL SER Intrinsics. (#3183)Yong He2023-09-05
| | | | | | | | | * Fix HLSL SER Intrinsics. * Fix GFX Vulkan shader creation bug. --------- Co-authored-by: Yong He <yhe@nvidia.com>
* Add support for getting external semaphore handles (#3181)skallweitNV2023-09-06
| | | | | | | | | | | | | * Add support for getting external semaphore handles * Fixes * Linux fix * Address reviewer comments --------- Co-authored-by: Yong He <yonghe@outlook.com>
* SPIR-V WIP (#3064)Ellie Hermaszewska2023-08-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add type layout for structured buffer * Default to generating spirv directly * vk test for compute simple * Add spirv-dis as a downstream compiler * Emit Array types in SPIR-V * makevector for spirv * Dump whole spirv module on validation failure * register array types todo, use emitTypeInst * Neater formatting for unhandled inst printing * break out emitCompositeConstruct * Correct array type generation * neaten * Allow getElement for vector * Remove unused * Allow predicating target intrinsics on types * Consider functions with intrinsics to have definitions We need to specialize these if they are predicated on types * Correct array type generation * makeArray for spir-v * replace getElement with getElementPtr for spirv * Correct translation of field access for spirv * Push layouts to types for spirv * Spirv intrinsics * operator now makes a pointer * Add structured buffer of struct test * Preserve type layout in spirv structured buffer legalization * neaten * makeVectorFromScalar for SPIRV * placeholder for layouts on param groups * More type safe spirv op construction * Know that constants and types only go in one section * Remove emitTypeInst * Add todo for spirv sampling * Add links to spirv documentation on emit functions * OpTypeImage support for SPIR-V * Add simpler texture test for spirv * s/spirv_direct/spirv/g * Allow several string literals in target_intrinsic * Handle global params without a var layour for SPIR-V For example groupshared vars * uint spirv asm type * Add todo for isDefinition It is currently too broad * Some atomic op spirv intrinsics * Strip ConstantBuffer wrappers for spirv * Add todo for matrix annotations * Do not associate decorations insts with spirv counterparts * Correct entry point parameter generation * Spelling * Assert that fieldAddress is returning a pointer * Add error for existential type layout getting to spir-v emit * Add IRTupleTypeLayout Unused so far * Allow getElementPtr to work with vectors * Correct target name in test * Hide default spirv direct behind a premake option --default-spirv-direct=true * Do not insert space at start of intrinsic def * Correct asm rendering in tests * remove redundant option * Emit directly from direct test * Add source language options for spirv-dis * Add comments to spirv dis * Add dead debug print for before spirv module * Correct asm rendering in tests * s/spirv_direct/spirv/g * Only specialize intrinsic functions with predicates * regenerate vs projects * squash warnings * squash warnings * remove duplication * Silence warnings from msvc * squash warnings * Overload for zero sized array * More msvc warnings * warnings * Add spirv-tools to path for tests * Do not be specific about dxc version for diag test * Normalize line endings from spirv-dis * Correct filecheck matches * Temporarily disable two spirv tests Failing on CI, undebuggable hang :/ * Do not emit storage class more than once for spirv snippet * Do not pass spir-v to spirv-dis by stdin * Do not get spirv-dis output via stream, use file * normalize file endings in spirv-dis output
* 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>
* MVP for higher order functions (#2849)Ellie Hermaszewska2023-05-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * MVP for higher order functions * Add shader subgroup partitioned glsl intrinsics * Implement parsing and checking for tuple types Currently there is no way to do anything useful with them from the source language however * neaten * Correct precedence of function type parsing * neaten * higher order function tests * function types of any arity * Inference for higher order functions * Add second test for unsynchronized params * regenerate vs projects * dx11 -> dx12 for saturated cooperations tests * Disable saturated cooperation tests on vulkan They fail on release builds in CI, not essential for the higher order function work however * remove saturated-cooperation tests * Remove unnecessary assert and clarify control flow in AddDeclRefOverloadCandidates * Add Tuple type name mangling * Use functype keyword to introduce function types * Add more inference tests for hof --------- Co-authored-by: Yong He <yonghe@outlook.com>
* gfx: fix vulkan validation errors. (#2861)Yong He2023-05-02
| | | | | | | | | | | * Fix VK validation errors when using vk1.2 features. * Fix vulkan validation errors. * Fix. --------- Co-authored-by: Yong He <yhe@nvidia.com>
* Dictionary using lowerCamel (#2835)jsmall-nvidia2023-04-25
| | | | | | | | | | | | | | | | | | | | | | | | | * #include an absolute path didn't work - because paths were taken to always be relative. * WIP lowerCamel Dictionary. * WIP more lowerCamel fixes for Dictionary. * Add/Remove/Clear * GetValue/Contains * Fix tabs in dictionary. Count -> getCount * Fix fields with caps. * Key -> key Value -> value Use m_ for members where appropriate. Use lowerCamel in linked list. * Some small fixes/improvements to Dictionary. * Kick CI.
* Correct vulkan extension name for inline uniforms (#2822)Ellie Hermaszewska2023-04-21
| | | Fixes https://github.com/shader-slang/slang/issues/2821
* Preliminary support for realtime clock (#2772)jsmall-nvidia2023-04-04
| | | | | | | | | | * #include an absolute path didn't work - because paths were taken to always be relative. * Initial support for realtime clock. * Add realtime-clock render feature where seems appropriate. * Fixes to make NVAPI compile properly. Change realtime-clock.slang check to use maths that can't overflow.
* Comment call to vkCreateInstance with a potential pitfall (#2642)Ellie Hermaszewska2023-02-11
| | | | | Although we could in principle write this explanatory message to stderr, that would entangle this call with the layer search above for what is probably a very unlikely possibility on any normal system.
* GFX: make dispatch commands return error code. (#2625)Yong He2023-02-06
| | | | | | | | | * GFX: make dispatch commands return error code. * Fix cuda. --------- Co-authored-by: Yong He <yhe@nvidia.com>
* Add vulkan extensions to support DLSS (#2603)skallweitNV2023-01-20
|
* Initial version of DeviceLimits implemented in d3d12, d3d11, vulkan and cuda ↵skallweitNV2022-11-07
| | | | (#2496)
* Add AdapterLUID to identify GPU adapters (#2492)skallweitNV2022-11-04
| | | | | * Add AdapterLUID to identify GPU adapters * Remove adapter option in render-test
* Add gfxGetAdapters function (currently implemented for D3D12/Vulkan) (#2486)skallweitNV2022-11-03
| | | | | | | | | | | * Add gfxGetAdapters function (currently implemented for D3D12/Vulkan) * Extend to handle DirectX11 and CUDA * Use blob to return adapter list and add AdapterList helper * Replace strncpy with memcpy Co-authored-by: jsmall-nvidia <jsmall@nvidia.com>
* Make `optimalClearValue` optional in `ITextureResource::Desc` (#2450)Yong He2022-10-13
| | | Co-authored-by: Yong He <yhe@nvidia.com>
* Shader caching (#2432)lucy96chen2022-10-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Changed all getEntryPointCode calls to use RendererBase::getEntryPointCodeFromShaderCache * Hashing hooked up, tests pass but need to add more to fully test functionality * checkpoint * Checkpoint: File system creation seems functional, saving is broken * checkpoint: Fixed filename generation from MD5 hash, shader blob might be going missing ahead of pipeline state creation * Fixed a lot of bugs related to hash code generation, shader cache is likely working but needs further testing * Added workaround for module loading by re-creating the test device, shader cache test functional * Vulkan shader caching bug fixed, checkpoint commit before more refinement * pre-ToT merge checkpoint * checkpoint commit, improving cache keys * Significantly expanded items included in the dependency hash for Module; Added dependency hash functions to SpecializedComponentType and RenamedEntryPointComponentType * Temporarily disable shader cache test * Mid cleanup changes, solution successfully builds * Added several helper update functions to slang-md5 to help simplify usage; Added a function under ISession to compute a hash for all linkage-related items; Function renames and cleaned up some comments * Ran premake.bat; Renamed getASTBasedHashCode to computeASTBasedHash * Added slang unit tests for Checksum and MD5; Extended gfx shader cache test to test with multiple shader files and one shader file with multiple entry points * Solution builds and shader cache tests pass, but at least a couple other tests now failing * ran premake.bat * More cleanup changes * Added shaderCachePath field to IDevice desc in gfx.slang, gfx-smoke.slang should be functional * ran premake * cleanup changes; Adding test printf to getEntryPointCodeFromShaderCache to see if output can be seen in CI * Removed debugging printfs; Added handling for getEntryPointCode() failing * Cleanup changes; Jonathan's fixes to SerialWriter to zero initialize otherwise uninitialized memory; Change to SwizzleExpr creation to zero initialize elementCount * Changed enable_if_t to enable_if * Fixed enable_if * Added test for import vs include and changes to included and imported files; Fixed build errors in CUDA; Renamed shader cache statistics fields * cleanup changes * Readd removed file * Restructured computeDependencyBasedHash calls, added computeDependencyBasedHashImpl to all classes dervied from ComponentType * Applied same restructuring to the AST hash functions * Cleanup changes; Moved HashBuilder out to slang-digest.h and added some helper functions to streamline the process of adding items to a hash * Cleanup; Fixed incorrect expected results for shader import and include test
* Various gfx fixes. (#2434)Yong He2022-10-05
|
* Use d3d12/vk debug layer when gfx debug layer is enabled. (#2411)Yong He2022-09-26
| | | | | | | * Use d3d12/vk debug layer when gfx debug layer is enabled. * Fix. Co-authored-by: Yong He <yhe@nvidia.com>
* GFX: improve d3d12 performance. (#2408)Yong He2022-09-22
|
* Fix for Vulkan ray tracing test using a non-zero raygen shader index (#2380)lucy96chen2022-08-25
| | | | | | | * Fixed math errors in SBT creation causing a ray tracing test to fail with a fully zero output when given a non-zero raygen shader index * Removed unnecessary code * raygen memcpy now copies the 32 bytes from srcHandle and zeroes out the remaining 32 bytes due to 64 byte alignment
* Call `gfx` in slang program. (#2370)Yong He2022-08-20
|
* Add gfx interface definition in Slang. (#2364)Yong He2022-08-16
| | | | | | | | | | | | | | | | | | * Add gfx interface definition in Slang. - add gfx interface definitons in Slang. - fix slang compiler to correctly type-check `out` interface argument. - modify gfx interface to be fully COM compatible - add convenient ShaderProgram creation methods to gfx. * Fix compile errors and warnings. * Update project files * Fix cuda. * Properly implement queryInterface in command encoder impls. Co-authored-by: Yong He <yhe@nvidia.com>
* Artifact and ICastable (#2351)jsmall-nvidia2022-08-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * #include an absolute path didn't work - because paths were taken to always be relative. * WIP with hierarchical enums. * Some small fixes and improvements around artifact desc related types. * Improvements around hierarchical enum. * Fixes to get Artifact types refactor to be able to execute tests. * Attempt to better categorize PTX. * Work around for potentially unused function warning. * Typo fix. * Simplify Artifact header. * Small improvements around Artifact kind/payload/style. * Added IDestroyable/ICastable * Add IArtifactList. * First impl of IArtifactUtil. * Use the ICastable interface for IArtifactRepresentation. * Added IArtifactRepresentation & IArtifactAssociated. * Add SLANG_OVERRIDE to avoid gcc/clang warning. * Fix calling convention issue on win32. * Fix missing SLANG_OVERRIDE. * First attempt at file abstraction around Artifact. * Added creation of lock file. * Move functionality for determining file paths to the IArtifactUtil. Add casting to ICastable. * Added some casting/finding mechanisms. * Simplify IArtifact interface, and use Items for file reps. * Fix problem with libraries on DXIL. * Split out ArtifactRepresentation. * Move ArtifactDesc functionality to ArtifactDescUtil. ArtifactInfoUtil becomes ArtifactDescUtil. * Split implementations from the interfaces for Artifact. * Use TypeTextUtil for target name outputting. * Add artifact impls. * Add ICastableList * Added UnknownCastableAdapter * Make ISlangSharedLibrary derive from ICastable, and remain backwards compatible with slang-llvm. * Refactor Representation on Artifact. * Make our ISlangBlobs also derive from ICastable. Make ISlangBlob atomic ref counted. * Fix typo.
* Fixed incorrectly scoped variable causing crashes on certain linux ↵Sai Praveen Bangaru2022-07-12
| | | | toolchains (#2319)
* Added a second set of shaders to the ray tracing test and added another test ↵lucy96chen2022-06-21
| | | | that uses these shaders; Fixed a bug in Vulkan's RayTracingCommandEncoder::dispatchRays() where the supplied raygen shader index wasn't being used (#2290)
* Vulkan validation error fixes (#2254)lucy96chen2022-06-01
| | | | | * Fixed Vulkan validation errors for incorrect layer counts and view types in Debug * Removed old (and empty) render-vk files; Ran premake.bat
* Split render-vk.h/.cpp into a set of smaller files (#2244)lucy96chen2022-05-26
| | | | | | | * Some preliminary work on splitting render-vk * render-vk split, tests currently crash on null reference * fixed circular include
* Various vulkan/glsl fixes. (#2222)Yong He2022-05-05
| | | | | | | | | | | | * Various vulkan/glsl fixes. * Fix. * Fix. * Canonicalize type constraints for name mangling. Co-authored-by: Yong He <yhe@nvidia.com> Co-authored-by: Theresa Foley <10618364+tangent-vector@users.noreply.github.com>
* Changed all uses of attachment (in the context of render/depth stencil ↵lucy96chen2022-05-04
| | | | | targets) to target (#2214) Co-authored-by: Theresa Foley <10618364+tangent-vector@users.noreply.github.com>
* 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
* GFX renaming work part 1 (#2183)lucy96chen2022-04-14
| | | | | * Added new typedefs for Size, Offset, Count, and Index; Replaced numerous instances of size_t in slang-gfx.h, render-d3d12, render-vk, and renderer-shared with either Size or Offset; Fixed compiler warnings for mismatched numerical types * Renamed Index and Count to GfxIndex and GfxCount, changed to 32 bit from 64 bit
* Texture views/shapes tests part 1 (#2179)lucy96chen2022-04-07
| | | | | | | * Framework for texture views testing working; Small tweaks to texture testing utils; Changed D3D12 readTextureResource to account for non-1 depth * Basic framework for texture views tests working; Test file needs a rename at some point * 1D, 2D, and 3D textures working for ShaderResource, UnorderedAccess, and RenderTarget tests; Fixed some small issues with handling the depth field of 3D textures in Vulkan causing incorrectly cleared textures
* Add additional texture to texture copying tests (#2165)lucy96chen2022-03-21
| | | | | | | | | | | | | | | | | | | * Working on finding a better way to do result comparisons in order to accommodate testing different formats and texture types, copying small to large texture currently half broken * All tests except copying into a buffer with an offset working with new code for results comparison, support for most formats WIP * Replaced SubresourceStuff with ValidationTextureData; Added implementation for ValidationTextureFormat::initializeTexel() and changed generateTextureData() to call this * All implemented formats work on D3D12, a few broken for Vulkan * Fixed numerous locations in render-vk.cpp to set aspect masks based on either the format or the provided TextureAspect; All tests except copy to buffer with offset working on new code structure * All texture to texture copying tests work for all non-compressed formats; Test code cleaned up to minimize the amount of stuff needing to be passed between functions * All tests working with all texture types except TextureCube and all non-compressed formats; Temporarily removing test for copying to a buffer at an offset, will likely return in a separate test file * Small cleanup changes * build fixes
* gfx: restructure render-vk.cpp (#2157)Yong He2022-03-09
| | | Co-authored-by: Yong He <yhe@nvidia.com>
* gfx: restructure render-d3d12.cpp (#2154)Yong He2022-03-09
| | | | | | | | | | | | | | | | | * Vulkan: deferred shader compilation and pipeline creation. * Fix 32bit build. * gfx: restructure the code in render-d3d12.cpp * Move `Submitter`. * Fix. * merge with master. * Revert dictionary change in previous PR. Co-authored-by: Yong He <yhe@nvidia.com>
* GFX Vulkan: deferred shader compilation and pipeline creation. (#2153)Yong He2022-03-08
| | | | | | | * Vulkan: deferred shader compilation and pipeline creation. * Fix 32bit build. Co-authored-by: Yong He <yhe@nvidia.com>
* Expose API-specific row alignment values (#2151)lucy96chen2022-03-08
| | | | | | | * Added function to IDevice that retrieves the row alignment for the particular API; Added rowDstStride argument to copyTextureToBuffer and changed D3D12 footprint row pitch to check that the user-supplied stride is correctly aligned before assigning to the footprint's row pitch * Changed alignment from Uint to size_t Co-authored-by: jsmall-nvidia <jsmall@nvidia.com>
* Use GLSL scalar layout for constant buffers. (#2147)Yong He2022-02-28
|
* Improved SCCP, inlining and resource specialization passes, legalize ↵Yong He2022-02-25
| | | | `ImageSubscript` for GLSL (#2146)
* Add isOccluded() and setFullScreenMode() to ISwapchain (#2145)lucy96chen2022-02-25
| | | | | | | * Added isOccluded() and setFullScreenMode() to ISwapchain and provided implementations for D3D12 (all others currently return false) * Removed isWindowOccluded variable and directly return the result of m_swapchain3->Present * Restart CI
* 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>
* Optimize d3d12 mutable shader object implementation. (#2138)Yong He2022-02-19
| | | | | | | | | | | | | * Optimize d3d12 mutable shader object implementation. * Disable mismatched clear value warning message from d3d sdk. * Fix. * Fix. * gfx: Avoid redundant d3d12 QueryInterface call. Co-authored-by: Yong He <yhe@nvidia.com>