aboutsummaryrefslogtreecommitdiff
path: root/vendor/gioui.org/shader/shader.go
blob: e1263c1edb76434bedc2e0219ba347bf7197e329 (plain)
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
// SPDX-License-Identifier: Unlicense OR MIT

package shader

type Sources struct {
	Name           string
	SPIRV          string
	GLSL100ES      string
	GLSL150        string
	DXBC           string
	MetalLib       string
	Uniforms       UniformsReflection
	Inputs         []InputLocation
	Textures       []TextureBinding
	StorageBuffers []BufferBinding
	Images         []ImageBinding
	WorkgroupSize  [3]int
}

type UniformsReflection struct {
	Locations []UniformLocation
	Size      int
}

type ImageBinding struct {
	Name    string
	Binding int
}

type BufferBinding struct {
	Name    string
	Binding int
}

type TextureBinding struct {
	Name    string
	Binding int
}

type UniformLocation struct {
	Name   string
	Type   DataType
	Size   int
	Offset int
}

type InputLocation struct {
	// For GLSL.
	Name     string
	Location int
	// For HLSL.
	Semantic      string
	SemanticIndex int

	Type DataType
	Size int
}

type DataType uint8

const (
	DataTypeFloat DataType = iota
	DataTypeInt
	DataTypeShort
)