///
/// create a frame buffer with only color & depth render targets
///
create a frame buffer with only color & depth render targets
create a frame buffer with only color & depth render targets
pub fn create_color_depth_frame_buffer(driver: &mut DriverPtr, width: usize, height: usize) -> Option<FrameBufferPtr> {
    let color_tex_desc      = SamplerDesc::default(width, height).with_pixel_format(PixelFormat::RGBA8(MinMagFilter::default()));
    let color_buffer_desc   = TextureDesc { sampler_desc: color_tex_desc, payload: None };
    let color_buffer        = driver.create_texture(color_buffer_desc).unwrap();
    let depth_tex_desc      = SamplerDesc::default(width, height).with_pixel_format(PixelFormat::D32);
    let depth_buffer_desc   = RenderTargetDesc { sampler_desc: depth_tex_desc, sample_count: 0 };
    let depth_buffer        = driver.create_render_target(depth_buffer_desc).unwrap();
    let fb_desc             = FrameBufferDesc {
        color_attachements: [Some(SurfaceAttachment::Texture(color_buffer)), None, None, None],
        depth_stencil_attachement: SurfaceAttachment::RenderTarget(depth_buffer)
    };
    driver.create_frame_buffer(fb_desc)
}
pub fn create_color_depth_frame_buffer ( driver : & mut DriverPtr , width : usize , height : usize ) -> Option < FrameBufferPtr > { let color_tex_desc = SamplerDesc :: default ( width , height ) . with_pixel_format ( PixelFormat :: RGBA8 ( MinMagFilter :: default ( ) ) ) ; let color_buffer_desc = TextureDesc { sampler_desc : color_tex_desc , payload : None } ; let color_buffer = driver . create_texture ( color_buffer_desc ) . unwrap ( ) ; let depth_tex_desc = SamplerDesc :: default ( width , height ) . with_pixel_format ( PixelFormat :: D32 ) ; let depth_buffer_desc = RenderTargetDesc { sampler_desc : depth_tex_desc , sample_count : 0 } ; let depth_buffer = driver . create_render_target ( depth_buffer_desc ) . unwrap ( ) ; let fb_desc = FrameBufferDesc { color_attachements : [ Some ( SurfaceAttachment :: Texture ( color_buffer ) ) , None , None , None ] , depth_stencil_attachement : SurfaceAttachment :: RenderTarget ( depth_buffer ) } ; driver . create_frame_buffer ( fb_desc ) }
create a frame buffer with only color & depth render targets
create a frame buffer with only color & depth render targets
driver
&mut DriverPtr
width
usize
height
usize