veldrid icon indicating copy to clipboard operation
veldrid copied to clipboard

Sprv Support for Geometry Shaders

Open Eightvo opened this issue 5 years ago • 1 comments

The ResourceFactory contains a function CreateFromSpirv. There are 4 existing method signatures...

CreateFromSpirv(ShaderDescription computeShader); CreateFromSpirv(ShaderDescription computeShader, CrossCompileOptions opts); CreateFromSpirv(ShaderDescription vertShader, ShaderDescription fragShader); CreateFromSpirv(ShaderDescription vertShader, ShaderDescription fragShader, CrossCompileOptions opts);

I think it would be sensible to request:

CreateFromSpirv(ShaderDescription vertShader, ShaderDescription GeoShader, ShaderDescription fragShader); CreateFromSpirv(ShaderDescription vertShader, ShaderDescription GeoShader, ShaderDescription fragShader, CrossCompileOptions opts);

Is there a way to do a similar operation currently without change to veldrid?

Eightvo avatar Jan 17 '21 20:01 Eightvo

Unfortunately, geometry shaders are not a concept that is supported by all native graphics API's (specifically, Metal does not have them at all, and they are optional in Vulkan). They are supported by Veldrid, but only because they are relatively trivial to pass along to the backends that do support them, and don't require a lot of API support on my end.

Geometry shaders support MAY be possible in Veldrid.SPIRV, but there is no way to make them fully portable across backends, so I would prefer not to add them. Instead, I'd prefer to push users toward solutions that actually are portable and will work on all backends (like compute shaders).

mellinoe avatar Jan 19 '21 05:01 mellinoe