// RUN: mlir-translate --no-implicit-module --split-input-file --test-spirv-roundtrip %s | FileCheck %s // RUN: %if spirv-tools %{ rm -rf %t %} // RUN: %if spirv-tools %{ mkdir %t %} // RUN: %if spirv-tools %{ mlir-translate --no-implicit-module --serialize-spirv --split-input-file --spirv-save-validation-files-with-prefix=%t/module %s %} // RUN: %if spirv-tools %{ spirv-val %t %} spirv.module Logical GLSL450 requires #spirv.vce { // CHECK-LABEL: @emit_mesh_tasks spirv.func @emit_mesh_tasks() "None" { %0 = spirv.Constant 1 : i32 // CHECK: spirv.EXT.EmitMeshTasks {{%.*}}, {{%.*}}, {{%.*}} : i32, i32, i32 spirv.EXT.EmitMeshTasks %0, %0, %0 : i32, i32, i32 } // CHECK-LABEL: @set_mesh_outputs spirv.func @set_mesh_outputs(%0 : i32, %1 : i32) "None" { // CHECK: spirv.EXT.SetMeshOutputs {{%.*}}, {{%.*}} : i32, i32 spirv.EXT.SetMeshOutputs %0, %1 : i32, i32 spirv.Return } // CHECK: spirv.EntryPoint "TaskEXT" {{@.*}} spirv.EntryPoint "TaskEXT" @emit_mesh_tasks } // ----- spirv.module Logical GLSL450 requires #spirv.vce { spirv.GlobalVariable @payload : !spirv.ptr // CHECK-LABEL: @emit_mesh_tasks_payload spirv.func @emit_mesh_tasks_payload() "None" { %0 = spirv.Constant 1 : i32 %1 = spirv.mlir.addressof @payload : !spirv.ptr // CHECK: spirv.EXT.EmitMeshTasks {{%.*}}, {{%.*}}, {{%.*}}, {{%.*}} : i32, i32, i32, !spirv.ptr spirv.EXT.EmitMeshTasks %0, %0, %0, %1 : i32, i32, i32, !spirv.ptr } // CHECK: spirv.EntryPoint "TaskEXT" {{@.*}}, {{@.*}} spirv.EntryPoint "TaskEXT" @emit_mesh_tasks_payload, @payload }