vkd3d  1.3
The vkd3d 3D Graphics Library
Data Fields
vkd3d_shader_descriptor_offset_info Struct Reference

A chained structure containing descriptor offsets. More...

#include <vkd3d_shader.h>

Collaboration diagram for vkd3d_shader_descriptor_offset_info:
Collaboration graph
[legend]

Data Fields

enum vkd3d_shader_structure_type type
 Must be set to VKD3D_SHADER_STRUCTURE_TYPE_DESCRIPTOR_OFFSET_INFO.
 
const void * next
 Optional pointer to a structure containing further parameters.
 
unsigned int descriptor_table_offset
 Byte offset within the push constants of an array of 32-bit descriptor array offsets. More...
 
unsigned int descriptor_table_count
 Size, in elements, of the descriptor table push constant array.
 
const struct vkd3d_shader_descriptor_offsetbinding_offsets
 Pointer to an array of struct vkd3d_shader_descriptor_offset objects. More...
 
const struct vkd3d_shader_descriptor_offsetuav_counter_offsets
 Pointer to an array of offsets into the descriptor arrays referenced by the 'uav_counters' array in struct vkd3d_shader_interface_info. More...
 

Detailed Description

A chained structure containing descriptor offsets.

This structure is optional.

This structure extends vkd3d_shader_interface_info.

This structure contains only input parameters.

Since
1.3

Field Documentation

◆ binding_offsets

const struct vkd3d_shader_descriptor_offset* vkd3d_shader_descriptor_offset_info::binding_offsets

Pointer to an array of struct vkd3d_shader_descriptor_offset objects.

The 'static_offset' field contains an offset into the descriptor arrays referenced by the 'bindings' array in struct vkd3d_shader_interface_info. This allows mapping multiple shader resource arrays to a single binding point in the target environment.

'dynamic_offset_index' in struct vkd3d_shader_descriptor_offset allows offsets to be set at runtime. The 32-bit descriptor table push constant at this index will be added to 'static_offset' to calculate the final binding offset.

If runtime offsets are not required, set all 'dynamic_offset_index' values to ~0u and 'descriptor_table_count' to zero.

For example, to map Direct3D constant buffer registers 'cb0[0:3]' and 'cb1[6:7]' to descriptors 8-12 and 4-5 in the Vulkan descriptor array in descriptor set 3 and with binding 2, set the following values in the 'bindings' array in struct vkd3d_shader_interface_info:

register_space = 0
register_index = 0
binding.set = 3
binding.binding = 2
binding.count = 4
register_space = 0
register_index = 6
binding.set = 3
binding.binding = 2
binding.count = 2

and then pass {8, 4} as static binding offsets here.

This field may be NULL, in which case the corresponding offsets are specified to be 0.

◆ descriptor_table_offset

unsigned int vkd3d_shader_descriptor_offset_info::descriptor_table_offset

Byte offset within the push constants of an array of 32-bit descriptor array offsets.

See the description of 'binding_offsets' below.

◆ uav_counter_offsets

const struct vkd3d_shader_descriptor_offset* vkd3d_shader_descriptor_offset_info::uav_counter_offsets

Pointer to an array of offsets into the descriptor arrays referenced by the 'uav_counters' array in struct vkd3d_shader_interface_info.

This works the same way as binding_offsets above.


The documentation for this struct was generated from the following file:
vkd3d_shader_descriptor_offset_info::type
enum vkd3d_shader_structure_type type
Must be set to VKD3D_SHADER_STRUCTURE_TYPE_DESCRIPTOR_OFFSET_INFO.
Definition: vkd3d_shader.h:492
VKD3D_SHADER_DESCRIPTOR_TYPE_CBV
@ VKD3D_SHADER_DESCRIPTOR_TYPE_CBV
The descriptor is a constant buffer view.
Definition: vkd3d_shader.h:203