-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgeometry.go
More file actions
48 lines (43 loc) · 1.29 KB
/
geometry.go
File metadata and controls
48 lines (43 loc) · 1.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
package gputypes
// Extent3D describes a 3D size.
//
// It is used for texture dimensions and copy operations.
// For 2D textures, DepthOrArrayLayers represents the array layer count.
// For 3D textures, it represents the depth.
type Extent3D struct {
// Width is the size in the X dimension (must be > 0).
Width uint32
// Height is the size in the Y dimension (must be > 0).
Height uint32
// DepthOrArrayLayers is the size in Z or array layer count (must be > 0).
DepthOrArrayLayers uint32
}
// NewExtent2D creates an Extent3D for a 2D texture with 1 layer.
func NewExtent2D(width, height uint32) Extent3D {
return Extent3D{
Width: width,
Height: height,
DepthOrArrayLayers: 1,
}
}
// NewExtent3D creates an Extent3D for a 3D texture.
func NewExtent3D(width, height, depth uint32) Extent3D {
return Extent3D{
Width: width,
Height: height,
DepthOrArrayLayers: depth,
}
}
// Origin3D describes a 3D origin point.
//
// It is used to specify the starting point for texture copy operations.
type Origin3D struct {
// X is the X coordinate.
X uint32
// Y is the Y coordinate.
Y uint32
// Z is the Z coordinate (or array layer for 2D array textures).
Z uint32
}
// OriginZero is the origin at (0, 0, 0).
var OriginZero = Origin3D{X: 0, Y: 0, Z: 0}