< 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: 82

  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 ()



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")
			






GeeXLab Rootard Guide | Downloads | Contact | Newsletter