From 0c33f82f72c800f5925a55910e06a35de8197473 Mon Sep 17 00:00:00 2001 From: Henri Verbeet Date: Wed, 6 Dec 2023 12:00:00 +0100 Subject: [PATCH] Release 1.10. --- ANNOUNCE | 190 ++++++++++++++++++---------- AUTHORS | 3 + Makefile.am | 6 +- configure.ac | 2 +- demos/demo_xcb.h | 2 +- include/vkd3d.h | 1 + include/vkd3d_shader.h | 1 + libs/vkd3d-shader/spirv.c | 2 +- libs/vkd3d-utils/vkd3d_utils_main.c | 4 +- libs/vkd3d/state.c | 6 +- programs/vkd3d-compiler/main.c | 2 +- tests/shader_runner_gl.c | 2 +- 12 files changed, 139 insertions(+), 82 deletions(-) diff --git a/ANNOUNCE b/ANNOUNCE index 286ca0b2..053d668f 100644 --- a/ANNOUNCE +++ b/ANNOUNCE @@ -1,103 +1,155 @@ -The Wine team is proud to announce that release 1.9 of vkd3d, the Direct3D to +The Wine team is proud to announce that release 1.10 of vkd3d, the Direct3D to Vulkan translation library, is now available. This release contains improvements that are listed in the release notes below. The main highlights are: - - Yet more improvements to the HLSL compiler. - - A new utility to inspect the contents of DXBC blobs. + - libvkd3d exposes various newer Direct3D 12 interfaces. + - The HLSL compiler supports dynamic indexing of arrays. + - libvkd3d-utils implements various helper functions for manipulating DXBC + blobs. - Miscellaneous bug fixes. The source is available from the following location: - https://dl.winehq.org/vkd3d/source/vkd3d-1.9.tar.xz + The current source can also be pulled directly from the git repository: - https://gitlab.winehq.org/wine/vkd3d.git + Vkd3d is available thanks to the work of multiple people. See the file AUTHORS for the complete list. ----------------------------------------------------------------- +# What's new in vkd3d 1.10 -What's new in vkd3d 1.9 -======================= +### libvkd3d + - Creating pipeline state objects from pipeline state stream descriptions is + implemented. + - Depth-bounds testing is implemented. + - When the VK\_KHR\_maintenance2 extension is available, libvkd3d will + explicitly specify the usage flags of Vulkan image views. This is + particularly useful on MoltenVK, where 2D-array views of 3D textures are + subject to usage restrictions. + - The D3D12\_FORMAT\_SUPPORT2\_UAV\_TYPED\_LOAD and/or + D3D12\_FORMAT\_SUPPORT2\_UAV\_TYPED\_STORE feature flags are reported for + UAV formats when the ‘shaderStorageImageReadWithoutFormat’ and/or + ‘shaderStorageImageWriteWithoutFormat’ Vulkan device features are + supported. + - The ID3D12Device5 interface is supported. + - The ID3D12GraphicsCommandList5 interface is supported. + - The ID3D12Resource1 interface is supported. -*** libvkd3d +### libvkd3d-shader -- Copying between depth/stencil and colour formats in - ID3D12GraphicsCommandList::CopyResource() is supported. -- The ID3D12Fence1 interface is supported. + - New features for the HLSL source type: + - Support for the following intrinsic functions: + - ceil() + - degrees() and radians() + - fwidth() + - tan() + - tex2Dlod(), tex2Dproj(), texCUBEproj(), and tex3Dproj() + - Constant folding support for more expression types. In particular: + - ternary operators and branches + - reciprocal square roots + - exponentials + - logical ‘not’ on booleans + - bitwise complements + - left/right shifts + - ceil(), floor(), frac(), and saturate() + - Support for dynamic indexing of arrays. + - Support for ‘break’ and ‘continue’ statements. + - Support for ‘switch’ statements. + - The ‘linear’, ‘centroid’, and ‘noperspective’ interpolation modifiers + are supported. + - The ‘RWTexture1DArray’ and ‘RWTexture2DArray’ unordered access view + types are supported. + - ‘\[loop\]’ attributes are accepted on loops. + - u/U and l/L suffixes on integer constants. + - Floating-point values are explicitly clamped to the upper and lower bounds + of the target type by ‘ftoi’ and ‘ftou’ instructions when targeting + SPIR-V. Similarly, NaNs are flushed to zero. Some hardware/drivers would + already do this implicitly, but behaviour for such inputs is undefined as + far as SPIR-V is concerned. -*** libvkd3d-shader + - The VKD3D\_SHADER\_CONFIG environment variable can be used to modify the + behaviour of libvkd3d-shader at run-time, analogous to the existing + VKD3D\_CONFIG environment variable for libvkd3d. See the README for a list + of supported options. -- vkd3d_shader_scan() supports retrieving descriptor information for `d3dbc' - shaders. This is one of the requirements for eventual SPIR-V generation from - `d3dbc' sources. + - When scanning legacy Direct3D bytecode using vkd3d\_shader\_scan(), + descriptor information for shader model 2 and 3 combined resource-sampler + pairs is returned in the vkd3d\_shader\_scan\_descriptor\_info structure. + Note that this information is not yet available for shader model 1 + sources, although this will likely be added in a future release. -- New features for the HLSL source type: - - Support for the following intrinsic functions: - - clip() - - ddx_coarse() and ddy_coarse() - - ddx_fine() and ddy_fine() - - tex1D(), tex2D(), texCUBE(), and tex3D() - - Constant folding support for more expression types. In particular: - - comparison operators - - floating-point min() and max() - - logical `and' and `or' - - dot products - - square roots - - logarithms - - Support for multi-sample texture object declarations without explicit - sample counts in shader model 4.1 and later shaders. - - Support for using constant expressions as sample counts in multi-sample - texture object declarations. - - Support for variable initialisers using variables declared earlier in the - same declaration list. E.g., `float a = 1, b = a, c = b + 1;'. - - The GetDimensions() texture object method is implemented. - - Matrix swizzles are implemented. - - Parser support for if-statement attributes like `[branch]' and - `[flatten]'. - - Support for the `inline' function modifier. + - The Direct3D shader assembly target supports the ‘rasteriser ordered view’ + flag (‘\_rov’) on unordered access view declarations. -- Previously, vkd3d_shader_compile() would in some cases return VKD3D_OK - despite compilation failing when targeting legacy Direct3D bytecode. These - cases have been fixed. + - New interfaces: + - The VKD3D\_SHADER\_COMPILE\_OPTION\_BACKWARD\_COMPATIBILITY compile + option can be used to specify backward compatibility options. The + VKD3D\_SHADER\_COMPILE\_OPTION\_BACKCOMPAT\_MAP\_SEMANTIC\_NAMES flag is + the only currently supported flag, and can be used to specify that + shader model 1-3 semantic names should be mapped to their shader model + 4+ system value equivalents when compiling HLSL sources. + - The VKD3D\_SHADER\_COMPILE\_OPTION\_FRAGMENT\_COORDINATE\_ORIGIN compile + option can be used to specify the origin of fragment coordinates for + SPIR-V targets. This is especially useful in OpenGL environments, where + the origin may be different than in Direct3D or Vulkan environments. + - The vkd3d\_shader\_scan\_combined\_resource\_sampler\_info structure + extends the vkd3d\_shader\_compile\_info structure, and can be used to + retrieve information about the combined resource-sampler pairs used by a + shader. This is especially useful when compiling shaders for usage in + environments without separate binding points for samplers and resources, + like OpenGL. + - vkd3d\_shader\_free\_scan\_combined\_resource\_sampler\_info() is used + to free vkd3d\_shader\_scan\_combined\_resource\_sampler\_info + structures. -- Various HLSL preprocessor fixes for edge cases related to stringification. +### libvkd3d-utils -- SPIR-V target support for the `linear noperspective centroid' input - interpolation mode. + - Passing the D3DCOMPILE\_ENABLE\_BACKWARDS\_COMPATIBILITY flag to + D3DCompile() and D3DCompile2() will enable mapping shader model 1-3 + semantic names to their shader model 4+ system value equivalents. -- New interfaces: - - The vkd3d_shader_scan_signature_info structure extends the - vkd3d_shader_compile_info structure, and can be used to retrieve - descriptions of `dxbc-tpf' and `d3dbc' shader inputs and outputs. - - vkd3d_shader_free_scan_signature_info() is used to free - vkd3d_shader_scan_signature_info structures. - - The VKD3D_SHADER_COMPILE_OPTION_PACK_MATRIX_ORDER compile option can be - used to specify the default matrix packing order for HLSL sources. - - The vkd3d_shader_varying_map_info structure extends the - vkd3d_shader_compile_info structure, and can be used to specify a mapping - between the outputs of a shader stage and the inputs of the next shader - stage. - - vkd3d_shader_build_varying_map() is used to build a mapping between the - outputs of a shader stage and the inputs of the next shader stage. - - The VKD3D_SHADER_DESCRIPTOR_INFO_FLAG_RAW_BUFFER flag returned as part of - the vkd3d_shader_descriptor_info structure indicates the descriptor refers - to a byte-addressed (`raw') buffer resource. + - New interfaces: + - D3DGetBlobPart() is used to retrieve specific parts of DXBC blobs. + - D3DGetDebugInfo() is used to retrieve debug information from DXBC blobs. + - D3DGetInputAndOutputSignatureBlob() is used to retrieve input and output + signatures from DXBC blobs. + - D3DGetInputSignatureBlob() is used to retrieve input signatures from + DXBC blobs. + - D3DGetOutputSignatureBlob() is used to retrieve output signatures from + DXBC blobs. + - D3DStripShader() is used to remove specific parts from DXBC blobs. +### vkd3d-compiler -*** vkd3d-compiler + - The ‘--fragment-coordinate-origin’ option can be used to specify the + origin of fragment coordinates for SPIR-V targets. -- The `--matrix-storage-order' option can used to specify the default matrix - storage order for HLSL sources. + - The ‘--semantic-compat-map’ option can be used to specify that shader + model 1-3 semantic names should be mapped to their shader model 4+ system + value equivalents when compiling HLSL sources. +### vkd3d-dxbc -*** vkd3d-dxbc + - The ‘--list’ and ‘--list-data’ options now also output the offsets of + sections inside the input data. -- vkd3d-dxbc is a new utility that can be used to inspect the contents of DXBC - blobs. +### build + + - The minimum required version of Vulkan-Headers for this release is version + 1.2.148. + + - When available, the libEGL and libOpenGL libraries are used to run the + vkd3d tests in additional configurations. These libraries are not used by + vkd3d itself. + + - The SONAME\_LIBDXCOMPILER configure variable can be used specify the + shared object name of the dxcompiler library. When available, it's used to + run the vkd3d tests in additional configurations. The dxcompiler library + is not used by vkd3d itself. diff --git a/AUTHORS b/AUTHORS index 2dc8e8c3..5f285220 100644 --- a/AUTHORS +++ b/AUTHORS @@ -1,3 +1,4 @@ +Akihiro Sagawa Alexandre Julliard Alistair Leslie-Hughes Andrew Eikum @@ -18,6 +19,7 @@ Giovanni Mascellani Hans-Kristian Arntzen Henri Verbeet Isabella Bosia +Jacek Caban Jactry Zeng Jan Sikorski Joshua Ashton @@ -25,6 +27,7 @@ Józef Kucia Martin Storsjö Matteo Bruni Nikolay Sivov +Petrichor Park Philip Rebohle Rémi Bernon Robin Kertels diff --git a/Makefile.am b/Makefile.am index d7696122..23e7add3 100644 --- a/Makefile.am +++ b/Makefile.am @@ -307,7 +307,7 @@ libvkd3d_shader_la_SOURCES = \ libs/vkd3d-shader/vkd3d_shader_main.c \ libs/vkd3d-shader/vkd3d_shader_private.h libvkd3d_shader_la_CFLAGS = $(AM_CFLAGS) -DLIBVKD3D_SHADER_SOURCE -I$(srcdir)/libs/vkd3d-shader @SPIRV_TOOLS_CFLAGS@ -libvkd3d_shader_la_LDFLAGS = $(AM_LDFLAGS) -version-info 8:0:7 +libvkd3d_shader_la_LDFLAGS = $(AM_LDFLAGS) -version-info 9:0:8 libvkd3d_shader_la_LIBADD = libvkd3d-common.la @SPIRV_TOOLS_LIBS@ -lm if HAVE_LD_VERSION_SCRIPT libvkd3d_shader_la_LDFLAGS += -Wl,--version-script=$(srcdir)/libs/vkd3d-shader/vkd3d_shader.map @@ -342,7 +342,7 @@ libvkd3d_la_SOURCES = \ libs/vkd3d/vkd3d_shaders.h \ libs/vkd3d/vulkan_procs.h libvkd3d_la_CFLAGS = $(AM_CFLAGS) -DLIBVKD3D_SOURCE -libvkd3d_la_LDFLAGS = $(AM_LDFLAGS) -version-info 10:0:9 +libvkd3d_la_LDFLAGS = $(AM_LDFLAGS) -version-info 11:0:10 libvkd3d_la_LIBADD = libvkd3d-common.la libvkd3d-shader.la @DL_LIBS@ @PTHREAD_LIBS@ if HAVE_LD_VERSION_SCRIPT libvkd3d_la_LDFLAGS += -Wl,--version-script=$(srcdir)/libs/vkd3d/vkd3d.map @@ -354,7 +354,7 @@ libvkd3d_utils_la_SOURCES = \ libs/vkd3d-utils/vkd3d_utils_main.c \ libs/vkd3d-utils/vkd3d_utils_private.h libvkd3d_utils_la_CFLAGS = $(AM_CFLAGS) -DLIBVKD3D_UTILS_SOURCE -libvkd3d_utils_la_LDFLAGS = $(AM_LDFLAGS) -version-info 4:5:3 +libvkd3d_utils_la_LDFLAGS = $(AM_LDFLAGS) -version-info 5:0:4 libvkd3d_utils_la_LIBADD = libvkd3d-common.la libvkd3d-shader.la libvkd3d.la @PTHREAD_LIBS@ if HAVE_LD_VERSION_SCRIPT libvkd3d_utils_la_LDFLAGS += -Wl,--version-script=$(srcdir)/libs/vkd3d-utils/vkd3d_utils.map diff --git a/configure.ac b/configure.ac index 6cd9d9b7..1b6003b0 100644 --- a/configure.ac +++ b/configure.ac @@ -1,5 +1,5 @@ AC_PREREQ([2.69]) -AC_INIT([vkd3d],[1.9]) +AC_INIT([vkd3d],[1.10]) AC_CONFIG_AUX_DIR([bin]) AC_CONFIG_MACRO_DIR([m4]) diff --git a/demos/demo_xcb.h b/demos/demo_xcb.h index 6eb3dc93..8a58d8ae 100644 --- a/demos/demo_xcb.h +++ b/demos/demo_xcb.h @@ -19,7 +19,7 @@ #define VK_NO_PROTOTYPES #define VK_USE_PLATFORM_XCB_KHR -#define VKD3D_UTILS_API_VERSION VKD3D_API_VERSION_1_9 +#define VKD3D_UTILS_API_VERSION VKD3D_API_VERSION_1_10 #include "config.h" #include #include diff --git a/include/vkd3d.h b/include/vkd3d.h index ef426898..a3bb8e0d 100644 --- a/include/vkd3d.h +++ b/include/vkd3d.h @@ -78,6 +78,7 @@ enum vkd3d_api_version VKD3D_API_VERSION_1_7, VKD3D_API_VERSION_1_8, VKD3D_API_VERSION_1_9, + VKD3D_API_VERSION_1_10, VKD3D_FORCE_32_BIT_ENUM(VKD3D_API_VERSION), }; diff --git a/include/vkd3d_shader.h b/include/vkd3d_shader.h index c43b619d..290f9085 100644 --- a/include/vkd3d_shader.h +++ b/include/vkd3d_shader.h @@ -51,6 +51,7 @@ enum vkd3d_shader_api_version VKD3D_SHADER_API_VERSION_1_7, VKD3D_SHADER_API_VERSION_1_8, VKD3D_SHADER_API_VERSION_1_9, + VKD3D_SHADER_API_VERSION_1_10, VKD3D_FORCE_32_BIT_ENUM(VKD3D_SHADER_API_VERSION), }; diff --git a/libs/vkd3d-shader/spirv.c b/libs/vkd3d-shader/spirv.c index f72875e1..956389dc 100644 --- a/libs/vkd3d-shader/spirv.c +++ b/libs/vkd3d-shader/spirv.c @@ -231,7 +231,7 @@ static inline bool register_is_constant_or_undef(const struct vkd3d_shader_regis #define VKD3D_SPIRV_VERSION 0x00010000 #define VKD3D_SPIRV_GENERATOR_ID 18 -#define VKD3D_SPIRV_GENERATOR_VERSION 9 +#define VKD3D_SPIRV_GENERATOR_VERSION 10 #define VKD3D_SPIRV_GENERATOR_MAGIC vkd3d_make_u32(VKD3D_SPIRV_GENERATOR_VERSION, VKD3D_SPIRV_GENERATOR_ID) struct vkd3d_spirv_stream diff --git a/libs/vkd3d-utils/vkd3d_utils_main.c b/libs/vkd3d-utils/vkd3d_utils_main.c index 306674cd..a2edf403 100644 --- a/libs/vkd3d-utils/vkd3d_utils_main.c +++ b/libs/vkd3d-utils/vkd3d_utils_main.c @@ -239,7 +239,7 @@ HRESULT WINAPI D3DCompile2(const void *data, SIZE_T data_size, const char *filen option = &options[0]; option->name = VKD3D_SHADER_COMPILE_OPTION_API_VERSION; - option->value = VKD3D_SHADER_API_VERSION_1_9; + option->value = VKD3D_SHADER_API_VERSION_1_10; compile_info.type = VKD3D_SHADER_STRUCTURE_TYPE_COMPILE_INFO; compile_info.next = &preprocess_info; @@ -362,7 +362,7 @@ HRESULT WINAPI D3DPreprocess(const void *data, SIZE_T size, const char *filename static const struct vkd3d_shader_compile_option options[] = { - {VKD3D_SHADER_COMPILE_OPTION_API_VERSION, VKD3D_SHADER_API_VERSION_1_9}, + {VKD3D_SHADER_COMPILE_OPTION_API_VERSION, VKD3D_SHADER_API_VERSION_1_10}, }; TRACE("data %p, size %lu, filename %s, macros %p, include %p, preprocessed_blob %p, messages_blob %p.\n", diff --git a/libs/vkd3d/state.c b/libs/vkd3d/state.c index 6665a1fd..fc3187f4 100644 --- a/libs/vkd3d/state.c +++ b/libs/vkd3d/state.c @@ -2142,7 +2142,7 @@ static HRESULT create_shader_stage(struct d3d12_device *device, const struct vkd3d_shader_compile_option options[] = { - {VKD3D_SHADER_COMPILE_OPTION_API_VERSION, VKD3D_SHADER_API_VERSION_1_9}, + {VKD3D_SHADER_COMPILE_OPTION_API_VERSION, VKD3D_SHADER_API_VERSION_1_10}, {VKD3D_SHADER_COMPILE_OPTION_TYPED_UAV, typed_uav_compile_option(device)}, {VKD3D_SHADER_COMPILE_OPTION_WRITE_TESS_GEOM_POINT_SIZE, 0}, }; @@ -2196,7 +2196,7 @@ static int vkd3d_scan_dxbc(const struct d3d12_device *device, const D3D12_SHADER const struct vkd3d_shader_compile_option options[] = { - {VKD3D_SHADER_COMPILE_OPTION_API_VERSION, VKD3D_SHADER_API_VERSION_1_9}, + {VKD3D_SHADER_COMPILE_OPTION_API_VERSION, VKD3D_SHADER_API_VERSION_1_10}, {VKD3D_SHADER_COMPILE_OPTION_TYPED_UAV, typed_uav_compile_option(device)}, }; @@ -3855,7 +3855,7 @@ static int compile_hlsl_cs(const struct vkd3d_shader_code *hlsl, struct vkd3d_sh static const struct vkd3d_shader_compile_option options[] = { - {VKD3D_SHADER_COMPILE_OPTION_API_VERSION, VKD3D_SHADER_API_VERSION_1_9}, + {VKD3D_SHADER_COMPILE_OPTION_API_VERSION, VKD3D_SHADER_API_VERSION_1_10}, }; info.type = VKD3D_SHADER_STRUCTURE_TYPE_COMPILE_INFO; diff --git a/programs/vkd3d-compiler/main.c b/programs/vkd3d-compiler/main.c index 4409d250..9af22823 100644 --- a/programs/vkd3d-compiler/main.c +++ b/programs/vkd3d-compiler/main.c @@ -827,7 +827,7 @@ int main(int argc, char **argv) if (!options.explicit_colour && !getenv("NO_COLOUR") && !getenv("NO_COLOR") && has_colour(output)) options.formatting |= VKD3D_SHADER_COMPILE_OPTION_FORMATTING_COLOUR; add_compile_option(&options, VKD3D_SHADER_COMPILE_OPTION_FORMATTING, options.formatting); - add_compile_option(&options, VKD3D_SHADER_COMPILE_OPTION_API_VERSION, VKD3D_SHADER_API_VERSION_1_9); + add_compile_option(&options, VKD3D_SHADER_COMPILE_OPTION_API_VERSION, VKD3D_SHADER_API_VERSION_1_10); info.type = VKD3D_SHADER_STRUCTURE_TYPE_COMPILE_INFO; info.next = &hlsl_source_info; diff --git a/tests/shader_runner_gl.c b/tests/shader_runner_gl.c index 8db0ed68..9a3dd710 100644 --- a/tests/shader_runner_gl.c +++ b/tests/shader_runner_gl.c @@ -417,7 +417,7 @@ static bool compile_shader(struct gl_runner *runner, ID3DBlob *blob, struct vkd3 static const struct vkd3d_shader_compile_option options[] = { - {VKD3D_SHADER_COMPILE_OPTION_API_VERSION, VKD3D_SHADER_API_VERSION_1_9}, + {VKD3D_SHADER_COMPILE_OPTION_API_VERSION, VKD3D_SHADER_API_VERSION_1_10}, {VKD3D_SHADER_COMPILE_OPTION_FRAGMENT_COORDINATE_ORIGIN, VKD3D_SHADER_COMPILE_OPTION_FRAGMENT_COORDINATE_ORIGIN_LOWER_LEFT}, };