documentation

master
mitchellhansen 5 years ago
parent 268c605d32
commit 626eac4e86

@ -36,36 +36,37 @@ pub struct RenderState<'a, D> where D: Device
type Uniform;
type VertexArray;
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,
size: Vector2I,
data: [[TextureDataRef]]
data: TextureDataRef
) -> Self::Texture;
**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,
name: &str,
kind: ShaderKind)
-> Self::Shader;
fn create_shader_from_source(&self,
[*] fn create_shader_from_source(&self,
name: &str,
source: &[u8],
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**
**In vk and metal this just returns the two shaders in one object**
fn create_program_from_shaders(
[*] fn create_program_from_shaders(
&self,
resources: &dyn ResourceLoader,
name: &str,
@ -74,15 +75,15 @@ pub struct RenderState<'a, D> where D: Device
) -> Self::Program;
**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?**
fn get_uniform(&self, program: &Self::Program, name: &str) -> Self::Uniform;
**This function just looks up the uniform using the name**
[ ] fn get_uniform(&self, program: &Self::Program, name: &str) -> Self::Uniform;
**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**
**uninitialized_buffer type of deal**
fn bind_buffer(&self,
[>] fn bind_buffer(&self,
vertex_array: &Self::VertexArray,
buffer: &Self::Buffer,
target: BufferTarget);
@ -95,9 +96,8 @@ pub struct RenderState<'a, D> where D: Device
attr: &Self::VertexAttr,
descriptor: &VertexAttrDescriptor);
**This creates the framebuffer using the **
**render_pass and swap_image. I assume what is happening here is that**
**the api is forcing me to genericize the swap_image into a texture**
**This creates the framebuffer using render_pass**
**Since it's single-frame. We don't use the swapchain**
fn create_framebuffer(&self, texture: Self::Texture) -> Self::Framebuffer;
**This just creates an empty buffer **

@ -0,0 +1 @@
<mxfile host="Electron" modified="2020-03-14T07:10:12.412Z" agent="Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) draw.io/12.6.5 Chrome/80.0.3987.137 Electron/8.1.0 Safari/537.36" etag="ypTcPfAMomO7T1kEJtR-" version="12.6.5" type="device"><diagram id="GvTndCJEda6ZmCapJoGh" name="Page-1">7VtZc5swEP41fnQGcfh4jO2kzbSZydTpkUcFZKOMQIwQsd1fX2GEgapOcGbixXWezK60ID6+PXS450yj9SeBk/CWB4T1bCtY95xZz7bRCA3UT67ZlJoxKjRLQQOtqxRz+ptopaW1GQ1I2ugoOWeSJk2lz+OY+LKhw0LwVbPbgrPmUxO8JIZi7mNman/SQIaFduRZlf4zocuwfDKydEuEy85akYY44KuayrnqOVPBuSyuovWUsBy9EpfC7npP625ggsSyjcGQjQl5+vLo3WaDyff+w81osOgjRw9Obso3JoECQItcyJAveYzZVaWdCJ7FAclvaymp6vOV80QpkVI+ESk3+mviTHKlCmXEdCtZU/krN7/wtPRQa5mt9Z23wqYUYik2NaNcfKi3VWZbqbILLnMeKDGgOOJxcB/SuGi4poxV3fRwUS4WqORQ7EVbq1KeCZ+8BLFmLRZLIl/oN9xxQnkT4RFRb6HsBGFY0ufmOLBm9XLXr/rw6kJ/+wN44LiQPEA1FlgXQ68lERo0qFixhwip+gKy/o1bMAN1ghkeJDPcEWiEaDCjJTHQuRBjAEkMfd9nzDL9pG0NQP1Uae9oQhiNicGdJjNWIZVknuAtGitl3mSBfgIRkqxfBtUEQRuU2VfXH64WV1UuR2WXsJbHB9Z7BVrvw52O7U72KcRZ23Cnnj1gariTR3WxzC9uoiiT+JGRSbZYEFG2q8ftuuxsRKn5UXiPbZVGwA7peE2PHIF75AHA30T5dKEV7vdkLTNBugs8ggbefR34SymxH0bqDQ9AXnftCu59NGgC71jQyHuvI1+EjbztX5CDJ/WOxZCBAehczfa7SD7wAmi3HHKWBZDPcJpS/4jFz7Bl8TOCLH6Ghv98U4jk/mPdKcDA3eivWQQCDzgjM+CscOKHWBXW0GAZMQceLmTWGjW8rG3F0AGWeV0rFMrl+y4sC3ZnVfCd14u9lhG7IDXY8s8YNI83dg6sltRo7hyg/5caoHsJLuheAnSF13FmwMYMc+J5LXBEOjJTt7uWfp3hR/o9tiftThm85kkOpCc5sNn3LGNsa2bsiTJH2kcw9+VmJPUFTSTP59NzNXT4QNuxpWgHGZgctZi133AO5vT9qW3NYoNWsx1ar7TbJuHDjkidMDVAQ60LGzXeVJ6dDTP2paAjUeP0zlWeUT4B3etwQSd1teOVbz9ze3orZ+0TCuwhIHOBZMqjCMdBrzPnGdxxs3jvD6Grd9vcDZttYhxRP5/vSCzhjyEah2/ecUtMidW/CrZttT9nOFd/AA==</diagram></mxfile>

@ -507,6 +507,7 @@ impl CanvasState {
.unwrap().clone().get_handle() as usize
).unwrap();
if !allocated_buffers.image_vertex_buffer.is_empty() {
for (image_handle, vertex_buffer) in allocated_buffers.image_vertex_buffer.clone() {
let handle = image_handle.clone().get_handle() as usize;

Loading…
Cancel
Save