Repository navigation
Pass storage buffer strides and structured slots to XDL so Direct3D 12 reads StructuredBuffer<T> correctly - #723
Merged
Merged
Conversation
…2 reads StructuredBuffer<T> through structured views
… and qualify the Direct3D 12 stride limits in the shader docs
botoddly
marked this pull request as ready for review
November 12, 2026 16:11
|
📦 Development package |
|
✅ Development package validation passed on all platforms. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
SDL's Direct3D 12 driver views every storage buffer as raw, so a shader's
StructuredBuffer<T>orRWStructuredBuffer<T>is read through a view of the wrong kind. On an AMD Radeon RX Vega 11 every index then reads element 0. stanoddly/XDL#35 lets XDL create structured views when it knows each buffer's stride and each shader's structured slots. This passes them:StructuredBuffer<T>orRWStructuredBuffer<T>, from the reflected shape rather than the element size, asShaderBindingLayout.StructuredStorageBuffersandReadWriteStructuredStorageBuffers.GpuDevice.CreateBufferCoretakes a stride. Storage buffers passUnsafe.SizeOf<T>(), and other buffers pass 0.CreateShaderCoreandCreateComputePipelineCoretake the slot masks.SdlGpuDevicesets theXDL_PROP_*properties only when a value is nonzero, checks each call, and destroys the properties infinally.docs/shaders.mdexplains the stride and its Direct3D 12 limits.Draft until nuget.org lists XdlSharp 3.4.20.5
This moves to XdlSharp 3.4.20.5 (stanoddly/XdlSharp#6), which binds the four property names. Its Release run succeeded and tagged
v3.4.20.5, but nuget.org does not list it yet, so CI cannot restore it until then.Testing
XDL3.dllof Give Direct3D 12 structured views of storage buffers for StructuredBuffer slots XDL#35, fixed the wrong reads on the Vega 11 under Direct3D 12.