Currently, ShaderFlagsAnalysis pass represents various module-level properties as well as function-level properties of a DXIL Module using a single mask. However, one mask per function is needed for accurate computation of shader flags mask, such as for entry function metadata creation. This change introduces a structure that wraps a sorted vector of function-shader flag mask pairs that represent function properties instead of a single shader flag mask that represents module properties and properties of all functions. The result type of ShaderFlagsAnalysis pass is changed to newly-defined structure type instead of a single shader flags mask. This allows accurate computation of shader flags of an entry function (and all functions in a library shader) for use during its metadata generation (DXILTranslateMetadata pass) and its feature flags in DX container globals construction (DXContainerGlobals pass) based on the shader flags mask of functions. However, note that the change to implement propagation of such callee-based shader flags mask computation is planned in a follow-on PR. Consequently, this PR changes shader flag mask computation in DXILTranslateMetadata and DXContainerGlobals passes to simply be a union of module flags and shader flags of all functions, thereby retaining the existing effect of using a single shader flag mask.
46 lines
1.3 KiB
LLVM
46 lines
1.3 KiB
LLVM
; RUN: opt -S --passes="print-dx-shader-flags" 2>&1 %s | FileCheck %s
|
|
|
|
target triple = "dxil-pc-shadermodel6.7-library"
|
|
|
|
; CHECK: ; Combined Shader Flags for Module
|
|
; CHECK-NEXT: ; Shader Flags Value: 0x00000044
|
|
|
|
; CHECK: ; Note: shader requires additional functionality:
|
|
; CHECK-NEXT: ; Double-precision floating point
|
|
; CHECK-NEXT: ; Double-precision extensions for 11.1
|
|
; CHECK-NEXT: ; Note: extra DXIL module flags:
|
|
; CHECK-NEXT: ;
|
|
; CHECK-NEXT: ; Shader Flags for Module Functions
|
|
|
|
; CHECK: ; Function test_fdiv_double : 0x00000044
|
|
define double @test_fdiv_double(double %a, double %b) #0 {
|
|
%res = fdiv double %a, %b
|
|
ret double %res
|
|
}
|
|
|
|
; CHECK: ; Function test_uitofp_i64 : 0x00000044
|
|
define double @test_uitofp_i64(i64 %a) #0 {
|
|
%r = uitofp i64 %a to double
|
|
ret double %r
|
|
}
|
|
|
|
; CHECK: ; Function test_sitofp_i64 : 0x00000044
|
|
define double @test_sitofp_i64(i64 %a) #0 {
|
|
%r = sitofp i64 %a to double
|
|
ret double %r
|
|
}
|
|
|
|
; CHECK: ; Function test_fptoui_i32 : 0x00000044
|
|
define i32 @test_fptoui_i32(double %a) #0 {
|
|
%r = fptoui double %a to i32
|
|
ret i32 %r
|
|
}
|
|
|
|
; CHECK: ; Function test_fptosi_i64 : 0x00000044
|
|
define i64 @test_fptosi_i64(double %a) #0 {
|
|
%r = fptosi double %a to i64
|
|
ret i64 %r
|
|
}
|
|
|
|
attributes #0 = { convergent norecurse nounwind "hlsl.export"}
|