< 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

  1. gh_vk.descriptorset_create ()
  2. gh_vk.descriptorset_kill ()
  3. gh_vk.descriptorset_build ()
  4. gh_vk.descriptorset_update ()
  5. gh_vk.descriptorset_bind ()
  6. gh_vk.descriptorset_add_resource_gpu_buffer ()
  7. gh_vk.descriptorset_update_resource_gpu_buffer ()
  8. gh_vk.descriptorset_add_resource_texture ()
  9. gh_vk.descriptorset_update_resource_texture ()
  10. gh_vk.descriptorset_add_resource_empty_texture_array ()
  11. gh_vk.descriptorset_update_resource_texture_array ()
  12. gh_vk.descriptorset_add_resource_rt_color ()
  13. gh_vk.descriptorset_update_resource_rt_color ()
  14. gh_vk.descriptorset_add_push_constant_range ()
  15. gh_vk.descriptorset_push_constant_1f ()
  16. gh_vk.descriptorset_push_constant_4f ()
  17. gh_vk.descriptorset_push_constant_4x4f ()
  18. gh_vk.descriptorset_push_constant_1i ()
  19. gh_vk.descriptorset_push_constant_4i ()
  20. gh_vk.descriptorset_push_constant_object_matrix ()
  21. gh_vk.descriptorset_push_constant_camera_view_matrix ()
  22. gh_vk.descriptorset_push_constant_camera_projection_matrix ()
  23. gh_vk.pipeline_create ()
  24. gh_vk.pipeline_kill ()
  25. gh_vk.pipeline_bind ()
  26. gh_vk.pipeline_build ()
  27. gh_vk.pipeline_build_v2 ()
  28. gh_vk.pipeline_set_attrib_4i ()
  29. gh_vk.pipeline_set_attrib_4f ()
  30. gh_vk.command_buffer_create ()
  31. gh_vk.command_buffer_kill ()
  32. gh_vk.command_buffer_begin ()
  33. gh_vk.command_buffer_end ()
  34. gh_vk.command_buffer_reset ()
  35. gh_vk.command_buffer_execute ()
  36. gh_vk.command_buffer_execute_secondary_cmd ()
  37. gh_vk.render_pass_begin ()
  38. gh_vk.render_pass_begin_v2 ()
  39. gh_vk.render_pass_begin_v3 ()
  40. gh_vk.render_pass_end ()
  41. gh_vk.swapchain_get_image_count ()
  42. gh_vk.swapchain_get_current_image_index ()
  43. gh_vk.swapchain_has_changed ()
  44. gh_vk.sampler_create ()
  45. gh_vk.sampler_kill ()
  46. gh_vk.set_viewport_scissor ()
  47. gh_vk.clear_color_depth_buffers ()
  48. gh_vk.wait_for_gpu ()
  49. gh_vk.instance_get_num_layers ()
  50. gh_vk.instance_get_layer_name ()
  51. gh_vk.instance_get_num_extensions ()
  52. gh_vk.instance_get_extension_name ()
  53. gh_vk.get_num_gpus ()
  54. gh_vk.gpu_get_name ()
  55. gh_vk.gpu_get_device_id ()
  56. gh_vk.gpu_get_num_layers ()
  57. gh_vk.gpu_get_layer_name ()
  58. gh_vk.gpu_get_num_extensions ()
  59. gh_vk.gpu_get_extension_name ()
  60. gh_vk.gpu_is_extension_supported ()
  61. gh_vk.gpu_get_api_version ()
  62. gh_vk.gpu_get_nvidia_driver_version ()
  63. gh_vk.get_num_physical_device_features ()
  64. gh_vk.get_physical_device_feature_state ()
  65. gh_vk.get_physical_device_feature_name ()
  66. gh_vk.get_physical_device_feature_index ()
  67. gh_vk.get_num_physical_device_limits ()
  68. gh_vk.get_physical_device_limit_type ()
  69. gh_vk.get_physical_device_limit_name ()
  70. gh_vk.get_physical_device_limit_index ()
  71. gh_vk.get_physical_device_limit_f32 ()
  72. gh_vk.get_physical_device_limit_s32 ()
  73. gh_vk.get_physical_device_limit_u32 ()
  74. gh_vk.get_physical_device_limit_u64 ()
  75. gh_vk.shader_core_properties_amd_get_value ()
  76. gh_vk.driver_properties_khr_get_value_1i ()
  77. gh_vk.driver_properties_khr_get_value_str ()
  78. gh_vk.gpu_get_num_memory_heaps ()
  79. gh_vk.gpu_get_heap_size ()
  80. gh_vk.gpu_get_device_type ()
  81. gh_vk.draw_mesh_tasks ()
  82. gh_vk.mesh_shader_get_property_value_nv ()
  83. gh_vk.raytracing_pipeline_get_property_value_u32 ()
  84. gh_vk.raytracing_acceleration_structure_get_property_value_u32 ()
  85. gh_vk.raytracing_acceleration_structure_get_property_value_u64 ()
  86. gh_vk.raytracing_new ()
  87. gh_vk.raytracing_blas_add_geometry ()
  88. gh_vk.raytracing_build_blas ()
  89. gh_vk.raytracing_tlas_add_instance_data ()
  90. gh_vk.raytracing_tlas_update_instance_transform ()
  91. gh_vk.raytracing_tlas_add_instance_data_v2 ()
  92. gh_vk.raytracing_tlas_update_instance_transform_v2 ()
  93. gh_vk.raytracing_tlas_add_instance_data_v3 ()
  94. gh_vk.raytracing_tlas_update_instance_transform_v3 ()
  95. gh_vk.raytracing_tlas_add_instance_data_v4 ()
  96. gh_vk.raytracing_tlas_update_instance_transform_v4 ()
  97. gh_vk.raytracing_build_tlas ()
  98. gh_vk.raytracing_update_tlas ()
  99. gh_vk.raytracing_set_ray_recursion_depth ()
  100. gh_vk.raytracing_pipeline_build ()
  101. gh_vk.raytracing_pipeline_bind ()
  102. gh_vk.raytracing_descriptorset_bind ()
  103. gh_vk.raytracing_shader_binding_table_build ()
  104. gh_vk.raytracing_raytrace ()
  105. gh_vk.descriptorset_add_resource_storage_image ()
  106. gh_vk.descriptorset_update_resource_storage_image ()
  107. gh_vk.descriptorset_add_geometry ()
  108. gh_vk.descriptorset_build_geometries_vertices_arrays ()
  109. gh_vk.descriptorset_build_geometries_indices_arrays ()
  110. gh_vk.command_buffer_op ()
  111. gh_vk.create_storage_image ()
  112. 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


Code sample


ds_id = gh_vk.descriptorset_create()
			


descriptorset_kill

Description

Destroys a descriptor set.


Syntax

gh_vk.descriptorset_kill(
 ds_id
)

Languages


Parameters


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


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


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


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


Return Values


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


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


Return Values


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


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


Return Values


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


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


Return Values


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


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


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


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


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


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


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


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


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


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


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


Return Values


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


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


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


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


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


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


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


Return Values


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


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


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


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


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


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


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


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


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


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


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


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


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


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


Return Values


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


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


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


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


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


Return Values


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


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


Return Values


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


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


Return Values


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


Return Values


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


Return Values


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


Return Values


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


Return Values


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


Return Values


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


Return Values


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


Return Values


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


Return Values


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


Return Values


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


Return Values


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


Return Values


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


Return Values


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


Return Values


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


Return Values


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


Return Values


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


Return Values


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


Return Values


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


Return Values


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


Return Values


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


Return Values


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


Return Values


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


Return Values


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


Return Values


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


Return Values


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


Return Values


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


Return Values


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


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


Return Values


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


Return Values


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


Return Values


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


Return Values


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


Return Values


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


Return Values


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


Return Values


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


Return Values


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


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


Return Values


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


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


Return Values


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


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


Return Values


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


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


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


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


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


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


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


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


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


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


Return Values


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


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


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


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


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


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


Return Values


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


Return Values

This function has no return value(s).


Code sample


gh_vk.create_storage_image(storage_image_id)
			






GeeXLab Rootard Guide | Downloads | Contact