Make compute shaders work

This commit is contained in:
Pierre Krieger 2016-03-29 10:11:51 +02:00
parent 56a27e6390
commit 106664c156
2 changed files with 13 additions and 1 deletions

View File

@ -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<Layout>"),
format!("compute_shader_entry_point(::std::ffi::CStr::from_ptr(NAME.as_ptr() as *const _), Layout)"))
},
enums::ExecutionModel::ExecutionModelKernel => panic!("Kernels are not supported"),

View File

@ -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 {