Skip to content

GitLab

  • Menu
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 2,873
    • Issues 2,873
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 899
    • Merge requests 899
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Mesa
  • mesamesa
  • Merge requests
  • !2929

Merged
Created Nov 30, 2019 by Marek Olšák@marekoOwner

gallium, radeonsi: add a utility to deduplicate live shader CSOs

  • Overview 28
  • Commits 6
  • Pipelines 17
  • Changes 14

Creating several shaders with the same IR will return the same CSO, reference-counted.

This happens a lot with games that convert D3D separate shaders to linked GLSL shaders, e.g. the same VS is used with many FS.

The assumed benefits are:

  • fewer resident shaders (possibly fewer total shader variants on the driver side)
  • fewer shader state changes in the driver if 2 GLSL programs bound back-to-back share shader CSOs

Using a Borderlands 2 apitrace, this is the efficiency with TGSI:

    321 cache hit
    524 cache miss

And with NIR:

    291 cache hit
    554 cache miss

I guess NIR is worse because the linker does more inter-shader optimizations.

radeonsi now has 3 levels of caching:

  • live shader CSO deduplication
  • in-memory shader cache
  • disk shader cache
Edited Nov 30, 2019 by Marek Olšák
Assignee
Assign to
Reviewer
Request review from
Time tracking
Source branch: gallium-dedup-shader-cso