Skip to content

Commit 51ff280

Browse files
Joao SaffranJoao Saffran
authored andcommitted
format
1 parent ffcff83 commit 51ff280

File tree

4 files changed

+10
-9
lines changed

4 files changed

+10
-9
lines changed

llvm/lib/Target/DirectX/DXILPostOptimizationValidation.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
#include "llvm/IR/Module.h"
2020
#include "llvm/InitializePasses.h"
2121
#include "llvm/Support/DXILABI.h"
22-
#include "llvm/Support/ErrorHandling.h"
2322

2423
#define DEBUG_TYPE "dxil-post-optimization-validation"
2524

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
; RUN: opt -S -passes='dxil-post-optimization-validation' %s 2>&1
2-
; expected-no-diagnostics
1+
; RUN: opt -S -passes='dxil-post-optimization-validation' %s
2+
; This is a valid case where no resource is being used
33
target triple = "dxil-pc-shadermodel6.6-pixel"
44

55
define void @CSMain() #0 {
@@ -11,5 +11,7 @@ attributes #0 = { noinline nounwind "exp-shader"="cs" "hlsl.numthreads"="1,2,1"
1111
!dx.rootsignatures = !{!0}
1212

1313
!0 = !{ptr @CSMain, !1, i32 2}
14-
!1 = !{!2}
15-
!2 = !{ !"RootFlags", i32 294 } ; 32 = deny_pixel/hull/vertex/amplification_shader_root_access
14+
!1 = !{!2, !3, !4}
15+
!2 = !{!"RootConstants", i32 0, i32 2, i32 0, i32 4}
16+
!3 = !{ !"RootFlags", i32 294 } ; 32 = deny_pixel/hull/vertex/amplification_shader_root_access
17+
!4 = !{ !"RootSRV", i32 0, i32 1, i32 0, i32 0 }

llvm/test/CodeGen/DirectX/rootsignature-validation-deny-shader.ll

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
; RUN: opt -S -passes='dxil-post-optimization-validation' %s 2>&1
2-
; expected-no-diagnostics
1+
; RUN: opt -S -passes='dxil-post-optimization-validation' %s
2+
; Valid scenario where shader stage is not blocked from accessing root bindings
33
target triple = "dxil-pc-shadermodel6.6-geometry"
44

55
define void @CSMain() #0 {
@@ -11,5 +11,6 @@ attributes #0 = { noinline nounwind "exp-shader"="cs" "hlsl.numthreads"="1,2,1"
1111
!dx.rootsignatures = !{!0}
1212

1313
!0 = !{ptr @CSMain, !1, i32 2}
14-
!1 = !{!2}
14+
!1 = !{!2, !3}
1515
!2 = !{ !"RootFlags", i32 294 } ; 32 = deny_pixel/hull/vertex/amplification_shader_root_access
16+
!3 = !{ !"RootCBV", i32 0, i32 1, i32 0, i32 0 }

llvm/test/CodeGen/DirectX/rootsignature-validation-fail-deny-multiple-shader.ll

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
; RUN: not opt -S -passes='dxil-post-optimization-validation' %s 2>&1 | FileCheck %s
2-
32
; CHECK: error: Shader has root bindings but root signature uses a DENY flag to disallow root binding access to the shader stage.
43
target triple = "dxil-pc-shadermodel6.6-pixel"
54

0 commit comments

Comments
 (0)