< GeeXLab Reference Guide />
> Back to Reference Guide Index
gh_vk library
Description
gh_vk is the library that allows to access to Vulkan renderer functions. It the same thing than gh_renderer but limited to Vulkan.
Number of functions: 112
- gh_vk.descriptorset_create ()
- gh_vk.descriptorset_kill ()
- gh_vk.descriptorset_build ()
- gh_vk.descriptorset_update ()
- gh_vk.descriptorset_bind ()
- gh_vk.descriptorset_add_resource_gpu_buffer ()
- gh_vk.descriptorset_update_resource_gpu_buffer ()
- gh_vk.descriptorset_add_resource_texture ()
- gh_vk.descriptorset_update_resource_texture ()
- gh_vk.descriptorset_add_resource_empty_texture_array ()
- gh_vk.descriptorset_update_resource_texture_array ()
- gh_vk.descriptorset_add_resource_rt_color ()
- gh_vk.descriptorset_update_resource_rt_color ()
- gh_vk.descriptorset_add_push_constant_range ()
- gh_vk.descriptorset_push_constant_1f ()
- gh_vk.descriptorset_push_constant_4f ()
- gh_vk.descriptorset_push_constant_4x4f ()
- gh_vk.descriptorset_push_constant_1i ()
- gh_vk.descriptorset_push_constant_4i ()
- gh_vk.descriptorset_push_constant_object_matrix ()
- gh_vk.descriptorset_push_constant_camera_view_matrix ()
- gh_vk.descriptorset_push_constant_camera_projection_matrix ()
- gh_vk.pipeline_create ()
- gh_vk.pipeline_kill ()
- gh_vk.pipeline_bind ()
- gh_vk.pipeline_build ()
- gh_vk.pipeline_build_v2 ()
- gh_vk.pipeline_set_attrib_4i ()
- gh_vk.pipeline_set_attrib_4f ()
- gh_vk.command_buffer_create ()
- gh_vk.command_buffer_kill ()
- gh_vk.command_buffer_begin ()
- gh_vk.command_buffer_end ()
- gh_vk.command_buffer_reset ()
- gh_vk.command_buffer_execute ()
- gh_vk.command_buffer_execute_secondary_cmd ()
- gh_vk.render_pass_begin ()
- gh_vk.render_pass_begin_v2 ()
- gh_vk.render_pass_begin_v3 ()
- gh_vk.render_pass_end ()
- gh_vk.swapchain_get_image_count ()
- gh_vk.swapchain_get_current_image_index ()
- gh_vk.swapchain_has_changed ()
- gh_vk.sampler_create ()
- gh_vk.sampler_kill ()
- gh_vk.set_viewport_scissor ()
- gh_vk.clear_color_depth_buffers ()
- gh_vk.wait_for_gpu ()
- gh_vk.instance_get_num_layers ()
- gh_vk.instance_get_layer_name ()
- gh_vk.instance_get_num_extensions ()
- gh_vk.instance_get_extension_name ()
- gh_vk.get_num_gpus ()
- gh_vk.gpu_get_name ()
- gh_vk.gpu_get_device_id ()
- gh_vk.gpu_get_num_layers ()
- gh_vk.gpu_get_layer_name ()
- gh_vk.gpu_get_num_extensions ()
- gh_vk.gpu_get_extension_name ()
- gh_vk.gpu_is_extension_supported ()
- gh_vk.gpu_get_api_version ()
- gh_vk.gpu_get_nvidia_driver_version ()
- gh_vk.get_num_physical_device_features ()
- gh_vk.get_physical_device_feature_state ()
- gh_vk.get_physical_device_feature_name ()
- gh_vk.get_physical_device_feature_index ()
- gh_vk.get_num_physical_device_limits ()
- gh_vk.get_physical_device_limit_type ()
- gh_vk.get_physical_device_limit_name ()
- gh_vk.get_physical_device_limit_index ()
- gh_vk.get_physical_device_limit_f32 ()
- gh_vk.get_physical_device_limit_s32 ()
- gh_vk.get_physical_device_limit_u32 ()
- gh_vk.get_physical_device_limit_u64 ()
- gh_vk.shader_core_properties_amd_get_value ()
- gh_vk.driver_properties_khr_get_value_1i ()
- gh_vk.driver_properties_khr_get_value_str ()
- gh_vk.gpu_get_num_memory_heaps ()
- gh_vk.gpu_get_heap_size ()
- gh_vk.gpu_get_device_type ()
- gh_vk.draw_mesh_tasks ()
- gh_vk.mesh_shader_get_property_value_nv ()
- gh_vk.raytracing_pipeline_get_property_value_u32 ()
- gh_vk.raytracing_acceleration_structure_get_property_value_u32 ()
- gh_vk.raytracing_acceleration_structure_get_property_value_u64 ()
- gh_vk.raytracing_new ()
- gh_vk.raytracing_blas_add_geometry ()
- gh_vk.raytracing_build_blas ()
- gh_vk.raytracing_tlas_add_instance_data ()
- gh_vk.raytracing_tlas_update_instance_transform ()
- gh_vk.raytracing_tlas_add_instance_data_v2 ()
- gh_vk.raytracing_tlas_update_instance_transform_v2 ()
- gh_vk.raytracing_tlas_add_instance_data_v3 ()
- gh_vk.raytracing_tlas_update_instance_transform_v3 ()
- gh_vk.raytracing_tlas_add_instance_data_v4 ()
- gh_vk.raytracing_tlas_update_instance_transform_v4 ()
- gh_vk.raytracing_build_tlas ()
- gh_vk.raytracing_update_tlas ()
- gh_vk.raytracing_set_ray_recursion_depth ()
- gh_vk.raytracing_pipeline_build ()
- gh_vk.raytracing_pipeline_bind ()
- gh_vk.raytracing_descriptorset_bind ()
- gh_vk.raytracing_shader_binding_table_build ()
- gh_vk.raytracing_raytrace ()
- gh_vk.descriptorset_add_resource_storage_image ()
- gh_vk.descriptorset_update_resource_storage_image ()
- gh_vk.descriptorset_add_geometry ()
- gh_vk.descriptorset_build_geometries_vertices_arrays ()
- gh_vk.descriptorset_build_geometries_indices_arrays ()
- gh_vk.command_buffer_op ()
- gh_vk.create_storage_image ()
- gh_vk.create_storage_kill ()
descriptorset_create
Description
Creates a descriptor set.
Syntax
ds_id = gh_vk.descriptorset_create()
Languages
Parameters
This function has no input parameter(s).
Return Values
- ds_id [INTEGER]: descriptor set identifier
Code sample
ds_id = gh_vk.descriptorset_create()
descriptorset_kill
Description
Destroys a descriptor set.
Syntax
gh_vk.descriptorset_kill(
ds_id
)
Languages
Parameters
- ds_id [INTEGER]: descriptor set identifier
Return Values
This function has no return value(s).
Code sample
gh_vk.descriptorset_kill(ds_id)
descriptorset_build
Description
Builds a descriptor set.
Syntax
gh_vk.descriptorset_build(
ds_id
)
Languages
Parameters
- ds_id [INTEGER]: descriptor set identifier
Return Values
This function has no return value(s).
Code sample
gh_vk.descriptorset_build(ds_id)
descriptorset_update
Description
Updates a descriptor set.
Syntax
gh_vk.descriptorset_update(
ds_id
)
Languages
Parameters
- ds_id [INTEGER]: descriptor set identifier
Return Values
This function has no return value(s).
Code sample
gh_vk.descriptorset_update(ds_id)
descriptorset_bind
Description
Binds a descriptor set.
Syntax
gh_vk.descriptorset_bind(
ds_id
)
Languages
Parameters
- ds_id [INTEGER]: descriptor set identifier
Return Values
This function has no return value(s).
Code sample
gh_vk.descriptorset_bind(ds_id)
descriptorset_add_resource_gpu_buffer
Description
Adds a GPU buffer resource to a descriptor set.
Syntax
resource_index = gh_vk.descriptorset_add_resource_gpu_buffer(
ds_id,
gpubuffer_id,
binding_point,
shader_stages
)
Languages
Parameters
- ds_id [INTEGER]: descriptor set identifier
- gpubuffer_id [INTEGER]: GPU buffer identifier
- binding_point [INTEGER]: resource binding point in the shader
- shader_stages [INTEGER]: shader stages that must access to the resource
Return Values
- resource_index [INTEGER]: index of the resource in the descriptor set
Code sample
SHADER_STAGE_VERTEX = 1
SHADER_STAGE_TESSELLATION_CONTROL = 2
SHADER_STAGE_TESSELLATION_EVALUATION = 4
SHADER_STAGE_GEOMETRY = 8
SHADER_STAGE_FRAGMENT = 16
SHADER_STAGE_COMPUTE = 32
SHADER_STAGE_TASK = 64
SHADER_STAGE_MESH = 128
shader_stages = SHADER_STAGE_VERTEX
binding_point = 0
resource_index = gh_vk.descriptorset_add_resource_gpu_buffer(ds_id, gpubuffer_id, binding_point, shader_stages)
descriptorset_update_resource_gpu_buffer
Description
Updates a GPU buffer resource to a descriptor set.
Syntax
gh_vk.descriptorset_update_resource_gpu_buffer(
ds_id,
resource_index,
gpubuffer_id,
binding_point,
shader_stages
)
Languages
Parameters
- ds_id [INTEGER]: descriptor set identifier
- resource_index [INTEGER]: index of the resource in the descriptor set
- gpubuffer_id [INTEGER]: GPU buffer identifier
- binding_point [INTEGER]: resource binding point in the shader
- shader_stages [INTEGER]: shader stages that must access to the resource
Return Values
This function has no return value(s).
Code sample
SHADER_STAGE_VERTEX = 1
SHADER_STAGE_TESSELLATION_CONTROL = 2
SHADER_STAGE_TESSELLATION_EVALUATION = 4
SHADER_STAGE_GEOMETRY = 8
SHADER_STAGE_FRAGMENT = 16
SHADER_STAGE_COMPUTE = 32
SHADER_STAGE_TASK = 64
SHADER_STAGE_MESH = 128
shader_stages = SHADER_STAGE_VERTEX
binding_point = 0
gh_vk.descriptorset_update_resource_gpu_buffer(ds_id, resource_index, gpubuffer_id, binding_point, shader_stages)
descriptorset_add_resource_texture
Description
Adds a texture resource to a descriptor set.
Syntax
resource_index = gh_vk.descriptorset_add_resource_texture(
ds_id,
texture_id,
sampler_id,
binding_point,
shader_stages
)
Languages
Parameters
- ds_id [INTEGER]: descriptor set identifier
- texture_id [INTEGER]: texture identifier
- sampler_id [INTEGER]: sampler identifier
- binding_point [INTEGER]: resource binding point in the shader
- shader_stages [INTEGER]: shader stages that must access to the resource
Return Values
- resource_index [INTEGER]: index of the resource in the descriptor set
Code sample
SHADER_STAGE_VERTEX = 1
SHADER_STAGE_TESSELLATION_CONTROL = 2
SHADER_STAGE_TESSELLATION_EVALUATION = 4
SHADER_STAGE_GEOMETRY = 8
SHADER_STAGE_FRAGMENT = 16
SHADER_STAGE_COMPUTE = 32
SHADER_STAGE_TASK = 64
SHADER_STAGE_MESH = 128
shader_stages = SHADER_STAGE_FRAGMENT + SHADER_STAGE_VERTEX
binding_point = 0
resource_index = gh_vk.descriptorset_add_resource_texture(ds_id, texture_id, sampler_id, binding_point, shader_stages)
descriptorset_update_resource_texture
Description
Updates a texture resource to a descriptor set.
Syntax
gh_vk.descriptorset_update_resource_texture(
ds_id,
resource_index,
texture_id,
sampler_id,
binding_point,
shader_stages
)
Languages
Parameters
- ds_id [INTEGER]: descriptor set identifier
- resource_index [INTEGER]: index of the resource in the descriptor set
- texture_id [INTEGER]: texture identifier
- sampler_id [INTEGER]: sampler identifier
- binding_point [INTEGER]: resource binding point in the shader
- shader_stages [INTEGER]: shader stages that must access to the resource
Return Values
This function has no return value(s).
Code sample
SHADER_STAGE_VERTEX = 1
SHADER_STAGE_TESSELLATION_CONTROL = 2
SHADER_STAGE_TESSELLATION_EVALUATION = 4
SHADER_STAGE_GEOMETRY = 8
SHADER_STAGE_FRAGMENT = 16
SHADER_STAGE_COMPUTE = 32
SHADER_STAGE_TASK = 64
SHADER_STAGE_MESH = 128
shader_stages = SHADER_STAGE_FRAGMENT + SHADER_STAGE_VERTEX
binding_point = 0
gh_vk.descriptorset_update_resource_texture(ds_id, resource_index, texture_id, sampler_id, binding_point, shader_stages)
descriptorset_add_resource_empty_texture_array
Description
Adds an empty texture array resource to a descriptor set.
Syntax
resource_index = gh_vk.descriptorset_add_resource_empty_texture_array(
ds_id,
texture_count,
binding_point,
shader_stages
)
Languages
Parameters
- ds_id [INTEGER]: descriptor set identifier
- texture_count [INTEGER]: number of textures
- binding_point [INTEGER]: resource binding point in the shader
- shader_stages [INTEGER]: shader stages that must access to the resource
Return Values
- resource_index [INTEGER]: index of the resource in the descriptor set
Code sample
SHADER_STAGE_VERTEX = 1
SHADER_STAGE_TESSELLATION_CONTROL = 2
SHADER_STAGE_TESSELLATION_EVALUATION = 4
SHADER_STAGE_GEOMETRY = 8
SHADER_STAGE_FRAGMENT = 16
SHADER_STAGE_COMPUTE = 32
SHADER_STAGE_TASK = 64
SHADER_STAGE_MESH = 128
texture_count = 2
shader_stages = SHADER_STAGE_FRAGMENT
binding_point = 0
resource_index = gh_vk.descriptorset_add_resource_empty_texture_array(ds_id, texture_count, binding_point, shader_stages)
descriptorset_update_resource_texture_array
Description
Updates a texture array resource with a texture.
Syntax
gh_vk.descriptorset_update_resource_texture_array(
ds_id,
resource_index,
texture_index,
texture_id,
sampler_id
)
Languages
Parameters
- ds_id [INTEGER]: descriptor set identifier
- resource_index [INTEGER]: index of the resource in the descriptor set
- texture_index [INTEGER]: index of the texture in the texture array
- texture_id [INTEGER]: texture identifier
- sampler_id [INTEGER]: sampler identifier
Return Values
This function has no return value(s).
Code sample
texture_count = 2
shader_stages = SHADER_STAGE_FRAGMENT
binding_point = 0
resource_index = gh_vk.descriptorset_add_resource_empty_texture_array(ds_id, texture_count, binding_point, shader_stages)
texture_index = 0
gh_vk.descriptorset_update_resource_texture_array(ds_id, resource_index, texture_index, texture1_id, sampler_id)
texture_index = 1
gh_vk.descriptorset_update_resource_texture_array(ds_id, resource_index, texture_index, texture2_id, sampler_id)
descriptorset_add_resource_rt_color
Description
Adds a render target texture resource to a descriptor set.
Syntax
resource_index = gh_vk.descriptorset_add_resource_rt_color(
ds_id,
rt_id,
color_index,
sampler_id,
binding_point,
shader_stages
)
Languages
Parameters
- ds_id [INTEGER]: descriptor set identifier
- rt_id [INTEGER]: render target identifier
- color_index [INTEGER]: texture index in the render target
- sampler_id [INTEGER]: sampler identifier
- binding_point [INTEGER]: resource binding point in the shader
- shader_stages [INTEGER]: shader stages that must access to the resource
Return Values
- resource_index [INTEGER]: index of the resource in the descriptor set
Code sample
SHADER_STAGE_VERTEX = 1
SHADER_STAGE_TESSELLATION_CONTROL = 2
SHADER_STAGE_TESSELLATION_EVALUATION = 4
SHADER_STAGE_GEOMETRY = 8
SHADER_STAGE_FRAGMENT = 16
SHADER_STAGE_COMPUTE = 32
SHADER_STAGE_TASK = 64
SHADER_STAGE_MESH = 128
shader_stages = SHADER_STAGE_FRAGMENT
binding_point = 0
color_index = 0
resource_index = gh_vk.descriptorset_add_resource_rt_color(ds_id, rt_id, color_index, sampler_id, binding_point, shader_stages)
descriptorset_update_resource_rt_color
Description
Updates a render target texture resource to a descriptor set.
Syntax
gh_vk.descriptorset_update_resource_rt_color(
ds_id,
resource_index,
rt_id,
color_index,
sampler_id,
binding_point,
shader_stages
)
Languages
Parameters
- ds_id [INTEGER]: descriptor set identifier
- resource_index [INTEGER]: index of the resource in the descriptor set
- rt_id [INTEGER]: render target identifier
- color_index [INTEGER]: texture index in the render target
- sampler_id [INTEGER]: sampler identifier
- binding_point [INTEGER]: resource binding point in the shader
- shader_stages [INTEGER]: shader stages that must access to the resource
Return Values
This function has no return value(s).
Code sample
SHADER_STAGE_VERTEX = 1
SHADER_STAGE_TESSELLATION_CONTROL = 2
SHADER_STAGE_TESSELLATION_EVALUATION = 4
SHADER_STAGE_GEOMETRY = 8
SHADER_STAGE_FRAGMENT = 16
SHADER_STAGE_COMPUTE = 32
SHADER_STAGE_TASK = 64
SHADER_STAGE_MESH = 128
shader_stages = SHADER_STAGE_FRAGMENT
binding_point = 0
color_index = 0
gh_vk.descriptorset_update_resource_rt_color(ds_id, resource_index, rt_id, color_index, sampler_id, binding_point, shader_stages)
descriptorset_add_push_constant_range
Description
Adds a push constant buffer to a descriptor set.
Syntax
gh_vk.descriptorset_add_push_constant_range(
ds_id,
size,
offset,
shader_stages
)
Languages
Parameters
- ds_id [INTEGER]: descriptor set identifier
- size [INTEGER]: size of the push constant in bytes
- offset [INTEGER]: offset of the push constant in bytes relative to the whole push constant buffer
- shader_stages [INTEGER]: shader stages that must access to the resource
Return Values
This function has no return value(s).
Code sample
SHADER_STAGE_VERTEX = 1
SHADER_STAGE_TESSELLATION_CONTROL = 2
SHADER_STAGE_TESSELLATION_EVALUATION = 4
SHADER_STAGE_GEOMETRY = 8
SHADER_STAGE_FRAGMENT = 16
SHADER_STAGE_COMPUTE = 32
SHADER_STAGE_TASK = 64
SHADER_STAGE_MESH = 128
shader_stages = SHADER_STAGE_VERTEX
size = 20
offset = 0
gh_vk.descriptorset_add_push_constant_range(ds_id, size, offset, shader_stages)
descriptorset_push_constant_1f
Description
Sets a float value in a push constant buffer.
Syntax
gh_vk.descriptorset_push_constant_1f(
ds_id,
x,
offset,
shader_stages
)
Languages
Parameters
- ds_id [INTEGER]: descriptor set identifier
- x [REAL]: value of the constant
- offset [INTEGER]: offset of the value in bytes in the push constant buffer
- shader_stages [INTEGER]: shader stages that must access to the resource
Return Values
This function has no return value(s).
Code sample
SHADER_STAGE_VERTEX = 1
SHADER_STAGE_TESSELLATION_CONTROL = 2
SHADER_STAGE_TESSELLATION_EVALUATION = 4
SHADER_STAGE_GEOMETRY = 8
SHADER_STAGE_FRAGMENT = 16
SHADER_STAGE_COMPUTE = 32
SHADER_STAGE_TASK = 64
SHADER_STAGE_MESH = 128
shader_stages = SHADER_STAGE_VERTEX
x = 0.25
offset = 0
gh_vk.descriptorset_push_constant_1f(ds_id, x, offset, shader_stages)
descriptorset_push_constant_4f
Description
Sets a vec4 value in a push constant buffer.
Syntax
gh_vk.descriptorset_push_constant_4f(
ds_id,
x, y, z, w,
offset,
shader_stages
)
Languages
Parameters
- ds_id [INTEGER]: descriptor set identifier
- x, y, z, w [REAL]: value of the constant
- offset [INTEGER]: offset of the value in bytes in the push constant buffer
- shader_stages [INTEGER]: shader stages that must access to the resource
Return Values
This function has no return value(s).
Code sample
SHADER_STAGE_VERTEX = 1
SHADER_STAGE_TESSELLATION_CONTROL = 2
SHADER_STAGE_TESSELLATION_EVALUATION = 4
SHADER_STAGE_GEOMETRY = 8
SHADER_STAGE_FRAGMENT = 16
SHADER_STAGE_COMPUTE = 32
SHADER_STAGE_TASK = 64
SHADER_STAGE_MESH = 128
shader_stages = SHADER_STAGE_VERTEX
x = 0.25
y = 0.15
z = 0.0
w = 1.0
offset = 4
gh_vk.descriptorset_push_constant_4f(ds_id, x, y, z, w, offset, shader_stages)
descriptorset_push_constant_4x4f
Description
Sets a mat4 value in a push constant buffer.
Syntax
gh_vk.descriptorset_push_constant_4x4f(
ds_id,
m0,m1,m2,m3,m4,m5,m6,m7,m8,m9,m10,m11,m12,m13,m14,m15,
offset,
shader_stages
)
Languages
Parameters
- ds_id [INTEGER]: descriptor set identifier
- m0,m1,m2,m3,m4,m5,m6,m7,m8,m9,m10,m11,m12,m13,m14,m15 [REAL]: the 16 floats that make the 4x4 matrix
- offset [INTEGER]: offset of the value in bytes in the push constant buffer
- shader_stages [INTEGER]: shader stages that must access to the resource
Return Values
This function has no return value(s).
Code sample
SHADER_STAGE_VERTEX = 1
SHADER_STAGE_TESSELLATION_CONTROL = 2
SHADER_STAGE_TESSELLATION_EVALUATION = 4
SHADER_STAGE_GEOMETRY = 8
SHADER_STAGE_FRAGMENT = 16
SHADER_STAGE_COMPUTE = 32
SHADER_STAGE_TASK = 64
SHADER_STAGE_MESH = 128
shader_stages = SHADER_STAGE_VERTEX
offset = 0
gh_vk.descriptorset_push_constant_4x4f(ds_id, m0,m1,m2,m3,m4,m5,m6,m7,m8,m9,m10,m11,m12,m13,m14,m15, offset, shader_stages)
descriptorset_push_constant_1i
Description
Sets an integer value in a push constant buffer.
Syntax
gh_vk.descriptorset_push_constant_1i(
ds_id,
x,
offset,
shader_stages
)
Languages
Parameters
- ds_id [INTEGER]: descriptor set identifier
- x [INTEGER]: value of the constant
- offset [INTEGER]: offset of the value in bytes in the push constant buffer
- shader_stages [INTEGER]: shader stages that must access to the resource
Return Values
This function has no return value(s).
Code sample
SHADER_STAGE_VERTEX = 1
SHADER_STAGE_TESSELLATION_CONTROL = 2
SHADER_STAGE_TESSELLATION_EVALUATION = 4
SHADER_STAGE_GEOMETRY = 8
SHADER_STAGE_FRAGMENT = 16
SHADER_STAGE_COMPUTE = 32
SHADER_STAGE_TASK = 64
SHADER_STAGE_MESH = 128
shader_stages = SHADER_STAGE_VERTEX
x = 2
offset = 0
gh_vk.descriptorset_push_constant_1i(ds_id, x, offset, shader_stages)
descriptorset_push_constant_4i
Description
Sets a vec4i value in a push constant buffer.
Syntax
gh_vk.descriptorset_push_constant_4i(
ds_id,
x, y, z, w,
offset,
shader_stages
)
Languages
Parameters
- ds_id [INTEGER]: descriptor set identifier
- x, y, z, w [INTEGER]: value of the constant
- offset [INTEGER]: offset of the value in bytes in the push constant buffer
- shader_stages [INTEGER]: shader stages that must access to the resource
Return Values
This function has no return value(s).
Code sample
SHADER_STAGE_VERTEX = 1
SHADER_STAGE_TESSELLATION_CONTROL = 2
SHADER_STAGE_TESSELLATION_EVALUATION = 4
SHADER_STAGE_GEOMETRY = 8
SHADER_STAGE_FRAGMENT = 16
SHADER_STAGE_COMPUTE = 32
SHADER_STAGE_TASK = 64
SHADER_STAGE_MESH = 128
shader_stages = SHADER_STAGE_VERTEX
x = 1
y = 2
z = 4
w = 8
offset = 4
gh_vk.descriptorset_push_constant_4i(ds_id, x, y, z, w, offset, shader_stages)
descriptorset_push_constant_object_matrix
Description
Sets a the 4x4 transformation matrix of an object in a push constant buffer.
Syntax
gh_vk.descriptorset_push_constant_object_matrix(
ds_id,
object_id,
offset,
shader_stages
)
Languages
Parameters
- ds_id [INTEGER]: descriptor set identifier
- object_id [INTEGER]: object identifier
- offset [INTEGER]: offset of the value in bytes in the push constant buffer
- shader_stages [INTEGER]: shader stages that must access to the resource
Return Values
This function has no return value(s).
Code sample
SHADER_STAGE_VERTEX = 1
SHADER_STAGE_TESSELLATION_CONTROL = 2
SHADER_STAGE_TESSELLATION_EVALUATION = 4
SHADER_STAGE_GEOMETRY = 8
SHADER_STAGE_FRAGMENT = 16
SHADER_STAGE_COMPUTE = 32
SHADER_STAGE_TASK = 64
SHADER_STAGE_MESH = 128
shader_stages = SHADER_STAGE_VERTEX
offset = 20
gh_vk.descriptorset_push_constant_object_matrix(ds_id, mesh, offset, shader_stages)
descriptorset_push_constant_camera_view_matrix
Description
Sets a the 4x4 view matrix of a camera in a push constant buffer.
Syntax
gh_vk.descriptorset_push_constant_camera_view_matrix(
ds_id,
camera_id,
offset,
shader_stages
)
Languages
Parameters
- ds_id [INTEGER]: descriptor set identifier
- camera_id [INTEGER]: camera identifier
- offset [INTEGER]: offset of the value in bytes in the push constant buffer
- shader_stages [INTEGER]: shader stages that must access to the resource
Return Values
This function has no return value(s).
Code sample
SHADER_STAGE_VERTEX = 1
SHADER_STAGE_TESSELLATION_CONTROL = 2
SHADER_STAGE_TESSELLATION_EVALUATION = 4
SHADER_STAGE_GEOMETRY = 8
SHADER_STAGE_FRAGMENT = 16
SHADER_STAGE_COMPUTE = 32
SHADER_STAGE_TASK = 64
SHADER_STAGE_MESH = 128
shader_stages = SHADER_STAGE_VERTEX
offset = 20
gh_vk.descriptorset_push_constant_camera_view_matrix(ds_id, camera, offset, shader_stages)
descriptorset_push_constant_camera_projection_matrix
Description
Sets a the 4x4 projection matrix of a camera in a push constant buffer.
Syntax
gh_vk.descriptorset_push_constant_camera_projection_matrix(
ds_id,
camera_id,
offset,
shader_stages
)
Languages
Parameters
- ds_id [INTEGER]: descriptor set identifier
- camera_id [INTEGER]: camera identifier
- offset [INTEGER]: offset of the value in bytes in the push constant buffer
- shader_stages [INTEGER]: shader stages that must access to the resource
Return Values
This function has no return value(s).
Code sample
SHADER_STAGE_VERTEX = 1
SHADER_STAGE_TESSELLATION_CONTROL = 2
SHADER_STAGE_TESSELLATION_EVALUATION = 4
SHADER_STAGE_GEOMETRY = 8
SHADER_STAGE_FRAGMENT = 16
SHADER_STAGE_COMPUTE = 32
SHADER_STAGE_TASK = 64
SHADER_STAGE_MESH = 128
shader_stages = SHADER_STAGE_VERTEX
offset = 36
gh_vk.descriptorset_push_constant_camera_projection_matrix(ds_id, camera, offset, shader_stages)
pipeline_create
Description
Creates a pipeline.
Syntax
pipeline_id = gh_vk.pipeline_create(
pipeline_name,
gpu_program_id,
render_states_descr
)
Languages
Parameters
- pipeline_name [STRING]: name of the pipeline
- gpu_program_id [INTEGER]: gpu program identifier
- render_states_descr [STRING]: reserved
Return Values
- pipeline_id [INTEGER]: pipeline identifier
Code sample
pipeline = gh_vk.pipeline_create("phong_pipeline", phong_gpu_prog, "")
pipeline_kill
Description
Destroys a pipeline.
Syntax
gh_vk.pipeline_kill(
pipeline_id
)
Languages
Parameters
- pipeline_id [INTEGER]: pipeline identifier
Return Values
This function has no return value(s).
Code sample
gh_vk.pipeline_kill(pipeline)
pipeline_bind
Description
Binds a pipeline.
Syntax
gh_vk.pipeline_bind(
pipeline_id
)
Languages
Parameters
- pipeline_id [INTEGER]: pipeline identifier
Return Values
This function has no return value(s).
Code sample
gh_vk.pipeline_bind(pipeline)
pipeline_build
Description
Builds a pipeline.
Syntax
gh_vk.pipeline_build(
pipeline_id,
ds_id
)
Languages
Parameters
- pipeline_id [INTEGER]: pipeline identifier
- ds_id [INTEGER]: descriptor set identifier
Return Values
This function has no return value(s).
Code sample
gh_vk.pipeline_build(pipeline, ds_id)
pipeline_build_v2
Description
Builds a pipeline.
Syntax
gh_vk.pipeline_build_v2(
pipeline_id,
ds_id,
rt_id
)
Languages
Parameters
- pipeline_id [INTEGER]: pipeline identifier
- ds_id [INTEGER]: descriptor set identifier
- rt_id [INTEGER]: render target identifier
Return Values
This function has no return value(s).
Code sample
gh_vk.pipeline_build_v2(pipeline, ds_id, rt_id)
pipeline_set_attrib_4i
Description
Sets a pipeline attribute. Must be done before building a pipeline.
Syntax
gh_vk.pipeline_set_attrib_4i(
pipeline_id,
attrib_name,
x, y, z, w
)
Languages
Parameters
- pipeline_id [INTEGER]: pipeline identifier
- attrib_name [STRING]: name of the atttribute - Possible values: DEPTH_TEST, DEPTH_READ_ONLY, BLENDING, BLENDING_FACTORS_COLOR, FILL_MODE, PRIMITIVE_TYPE, CULL_MODE, CCW
- x, y, z, w [INTEGER]: value of the attribute
Return Values
This function has no return value(s).
Code sample
local lib_dir = gh_utils.get_lib_dir()
dofile(lib_dir .. "lua/vk.lua")
...
gh_vk.pipeline_set_attrib_4i(pipeline, "DEPTH_TEST", 1, 0, 0, 0)
gh_vk.pipeline_set_attrib_4i(pipeline, "FILL_MODE", POLYGON_MODE_SOLID, 0, 0, 0)
gh_vk.pipeline_set_attrib_4i(pipeline, "PRIMITIVE_TYPE", PRIMITIVE_TRIANGLE, 0, 0, 0)
gh_vk.pipeline_set_attrib_4i(pipeline, "CULL_MODE", POLYGON_FACE_NONE, 0, 0, 0)
...
pipeline_set_attrib_4f
Description
Sets a pipeline attribute. Must be done before building a pipeline.
Syntax
gh_vk.pipeline_set_attrib_4f(
pipeline_id,
attrib_name,
x, y, z, w
)
Languages
Parameters
- pipeline_id [INTEGER]: pipeline identifier
- attrib_name [STRING]: name of the atttribute - Possible values: DEPTH_BIAS, DEPTH_BIAS_CLAMP, DEPTH_BIAS_SLOPE_SCALED, LINE_WIDTH
- x, y, z, w [REAL]: value of the attribute
Return Values
This function has no return value(s).
Code sample
gh_vk.pipeline_set_attrib_4f(pipeline, "LINE_WIDTH", 2.0, 0, 0, 0)
command_buffer_create
Description
Creates a command buffer.
Syntax
cmdbuf_id = gh_vk.command_buffer_create(
type
)
Languages
Parameters
- type [INTEGER]: type of the command buffer: 0 (primary) or 1 (secondary)
Return Values
- cmdbuf_id [INTEGER]: command buffer identifier
Code sample
cmdbuf_id = gh_vk.command_buffer_create(0)
command_buffer_kill
Description
Destroys a command buffer.
Syntax
gh_vk.command_buffer_kill(
cmdbuf_id
)
Languages
Parameters
- cmdbuf_id [INTEGER]: command buffer identifier
Return Values
This function has no return value(s).
Code sample
gh_vk.command_buffer_kill(cmdbuf_id)
command_buffer_begin
Description
Begins a command buffer: drawing commands can be recorded.
Syntax
gh_vk.command_buffer_begin(
cmdbuf_id
)
Languages
Parameters
- cmdbuf_id [INTEGER]: command buffer identifier
Return Values
This function has no return value(s).
Code sample
gh_vk.command_buffer_begin(cmdbuf_id)
command_buffer_end
Description
Ends a command buffer: drawing commands can be no longer recorded.
Syntax
gh_vk.command_buffer_end(
cmdbuf_id
)
Languages
Parameters
- cmdbuf_id [INTEGER]: command buffer identifier
Return Values
This function has no return value(s).
Code sample
gh_vk.command_buffer_end(cmdbuf_id)
command_buffer_reset
Description
Resets a command buffer.
Syntax
gh_vk.command_buffer_reset(
cmdbuf_id
)
Languages
Parameters
- cmdbuf_id [INTEGER]: command buffer identifier
Return Values
This function has no return value(s).
Code sample
gh_vk.command_buffer_reset(cmdbuf_id)
command_buffer_execute
Description
Executes a command buffer.
Syntax
gh_vk.command_buffer_execute(
cmdbuf_id
)
Languages
Parameters
- cmdbuf_id [INTEGER]: command buffer identifier
Return Values
This function has no return value(s).
Code sample
gh_vk.command_buffer_execute(cmdbuf_id)
command_buffer_execute_secondary_cmd
Description
Executes a secondary command buffer.
Syntax
gh_vk.command_buffer_execute_secondary_cmd(
main_cmdbuf_id,
secd_cmdbuf_id
)
Languages
Parameters
- main_cmdbuf_id [INTEGER]: main command buffer identifier
- secd_cmdbuf_id [INTEGER]: second command buffer identifier
Return Values
This function has no return value(s).
Code sample
gh_vk.command_buffer_execute_secondary_cmd(main_cmdbuf_id, secd_cmdbuf_id)
render_pass_begin
Description
Begins a render pass.
Syntax
gh_vk.render_pass_begin(
cmdbuf_id,
is_secondary_cmd
)
Languages
Parameters
- cmdbuf_id [INTEGER]: command buffer identifier
- is_secondary_cmd [INTEGER]: 1 if secondary command buffer or 0 otherwise (main command buffer).
Return Values
This function has no return value(s).
Code sample
gh_vk.render_pass_begin(cmdbuf_id, 0)
render_pass_begin_v2
Description
Begins a render pass.
Syntax
gh_vk.render_pass_begin_v2(
cmdbuf_id,
swapchain_buffer_index,
is_secondary_cmd
)
Languages
Parameters
- cmdbuf_id [INTEGER]: command buffer identifier
- swapchain_buffer_index [INTEGER]: index of a swapchain buffer
- is_secondary_cmd [INTEGER]: 1 if secondary command buffer or 0 otherwise (main command buffer).
Return Values
This function has no return value(s).
Code sample
gh_vk.render_pass_begin_v2(cmdbuf_id, swapchain_buffer_index, 0)
render_pass_begin_v3
Description
Begins a render pass.
Syntax
gh_vk.render_pass_begin_v3(
cmdbuf_id,
r, g, b, a,
z,
swapchain_buffer_index,
is_secondary_cmd
)
Languages
Parameters
- cmdbuf_id [INTEGER]: command buffer identifier
- r, g, b, a [REAL]: color buffer clear value
- z [REAL]: depth buffer clear value
- swapchain_buffer_index [INTEGER]: index of a swapchain buffer
- is_secondary_cmd [INTEGER]: 1 if secondary command buffer or 0 otherwise (main command buffer).
Return Values
This function has no return value(s).
Code sample
gh_vk.render_pass_begin_v3(cmdbuf_id, 0, 0, 0, 1, 1, swapchain_buffer_index, 0)
render_pass_end
Description
Ends a render pass.
Syntax
gh_vk.render_pass_end(
cmdbuf_id
)
Languages
Parameters
- cmdbuf_id [INTEGER]: command buffer identifier
Return Values
This function has no return value(s).
Code sample
gh_vk.render_pass_end(cmdbuf_id)
swapchain_get_image_count
Description
Returns the number of images in the swapchain.
Syntax
num_images = gh_vk.swapchain_get_image_count()
Languages
Parameters
This function has no input parameter(s).
Return Values
- num_images [INTEGER]: number of images
Code sample
num_images = gh_vk.swapchain_get_image_count()
swapchain_get_current_image_index
Description
Returns the current acquired image of the swapchain.
Syntax
cur_image = gh_vk.swapchain_get_current_image_index()
Languages
Parameters
This function has no input parameter(s).
Return Values
- cur_image [INTEGER]: index of the current image
Code sample
cur_image = gh_vk.swapchain_get_current_image_index()
swapchain_has_changed
Description
Allows to know if the swapchain has changed (resized). If the swapchain has changed, you have to rebuild some command buffers when a command buffer per swapchain image is used.
Syntax
has_changed = gh_vk.swapchain_has_changed()
Languages
Parameters
This function has no input parameter(s).
Return Values
- has_changed [INTEGER]: 1 if swapchain has changed, 0 if not
Code sample
has_changed = gh_vk.swapchain_has_changed()
sampler_create
Description
Creates a texture sampler. The sample is used when a texture is added to a descriptor set.
Syntax
sampler_id = gh_vk.sampler_create(
filtering_mode,
addressing_mode,
anisotropy,
_reserved_
)
Languages
Parameters
- filtering_mode [STRING]: filtering mode: NONE, LINEAR, TRILINEAR
- addressing_mode [STRING]: filtering mode: WRAP (or REPEAT), MIRROR, CLAMP
- anisotropy [REAL]: anisotropy value (1.0 ; 16.0)
- _reserved_ [INTEGER]: reserved - set it to 0
Return Values
- sampler_id [INTEGER]: sampler identifier
Code sample
anisotropy = 1.0
sampler_id = gh_vk.sampler_create("LINEAR", "REPEAT", anisotropy, 0)
sampler_kill
Description
Kills a texture sampler.
Syntax
gh_vk.sampler_kill(
sampler_id
)
Languages
Parameters
- sampler_id [INTEGER]: sampler identifier
Return Values
This function has no return value(s).
Code sample
gh_vk.sampler_kill(sampler_id)
set_viewport_scissor
Description
Sets the size and position of the current viewport.
Syntax
gh_vk.set_viewport_scissor(
x, y, w, h
)
Languages
Parameters
- x, y, w, h [INTEGER]: position (x, y) and size (w, h) of the current viewport. This information is recorded in the current command buffer (see command_buffer_begin).
Return Values
This function has no return value(s).
Code sample
gh_vk.set_viewport_scissor(0, 0, winW, winH)
clear_color_depth_buffers
Description
Sets the clear values for the color and depth buffers. Must be called before render_pass_begin or render_pass_begin_v2.
Syntax
gh_vk.clear_color_depth_buffers(
r, g, b, a,
z
)
Languages
Parameters
- r, g, b, a [REAL]: color buffer clear value.
- z [REAL]: depth buffer clear value.
Return Values
This function has no return value(s).
Code sample
gh_vk.clear_color_depth_buffers(0, 0, 0, 1.0, 1.0)
wait_for_gpu
Description
Waits for GPU completion (vkDeviceWaitIdle).
Syntax
gh_vk.wait_for_gpu()
Languages
Parameters
This function has no input parameter(s).
Return Values
This function has no return value(s).
Code sample
gh_vk.wait_for_gpu()
instance_get_num_layers
Description
Returns the number of layers of the Vulkan instance.
Syntax
num_layers = gh_vk.instance_get_num_layers()
Languages
Parameters
This function has no input parameter(s).
Return Values
- num_layers [INTEGER]: number of layers.
Code sample
num_layers = gh_vk.instance_get_num_layers()
instance_get_layer_name
Description
Returns the name of a particular instance layer.
Syntax
layer_name = gh_vk.instance_get_layer_name(
layer_index
)
Languages
Parameters
- layer_index [INTEGER]: index of the layer.
Return Values
- layer_name [STRING]: name of the layer.
Code sample
name = gh_vk.instance_get_layer_name(layer_index)
instance_get_num_extensions
Description
Returns the number of extensions of the Vulkan instance.
Syntax
num_extensions = gh_vk.instance_get_num_extensions()
Languages
Parameters
This function has no input parameter(s).
Return Values
- num_extensions [INTEGER]: number of extensions.
Code sample
num_extensions = gh_vk.instance_get_num_extensions()
instance_get_extension_name
Description
Returns the name of a particular instance extension.
Syntax
extension_name = gh_vk.instance_get_extension_name(
extension_index
)
Languages
Parameters
- extension_index [INTEGER]: index of the extension.
Return Values
- extension_name [STRING]: name of the extension.
Code sample
name = gh_vk.instance_get_extension_name(extension_index)
get_num_gpus
Description
Returns the number of Vulkan GPUs.
Syntax
num_gpus = gh_vk.get_num_gpus()
Languages
Parameters
This function has no input parameter(s).
Return Values
- num_gpus [INTEGER]: number of GPUs.
Code sample
num_gpus = gh_vk.get_num_gpus()
gpu_get_name
Description
Returns the name of a Vulkan GPU.
Syntax
num_gpus = gh_vk.gpu_get_name(
gpu_index
)
Languages
Parameters
- gpu_index [INTEGER]: index of the GPU.
Return Values
- num_gpus [INTEGER]: number of GPUs.
Code sample
name = gh_vk.gpu_get_name(gpu_index)
gpu_get_device_id
Description
Returns the device ID of a Vulkan GPU.
Syntax
vendor_id, device_id = gh_vk.gpu_get_device_id(
gpu_index
)
Languages
Parameters
- gpu_index [INTEGER]: index of the GPU.
Return Values
- vendor_id, device_id [INTEGER]: vendor and device ID
Code sample
vendor_id, device_id = gh_vk.gpu_get_device_id(gpu_index)
gpu_get_num_layers
Description
Returns the number of layers of a Vulkan GPU.
Syntax
vendor_id, device_id = gh_vk.gpu_get_num_layers(
gpu_index
)
Languages
Parameters
- gpu_index [INTEGER]: index of the GPU.
Return Values
- vendor_id, device_id [INTEGER]: vendor and device ID
Code sample
num_layers = gh_vk.gpu_get_num_layers(gpu_index)
gpu_get_layer_name
Description
Returns the name of a particular GPU layer.
Syntax
layer_name = gh_vk.gpu_get_layer_name(
gpu_index,
layer_index
)
Languages
Parameters
- gpu_index [INTEGER]: index of the GPU.
- layer_index [INTEGER]: index of the layer.
Return Values
- layer_name [STRING]: name of the layer.
Code sample
name = gh_vk.gpu_get_layer_name(gpu_index, layer_index)
gpu_get_num_extensions
Description
Returns the number of extensions of a Vulkan GPU.
Syntax
num_extensions = gh_vk.gpu_get_num_extensions(
gpu_index
)
Languages
Parameters
- gpu_index [INTEGER]: index of the GPU.
Return Values
- num_extensions [INTEGER]: number of extensions.
Code sample
num_extensions = gh_vk.gpu_get_num_extensions(gpu_index)
gpu_get_extension_name
Description
Returns the name of a particular GPU extension.
Syntax
extension_name = gh_vk.gpu_get_extension_name(
gpu_index,
extension_index
)
Languages
Parameters
- gpu_index [INTEGER]: index of the GPU.
- extension_index [INTEGER]: index of the extension.
Return Values
- extension_name [STRING]: name of the extension.
Code sample
name = gh_vk.gpu_get_extension_name(gpu_index, extension_index)
gpu_is_extension_supported
Description
Allows to know if an extension is supported by a GPU.
Syntax
is_supported = gh_vk.gpu_is_extension_supported(
gpu_index,
extension_name
)
Languages
Parameters
- gpu_index [INTEGER]: index of the GPU.
- extension_name [STRING]: name of the extension.
Return Values
- is_supported [INTEGER]: 1 if supported, 0 if not.
Code sample
is_supported = gh_vk.gpu_is_extension_supported(gpu_index, extension_name)
gpu_get_api_version
Description
Returns the Vulkan API version for a particular GPU.
Syntax
major, minor, patch = gh_vk.gpu_get_api_version(
gpu_index
)
Languages
Parameters
- gpu_index [INTEGER]: index of the GPU.
Return Values
- major, minor, patch [INTEGER]: version of the Vulkan API.
Code sample
major, minor, patch = gh_vk.gpu_get_api_version(gpu_index)
gpu_get_nvidia_driver_version
Description
Returns the NVIDIA driver version for a particular GPU.
Syntax
major, minor, patch, build = gh_vk.gpu_get_nvidia_driver_version(
gpu_index
)
Languages
Parameters
- gpu_index [INTEGER]: index of the GPU.
Return Values
- major, minor, patch, build [INTEGER]: version of driver.
Code sample
major, minor, patch, build = gh_vk.gpu_get_nvidia_driver_version(gpu_index)
get_num_physical_device_features
Description
Returns the number of features (number of fields of VkPhysicalDeviceFeatures) for a particular GPU.
Syntax
num_features = gh_vk.get_num_physical_device_features(
gpu_index
)
Languages
Parameters
- gpu_index [INTEGER]: index of the GPU.
Return Values
- num_features [INTEGER]: number of features.
Code sample
num_features = gh_vk.get_num_physical_device_features(gpu_index)
get_physical_device_feature_state
Description
Returns the state of a feature for a particular GPU.
Syntax
state = gh_vk.get_physical_device_feature_state(
gpu_index,
feature_index
)
Languages
Parameters
- gpu_index [INTEGER]: index of the GPU.
- feature_index [INTEGER]: index of the feature.
Return Values
- state [INTEGER]: state of feature (0 or 1).
Code sample
state = gh_vk.get_physical_device_feature_state(gpu_index, feature_index)
get_physical_device_feature_name
Description
Returns the name of a feature for a particular GPU.
Syntax
name = gh_vk.get_physical_device_feature_name(
gpu_index,
feature_index
)
Languages
Parameters
- gpu_index [INTEGER]: index of the GPU.
- feature_index [INTEGER]: index of the feature.
Return Values
- name [STRING]: name of a feature.
Code sample
name = gh_vk.get_physical_device_feature_name(gpu_index, feature_index)
get_physical_device_feature_index
Description
Returns the index of a feature for a particular GPU.
Syntax
feature_index = gh_vk.get_physical_device_feature_index(
gpu_index,
name
)
Languages
Parameters
- gpu_index [INTEGER]: index of the GPU.
- name [STRING]: name of a feature.
Return Values
- feature_index [INTEGER]: index of the feature.
Code sample
feature_index = gh_vk.get_physical_device_feature_index(gpu_index, name)
get_num_physical_device_limits
Description
Returns the number of limits (number of fields of VkPhysicalDeviceLimits) for a particular GPU.
Syntax
num_limits = gh_vk.get_num_physical_device_limits(
gpu_index
)
Languages
Parameters
- gpu_index [INTEGER]: index of the GPU.
Return Values
- num_limits [INTEGER]: number of limits.
Code sample
num_limits = gh_vk.get_num_physical_device_limits(gpu_index)
get_physical_device_limit_type
Description
Returns the type of a limit for a particular GPU.
Syntax
type = gh_vk.get_physical_device_limit_type(
gpu_index,
limit_index
)
Languages
Parameters
- gpu_index [INTEGER]: index of the GPU.
- limit_index [INTEGER]: index of the limit.
Return Values
- type [STRING]: type of the limit: 1u32, 1s32, 1u64, 1f32, 3u32, 2u32, 2f32
Code sample
type = gh_vk.get_physical_device_limit_type(gpu_index, limit_index)
get_physical_device_limit_name
Description
Returns the name of a limit for a particular GPU.
Syntax
name = gh_vk.get_physical_device_limit_name(
gpu_index,
limit_index
)
Languages
Parameters
- gpu_index [INTEGER]: index of the GPU.
- limit_index [INTEGER]: index of the limit.
Return Values
- name [STRING]: name of the limit
Code sample
name = gh_vk.get_physical_device_limit_name(gpu_index, limit_index)
get_physical_device_limit_index
Description
Returns the name of a limit for a particular GPU.
Syntax
limit_index = gh_vk.get_physical_device_limit_index(
gpu_index,
name
)
Languages
Parameters
- gpu_index [INTEGER]: index of the GPU.
- name [STRING]: name of the limit
Return Values
- limit_index [INTEGER]: index of the limit.
Code sample
limit_index = gh_vk.get_physical_device_limit_index(gpu_index, name)
get_physical_device_limit_f32
Description
Returns the value of a limit for a particular GPU.
Syntax
x, y, z = gh_vk.get_physical_device_limit_f32(
gpu_index,
limit_index
)
Languages
Parameters
- gpu_index [INTEGER]: index of the GPU.
- limit_index [INTEGER]: index of the limit.
Return Values
- x, y, z [REAL]: limit value
Code sample
x, y, z = gh_vk.get_physical_device_limit_f32(gpu_index, limit_index)
get_physical_device_limit_s32
Description
Returns the value of a limit for a particular GPU.
Syntax
x, y, z = gh_vk.get_physical_device_limit_s32(
gpu_index,
limit_index
)
Languages
Parameters
- gpu_index [INTEGER]: index of the GPU.
- limit_index [INTEGER]: index of the limit.
Return Values
- x, y, z [INTEGER]: signed integer limit value
Code sample
x, y, z = gh_vk.get_physical_device_limit_s32(gpu_index, limit_index)
get_physical_device_limit_u32
Description
Returns the value of a limit for a particular GPU.
Syntax
x, y, z = gh_vk.get_physical_device_limit_u32(
gpu_index,
limit_index
)
Languages
Parameters
- gpu_index [INTEGER]: index of the GPU.
- limit_index [INTEGER]: index of the limit.
Return Values
- x, y, z [INTEGER]: unsigned integer limit value
Code sample
x, y, z = gh_vk.get_physical_device_limit_u32(gpu_index, limit_index)
get_physical_device_limit_u64
Description
Returns the value of a limit for a particular GPU.
Syntax
x, y, z = gh_vk.get_physical_device_limit_u64(
gpu_index,
limit_index
)
Languages
Parameters
- gpu_index [INTEGER]: index of the GPU.
- limit_index [INTEGER]: index of the limit.
Return Values
- x, y, z [INTEGER]: unsigned integer limit value
Code sample
x, y, z = gh_vk.get_physical_device_limit_u64(gpu_index, limit_index)
shader_core_properties_amd_get_value
Description
AMD extension: VK_AMD_shader_core_properties - Returns the value of a property.
Syntax
x = gh_vk.shader_core_properties_amd_get_value(
gpu_index,
property_name
)
Languages
Parameters
- gpu_index [INTEGER]: index of the GPU.
- property_name [STRING]: property name: shaderEngineCount, shaderArraysPerEngineCount, computeUnitsPerShaderArray, simdPerComputeUnit, wavefrontsPerSimd, wavefrontSize, sgprsPerSimd, minSgprAllocation, maxSgprAllocation, sgprAllocationGranularity, vgprsPerSimd, minVgprAllocation, maxVgprAllocation, vgprAllocationGranularity
Return Values
- x [INTEGER]: value of the property
Code sample
x = gh_vk.shader_core_properties_amd_get_value(gpu_index, "shaderEngineCount")
driver_properties_khr_get_value_1i
Description
KHR extension: VK_KHR_driver_properties - Returns the value of a property.
Syntax
x = gh_vk.driver_properties_khr_get_value_1i(
gpu_index,
property_name
)
Languages
Parameters
- gpu_index [INTEGER]: index of the GPU.
- property_name [STRING]: property name: driverID, conformanceVersion_major, conformanceVersion_minor, conformanceVersion_patch, conformanceVersion_subminor
Return Values
- x [INTEGER]: value of the property
Code sample
x = gh_vk.driver_properties_khr_get_value_1i(gpu_index, "driverID")
driver_properties_khr_get_value_str
Description
KHR extension: VK_KHR_driver_properties - Returns the value of a property.
Syntax
s = gh_vk.driver_properties_khr_get_value_str(
gpu_index,
property_name
)
Languages
Parameters
- gpu_index [INTEGER]: index of the GPU.
- property_name [STRING]: property name: driverName, driverID_str, driverInfo
Return Values
- s [STRING]: value of the property
Code sample
s = gh_vk.driver_properties_khr_get_value_str(gpu_index, "driverName")
gpu_get_num_memory_heaps
Description
Returns the number of memory heaps.
Syntax
num_memory_heaps = gh_vk.gpu_get_num_memory_heaps(
gpu_index
)
Languages
Parameters
- gpu_index [INTEGER]: index of the GPU.
Return Values
- num_memory_heaps [INTEGER]: number of memory heaps
Code sample
num_memory_heaps = gh_vk.gpu_get_num_memory_heaps(gpu_index)
gpu_get_heap_size
Description
Returns the number of memory heaps.
Syntax
heap_size = gh_vk.gpu_get_heap_size(
gpu_index,
memory_heap_index
)
Languages
Parameters
- gpu_index [INTEGER]: index of the GPU.
- memory_heap_index [INTEGER]: index of the memory heap.
Return Values
- heap_size [INTEGER]: size of the memory heap in bytes
Code sample
heap_size = gh_vk.gpu_get_heap_size(gpu_index, memory_heap_index)
gpu_get_device_type
Description
Returns the type of a Vulkan device.
Syntax
type = gh_vk.gpu_get_device_type(
gpu_index
)
Languages
Parameters
- gpu_index [INTEGER]: index of the GPU.
Return Values
- type [INTEGER]: type of the Vulkan device
Code sample
VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU = 1
VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU = 2
VK_PHYSICAL_DEVICE_TYPE_VIRTUAL_GPU = 3
VK_PHYSICAL_DEVICE_TYPE_CPU = 4
type = gh_vk.gpu_get_device_type(gpu_index)
if (type == VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU) then
print("- device type: DISCRETE GPU")
end
draw_mesh_tasks
Description
Starts a mesh shader (Turing GPUs) execution.
Syntax
gh_vk.draw_mesh_tasks(
first_task,
task_count
)
Languages
Parameters
- first_task [INTEGER]: first task - usually 0.
- task_count [INTEGER]: number of tasks to launch.
Return Values
This function has no return value(s).
Code sample
gh_vk.draw_mesh_tasks(first_task, task_count)
mesh_shader_get_property_value_nv
Description
Returns the value of a property for mesh shaders (Turing GPUs).
Syntax
x, y, z = gh_vk.mesh_shader_get_property_value_nv(
gpu_index,
property_name
)
Languages
Parameters
- gpu_index [INTEGER]: index of the GPU.
- property_name [STRING]: name of the property.
Return Values
- x, y, z [INTEGER]: value of the property
Code sample
Possible properties:
"maxDrawMeshTasksCount" - return value: x, 0, 0
"maxTaskWorkGroupInvocations" - return value: x, 0, 0
"maxTaskWorkGroupSize" - return value: x,y, z
"maxTaskTotalMemorySize" - return value: x, 0, 0
"maxTaskOutputCount" - return value: x, 0, 0
"maxMeshWorkGroupInvocations" - return value: x, 0, 0
"maxMeshWorkGroupSize" - return value: x,y, z
"maxMeshTotalMemorySize" - return value: x, 0, 0
"maxMeshOutputVertices" - return value: x, 0, 0
"maxMeshOutputPrimitives" - return value: x, 0, 0
"maxMeshMultiviewViewCount" - return value: x, 0, 0
"meshOutputPerVertexGranularity" - return value: x, 0, 0
"meshOutputPerPrimitiveGranularity" - return value: x, 0, 0
x, y, z = gh_vk.mesh_shader_get_property_value_nv(gpu_index, "maxDrawMeshTasksCount")
raytracing_pipeline_get_property_value_u32
Description
Returns the value of a property for Vulkan KHR raytracing (NVIDIA Turing+ or AMD RDNA2+ GPUs).
Syntax
x = gh_vk.raytracing_pipeline_get_property_value_u32(
gpu_index,
property_name
)
Languages
Parameters
- gpu_index [INTEGER]: index of the GPU.
- property_name [STRING]: name of the property.
Return Values
- x [INTEGER]: value of the property
Code sample
Possible properties:
"shaderGroupHandleSize"
"maxRayRecursionDepth"
"maxShaderGroupStride"
"shaderGroupBaseAlignment"
"shaderGroupHandleCaptureReplaySize"
"maxRayDispatchInvocationCount"
"shaderGroupHandleAlignment"
"maxRayHitAttributeSize"
x = gh_vk.raytracing_pipeline_get_property_value_u32(gpu_index, "maxRayRecursionDepth")
raytracing_acceleration_structure_get_property_value_u32
Description
Returns the value of a property for Vulkan KHR raytracing (NVIDIA Turing+ or AMD RDNA2+ GPUs).
Syntax
x = gh_vk.raytracing_acceleration_structure_get_property_value_u32(
gpu_index,
property_name
)
Languages
Parameters
- gpu_index [INTEGER]: index of the GPU.
- property_name [STRING]: name of the property.
Return Values
- x [INTEGER]: value of the property
Code sample
Possible properties:
"maxPerStageDescriptorAccelerationStructures"
"maxPerStageDescriptorUpdateAfterBindAccelerationStructures"
"maxDescriptorSetAccelerationStructures"
"maxDescriptorSetUpdateAfterBindAccelerationStructures"
"minAccelerationStructureScratchOffsetAlignment"
x = gh_vk.raytracing_acceleration_structure_get_property_value_u32(gpu_index, "maxDescriptorSetAccelerationStructures")
raytracing_acceleration_structure_get_property_value_u64
Description
Returns the value of a property for Vulkan KHR raytracing (NVIDIA Turing+ or AMD RDNA2+ GPUs).
Syntax
x = gh_vk.raytracing_acceleration_structure_get_property_value_u64(
gpu_index,
property_name
)
Languages
Parameters
- gpu_index [INTEGER]: index of the GPU.
- property_name [STRING]: name of the property.
Return Values
- x [INTEGER]: value of the property
Code sample
Possible properties:
"maxGeometryCount"
"maxInstanceCount"
"maxPrimitiveCount"
x = gh_vk.raytracing_acceleration_structure_get_property_value_u64(gpu_index, "maxGeometryCount")
raytracing_new
Description
Description not available.
Syntax
rt_index = gh_vk.raytracing_new(
gpu_index
)
Languages
Parameters
- gpu_index [INTEGER]: index of the GPU.
Return Values
- rt_index [INTEGER]: index of the new raytracing opaque object
Code sample
gpu_index = gh_vk.get_current_gpu()
rt_index = gh_vk.raytracing_new()
raytracing_blas_add_geometry
Description
Description not available.
Syntax
blas_index = gh_vk.raytracing_blas_add_geometry(
rt_index,
mesh_id
)
Languages
Parameters
- rt_index [INTEGER]: index of the raytracing opaque object
- mesh_id [INTEGER]: identifier of a mesh.
Return Values
- blas_index [INTEGER]: index of the blas
Code sample
blas_index = gh_vk.raytracing_blas_add_geometry(rt_index, mesh_id)
raytracing_build_blas
Description
Description not available.
Syntax
ret = gh_vk.raytracing_build_blas(
rt_index
)
Languages
Parameters
- rt_index [INTEGER]: index of the raytracing opaque object
Return Values
- ret [INTEGER]: 1 if ok or 0 if error
Code sample
ret = gh_vk.raytracing_build_blas(rt_index)
raytracing_tlas_add_instance_data
Description
Description not available.
Syntax
instance_index = gh_vk.raytracing_tlas_add_instance_data(
rt_index,
mesh_id,
blas_index,
hit_group_index,
visibility_mask
)
Languages
Parameters
- rt_index [INTEGER]: index of the raytracing opaque object
- mesh_id [INTEGER]: identifier of a mesh.
- blas_index [INTEGER]: index of the blas.
- hit_group_index [INTEGER]:
- visibility_mask [INTEGER]:
Return Values
- instance_index [INTEGER]: index of the new instance
Code sample
instance_index = gh_vk.raytracing_tlas_add_instance_data(rt_index, mesh_id, blas_index, hit_group_index, visibility_mask)
raytracing_tlas_update_instance_transform
Description
Description not available.
Syntax
gh_vk.raytracing_tlas_update_instance_transform(
rt_index,
instance_index,
mesh_id
)
Languages
Parameters
- rt_index [INTEGER]: index of the raytracing opaque object
- instance_index [INTEGER]: index of the instance
- mesh_id [INTEGER]: identifier of a mesh.
Return Values
This function has no return value(s).
Code sample
gh_vk.raytracing_tlas_update_instance_transform(rt_index, instance_index, mesh_id)
raytracing_tlas_add_instance_data_v2
Description
Description not available.
Syntax
instance_index = gh_vk.raytracing_tlas_add_instance_data_v2(
rt_index,
pos_x, pos_y, pos_z,
pitch, yaw, roll,
scale_x, scale_y, scale_z,
transform_order,
blas_index,
hit_group_index,
visibility_mask
)
Languages
Parameters
- rt_index [INTEGER]: index of the raytracing opaque object
- pos_x, pos_y, pos_z [REAL]: position.
- pitch, yaw, roll [REAL]: orientation using Euler's angles.
- scale_x, scale_y, scale_z [REAL]: scale.
- transform_order [INTEGER]: transformatzion order to build the transformation matrix.
- blas_index [INTEGER]: index of the blas.
- hit_group_index [INTEGER]:
- visibility_mask [INTEGER]:
Return Values
- instance_index [INTEGER]: index of the new instance
Code sample
TRANSFORM_ORDER_TRS = 0 --default.
TRANSFORM_ORDER_RTS = 1
TRANSFORM_ORDER_TSR = 2
TRANSFORM_ORDER_RST = 3
instance_index = gh_vk.raytracing_tlas_add_instance_data_v2(rt_index, pos_x, pos_y, pos_z, pitch, yaw, roll, scale_x, scale_y, scale_z, TRANSFORM_ORDER_TRS, blas_index, hit_group_index, visibility_mask)
raytracing_tlas_update_instance_transform_v2
Description
Description not available.
Syntax
gh_vk.raytracing_tlas_update_instance_transform_v2(
rt_index,
instance_index,
pos_x, pos_y, pos_z,
pitch, yaw, roll,
scale_x, scale_y, scale_z,
transform_order
)
Languages
Parameters
- rt_index [INTEGER]: index of the raytracing opaque object
- instance_index [INTEGER]: index of the instance
- pos_x, pos_y, pos_z [REAL]: position.
- pitch, yaw, roll [REAL]: orientation using Euler's angles.
- scale_x, scale_y, scale_z [REAL]: scale.
- transform_order [INTEGER]: transformation order to build the transformation matrix.
Return Values
This function has no return value(s).
Code sample
TRANSFORM_ORDER_TRS = 0 --default.
TRANSFORM_ORDER_RTS = 1
TRANSFORM_ORDER_TSR = 2
TRANSFORM_ORDER_RST = 3
gh_vk.raytracing_tlas_update_instance_transform_v2(rt_index, instance_index, pos_x, pos_y, pos_z, pitch, yaw, roll, scale_x, scale_y, scale_z, TRANSFORM_ORDER_TRS)
raytracing_tlas_add_instance_data_v3
Description
Description not available.
Syntax
instance_index = gh_vk.raytracing_tlas_add_instance_data_v3(
rt_index,
pos_x, pos_y, pos_z,
qx, qy, qz, qw,
scale_x, scale_y, scale_z,
transform_order,
blas_index,
hit_group_index,
visibility_mask
)
Languages
Parameters
- rt_index [INTEGER]: index of the raytracing opaque object
- pos_x, pos_y, pos_z [REAL]: position.
- qx, qy, qz, qw [REAL]: orientation using a quaternion.
- scale_x, scale_y, scale_z [REAL]: scale.
- transform_order [INTEGER]: transformation order to build the transformation matrix.
- blas_index [INTEGER]: index of the blas.
- hit_group_index [INTEGER]:
- visibility_mask [INTEGER]:
Return Values
- instance_index [INTEGER]: index of the new instance
Code sample
TRANSFORM_ORDER_TRS = 0 --default.
TRANSFORM_ORDER_RTS = 1
TRANSFORM_ORDER_TSR = 2
TRANSFORM_ORDER_RST = 3
instance_index = gh_vk.raytracing_tlas_add_instance_data_v3(rt_index, pos_x, pos_y, pos_z, qx, qy, qz, qw, scale_x, scale_y, scale_z, TRANSFORM_ORDER_TRS, blas_index, hit_group_index, visibility_mask)
raytracing_tlas_update_instance_transform_v3
Description
Description not available.
Syntax
gh_vk.raytracing_tlas_update_instance_transform_v3(
rt_index,
instance_index,
pos_x, pos_y, pos_z,
qx, qy, qz, qw,
scale_x, scale_y, scale_z,
transform_order
)
Languages
Parameters
- rt_index [INTEGER]: index of the raytracing opaque object
- instance_index [INTEGER]: index of the instance
- pos_x, pos_y, pos_z [REAL]: position.
- qx, qy, qz, qw [REAL]: orientation using a quaternion.
- scale_x, scale_y, scale_z [REAL]: scale.
- transform_order [INTEGER]: transformation order to build the transformation matrix.
Return Values
This function has no return value(s).
Code sample
TRANSFORM_ORDER_TRS = 0 --default.
TRANSFORM_ORDER_RTS = 1
TRANSFORM_ORDER_TSR = 2
TRANSFORM_ORDER_RST = 3
gh_vk.raytracing_tlas_update_instance_transform_v3(rt_index, instance_index, pos_x, pos_y, pos_z, qx, qy, qz, qw, scale_x, scale_y, scale_z, TRANSFORM_ORDER_TRS)
raytracing_tlas_add_instance_data_v4
Description
Description not available.
Syntax
instance_index = gh_vk.raytracing_tlas_add_instance_data_v4(
rt_index,
m0,m1,m2,m3,m4,m5,m6,m7,m8,m9,m10,m11,m12,m13,m14,m15,
blas_index,
hit_group_index,
visibility_mask
)
Languages
Parameters
- rt_index [INTEGER]: index of the raytracing opaque object
- m0,m1,m2,m3,m4,m5,m6,m7,m8,m9,m10,m11,m12,m13,m14,m15 [REAL]: transformation matrix
- blas_index [INTEGER]: index of the blas.
- hit_group_index [INTEGER]:
- visibility_mask [INTEGER]:
Return Values
- instance_index [INTEGER]: index of the new instance
Code sample
instance_index = gh_vk.raytracing_tlas_add_instance_data_v4(rt_index, m0,m1,m2,m3,m4,m5,m6,m7,m8,m9,m10,m11,m12,m13,m14,m15, blas_index, hit_group_index, visibility_mask)
raytracing_tlas_update_instance_transform_v4
Description
Description not available.
Syntax
gh_vk.raytracing_tlas_update_instance_transform_v4(
rt_index,
instance_index,
m0,m1,m2,m3,m4,m5,m6,m7,m8,m9,m10,m11,m12,m13,m14,m15
)
Languages
Parameters
- rt_index [INTEGER]: index of the raytracing opaque object
- instance_index [INTEGER]: index of the instance
- m0,m1,m2,m3,m4,m5,m6,m7,m8,m9,m10,m11,m12,m13,m14,m15 [REAL]: transformation matrix
Return Values
This function has no return value(s).
Code sample
gh_vk.raytracing_tlas_update_instance_transform_v4(rt_index, instance_index, m0,m1,m2,m3,m4,m5,m6,m7,m8,m9,m10,m11,m12,m13,m14,m15)
raytracing_build_tlas
Description
Description not available.
Syntax
gh_vk.raytracing_build_tlas(
rt_index
)
Languages
Parameters
- rt_index [INTEGER]: index of the raytracing opaque object
Return Values
This function has no return value(s).
Code sample
gh_vk.raytracing_build_tlas(rt_index)
raytracing_update_tlas
Description
Description not available.
Syntax
gh_vk.raytracing_update_tlas(
rt_index
)
Languages
Parameters
- rt_index [INTEGER]: index of the raytracing opaque object
Return Values
This function has no return value(s).
Code sample
gh_vk.raytracing_update_tlas(rt_index)
raytracing_set_ray_recursion_depth
Description
Description not available.
Syntax
gh_vk.raytracing_set_ray_recursion_depth(
rt_index,
recursion_depth
)
Languages
Parameters
- rt_index [INTEGER]: index of the raytracing opaque object
- recursion_depth [INTEGER]: recursion depth
Return Values
This function has no return value(s).
Code sample
gh_vk.raytracing_set_ray_recursion_depth(rt_index, recursion_depth)
raytracing_pipeline_build
Description
Description not available.
Syntax
gh_vk.raytracing_pipeline_build(
rt_index,
pipeline_id,
rt_ds,
render_target_id
)
Languages
Parameters
- rt_index [INTEGER]: index of the raytracing opaque object
- pipeline_id [INTEGER]: pipeline identifier
- rt_ds [INTEGER]: descriptor set identifier
- render_target_id [INTEGER]: render target identifier. Can be 0 if not used.
Return Values
This function has no return value(s).
Code sample
rt_pipeline = gh_vk.pipeline_create("rt_pipeline", raytracing_prog, "")
rt_pipeline_ok = gh_vk.raytracing_pipeline_build(rt_index, rt_pipeline, rt_ds, 0)
raytracing_pipeline_bind
Description
Description not available.
Syntax
gh_vk.raytracing_pipeline_bind(
command_buffer,
pipeline_id
)
Languages
Parameters
- command_buffer [INTEGER]: command buffer identifier
- pipeline_id [INTEGER]: pipeline identifier
Return Values
This function has no return value(s).
Code sample
gh_vk.raytracing_pipeline_bind(command_buffer, pipeline_id)
raytracing_descriptorset_bind
Description
Description not available.
Syntax
gh_vk.raytracing_descriptorset_bind(
command_buffer,
descriptor_set_id
)
Languages
Parameters
- command_buffer [INTEGER]: command buffer identifier
- descriptor_set_id [INTEGER]: descriptor set identifier
Return Values
This function has no return value(s).
Code sample
gh_vk.raytracing_descriptorset_bind(command_buffer, descriptor_set_id)
raytracing_shader_binding_table_build
Description
Description not available.
Syntax
gh_vk.raytracing_shader_binding_table_build(
rt_index,
pipeline_id
)
Languages
Parameters
- rt_index [INTEGER]: index of the raytracing opaque object
- pipeline_id [INTEGER]: pipeline identifier
Return Values
This function has no return value(s).
Code sample
gh_vk.raytracing_shader_binding_table_build(rt_index, pipeline_id)
raytracing_raytrace
Description
Description not available.
Syntax
gh_vk.raytracing_raytrace(
rt_index,
width, height,
render_target_id,
color_target_index
)
Languages
Parameters
- rt_index [INTEGER]: index of the raytracing opaque object
- width, height [INTEGER]:
- render_target_id [INTEGER]: render target identifier. Can be 0 if not used.
- color_target_index [INTEGER]: index of the color target in the render target.
Return Values
This function has no return value(s).
Code sample
gh_vk.raytracing_raytrace(rt_index, width, height, 0, 0)
descriptorset_add_resource_storage_image
Description
Adds a storage image resource to a descriptor set.
Syntax
resource_index = gh_vk.descriptorset_add_resource_storage_image(
ds_id,
storage_image_id,
binding_point,
shader_stages
)
Languages
Parameters
- ds_id [INTEGER]: descriptor set identifier
- storage_image_id [INTEGER]: storage image identifier
- binding_point [INTEGER]: resource binding point in the shader
- shader_stages [INTEGER]: shader stages that must access to the resource
Return Values
- resource_index [INTEGER]: index of the resource in the descriptor set
Code sample
SHADER_STAGE_VERTEX = 1
SHADER_STAGE_TESSELLATION_CONTROL = 2
SHADER_STAGE_TESSELLATION_EVALUATION = 4
SHADER_STAGE_GEOMETRY = 8
SHADER_STAGE_FRAGMENT = 16
SHADER_STAGE_COMPUTE = 32
SHADER_STAGE_TASK = 64
SHADER_STAGE_MESH = 128
SHADER_STAGE_RAYGEN = 256
SHADER_STAGE_ANY_HIT = 512
SHADER_STAGE_CLOSEST_HIT = 1024
SHADER_STAGE_MISS = 2048
SHADER_STAGE_INTERSECTION = 4096
shader_stages = SHADER_STAGE_RAYGEN
binding_point = 0
resource_index = gh_vk.descriptorset_add_resource_storage_image(ds_id, storage_image_id, binding_point, shader_stages)
descriptorset_update_resource_storage_image
Description
Updates a storage image resource to a descriptor set.
Syntax
gh_vk.descriptorset_update_resource_storage_image(
ds_id,
resource_index,
storage_image_id,
binding_point,
shader_stages
)
Languages
Parameters
- ds_id [INTEGER]: descriptor set identifier
- resource_index [INTEGER]: index of the resource in the descriptor set
- storage_image_id [INTEGER]: storage image identifier
- binding_point [INTEGER]: resource binding point in the shader
- shader_stages [INTEGER]: shader stages that must access to the resource
Return Values
This function has no return value(s).
Code sample
SHADER_STAGE_VERTEX = 1
SHADER_STAGE_TESSELLATION_CONTROL = 2
SHADER_STAGE_TESSELLATION_EVALUATION = 4
SHADER_STAGE_GEOMETRY = 8
SHADER_STAGE_FRAGMENT = 16
SHADER_STAGE_COMPUTE = 32
SHADER_STAGE_TASK = 64
SHADER_STAGE_MESH = 128
SHADER_STAGE_RAYGEN = 256
SHADER_STAGE_ANY_HIT = 512
SHADER_STAGE_CLOSEST_HIT = 1024
SHADER_STAGE_MISS = 2048
SHADER_STAGE_INTERSECTION = 4096
shader_stages = SHADER_STAGE_RAYGEN
binding_point = 0
gh_vk.descriptorset_update_resource_storage_image(ds_id, resource_index, storage_image_id, binding_point, shader_stages)
descriptorset_add_geometry
Description
Adds a geometry (a mesh) to a descriptor set. Several meshes can be added. Once all meshes have been added, call descriptorset_add_all_geometry_cores_vertices() and descriptorset_add_all_geometry_cores_indices() to build the vertices and indices arrays that will be visible by shaders. Deprecated name: descriptorset_push_geometry_core
Syntax
gh_vk.descriptorset_add_geometry(
ds_id,
mesh_id
)
Languages
Parameters
- ds_id [INTEGER]: descriptor set identifier
- mesh_id [INTEGER]: mesh identifier
Return Values
This function has no return value(s).
Code sample
gh_vk.descriptorset_add_geometry(ds_id, mesh0)
gh_vk.descriptorset_add_geometry(ds_id, mesh1)
gh_vk.descriptorset_add_geometry(ds_id, mesh2)
binding_point = 2
gh_vk.descriptorset_build_geometries_vertices_arrays(ds_id, binding_point, shader_stages)
binding_point = 3
gh_vk.descriptorset_build_geometries_indices_arrays(ds_id, binding_point, shader_stages)
descriptorset_build_geometries_vertices_arrays
Description
Builds the vertices arrays that are visible by shaders. Deprecated name: descriptorset_add_all_geometry_cores_vertices
Syntax
gh_vk.descriptorset_build_geometries_vertices_arrays(
ds_id,
binding_point,
shader_stages
)
Languages
Parameters
- ds_id [INTEGER]: descriptor set identifier
- binding_point [INTEGER]: resource binding point in the shader
- shader_stages [INTEGER]: shader stages that must access to the resource
Return Values
This function has no return value(s).
Code sample
gh_vk.descriptorset_add_geometry(ds_id, mesh0)
gh_vk.descriptorset_add_geometry(ds_id, mesh1)
gh_vk.descriptorset_add_geometry(ds_id, mesh2)
binding_point = 2
gh_vk.descriptorset_build_geometries_vertices_arrays(ds_id, binding_point, shader_stages)
binding_point = 3
gh_vk.descriptorset_build_geometries_indices_arrays(ds_id, binding_point, shader_stages)
descriptorset_build_geometries_indices_arrays
Description
Builds the indices arrays that are visible by shaders. Deprecated name: descriptorset_add_all_geometry_cores_indices
Syntax
gh_vk.descriptorset_build_geometries_indices_arrays(
ds_id,
binding_point,
shader_stages
)
Languages
Parameters
- ds_id [INTEGER]: descriptor set identifier
- binding_point [INTEGER]: resource binding point in the shader
- shader_stages [INTEGER]: shader stages that must access to the resource
Return Values
This function has no return value(s).
Code sample
gh_vk.descriptorset_add_geometry(ds_id, mesh0)
gh_vk.descriptorset_add_geometry(ds_id, mesh1)
gh_vk.descriptorset_add_geometry(ds_id, mesh2)
binding_point = 2
gh_vk.descriptorset_build_geometries_vertices_arrays(ds_id, binding_point, shader_stages)
binding_point = 3
gh_vk.descriptorset_build_geometries_indices_arrays(ds_id, binding_point, shader_stages)
command_buffer_op
Description
Operation on a command buffer: begin, end and submit. Useful in some situations like ray tracing.
Syntax
gh_vk.command_buffer_op(
command_buffer,
op
)
Languages
Parameters
- command_buffer [INTEGER]: command buffer identifier
- op [STRING]: operation on the command buffer: begin, end or submit
Return Values
This function has no return value(s).
Code sample
# INIT
command_buffer = gh_vk.command_buffer_create(0)
# FRAME
gh_vk.command_buffer_op(command_buffer, "begin")
...
gh_vk.command_buffer_op(command_buffer, "end")
gh_vk.command_buffer_op(command_buffer, "submit")
create_storage_image
Description
Creates a storage image.
Syntax
storage_image_id = gh_vk.create_storage_image(
width, height,
pixel_format
)
Languages
Parameters
- width, height [INTEGER]: size of the storage image
- pixel_format [INTEGER]: pixel format
Return Values
- storage_image_id [INTEGER]: storage image identifier
Code sample
PF_U8_RGB = 1
PF_U8_RGBA = 3
PF_F32_RGBA = 6
storage_image_id = gh_vk.create_storage_image(1024, 1024, PF_F32_RGBA)
create_storage_kill
Description
Destroys a storage image.
Syntax
gh_vk.create_storage_kill(
storage_image_id
)
Languages
Parameters
- storage_image_id [INTEGER]: storage image identifier
Return Values
This function has no return value(s).
Code sample
gh_vk.create_storage_image(storage_image_id)
| |