mirror of
https://github.com/intel/llvm.git
synced 2026-01-26 03:56:16 +08:00
[SPIR-V] Add Vertex execution model (#142369)
Adds backend handling of the vertex shader type compiling from HLSL. Fixes #136961
This commit is contained in:
@@ -280,6 +280,8 @@ getExecutionModel(const SPIRVSubtarget &STI, const Function &F) {
|
||||
const auto value = attribute.getValueAsString();
|
||||
if (value == "compute")
|
||||
return SPIRV::ExecutionModel::GLCompute;
|
||||
if (value == "vertex")
|
||||
return SPIRV::ExecutionModel::Vertex;
|
||||
|
||||
report_fatal_error(
|
||||
"This HLSL entry point is not supported by this backend.");
|
||||
@@ -302,6 +304,8 @@ getExecutionModel(const SPIRVSubtarget &STI, const Function &F) {
|
||||
const auto value = attribute.getValueAsString();
|
||||
if (value == "compute")
|
||||
return SPIRV::ExecutionModel::GLCompute;
|
||||
if (value == "vertex")
|
||||
return SPIRV::ExecutionModel::Vertex;
|
||||
|
||||
report_fatal_error("This HLSL entry point is not supported by this backend.");
|
||||
}
|
||||
|
||||
12
llvm/test/CodeGen/SPIRV/ExecutionMode_Vertex.ll
Normal file
12
llvm/test/CodeGen/SPIRV/ExecutionMode_Vertex.ll
Normal file
@@ -0,0 +1,12 @@
|
||||
; RUN: llc -O0 -mtriple=spirv-unknown-vulkan1.3-vertex %s -o - | FileCheck %s
|
||||
; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv-unknown-vulkan1.3-vertex %s -o - -filetype=obj | spirv-val --target-env vulkan1.3 %}
|
||||
|
||||
; CHECK: OpCapability Shader
|
||||
; CHECK: OpEntryPoint Vertex %[[#entry:]] "main"
|
||||
|
||||
define void @main() #1 {
|
||||
entry:
|
||||
ret void
|
||||
}
|
||||
|
||||
attributes #1 = { "hlsl.shader"="vertex" }
|
||||
Reference in New Issue
Block a user