Skip to content

Commit fb22e7c

Browse files
committed
[SPIR-V] Add Vertex execution model
Adds backend handling of the vertex shader type compiling from HLSL.
1 parent f43aaf9 commit fb22e7c

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

llvm/lib/Target/SPIRV/SPIRVCallLowering.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,8 @@ getExecutionModel(const SPIRVSubtarget &STI, const Function &F) {
302302
const auto value = attribute.getValueAsString();
303303
if (value == "compute")
304304
return SPIRV::ExecutionModel::GLCompute;
305+
if (value == "vertex")
306+
return SPIRV::ExecutionModel::Vertex;
305307

306308
report_fatal_error("This HLSL entry point is not supported by this backend.");
307309
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
; RUN: llc -O0 -mtriple=spirv-unknown-vulkan1.3-vertex %s -o - | FileCheck %s
2+
; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv-unknown-vulkan1.3-vertex %s -o - -filetype=obj | spirv-val %}
3+
4+
; CHECK: OpCapability Shader
5+
; CHECK: OpEntryPoint Vertex %[[#entry:]] "main"
6+
7+
define void @main() #1 {
8+
entry:
9+
ret void
10+
}
11+
12+
attributes #1 = { "hlsl.shader"="vertex" }

0 commit comments

Comments
 (0)