|
|
@ -36,36 +36,37 @@ pub struct RenderState<'a, D> where D: Device
|
|
|
|
type Uniform;
|
|
|
|
type Uniform;
|
|
|
|
type VertexArray;
|
|
|
|
type VertexArray;
|
|
|
|
type VertexAttr;
|
|
|
|
type VertexAttr;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fn create_texture(&self, format: TextureFormat, size: Vector2I) -> Self::Texture;
|
|
|
|
[*] fn create_texture(&self, format: TextureFormat, size: Vector2I) -> Self::Texture;
|
|
|
|
|
|
|
|
|
|
|
|
fn create_texture_from_data(&self,
|
|
|
|
[*] fn create_texture_from_data(&self,
|
|
|
|
format: TextureFormat,
|
|
|
|
format: TextureFormat,
|
|
|
|
size: Vector2I,
|
|
|
|
size: Vector2I,
|
|
|
|
data: [[TextureDataRef]]
|
|
|
|
data: TextureDataRef
|
|
|
|
) -> Self::Texture;
|
|
|
|
) -> Self::Texture;
|
|
|
|
|
|
|
|
|
|
|
|
**For now I'm going to create just the shader and not the pipeline**
|
|
|
|
**For now I'm going to create just the shader and not the pipeline**
|
|
|
|
fn create_shader(&self,
|
|
|
|
[*] fn create_shader(&self,
|
|
|
|
resources: &dyn ResourceLoader,
|
|
|
|
resources: &dyn ResourceLoader,
|
|
|
|
name: &str,
|
|
|
|
name: &str,
|
|
|
|
kind: ShaderKind)
|
|
|
|
kind: ShaderKind)
|
|
|
|
-> Self::Shader;
|
|
|
|
-> Self::Shader;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fn create_shader_from_source(&self,
|
|
|
|
[*] fn create_shader_from_source(&self,
|
|
|
|
name: &str,
|
|
|
|
name: &str,
|
|
|
|
source: &[u8],
|
|
|
|
source: &[u8],
|
|
|
|
kind: ShaderKind) -> Self::Shader;
|
|
|
|
kind: ShaderKind) -> Self::Shader;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fn create_vertex_array(&self) -> Self::VertexArray;
|
|
|
|
**This seems to just return a container, but what is the type of the container?**
|
|
|
|
|
|
|
|
[ ] fn create_vertex_array(&self) -> Self::VertexArray;
|
|
|
|
|
|
|
|
|
|
|
|
**This means more in GL as a program is a part of the state machine**
|
|
|
|
**This means more in GL as a program is a part of the state machine**
|
|
|
|
**In vk and metal this just returns the two shaders in one object**
|
|
|
|
**In vk and metal this just returns the two shaders in one object**
|
|
|
|
fn create_program_from_shaders(
|
|
|
|
[*] fn create_program_from_shaders(
|
|
|
|
&self,
|
|
|
|
&self,
|
|
|
|
resources: &dyn ResourceLoader,
|
|
|
|
resources: &dyn ResourceLoader,
|
|
|
|
name: &str,
|
|
|
|
name: &str,
|
|
|
@ -74,15 +75,15 @@ pub struct RenderState<'a, D> where D: Device
|
|
|
|
) -> Self::Program;
|
|
|
|
) -> Self::Program;
|
|
|
|
|
|
|
|
|
|
|
|
**This one I'm a little shakey on. Where do I get these attributes?**
|
|
|
|
**This one I'm a little shakey on. Where do I get these attributes?**
|
|
|
|
fn get_vertex_attr(&self, program: &Self::Program, name: &str) -> Option<Self::VertexAttr>;
|
|
|
|
[ ] fn get_vertex_attr(&self, program: &Self::Program, name: &str) -> Option<Self::VertexAttr>;
|
|
|
|
|
|
|
|
|
|
|
|
**This one as well, how am I storing these?**
|
|
|
|
**This function just looks up the uniform using the name**
|
|
|
|
fn get_uniform(&self, program: &Self::Program, name: &str) -> Self::Uniform;
|
|
|
|
[ ] fn get_uniform(&self, program: &Self::Program, name: &str) -> Self::Uniform;
|
|
|
|
|
|
|
|
|
|
|
|
**Probably just allocating a buffer with data. Target is just usage**
|
|
|
|
**Probably just allocating a buffer with data. Target is just usage**
|
|
|
|
**See that it passes in a borrow for Buffer, I assume we should do an**
|
|
|
|
**See that it passes in a borrow for Buffer, I assume we should do an**
|
|
|
|
**uninitialized_buffer type of deal**
|
|
|
|
**uninitialized_buffer type of deal**
|
|
|
|
fn bind_buffer(&self,
|
|
|
|
[>] fn bind_buffer(&self,
|
|
|
|
vertex_array: &Self::VertexArray,
|
|
|
|
vertex_array: &Self::VertexArray,
|
|
|
|
buffer: &Self::Buffer,
|
|
|
|
buffer: &Self::Buffer,
|
|
|
|
target: BufferTarget);
|
|
|
|
target: BufferTarget);
|
|
|
@ -95,9 +96,8 @@ pub struct RenderState<'a, D> where D: Device
|
|
|
|
attr: &Self::VertexAttr,
|
|
|
|
attr: &Self::VertexAttr,
|
|
|
|
descriptor: &VertexAttrDescriptor);
|
|
|
|
descriptor: &VertexAttrDescriptor);
|
|
|
|
|
|
|
|
|
|
|
|
**This creates the framebuffer using the **
|
|
|
|
**This creates the framebuffer using render_pass**
|
|
|
|
**render_pass and swap_image. I assume what is happening here is that**
|
|
|
|
**Since it's single-frame. We don't use the swapchain**
|
|
|
|
**the api is forcing me to genericize the swap_image into a texture**
|
|
|
|
|
|
|
|
fn create_framebuffer(&self, texture: Self::Texture) -> Self::Framebuffer;
|
|
|
|
fn create_framebuffer(&self, texture: Self::Texture) -> Self::Framebuffer;
|
|
|
|
|
|
|
|
|
|
|
|
**This just creates an empty buffer **
|
|
|
|
**This just creates an empty buffer **
|
|
|
|