still working on getiting these shaders to a usable API
This commit is contained in:
@@ -27,6 +27,7 @@ use crate::util::vertex_3d::Vertex3D;
|
||||
use vulkano::pipeline::depth_stencil::{StencilFaceFlags, DynamicStencilValue};
|
||||
use crate::canvas::shader::common::{CompiledGraphicsPipeline, CompiledGraphicsPipelineHandle};
|
||||
use crate::canvas::shader::generic_shader::GenericShader;
|
||||
use vulkano::memory::pool::PotentialDedicatedAllocation::Generic;
|
||||
|
||||
/// A drawable object can be passed into a CanvasFrame to be rendered
|
||||
/// Very generic implementation. (N % 2 == 0) vertices, ditto for texture coords, and rgba color
|
||||
@@ -336,17 +337,17 @@ impl CanvasState {
|
||||
|
||||
/// Load and Compile a shader with the filename at resources/shaders
|
||||
/// Takes physical and capabilities as we don't store that in Canvas
|
||||
pub fn load_shader(&mut self,
|
||||
pub fn load_shader<T: 'static>(&mut self,
|
||||
filename: String,
|
||||
physical: PhysicalDevice,
|
||||
capabilities: Capabilities) -> Option<Arc<CompiledGraphicsPipelineHandle>> {
|
||||
capabilities: Capabilities) -> Option<Arc<CompiledGraphicsPipelineHandle>>
|
||||
where T: CompiledGraphicsPipeline {
|
||||
|
||||
let handle = Arc::new(CompiledGraphicsPipelineHandle {
|
||||
handle: self.shader_buffers.len() as u32
|
||||
});
|
||||
|
||||
|
||||
let shader : Box<dyn CompiledGraphicsPipeline> = Box::new(GenericShader::new(
|
||||
let shader : Box<dyn CompiledGraphicsPipeline> = Box::new(T::new(
|
||||
filename.clone(),
|
||||
self.device.clone(),
|
||||
handle.clone(),
|
||||
|
||||
Reference in New Issue
Block a user