diff --git a/vulkano-shaders/src/lib.rs b/vulkano-shaders/src/lib.rs index b29a8243..92474e1c 100644 --- a/vulkano-shaders/src/lib.rs +++ b/vulkano-shaders/src/lib.rs @@ -257,7 +257,8 @@ fn write_entry_point(doc: &parse::Spirv, instruction: &parse::Instruction) -> St }, enums::ExecutionModel::ExecutionModelGLCompute => { - (format!("::vulkano::shader::ComputeShaderEntryPoint"), format!("compute_shader_entry_point")) + (format!("::vulkano::shader::ComputeShaderEntryPoint"), + format!("compute_shader_entry_point(::std::ffi::CStr::from_ptr(NAME.as_ptr() as *const _), Layout)")) }, enums::ExecutionModel::ExecutionModelKernel => panic!("Kernels are not supported"), diff --git a/vulkano/src/shader.rs b/vulkano/src/shader.rs index 61fd83d5..69475170 100644 --- a/vulkano/src/shader.rs +++ b/vulkano/src/shader.rs @@ -102,6 +102,17 @@ impl ShaderModule { marker: PhantomData, } } + + #[inline] + pub unsafe fn compute_shader_entry_point<'a, L>(&'a self, name: &'a CStr, layout: L) + -> ComputeShaderEntryPoint<'a, L> + { + ComputeShaderEntryPoint { + module: self, + name: name, + layout: layout, + } + } } unsafe impl VulkanObject for ShaderModule {