Allowed setting uniforms in shader
This commit is contained in:
30
pass.odin
30
pass.odin
@@ -1,5 +1,6 @@
|
||||
package renderer
|
||||
|
||||
import "core:math/linalg"
|
||||
import "core:fmt"
|
||||
|
||||
MAX_DRAW_COMMANDS_CAPACITY :: 4096
|
||||
@@ -28,8 +29,35 @@ Post_Processing_Pass :: struct {
|
||||
post_processing_nodes: [dynamic]Post_Processing_Node, // These nodes are executed after all commands have been drawn onto the render-target.
|
||||
}
|
||||
|
||||
Uniform :: union {
|
||||
Uniform_Texture,
|
||||
Uniform_Float,
|
||||
Uniform_Matrix4f32,
|
||||
Uniform_Vector3,
|
||||
}
|
||||
|
||||
Uniform_Texture :: struct {
|
||||
index: u8,
|
||||
value: ^Texture,
|
||||
}
|
||||
|
||||
Uniform_Float :: struct {
|
||||
name: string,
|
||||
value: ^f32,
|
||||
}
|
||||
|
||||
Uniform_Matrix4f32 :: struct {
|
||||
name: string,
|
||||
value: ^linalg.Matrix4f32,
|
||||
}
|
||||
|
||||
Uniform_Vector3 :: struct {
|
||||
name: string,
|
||||
value: ^[3]f32,
|
||||
}
|
||||
|
||||
Post_Processing_Node :: struct {
|
||||
input: []^Texture,
|
||||
uniforms: []Uniform,
|
||||
output: ^Render_Target,
|
||||
|
||||
program: ^Shader_Program,
|
||||
|
||||
Reference in New Issue
Block a user