bind-vertex-format ( program-instance buffer-ptr format -- ) (original) (raw)

bind-vertex-format ( program-instance buffer-ptr format -- )

Vocabulary
gpu.shaders.private

Inputs

program-instance an object
buffer-ptr an object
format an object

Outputs
None

Definition

IN: gpu.shaders.private

GENERIC: bind-vertex-format
( program-instance buffer-ptr format -- )

Methods

USING: combinators gpu.buffers gpu.demos.bunny
gpu.shaders.private kernel ;

M: bunny-vertex bind-vertex-format
drop vertex-buffer [
{
[
"vertex" 3 5126 0 32 0
(bind-float-vertex-attribute)
]
[ 2drop ]
[
"normal" 3 5126 0 32 16
(bind-float-vertex-attribute)
]
[ 2drop ]
} 2cleave
] with-buffer-ptr ;

USING: combinators game.models.collada.private gpu.buffers
gpu.shaders.private kernel ;

M: collada-vertex-format bind-vertex-format
drop vertex-buffer [
{
[
"POSITION" 3 5126 0 32 0
(bind-float-vertex-attribute)
]
[
"NORMAL" 3 5126 0 32 12
(bind-float-vertex-attribute)
]
[
"TEXCOORD" 2 5126 0 32 24
(bind-float-vertex-attribute)
]
} 2cleave
] with-buffer-ptr ;

USING: combinators game.debug.private gpu.buffers
gpu.shaders.private kernel ;

M: debug-shapes-vertex-format bind-vertex-format
drop vertex-buffer [
{
[
"a_position" 3 5126 0 24 0
(bind-float-vertex-attribute)
]
[
"a_color" 3 5126 0 24 12
(bind-float-vertex-attribute)
]
} 2cleave
] with-buffer-ptr ;

USING: combinators game.debug.private gpu.buffers
gpu.shaders.private kernel ;

M: debug-text-vertex-format bind-vertex-format
drop vertex-buffer [
{
[
"a_position" 2 5126 0 16 0
(bind-float-vertex-attribute)
]
[
"a_texcoord" 2 5126 0 16 8
(bind-float-vertex-attribute)
]
} 2cleave
] with-buffer-ptr ;

USING: combinators game.models.obj.private gpu.buffers
gpu.shaders.private kernel ;

M: obj-vertex-format bind-vertex-format
drop vertex-buffer [
{
[
"POSITION" 3 5126 0 32 0
(bind-float-vertex-attribute)
]
[
"TEXCOORD" 2 5126 0 32 12
(bind-float-vertex-attribute)
]
[
"NORMAL" 3 5126 0 32 20
(bind-float-vertex-attribute)
]
} 2cleave
] with-buffer-ptr ;

USING: combinators gpu.buffers gpu.shaders.private kernel
papier.map ;

M: papier-vertex bind-vertex-format
drop vertex-buffer [
{
[
"vertex" 3 5126 0 48 0
(bind-float-vertex-attribute)
]
[ 2drop ]
[
"texcoord" 2 5126 0 48 16
(bind-float-vertex-attribute)
]
[ 2drop ]
[
"color" 4 5126 0 48 32
(bind-float-vertex-attribute)
]
} 2cleave
] with-buffer-ptr ;

USING: combinators gpu.buffers gpu.shaders.private gpu.util
kernel ;

M: window-vertex-format bind-vertex-format
drop vertex-buffer [
{
[
"vertex" 2 5126 0 8 0
(bind-float-vertex-attribute)
]
} 2cleave
] with-buffer-ptr ;

USING: combinators gml.viewer gpu.buffers gpu.shaders.private
kernel ;

M: wire-vertex-format bind-vertex-format
drop vertex-buffer [
{
[
"vertex" 3 5126 0 32 0
(bind-float-vertex-attribute)
]
[ 2drop ]
[
"color" 4 5126 0 32 16
(bind-float-vertex-attribute)
]
} 2cleave
] with-buffer-ptr ;