mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-26 02:42:02 +01:00
shaderir: Implement sampler2D
This commit is contained in:
parent
316e502f4b
commit
8f4e93338c
@ -86,8 +86,6 @@ func (p *Program) glslType(t *Type) string {
|
||||
switch t.Main {
|
||||
case None:
|
||||
return "void"
|
||||
case Image2D:
|
||||
panic("not implemented")
|
||||
case Array:
|
||||
panic("not implemented")
|
||||
case Struct:
|
||||
@ -101,8 +99,6 @@ func (p *Program) glslVarDecl(t *Type, varname string) string {
|
||||
switch t.Main {
|
||||
case None:
|
||||
return "?(none)"
|
||||
case Image2D:
|
||||
panic("not implemented")
|
||||
case Array:
|
||||
panic("not implemented")
|
||||
case Struct:
|
||||
|
@ -47,8 +47,8 @@ func (t *Type) serialize() string {
|
||||
return "mat3"
|
||||
case Mat4:
|
||||
return "mat4"
|
||||
case Image2D:
|
||||
return "image2d"
|
||||
case Sampler2D:
|
||||
return "sampler2D"
|
||||
case Array:
|
||||
return fmt.Sprintf("%s[%d]", t.Sub[0].serialize(), t.Length)
|
||||
case Struct:
|
||||
@ -78,7 +78,7 @@ const (
|
||||
Mat2
|
||||
Mat3
|
||||
Mat4
|
||||
Image2D
|
||||
Sampler2D
|
||||
Array
|
||||
Struct
|
||||
)
|
||||
@ -105,8 +105,8 @@ func (t BasicType) Glsl() string {
|
||||
return "mat3"
|
||||
case Mat4:
|
||||
return "mat4"
|
||||
case Image2D:
|
||||
return "?(image2d)"
|
||||
case Sampler2D:
|
||||
return "sampler2D"
|
||||
case Array:
|
||||
// First-class array is not available on GLSL ES 2.
|
||||
return "?(array)"
|
||||
|
Loading…
Reference in New Issue
Block a user