Skip to content

Objects with embedded debug data are larger than separate object and debug information #7318

@bmunozgarcia

Description

@bmunozgarcia

Description
Embedded debug information size is larger than separate PDB data for the same shader, seemingly because source code is embedded in the former and not in the latter, without an option to control it. The expectation is that both should be roughly the same size (roughly because of bookkeeping), not 10-50% larger.

Steps to Reproduce

  1. Compile a shader with separate object and PDB data, using the provided example (doom2_shader.txt), calling the outputs 00_output_separate.obj and 00_output_separate.pdb:

dxc doom2_shader.txt -E main -T ps_6_6 -Zi -Qstrip_debug -HV 2021 -Fo 00_output_separate.obj -Fd 00_output_separate.pdb

  1. Compile the same shader with debug data embedded, calling the output 01_output_embed.obj:

dxc doom2_shader.txt -E main -T ps_6_6 -Zi -Qembed_debug -HV 2021 -Fo 01_output_embed.obj

Actual Behavior
With the tested dxc version, the total sizes are:

  • Separate objects (00_output_separate.obj+00_output_separate.pdb): 124kb
  • Object with embedded debug data (01_output_embed.obj): 132kb

The expectation is that both should be roughly the same size, which they are not, as the latter seems to be embedding more data than the former. Note that the provided example is one of the least offenders, actual production shaders see increases in size up to 100%.

Environment

  • DXC version: dxcompiler.dll: 1.8 - 1.8.2502.8 (b471183); dxil.dll: 1.8(1.8.2502.8)
  • Host Operating System: Windows 10 Pro 22H2 19045.5608

Extra notes
Used the doom2 shader from shadertoy as an example of a large shader

doom2_shader.txt

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugBug, regression, crashneeds-triageAwaiting triage

    Type

    No type

    Projects

    Status

    Triaged

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions