mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-09-12 18:50:22 -07:00
vkd3d-shader: Introduce VKD3D_SHADER_COMPILE_OPTION_API_VERSION.
Analogous to vkd3d_api_version for libvkd3d. Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
committed by
Alexandre Julliard
parent
f5c4c06090
commit
22b02ed59f
@@ -158,7 +158,7 @@ HRESULT WINAPI D3DCompile2(const void *data, SIZE_T data_size, const char *filen
|
||||
{
|
||||
struct vkd3d_shader_preprocess_info preprocess_info;
|
||||
struct vkd3d_shader_hlsl_source_info hlsl_info;
|
||||
struct vkd3d_shader_compile_option options[1];
|
||||
struct vkd3d_shader_compile_option options[2];
|
||||
struct vkd3d_shader_compile_info compile_info;
|
||||
struct vkd3d_shader_compile_option *option;
|
||||
struct vkd3d_shader_code byte_code;
|
||||
@@ -208,6 +208,10 @@ HRESULT WINAPI D3DCompile2(const void *data, SIZE_T data_size, const char *filen
|
||||
if (messages_blob)
|
||||
*messages_blob = NULL;
|
||||
|
||||
option = &options[0];
|
||||
option->name = VKD3D_SHADER_COMPILE_OPTION_API_VERSION;
|
||||
option->value = VKD3D_SHADER_API_VERSION_1_3;
|
||||
|
||||
compile_info.type = VKD3D_SHADER_STRUCTURE_TYPE_COMPILE_INFO;
|
||||
compile_info.next = &preprocess_info;
|
||||
compile_info.source.code = data;
|
||||
@@ -215,7 +219,7 @@ HRESULT WINAPI D3DCompile2(const void *data, SIZE_T data_size, const char *filen
|
||||
compile_info.source_type = VKD3D_SHADER_SOURCE_HLSL;
|
||||
compile_info.target_type = VKD3D_SHADER_TARGET_DXBC_TPF;
|
||||
compile_info.options = options;
|
||||
compile_info.option_count = 0;
|
||||
compile_info.option_count = 1;
|
||||
compile_info.log_level = VKD3D_SHADER_LOG_INFO;
|
||||
compile_info.source_name = filename;
|
||||
|
||||
@@ -310,6 +314,11 @@ HRESULT WINAPI D3DPreprocess(const void *data, SIZE_T size, const char *filename
|
||||
HRESULT hr;
|
||||
int ret;
|
||||
|
||||
static const struct vkd3d_shader_compile_option options[] =
|
||||
{
|
||||
{VKD3D_SHADER_COMPILE_OPTION_API_VERSION, VKD3D_SHADER_API_VERSION_1_3},
|
||||
};
|
||||
|
||||
TRACE("data %p, size %lu, filename %s, macros %p, include %p, preprocessed_blob %p, messages_blob %p.\n",
|
||||
data, size, debugstr_a(filename), macros, include, preprocessed_blob, messages_blob);
|
||||
|
||||
@@ -322,8 +331,8 @@ HRESULT WINAPI D3DPreprocess(const void *data, SIZE_T size, const char *filename
|
||||
compile_info.source.size = size;
|
||||
compile_info.source_type = VKD3D_SHADER_SOURCE_HLSL;
|
||||
compile_info.target_type = VKD3D_SHADER_TARGET_NONE;
|
||||
compile_info.options = NULL;
|
||||
compile_info.option_count = 0;
|
||||
compile_info.options = options;
|
||||
compile_info.option_count = ARRAY_SIZE(options);
|
||||
compile_info.log_level = VKD3D_SHADER_LOG_INFO;
|
||||
compile_info.source_name = filename;
|
||||
|
||||
|
||||
@@ -1768,6 +1768,11 @@ static HRESULT create_shader_stage(struct d3d12_device *device,
|
||||
VkResult vr;
|
||||
int ret;
|
||||
|
||||
static const struct vkd3d_shader_compile_option options[] =
|
||||
{
|
||||
{VKD3D_SHADER_COMPILE_OPTION_API_VERSION, VKD3D_SHADER_API_VERSION_1_3},
|
||||
};
|
||||
|
||||
stage_desc->sType = VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO;
|
||||
stage_desc->pNext = NULL;
|
||||
stage_desc->flags = 0;
|
||||
@@ -1785,8 +1790,8 @@ static HRESULT create_shader_stage(struct d3d12_device *device,
|
||||
compile_info.source.size = code->BytecodeLength;
|
||||
compile_info.source_type = VKD3D_SHADER_SOURCE_DXBC_TPF;
|
||||
compile_info.target_type = VKD3D_SHADER_TARGET_SPIRV_BINARY;
|
||||
compile_info.options = NULL;
|
||||
compile_info.option_count = 0;
|
||||
compile_info.options = options;
|
||||
compile_info.option_count = ARRAY_SIZE(options);
|
||||
compile_info.log_level = VKD3D_SHADER_LOG_NONE;
|
||||
compile_info.source_name = NULL;
|
||||
|
||||
@@ -1814,14 +1819,19 @@ static int vkd3d_scan_dxbc(const D3D12_SHADER_BYTECODE *code,
|
||||
{
|
||||
struct vkd3d_shader_compile_info compile_info;
|
||||
|
||||
static const struct vkd3d_shader_compile_option options[] =
|
||||
{
|
||||
{VKD3D_SHADER_COMPILE_OPTION_API_VERSION, VKD3D_SHADER_API_VERSION_1_3},
|
||||
};
|
||||
|
||||
compile_info.type = VKD3D_SHADER_STRUCTURE_TYPE_COMPILE_INFO;
|
||||
compile_info.next = descriptor_info;
|
||||
compile_info.source.code = code->pShaderBytecode;
|
||||
compile_info.source.size = code->BytecodeLength;
|
||||
compile_info.source_type = VKD3D_SHADER_SOURCE_DXBC_TPF;
|
||||
compile_info.target_type = VKD3D_SHADER_TARGET_SPIRV_BINARY;
|
||||
compile_info.options = NULL;
|
||||
compile_info.option_count = 0;
|
||||
compile_info.options = options;
|
||||
compile_info.option_count = ARRAY_SIZE(options);
|
||||
compile_info.log_level = VKD3D_SHADER_LOG_NONE;
|
||||
compile_info.source_name = NULL;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user