This requires !423.
-- v3: gitlab: Expect builds to always succeed, even when tests are allowed to fail. include: Import vkd3d_d3dcompiler.h instead of redefining D3D_BLOB_PART. ci: Make the MoltenVK logging less verbose. vkd3d-shader: Explicitly cast vkd3d_shader_global_flags to uint64_t. ci: Allow the artifact copy to fail.
From: Giovanni Mascellani gmascellani@codeweavers.com
If the build fail some artifact files might not exist, and we don't want the script to fail just because of that. --- gitlab/build-crosstest | 2 +- gitlab/build-linux | 2 +- gitlab/build-mac | 2 +- gitlab/build-mingw | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/gitlab/build-crosstest b/gitlab/build-crosstest index 4a1341a09..584008fea 100755 --- a/gitlab/build-crosstest +++ b/gitlab/build-crosstest @@ -19,6 +19,6 @@ cd build touch ../pipeline_failed
mkdir -p ../artifacts/$COMMIT -rsync -Rr config.log tests/*.exe ../artifacts/$COMMIT +rsync -Rr config.log tests/*.exe ../artifacts/$COMMIT || true
git reset --hard diff --git a/gitlab/build-linux b/gitlab/build-linux index ee00e61ef..545601bcc 100755 --- a/gitlab/build-linux +++ b/gitlab/build-linux @@ -18,6 +18,6 @@ export LD_LIBRARY_PATH=/usr/local/lib touch ../pipeline_failed
mkdir -p ../artifacts/$COMMIT -rsync -Rr config.log doc/* test-suite.log tests/*.log tests/*/*.log ../artifacts/$COMMIT +rsync -Rr config.log doc/* test-suite.log tests/*.log tests/*/*.log ../artifacts/$COMMIT || true
git reset --hard diff --git a/gitlab/build-mac b/gitlab/build-mac index 854bc8e33..6a795d02f 100755 --- a/gitlab/build-mac +++ b/gitlab/build-mac @@ -17,6 +17,6 @@ cd build touch ../pipeline_failed
mkdir -p ../artifacts/$COMMIT -rsync -Rr config.log test-suite.log tests/*.log tests/*/*.log ../artifacts/$COMMIT +rsync -Rr config.log test-suite.log tests/*.log tests/*/*.log ../artifacts/$COMMIT || true
git reset --hard diff --git a/gitlab/build-mingw b/gitlab/build-mingw index 1334a18a7..0886de2ca 100755 --- a/gitlab/build-mingw +++ b/gitlab/build-mingw @@ -19,7 +19,7 @@ cp -r /usr/include/vulkan /usr/include/vk_video /usr/include/spirv vulkan-header touch ../pipeline_failed
mkdir -p ../artifacts/$COMMIT -cp config.log ../artifacts/$COMMIT -cp destdir/usr/local/bin/* ../artifacts/$COMMIT +cp config.log ../artifacts/$COMMIT || true +cp destdir/usr/local/bin/* ../artifacts/$COMMIT || true
git reset --hard
From: Giovanni Mascellani gmascellani@codeweavers.com
On macOS vkd3d_shader_global_flags has underlying type unsigned long, while uint64_t is defined as unsigned long long. This difference causes a few warnings to be raised. --- libs/vkd3d-shader/d3d_asm.c | 2 +- libs/vkd3d-shader/dxil.c | 2 +- libs/vkd3d-shader/spirv.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/libs/vkd3d-shader/d3d_asm.c b/libs/vkd3d-shader/d3d_asm.c index 40daa5354..5453d432f 100644 --- a/libs/vkd3d-shader/d3d_asm.c +++ b/libs/vkd3d-shader/d3d_asm.c @@ -424,7 +424,7 @@ static void shader_dump_global_flags(struct vkd3d_d3d_asm_compiler *compiler, }
if (global_flags) - vkd3d_string_buffer_printf(&compiler->buffer, "unknown_flags(%#"PRIx64")", global_flags); + vkd3d_string_buffer_printf(&compiler->buffer, "unknown_flags(%#"PRIx64")", (uint64_t)global_flags); }
static void shader_dump_sync_flags(struct vkd3d_d3d_asm_compiler *compiler, uint32_t sync_flags) diff --git a/libs/vkd3d-shader/dxil.c b/libs/vkd3d-shader/dxil.c index 19ce2936a..0e29f6652 100644 --- a/libs/vkd3d-shader/dxil.c +++ b/libs/vkd3d-shader/dxil.c @@ -3857,7 +3857,7 @@ static void sm6_parser_emit_global_flags(struct sm6_parser *sm6, const struct sm enum vkd3d_shader_global_flags global_flags, mask, rotated_flags; struct vkd3d_shader_instruction *ins;
- if (!sm6_metadata_get_uint64_value(sm6, m, &global_flags)) + if (!sm6_metadata_get_uint64_value(sm6, m, (uint64_t*)&global_flags)) { WARN("Failed to load global flags.\n"); vkd3d_shader_parser_error(&sm6->p, VKD3D_SHADER_ERROR_DXIL_INVALID_PROPERTIES, diff --git a/libs/vkd3d-shader/spirv.c b/libs/vkd3d-shader/spirv.c index 2dab97ccb..c86efb758 100644 --- a/libs/vkd3d-shader/spirv.c +++ b/libs/vkd3d-shader/spirv.c @@ -5393,9 +5393,9 @@ static void spirv_compiler_emit_dcl_global_flags(struct spirv_compiler *compiler }
if (flags & ~(VKD3DSGF_REFACTORING_ALLOWED | VKD3DSGF_ENABLE_RAW_AND_STRUCTURED_BUFFERS)) - FIXME("Unhandled global flags %#"PRIx64".\n", flags); + FIXME("Unhandled global flags %#"PRIx64".\n", (uint64_t)flags); else - WARN("Unhandled global flags %#"PRIx64".\n", flags); + WARN("Unhandled global flags %#"PRIx64".\n", (uint64_t)flags); }
static void spirv_compiler_emit_temps(struct spirv_compiler *compiler, uint32_t count)
From: Giovanni Mascellani gmascellani@codeweavers.com
--- gitlab/build.yml | 1 + 1 file changed, 1 insertion(+)
diff --git a/gitlab/build.yml b/gitlab/build.yml index 6a260510a..fd2b63ff2 100644 --- a/gitlab/build.yml +++ b/gitlab/build.yml @@ -153,6 +153,7 @@ build-mac: variables: VKD3D_DISABLE_EXTENSIONS: "VK_EXT_descriptor_indexing" VKD3D_SHADER_CONFIG: 'force_validation' + MVK_CONFIG_LOG_LEVEL: 1 artifacts: when: always paths:
From: Giovanni Mascellani gmascellani@codeweavers.com
According to a clang diagnostic, redefining a typedef is C11, and we want to stick with C99. --- Makefile.am | 1 + include/vkd3d_d3dcompiler.h | 23 ++-------------- include/vkd3d_d3dcompiler_types.h | 45 +++++++++++++++++++++++++++++++ include/vkd3d_utils.h | 4 +-- 4 files changed, 49 insertions(+), 24 deletions(-) create mode 100644 include/vkd3d_d3dcompiler_types.h
diff --git a/Makefile.am b/Makefile.am index 2821ddc6f..deac888d7 100644 --- a/Makefile.am +++ b/Makefile.am @@ -24,6 +24,7 @@ vkd3d_public_headers = \ include/vkd3d_d3d9types.h \ include/vkd3d_d3dcommon.h \ include/vkd3d_d3dcompiler.h \ + include/vkd3d_d3dcompiler_types.h \ include/vkd3d_d3dx9shader.h \ include/vkd3d_dxgibase.h \ include/vkd3d_dxgiformat.h \ diff --git a/include/vkd3d_d3dcompiler.h b/include/vkd3d_d3dcompiler.h index 78d529483..c3eccdbd8 100644 --- a/include/vkd3d_d3dcompiler.h +++ b/include/vkd3d_d3dcompiler.h @@ -16,6 +16,8 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */
+#include <vkd3d_d3dcompiler_types.h> + #ifndef __VKD3D_D3DCOMPILER_H #define __VKD3D_D3DCOMPILER_H #ifndef __D3DCOMPILER_H__ @@ -58,27 +60,6 @@ #define D3DCOMPILE_SECDATA_PRESERVE_TEMPLATE_SLOTS 0x00000002 #define D3DCOMPILE_SECDATA_REQUIRE_TEMPLATE_MATCH 0x00000004
-typedef enum D3D_BLOB_PART -{ - D3D_BLOB_INPUT_SIGNATURE_BLOB, - D3D_BLOB_OUTPUT_SIGNATURE_BLOB, - D3D_BLOB_INPUT_AND_OUTPUT_SIGNATURE_BLOB, - D3D_BLOB_PATCH_CONSTANT_SIGNATURE_BLOB, - D3D_BLOB_ALL_SIGNATURE_BLOB, - D3D_BLOB_DEBUG_INFO, - D3D_BLOB_LEGACY_SHADER, - D3D_BLOB_XNA_PREPASS_SHADER, - D3D_BLOB_XNA_SHADER, - D3D_BLOB_PDB, - D3D_BLOB_PRIVATE_DATA, - D3D_BLOB_ROOT_SIGNATURE, - D3D_BLOB_DEBUG_NAME, - D3D_BLOB_TEST_ALTERNATE_SHADER = 0x8000, - D3D_BLOB_TEST_COMPILE_DETAILS, - D3D_BLOB_TEST_COMPILE_PERF, - D3D_BLOB_TEST_COMPILE_REPORT -} D3D_BLOB_PART; - typedef enum D3DCOMPILER_STRIP_FLAGS { D3DCOMPILER_STRIP_REFLECTION_DATA = 0x00000001, diff --git a/include/vkd3d_d3dcompiler_types.h b/include/vkd3d_d3dcompiler_types.h new file mode 100644 index 000000000..b3a47cdd9 --- /dev/null +++ b/include/vkd3d_d3dcompiler_types.h @@ -0,0 +1,45 @@ +/* + * Copyright 2010 Matteo Bruni for CodeWeavers + * + * 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_D3DCOMPILER_TYPES_H +#define __VKD3D_D3DCOMPILER_TYPES_H +#ifndef __D3DCOMPILER_H__ + +typedef enum D3D_BLOB_PART +{ + D3D_BLOB_INPUT_SIGNATURE_BLOB, + D3D_BLOB_OUTPUT_SIGNATURE_BLOB, + D3D_BLOB_INPUT_AND_OUTPUT_SIGNATURE_BLOB, + D3D_BLOB_PATCH_CONSTANT_SIGNATURE_BLOB, + D3D_BLOB_ALL_SIGNATURE_BLOB, + D3D_BLOB_DEBUG_INFO, + D3D_BLOB_LEGACY_SHADER, + D3D_BLOB_XNA_PREPASS_SHADER, + D3D_BLOB_XNA_SHADER, + D3D_BLOB_PDB, + D3D_BLOB_PRIVATE_DATA, + D3D_BLOB_ROOT_SIGNATURE, + D3D_BLOB_DEBUG_NAME, + D3D_BLOB_TEST_ALTERNATE_SHADER = 0x8000, + D3D_BLOB_TEST_COMPILE_DETAILS, + D3D_BLOB_TEST_COMPILE_PERF, + D3D_BLOB_TEST_COMPILE_REPORT +} D3D_BLOB_PART; + +#endif /* __D3DCOMPILER_H__ */ +#endif /* __VKD3D_D3DCOMPILER_TYPES_H */ diff --git a/include/vkd3d_utils.h b/include/vkd3d_utils.h index b5ec79813..686ddf386 100644 --- a/include/vkd3d_utils.h +++ b/include/vkd3d_utils.h @@ -20,6 +20,7 @@ #define __VKD3D_UTILS_H
#include <vkd3d.h> +#include <vkd3d_d3dcompiler_types.h>
#ifndef VKD3D_UTILS_API_VERSION #define VKD3D_UTILS_API_VERSION VKD3D_API_VERSION_1_0 @@ -51,9 +52,6 @@ extern "C" { # define VKD3D_UTILS_API VKD3D_IMPORT #endif
-/** \since 1.10 */ -typedef enum D3D_BLOB_PART D3D_BLOB_PART; - /* 1.0 */ VKD3D_UTILS_API HANDLE vkd3d_create_event(void); VKD3D_UTILS_API HRESULT vkd3d_signal_event(HANDLE event);
From: Giovanni Mascellani gmascellani@codeweavers.com
--- gitlab/build-linux | 9 ++++++--- gitlab/build-mac | 9 ++++++--- gitlab/build.yml | 18 +++++++++++++----- 3 files changed, 25 insertions(+), 11 deletions(-)
diff --git a/gitlab/build-linux b/gitlab/build-linux index 545601bcc..4a8c793b7 100755 --- a/gitlab/build-linux +++ b/gitlab/build-linux @@ -12,10 +12,13 @@ rm -fr build mkdir build cd build export LD_LIBRARY_PATH=/usr/local/lib -../configure --enable-demos DXCOMPILER_LIBS="-L/usr/local/lib" CFLAGS="-g -O2 -Werror" CPPFLAGS="-DVKD3D_SHADER_UNSUPPORTED_DXIL" && \ - make -j$(nproc) && \ +if ../configure --enable-demos DXCOMPILER_LIBS="-L/usr/local/lib" CFLAGS="-g -O2 -Werror" CPPFLAGS="-DVKD3D_SHADER_UNSUPPORTED_DXIL" && \ + make -j$(nproc) ; then make -j$(nproc) check || \ - touch ../pipeline_failed + touch ../tests_failed +else + touch ../build_failed +fi
mkdir -p ../artifacts/$COMMIT rsync -Rr config.log doc/* test-suite.log tests/*.log tests/*/*.log ../artifacts/$COMMIT || true diff --git a/gitlab/build-mac b/gitlab/build-mac index 6a795d02f..27c70d316 100755 --- a/gitlab/build-mac +++ b/gitlab/build-mac @@ -11,10 +11,13 @@ set -Eeuxo pipefail rm -fr build mkdir build cd build -../configure CFLAGS="-g -O2 -Wno-implicit-fallthrough -Wno-enum-conversion -Werror" && \ - make -j$(sysctl -n hw.ncpu) && \ +if ../configure CFLAGS="-g -O2 -Wno-implicit-fallthrough -Wno-enum-conversion -Werror" && \ + make -j$(sysctl -n hw.ncpu) ; then make -j$(sysctl -n hw.ncpu) check || \ - touch ../pipeline_failed + touch ../tests_failed +else + touch ../build_failed +fi
mkdir -p ../artifacts/$COMMIT rsync -Rr config.log test-suite.log tests/*.log tests/*/*.log ../artifacts/$COMMIT || true diff --git a/gitlab/build.yml b/gitlab/build.yml index fd2b63ff2..9695a3042 100644 --- a/gitlab/build.yml +++ b/gitlab/build.yml @@ -18,7 +18,8 @@ - cat /proc/meminfo > artifacts/meminfo.txt - vulkaninfo > artifacts/vulkaninfo.txt - git rebase $CI_MERGE_REQUEST_DIFF_BASE_SHA --exec ./gitlab/build-linux - - if [ -f pipeline_failed ] ; then exit 1 ; fi + - if [ -f build_failed ] ; then exit 1 ; fi + - if [ -f tests_failed ] ; then exit 2 ; fi artifacts: when: always paths: @@ -34,7 +35,9 @@ build-radv-64:
build-llvmpipe-64: extends: .build-linux - allow_failure: true + allow_failure: + exit_codes: + - 2 variables: VK_LOADER_DRIVERS_SELECT: 'lvp_*' VKD3D_SHADER_CONFIG: 'force_validation' @@ -50,7 +53,9 @@ build-radv-32:
build-llvmpipe-32: extends: .build-linux - allow_failure: true + allow_failure: + exit_codes: + - 2 variables: VK_LOADER_DRIVERS_SELECT: 'lvp_*' CC: 'gcc -m32' @@ -121,7 +126,9 @@ build-mac: stage: build rules: - if: $CI_PIPELINE_SOURCE == 'merge_request_event' - allow_failure: true + allow_failure: + exit_codes: + - 2 interruptible: true needs: [] dependencies: [] @@ -149,7 +156,8 @@ build-mac: - cd ../.. - export PATH="$PWD/wine/build/tools/widl:$PATH" - git rebase $CI_MERGE_REQUEST_DIFF_BASE_SHA --exec ./gitlab/build-mac - - if [ -f pipeline_failed ] ; then exit 1 ; fi + - if [ -f build_failed ] ; then exit 1 ; fi + - if [ -f tests_failed ] ; then exit 2 ; fi variables: VKD3D_DISABLE_EXTENSIONS: "VK_EXT_descriptor_indexing" VKD3D_SHADER_CONFIG: 'force_validation'