Struct stark::graphics::GraphicsState [−][src]
pub struct GraphicsState<B: Backend> {}Show fields
surface_extent: Extent2D, instance: B::Instance, surface: Option<B::Surface>, adapter: Adapter<B>, device: B::Device, queue_group: QueueGroup<B>, surface_color_format: Format, render_passes: Vec<B::RenderPass>, framebuffer: Option<B::Framebuffer>, command_pool: Option<B::CommandPool>, command_buffers: Vec<B::CommandBuffer>, vertex_memory: Vec<B::Memory>, vertex_buffers: Vec<B::Buffer>, pipeline_layouts: Vec<B::PipelineLayout>, pipelines: Vec<B::GraphicsPipeline>, submission_complete_fence: Option<B::Fence>, rendering_complete_semaphore: Option<B::Semaphore>,
Expand description
Stores all persistent gfx-hal
(Vulkan) objects
Fields
surface_extent: Extent2D
instance: B::Instance
surface: Option<B::Surface>
adapter: Adapter<B>
device: B::Device
queue_group: QueueGroup<B>
surface_color_format: Format
render_passes: Vec<B::RenderPass>
framebuffer: Option<B::Framebuffer>
command_pool: Option<B::CommandPool>
command_buffers: Vec<B::CommandBuffer>
vertex_memory: Vec<B::Memory>
vertex_buffers: Vec<B::Buffer>
pipeline_layouts: Vec<B::PipelineLayout>
pipelines: Vec<B::GraphicsPipeline>
submission_complete_fence: Option<B::Fence>
rendering_complete_semaphore: Option<B::Semaphore>
Implementations
impl<B: Backend> GraphicsState<B>
[src]
impl<B: Backend> GraphicsState<B>
[src]pub fn new(window: &FrameHandle, name: &str, width: u32, height: u32) -> Self
[src]
pub fn new(window: &FrameHandle, name: &str, width: u32, height: u32) -> Self
[src]Initialize the graphics system and track necessary state
pub fn draw_clear_frame(&mut self, color: [f32; 4]) -> Result<(), &str>
[src]
pub fn draw_clear_frame(&mut self, color: [f32; 4]) -> Result<(), &str>
[src]Draw a frame that is cleared to the specified color
pub fn config_swapchain(&mut self)
[src]
pub fn config_swapchain(&mut self)
[src]Reconfigure the swapchain (usually due to new surface extent)
pub fn set_extent(&mut self, width: u32, height: u32)
[src]
pub fn set_extent(&mut self, width: u32, height: u32)
[src]Set the size of the 2D graphics surface, in pixels
unsafe fn make_buffer(
&mut self,
buffer_len: u64,
usage: Usage,
properties: Properties
) -> (B::Memory, B::Buffer)
[src]
unsafe fn make_buffer(
&mut self,
buffer_len: u64,
usage: Usage,
properties: Properties
) -> (B::Memory, B::Buffer)
[src]Create a new buffer for graphics processing and bind its memory
fn compile_shader(glsl: &str, shader_kind: ShaderKind) -> Vec<u32>
[src]
fn compile_shader(glsl: &str, shader_kind: ShaderKind) -> Vec<u32>
[src]Compile GLSL shader code into SPIR-V
unsafe fn make_pipeline(
&mut self,
pipeline_layout: &B::PipelineLayout,
vertex_shader: &str,
fragment_shader: &str,
primitive_type: Primitive
) -> B::GraphicsPipeline
[src]
unsafe fn make_pipeline(
&mut self,
pipeline_layout: &B::PipelineLayout,
vertex_shader: &str,
fragment_shader: &str,
primitive_type: Primitive
) -> B::GraphicsPipeline
[src]Generate a basic graphics pipeline
Trait Implementations
Auto Trait Implementations
impl<B> RefUnwindSafe for GraphicsState<B> where
<B as Backend>::Buffer: RefUnwindSafe,
<B as Backend>::CommandBuffer: RefUnwindSafe,
<B as Backend>::CommandPool: RefUnwindSafe,
<B as Backend>::Device: RefUnwindSafe,
<B as Backend>::Fence: RefUnwindSafe,
<B as Backend>::Framebuffer: RefUnwindSafe,
<B as Backend>::GraphicsPipeline: RefUnwindSafe,
<B as Backend>::Instance: RefUnwindSafe,
<B as Backend>::Memory: RefUnwindSafe,
<B as Backend>::PhysicalDevice: RefUnwindSafe,
<B as Backend>::PipelineLayout: RefUnwindSafe,
<B as Backend>::Queue: RefUnwindSafe,
<B as Backend>::QueueFamily: RefUnwindSafe,
<B as Backend>::RenderPass: RefUnwindSafe,
<B as Backend>::Semaphore: RefUnwindSafe,
<B as Backend>::Surface: RefUnwindSafe,
<B as Backend>::Buffer: RefUnwindSafe,
<B as Backend>::CommandBuffer: RefUnwindSafe,
<B as Backend>::CommandPool: RefUnwindSafe,
<B as Backend>::Device: RefUnwindSafe,
<B as Backend>::Fence: RefUnwindSafe,
<B as Backend>::Framebuffer: RefUnwindSafe,
<B as Backend>::GraphicsPipeline: RefUnwindSafe,
<B as Backend>::Instance: RefUnwindSafe,
<B as Backend>::Memory: RefUnwindSafe,
<B as Backend>::PhysicalDevice: RefUnwindSafe,
<B as Backend>::PipelineLayout: RefUnwindSafe,
<B as Backend>::Queue: RefUnwindSafe,
<B as Backend>::QueueFamily: RefUnwindSafe,
<B as Backend>::RenderPass: RefUnwindSafe,
<B as Backend>::Semaphore: RefUnwindSafe,
<B as Backend>::Surface: RefUnwindSafe,
impl<B> Send for GraphicsState<B>
impl<B> Sync for GraphicsState<B>
impl<B> Unpin for GraphicsState<B> where
<B as Backend>::Buffer: Unpin,
<B as Backend>::CommandBuffer: Unpin,
<B as Backend>::CommandPool: Unpin,
<B as Backend>::Device: Unpin,
<B as Backend>::Fence: Unpin,
<B as Backend>::Framebuffer: Unpin,
<B as Backend>::GraphicsPipeline: Unpin,
<B as Backend>::Instance: Unpin,
<B as Backend>::Memory: Unpin,
<B as Backend>::PhysicalDevice: Unpin,
<B as Backend>::PipelineLayout: Unpin,
<B as Backend>::Queue: Unpin,
<B as Backend>::QueueFamily: Unpin,
<B as Backend>::RenderPass: Unpin,
<B as Backend>::Semaphore: Unpin,
<B as Backend>::Surface: Unpin,
<B as Backend>::Buffer: Unpin,
<B as Backend>::CommandBuffer: Unpin,
<B as Backend>::CommandPool: Unpin,
<B as Backend>::Device: Unpin,
<B as Backend>::Fence: Unpin,
<B as Backend>::Framebuffer: Unpin,
<B as Backend>::GraphicsPipeline: Unpin,
<B as Backend>::Instance: Unpin,
<B as Backend>::Memory: Unpin,
<B as Backend>::PhysicalDevice: Unpin,
<B as Backend>::PipelineLayout: Unpin,
<B as Backend>::Queue: Unpin,
<B as Backend>::QueueFamily: Unpin,
<B as Backend>::RenderPass: Unpin,
<B as Backend>::Semaphore: Unpin,
<B as Backend>::Surface: Unpin,
impl<B> UnwindSafe for GraphicsState<B> where
<B as Backend>::Buffer: UnwindSafe,
<B as Backend>::CommandBuffer: UnwindSafe,
<B as Backend>::CommandPool: UnwindSafe,
<B as Backend>::Device: UnwindSafe,
<B as Backend>::Fence: UnwindSafe,
<B as Backend>::Framebuffer: UnwindSafe,
<B as Backend>::GraphicsPipeline: UnwindSafe,
<B as Backend>::Instance: UnwindSafe,
<B as Backend>::Memory: UnwindSafe,
<B as Backend>::PhysicalDevice: UnwindSafe,
<B as Backend>::PipelineLayout: UnwindSafe,
<B as Backend>::Queue: UnwindSafe,
<B as Backend>::QueueFamily: UnwindSafe,
<B as Backend>::RenderPass: UnwindSafe,
<B as Backend>::Semaphore: UnwindSafe,
<B as Backend>::Surface: UnwindSafe,
<B as Backend>::Buffer: UnwindSafe,
<B as Backend>::CommandBuffer: UnwindSafe,
<B as Backend>::CommandPool: UnwindSafe,
<B as Backend>::Device: UnwindSafe,
<B as Backend>::Fence: UnwindSafe,
<B as Backend>::Framebuffer: UnwindSafe,
<B as Backend>::GraphicsPipeline: UnwindSafe,
<B as Backend>::Instance: UnwindSafe,
<B as Backend>::Memory: UnwindSafe,
<B as Backend>::PhysicalDevice: UnwindSafe,
<B as Backend>::PipelineLayout: UnwindSafe,
<B as Backend>::Queue: UnwindSafe,
<B as Backend>::QueueFamily: UnwindSafe,
<B as Backend>::RenderPass: UnwindSafe,
<B as Backend>::Semaphore: UnwindSafe,
<B as Backend>::Surface: UnwindSafe,