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,760
    • Issues 2,760
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 919
    • Merge requests 919
  • 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
  • !16713

Fix static glapi on Windows

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Jesse Natalie requested to merge jenatali/mesa:fix-windows-static-glapi into main May 25, 2022
  • Overview 13
  • Commits 1
  • Pipelines 11
  • Changes 4

On Linux, the static glapi path sees libGL.so implementing the static glapi, and the drivers (libgallium_dri.so) updating/reading the TLS vars.

On Windows, to allow libgallium_wgl.dll to be a full ICD, it's responsible for implementing the actual static glapi. However, before this change, OpenGL32.dll was also implementing the static glapi, meaning that GL API calls from OpenGL32.dll didn't route to the driver correctly because the TLS vars were never actually set - the driver set its copy, and OpenGL32.dll read its own copy.

Now, always build a bridge and static version of glapi when not using shared. The bridge version is linked into OpenGL32.dll, and the static version is linked into the driver on Windows. GLES only builds with shared glapi - but after this, shared glapi is not really needed on Windows for GLES, since the driver has all of the data.

Fixes: f36921ef ("wgl: Refactor drivers to a libgallium_wgl.dll") Closes: #6560 (closed)

/cc @pal1000 - looks like you called it out in Mesa 21.3 release notes ("Always build Mesa3D 21.3+ with shared glapi as static glapi is no longer supported") but that wasn't my intention. Not sure if you had filed an issue for it.

Assignee
Assign to
Reviewer
Request review from
Time tracking
Source branch: fix-windows-static-glapi