Comments (3)
From Hai:
Here's all the resources that I could scrounge up for this.
For DXC, the selection for the layout rules begins here based on what options were passed in:
https://github.com/microsoft/DirectXShaderCompiler/blob/main/tools/clang/lib/SPIRV/SpirvEmitter.cpp#L605-L609
Looking through this reminded me it was actually the FXC rules that we had to follow, so that's why the enums are prefixed with Fxc.
cbuffer/ConstantBuffer/tbuffers all use the FxcCTBuffer rules.
StructuredBuffer/RWStructuredBuffer + all their variants use the FxcSBuffer rules.
Amplification shader payloads also use FxcSBuffer rules.
The rules (FxcCTBuffer and FxcSBuffer) are spelled out and implemented in this file:
https://github.com/microsoft/DirectXShaderCompiler/blob/main/tools/clang/lib/SPIRV/AlignmentSizeCalculator.cpp#L245-L261
DXC's documentation also spells out these rules although it takes a bit parsing:
https://github.com/microsoft/DirectXShaderCompiler/wiki/Buffer-Packing
Microsoft's documentation on HLSL packing rules is pretty simplistic:
https://learn.microsoft.com/en-us/windows/win32/direct3dhlsl/dx-graphics-hlsl-packing-rules
This is a pretty awesome visualizer that someone wrote to illustrate the HLSL Constant Buffer Packing Rules:
https://maraneshi.github.io/HLSL-ConstantBufferLayoutVisualizer/
from slang.
Not sure if we've got capacity for this one in Q2 or not. Marking for Q2 for now. Need to do another scrub of issues in Q2 to see how this one ranks.
from slang.
Marking for Q3. Planning to tackle this request in July to support Siggraph.
from slang.
Related Issues (20)
- Latest macOS release x64 build is actually an ARM64 build
- `and` intrinsic does not support vector arguments HOT 1
- SPIRV and Metal `TextureBufferType` support HOT 4
- Missing `uint2` variant of `asdouble`
- Unexpected error: unable to parse target intrinsic snippet: `CheckAccessFullyMapped`
- `countbits` intrinsic does not support vector arguments
- SPIR-V: `SubpassInput` should default to `float4` if explicit type parameter is not provided
- Missing support for `or` intrinsic
- Add support for matrix variants of `select`
- SPIR-V: Error message for `WaveMultiPrefix` functions is not easy to understand HOT 1
- Missing SM 6.6 function: `IsHelperLane()` HOT 2
- `Load(in int Location, out uint Status)` missing from `Buffer/RWBuffer`? HOT 2
- Does Slang allow function implementation to live outside of namespace? HOT 2
- Improve documentation and error message to clarify user defined data structures: `struct` vs `class` HOT 1
- Use of base struct's resource member causes assert HOT 1
- Does/should Slang allow left side cast? HOT 1
- Hitting assert due to NULL struct type layout
- NULL pointer access when retrieving field layout HOT 6
- Does Slang allow for static const global references to `cbuffer` data?
- Crash with TypeConformance
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from slang.