mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
internal/graphicsdriver/opengl: assume custom attributes are vec4
Due to HLSL restrictions, all the attributes must have a semantics. Always assuming custom attributes are vec4 makes things simpler. Updates #2640
This commit is contained in:
parent
107189a00d
commit
ed45843c13
@ -114,17 +114,17 @@ func init() {
|
||||
},
|
||||
}
|
||||
n := theArrayBufferLayout.float32Count()
|
||||
if n > graphics.VertexFloatCount {
|
||||
panic("opengl: the array buffer layout is too large")
|
||||
diff := graphics.VertexFloatCount - n
|
||||
if diff == 0 {
|
||||
return
|
||||
}
|
||||
if n < graphics.VertexFloatCount {
|
||||
d := graphics.VertexFloatCount - n
|
||||
if d > 4 {
|
||||
panic("opengl: the array buffer layout is too small")
|
||||
}
|
||||
if diff%4 != 0 {
|
||||
panic("opengl: unexpected attribute layout")
|
||||
}
|
||||
for i := 0; i < diff/4; i++ {
|
||||
theArrayBufferLayout.addPart(arrayBufferLayoutPart{
|
||||
name: "A3",
|
||||
num: d,
|
||||
name: fmt.Sprintf("A%d", i+3),
|
||||
num: 4,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user