Struct three::render::BackendFactory
source · pub struct BackendFactory { /* private fields */ }
Expand description
GL resource factory.
Implementations
sourceimpl Factory
impl Factory
pub fn create_command_buffer(&mut self) -> CommandBuffer
Trait Implementations
sourceimpl Factory<Resources> for Factory
impl Factory<Resources> for Factory
sourcefn get_capabilities(&self) -> &Capabilities
fn get_capabilities(&self) -> &Capabilities
Returns the capabilities of this
Factory
. This usually depends on the graphics API being
used. Read morefn create_buffer_raw(
&mut self,
info: Info
) -> Result<RawBuffer<Resources>, CreationError>
fn create_buffer_immutable_raw(
&mut self,
data: &[u8],
stride: usize,
role: Role,
bind: Bind
) -> Result<RawBuffer<Resources>, CreationError>
sourcefn create_shader(
&mut self,
stage: Stage,
code: &[u8]
) -> Result<Shader<Resources>, CreateShaderError>
fn create_shader(
&mut self,
stage: Stage,
code: &[u8]
) -> Result<Shader<Resources>, CreateShaderError>
Compiles a shader source into a
Shader
object that can be used to create a shader
Program
. Read moresourcefn create_program(
&mut self,
shader_set: &ShaderSet<Resources>
) -> Result<Program<Resources>, CreateProgramError>
fn create_program(
&mut self,
shader_set: &ShaderSet<Resources>
) -> Result<Program<Resources>, CreateProgramError>
Creates a new shader
Program
for the supplied ShaderSet
.sourcefn create_pipeline_state_raw(
&mut self,
program: &Program<Resources>,
desc: &Descriptor
) -> Result<RawPipelineState<Resources>, CreationError>
fn create_pipeline_state_raw(
&mut self,
program: &Program<Resources>,
desc: &Descriptor
) -> Result<RawPipelineState<Resources>, CreationError>
Creates a new
RawPipelineState
. To create a safely typed PipelineState
, see the
FactoryExt
trait and pso
module, both in the gfx
crate. Read moresourcefn create_texture_raw(
&mut self,
desc: Info,
hint: Option<ChannelType>,
data_opt: Option<(&[&[u8]], Mipmap)>
) -> Result<RawTexture<Resources>, CreationError>
fn create_texture_raw(
&mut self,
desc: Info,
hint: Option<ChannelType>,
data_opt: Option<(&[&[u8]], Mipmap)>
) -> Result<RawTexture<Resources>, CreationError>
Create a new empty raw texture with no data. The channel type parameter is a hint,
required to assist backends that have no concept of typeless formats (OpenGL).
The initial data, if given, has to be provided for all mip levels and slices:
Slice0.Mip0, Slice0.Mip1, …, Slice1.Mip0, … Read more
fn view_buffer_as_shader_resource_raw(
&mut self,
hbuf: &RawBuffer<Resources>,
format: Format
) -> Result<RawShaderResourceView<Resources>, ResourceViewError>
fn view_buffer_as_unordered_access_raw(
&mut self,
_hbuf: &RawBuffer<Resources>
) -> Result<RawUnorderedAccessView<Resources>, ResourceViewError>
fn view_texture_as_shader_resource_raw(
&mut self,
htex: &RawTexture<Resources>,
desc: ResourceDesc
) -> Result<RawShaderResourceView<Resources>, ResourceViewError>
fn view_texture_as_unordered_access_raw(
&mut self,
_htex: &RawTexture<Resources>
) -> Result<RawUnorderedAccessView<Resources>, ResourceViewError>
fn view_texture_as_render_target_raw(
&mut self,
htex: &RawTexture<Resources>,
desc: RenderDesc
) -> Result<RawRenderTargetView<Resources>, TargetViewError>
fn view_texture_as_depth_stencil_raw(
&mut self,
htex: &RawTexture<Resources>,
desc: DepthStencilDesc
) -> Result<RawDepthStencilView<Resources>, TargetViewError>
fn create_sampler(&mut self, info: SamplerInfo) -> Sampler<Resources>
sourcefn read_mapping<T, 'a, 'b>(
&'a mut self,
buf: &'b Buffer<Resources, T>
) -> Result<Reader<'b, Resources, T>, Error>where
T: Copy,
fn read_mapping<T, 'a, 'b>(
&'a mut self,
buf: &'b Buffer<Resources, T>
) -> Result<Reader<'b, Resources, T>, Error>where
T: Copy,
Acquire a mapping Reader Read more
sourcefn write_mapping<T, 'a, 'b>(
&'a mut self,
buf: &'b Buffer<Resources, T>
) -> Result<Writer<'b, Resources, T>, Error>where
T: Copy,
fn write_mapping<T, 'a, 'b>(
&'a mut self,
buf: &'b Buffer<Resources, T>
) -> Result<Writer<'b, Resources, T>, Error>where
T: Copy,
Acquire a mapping Writer Read more
fn create_buffer_immutable<T>(
&mut self,
data: &[T],
role: Role,
bind: Bind
) -> Result<Buffer<R, T>, CreationError>where
T: Pod,
fn create_buffer<T>(
&mut self,
num: usize,
role: Role,
usage: Usage,
bind: Bind
) -> Result<Buffer<R, T>, CreationError>
fn create_shader_vertex(
&mut self,
code: &[u8]
) -> Result<VertexShader<R>, CreateShaderError>
fn create_shader_vertex(
&mut self,
code: &[u8]
) -> Result<VertexShader<R>, CreateShaderError>
Compiles a
VertexShader
from source.fn create_shader_hull(
&mut self,
code: &[u8]
) -> Result<HullShader<R>, CreateShaderError>
fn create_shader_hull(
&mut self,
code: &[u8]
) -> Result<HullShader<R>, CreateShaderError>
Compiles a
HullShader
from source.fn create_shader_domain(
&mut self,
code: &[u8]
) -> Result<DomainShader<R>, CreateShaderError>
fn create_shader_domain(
&mut self,
code: &[u8]
) -> Result<DomainShader<R>, CreateShaderError>
Compiles a
VertexShader
from source.fn create_shader_geometry(
&mut self,
code: &[u8]
) -> Result<GeometryShader<R>, CreateShaderError>
fn create_shader_geometry(
&mut self,
code: &[u8]
) -> Result<GeometryShader<R>, CreateShaderError>
Compiles a
GeometryShader
from source.fn create_shader_pixel(
&mut self,
code: &[u8]
) -> Result<PixelShader<R>, CreateShaderError>
fn create_shader_pixel(
&mut self,
code: &[u8]
) -> Result<PixelShader<R>, CreateShaderError>
Compiles a
PixelShader
from source. This is the same as what some APIs call a fragment
shader. Read morefn create_texture<S>(
&mut self,
kind: Kind,
levels: u8,
bind: Bind,
usage: Usage,
channel_hint: Option<ChannelType>
) -> Result<Texture<R, S>, CreationError>where
S: SurfaceTyped,
fn view_buffer_as_shader_resource<T>(
&mut self,
buf: &Buffer<R, T>
) -> Result<ShaderResourceView<R, T>, ResourceViewError>where
T: Formatted,
fn view_buffer_as_unordered_access<T>(
&mut self,
buf: &Buffer<R, T>
) -> Result<UnorderedAccessView<R, T>, ResourceViewError>
fn view_texture_as_shader_resource<T>(
&mut self,
tex: &Texture<R, <T as Formatted>::Surface>,
levels: (u8, u8),
swizzle: Swizzle
) -> Result<ShaderResourceView<R, <T as Formatted>::View>, ResourceViewError>where
T: TextureFormat,
fn view_texture_as_unordered_access<T>(
&mut self,
tex: &Texture<R, <T as Formatted>::Surface>
) -> Result<UnorderedAccessView<R, <T as Formatted>::View>, ResourceViewError>where
T: TextureFormat,
fn view_texture_as_render_target<T>(
&mut self,
tex: &Texture<R, <T as Formatted>::Surface>,
level: u8,
layer: Option<u16>
) -> Result<RenderTargetView<R, T>, TargetViewError>where
T: RenderFormat,
fn view_texture_as_depth_stencil<T>(
&mut self,
tex: &Texture<R, <T as Formatted>::Surface>,
level: u8,
layer: Option<u16>,
flags: DepthStencilFlags
) -> Result<DepthStencilView<R, T>, TargetViewError>where
T: DepthFormat,
fn view_texture_as_depth_stencil_trivial<T>(
&mut self,
tex: &Texture<R, <T as Formatted>::Surface>
) -> Result<DepthStencilView<R, T>, TargetViewError>where
T: DepthFormat,
fn create_texture_immutable_u8<T>(
&mut self,
kind: Kind,
mipmap: Mipmap,
data: &[&[u8]]
) -> Result<(Texture<R, <T as Formatted>::Surface>, ShaderResourceView<R, <T as Formatted>::View>), CombinedError>where
T: TextureFormat,
fn create_texture_immutable<T>(
&mut self,
kind: Kind,
mipmap: Mipmap,
data: &[&[<<T as Formatted>::Surface as SurfaceTyped>::DataType]]
) -> Result<(Texture<R, <T as Formatted>::Surface>, ShaderResourceView<R, <T as Formatted>::View>), CombinedError>where
T: TextureFormat,
fn create_render_target<T>(
&mut self,
width: u16,
height: u16
) -> Result<(Texture<R, <T as Formatted>::Surface>, ShaderResourceView<R, <T as Formatted>::View>, RenderTargetView<R, T>), CombinedError>where
T: RenderFormat + TextureFormat,
fn create_depth_stencil<T>(
&mut self,
width: u16,
height: u16
) -> Result<(Texture<R, <T as Formatted>::Surface>, ShaderResourceView<R, <T as Formatted>::View>, DepthStencilView<R, T>), CombinedError>where
T: DepthFormat + TextureFormat,
fn create_depth_stencil_view_only<T>(
&mut self,
width: u16,
height: u16
) -> Result<DepthStencilView<R, T>, CombinedError>where
T: DepthFormat + TextureFormat,
Auto Trait Implementations
impl !RefUnwindSafe for Factory
impl !Send for Factory
impl !Sync for Factory
impl Unpin for Factory
impl !UnwindSafe for Factory
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<R, F> FactoryExt<R> for Fwhere
R: Resources,
F: Factory<R>,
impl<R, F> FactoryExt<R> for Fwhere
R: Resources,
F: Factory<R>,
sourcefn create_vertex_buffer<T>(&mut self, vertices: &[T]) -> Buffer<R, T>where
T: Pod + Structure<Format>,
fn create_vertex_buffer<T>(&mut self, vertices: &[T]) -> Buffer<R, T>where
T: Pod + Structure<Format>,
Creates an immutable vertex buffer from the supplied vertices.
A
Slice
will have to manually be constructed. Read moresourcefn create_index_buffer<T>(&mut self, indices: T) -> IndexBuffer<R>where
T: IntoIndexBuffer<R>,
fn create_index_buffer<T>(&mut self, indices: T) -> IndexBuffer<R>where
T: IntoIndexBuffer<R>,
Creates an immutable index buffer from the supplied vertices. Read more
sourcefn create_vertex_buffer_with_slice<B, V>(
&mut self,
vertices: &[V],
indices: B
) -> (Buffer<R, V>, Slice<R>)where
V: Pod + Structure<Format>,
B: IntoIndexBuffer<R>,
fn create_vertex_buffer_with_slice<B, V>(
&mut self,
vertices: &[V],
indices: B
) -> (Buffer<R, V>, Slice<R>)where
V: Pod + Structure<Format>,
B: IntoIndexBuffer<R>,
Creates an immutable vertex buffer from the supplied vertices,
together with a
Slice
from the supplied indices. Read moresourcefn create_constant_buffer<T>(&mut self, num: usize) -> Buffer<R, T>where
T: Copy,
fn create_constant_buffer<T>(&mut self, num: usize) -> Buffer<R, T>where
T: Copy,
Creates a constant buffer for
num
identical elements of type T
.sourcefn create_upload_buffer<T>(
&mut self,
num: usize
) -> Result<Buffer<R, T>, CreationError>
fn create_upload_buffer<T>(
&mut self,
num: usize
) -> Result<Buffer<R, T>, CreationError>
Creates an upload buffer for
num
elements of type T
.sourcefn create_download_buffer<T>(
&mut self,
num: usize
) -> Result<Buffer<R, T>, CreationError>
fn create_download_buffer<T>(
&mut self,
num: usize
) -> Result<Buffer<R, T>, CreationError>
Creates a download buffer for
num
elements of type T
.sourcefn create_shader_set(
&mut self,
vs_code: &[u8],
ps_code: &[u8]
) -> Result<ShaderSet<R>, ProgramError>
fn create_shader_set(
&mut self,
vs_code: &[u8],
ps_code: &[u8]
) -> Result<ShaderSet<R>, ProgramError>
Creates a
ShaderSet
from the supplied vertex and pixel shader source code.sourcefn create_shader_set_geometry(
&mut self,
vs_code: &[u8],
gs_code: &[u8],
ps_code: &[u8]
) -> Result<ShaderSet<R>, ProgramError>
fn create_shader_set_geometry(
&mut self,
vs_code: &[u8],
gs_code: &[u8],
ps_code: &[u8]
) -> Result<ShaderSet<R>, ProgramError>
Creates a
ShaderSet
from the supplied vertex, geometry, and pixel
shader source code. Mainly used for testing. Read moresourcefn create_shader_set_tessellation(
&mut self,
vs_code: &[u8],
hs_code: &[u8],
ds_code: &[u8],
ps_code: &[u8]
) -> Result<ShaderSet<R>, ProgramError>
fn create_shader_set_tessellation(
&mut self,
vs_code: &[u8],
hs_code: &[u8],
ds_code: &[u8],
ps_code: &[u8]
) -> Result<ShaderSet<R>, ProgramError>
Creates a
ShaderSet
from the supplied vertex, hull, domain, and pixel
shader source code. Mainly used for testing. Read moresourcefn link_program(
&mut self,
vs_code: &[u8],
ps_code: &[u8]
) -> Result<Program<R>, ProgramError>
fn link_program(
&mut self,
vs_code: &[u8],
ps_code: &[u8]
) -> Result<Program<R>, ProgramError>
Creates a basic shader
Program
from the supplied vertex and pixel shader source code.sourcefn create_pipeline_state<I>(
&mut self,
shaders: &ShaderSet<R>,
primitive: Primitive,
rasterizer: Rasterizer,
init: I
) -> Result<PipelineState<R, <I as PipelineInit>::Meta>, PipelineStateError<String>>where
I: PipelineInit,
fn create_pipeline_state<I>(
&mut self,
shaders: &ShaderSet<R>,
primitive: Primitive,
rasterizer: Rasterizer,
init: I
) -> Result<PipelineState<R, <I as PipelineInit>::Meta>, PipelineStateError<String>>where
I: PipelineInit,
Similar to
create_pipeline_from_program(..)
, but takes a ShaderSet
as opposed to a
shader Program
. Read moresourcefn create_pipeline_from_program<I, 'a>(
&mut self,
program: &'a Program<R>,
primitive: Primitive,
rasterizer: Rasterizer,
init: I
) -> Result<PipelineState<R, <I as PipelineInit>::Meta>, PipelineStateError<&'a str>>where
I: PipelineInit,
fn create_pipeline_from_program<I, 'a>(
&mut self,
program: &'a Program<R>,
primitive: Primitive,
rasterizer: Rasterizer,
init: I
) -> Result<PipelineState<R, <I as PipelineInit>::Meta>, PipelineStateError<&'a str>>where
I: PipelineInit,
Creates a strongly typed
PipelineState
from its Init
structure, a shader Program
, a
primitive type and a Rasterizer
. Read moresourcefn create_pipeline_simple<I>(
&mut self,
vs: &[u8],
ps: &[u8],
init: I
) -> Result<PipelineState<R, <I as PipelineInit>::Meta>, PipelineStateError<String>>where
I: PipelineInit,
fn create_pipeline_simple<I>(
&mut self,
vs: &[u8],
ps: &[u8],
init: I
) -> Result<PipelineState<R, <I as PipelineInit>::Meta>, PipelineStateError<String>>where
I: PipelineInit,
Creates a strongly typed
PipelineState
from its Init
structure. Automatically creates a
shader Program
from a vertex and pixel shader source, as well as a Rasterizer
capable
of rendering triangle faces without culling. Read moresourcefn create_sampler_linear(&mut self) -> Sampler<R>
fn create_sampler_linear(&mut self) -> Sampler<R>
Create a linear sampler with clamping to border.
impl<T> Pointable for T
impl<T> Pointable for T
impl<T> SetParameter for T
impl<T> SetParameter for T
fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Resultwhere
T: Parameter<Self>,
fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Resultwhere
T: Parameter<Self>,
Sets
value
as a parameter of self
.