gpu: setup OpenGL ES texture uniforms automatically from shader metadata

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2020-02-20 21:39:29 +01:00
parent 5c359bbf89
commit 4e3bfd5b1b
6 changed files with 77 additions and 30 deletions
+6 -4
View File
@@ -46,6 +46,12 @@ type ShaderSources struct {
Uniforms []UniformLocation
UniformSize int
Inputs []InputLocation
Textures []TextureBinding
}
type TextureBinding struct {
Name string
Binding int
}
type UniformLocation struct {
@@ -109,12 +115,8 @@ type Program interface {
Release()
SetVertexUniforms(buf Buffer)
SetFragmentUniforms(buf Buffer)
UniformFor(uniform string) Uniform
Uniform1i(u Uniform, v int)
}
type Uniform interface{}
type Buffer interface {
BindVertex(stride, offset int)
BindIndex()