Skip to content

Commit

Permalink
Check spir-v version
Browse files Browse the repository at this point in the history
  • Loading branch information
s-perron committed Sep 17, 2024
1 parent b5403c4 commit cfe7889
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tools/clang/lib/Headers/hlsl/vk/khr/cooperative_matrix.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
// TODO: Add a macro to HLSL to be able to check the Vulkan version being
// targeted.

#if __SPIRV_MAJOR_VERSION__ == 1 && __SPIRV_MINOR_VERSION__ < 6
#error "CooperativeMatrix requires a minimum of SPIR-V 1.6"
#endif

#include "vk/spirv.h"

namespace vk {
Expand Down
8 changes: 8 additions & 0 deletions tools/clang/test/CodeGenSPIRV/coopmatrix.old.spirv.hlsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// RUN: not dxc -fspv-target-env=vulkan1.1 -T cs_6_0 -E main -spirv -HV 2021 -I %hlsl_headers -DTYPE=int %s 2>&1 | FileCheck %s --check-prefix=CHECK --check-prefix=INTEGERS --check-prefix=INT32

#include "vk/khr/cooperative_matrix.h"

[numthreads(64, 1, 1)] void main() {
}

// CHECK: error: "CooperativeMatrix requires a minimum of SPIR-V 1.6"

0 comments on commit cfe7889

Please sign in to comment.