SPIR-V and Metal?

Hello. Will or not SPIR-V Metal compiler, or not? And possible, or not?
I want to use Metal shaders in Vulkan API. Yes, in Metal I mean Metal API shaders by Apple.

I think that in theory is possible.

I also have question: can I use in Vulkan vertex shader with vertex index and freedom buffers (in Metal named as “constant” ) ?

IT’S HEAVY METAL ROCK! SPIR-V!

I can not edit message. I have also question. How to in Vulkan pass empty vertex (like Metal), pass only index buffers? And possible? I found gl_VertexID variable. Need pass indices and without vertex.

Will or not SPIR-V Metal compiler, or not? And possible, or not?

Sure; just write a compiler to compile Metal’s shading language into SPIR-V.

I also have question: can I use in Vulkan vertex shader with vertex index and freedom buffers (in Metal named as “constant” ) ?

What’s a “freedom buffer”?

How to in Vulkan pass empty vertex (like Metal), pass only index buffers?

sigh Normally, I’d chastise you for asking a basic question that could be solved by cursory examination of the available Vulkan man pages. Unfortunately… said information isn’t on the Vulkan man pages; you’d have to look it up in the specification.

In any case, VkPipelineVertexInputStateCreateInfo describes… well, exactly what it says: the vertex input state for the Vulkan rendering pipeline. You use this with vkCreateGraphicsPipeline. In that struct are two arrays which represent the buffer binding descriptions and the vertex attribute descriptions for the pipeline’s input. Both of these arrays are allowed to be zero.

So if you don’t want user-defined vertex shader inputs, just pass NULL pointers for those arrays and zero for the array counts.

When will compiler of Metal shading to SPIR-V?
But better make Vulkan Shading Language, because Metal use different termins.

[QUOTE=acterhd;39862]When will compiler of Metal shading to SPIR-V?
But better make Vulkan Shading Language, because Metal use different termins.[/QUOTE]
As soon as some one will take an effort to implement Metal shading language compiler. And Vulkan already has its own high level language called GLSL.

It’s kind of a stretch to call something “its own” when its just a minor variation of something that belongs to someone else.

regardless glslang is the sponsored “high-level language” to spir-V generator

Metal has a command-line compiler which generates LLVM bytecode. It shouldn’t be too difficult to convert that bytecode to SPIR-V. Besides, there is already a compiler from GLSL to Metal.