Giter Club home page Giter Club logo

Comments (3)

csyonghe avatar csyonghe commented on June 24, 2024

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.

bmillsNV avatar bmillsNV commented on June 24, 2024

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.

bmillsNV avatar bmillsNV commented on June 24, 2024

Marking for Q3. Planning to tackle this request in July to support Siggraph.

from slang.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.