Loading...
Searching...
No Matches
vkd3d_shader_scan_descriptor_info Struct Reference

A chained structure enumerating the descriptors declared by a shader. More...

`#include <vkd3d_shader.h>`

Collaboration diagram for vkd3d_shader_scan_descriptor_info:
[legend]

## Data Fields

enum vkd3d_shader_structure_type | type
| Input; must be set to VKD3D_SHADER_STRUCTURE_TYPE_SCAN_DESCRIPTOR_INFO.
const void * | next
| Input; optional pointer to a structure containing further parameters.
struct vkd3d_shader_descriptor_info * | descriptors
| Output; returns a pointer to an array of descriptors.
unsigned int | descriptor_count
| Output; size, in elements, of descriptors.

## Detailed Description

A chained structure enumerating the descriptors declared by a shader.

This structure extends vkd3d_shader_compile_info.

When scanning a legacy Direct3D shader, vkd3d-shader enumerates descriptors as follows:

- Each constant register set used by the shader is scanned as a single constant buffer descriptor. There may therefore be up to three such descriptors, one for each register set used by the shader: float, integer, and boolean. The fields are set as follows:
  - The vkd3d_shader_descriptor_info::type field is set to VKD3D_SHADER_DESCRIPTOR_TYPE_CBV.
  - The vkd3d_shader_descriptor_info::register_space field is set to zero.
  - The vkd3d_shader_descriptor_info::register_index field is set to a member of enum vkd3d_shader_d3dbc_constant_register denoting which set is used.
  - The vkd3d_shader_descriptor_info::count field is set to one.
- Each sampler used by the shader is scanned as two separate descriptors, one representing the texture, and one representing the sampler state. If desired, these may be mapped back into a single combined sampler using struct vkd3d_shader_combined_resource_sampler. The fields are set as follows:
  - The vkd3d_shader_descriptor_info::type field is set to VKD3D_SHADER_DESCRIPTOR_TYPE_SRV and VKD3D_SHADER_DESCRIPTOR_TYPE_SAMPLER respectively.
  - The vkd3d_shader_descriptor_info::register_space field is set to zero.
  - The vkd3d_shader_descriptor_info::register_index field is set to the binding index of the original sampler, for both descriptors.
  - The vkd3d_shader_descriptor_info::count field is set to one.

The documentation for this struct was generated from the following file:

- include/vkd3d_shader.h