|
ReactOS 0.4.17-dev-934-g091855f
|


Go to the source code of this file.
Macros | |
| #define | VKD3D_SHADER_DUMMY_SAMPLER_INDEX ~0u |
| #define | VKD3D_SHADER_SWIZZLE_MASK (0xffu) |
| #define | VKD3D_SHADER_SWIZZLE_SHIFT(idx) (8u * (idx)) |
| #define | VKD3D_SHADER_SWIZZLE(x, y, z, w) |
| #define | VKD3D_SHADER_NO_SWIZZLE VKD3D_SHADER_SWIZZLE(X, Y, Z, W) |
| #define | VKD3D_SHADER_API VKD3D_IMPORT |
This file contains definitions for the vkd3d-shader library.
The vkd3d-shader library provides multiple utilities related to the compilation, transformation, and reflection of GPU shaders.
Definition in file vkd3d_shader.h.
| #define VKD3D_SHADER_API VKD3D_IMPORT |
Definition at line 2445 of file vkd3d_shader.h.
| #define VKD3D_SHADER_DUMMY_SAMPLER_INDEX ~0u |
Definition at line 964 of file vkd3d_shader.h.
The identity swizzle ".xyzw".
Definition at line 2265 of file vkd3d_shader.h.
A helper macro which returns a vkd3d-shader swizzle with the given components. The components are specified as the suffixes to members of vkd3d_shader_swizzle_component. For example, the swizzle ".xwyy" can be represented as:
Definition at line 2258 of file vkd3d_shader.h.
| #define VKD3D_SHADER_SWIZZLE_MASK (0xffu) |
A mask selecting one component from a vkd3d-shader swizzle. The component has type vkd3d_shader_swizzle_component.
Definition at line 2245 of file vkd3d_shader.h.
The offset, in bits, of the nth parameter of a vkd3d-shader swizzle.
Definition at line 2247 of file vkd3d_shader.h.
| typedef void(* PFN_vkd3d_shader_build_varying_map) (const struct vkd3d_shader_signature *output_signature, const struct vkd3d_shader_signature *input_signature, unsigned int *count, struct vkd3d_shader_varying_map *varyings) |
| typedef void(* PFN_vkd3d_shader_close_include) (const struct vkd3d_shader_code *code, void *context) |
Type of a callback function which will be used to close preprocessor includes.
This callback function is passed as part of struct vkd3d_shader_preprocess_info.
| code | Contents of the included file, which were allocated by the vkd3d_shader_preprocess_info.pfn_open_include callback. The user must free them. |
| context | The user-defined pointer passed to struct vkd3d_shader_preprocess_info. |
Definition at line 1479 of file vkd3d_shader.h.
| typedef int(* PFN_vkd3d_shader_compile) (const struct vkd3d_shader_compile_info *compile_info, struct vkd3d_shader_code *out, char **messages) |
Type of vkd3d_shader_compile().
Definition at line 3024 of file vkd3d_shader.h.
| typedef int(* PFN_vkd3d_shader_convert_root_signature) (struct vkd3d_shader_versioned_root_signature_desc *dst, enum vkd3d_shader_root_signature_version version, const struct vkd3d_shader_versioned_root_signature_desc *src) |
Type of vkd3d_shader_convert_root_signature().
Definition at line 3043 of file vkd3d_shader.h.
| typedef struct vkd3d_shader_signature_element *(* PFN_vkd3d_shader_find_signature_element) (const struct vkd3d_shader_signature *signature, const char *semantic_name, unsigned int semantic_index, unsigned int stream_index) |
Type of vkd3d_shader_find_signature_element().
Definition at line 3053 of file vkd3d_shader.h.
| typedef void(* PFN_vkd3d_shader_free_dxbc) (struct vkd3d_shader_dxbc_desc *dxbc) |
Type of vkd3d_shader_free_messages().
Definition at line 3027 of file vkd3d_shader.h.
| typedef void(* PFN_vkd3d_shader_free_root_signature) (struct vkd3d_shader_versioned_root_signature_desc *root_signature) |
Type of vkd3d_shader_free_root_signature().
Definition at line 3035 of file vkd3d_shader.h.
| typedef void(* PFN_vkd3d_shader_free_scan_combined_resource_sampler_info) (struct vkd3d_shader_scan_combined_resource_sampler_info *info) |
Type of vkd3d_shader_free_scan_combined_resource_sampler_info().
Definition at line 3086 of file vkd3d_shader.h.
| typedef void(* PFN_vkd3d_shader_free_scan_descriptor_info) (struct vkd3d_shader_scan_descriptor_info *scan_descriptor_info) |
Type of vkd3d_shader_free_scan_descriptor_info().
Definition at line 3049 of file vkd3d_shader.h.
| typedef void(* PFN_vkd3d_shader_free_scan_signature_info) (struct vkd3d_shader_scan_signature_info *info) |
Type of vkd3d_shader_free_scan_signature_info().
Definition at line 3083 of file vkd3d_shader.h.
| typedef void(* PFN_vkd3d_shader_free_shader_code) (struct vkd3d_shader_code *code) |
Type of vkd3d_shader_free_shader_code().
Definition at line 3029 of file vkd3d_shader.h.
| typedef void(* PFN_vkd3d_shader_free_shader_signature) (struct vkd3d_shader_signature *signature) |
Type of vkd3d_shader_free_shader_signature().
Definition at line 3060 of file vkd3d_shader.h.
| typedef enum vkd3d_shader_source_type *(* PFN_vkd3d_shader_get_supported_source_types) (unsigned int *count) |
Type of vkd3d_shader_get_supported_source_types().
Definition at line 3016 of file vkd3d_shader.h.
| typedef enum vkd3d_shader_target_type *(* PFN_vkd3d_shader_get_supported_target_types) (enum vkd3d_shader_source_type source_type, unsigned int *count) |
Type of vkd3d_shader_get_supported_target_types().
Definition at line 3016 of file vkd3d_shader.h.
Type of vkd3d_shader_get_version().
Definition at line 3016 of file vkd3d_shader.h.
| typedef int(* PFN_vkd3d_shader_open_include) (const char *filename, bool local, const char *parent_data, void *context, struct vkd3d_shader_code *out) |
Type of a callback function which will be used to open preprocessor includes.
This callback function is passed as part of struct vkd3d_shader_preprocess_info.
If this function fails, vkd3d-shader will emit a compilation error, and the pfn_close_include callback will not be called.
| filename | Unquoted string used as an argument to the #include directive. |
| local | Whether the #include directive is requesting a local (i.e. double-quoted) or system (i.e. angle-bracketed) include. |
| parent_data | Unprocessed source code of the file in which this #include directive is evaluated. This parameter may be NULL. |
| context | The user-defined pointer passed to struct vkd3d_shader_preprocess_info. |
| out | Output location for the full contents of the included file. The code need not be allocated using standard vkd3d functions, but must remain valid until the corresponding call to pfn_close_include. If this function fails, the contents of this parameter are ignored. |
Definition at line 1463 of file vkd3d_shader.h.
| typedef int(* PFN_vkd3d_shader_parse_input_signature) (const struct vkd3d_shader_code *dxbc, struct vkd3d_shader_signature *signature, char **messages) |
Type of vkd3d_shader_parse_input_signature().
Definition at line 3053 of file vkd3d_shader.h.
| typedef int(* PFN_vkd3d_shader_parse_root_signature) (const struct vkd3d_shader_code *dxbc, struct vkd3d_shader_versioned_root_signature_desc *root_signature, char **messages) |
Type of vkd3d_shader_parse_root_signature().
Definition at line 3032 of file vkd3d_shader.h.
| typedef void(* PFN_vkd3d_shader_preprocess) (struct vkd3d_shader_compile_info *compile_info, struct vkd3d_shader_code *out, char **messages) |
| typedef int(* PFN_vkd3d_shader_scan) (const struct vkd3d_shader_compile_info *compile_info, char **messages) |
Type of vkd3d_shader_scan().
Definition at line 3047 of file vkd3d_shader.h.
| typedef int(* PFN_vkd3d_shader_serialize_dxbc) (size_t section_count, const struct vkd3d_shader_dxbc_section_desc *sections, struct vkd3d_shader_code *dxbc, char **messages) |
| typedef int(* PFN_vkd3d_shader_serialize_root_signature) (const struct vkd3d_shader_versioned_root_signature_desc *root_signature, struct vkd3d_shader_code *dxbc, char **messages) |
Type of vkd3d_shader_serialize_root_signature().
Definition at line 3038 of file vkd3d_shader.h.
| typedef void(* PFN_vkd3d_shader_set_log_callback) (PFN_vkd3d_log callback) |
Definition at line 43 of file vkd3d_shader.h.
| Enumerator | |
|---|---|
| VKD3D_SHADER_BINDING_FLAG_BUFFER | |
| VKD3D_SHADER_BINDING_FLAG_IMAGE | |
| VKD3D_FORCE_32_BIT_ENUM | |
Definition at line 466 of file vkd3d_shader.h.
Definition at line 1628 of file vkd3d_shader.h.
Individual options to enable various backward compatibility features.
| Enumerator | |
|---|---|
| VKD3D_SHADER_COMPILE_OPTION_BACKCOMPAT_MAP_SEMANTIC_NAMES | Causes compiler to convert SM1-3 semantics to corresponding System Value semantics, when compiling HLSL sources for SM4+ targets. This option does the following conversions:
|
| VKD3D_SHADER_COMPILE_OPTION_DOUBLE_AS_FLOAT_ALIAS | Causes 'double' to behave as an alias for 'float'. This option only applies to HLSL sources with shader model 1-3 target profiles. Without this option using the 'double' type produces compilation errors in these target profiles. This option is disabled by default.
|
| VKD3D_FORCE_32_BIT_ENUM | |
Definition at line 180 of file vkd3d_shader.h.
Determines how buffer UAVs are stored.
This also affects UAV counters in Vulkan environments. In OpenGL environments, atomic counter buffers are always used for UAV counters.
| Enumerator | |
|---|---|
| VKD3D_SHADER_COMPILE_OPTION_BUFFER_UAV_STORAGE_TEXEL_BUFFER | Use buffer textures for buffer UAVs. This is the default value. |
| VKD3D_SHADER_COMPILE_OPTION_BUFFER_UAV_STORAGE_BUFFER | Use storage buffers for buffer UAVs. |
| VKD3D_FORCE_32_BIT_ENUM | |
Definition at line 125 of file vkd3d_shader.h.
Advertises feature availability.
| Enumerator | |
|---|---|
| VKD3D_SHADER_COMPILE_OPTION_FEATURE_INT64 | The SPIR-V target environment supports 64-bit integer types. This corresponds to the "shaderInt64" feature in the Vulkan API, and the "GL_ARB_gpu_shader_int64" extension in the OpenGL API. |
| VKD3D_SHADER_COMPILE_OPTION_FEATURE_FLOAT64 | The SPIR-V target environment supports 64-bit floating-point types. This corresponds to the "shaderFloat64" feature in the Vulkan API, and the "GL_ARB_gpu_shader_fp64" extension in the OpenGL API. |
| VKD3D_SHADER_COMPILE_OPTION_FEATURE_WAVE_OPS | The SPIR-V target environment supports wave operations. This flag is valid only in VKD3D_SHADER_SPIRV_ENVIRONMENT_VULKAN_1_1 or greater, and corresponds to the following minimum requirements in VkPhysicalDeviceSubgroupProperties:
|
| VKD3D_FORCE_32_BIT_ENUM | |
Definition at line 227 of file vkd3d_shader.h.
Definition at line 152 of file vkd3d_shader.h.
Determines the origin of fragment coordinates.
| Enumerator | |
|---|---|
| VKD3D_SHADER_COMPILE_OPTION_FRAGMENT_COORDINATE_ORIGIN_UPPER_LEFT | Fragment coordinates originate from the upper-left. This is the default; it's also the only value supported by Vulkan environments. |
| VKD3D_SHADER_COMPILE_OPTION_FRAGMENT_COORDINATE_ORIGIN_LOWER_LEFT | Fragment coordinates originate from the lower-left. This matches the traditional behaviour of OpenGL environments. |
| VKD3D_FORCE_32_BIT_ENUM | |
Definition at line 214 of file vkd3d_shader.h.
| Enumerator | |
|---|---|
| VKD3D_SHADER_COMPILE_OPTION_STRIP_DEBUG | If value is nonzero, do not include debug information in the compiled shader. The default value is zero. This option is supported by vkd3d_shader_compile(). However, not all compilers support generating debug information. |
| VKD3D_SHADER_COMPILE_OPTION_BUFFER_UAV | value is a member of enum vkd3d_shader_compile_option_buffer_uav. |
| VKD3D_SHADER_COMPILE_OPTION_FORMATTING | value is a member of enum vkd3d_shader_compile_option_formatting_flags. |
| VKD3D_SHADER_COMPILE_OPTION_API_VERSION | value is a member of enum vkd3d_shader_api_version.
|
| VKD3D_SHADER_COMPILE_OPTION_TYPED_UAV | value is a member of enum vkd3d_shader_compile_option_typed_uav.
|
| VKD3D_SHADER_COMPILE_OPTION_WRITE_TESS_GEOM_POINT_SIZE | If value is nonzero, write the point size for Vulkan tessellation and geometry shaders. This option should be enabled if and only if the shaderTessellationAndGeometryPointSize feature is enabled. The default value is nonzero, i.e. write the point size. This option is supported by vkd3d_shader_compile() for the SPIR-V target type and Vulkan targets; it should not be enabled otherwise.
|
| VKD3D_SHADER_COMPILE_OPTION_PACK_MATRIX_ORDER | This option specifies default matrix packing order for HLSL sources. Explicit variable modifiers or pragmas will take precedence. value is a member of enum vkd3d_shader_compile_option_pack_matrix_order.
|
| VKD3D_SHADER_COMPILE_OPTION_BACKWARD_COMPATIBILITY | This option is used to enable various backward compatibility features. value is a mask of values from enum vkd3d_shader_compile_option_backward_compatibility.
|
| VKD3D_SHADER_COMPILE_OPTION_FRAGMENT_COORDINATE_ORIGIN | This option specifies the origin of fragment coordinates for SPIR-V targets. value is a member of enum vkd3d_shader_compile_option_fragment_coordinate_origin.
|
| VKD3D_SHADER_COMPILE_OPTION_FEATURE | This option specifies the shader features available in the target environment. These are not extensions, i.e. they are always supported by the driver, but may not be supported by the available hardware. value is a member of enum vkd3d_shader_compile_option_feature_flags.
|
| VKD3D_SHADER_COMPILE_OPTION_CHILD_EFFECT | If value is non-zero compilation will produce a child effect using shared object descriptions, as instructed by the "shared" modifier. Child effects are supported with fx_4_0, and fx_4_1 profiles. This option and "shared" modifiers are ignored for the fx_5_0 profile and non-fx profiles. The fx_2_0 profile does not have a separate concept of child effects, variables marked with "shared" modifier will be marked as such in a binary.
|
| VKD3D_SHADER_COMPILE_OPTION_WARN_IMPLICIT_TRUNCATION | If value is nonzero, emit a compile warning warn when vectors or matrices are truncated in an implicit conversion. If warnings are disabled, this option has no effect. This option has no effects for targets other than HLSL. The default value is nonzero, i.e. enable implicit truncation warnings.
|
| VKD3D_SHADER_COMPILE_OPTION_INCLUDE_EMPTY_BUFFERS_IN_EFFECTS | If value is nonzero, empty constant buffers descriptions are written out in the output effect binary. This option applies only to fx_4_0 and fx_4_1 profiles and is otherwise ignored.
|
| VKD3D_FORCE_32_BIT_ENUM | |
Definition at line 264 of file vkd3d_shader.h.
Determines how matrices are stored.
| Enumerator | |
|---|---|
| VKD3D_SHADER_COMPILE_OPTION_PACK_MATRIX_ROW_MAJOR | |
| VKD3D_SHADER_COMPILE_OPTION_PACK_MATRIX_COLUMN_MAJOR | |
| VKD3D_FORCE_32_BIT_ENUM | |
Definition at line 171 of file vkd3d_shader.h.
Determines how typed UAVs are declared.
| Enumerator | |
|---|---|
| VKD3D_SHADER_COMPILE_OPTION_TYPED_UAV_READ_FORMAT_R32 | Use R32(u)i/R32f format for UAVs which are read from. This is the default value. |
| VKD3D_SHADER_COMPILE_OPTION_TYPED_UAV_READ_FORMAT_UNKNOWN | Use Unknown format for UAVs which are read from. This should only be set if shaderStorageImageReadWithoutFormat is enabled in the target environment. |
| VKD3D_FORCE_32_BIT_ENUM | |
Definition at line 139 of file vkd3d_shader.h.
Data type of a shader varying, returned as part of struct vkd3d_shader_signature_element.
Definition at line 2047 of file vkd3d_shader.h.
Symbolic register indices for mapping uniform constant register sets in legacy Direct3D bytecode to constant buffer views in the target environment.
Members of this enumeration are used in vkd3d_shader_resource_binding::register_index.
Definition at line 912 of file vkd3d_shader.h.
Additional flags describing a shader descriptor, returned as part of struct vkd3d_shader_descriptor_info.
Definition at line 1897 of file vkd3d_shader.h.
Definition at line 1753 of file vkd3d_shader.h.
The type of a shader resource descriptor.
Definition at line 419 of file vkd3d_shader.h.
Definition at line 1575 of file vkd3d_shader.h.
Describes the minimum severity of compilation messages returned by vkd3d_shader_compile() and similar functions.
Definition at line 1276 of file vkd3d_shader.h.
Minimum interpolation precision of a shader varying, returned as part of struct vkd3d_shader_signature_element.
Definition at line 2124 of file vkd3d_shader.h.
The format of data provided to the shader, used in struct vkd3d_shader_parameter and struct vkd3d_shader_parameter1.
| Enumerator | |
|---|---|
| VKD3D_SHADER_PARAMETER_DATA_TYPE_UNKNOWN | |
| VKD3D_SHADER_PARAMETER_DATA_TYPE_UINT32 | The parameter is provided as a 32-bit unsigned integer. |
| VKD3D_SHADER_PARAMETER_DATA_TYPE_FLOAT32 | The parameter is provided as a 32-bit float.
|
| VKD3D_SHADER_PARAMETER_DATA_TYPE_FLOAT32_VEC4 | The parameter is provided as a 4-dimensional vector of 32-bit floats. This parameter must be used with struct vkd3d_shader_parameter1; it cannot be used with struct vkd3d_shader_parameter.
|
| VKD3D_FORCE_32_BIT_ENUM | |
Definition at line 503 of file vkd3d_shader.h.
Names a specific shader parameter, used in struct vkd3d_shader_parameter and struct vkd3d_shader_parameter1.
| Enumerator | |
|---|---|
| VKD3D_SHADER_PARAMETER_NAME_UNKNOWN | |
| VKD3D_SHADER_PARAMETER_NAME_RASTERIZER_SAMPLE_COUNT | The sample count of the framebuffer, as returned by the HLSL function GetRenderTargetSampleCount() or the GLSL builtin gl_NumSamples. This parameter should be specified when compiling to SPIR-V, which provides no builtin ability to query this information from the shader. The default value is 1. The data type for this parameter must be VKD3D_SHADER_PARAMETER_DATA_TYPE_UINT32. |
| VKD3D_SHADER_PARAMETER_NAME_ALPHA_TEST_FUNC | Alpha test comparison function. When this parameter is provided, if the alpha component of the pixel shader colour output at location 0 fails the test, as defined by this function and the reference value provided by VKD3D_SHADER_PARAMETER_NAME_ALPHA_TEST_REF, the fragment will be discarded. This parameter, along with VKD3D_SHADER_PARAMETER_NAME_ALPHA_TEST_REF, can be used to implement fixed function alpha test, as present in Direct3D versions up to 9, if the target environment does not support alpha test as part of its own fixed-function API (as Vulkan and core OpenGL). The default value is VKD3D_SHADER_COMPARISON_FUNC_ALWAYS. The data type for this parameter must be VKD3D_SHADER_PARAMETER_DATA_TYPE_UINT32. The value specified must be a member of enum vkd3d_shader_comparison_func. Only VKD3D_SHADER_PARAMETER_TYPE_IMMEDIATE_CONSTANT is supported in this version of vkd3d-shader.
|
| VKD3D_SHADER_PARAMETER_NAME_ALPHA_TEST_REF | Alpha test reference value. See VKD3D_SHADER_PARAMETER_NAME_ALPHA_TEST_FUNC for documentation of alpha test. The default value is zero.
|
| VKD3D_SHADER_PARAMETER_NAME_FLAT_INTERPOLATION | Whether to use flat interpolation for fragment shader colour inputs. If the value is nonzero, inputs whose semantic usage is COLOR will use flat interpolation instead of linear. This parameter is ignored if the shader model is 4 or greater, since only shader model 3 and below do not specify the interpolation mode in the shader bytecode. This parameter can be used to implement fixed function shade mode, as present in Direct3D versions up to 9, if the target environment does not support shade mode as part of its own fixed-function API (as Vulkan and core OpenGL). The data type for this parameter must be VKD3D_SHADER_PARAMETER_DATA_TYPE_UINT32. The default value is zero, i.e. use linear interpolation. Only VKD3D_SHADER_PARAMETER_TYPE_IMMEDIATE_CONSTANT is supported in this version of vkd3d-shader.
|
| VKD3D_SHADER_PARAMETER_NAME_CLIP_PLANE_MASK | A mask of enabled clip planes. When this parameter is provided to a vertex shader, for each nonzero bit of this mask, a user clip distance will be generated from vertex position in clip space, and the clip plane defined by the indexed vector, taken from the VKD3D_SHADER_PARAMETER_NAME_CLIP_PLANE_# parameter. Regardless of the specific clip planes which are enabled, the clip distances which are output are a contiguous array starting from clip distance 0. This affects the interface of OpenGL. For example, if only clip planes 1 and 3 are enabled (and so the value of the mask is 0xa), the user should enable only GL_CLIP_DISTANCE0 and GL_CLIP_DISTANCE1. The default value is zero, i.e. do not enable any clip planes. The data type for this parameter must be VKD3D_SHADER_PARAMETER_DATA_TYPE_UINT32. Only VKD3D_SHADER_PARAMETER_TYPE_IMMEDIATE_CONSTANT is supported in this version of vkd3d-shader. If the source shader writes clip distances and this parameter is nonzero, compilation fails.
|
| VKD3D_SHADER_PARAMETER_NAME_CLIP_PLANE_0 | Clip plane values. See VKD3D_SHADER_PARAMETER_NAME_CLIP_PLANE_MASK for documentation of clip planes. These enum values are contiguous and arithmetic may safely be performed on them. That is, VKD3D_SHADER_PARAMETER_NAME_CLIP_PLANE_[n] is VKD3D_SHADER_PARAMETER_NAME_CLIP_PLANE_0 plus n. The data type for each parameter must be VKD3D_SHADER_PARAMETER_DATA_TYPE_FLOAT32_VEC4. The default value for each plane is a (0, 0, 0, 0) vector.
|
| VKD3D_SHADER_PARAMETER_NAME_CLIP_PLANE_1 | |
| VKD3D_SHADER_PARAMETER_NAME_CLIP_PLANE_2 | |
| VKD3D_SHADER_PARAMETER_NAME_CLIP_PLANE_3 | |
| VKD3D_SHADER_PARAMETER_NAME_CLIP_PLANE_4 | |
| VKD3D_SHADER_PARAMETER_NAME_CLIP_PLANE_5 | |
| VKD3D_SHADER_PARAMETER_NAME_CLIP_PLANE_6 | |
| VKD3D_SHADER_PARAMETER_NAME_CLIP_PLANE_7 | |
| VKD3D_SHADER_PARAMETER_NAME_POINT_SIZE | Point size. When this parameter is provided to a vertex, tessellation, or geometry shader, and the source shader does not write point size, it specifies a uniform value which will be written to point size. If the source shader writes point size, this parameter is ignored. This parameter can be used to implement fixed function point size, as present in Direct3D versions 8 and 9, if the target environment does not support point size as part of its own fixed-function API (as Vulkan and core OpenGL). The data type for this parameter must be VKD3D_SHADER_PARAMETER_DATA_TYPE_FLOAT32.
|
| VKD3D_SHADER_PARAMETER_NAME_POINT_SIZE_MIN | Minimum point size. When this parameter is provided to a vertex, tessellation, or geometry shader, and the source shader writes point size or uses the VKD3D_SHADER_PARAMETER_NAME_POINT_SIZE parameter, the point size will be clamped to the provided minimum value. If point size is not written in one of these ways, this parameter is ignored. If this parameter is not provided, the point size will not be clamped to a minimum size by vkd3d-shader. This parameter can be used to implement fixed function point size, as present in Direct3D versions 8 and 9, if the target environment does not support point size as part of its own fixed-function API (as Vulkan and core OpenGL). The data type for this parameter must be VKD3D_SHADER_PARAMETER_DATA_TYPE_FLOAT32.
|
| VKD3D_SHADER_PARAMETER_NAME_POINT_SIZE_MAX | Maximum point size. This parameter has identical behaviour to VKD3D_SHADER_PARAMETER_NAME_POINT_SIZE_MIN, except that it provides the maximum size rather than the minimum.
|
| VKD3D_SHADER_PARAMETER_NAME_POINT_SPRITE | Whether texture coordinate inputs should take their values from the point coordinate. When this parameter is provided to a pixel shader, and the value is nonzero, any fragment shader input with the semantic name "TEXCOORD" takes its value from the point coordinates instead of from the previous shader. The point coordinates here are defined as a four-component vector whose X and Y components are the X and Y coordinates of the fragment within a point being rasterized, and whose Z and W components are zero. In GLSL, the X and Y components are drawn from gl_PointCoord; in SPIR-V, they are drawn from a variable with the BuiltinPointCoord decoration. This includes t# fragment shader inputs in shader model 2 shaders, as well as texture sampling in shader model 1 shaders. This parameter can be used to implement fixed function point sprite, as present in Direct3D versions 8 and 9, if the target environment does not support point sprite as part of its own fixed-function API (as Vulkan and core OpenGL). The data type for this parameter must be VKD3D_SHADER_PARAMETER_DATA_TYPE_UINT32. The default value is zero, i.e. use the original varyings. Only VKD3D_SHADER_PARAMETER_TYPE_IMMEDIATE_CONSTANT is supported in this version of vkd3d-shader.
|
| VKD3D_FORCE_32_BIT_ENUM | |
Definition at line 525 of file vkd3d_shader.h.
The manner in which a parameter value is provided to the shader, used in struct vkd3d_shader_parameter and struct vkd3d_shader_parameter1.
| Enumerator | |
|---|---|
| VKD3D_SHADER_PARAMETER_TYPE_UNKNOWN | |
| VKD3D_SHADER_PARAMETER_TYPE_IMMEDIATE_CONSTANT | The parameter value is embedded directly in the shader. |
| VKD3D_SHADER_PARAMETER_TYPE_SPECIALIZATION_CONSTANT | The parameter value is provided to the shader via specialization constants. This value is only supported for the SPIR-V target type. |
| VKD3D_SHADER_PARAMETER_TYPE_BUFFER | The parameter value is provided to the shader as part of a uniform buffer.
|
| VKD3D_FORCE_32_BIT_ENUM | |
Definition at line 478 of file vkd3d_shader.h.
Flags for vkd3d_shader_parse_dxbc().
| Enumerator | |
|---|---|
| VKD3D_SHADER_PARSE_DXBC_IGNORE_CHECKSUM | Ignore the checksum and continue parsing even if it is incorrect. |
| VKD3D_FORCE_32_BIT_ENUM | |
Definition at line 255 of file vkd3d_shader.h.
The type of the data contained in a shader resource, returned as part of struct vkd3d_shader_descriptor_info. All formats are 32-bit.
Definition at line 1867 of file vkd3d_shader.h.
The type of a shader resource, returned as part of struct vkd3d_shader_descriptor_info.
| Enumerator | |
|---|---|
| VKD3D_SHADER_RESOURCE_NONE | The type is invalid or not applicable for this descriptor. This value is returned for samplers. |
| VKD3D_SHADER_RESOURCE_BUFFER | Dimensionless buffer. |
| VKD3D_SHADER_RESOURCE_TEXTURE_1D | 1-dimensional texture. |
| VKD3D_SHADER_RESOURCE_TEXTURE_2D | 2-dimensional texture. |
| VKD3D_SHADER_RESOURCE_TEXTURE_2DMS | Multisampled 2-dimensional texture. |
| VKD3D_SHADER_RESOURCE_TEXTURE_3D | 3-dimensional texture. |
| VKD3D_SHADER_RESOURCE_TEXTURE_CUBE | Cubemap texture. |
| VKD3D_SHADER_RESOURCE_TEXTURE_1DARRAY | 1-dimensional array texture. |
| VKD3D_SHADER_RESOURCE_TEXTURE_2DARRAY | 2-dimensional array texture. |
| VKD3D_SHADER_RESOURCE_TEXTURE_2DMSARRAY | Multisampled 2-dimensional array texture. |
| VKD3D_SHADER_RESOURCE_TEXTURE_CUBEARRAY | Cubemap array texture. |
| VKD3D_FORCE_32_BIT_ENUM | |
Definition at line 1832 of file vkd3d_shader.h.
Definition at line 1743 of file vkd3d_shader.h.
Definition at line 1696 of file vkd3d_shader.h.
Definition at line 1719 of file vkd3d_shader.h.
| Enumerator | |
|---|---|
| VKD3D_SHADER_ROOT_SIGNATURE_VERSION_1_0 | |
| VKD3D_SHADER_ROOT_SIGNATURE_VERSION_1_1 | |
| VKD3D_FORCE_32_BIT_ENUM | |
Definition at line 1810 of file vkd3d_shader.h.
The format of a shader to be compiled or scanned.
| Enumerator | |
|---|---|
| VKD3D_SHADER_SOURCE_NONE | The shader has no type or is to be ignored. This is not a valid value for vkd3d_shader_compile() or vkd3d_shader_scan(). |
| VKD3D_SHADER_SOURCE_DXBC_TPF | A 'Tokenized Program Format' shader embedded in a DXBC container. This is the format used for Direct3D shader model 4 and 5 shaders. |
| VKD3D_SHADER_SOURCE_HLSL | High-Level Shader Language source code.
|
| VKD3D_SHADER_SOURCE_D3D_BYTECODE | Legacy Direct3D byte-code. This is the format used for Direct3D shader model 1, 2, and 3 shaders.
|
| VKD3D_SHADER_SOURCE_DXBC_DXIL | A 'DirectX Intermediate Language' shader embedded in a DXBC container. This is the format used for Direct3D shader model 6 shaders.
|
| VKD3D_SHADER_SOURCE_FX | Binary format used by Direct3D 9/10.x/11 effects. Input is a raw FX section without container.
|
| VKD3D_FORCE_32_BIT_ENUM | |
Definition at line 1194 of file vkd3d_shader.h.
Definition at line 1337 of file vkd3d_shader.h.
Definition at line 1348 of file vkd3d_shader.h.
| Enumerator | |
|---|---|
| VKD3D_SHADER_STATIC_BORDER_COLOUR_TRANSPARENT_BLACK | |
| VKD3D_SHADER_STATIC_BORDER_COLOUR_OPAQUE_BLACK | |
| VKD3D_SHADER_STATIC_BORDER_COLOUR_OPAQUE_WHITE | |
| VKD3D_FORCE_32_BIT_ENUM | |
Definition at line 1642 of file vkd3d_shader.h.
The type of a chained structure.
| Enumerator | |
|---|---|
| VKD3D_SHADER_STRUCTURE_TYPE_COMPILE_INFO | The structure is a vkd3d_shader_compile_info structure. |
| VKD3D_SHADER_STRUCTURE_TYPE_INTERFACE_INFO | The structure is a vkd3d_shader_interface_info structure. |
| VKD3D_SHADER_STRUCTURE_TYPE_SCAN_DESCRIPTOR_INFO | The structure is a vkd3d_shader_scan_descriptor_info structure. |
| VKD3D_SHADER_STRUCTURE_TYPE_SPIRV_DOMAIN_SHADER_TARGET_INFO | The structure is a vkd3d_shader_spirv_domain_shader_target_info structure. |
| VKD3D_SHADER_STRUCTURE_TYPE_SPIRV_TARGET_INFO | The structure is a vkd3d_shader_spirv_target_info structure. |
| VKD3D_SHADER_STRUCTURE_TYPE_TRANSFORM_FEEDBACK_INFO | The structure is a vkd3d_shader_transform_feedback_info structure. |
| VKD3D_SHADER_STRUCTURE_TYPE_HLSL_SOURCE_INFO | The structure is a vkd3d_shader_hlsl_source_info structure.
|
| VKD3D_SHADER_STRUCTURE_TYPE_PREPROCESS_INFO | The structure is a vkd3d_shader_preprocess_info structure.
|
| VKD3D_SHADER_STRUCTURE_TYPE_DESCRIPTOR_OFFSET_INFO | The structure is a vkd3d_shader_descriptor_offset_info structure.
|
| VKD3D_SHADER_STRUCTURE_TYPE_SCAN_SIGNATURE_INFO | The structure is a vkd3d_shader_scan_signature_info structure.
|
| VKD3D_SHADER_STRUCTURE_TYPE_VARYING_MAP_INFO | The structure is a vkd3d_shader_varying_map_info structure.
|
| VKD3D_SHADER_STRUCTURE_TYPE_SCAN_COMBINED_RESOURCE_SAMPLER_INFO | The structure is a vkd3d_shader_scan_combined_resource_sampler_info structure.
|
| VKD3D_SHADER_STRUCTURE_TYPE_PARAMETER_INFO | The structure is a vkd3d_shader_parameter_info structure.
|
| VKD3D_FORCE_32_BIT_ENUM | |
Definition at line 65 of file vkd3d_shader.h.
Possible values for a single component of a vkd3d-shader swizzle.
| Enumerator | |
|---|---|
| VKD3D_SHADER_SWIZZLE_X | |
| VKD3D_SHADER_SWIZZLE_Y | |
| VKD3D_SHADER_SWIZZLE_Z | |
| VKD3D_SHADER_SWIZZLE_W | |
| VKD3D_FORCE_32_BIT_ENUM | |
Definition at line 2191 of file vkd3d_shader.h.
System value semantic, returned as part of struct vkd3d_shader_signature.
Definition at line 2068 of file vkd3d_shader.h.
The output format of a compiled shader.
| Enumerator | |
|---|---|
| VKD3D_SHADER_TARGET_NONE | The shader has no type or is to be ignored. This is not a valid value for vkd3d_shader_compile(). |
| VKD3D_SHADER_TARGET_SPIRV_BINARY | A SPIR-V shader in binary form. This is the format used for Vulkan shaders. |
| VKD3D_SHADER_TARGET_SPIRV_TEXT | |
| VKD3D_SHADER_TARGET_D3D_ASM | Direct3D shader assembly.
|
| VKD3D_SHADER_TARGET_D3D_BYTECODE | Legacy Direct3D byte-code. This is the format used for Direct3D shader model 1, 2, and 3 shaders.
|
| VKD3D_SHADER_TARGET_DXBC_TPF | A 'Tokenized Program Format' shader embedded in a DXBC container. This is the format used for Direct3D shader model 4 and 5 shaders.
|
| VKD3D_SHADER_TARGET_GLSL | An 'OpenGL Shading Language' shader.
|
| VKD3D_SHADER_TARGET_FX | Binary format used by Direct3D 9/10.x/11 effects profiles. Output is a raw FX section without container.
|
| VKD3D_SHADER_TARGET_MSL | A 'Metal Shading Language' shader.
|
| VKD3D_FORCE_32_BIT_ENUM | |
Definition at line 1228 of file vkd3d_shader.h.
| Enumerator | |
|---|---|
| VKD3D_SHADER_TESSELLATOR_OUTPUT_POINT | |
| VKD3D_SHADER_TESSELLATOR_OUTPUT_LINE | |
| VKD3D_SHADER_TESSELLATOR_OUTPUT_TRIANGLE_CW | |
| VKD3D_SHADER_TESSELLATOR_OUTPUT_TRIANGLE_CCW | |
| VKD3D_FORCE_32_BIT_ENUM | |
Definition at line 1385 of file vkd3d_shader.h.
Definition at line 1395 of file vkd3d_shader.h.
Definition at line 1617 of file vkd3d_shader.h.
Describes which shader stages a resource is visible to.
Definition at line 382 of file vkd3d_shader.h.
| VKD3D_SHADER_API void vkd3d_shader_build_varying_map | ( | const struct vkd3d_shader_signature * | output_signature, |
| const struct vkd3d_shader_signature * | input_signature, | ||
| unsigned int * | count, | ||
| struct vkd3d_shader_varying_map * | varyings | ||
| ) |
Build a mapping of output varyings in a shader stage to input varyings in the following shader stage.
This mapping should be used in struct vkd3d_shader_varying_map_info to compile the first shader.
| output_signature | The output signature of the first shader. |
| input_signature | The input signature of the second shader. |
| count | On output, contains the number of entries written into "varyings". |
| varyings | Pointer to an output array of varyings. This must point to space for N varyings, where N is the number of elements in the input signature. |
Definition at line 2271 of file vkd3d_shader_main.c.
Referenced by shader_spirv_compile_arguments_init().
| VKD3D_SHADER_API int vkd3d_shader_compile | ( | const struct vkd3d_shader_compile_info * | compile_info, |
| struct vkd3d_shader_code * | out, | ||
| char ** | messages | ||
| ) |
Transform a form of GPU shader source code or byte code into another form of source code or byte code.
This version of vkd3d-shader supports the following transformations:
Supported transformations can also be detected at runtime with the functions vkd3d_shader_get_supported_source_types() and vkd3d_shader_get_supported_target_types().
Depending on the source and target types, this function may support the following chained structures:
| compile_info | A chained structure containing compilation parameters. |
| out | A pointer to a vkd3d_shader_code structure in which the compiled code will be stored. The compiled shader is allocated by vkd3d-shader and should be freed with vkd3d_shader_free_shader_code() when no longer needed. |
| messages | Optional output location for error or informational messages produced by the compiler. This string is null-terminated and UTF-8 encoded. The messages are allocated by vkd3d-shader and should be freed with vkd3d_shader_free_messages() when no longer needed. The messages returned can be regulated with the log_level member of struct vkd3d_shader_compile_info. Regardless of the requested level, if this parameter is NULL, no compilation messages will be returned. If no messages are produced by the compiler, this parameter may receive NULL instead of a valid string pointer. |
Definition at line 1708 of file vkd3d_shader_main.c.
Referenced by compile_hlsl_cs(), compile_hlsl_shader(), create_shader_stage(), D3DCompile2(), D3DDisassemble(), fx_4_parse_shader_initializer(), shader_glsl_generate_vkd3d_shader(), shader_spirv_compile_shader(), and shader_trace().
| VKD3D_SHADER_API int vkd3d_shader_convert_root_signature | ( | struct vkd3d_shader_versioned_root_signature_desc * | dst, |
| enum vkd3d_shader_root_signature_version | version, | ||
| const struct vkd3d_shader_versioned_root_signature_desc * | src | ||
| ) |
Convert a structural representation of a root signature to a different version of structural representation.
This function corresponds to ID3D12VersionedRootSignatureDeserializer::GetRootSignatureDescAtVersion().
| dst | A pointer to a vkd3d_shader_versioned_root_signature_desc structure in which the converted signature will be stored. Members of dst may be allocated by vkd3d-shader. The signature should be freed with vkd3d_shader_free_root_signature() when no longer needed. |
| version | The desired version to convert src to. This version must not be equal to src->version. |
| src | Input root signature description. |
Definition at line 1756 of file dxbc.c.
Referenced by d3d12_versioned_root_signature_deserializer_GetRootSignatureDescAtVersion(), and vkd3d_parse_root_signature_v_1_0().
|
inlinestatic |
Build a vkd3d-shader swizzle with the given components.
Definition at line 2268 of file vkd3d_shader.h.
Referenced by src_param_init_scalar(), swizzle_from_sm1(), swizzle_from_sm4(), vsir_program_lower_sm1_sincos(), vsir_program_lower_texkill(), and vsir_swizzle_from_hlsl().
| VKD3D_SHADER_API struct vkd3d_shader_signature_element * vkd3d_shader_find_signature_element | ( | const struct vkd3d_shader_signature * | signature, |
| const char * | semantic_name, | ||
| unsigned int | semantic_index, | ||
| unsigned int | stream_index | ||
| ) |
Find a single element of a parsed input signature.
| signature | The parsed input signature. This structure is normally populated by vkd3d_shader_parse_input_signature(). |
| semantic_name | Semantic name of the desired element. This function performs a case-insensitive comparison with respect to the ASCII plane. |
| semantic_index | Semantic index of the desired element. |
| stream_index | Geometry shader stream index of the desired element. If the signature is not a geometry shader output signature, this parameter must be set to 0. |
Definition at line 1885 of file vkd3d_shader_main.c.
Referenced by d3d12_pipeline_state_init_graphics(), and vkd3d_shader_build_varying_map().
| VKD3D_SHADER_API void vkd3d_shader_free_dxbc | ( | struct vkd3d_shader_dxbc_desc * | dxbc | ) |
Free the contents of a vkd3d_shader_dxbc_desc structure allocated by another vkd3d-shader function, such as vkd3d_shader_parse_dxbc().
This function may free the vkd3d_shader_dxbc_desc::sections member, but does not free the structure itself.
| dxbc | The vkd3d_shader_dxbc_desc structure to free. |
Definition at line 290 of file dxbc.c.
Referenced by d3d10_effect_parse(), d3dcompiler_get_blob_part(), d3dcompiler_shader_reflection_init(), d3dcompiler_strip_shader(), for_each_dxbc_section(), parse_fx10_preshader(), vkd3d_shader_parse_dxbc(), vkd3d_shader_parse_dxbc_source_type(), and wined3d_shader_extract_from_dxbc().
| VKD3D_SHADER_API void vkd3d_shader_free_messages | ( | char * | messages | ) |
Free shader messages allocated by another vkd3d-shader function, such as vkd3d_shader_compile().
| messages | Messages to free. This pointer is optional and may be NULL, in which case no action will be taken. |
Definition at line 728 of file vkd3d_shader_main.c.
Referenced by compile_hlsl_shader(), D3DCompile2(), D3DDisassemble(), preprocess_shader(), shader_glsl_generate_vkd3d_shader(), shader_spirv_compile_shader(), shader_spirv_scan_shader(), shader_trace(), vkd3d_serialize_root_signature(), and vkd3d_serialize_versioned_root_signature().
| VKD3D_SHADER_API void vkd3d_shader_free_root_signature | ( | struct vkd3d_shader_versioned_root_signature_desc * | root_signature | ) |
Free a structural representation of a shader root signature allocated by vkd3d_shader_convert_root_signature() or vkd3d_shader_parse_root_signature().
This function may free members of struct vkd3d_shader_versioned_root_signature_desc, but does not free the structure itself.
| root_signature | Signature description to free. |
Definition at line 1825 of file vkd3d_shader_main.c.
Referenced by d3d12_root_signature_create(), d3d12_root_signature_deserializer_Release(), d3d12_versioned_root_signature_deserializer_Release(), vkd3d_parse_root_signature_v_1_0(), and vkd3d_shader_parse_root_signature().
| VKD3D_SHADER_API void vkd3d_shader_free_scan_combined_resource_sampler_info | ( | struct vkd3d_shader_scan_combined_resource_sampler_info * | info | ) |
Free members of struct vkd3d_shader_scan_combined_resource_sampler_info allocated by vkd3d_shader_scan().
This function may free members of vkd3d_shader_scan_combined_resource_sampler_info, but does not free the structure itself.
| info | Combined resource-sampler information to free. |
Definition at line 1760 of file vkd3d_shader_main.c.
Referenced by vsir_program_compile(), and vsir_program_scan().
| VKD3D_SHADER_API void vkd3d_shader_free_scan_descriptor_info | ( | struct vkd3d_shader_scan_descriptor_info * | scan_descriptor_info | ) |
Free members of struct vkd3d_shader_scan_descriptor_info() allocated by vkd3d_shader_scan().
This function may free members of vkd3d_shader_scan_descriptor_info, but does not free the structure itself.
| scan_descriptor_info | Descriptor information to free. |
Definition at line 1768 of file vkd3d_shader_main.c.
Referenced by d3d12_pipeline_state_find_and_init_uav_counters(), shader_spirv_destroy(), shader_spirv_destroy_compute_vk(), and vsir_program_scan().
| VKD3D_SHADER_API void vkd3d_shader_free_scan_signature_info | ( | struct vkd3d_shader_scan_signature_info * | info | ) |
Free members of struct vkd3d_shader_scan_signature_info allocated by vkd3d_shader_scan().
This function may free members of vkd3d_shader_scan_signature_info, but does not free the structure itself.
| info | Scan information to free. |
Definition at line 1775 of file vkd3d_shader_main.c.
Referenced by shader_spirv_destroy(), and vsir_program_scan().
| VKD3D_SHADER_API void vkd3d_shader_free_shader_code | ( | struct vkd3d_shader_code * | code | ) |
Free shader code allocated by another vkd3d-shader function, such as vkd3d_shader_compile().
This function frees the vkd3d_shader_code::code member, but does not free the structure itself.
| code | Code to free. |
Definition at line 1784 of file vkd3d_shader_main.c.
Referenced by compile_hlsl(), create_shader_stage(), create_uav_pipeline(), D3DCompile2(), d3dcompiler_get_blob_part(), d3dcompiler_strip_shader(), D3DDisassemble(), fx_4_parse_shader_initializer(), hlsl_compile_shader(), hlsl_emit_bytecode(), preprocess_shader(), shader_glsl_generate_vkd3d_shader(), shader_spirv_compile_shader(), shader_trace(), spirv_compiler_generate_spirv(), tpf_compile(), vkd3d_serialize_root_signature(), vkd3d_serialize_versioned_root_signature(), vkd3d_uav_clear_state_init(), and vsir_program_trace().
| VKD3D_SHADER_API void vkd3d_shader_free_shader_signature | ( | struct vkd3d_shader_signature * | signature | ) |
Free a structural representation of a shader input signature allocated by vkd3d_shader_parse_input_signature().
This function may free members of struct vkd3d_shader_signature, but does not free the structure itself.
| signature | Signature description to free. |
Definition at line 1907 of file vkd3d_shader_main.c.
Referenced by d3d11_input_layout_to_wined3d_declaration(), d3d12_pipeline_state_init_graphics(), and vkd3d_shader_free_scan_signature_info().
| VKD3D_SHADER_API enum vkd3d_shader_source_type * vkd3d_shader_get_supported_source_types | ( | unsigned int * | count | ) |
Returns the source types supported, with any target type, by vkd3d_shader_compile(). Future versions of the library may introduce additional source types; callers should ignore unrecognised source types.
Use vkd3d_shader_get_supported_target_types() to determine which target types are supported for each source type.
| count | Output location for the size, in elements, of the returned array. |
Definition at line 1937 of file vkd3d_shader_main.c.
Referenced by vkd3d_shader_validate_compile_info().
| VKD3D_SHADER_API enum vkd3d_shader_target_type * vkd3d_shader_get_supported_target_types | ( | enum vkd3d_shader_source_type | source_type, |
| unsigned int * | count | ||
| ) |
Returns the target types supported, with the given source type, by vkd3d_shader_compile(). Future versions of the library may introduce additional target types; callers should ignore unrecognised target types.
| source_type | Source type for which to enumerate supported target types. |
| count | Output location for the size, in elements, of the returned array. |
Definition at line 1956 of file vkd3d_shader_main.c.
Referenced by vkd3d_shader_validate_compile_info().
| VKD3D_SHADER_API const char * vkd3d_shader_get_version | ( | unsigned int * | major, |
| unsigned int * | minor | ||
| ) |
Returns the current version of this library.
| major | Output location for the major version of this library. |
| minor | Output location for the minor version of this library. |
Definition at line 1919 of file vkd3d_shader_main.c.
Referenced by msl_generator_generate(), shader_glsl_alloc(), vkd3d_glsl_generator_generate(), wined3d_spirv_shader_backend_init_vk(), write_sm1_uniforms(), and write_sm4_rdef().
| VKD3D_SHADER_API int vkd3d_shader_parse_dxbc | ( | const struct vkd3d_shader_code * | dxbc, |
| uint32_t | flags, | ||
| struct vkd3d_shader_dxbc_desc * | desc, | ||
| char ** | messages | ||
| ) |
Parse a DXBC blob contained in a vkd3d_shader_code structure.
| dxbc | A vkd3d_shader_code structure containing the DXBC blob to parse. |
| flags | A combination of zero or more elements of enum vkd3d_shader_parse_dxbc_flags. |
| desc | A vkd3d_shader_dxbc_desc structure describing the contents of the DXBC blob. Its vkd3d_shader_dxbc_section_desc structures will contain pointers into the input blob; its contents are only valid while the input blob is valid. The contents of this structure should be freed with vkd3d_shader_free_dxbc() when no longer needed. |
| messages | Optional output location for error or informational messages produced by the parser. This string is null-terminated and UTF-8 encoded. The messages are allocated by vkd3d-shader and should be freed with vkd3d_shader_free_messages() when no longer needed. If no messages are produced by the parser, this parameter may receive NULL instead of a valid string pointer. |
Definition at line 320 of file dxbc.c.
Referenced by d3d10_effect_parse(), d3dcompiler_get_blob_part(), d3dcompiler_shader_reflection_init(), d3dcompiler_strip_shader(), parse_fx10_preshader(), vkd3d_shader_parse_dxbc_source_type(), and wined3d_shader_extract_from_dxbc().
| VKD3D_SHADER_API int vkd3d_shader_parse_input_signature | ( | const struct vkd3d_shader_code * | dxbc, |
| struct vkd3d_shader_signature * | signature, | ||
| char ** | messages | ||
| ) |
Read the input signature of a compiled DXBC shader, returning a structural description which can be easily parsed by C code.
This function parses a compiled shader. To parse a standalone root signature, use vkd3d_shader_parse_root_signature().
This function only parses DXBC shaders, and only retrieves the input signature. To retrieve signatures from other shader types, or other signature types, use vkd3d_shader_scan() and struct vkd3d_shader_scan_signature_info. This function returns the same input signature that is returned in struct vkd3d_shader_scan_signature_info.
| dxbc | Compiled byte code, in DXBC format. |
| signature | Output location in which the parsed root signature will be stored. Members of signature may be allocated by vkd3d-shader. The signature should be freed with vkd3d_shader_free_shader_signature() when no longer needed. The signature may contain pointers into the input shader, and should only be accessed while the input shader remains valid. |
| messages | Optional output location for error or informational messages produced by the parser. This string is null-terminated and UTF-8 encoded. The messages are allocated by vkd3d-shader and should be freed with vkd3d_shader_free_messages() when no longer needed. If no messages are produced by the parser, this parameter may receive NULL instead of a valid string pointer. |
Definition at line 1858 of file vkd3d_shader_main.c.
Referenced by d3d11_input_layout_to_wined3d_declaration(), and d3d12_pipeline_state_init_graphics().
| VKD3D_SHADER_API int vkd3d_shader_parse_root_signature | ( | const struct vkd3d_shader_code * | dxbc, |
| struct vkd3d_shader_versioned_root_signature_desc * | root_signature, | ||
| char ** | messages | ||
| ) |
Convert a byte code description of a shader root signature to a structural description which can be easily parsed by C code.
This function corresponds to ID3D12VersionedRootSignatureDeserializer::GetUnconvertedRootSignatureDesc().
This function performs the reverse transformation of vkd3d_shader_serialize_root_signature().
This function parses a standalone root signature, and should not be confused with vkd3d_shader_parse_input_signature().
| dxbc | Compiled byte code, in DXBC format. |
| root_signature | Output location in which the decompiled root signature will be stored. Members of root_signature may be allocated by vkd3d-shader. The signature should be freed with vkd3d_shader_free_root_signature() when no longer needed. |
| messages | Optional output location for error or informational messages produced by the parser. This string is null-terminated and UTF-8 encoded. The messages are allocated by vkd3d-shader and should be freed with vkd3d_shader_free_messages() when no longer needed. If no messages are produced by the parser, this parameter may receive NULL instead of a valid string pointer. |
Definition at line 1043 of file dxbc.c.
Referenced by d3d12_versioned_root_signature_deserializer_init(), and vkd3d_parse_root_signature_v_1_0().
| VKD3D_SHADER_API int vkd3d_shader_preprocess | ( | const struct vkd3d_shader_compile_info * | compile_info, |
| struct vkd3d_shader_code * | out, | ||
| char ** | messages | ||
| ) |
Preprocess the given source code.
This function supports the following chained structures:
| compile_info | A chained structure containing compilation parameters. |
| out | A pointer to a vkd3d_shader_code structure in which the preprocessed code will be stored. The preprocessed shader is allocated by vkd3d-shader and should be freed with vkd3d_shader_free_shader_code() when no longer needed. |
| messages | Optional output location for error or informational messages produced by the preprocessor. This string is null-terminated and UTF-8 encoded. The messages are allocated by vkd3d-shader and should be freed with vkd3d_shader_free_messages() when no longer needed. The messages returned can be regulated with the log_level member of struct vkd3d_shader_compile_info. Regardless of the requested level, if this parameter is NULL, no compilation messages will be returned. If no messages are produced by the preprocessor, this parameter may receive NULL instead of a valid string pointer. |
Definition at line 2043 of file vkd3d_shader_main.c.
Referenced by preprocess_shader().
| VKD3D_SHADER_API int vkd3d_shader_scan | ( | const struct vkd3d_shader_compile_info * | compile_info, |
| char ** | messages | ||
| ) |
Parse shader source code or byte code, returning various types of requested information.
The source_type member of compile_info must be set to the type of the shader.
The target_type member may be set to VKD3D_SHADER_TARGET_NONE, in which case vkd3d_shader_scan() will return information about the shader in isolation. Alternatively, it may be set to a valid compilation target for the shader, in which case vkd3d_shader_scan() will return information that reflects the interface for a shader as it will be compiled to that target. In this case other chained structures may be appended to compile_info as they would be passed to vkd3d_shader_compile(), and interpreted accordingly, such as vkd3d_shader_spirv_target_info.
(For a hypothetical example, suppose the source shader distinguishes float and integer texture data, but the target environment does not support integer textures. In this case vkd3d_shader_compile() might translate integer operations to float. Accordingly using VKD3D_SHADER_TARGET_NONE would accurately report whether the texture expects integer or float data, but using the relevant specific target type would report VKD3D_SHADER_RESOURCE_DATA_FLOAT.)
Currently this function supports the following code types:
| compile_info | A chained structure containing scan parameters. The scanner supports the following chained structures:
|
| messages | Optional output location for error or informational messages produced by the parser. This string is null-terminated and UTF-8 encoded. The messages are allocated by vkd3d-shader and should be freed with vkd3d_shader_free_messages() when no longer needed. The messages returned can be regulated with the log_level member of struct vkd3d_shader_compile_info. Regardless of the requested level, if this parameter is NULL, no compilation messages will be returned. If no messages are produced by the parser, this parameter may receive NULL instead of a valid string pointer. |
Definition at line 1595 of file vkd3d_shader_main.c.
Referenced by shader_spirv_scan_shader(), and vkd3d_scan_dxbc().
| VKD3D_SHADER_API int vkd3d_shader_serialize_dxbc | ( | size_t | section_count, |
| const struct vkd3d_shader_dxbc_section_desc * | sections, | ||
| struct vkd3d_shader_code * | dxbc, | ||
| char ** | messages | ||
| ) |
Serialize a DXBC description into a blob stored in a vkd3d_shader_code structure.
| section_count | The number of DXBC sections to serialize. |
| sections | An array of vkd3d_shader_dxbc_section_desc structures to serialize. |
| dxbc | A pointer to a vkd3d_shader_code structure in which the serialized blob will be stored. The output blob is allocated by vkd3d-shader and should be freed with vkd3d_shader_free_shader_code() when no longer needed. |
| messages | Optional output location for error or informational messages produced by the serializer. This string is null-terminated and UTF-8 encoded. The messages are allocated by vkd3d-shader and should be freed with vkd3d_shader_free_messages() when no longer needed. If no messages are produced by the serializer, this parameter may receive NULL instead of a valid string pointer. |
Definition at line 53 of file dxbc.c.
Referenced by D3DCompile2(), d3dcompiler_get_blob_part(), d3dcompiler_strip_shader(), and dxbc_writer_write().
| VKD3D_SHADER_API int vkd3d_shader_serialize_root_signature | ( | const struct vkd3d_shader_versioned_root_signature_desc * | root_signature, |
| struct vkd3d_shader_code * | dxbc, | ||
| char ** | messages | ||
| ) |
Convert a structural description of a shader root signature to a byte code format capable of being read by ID3D12Device::CreateRootSignature. The compiled signature is compatible with Microsoft D3D 12.
This function corresponds to D3D12SerializeVersionedRootSignature().
| root_signature | Description of the root signature. |
| dxbc | A pointer to a vkd3d_shader_code structure in which the compiled code will be stored. The compiled signature is allocated by vkd3d-shader and should be freed with vkd3d_shader_free_shader_code() when no longer needed. |
| messages | Optional output location for error or informational messages produced by the serializer. This string is null-terminated and UTF-8 encoded. The messages are allocated by vkd3d-shader and should be freed with vkd3d_shader_free_messages() when no longer needed. If no messages are produced by the serializer, this parameter may receive NULL instead of a valid string pointer. |
Definition at line 1447 of file dxbc.c.
Referenced by vkd3d_serialize_root_signature(), and vkd3d_serialize_versioned_root_signature().
| VKD3D_SHADER_API void vkd3d_shader_set_log_callback | ( | PFN_vkd3d_log | callback | ) |
Set a callback to be called when vkd3d-shader outputs debug logging.
If NULL, or if this function has not been called, libvkd3d-shader will print all enabled log output to stderr.
| callback | Callback function to set. |
Definition at line 2068 of file vkd3d_shader_main.c.
Referenced by vkd3d_set_log_callback().