From b71f3f86a8ebcafcf33857a3c5e631d0e5784d63 Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Fri, 23 Aug 2024 09:58:28 +0900 Subject: [PATCH] ebiten: add check that graphics.VertexFloatCount and Vertex match --- image.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/image.go b/image.go index 146c1a13c..aa2daf9bf 100644 --- a/image.go +++ b/image.go @@ -18,6 +18,7 @@ import ( "fmt" "image" "image/color" + "unsafe" "github.com/hajimehoshi/ebiten/v2/internal/affine" "github.com/hajimehoshi/ebiten/v2/internal/atlas" @@ -296,6 +297,8 @@ type Vertex struct { ColorA float32 } +var _ [0]byte = [unsafe.Sizeof(Vertex{}) - unsafe.Sizeof(float32(0))*graphics.VertexFloatCount]byte{} + // Address represents a sampler address mode. type Address int