51 lines
887 B
Go
51 lines
887 B
Go
|
|
package pipeline
|
||
|
|
|
||
|
|
import (
|
||
|
|
"reflect"
|
||
|
|
|
||
|
|
"zworld/engine/renderapi/renderpass"
|
||
|
|
"zworld/engine/renderapi/shader"
|
||
|
|
"zworld/engine/renderapi/vertex"
|
||
|
|
|
||
|
|
"github.com/vkngwrapper/core/v2/core1_0"
|
||
|
|
)
|
||
|
|
|
||
|
|
type Args struct {
|
||
|
|
Key string
|
||
|
|
Pass renderpass.T
|
||
|
|
Subpass renderpass.Name
|
||
|
|
Layout Layout
|
||
|
|
Shader shader.T
|
||
|
|
Pointers vertex.Pointers
|
||
|
|
|
||
|
|
Primitive vertex.Primitive
|
||
|
|
PolygonFillMode core1_0.PolygonMode
|
||
|
|
CullMode vertex.CullMode
|
||
|
|
|
||
|
|
DepthTest bool
|
||
|
|
DepthWrite bool
|
||
|
|
DepthClamp bool
|
||
|
|
DepthFunc core1_0.CompareOp
|
||
|
|
|
||
|
|
StencilTest bool
|
||
|
|
}
|
||
|
|
|
||
|
|
func (args *Args) defaults() {
|
||
|
|
if args.DepthFunc == 0 {
|
||
|
|
args.DepthFunc = core1_0.CompareOpLessOrEqual
|
||
|
|
}
|
||
|
|
if args.Primitive == 0 {
|
||
|
|
args.Primitive = vertex.Triangles
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
type PushConstant struct {
|
||
|
|
Stages core1_0.ShaderStageFlags
|
||
|
|
Type any
|
||
|
|
}
|
||
|
|
|
||
|
|
func (p *PushConstant) Size() int {
|
||
|
|
t := reflect.TypeOf(p.Type)
|
||
|
|
return int(t.Size())
|
||
|
|
}
|