Closed Pat-Lafon closed 4 years ago
The title of this issue was a little open ended but all the points in the above comment have been implemented. Most things related to bindings were reusable after some massaging and we currently have one graphics specific bind function(bind_vertex) with bind functions to implement textures on the way. The shader! macro was abstracted out and each library has it's own macro that wraps it to produce a corresponding ComputeShader or GraphicsShader. Having a VertexShader and FragmentShader as separate structs instead of sharing GraphicsShader might be useful. The compile/run functions are written but almost constantly iterated on. Pipe on the other hand is in a good spot and is modeled off of the compute pipe function
Factor out the generic parts of wgpu_compute_header to use for wgpu_graphics_header. A new PROGRAM struct with compile/pipe and run functions will be needed. It would be nice if things like BIND_CONTEXT and bind/read operations can be reused with their corresponding static checks. It's a little unclear whether the shader! macro can be reused.