| # RUN: yaml2obj %s -o %t.dxbc |
| # RUN: llvm-objcopy --dump-section=DXIL=%t.bc %t.dxbc |
| # RUN: llvm-objcopy --dump-section=ILDB=%t0.bc %t.dxbc |
| |
| ## Verify that when dumping ILDB and DXIL parts we get the bitcode, |
| ## not the header. |
| # RUN: od -t x1 %t.bc | FileCheck %s --check-prefix=BITCODE |
| # RUN: od -t x1 %t0.bc | FileCheck %s --check-prefix=BITCODE |
| # BITCODE: 42 43 12 34 |
| |
| ## Verify the size of the bitcode data. |
| # RUN: wc -c %t.bc | FileCheck %s --check-prefix=DXIL-SIZE |
| # DXIL-SIZE: 4 |
| # RUN: wc -c %t0.bc | FileCheck %s --check-prefix=ILDB-SIZE |
| # ILDB-SIZE: 4 |
| |
| ## Dump the PSV0 part and verify its size. |
| # RUN: llvm-objcopy --dump-section=PSV0=%t.psv0 %t.dxbc |
| # RUN: wc -c %t.psv0 | FileCheck %s --check-prefix=PSV0-SIZE |
| # RUN: od -v -Ax -t x1 %t.psv0 | FileCheck %s --check-prefix=PSV0-CONTENTS --ignore-case |
| # PSV0-SIZE: 76 |
| |
| # For a compute shader the structure size is encoded followed by a bunch of 00'd |
| # bytes until you get to the unused wave size min and max (0xffff), followed by |
| # the shader stage (5 for compute). |
| # TODO: Update this test to use objdump or obj2yaml once we support |
| # --add-section in objcopy. See issue: |
| # https://github.com/llvm/llvm-project/issues/162159. |
| # PSV0-CONTENTS: 0000 34 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |
| # PSV0-CONTENTS: 0010 00 00 00 00 00 00 00 00 ff ff ff ff 05 00 00 00 |
| |
| --- !dxcontainer |
| Header: |
| Hash: [ 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, |
| 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 ] |
| Version: |
| Major: 1 |
| Minor: 0 |
| PartCount: 3 |
| Parts: |
| - Name: ILDB |
| Size: 28 |
| Program: |
| MajorVersion: 6 |
| MinorVersion: 0 |
| ShaderKind: 5 |
| DXILMajorVersion: 1 |
| DXILMinorVersion: 0 |
| DXILSize: 4 |
| DXIL: [ 0x42, 0x43, 0x12, 0x34 ] |
| - Name: DXIL |
| Size: 28 |
| Program: |
| MajorVersion: 6 |
| MinorVersion: 0 |
| ShaderKind: 5 |
| DXILMajorVersion: 1 |
| DXILMinorVersion: 0 |
| DXILSize: 4 |
| DXIL: [ 0x42, 0x43, 0x12, 0x34 ] |
| - Name: PSV0 |
| Size: 76 |
| PSVInfo: |
| Version: 3 |
| ShaderStage: 5 |
| MinimumWaveLaneCount: 0 |
| MaximumWaveLaneCount: 4294967295 |
| UsesViewID: 0 |
| SigInputVectors: 0 |
| SigOutputVectors: [ 0, 0, 0, 0 ] |
| NumThreadsX: 1 |
| NumThreadsY: 1 |
| NumThreadsZ: 1 |
| EntryName: main |
| ResourceStride: 24 |
| Resources: [] |
| SigInputElements: [] |
| SigOutputElements: [] |
| SigPatchOrPrimElements: [] |
| InputOutputMap: |
| - [ ] |
| - [ ] |
| - [ ] |
| - [ ] |
| ... |