DXContainer files have a handful of sections that need to be written. This adds a pass to write the section data into IR globals, and writes the shader flag data into a global. The test cases here verify that the shader flags are correctly written from the IR into the global and emitted to the DXContainer. This change also fixes a bug in the MCDXContainerWriter, where the size of the dxbc::ProgramHeader was not being included in the part offset calcuations. This is verified to be working by the new testcases where obj2yaml can properly dump part data for parts after the DXIL part. Resolves issue #57742 (https://github.com/llvm/llvm-project/issues/57742) Reviewed By: python3kgae Differential Revision: https://reviews.llvm.org/D135793
26 lines
830 B
LLVM
26 lines
830 B
LLVM
; RUN: opt -S --passes="print-dx-shader-flags" 2>&1 %s | FileCheck %s
|
|
; RUN: llc %s --filetype=obj -o - | obj2yaml | FileCheck %s --check-prefix=DXC
|
|
|
|
target triple = "dxil-pc-shadermodel6.7-library"
|
|
|
|
; CHECK: ; Shader Flags Value: 0x00000021
|
|
; CHECK: ; Note: shader requires additional functionality:
|
|
; CHECK-NEXT: ; Double-precision floating point
|
|
; CHECK-NEXT: ; Double-precision extensions for 11.1
|
|
; CHECK-NEXT: {{^;$}}
|
|
define double @div(double %a, double %b) {
|
|
%res = fdiv double %a, %b
|
|
ret double %res
|
|
}
|
|
|
|
|
|
; DXC: - Name: SFI0
|
|
; DXC-NEXT: Size: 16
|
|
; DXC-NEXT: Flags:
|
|
; DXC-NEXT: Doubles: true
|
|
; DXC-NOT: {{[A-Za-z]+: +true}}
|
|
; DXC: DX11_1_DoubleExtensions: true
|
|
; DXC-NOT: {{[A-Za-z]+: +true}}
|
|
; DXC: NextUnusedBit: false
|
|
; DXC: ...
|