Last active
August 20, 2024 13:27
-
-
Save sortofsleepy/d83e605977ad4ddac457eaa829d5b762 to your computer and use it in GitHub Desktop.
Vulkan Buffer Reference basics
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ... version, etc | |
#extension GL_EXT_shader_explicit_arithmetic_types_int64 : require | |
struct SceneDataTable { | |
uint64_t vertices; | |
}; | |
layout(buffer_reference, scalar) buffer Vertices { vec4 v[]; }; | |
layout(push_constant) uniform PushConsts { | |
SceneDataTable data; | |
} env; | |
// When using | |
Vertices verts = Vertices(env.data.vertices); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Basic reference for how to use buffer references.
Here
Vertices
with the push constant dataverts.v[index]
Note that you will have to enable Int64 support when initializing your logical device by querying and enabling the
shaderInt64
feature