Skip to content

Revive --extract-shaders for dxbc bytecode extraction#186

Draft
PachiMako wants to merge 4 commits into
overtools:developfrom
PachiMako:fix-shader-extract
Draft

Revive --extract-shaders for dxbc bytecode extraction#186
PachiMako wants to merge 4 commits into
overtools:developfrom
PachiMako:fix-shader-extract

Conversation

@PachiMako

Copy link
Copy Markdown

teShaderCode, teShaderInstance and teShaderGroup all changed structure since at least the patch of Aug 10 '23 (Manifest 3320652641754470004).

This change reran structural analysis of teShaderCode as well as teShaderGroup which now holds a list of shaders per group. teShaderInstance is not reversed in this change since --extract-shaders does not require it to be updated (note that teShaderInstance moved from 088 to 040).

Further reversing of the fields and their associations may come in subsequent changes.

Changes:

  • Improves error handling and logging for --extract-shaders
  • Adds errors in codepaths that are not longer functional such as resolving file names in SaveShaderGroup and resolving previously extracted shaders using their now stale hash
  • Fixup teSHADER_TYPE enum which is in fact a byte-sized bitflag with COMPUTE being inferred from no other stages being enabled
  • Minimal reverse of teShaderGroup and teShaderCode headers

Verified working on overwatch build prometheus-2_23_0_0-150480 with valid dxbc for all entries of teShaderCode with the following distributions across shader types:

PIXEL (2): 112210
VERTEX (1): 21777
COMPUTE (0): 147
GEOMETRY (4): 24
VERTEX, UNKNOWN_C (129): 13
GEOMETRY, UNKNOWN_B (20): 1

ZingBallyhoo and others added 4 commits May 29, 2026 18:20
teShaderCode, teShaderInstance and teShaderGroup all changed structure since at least the patch of Aug 10 '23 (Manifest 3320652641754470004).

This change reran structural analysis of teShaderCode as well as teShaderGroup which now holds a list of shaders per group. teShaderInstance is not reversed in this change since --extract-shaders does not require it to be updated (note that teShaderInstance moved from 088 to 040).

Further reversing of the fields and their associations may come in subsequent changes.

Changes:
 - Improves error handling and logging for --extract-shaders
 - Adds errors in codepaths that are not longer functional such as resolving file names in SaveShaderGroup and resolving previously extracted shaders using their now stale hash
 - Fixup teSHADER_TYPE enum which is in fact a byte-sized bitflag with COMPUTE being inferred from no other stages being enabled
 - Minimal reverse of teShaderGroup and teShaderCode headers

Verified working on overwatch build prometheus-2_23_0_0-150480 with valid dxbc for all entries of teShaderCode with the following distributions across shader types:
PIXEL (2): 112210
VERTEX (1): 21777
COMPUTE (0): 147
GEOMETRY (4): 24
VERTEX, UNKNOWN_C (129): 13
GEOMETRY, UNKNOWN_B (20): 1
@PachiMako PachiMako marked this pull request as draft July 10, 2026 21:30
@PachiMako

Copy link
Copy Markdown
Author

Needs a few fixes before opening up for review again:

  • use [StructLayout(LayoutKind.Explicit)] for the required fields
  • revert the changes to teSHADER_TYPE as it was in fact still a ushort with 256 indicating COMPUTE
  • fix PR to only contain the fix change

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants