2017-06-16 13:38:21 -07:00
|
|
|
/*
|
2019-02-25 02:59:16 -08:00
|
|
|
* Copyright 2017-2019 Józef Kucia for CodeWeavers
|
2017-06-16 13:38:21 -07:00
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __VKD3D_SHADER_H
|
|
|
|
#define __VKD3D_SHADER_H
|
|
|
|
|
2019-01-11 07:45:34 -08:00
|
|
|
#include <stdbool.h>
|
2019-01-14 08:05:43 -08:00
|
|
|
#include <stdint.h>
|
2018-11-08 08:19:29 -08:00
|
|
|
#include <vkd3d_types.h>
|
|
|
|
|
2017-06-16 13:38:21 -07:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif /* __cplusplus */
|
|
|
|
|
2020-08-31 18:34:27 -07:00
|
|
|
/**
|
|
|
|
* \file vkd3d_shader.h
|
|
|
|
*
|
|
|
|
* \since 1.2
|
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/** The type of a chained structure. */
|
2018-10-30 07:22:53 -07:00
|
|
|
enum vkd3d_shader_structure_type
|
|
|
|
{
|
2020-08-31 18:34:27 -07:00
|
|
|
/** The structure is a vkd3d_shader_compile_info structure. */
|
2020-06-19 04:43:32 -07:00
|
|
|
VKD3D_SHADER_STRUCTURE_TYPE_COMPILE_INFO,
|
2020-08-31 18:34:27 -07:00
|
|
|
/** The structure is a vkd3d_shader_interface_info structure. */
|
2020-06-18 07:22:49 -07:00
|
|
|
VKD3D_SHADER_STRUCTURE_TYPE_INTERFACE_INFO,
|
2020-08-31 18:34:27 -07:00
|
|
|
/** The structure is a vkd3d_shader_scan_descriptor_info structure. */
|
2020-07-30 03:29:55 -07:00
|
|
|
VKD3D_SHADER_STRUCTURE_TYPE_SCAN_DESCRIPTOR_INFO,
|
2020-08-31 18:34:27 -07:00
|
|
|
/** The structure is a vkd3d_shader_spirv_domain_shader_target_info structure. */
|
2020-06-18 07:22:48 -07:00
|
|
|
VKD3D_SHADER_STRUCTURE_TYPE_SPIRV_DOMAIN_SHADER_TARGET_INFO,
|
2020-08-31 18:34:27 -07:00
|
|
|
/** The structure is a vkd3d_shader_spirv_target_info structure. */
|
2020-06-18 07:22:47 -07:00
|
|
|
VKD3D_SHADER_STRUCTURE_TYPE_SPIRV_TARGET_INFO,
|
2020-08-31 18:34:27 -07:00
|
|
|
/** The structure is a vkd3d_shader_transform_feedback_info structure. */
|
2019-01-14 08:05:43 -08:00
|
|
|
VKD3D_SHADER_STRUCTURE_TYPE_TRANSFORM_FEEDBACK_INFO,
|
2018-10-30 07:22:53 -07:00
|
|
|
|
|
|
|
VKD3D_FORCE_32_BIT_ENUM(VKD3D_SHADER_STRUCTURE_TYPE),
|
|
|
|
};
|
|
|
|
|
2020-08-31 18:34:28 -07:00
|
|
|
/**
|
|
|
|
* 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.
|
|
|
|
*/
|
2020-08-04 03:13:31 -07:00
|
|
|
enum vkd3d_shader_compile_option_buffer_uav
|
|
|
|
{
|
2020-08-31 18:34:28 -07:00
|
|
|
/** Use buffer textures for buffer UAVs. This is the default value. */
|
2020-08-04 03:13:31 -07:00
|
|
|
VKD3D_SHADER_COMPILE_OPTION_BUFFER_UAV_STORAGE_TEXEL_BUFFER = 0x00000000,
|
2020-08-31 18:34:28 -07:00
|
|
|
/** Use storage buffers for buffer UAVs. */
|
2020-08-04 03:13:31 -07:00
|
|
|
VKD3D_SHADER_COMPILE_OPTION_BUFFER_UAV_STORAGE_BUFFER = 0x00000001,
|
|
|
|
|
|
|
|
VKD3D_FORCE_32_BIT_ENUM(VKD3D_SHADER_COMPILE_OPTION_BUFFER_UAV),
|
|
|
|
};
|
|
|
|
|
2020-06-19 04:43:35 -07:00
|
|
|
enum vkd3d_shader_compile_option_name
|
2017-06-16 13:38:21 -07:00
|
|
|
{
|
2020-08-31 18:34:28 -07:00
|
|
|
/**
|
|
|
|
* If \a 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.
|
|
|
|
*/
|
2020-06-19 04:43:35 -07:00
|
|
|
VKD3D_SHADER_COMPILE_OPTION_STRIP_DEBUG = 0x00000001,
|
2020-08-31 18:34:28 -07:00
|
|
|
/** \a value is a member of enum vkd3d_shader_compile_option_buffer_uav. */
|
|
|
|
VKD3D_SHADER_COMPILE_OPTION_BUFFER_UAV = 0x00000002,
|
2017-06-16 13:38:21 -07:00
|
|
|
|
2020-06-19 04:43:35 -07:00
|
|
|
VKD3D_FORCE_32_BIT_ENUM(VKD3D_SHADER_COMPILE_OPTION_NAME),
|
|
|
|
};
|
|
|
|
|
2020-08-31 18:34:28 -07:00
|
|
|
/**
|
|
|
|
* Various settings which may affect shader compilation or scanning, passed as
|
|
|
|
* part of struct vkd3d_shader_compile_info. For more details, see the
|
|
|
|
* documentation for individual options.
|
|
|
|
*/
|
2020-06-19 04:43:35 -07:00
|
|
|
struct vkd3d_shader_compile_option
|
|
|
|
{
|
2020-08-31 18:34:28 -07:00
|
|
|
/** Name of the option. */
|
2020-06-19 04:43:35 -07:00
|
|
|
enum vkd3d_shader_compile_option_name name;
|
2020-08-31 18:34:28 -07:00
|
|
|
/**
|
|
|
|
* A value associated with the option. The type and interpretation of the
|
|
|
|
* value depends on the option in question.
|
|
|
|
*/
|
2020-06-19 04:43:35 -07:00
|
|
|
unsigned int value;
|
2017-06-16 13:38:21 -07:00
|
|
|
};
|
|
|
|
|
2017-08-01 01:51:45 -07:00
|
|
|
enum vkd3d_shader_visibility
|
|
|
|
{
|
2018-02-02 06:39:23 -08:00
|
|
|
VKD3D_SHADER_VISIBILITY_ALL = 0,
|
|
|
|
VKD3D_SHADER_VISIBILITY_VERTEX = 1,
|
|
|
|
VKD3D_SHADER_VISIBILITY_HULL = 2,
|
|
|
|
VKD3D_SHADER_VISIBILITY_DOMAIN = 3,
|
|
|
|
VKD3D_SHADER_VISIBILITY_GEOMETRY = 4,
|
|
|
|
VKD3D_SHADER_VISIBILITY_PIXEL = 5,
|
|
|
|
|
2018-10-29 03:12:17 -07:00
|
|
|
VKD3D_SHADER_VISIBILITY_COMPUTE = 1000000000,
|
|
|
|
|
2018-02-02 06:39:23 -08:00
|
|
|
VKD3D_FORCE_32_BIT_ENUM(VKD3D_SHADER_VISIBILITY),
|
2017-08-01 01:51:45 -07:00
|
|
|
};
|
|
|
|
|
2020-08-31 18:34:28 -07:00
|
|
|
/** A generic structure containing a GPU shader, in text or byte-code format. */
|
2017-06-16 13:38:21 -07:00
|
|
|
struct vkd3d_shader_code
|
|
|
|
{
|
2020-08-31 18:34:28 -07:00
|
|
|
/** Pointer to the code. */
|
2017-06-16 13:38:21 -07:00
|
|
|
const void *code;
|
2020-08-31 18:34:28 -07:00
|
|
|
/** Size of \a code, in bytes. */
|
2017-06-16 13:38:21 -07:00
|
|
|
size_t size;
|
|
|
|
};
|
|
|
|
|
2017-09-07 08:15:54 -07:00
|
|
|
enum vkd3d_shader_descriptor_type
|
2017-07-26 04:45:25 -07:00
|
|
|
{
|
2020-08-04 03:13:33 -07:00
|
|
|
VKD3D_SHADER_DESCRIPTOR_TYPE_SRV = 0x0, /* t# */
|
|
|
|
VKD3D_SHADER_DESCRIPTOR_TYPE_UAV = 0x1, /* u# */
|
|
|
|
VKD3D_SHADER_DESCRIPTOR_TYPE_CBV = 0x2, /* cb# */
|
|
|
|
VKD3D_SHADER_DESCRIPTOR_TYPE_SAMPLER = 0x3, /* s# */
|
2018-02-02 06:39:23 -08:00
|
|
|
|
|
|
|
VKD3D_FORCE_32_BIT_ENUM(VKD3D_SHADER_DESCRIPTOR_TYPE),
|
2017-07-26 04:45:25 -07:00
|
|
|
};
|
|
|
|
|
2017-08-16 04:11:52 -07:00
|
|
|
struct vkd3d_shader_descriptor_binding
|
|
|
|
{
|
2018-10-29 03:12:18 -07:00
|
|
|
unsigned int set;
|
|
|
|
unsigned int binding;
|
2020-08-20 12:09:42 -07:00
|
|
|
unsigned int count; /* This must be 1 in this version of vkd3d-shader. */
|
2017-08-16 04:11:52 -07:00
|
|
|
};
|
|
|
|
|
2018-10-29 03:12:16 -07:00
|
|
|
enum vkd3d_shader_binding_flag
|
|
|
|
{
|
|
|
|
VKD3D_SHADER_BINDING_FLAG_BUFFER = 0x00000001,
|
|
|
|
VKD3D_SHADER_BINDING_FLAG_IMAGE = 0x00000002,
|
|
|
|
|
|
|
|
VKD3D_FORCE_32_BIT_ENUM(VKD3D_SHADER_BINDING_FLAG),
|
|
|
|
};
|
|
|
|
|
2019-04-26 03:37:04 -07:00
|
|
|
enum vkd3d_shader_parameter_type
|
|
|
|
{
|
|
|
|
VKD3D_SHADER_PARAMETER_TYPE_UNKNOWN,
|
|
|
|
VKD3D_SHADER_PARAMETER_TYPE_IMMEDIATE_CONSTANT,
|
|
|
|
VKD3D_SHADER_PARAMETER_TYPE_SPECIALIZATION_CONSTANT,
|
2020-07-22 04:24:14 -07:00
|
|
|
|
|
|
|
VKD3D_FORCE_32_BIT_ENUM(VKD3D_SHADER_PARAMETER_TYPE),
|
2019-04-26 03:37:04 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
enum vkd3d_shader_parameter_data_type
|
|
|
|
{
|
|
|
|
VKD3D_SHADER_PARAMETER_DATA_TYPE_UNKNOWN,
|
|
|
|
VKD3D_SHADER_PARAMETER_DATA_TYPE_UINT32,
|
2020-07-22 04:24:14 -07:00
|
|
|
|
|
|
|
VKD3D_FORCE_32_BIT_ENUM(VKD3D_SHADER_PARAMETER_DATA_TYPE),
|
2019-04-26 03:37:04 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
enum vkd3d_shader_parameter_name
|
|
|
|
{
|
|
|
|
VKD3D_SHADER_PARAMETER_NAME_UNKNOWN,
|
|
|
|
VKD3D_SHADER_PARAMETER_NAME_RASTERIZER_SAMPLE_COUNT,
|
2020-07-22 04:24:14 -07:00
|
|
|
|
|
|
|
VKD3D_FORCE_32_BIT_ENUM(VKD3D_SHADER_PARAMETER_NAME),
|
2019-04-26 03:37:04 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
struct vkd3d_shader_parameter_immediate_constant
|
|
|
|
{
|
|
|
|
union
|
|
|
|
{
|
|
|
|
uint32_t u32;
|
|
|
|
} u;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct vkd3d_shader_parameter_specialization_constant
|
|
|
|
{
|
|
|
|
uint32_t id;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct vkd3d_shader_parameter
|
|
|
|
{
|
|
|
|
enum vkd3d_shader_parameter_name name;
|
|
|
|
enum vkd3d_shader_parameter_type type;
|
|
|
|
enum vkd3d_shader_parameter_data_type data_type;
|
|
|
|
union
|
|
|
|
{
|
|
|
|
struct vkd3d_shader_parameter_immediate_constant immediate_constant;
|
|
|
|
struct vkd3d_shader_parameter_specialization_constant specialization_constant;
|
|
|
|
} u;
|
|
|
|
};
|
|
|
|
|
2017-07-26 04:45:25 -07:00
|
|
|
struct vkd3d_shader_resource_binding
|
|
|
|
{
|
2017-09-07 08:15:54 -07:00
|
|
|
enum vkd3d_shader_descriptor_type type;
|
2020-05-26 13:16:45 -07:00
|
|
|
unsigned int register_space;
|
2017-07-27 06:16:49 -07:00
|
|
|
unsigned int register_index;
|
2017-09-22 07:42:07 -07:00
|
|
|
enum vkd3d_shader_visibility shader_visibility;
|
2020-06-23 02:20:16 -07:00
|
|
|
unsigned int flags; /* vkd3d_shader_binding_flag */
|
2017-07-26 04:45:25 -07:00
|
|
|
|
2017-08-16 04:11:52 -07:00
|
|
|
struct vkd3d_shader_descriptor_binding binding;
|
2017-07-26 04:45:25 -07:00
|
|
|
};
|
|
|
|
|
2020-07-22 04:24:13 -07:00
|
|
|
#define VKD3D_SHADER_DUMMY_SAMPLER_INDEX ~0u
|
2018-10-21 16:49:16 -07:00
|
|
|
|
|
|
|
struct vkd3d_shader_combined_resource_sampler
|
|
|
|
{
|
2020-08-11 04:06:39 -07:00
|
|
|
unsigned int resource_space;
|
2018-10-21 16:49:16 -07:00
|
|
|
unsigned int resource_index;
|
2020-08-11 04:06:39 -07:00
|
|
|
unsigned int sampler_space;
|
2018-10-21 16:49:16 -07:00
|
|
|
unsigned int sampler_index;
|
|
|
|
enum vkd3d_shader_visibility shader_visibility;
|
2020-06-23 02:20:16 -07:00
|
|
|
unsigned int flags; /* vkd3d_shader_binding_flag */
|
2018-10-21 16:49:16 -07:00
|
|
|
|
|
|
|
struct vkd3d_shader_descriptor_binding binding;
|
|
|
|
};
|
|
|
|
|
2017-09-07 08:15:54 -07:00
|
|
|
struct vkd3d_shader_uav_counter_binding
|
|
|
|
{
|
2020-05-26 13:16:45 -07:00
|
|
|
unsigned int register_space;
|
2017-09-07 08:15:54 -07:00
|
|
|
unsigned int register_index; /* u# */
|
2018-11-15 07:32:40 -08:00
|
|
|
enum vkd3d_shader_visibility shader_visibility;
|
2017-09-07 08:15:54 -07:00
|
|
|
|
|
|
|
struct vkd3d_shader_descriptor_binding binding;
|
2018-10-17 08:59:36 -07:00
|
|
|
unsigned int offset;
|
2017-09-07 08:15:54 -07:00
|
|
|
};
|
|
|
|
|
2017-09-07 08:15:54 -07:00
|
|
|
struct vkd3d_shader_push_constant_buffer
|
2017-07-27 06:16:49 -07:00
|
|
|
{
|
2020-05-26 13:16:45 -07:00
|
|
|
unsigned int register_space;
|
2017-07-27 06:16:49 -07:00
|
|
|
unsigned int register_index;
|
2017-08-01 01:51:45 -07:00
|
|
|
enum vkd3d_shader_visibility shader_visibility;
|
2017-07-27 06:16:49 -07:00
|
|
|
|
2017-08-01 01:51:45 -07:00
|
|
|
unsigned int offset; /* in bytes */
|
|
|
|
unsigned int size; /* in bytes */
|
2017-07-27 06:16:49 -07:00
|
|
|
};
|
|
|
|
|
2020-06-19 04:43:33 -07:00
|
|
|
/* Extends vkd3d_shader_compile_info. */
|
2019-01-16 03:44:59 -08:00
|
|
|
struct vkd3d_shader_interface_info
|
2017-08-16 04:11:52 -07:00
|
|
|
{
|
2018-10-30 07:22:53 -07:00
|
|
|
enum vkd3d_shader_structure_type type;
|
|
|
|
const void *next;
|
|
|
|
|
2017-08-16 04:11:52 -07:00
|
|
|
const struct vkd3d_shader_resource_binding *bindings;
|
|
|
|
unsigned int binding_count;
|
|
|
|
|
2017-09-07 08:15:54 -07:00
|
|
|
const struct vkd3d_shader_push_constant_buffer *push_constant_buffers;
|
|
|
|
unsigned int push_constant_buffer_count;
|
2017-08-16 04:11:52 -07:00
|
|
|
|
2018-10-21 16:49:16 -07:00
|
|
|
const struct vkd3d_shader_combined_resource_sampler *combined_samplers;
|
|
|
|
unsigned int combined_sampler_count;
|
|
|
|
|
2017-09-07 08:15:54 -07:00
|
|
|
const struct vkd3d_shader_uav_counter_binding *uav_counters;
|
|
|
|
unsigned int uav_counter_count;
|
2017-08-16 04:11:52 -07:00
|
|
|
};
|
|
|
|
|
2019-01-14 08:05:43 -08:00
|
|
|
struct vkd3d_shader_transform_feedback_element
|
|
|
|
{
|
|
|
|
unsigned int stream_index;
|
|
|
|
const char *semantic_name;
|
|
|
|
unsigned int semantic_index;
|
|
|
|
uint8_t component_index;
|
|
|
|
uint8_t component_count;
|
|
|
|
uint8_t output_slot;
|
|
|
|
};
|
|
|
|
|
2019-01-16 03:44:59 -08:00
|
|
|
/* Extends vkd3d_shader_interface_info. */
|
2019-01-14 08:05:43 -08:00
|
|
|
struct vkd3d_shader_transform_feedback_info
|
|
|
|
{
|
|
|
|
enum vkd3d_shader_structure_type type;
|
|
|
|
const void *next;
|
|
|
|
|
|
|
|
const struct vkd3d_shader_transform_feedback_element *elements;
|
|
|
|
unsigned int element_count;
|
|
|
|
const unsigned int *buffer_strides;
|
|
|
|
unsigned int buffer_stride_count;
|
|
|
|
};
|
|
|
|
|
2020-08-31 18:34:28 -07:00
|
|
|
/** The format of a shader to be compiled or scanned. */
|
2020-06-19 04:43:36 -07:00
|
|
|
enum vkd3d_shader_source_type
|
|
|
|
{
|
2020-08-31 18:34:28 -07:00
|
|
|
/**
|
|
|
|
* The shader has no type or is to be ignored. This is not a valid value
|
|
|
|
* for vkd3d_shader_compile() or vkd3d_shader_scan().
|
|
|
|
*/
|
2020-06-19 04:43:36 -07:00
|
|
|
VKD3D_SHADER_SOURCE_NONE,
|
2020-08-31 18:34:28 -07:00
|
|
|
/**
|
|
|
|
* A 'Tokenized Program Format' shader embedded in a DXBC container. This is
|
|
|
|
* the format used for Direct3D shader model 4 and 5 shaders.
|
|
|
|
*/
|
2020-06-19 04:43:36 -07:00
|
|
|
VKD3D_SHADER_SOURCE_DXBC_TPF,
|
|
|
|
|
|
|
|
VKD3D_FORCE_32_BIT_ENUM(VKD3D_SHADER_SOURCE_TYPE),
|
|
|
|
};
|
|
|
|
|
2020-08-31 18:34:28 -07:00
|
|
|
/** The output format of a compiled shader. */
|
2020-06-23 02:20:12 -07:00
|
|
|
enum vkd3d_shader_target_type
|
|
|
|
{
|
2020-08-31 18:34:28 -07:00
|
|
|
/**
|
|
|
|
* The shader has no type or is to be ignored. This is not a valid value
|
|
|
|
* for vkd3d_shader_compile() or vkd3d_shader_scan().
|
|
|
|
*/
|
2020-06-23 02:20:12 -07:00
|
|
|
VKD3D_SHADER_TARGET_NONE,
|
2020-08-31 18:34:28 -07:00
|
|
|
/**
|
|
|
|
* A SPIR-V shader in binary form. This is the format used for Vulkan
|
|
|
|
* shaders.
|
|
|
|
*/
|
2020-06-23 02:20:12 -07:00
|
|
|
VKD3D_SHADER_TARGET_SPIRV_BINARY,
|
|
|
|
|
|
|
|
VKD3D_FORCE_32_BIT_ENUM(VKD3D_SHADER_TARGET_TYPE),
|
|
|
|
};
|
|
|
|
|
2020-08-31 18:34:28 -07:00
|
|
|
/**
|
|
|
|
* Describes the maximum severity of compilation messages returned by
|
|
|
|
* vkd3d_shader_compile() and similar functions.
|
|
|
|
*/
|
2020-07-23 02:11:25 -07:00
|
|
|
enum vkd3d_shader_log_level
|
|
|
|
{
|
2020-08-31 18:34:28 -07:00
|
|
|
/** No messages will be returned. */
|
2020-07-23 02:11:25 -07:00
|
|
|
VKD3D_SHADER_LOG_NONE,
|
2020-08-31 18:34:28 -07:00
|
|
|
/** Only fatal errors which prevent successful compilation will be returned. */
|
2020-07-23 02:11:25 -07:00
|
|
|
VKD3D_SHADER_LOG_ERROR,
|
2020-08-31 18:34:28 -07:00
|
|
|
/** Non-fatal warnings and fatal errors will be returned. */
|
2020-07-23 02:11:25 -07:00
|
|
|
VKD3D_SHADER_LOG_WARNING,
|
2020-08-31 18:34:28 -07:00
|
|
|
/**
|
|
|
|
* All messages, including general informational messages, will be returned.
|
|
|
|
*/
|
2020-07-23 02:11:25 -07:00
|
|
|
VKD3D_SHADER_LOG_INFO,
|
|
|
|
|
|
|
|
VKD3D_FORCE_32_BIT_ENUM(VKD3D_SHADER_LOG_LEVEL),
|
|
|
|
};
|
|
|
|
|
2020-08-31 18:34:28 -07:00
|
|
|
/**
|
|
|
|
* A chained structure containing compilation parameters.
|
|
|
|
*/
|
2020-06-19 04:43:32 -07:00
|
|
|
struct vkd3d_shader_compile_info
|
|
|
|
{
|
2020-08-31 18:34:28 -07:00
|
|
|
/** Must be set to VKD3D_SHADER_STRUCTURE_TYPE_COMPILE_INFO. */
|
2020-06-19 04:43:32 -07:00
|
|
|
enum vkd3d_shader_structure_type type;
|
2020-08-31 18:34:28 -07:00
|
|
|
/**
|
|
|
|
* Optional pointer to a structure containing further parameters. For a list
|
|
|
|
* of valid structures, refer to the respective function documentation. If
|
|
|
|
* no further parameters are needed, this field should be set to NULL.
|
|
|
|
*/
|
2020-06-19 04:43:32 -07:00
|
|
|
const void *next;
|
|
|
|
|
2020-08-31 18:34:28 -07:00
|
|
|
/** Input source code or byte code. */
|
2020-06-19 04:43:32 -07:00
|
|
|
struct vkd3d_shader_code source;
|
2020-06-19 04:43:35 -07:00
|
|
|
|
2020-08-31 18:34:28 -07:00
|
|
|
/** Format of the input code passed in \ref source. */
|
2020-06-19 04:43:36 -07:00
|
|
|
enum vkd3d_shader_source_type source_type;
|
2020-08-31 18:34:28 -07:00
|
|
|
/** Desired output format. */
|
2020-06-23 02:20:12 -07:00
|
|
|
enum vkd3d_shader_target_type target_type;
|
2020-06-19 04:43:36 -07:00
|
|
|
|
2020-08-31 18:34:28 -07:00
|
|
|
/**
|
|
|
|
* Pointer to an array of compilation options. This field is ignored if
|
|
|
|
* \ref option_count is zero, but must be valid otherwise.
|
|
|
|
*
|
|
|
|
* If the same option is specified multiple times, only the last value is
|
|
|
|
* used.
|
|
|
|
*
|
|
|
|
* Options not relevant to or not supported by a particular shader compiler
|
|
|
|
* or scanner will be ignored.
|
|
|
|
*/
|
2020-06-19 04:43:35 -07:00
|
|
|
const struct vkd3d_shader_compile_option *options;
|
2020-08-31 18:34:28 -07:00
|
|
|
/** Size, in elements, of \ref options. */
|
2020-06-19 04:43:35 -07:00
|
|
|
unsigned int option_count;
|
2020-07-23 02:11:25 -07:00
|
|
|
|
2020-08-31 18:34:28 -07:00
|
|
|
/** Minimum severity of messages returned from the shader function. */
|
2020-07-23 02:11:25 -07:00
|
|
|
enum vkd3d_shader_log_level log_level;
|
2020-08-31 18:34:28 -07:00
|
|
|
/**
|
|
|
|
* Name of the initial source file, which may be used in error messages or
|
|
|
|
* debug information. This parameter is optional and may be NULL.
|
|
|
|
*/
|
2020-07-23 02:11:25 -07:00
|
|
|
const char *source_name;
|
2020-06-19 04:43:32 -07:00
|
|
|
};
|
|
|
|
|
2020-06-18 07:22:50 -07:00
|
|
|
enum vkd3d_shader_spirv_environment
|
2018-10-11 06:33:34 -07:00
|
|
|
{
|
2020-06-18 07:22:50 -07:00
|
|
|
VKD3D_SHADER_SPIRV_ENVIRONMENT_NONE,
|
|
|
|
VKD3D_SHADER_SPIRV_ENVIRONMENT_OPENGL_4_5,
|
|
|
|
VKD3D_SHADER_SPIRV_ENVIRONMENT_VULKAN_1_0, /* default target */
|
2018-10-11 06:33:34 -07:00
|
|
|
|
2020-06-18 07:22:50 -07:00
|
|
|
VKD3D_FORCE_32_BIT_ENUM(VKD3D_SHADER_SPIRV_ENVIRONMENT),
|
2018-10-11 06:33:34 -07:00
|
|
|
};
|
|
|
|
|
2020-06-18 07:22:51 -07:00
|
|
|
enum vkd3d_shader_spirv_extension
|
2019-07-05 22:36:29 -07:00
|
|
|
{
|
2020-06-18 07:22:51 -07:00
|
|
|
VKD3D_SHADER_SPIRV_EXTENSION_NONE,
|
|
|
|
VKD3D_SHADER_SPIRV_EXTENSION_EXT_DEMOTE_TO_HELPER_INVOCATION,
|
2019-07-05 22:36:29 -07:00
|
|
|
|
2020-06-18 07:22:51 -07:00
|
|
|
VKD3D_FORCE_32_BIT_ENUM(VKD3D_SHADER_SPIRV_EXTENSION),
|
2019-07-05 22:36:29 -07:00
|
|
|
};
|
|
|
|
|
2020-06-19 04:43:34 -07:00
|
|
|
/* Extends vkd3d_shader_compile_info. */
|
2020-06-18 07:22:47 -07:00
|
|
|
struct vkd3d_shader_spirv_target_info
|
2018-05-24 04:08:35 -07:00
|
|
|
{
|
2018-10-30 07:22:53 -07:00
|
|
|
enum vkd3d_shader_structure_type type;
|
|
|
|
const void *next;
|
|
|
|
|
2020-06-23 02:20:15 -07:00
|
|
|
const char *entry_point; /* "main" if NULL. */
|
|
|
|
|
2020-06-18 07:22:50 -07:00
|
|
|
enum vkd3d_shader_spirv_environment environment;
|
2019-04-26 03:37:04 -07:00
|
|
|
|
2020-06-18 07:22:51 -07:00
|
|
|
const enum vkd3d_shader_spirv_extension *extensions;
|
|
|
|
unsigned int extension_count;
|
2019-07-05 22:36:29 -07:00
|
|
|
|
|
|
|
const struct vkd3d_shader_parameter *parameters;
|
2020-06-18 07:22:51 -07:00
|
|
|
unsigned int parameter_count;
|
2019-04-26 03:37:04 -07:00
|
|
|
|
2018-12-13 01:28:36 -08:00
|
|
|
bool dual_source_blending;
|
2018-10-30 07:22:53 -07:00
|
|
|
const unsigned int *output_swizzles;
|
2018-05-24 04:08:35 -07:00
|
|
|
unsigned int output_swizzle_count;
|
|
|
|
};
|
|
|
|
|
2020-06-23 02:20:13 -07:00
|
|
|
enum vkd3d_shader_tessellator_output_primitive
|
2019-02-14 03:22:33 -08:00
|
|
|
{
|
2020-06-23 02:20:13 -07:00
|
|
|
VKD3D_SHADER_TESSELLATOR_OUTPUT_POINT = 0x1,
|
|
|
|
VKD3D_SHADER_TESSELLATOR_OUTPUT_LINE = 0x2,
|
|
|
|
VKD3D_SHADER_TESSELLATOR_OUTPUT_TRIANGLE_CW = 0x3,
|
|
|
|
VKD3D_SHADER_TESSELLATOR_OUTPUT_TRIANGLE_CCW = 0x4,
|
|
|
|
|
|
|
|
VKD3D_FORCE_32_BIT_ENUM(VKD3D_SHADER_TESSELLATOR_OUTPUT_PRIMITIVE),
|
2019-02-14 03:22:33 -08:00
|
|
|
};
|
|
|
|
|
2020-06-23 02:20:14 -07:00
|
|
|
enum vkd3d_shader_tessellator_partitioning
|
2019-02-14 03:22:33 -08:00
|
|
|
{
|
2020-06-23 02:20:14 -07:00
|
|
|
VKD3D_SHADER_TESSELLATOR_PARTITIONING_INTEGER = 0x1,
|
|
|
|
VKD3D_SHADER_TESSELLATOR_PARTITIONING_POW2 = 0x2,
|
|
|
|
VKD3D_SHADER_TESSELLATOR_PARTITIONING_FRACTIONAL_ODD = 0x3,
|
|
|
|
VKD3D_SHADER_TESSELLATOR_PARTITIONING_FRACTIONAL_EVEN = 0x4,
|
|
|
|
|
|
|
|
VKD3D_FORCE_32_BIT_ENUM(VKD3D_SHADER_TESSELLATOR_PARTITIONING),
|
2019-02-14 03:22:33 -08:00
|
|
|
};
|
|
|
|
|
2020-06-18 07:22:47 -07:00
|
|
|
/* Extends vkd3d_shader_spirv_target_info. */
|
2020-06-18 07:22:48 -07:00
|
|
|
struct vkd3d_shader_spirv_domain_shader_target_info
|
2019-02-14 03:22:33 -08:00
|
|
|
{
|
|
|
|
enum vkd3d_shader_structure_type type;
|
|
|
|
const void *next;
|
|
|
|
|
2020-06-23 02:20:13 -07:00
|
|
|
enum vkd3d_shader_tessellator_output_primitive output_primitive;
|
2020-06-23 02:20:14 -07:00
|
|
|
enum vkd3d_shader_tessellator_partitioning partitioning;
|
2019-02-14 03:22:33 -08:00
|
|
|
};
|
|
|
|
|
2019-04-19 02:07:31 -07:00
|
|
|
/* root signature 1.0 */
|
2020-07-16 03:08:47 -07:00
|
|
|
enum vkd3d_shader_filter
|
|
|
|
{
|
|
|
|
VKD3D_SHADER_FILTER_MIN_MAG_MIP_POINT = 0x000,
|
|
|
|
VKD3D_SHADER_FILTER_MIN_MAG_POINT_MIP_LINEAR = 0x001,
|
|
|
|
VKD3D_SHADER_FILTER_MIN_POINT_MAG_LINEAR_MIP_POINT = 0x004,
|
|
|
|
VKD3D_SHADER_FILTER_MIN_POINT_MAG_MIP_LINEAR = 0x005,
|
|
|
|
VKD3D_SHADER_FILTER_MIN_LINEAR_MAG_MIP_POINT = 0x010,
|
|
|
|
VKD3D_SHADER_FILTER_MIN_LINEAR_MAG_POINT_MIP_LINEAR = 0x011,
|
|
|
|
VKD3D_SHADER_FILTER_MIN_MAG_LINEAR_MIP_POINT = 0x014,
|
|
|
|
VKD3D_SHADER_FILTER_MIN_MAG_MIP_LINEAR = 0x015,
|
|
|
|
VKD3D_SHADER_FILTER_ANISOTROPIC = 0x055,
|
|
|
|
VKD3D_SHADER_FILTER_COMPARISON_MIN_MAG_MIP_POINT = 0x080,
|
|
|
|
VKD3D_SHADER_FILTER_COMPARISON_MIN_MAG_POINT_MIP_LINEAR = 0x081,
|
|
|
|
VKD3D_SHADER_FILTER_COMPARISON_MIN_POINT_MAG_LINEAR_MIP_POINT = 0x084,
|
|
|
|
VKD3D_SHADER_FILTER_COMPARISON_MIN_POINT_MAG_MIP_LINEAR = 0x085,
|
|
|
|
VKD3D_SHADER_FILTER_COMPARISON_MIN_LINEAR_MAG_MIP_POINT = 0x090,
|
|
|
|
VKD3D_SHADER_FILTER_COMPARISON_MIN_LINEAR_MAG_POINT_MIP_LINEAR = 0x091,
|
|
|
|
VKD3D_SHADER_FILTER_COMPARISON_MIN_MAG_LINEAR_MIP_POINT = 0x094,
|
|
|
|
VKD3D_SHADER_FILTER_COMPARISON_MIN_MAG_MIP_LINEAR = 0x095,
|
|
|
|
VKD3D_SHADER_FILTER_COMPARISON_ANISOTROPIC = 0x0d5,
|
|
|
|
VKD3D_SHADER_FILTER_MINIMUM_MIN_MAG_MIP_POINT = 0x100,
|
|
|
|
VKD3D_SHADER_FILTER_MINIMUM_MIN_MAG_POINT_MIP_LINEAR = 0x101,
|
|
|
|
VKD3D_SHADER_FILTER_MINIMUM_MIN_POINT_MAG_LINEAR_MIP_POINT = 0x104,
|
|
|
|
VKD3D_SHADER_FILTER_MINIMUM_MIN_POINT_MAG_MIP_LINEAR = 0x105,
|
|
|
|
VKD3D_SHADER_FILTER_MINIMUM_MIN_LINEAR_MAG_MIP_POINT = 0x110,
|
|
|
|
VKD3D_SHADER_FILTER_MINIMUM_MIN_LINEAR_MAG_POINT_MIP_LINEAR = 0x111,
|
|
|
|
VKD3D_SHADER_FILTER_MINIMUM_MIN_MAG_LINEAR_MIP_POINT = 0x114,
|
|
|
|
VKD3D_SHADER_FILTER_MINIMUM_MIN_MAG_MIP_LINEAR = 0x115,
|
|
|
|
VKD3D_SHADER_FILTER_MINIMUM_ANISOTROPIC = 0x155,
|
|
|
|
VKD3D_SHADER_FILTER_MAXIMUM_MIN_MAG_MIP_POINT = 0x180,
|
|
|
|
VKD3D_SHADER_FILTER_MAXIMUM_MIN_MAG_POINT_MIP_LINEAR = 0x181,
|
|
|
|
VKD3D_SHADER_FILTER_MAXIMUM_MIN_POINT_MAG_LINEAR_MIP_POINT = 0x184,
|
|
|
|
VKD3D_SHADER_FILTER_MAXIMUM_MIN_POINT_MAG_MIP_LINEAR = 0x185,
|
|
|
|
VKD3D_SHADER_FILTER_MAXIMUM_MIN_LINEAR_MAG_MIP_POINT = 0x190,
|
|
|
|
VKD3D_SHADER_FILTER_MAXIMUM_MIN_LINEAR_MAG_POINT_MIP_LINEAR = 0x191,
|
|
|
|
VKD3D_SHADER_FILTER_MAXIMUM_MIN_MAG_LINEAR_MIP_POINT = 0x194,
|
|
|
|
VKD3D_SHADER_FILTER_MAXIMUM_MIN_MAG_MIP_LINEAR = 0x195,
|
|
|
|
VKD3D_SHADER_FILTER_MAXIMUM_ANISOTROPIC = 0x1d5,
|
|
|
|
|
|
|
|
VKD3D_FORCE_32_BIT_ENUM(VKD3D_SHADER_FILTER),
|
2018-02-15 06:43:51 -08:00
|
|
|
};
|
|
|
|
|
2020-07-16 03:08:48 -07:00
|
|
|
enum vkd3d_shader_texture_address_mode
|
2018-02-15 06:43:51 -08:00
|
|
|
{
|
2020-07-16 03:08:48 -07:00
|
|
|
VKD3D_SHADER_TEXTURE_ADDRESS_MODE_WRAP = 0x1,
|
|
|
|
VKD3D_SHADER_TEXTURE_ADDRESS_MODE_MIRROR = 0x2,
|
|
|
|
VKD3D_SHADER_TEXTURE_ADDRESS_MODE_CLAMP = 0x3,
|
|
|
|
VKD3D_SHADER_TEXTURE_ADDRESS_MODE_BORDER = 0x4,
|
|
|
|
VKD3D_SHADER_TEXTURE_ADDRESS_MODE_MIRROR_ONCE = 0x5,
|
2018-02-15 06:43:51 -08:00
|
|
|
|
2020-07-16 03:08:48 -07:00
|
|
|
VKD3D_FORCE_32_BIT_ENUM(VKD3D_SHADER_TEXTURE_ADDRESS_MODE),
|
2018-02-15 06:43:51 -08:00
|
|
|
};
|
|
|
|
|
2020-07-17 02:44:21 -07:00
|
|
|
enum vkd3d_shader_comparison_func
|
2018-02-15 06:43:51 -08:00
|
|
|
{
|
2020-07-17 02:44:21 -07:00
|
|
|
VKD3D_SHADER_COMPARISON_FUNC_NEVER = 0x1,
|
|
|
|
VKD3D_SHADER_COMPARISON_FUNC_LESS = 0x2,
|
|
|
|
VKD3D_SHADER_COMPARISON_FUNC_EQUAL = 0x3,
|
|
|
|
VKD3D_SHADER_COMPARISON_FUNC_LESS_EQUAL = 0x4,
|
|
|
|
VKD3D_SHADER_COMPARISON_FUNC_GREATER = 0x5,
|
|
|
|
VKD3D_SHADER_COMPARISON_FUNC_NOT_EQUAL = 0x6,
|
|
|
|
VKD3D_SHADER_COMPARISON_FUNC_GREATER_EQUAL = 0x7,
|
|
|
|
VKD3D_SHADER_COMPARISON_FUNC_ALWAYS = 0x8,
|
2018-02-15 06:43:51 -08:00
|
|
|
|
2020-07-17 02:44:21 -07:00
|
|
|
VKD3D_FORCE_32_BIT_ENUM(VKD3D_SHADER_COMPARISON_FUNC),
|
2018-02-15 06:43:51 -08:00
|
|
|
};
|
|
|
|
|
2020-07-17 02:44:22 -07:00
|
|
|
enum vkd3d_shader_static_border_colour
|
2018-02-15 06:43:51 -08:00
|
|
|
{
|
2020-07-17 02:44:22 -07:00
|
|
|
VKD3D_SHADER_STATIC_BORDER_COLOUR_TRANSPARENT_BLACK = 0x0,
|
|
|
|
VKD3D_SHADER_STATIC_BORDER_COLOUR_OPAQUE_BLACK = 0x1,
|
|
|
|
VKD3D_SHADER_STATIC_BORDER_COLOUR_OPAQUE_WHITE = 0x2,
|
2018-02-15 06:43:51 -08:00
|
|
|
|
2020-07-17 02:44:22 -07:00
|
|
|
VKD3D_FORCE_32_BIT_ENUM(VKD3D_SHADER_STATIC_BORDER_COLOUR),
|
2018-02-15 06:43:51 -08:00
|
|
|
};
|
|
|
|
|
2020-07-21 03:49:59 -07:00
|
|
|
struct vkd3d_shader_static_sampler_desc
|
2018-02-15 06:43:51 -08:00
|
|
|
{
|
2020-07-16 03:08:47 -07:00
|
|
|
enum vkd3d_shader_filter filter;
|
2020-07-16 03:08:48 -07:00
|
|
|
enum vkd3d_shader_texture_address_mode address_u;
|
|
|
|
enum vkd3d_shader_texture_address_mode address_v;
|
|
|
|
enum vkd3d_shader_texture_address_mode address_w;
|
2018-02-15 06:43:51 -08:00
|
|
|
float mip_lod_bias;
|
|
|
|
unsigned int max_anisotropy;
|
2020-07-17 02:44:21 -07:00
|
|
|
enum vkd3d_shader_comparison_func comparison_func;
|
2020-07-17 02:44:22 -07:00
|
|
|
enum vkd3d_shader_static_border_colour border_colour;
|
2018-02-15 06:43:51 -08:00
|
|
|
float min_lod;
|
|
|
|
float max_lod;
|
|
|
|
unsigned int shader_register;
|
|
|
|
unsigned int register_space;
|
|
|
|
enum vkd3d_shader_visibility shader_visibility;
|
|
|
|
};
|
|
|
|
|
2020-07-14 04:22:52 -07:00
|
|
|
struct vkd3d_shader_descriptor_range
|
2018-02-15 06:43:51 -08:00
|
|
|
{
|
2020-08-04 03:13:33 -07:00
|
|
|
enum vkd3d_shader_descriptor_type range_type;
|
2018-02-15 06:43:51 -08:00
|
|
|
unsigned int descriptor_count;
|
|
|
|
unsigned int base_shader_register;
|
|
|
|
unsigned int register_space;
|
|
|
|
unsigned int descriptor_table_offset;
|
|
|
|
};
|
|
|
|
|
2020-07-16 03:08:44 -07:00
|
|
|
struct vkd3d_shader_root_descriptor_table
|
2018-02-15 06:43:51 -08:00
|
|
|
{
|
|
|
|
unsigned int descriptor_range_count;
|
2020-07-14 04:22:52 -07:00
|
|
|
const struct vkd3d_shader_descriptor_range *descriptor_ranges;
|
2018-02-15 06:43:51 -08:00
|
|
|
};
|
|
|
|
|
2020-07-16 03:08:45 -07:00
|
|
|
struct vkd3d_shader_root_constants
|
2018-02-15 06:43:51 -08:00
|
|
|
{
|
|
|
|
unsigned int shader_register;
|
|
|
|
unsigned int register_space;
|
|
|
|
unsigned int value_count;
|
|
|
|
};
|
|
|
|
|
2020-07-16 03:08:46 -07:00
|
|
|
struct vkd3d_shader_root_descriptor
|
2018-02-15 06:43:51 -08:00
|
|
|
{
|
|
|
|
unsigned int shader_register;
|
|
|
|
unsigned int register_space;
|
|
|
|
};
|
|
|
|
|
2020-07-14 04:22:55 -07:00
|
|
|
enum vkd3d_shader_root_parameter_type
|
2018-02-15 06:43:51 -08:00
|
|
|
{
|
2020-07-14 04:22:55 -07:00
|
|
|
VKD3D_SHADER_ROOT_PARAMETER_TYPE_DESCRIPTOR_TABLE = 0x0,
|
|
|
|
VKD3D_SHADER_ROOT_PARAMETER_TYPE_32BIT_CONSTANTS = 0x1,
|
|
|
|
VKD3D_SHADER_ROOT_PARAMETER_TYPE_CBV = 0x2,
|
|
|
|
VKD3D_SHADER_ROOT_PARAMETER_TYPE_SRV = 0x3,
|
|
|
|
VKD3D_SHADER_ROOT_PARAMETER_TYPE_UAV = 0x4,
|
2018-02-15 06:43:51 -08:00
|
|
|
|
2020-07-14 04:22:55 -07:00
|
|
|
VKD3D_FORCE_32_BIT_ENUM(VKD3D_SHADER_ROOT_PARAMETER_TYPE),
|
2018-02-15 06:43:51 -08:00
|
|
|
};
|
|
|
|
|
2020-07-17 02:44:25 -07:00
|
|
|
struct vkd3d_shader_root_parameter
|
2018-02-15 06:43:51 -08:00
|
|
|
{
|
2020-07-14 04:22:55 -07:00
|
|
|
enum vkd3d_shader_root_parameter_type parameter_type;
|
2018-02-15 06:43:51 -08:00
|
|
|
union
|
|
|
|
{
|
2020-07-16 03:08:44 -07:00
|
|
|
struct vkd3d_shader_root_descriptor_table descriptor_table;
|
2020-07-16 03:08:45 -07:00
|
|
|
struct vkd3d_shader_root_constants constants;
|
2020-07-16 03:08:46 -07:00
|
|
|
struct vkd3d_shader_root_descriptor descriptor;
|
2018-02-15 06:43:51 -08:00
|
|
|
} u;
|
|
|
|
enum vkd3d_shader_visibility shader_visibility;
|
|
|
|
};
|
|
|
|
|
2020-07-21 03:50:00 -07:00
|
|
|
enum vkd3d_shader_root_signature_flags
|
2018-02-15 06:43:51 -08:00
|
|
|
{
|
2020-07-21 03:50:00 -07:00
|
|
|
VKD3D_SHADER_ROOT_SIGNATURE_FLAG_NONE = 0x00,
|
|
|
|
VKD3D_SHADER_ROOT_SIGNATURE_FLAG_ALLOW_INPUT_ASSEMBLER_INPUT_LAYOUT = 0x01,
|
|
|
|
VKD3D_SHADER_ROOT_SIGNATURE_FLAG_DENY_VERTEX_SHADER_ROOT_ACCESS = 0x02,
|
|
|
|
VKD3D_SHADER_ROOT_SIGNATURE_FLAG_DENY_HULL_SHADER_ROOT_ACCESS = 0x04,
|
|
|
|
VKD3D_SHADER_ROOT_SIGNATURE_FLAG_DENY_DOMAIN_SHADER_ROOT_ACCESS = 0x08,
|
|
|
|
VKD3D_SHADER_ROOT_SIGNATURE_FLAG_DENY_GEOMETRY_SHADER_ROOT_ACCESS = 0x10,
|
|
|
|
VKD3D_SHADER_ROOT_SIGNATURE_FLAG_DENY_PIXEL_SHADER_ROOT_ACCESS = 0x20,
|
|
|
|
VKD3D_SHADER_ROOT_SIGNATURE_FLAG_ALLOW_STREAM_OUTPUT = 0x40,
|
2018-02-15 06:43:51 -08:00
|
|
|
|
2020-07-21 03:50:00 -07:00
|
|
|
VKD3D_FORCE_32_BIT_ENUM(VKD3D_SHADER_ROOT_SIGNATURE_FLAGS),
|
2018-02-15 06:43:51 -08:00
|
|
|
};
|
|
|
|
|
2020-07-21 03:50:03 -07:00
|
|
|
struct vkd3d_shader_root_signature_desc
|
2018-02-15 06:43:51 -08:00
|
|
|
{
|
|
|
|
unsigned int parameter_count;
|
2020-07-17 02:44:25 -07:00
|
|
|
const struct vkd3d_shader_root_parameter *parameters;
|
2018-02-15 06:43:51 -08:00
|
|
|
unsigned int static_sampler_count;
|
2020-07-21 03:49:59 -07:00
|
|
|
const struct vkd3d_shader_static_sampler_desc *static_samplers;
|
2020-07-21 03:50:00 -07:00
|
|
|
enum vkd3d_shader_root_signature_flags flags;
|
2018-02-15 06:43:51 -08:00
|
|
|
};
|
|
|
|
|
2019-04-19 02:07:31 -07:00
|
|
|
/* root signature 1.1 */
|
2020-07-14 04:22:54 -07:00
|
|
|
enum vkd3d_shader_root_descriptor_flags
|
2019-04-19 02:07:31 -07:00
|
|
|
{
|
2020-07-14 04:22:54 -07:00
|
|
|
VKD3D_SHADER_ROOT_DESCRIPTOR_FLAG_NONE = 0x0,
|
|
|
|
VKD3D_SHADER_ROOT_DESCRIPTOR_FLAG_DATA_VOLATILE = 0x2,
|
|
|
|
VKD3D_SHADER_ROOT_DESCRIPTOR_FLAG_DATA_STATIC_WHILE_SET_AT_EXECUTE = 0x4,
|
|
|
|
VKD3D_SHADER_ROOT_DESCRIPTOR_FLAG_DATA_STATIC = 0x8,
|
|
|
|
|
|
|
|
VKD3D_FORCE_32_BIT_ENUM(VKD3D_SHADER_ROOT_DESCRIPTOR_FLAGS),
|
2019-04-19 02:07:31 -07:00
|
|
|
};
|
|
|
|
|
2020-07-14 04:22:51 -07:00
|
|
|
enum vkd3d_shader_descriptor_range_flags
|
2019-04-19 02:07:31 -07:00
|
|
|
{
|
2020-07-14 04:22:51 -07:00
|
|
|
VKD3D_SHADER_DESCRIPTOR_RANGE_FLAG_NONE = 0x0,
|
|
|
|
VKD3D_SHADER_DESCRIPTOR_RANGE_FLAG_DESCRIPTORS_VOLATILE = 0x1,
|
|
|
|
VKD3D_SHADER_DESCRIPTOR_RANGE_FLAG_DATA_VOLATILE = 0x2,
|
|
|
|
VKD3D_SHADER_DESCRIPTOR_RANGE_FLAG_DATA_STATIC_WHILE_SET_AT_EXECUTE = 0x4,
|
|
|
|
VKD3D_SHADER_DESCRIPTOR_RANGE_FLAG_DATA_STATIC = 0x8,
|
|
|
|
|
|
|
|
VKD3D_FORCE_32_BIT_ENUM(VKD3D_SHADER_DESCRIPTOR_RANGE_FLAGS),
|
2019-04-19 02:07:31 -07:00
|
|
|
};
|
|
|
|
|
2020-07-14 04:22:53 -07:00
|
|
|
struct vkd3d_shader_descriptor_range1
|
2019-04-19 02:07:31 -07:00
|
|
|
{
|
2020-08-04 03:13:33 -07:00
|
|
|
enum vkd3d_shader_descriptor_type range_type;
|
2019-04-19 02:07:31 -07:00
|
|
|
unsigned int descriptor_count;
|
|
|
|
unsigned int base_shader_register;
|
|
|
|
unsigned int register_space;
|
2020-07-14 04:22:51 -07:00
|
|
|
enum vkd3d_shader_descriptor_range_flags flags;
|
2019-04-19 02:07:31 -07:00
|
|
|
unsigned int descriptor_table_offset;
|
|
|
|
};
|
|
|
|
|
2020-07-17 02:44:23 -07:00
|
|
|
struct vkd3d_shader_root_descriptor_table1
|
2019-04-19 02:07:31 -07:00
|
|
|
{
|
|
|
|
unsigned int descriptor_range_count;
|
2020-07-14 04:22:53 -07:00
|
|
|
const struct vkd3d_shader_descriptor_range1 *descriptor_ranges;
|
2019-04-19 02:07:31 -07:00
|
|
|
};
|
|
|
|
|
2020-07-17 02:44:24 -07:00
|
|
|
struct vkd3d_shader_root_descriptor1
|
2019-04-19 02:07:31 -07:00
|
|
|
{
|
|
|
|
unsigned int shader_register;
|
|
|
|
unsigned int register_space;
|
2020-07-14 04:22:54 -07:00
|
|
|
enum vkd3d_shader_root_descriptor_flags flags;
|
2019-04-19 02:07:31 -07:00
|
|
|
};
|
|
|
|
|
2020-07-21 03:50:01 -07:00
|
|
|
struct vkd3d_shader_root_parameter1
|
2019-04-19 02:07:31 -07:00
|
|
|
{
|
2020-07-14 04:22:55 -07:00
|
|
|
enum vkd3d_shader_root_parameter_type parameter_type;
|
2019-04-19 02:07:31 -07:00
|
|
|
union
|
|
|
|
{
|
2020-07-17 02:44:23 -07:00
|
|
|
struct vkd3d_shader_root_descriptor_table1 descriptor_table;
|
2020-07-16 03:08:45 -07:00
|
|
|
struct vkd3d_shader_root_constants constants;
|
2020-07-17 02:44:24 -07:00
|
|
|
struct vkd3d_shader_root_descriptor1 descriptor;
|
2019-04-19 02:07:31 -07:00
|
|
|
} u;
|
|
|
|
enum vkd3d_shader_visibility shader_visibility;
|
|
|
|
};
|
|
|
|
|
2020-07-22 04:24:11 -07:00
|
|
|
struct vkd3d_shader_root_signature_desc1
|
2019-04-19 02:07:31 -07:00
|
|
|
{
|
|
|
|
unsigned int parameter_count;
|
2020-07-21 03:50:01 -07:00
|
|
|
const struct vkd3d_shader_root_parameter1 *parameters;
|
2019-04-19 02:07:31 -07:00
|
|
|
unsigned int static_sampler_count;
|
2020-07-21 03:49:59 -07:00
|
|
|
const struct vkd3d_shader_static_sampler_desc *static_samplers;
|
2020-07-21 03:50:00 -07:00
|
|
|
enum vkd3d_shader_root_signature_flags flags;
|
2019-04-19 02:07:31 -07:00
|
|
|
};
|
|
|
|
|
2020-07-21 03:50:02 -07:00
|
|
|
enum vkd3d_shader_root_signature_version
|
2017-10-10 07:57:36 -07:00
|
|
|
{
|
2020-07-21 03:50:02 -07:00
|
|
|
VKD3D_SHADER_ROOT_SIGNATURE_VERSION_1_0 = 0x1,
|
|
|
|
VKD3D_SHADER_ROOT_SIGNATURE_VERSION_1_1 = 0x2,
|
2018-02-02 06:39:23 -08:00
|
|
|
|
2020-07-21 03:50:02 -07:00
|
|
|
VKD3D_FORCE_32_BIT_ENUM(VKD3D_SHADER_ROOT_SIGNATURE_VERSION),
|
2017-10-10 07:57:36 -07:00
|
|
|
};
|
|
|
|
|
2020-07-22 04:24:12 -07:00
|
|
|
struct vkd3d_shader_versioned_root_signature_desc
|
2019-04-19 02:07:31 -07:00
|
|
|
{
|
2020-07-21 03:50:02 -07:00
|
|
|
enum vkd3d_shader_root_signature_version version;
|
2019-04-19 02:07:31 -07:00
|
|
|
union
|
|
|
|
{
|
2020-07-21 03:50:03 -07:00
|
|
|
struct vkd3d_shader_root_signature_desc v_1_0;
|
2020-07-22 04:24:11 -07:00
|
|
|
struct vkd3d_shader_root_signature_desc1 v_1_1;
|
2019-04-19 02:07:31 -07:00
|
|
|
} u;
|
|
|
|
};
|
|
|
|
|
2020-06-24 23:18:25 -07:00
|
|
|
enum vkd3d_shader_resource_type
|
|
|
|
{
|
|
|
|
VKD3D_SHADER_RESOURCE_NONE = 0x0,
|
|
|
|
VKD3D_SHADER_RESOURCE_BUFFER = 0x1,
|
|
|
|
VKD3D_SHADER_RESOURCE_TEXTURE_1D = 0x2,
|
|
|
|
VKD3D_SHADER_RESOURCE_TEXTURE_2D = 0x3,
|
|
|
|
VKD3D_SHADER_RESOURCE_TEXTURE_2DMS = 0x4,
|
|
|
|
VKD3D_SHADER_RESOURCE_TEXTURE_3D = 0x5,
|
|
|
|
VKD3D_SHADER_RESOURCE_TEXTURE_CUBE = 0x6,
|
|
|
|
VKD3D_SHADER_RESOURCE_TEXTURE_1DARRAY = 0x7,
|
|
|
|
VKD3D_SHADER_RESOURCE_TEXTURE_2DARRAY = 0x8,
|
|
|
|
VKD3D_SHADER_RESOURCE_TEXTURE_2DMSARRAY = 0x9,
|
|
|
|
VKD3D_SHADER_RESOURCE_TEXTURE_CUBEARRAY = 0xa,
|
|
|
|
|
|
|
|
VKD3D_FORCE_32_BIT_ENUM(VKD3D_SHADER_RESOURCE_TYPE),
|
|
|
|
};
|
|
|
|
|
|
|
|
enum vkd3d_shader_resource_data_type
|
|
|
|
{
|
|
|
|
VKD3D_SHADER_RESOURCE_DATA_UNORM = 0x1,
|
|
|
|
VKD3D_SHADER_RESOURCE_DATA_SNORM = 0x2,
|
|
|
|
VKD3D_SHADER_RESOURCE_DATA_INT = 0x3,
|
|
|
|
VKD3D_SHADER_RESOURCE_DATA_UINT = 0x4,
|
|
|
|
VKD3D_SHADER_RESOURCE_DATA_FLOAT = 0x5,
|
|
|
|
|
|
|
|
VKD3D_FORCE_32_BIT_ENUM(VKD3D_SHADER_RESOURCE_DATA_TYPE),
|
|
|
|
};
|
|
|
|
|
2020-06-24 23:18:26 -07:00
|
|
|
enum vkd3d_shader_descriptor_info_flag
|
|
|
|
{
|
2020-06-24 23:18:28 -07:00
|
|
|
VKD3D_SHADER_DESCRIPTOR_INFO_FLAG_UAV_COUNTER = 0x00000001,
|
|
|
|
VKD3D_SHADER_DESCRIPTOR_INFO_FLAG_UAV_READ = 0x00000002,
|
|
|
|
VKD3D_SHADER_DESCRIPTOR_INFO_FLAG_SAMPLER_COMPARISON_MODE = 0x00000004,
|
2020-06-24 23:18:26 -07:00
|
|
|
|
|
|
|
VKD3D_FORCE_32_BIT_ENUM(VKD3D_SHADER_DESCRIPTOR_INFO_FLAG),
|
|
|
|
};
|
|
|
|
|
2020-06-24 23:18:24 -07:00
|
|
|
struct vkd3d_shader_descriptor_info
|
|
|
|
{
|
|
|
|
enum vkd3d_shader_descriptor_type type;
|
|
|
|
unsigned int register_space;
|
|
|
|
unsigned int register_index;
|
2020-06-24 23:18:25 -07:00
|
|
|
enum vkd3d_shader_resource_type resource_type;
|
|
|
|
enum vkd3d_shader_resource_data_type resource_data_type;
|
2020-06-24 23:18:26 -07:00
|
|
|
unsigned int flags; /* vkd3d_shader_descriptor_info_flag */
|
2020-06-24 23:18:24 -07:00
|
|
|
unsigned int count;
|
|
|
|
};
|
|
|
|
|
2020-07-30 03:29:55 -07:00
|
|
|
/* Extends vkd3d_shader_compile_info. */
|
|
|
|
struct vkd3d_shader_scan_descriptor_info
|
2017-09-01 02:27:58 -07:00
|
|
|
{
|
2018-10-30 07:22:53 -07:00
|
|
|
enum vkd3d_shader_structure_type type;
|
2020-07-30 03:29:55 -07:00
|
|
|
const void *next;
|
2018-10-30 07:22:53 -07:00
|
|
|
|
2020-06-24 23:18:24 -07:00
|
|
|
struct vkd3d_shader_descriptor_info *descriptors;
|
|
|
|
unsigned int descriptor_count;
|
2017-09-01 02:27:58 -07:00
|
|
|
};
|
|
|
|
|
2020-07-10 05:14:00 -07:00
|
|
|
enum vkd3d_shader_component_type
|
2017-09-11 13:35:16 -07:00
|
|
|
{
|
2020-07-10 05:14:00 -07:00
|
|
|
VKD3D_SHADER_COMPONENT_VOID = 0x0,
|
|
|
|
VKD3D_SHADER_COMPONENT_UINT = 0x1,
|
|
|
|
VKD3D_SHADER_COMPONENT_INT = 0x2,
|
|
|
|
VKD3D_SHADER_COMPONENT_FLOAT = 0x3,
|
|
|
|
VKD3D_SHADER_COMPONENT_BOOL = 0x4,
|
2018-02-02 06:39:23 -08:00
|
|
|
|
2020-07-10 05:14:00 -07:00
|
|
|
VKD3D_FORCE_32_BIT_ENUM(VKD3D_SHADER_COMPONENT_TYPE),
|
2017-09-11 13:35:16 -07:00
|
|
|
};
|
|
|
|
|
2020-07-10 05:14:01 -07:00
|
|
|
enum vkd3d_shader_sysval_semantic
|
|
|
|
{
|
|
|
|
VKD3D_SHADER_SV_NONE = 0x00,
|
|
|
|
VKD3D_SHADER_SV_POSITION = 0x01,
|
|
|
|
VKD3D_SHADER_SV_CLIP_DISTANCE = 0x02,
|
|
|
|
VKD3D_SHADER_SV_CULL_DISTANCE = 0x03,
|
|
|
|
VKD3D_SHADER_SV_RENDER_TARGET_ARRAY_INDEX = 0x04,
|
|
|
|
VKD3D_SHADER_SV_VIEWPORT_ARRAY_INDEX = 0x05,
|
|
|
|
VKD3D_SHADER_SV_VERTEX_ID = 0x06,
|
|
|
|
VKD3D_SHADER_SV_PRIMITIVE_ID = 0x07,
|
|
|
|
VKD3D_SHADER_SV_INSTANCE_ID = 0x08,
|
|
|
|
VKD3D_SHADER_SV_IS_FRONT_FACE = 0x09,
|
|
|
|
VKD3D_SHADER_SV_SAMPLE_INDEX = 0x0a,
|
|
|
|
VKD3D_SHADER_SV_TESS_FACTOR_QUADEDGE = 0x0b,
|
|
|
|
VKD3D_SHADER_SV_TESS_FACTOR_QUADINT = 0x0c,
|
|
|
|
VKD3D_SHADER_SV_TESS_FACTOR_TRIEDGE = 0x0d,
|
|
|
|
VKD3D_SHADER_SV_TESS_FACTOR_TRIINT = 0x0e,
|
|
|
|
VKD3D_SHADER_SV_TESS_FACTOR_LINEDET = 0x0f,
|
|
|
|
VKD3D_SHADER_SV_TESS_FACTOR_LINEDEN = 0x10,
|
|
|
|
|
|
|
|
VKD3D_FORCE_32_BIT_ENUM(VKD3D_SHADER_SYSVAL_SEMANTIC),
|
2017-09-11 13:35:16 -07:00
|
|
|
};
|
|
|
|
|
2019-05-21 01:57:19 -07:00
|
|
|
enum vkd3d_shader_minimum_precision
|
|
|
|
{
|
|
|
|
VKD3D_SHADER_MINIMUM_PRECISION_NONE = 0,
|
|
|
|
VKD3D_SHADER_MINIMUM_PRECISION_FLOAT_16 = 1,
|
|
|
|
VKD3D_SHADER_MINIMUM_PRECISION_FLOAT_8_2 = 2,
|
|
|
|
VKD3D_SHADER_MINIMUM_PRECISION_INT_16 = 4,
|
|
|
|
VKD3D_SHADER_MINIMUM_PRECISION_UINT_16 = 5,
|
2020-07-22 04:24:14 -07:00
|
|
|
|
|
|
|
VKD3D_FORCE_32_BIT_ENUM(VKD3D_SHADER_MINIMUM_PRECISION),
|
2019-05-21 01:57:19 -07:00
|
|
|
};
|
|
|
|
|
2017-09-11 13:35:16 -07:00
|
|
|
struct vkd3d_shader_signature_element
|
|
|
|
{
|
|
|
|
const char *semantic_name;
|
|
|
|
unsigned int semantic_index;
|
|
|
|
unsigned int stream_index;
|
2020-07-10 05:14:01 -07:00
|
|
|
enum vkd3d_shader_sysval_semantic sysval_semantic;
|
2020-07-10 05:14:00 -07:00
|
|
|
enum vkd3d_shader_component_type component_type;
|
2017-09-11 13:35:16 -07:00
|
|
|
unsigned int register_index;
|
2018-02-15 06:43:52 -08:00
|
|
|
unsigned int mask;
|
2019-05-21 01:57:19 -07:00
|
|
|
enum vkd3d_shader_minimum_precision min_precision;
|
2017-09-11 13:35:16 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
struct vkd3d_shader_signature
|
|
|
|
{
|
|
|
|
struct vkd3d_shader_signature_element *elements;
|
|
|
|
unsigned int element_count;
|
|
|
|
};
|
|
|
|
|
2018-05-24 04:08:35 -07:00
|
|
|
/* swizzle bits fields: wwzzyyxx */
|
2020-08-13 06:07:40 -07:00
|
|
|
enum vkd3d_shader_swizzle_component
|
|
|
|
{
|
|
|
|
VKD3D_SHADER_SWIZZLE_X = 0x0,
|
|
|
|
VKD3D_SHADER_SWIZZLE_Y = 0x1,
|
|
|
|
VKD3D_SHADER_SWIZZLE_Z = 0x2,
|
|
|
|
VKD3D_SHADER_SWIZZLE_W = 0x3,
|
|
|
|
|
|
|
|
VKD3D_FORCE_32_BIT_ENUM(VKD3D_SHADER_SWIZZLE_COMPONENT),
|
|
|
|
};
|
2020-07-10 05:14:02 -07:00
|
|
|
|
2020-08-20 12:09:41 -07:00
|
|
|
#define VKD3D_SHADER_SWIZZLE_MASK (0xffu)
|
|
|
|
#define VKD3D_SHADER_SWIZZLE_SHIFT(idx) (8u * (idx))
|
2020-07-10 05:14:02 -07:00
|
|
|
|
|
|
|
#define VKD3D_SHADER_SWIZZLE(x, y, z, w) \
|
2020-08-20 12:09:41 -07:00
|
|
|
vkd3d_shader_create_swizzle(VKD3D_SHADER_SWIZZLE_ ## x, \
|
|
|
|
VKD3D_SHADER_SWIZZLE_ ## y, \
|
|
|
|
VKD3D_SHADER_SWIZZLE_ ## z, \
|
|
|
|
VKD3D_SHADER_SWIZZLE_ ## w)
|
2020-08-10 14:24:48 -07:00
|
|
|
|
|
|
|
#define VKD3D_SHADER_NO_SWIZZLE VKD3D_SHADER_SWIZZLE(X, Y, Z, W)
|
2018-05-24 04:08:35 -07:00
|
|
|
|
2020-08-20 12:09:41 -07:00
|
|
|
static inline uint32_t vkd3d_shader_create_swizzle(enum vkd3d_shader_swizzle_component x,
|
|
|
|
enum vkd3d_shader_swizzle_component y, enum vkd3d_shader_swizzle_component z,
|
|
|
|
enum vkd3d_shader_swizzle_component w)
|
|
|
|
{
|
|
|
|
return ((x & VKD3D_SHADER_SWIZZLE_MASK) << VKD3D_SHADER_SWIZZLE_SHIFT(0))
|
|
|
|
| ((y & VKD3D_SHADER_SWIZZLE_MASK) << VKD3D_SHADER_SWIZZLE_SHIFT(1))
|
|
|
|
| ((z & VKD3D_SHADER_SWIZZLE_MASK) << VKD3D_SHADER_SWIZZLE_SHIFT(2))
|
|
|
|
| ((w & VKD3D_SHADER_SWIZZLE_MASK) << VKD3D_SHADER_SWIZZLE_SHIFT(3));
|
|
|
|
}
|
|
|
|
|
2019-02-25 02:59:16 -08:00
|
|
|
#ifndef VKD3D_SHADER_NO_PROTOTYPES
|
|
|
|
|
2020-08-06 01:53:45 -07:00
|
|
|
const char *vkd3d_shader_get_version(unsigned int *major, unsigned int *minor);
|
2020-08-06 01:53:48 -07:00
|
|
|
const enum vkd3d_shader_source_type *vkd3d_shader_get_supported_source_types(unsigned int *count);
|
2020-08-06 01:53:49 -07:00
|
|
|
const enum vkd3d_shader_target_type *vkd3d_shader_get_supported_target_types(
|
|
|
|
enum vkd3d_shader_source_type source_type, unsigned int *count);
|
2020-08-06 01:53:45 -07:00
|
|
|
|
2020-07-23 02:11:25 -07:00
|
|
|
int vkd3d_shader_compile(const struct vkd3d_shader_compile_info *compile_info,
|
|
|
|
struct vkd3d_shader_code *out, char **messages);
|
|
|
|
void vkd3d_shader_free_messages(char *messages);
|
2019-02-25 02:59:16 -08:00
|
|
|
void vkd3d_shader_free_shader_code(struct vkd3d_shader_code *code);
|
|
|
|
|
2019-04-24 07:05:46 -07:00
|
|
|
int vkd3d_shader_parse_root_signature(const struct vkd3d_shader_code *dxbc,
|
2020-07-30 03:29:57 -07:00
|
|
|
struct vkd3d_shader_versioned_root_signature_desc *root_signature, char **messages);
|
2020-07-22 04:24:12 -07:00
|
|
|
void vkd3d_shader_free_root_signature(struct vkd3d_shader_versioned_root_signature_desc *root_signature);
|
2019-04-19 02:07:31 -07:00
|
|
|
|
2020-07-22 04:24:12 -07:00
|
|
|
int vkd3d_shader_serialize_root_signature(const struct vkd3d_shader_versioned_root_signature_desc *root_signature,
|
2020-07-30 03:29:58 -07:00
|
|
|
struct vkd3d_shader_code *dxbc, char **messages);
|
2019-04-22 01:58:33 -07:00
|
|
|
|
2020-07-22 04:24:12 -07:00
|
|
|
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);
|
2019-04-19 02:07:33 -07:00
|
|
|
|
2020-07-30 03:29:55 -07:00
|
|
|
int vkd3d_shader_scan(const struct vkd3d_shader_compile_info *compile_info, char **messages);
|
|
|
|
void vkd3d_shader_free_scan_descriptor_info(struct vkd3d_shader_scan_descriptor_info *scan_descriptor_info);
|
2019-02-25 02:59:16 -08:00
|
|
|
|
|
|
|
int vkd3d_shader_parse_input_signature(const struct vkd3d_shader_code *dxbc,
|
2020-07-30 03:29:56 -07:00
|
|
|
struct vkd3d_shader_signature *signature, char **messages);
|
2019-02-25 02:59:16 -08:00
|
|
|
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);
|
|
|
|
void vkd3d_shader_free_shader_signature(struct vkd3d_shader_signature *signature);
|
|
|
|
|
|
|
|
#endif /* VKD3D_SHADER_NO_PROTOTYPES */
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Function pointer typedefs for vkd3d-shader functions.
|
|
|
|
*/
|
2020-08-06 01:53:45 -07:00
|
|
|
typedef const char *(*PFN_vkd3d_shader_get_version)(unsigned int *major, unsigned int *minor);
|
2020-08-06 01:53:48 -07:00
|
|
|
typedef const enum vkd3d_shader_source_type *(*PFN_vkd3d_shader_get_supported_source_types)(unsigned int *count);
|
2020-08-06 01:53:49 -07:00
|
|
|
typedef const enum vkd3d_shader_target_type *(*PFN_vkd3d_shader_get_supported_target_types)(
|
|
|
|
enum vkd3d_shader_source_type source_type, unsigned int *count);
|
2020-08-06 01:53:45 -07:00
|
|
|
|
2020-06-19 04:43:36 -07:00
|
|
|
typedef int (*PFN_vkd3d_shader_compile)(const struct vkd3d_shader_compile_info *compile_info,
|
2020-07-23 02:11:25 -07:00
|
|
|
struct vkd3d_shader_code *out, char **messages);
|
|
|
|
typedef void (*PFN_vkd3d_shader_free_messages)(char *messages);
|
2019-02-25 02:59:16 -08:00
|
|
|
typedef void (*PFN_vkd3d_shader_free_shader_code)(struct vkd3d_shader_code *code);
|
|
|
|
|
2019-04-24 07:05:46 -07:00
|
|
|
typedef int (*PFN_vkd3d_shader_parse_root_signature)(const struct vkd3d_shader_code *dxbc,
|
2020-07-30 03:29:57 -07:00
|
|
|
struct vkd3d_shader_versioned_root_signature_desc *root_signature, char **messages);
|
2020-07-22 04:24:12 -07:00
|
|
|
typedef void (*PFN_vkd3d_shader_free_root_signature)(struct vkd3d_shader_versioned_root_signature_desc *root_signature);
|
2019-04-19 02:07:31 -07:00
|
|
|
|
2019-04-24 07:05:46 -07:00
|
|
|
typedef int (*PFN_vkd3d_shader_serialize_root_signature)(
|
2020-07-30 03:29:58 -07:00
|
|
|
const struct vkd3d_shader_versioned_root_signature_desc *root_signature,
|
|
|
|
struct vkd3d_shader_code *dxbc, char **messages);
|
2019-04-22 01:58:33 -07:00
|
|
|
|
2020-07-22 04:24:12 -07:00
|
|
|
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);
|
2019-04-19 02:07:33 -07:00
|
|
|
|
2020-07-30 03:29:55 -07:00
|
|
|
typedef int (*PFN_vkd3d_shader_scan)(const struct vkd3d_shader_compile_info *compile_info, char **messages);
|
|
|
|
typedef void (*PFN_vkd3d_shader_free_scan_descriptor_info)(
|
|
|
|
struct vkd3d_shader_scan_descriptor_info *scan_descriptor_info);
|
2019-02-25 02:59:16 -08:00
|
|
|
|
|
|
|
typedef int (*PFN_vkd3d_shader_parse_input_signature)(const struct vkd3d_shader_code *dxbc,
|
2020-07-30 03:29:56 -07:00
|
|
|
struct vkd3d_shader_signature *signature, char **messages);
|
2019-02-25 02:59:16 -08:00
|
|
|
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);
|
|
|
|
typedef void (*PFN_vkd3d_shader_free_shader_signature)(struct vkd3d_shader_signature *signature);
|
|
|
|
|
2017-06-16 13:38:21 -07:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif /* __cplusplus */
|
|
|
|
|
|
|
|
#endif /* __VKD3D_SHADER_H */
|