Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • mesa mesa
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,068
    • Issues 3,068
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 1,000
    • Merge requests 1,000
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • MesaMesa
  • mesamesa
  • Merge requests
  • !10298

d3d12, microsoft/compiler: More shader compiler support for Vulkan/WebGPU shaders

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Jesse Natalie requested to merge jenatali/mesa:more-more-vulkan-shaders into master Apr 17, 2021
  • Overview 10
  • Commits 5
  • Pipelines 19
  • Changes 12

The first commit of this series makes the DXIL backend use sampler variable binding data for emitting SRVs and samplers into DXIL. This breaks the d3d12 driver for GL pretty badly, so this commit also updates the GL driver to expect this behavior. /cc @kusma and @billkris.ms if you have time/interest to take a look. Note that currently this is structured a bit differently from D3D11On12, which always binds from 0 -> max (using nulls for all gaps in that range), instead this goes from min -> max.

The second commit updates the sampler splitting pass that the d3d12 driver uses. In GL, samplers are always combined into texture + sampler. In CL, they're always split. The DXIL backend currently always expects them to be split. The previous pass was dumb, and, if called, added a "bare" sampler for every texture (sampler with return type). That's not right for VK, because each texture isn't 1:1 with a sampler anymore. Also, the pass didn't modify instructions, assuming that just using the existing sampler_id binding was sufficient after adding a new variable. The pass has been rewritten to support derefs and lowered samplers, including references to typed samplers, and references to already-bare samplers. Doing this without the previous change would also break GL pretty badly, as it can cause sampler bindings to no longer match up with SRVs, since we now don't split samplers for things like txf.

After that, things get simpler:

  • A bugfix for bufferStore
  • Support for Vulkan's "descriptor set" concept, which we map to DXIL's "binding space" concept. This is the inverse mapping that DXC does when going from HLSL -> SPIR-V.
  • Handle resource arrays declared as [], or unbounded. The size here is 0, which trips up some pre-existing assumptions.

With this, we no longer assert on the vast majority of DXC's HLSL filecheck test suite, though we still fail to compile large portions, or otherwise produce "incorrect" codegen (TBD how many of those are just being way too specific).

/cc @tangm @egalli

Edited Apr 22, 2021 by Jesse Natalie
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: more-more-vulkan-shaders