diff --git a/.gitlab-ci/build/gitlab-ci.yml b/.gitlab-ci/build/gitlab-ci.yml index 541f2dd4ec4bee3e9c0e0b23c0beafc125816733..0ac662e96b5d79b921f24932cc79c20543f1dab6 100644 --- a/.gitlab-ci/build/gitlab-ci.yml +++ b/.gitlab-ci/build/gitlab-ci.yml @@ -54,6 +54,15 @@ script: - .gitlab-ci/meson/build.sh +.meson-build_mingw: + extends: + - .build-linux + - .use-debian/x86_build_mingw + - .use-wine + stage: build-x86_64 + script: + - .gitlab-ci/meson/build.sh + debian-testing: extends: - .meson-build @@ -513,18 +522,39 @@ debian-ppc64el: VULKAN_DRIVERS: "amd,swrast" debian-mingw32-x86_64: - extends: .meson-build + extends: .meson-build_mingw stage: build-misc variables: UNWIND: "disabled" C_ARGS: > -Wno-error=format -Wno-error=format-extra-args + -Wno-error=deprecated-declarations + -Wno-error=unused-function + -Wno-error=unused-variable + -Wno-error=unused-but-set-variable + -Wno-error=unused-value + -Wno-error=switch + -Wno-error=parentheses + -Wno-error=missing-prototypes + -Wno-error=sign-compare + -Wno-error=narrowing + -Wno-error=overflow CPP_ARGS: $C_ARGS - GALLIUM_DRIVERS: "swrast" + GALLIUM_DRIVERS: "swrast,d3d12,zink" + VULKAN_DRIVERS: "swrast,amd,microsoft-experimental" + GALLIUM_ST: > + -D gallium-opencl=icd + -D opencl-spirv=true + -D microsoft-clc=enabled + -D static-libclc=all + -D llvm=enabled EXTRA_OPTION: > -D spirv-to-dxil=true - -Dllvm=disabled - -Dzlib=disabled - -Dosmesa=true + -D gles1=enabled + -D gles2=enabled + -D osmesa=true + -D cpp_rtti=true + -D shared-glapi=enabled + -D zlib=enabled --cross-file=.gitlab-ci/x86_64-w64-mingw32 diff --git a/.gitlab-ci/container/debian/x86_build-base-wine.sh b/.gitlab-ci/container/debian/x86_build-base-wine.sh new file mode 100644 index 0000000000000000000000000000000000000000..dec8f790cf47ab9bcc75a5b6a5cadb139a215a1d --- /dev/null +++ b/.gitlab-ci/container/debian/x86_build-base-wine.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +set -e +set -o xtrace + +# Installing wine, need this for testing mingw or nine + +# We need multiarch for Wine +dpkg --add-architecture i386 +apt-get update +apt-get install -y --no-remove \ + wine \ + wine32 \ + wine64 \ + xvfb + +# Used to initialize the Wine environment to reduce build time +wine64 whoami.exe + diff --git a/.gitlab-ci/container/debian/x86_build-base.sh b/.gitlab-ci/container/debian/x86_build-base.sh index 85a6a6f00028ce7e4c6b0dcc7c8018ddd828172e..0a56d479bf2e82e479367fc59141d8f725950297 100644 --- a/.gitlab-ci/container/debian/x86_build-base.sh +++ b/.gitlab-ci/container/debian/x86_build-base.sh @@ -25,7 +25,7 @@ apt-get install -y --no-remove \ dpkg-cross \ flex \ g++ \ - g++-mingw-w64-x86-64 \ + cmake \ gcc \ git \ glslang-tools \ @@ -54,7 +54,6 @@ apt-get install -y --no-remove \ libxshmfence-dev \ libxvmc-dev \ libxxf86vm-dev \ - libz-mingw-w64-dev \ make \ meson \ pkg-config \ @@ -64,7 +63,6 @@ apt-get install -y --no-remove \ qemu-user \ valgrind \ wget \ - wine64 \ x11proto-dri2-dev \ x11proto-gl-dev \ x11proto-randr-dev \ @@ -74,6 +72,8 @@ apt-get install -y --no-remove \ # Needed for ci-fairy, this revision is able to upload files to MinIO pip3 install git+http://gitlab.freedesktop.org/freedesktop/ci-templates@34f4ade99434043f88e164933f570301fd18b125 +. .gitlab-ci/container/debian/x86_build-base-wine.sh + ############### Uninstall ephemeral packages apt-get purge -y $STABLE_EPHEMERAL diff --git a/.gitlab-ci/container/debian/x86_build-mingw-patch.sh b/.gitlab-ci/container/debian/x86_build-mingw-patch.sh new file mode 100644 index 0000000000000000000000000000000000000000..6dbb743f9134cb8d71476e1172a6b43bdd9ec2a1 --- /dev/null +++ b/.gitlab-ci/container/debian/x86_build-mingw-patch.sh @@ -0,0 +1,74 @@ +#!/bin/bash + +# Pull packages from msys2 repository that can be directly used. +# We can use https://packages.msys2.org/ to retrieve the newest package +mkdir ~/tmp +pushd ~/tmp +MINGW_PACKET_LIST=" +mingw-w64-x86_64-headers-git-10.0.0.r14.ga08c638f8-1-any.pkg.tar.zst +mingw-w64-x86_64-vulkan-loader-1.3.211-1-any.pkg.tar.zst +mingw-w64-x86_64-libelf-0.8.13-6-any.pkg.tar.zst +mingw-w64-x86_64-zlib-1.2.12-1-any.pkg.tar.zst +mingw-w64-x86_64-zstd-1.5.2-2-any.pkg.tar.zst +" + +for i in $MINGW_PACKET_LIST +do + wget -q --tries=3 https://mirror.msys2.org/mingw/mingw64/$i + tar xf $i --strip-components=1 -C /usr/x86_64-w64-mingw32/ +done +popd +rm -rf ~/tmp + +mkdir -p /usr/x86_64-w64-mingw32/bin + +# The output of `wine64 llvm-config --system-libs --cxxflags mcdisassembler` +# containes absolute path like '-IZ:' +# The sed is used to replace `-IZ:/usr/x86_64-w64-mingw32/include` +# to `-I/usr/x86_64-w64-mingw32/include` + +# Debian's pkg-config wrapers for mingw are broken, and there's no sign that +# they're going to be fixed, so we'll just have to fix it ourselves +# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=930492 +cat >/usr/x86_64-w64-mingw32/bin/pkg-config </usr/x86_64-w64-mingw32/bin/llvm-config </usr/x86_64-w64-mingw32/bin/clang </usr/x86_64-w64-mingw32/bin/llvm-as </usr/x86_64-w64-mingw32/bin/llvm-link </usr/x86_64-w64-mingw32/bin/opt </usr/x86_64-w64-mingw32/bin/llvm-spirv </usr/local/bin/x86_64-w64-mingw32-pkg-config < -#ifdef _WIN32 -#include -#else -#include -#endif #include #include "pipe/p_format.h" diff --git a/src/gallium/drivers/d3d12/d3d12_video_enc_h264.cpp b/src/gallium/drivers/d3d12/d3d12_video_enc_h264.cpp index 5cdb84f5cbf44f8bdabc2a5364bd74c613bd5c93..3ceceb12dae9be0687329c2e99dd974c5f97fe46 100644 --- a/src/gallium/drivers/d3d12/d3d12_video_enc_h264.cpp +++ b/src/gallium/drivers/d3d12/d3d12_video_enc_h264.cpp @@ -113,7 +113,7 @@ d3d12_video_encoder_update_current_frame_pic_params_info_h264(struct d3d12_video { struct pipe_h264_enc_picture_desc *h264Pic = (struct pipe_h264_enc_picture_desc *) picture; d3d12_video_bitstream_builder_h264 *pH264BitstreamBuilder = - dynamic_cast(pD3D12Enc->m_upBitstreamBuilder.get()); + static_cast(pD3D12Enc->m_upBitstreamBuilder.get()); assert(pH264BitstreamBuilder != nullptr); bUsedAsReference = !h264Pic->not_referenced; @@ -774,7 +774,7 @@ d3d12_video_encoder_build_codec_headers_h264(struct d3d12_video_encoder *pD3D12E D3D12_VIDEO_ENCODER_SEQUENCE_CONTROL_FLAG_RESOLUTION_CHANGE) != 0); d3d12_video_bitstream_builder_h264 *pH264BitstreamBuilder = - dynamic_cast(pD3D12Enc->m_upBitstreamBuilder.get()); + static_cast(pD3D12Enc->m_upBitstreamBuilder.get()); assert(pH264BitstreamBuilder); uint32_t active_seq_parameter_set_id = pH264BitstreamBuilder->get_active_sps_id(); diff --git a/src/gallium/targets/libgl-gdi/meson.build b/src/gallium/targets/libgl-gdi/meson.build index 1edb4a1ff59bd9c26b7ceb87bd2dcfe4ce73914d..e344090e2e7f96f8932e5dd584c7078c1005cf48 100644 --- a/src/gallium/targets/libgl-gdi/meson.build +++ b/src/gallium/targets/libgl-gdi/meson.build @@ -68,21 +68,18 @@ if with_tests dependencies : [idep_gtest, dep_dxheaders, extra_test_deps], ) - # The CI pipeline for MinGW doesn't support creating a window, so don't run these tests there - if with_tests and cc.get_id() != 'gcc' - wgl_test_env = environment() - wgl_test_env.append('PATH', libgallium_wgl_build_dir) - if with_shared_glapi - wgl_test_env.append('PATH', libglapi_build_dir) - endif - - test( - 'wgl', - test_wgl, - suite : ['wgl'], - env : wgl_test_env, - depends : [libopengl32], - protocol : gtest_test_protocol, - ) + wgl_test_env = environment() + wgl_test_env.append('PATH', libgallium_wgl_build_dir) + if with_shared_glapi + wgl_test_env.append('PATH', libglapi_build_dir) endif + + test( + 'wgl', + test_wgl, + suite : ['wgl'], + env : wgl_test_env, + depends : [libopengl32], + protocol : gtest_test_protocol, + ) endif diff --git a/src/gallium/winsys/d3d12/wgl/d3d12_wgl_framebuffer.cpp b/src/gallium/winsys/d3d12/wgl/d3d12_wgl_framebuffer.cpp index 8dd65dcc7bb5a103a5f193b6fe77667fb523ba18..90e9ec929429117c0e3983993aa93b7cf1e5ca31 100644 --- a/src/gallium/winsys/d3d12/wgl/d3d12_wgl_framebuffer.cpp +++ b/src/gallium/winsys/d3d12/wgl/d3d12_wgl_framebuffer.cpp @@ -23,6 +23,8 @@ #include "d3d12_wgl_public.h" +#include + #include #include #include diff --git a/src/microsoft/clc/clc_compiler_test.cpp b/src/microsoft/clc/clc_compiler_test.cpp index f84565f4b6fc8790057cac87231f88c22a718707..4a02e39cf7cf49d50da7ef3af278732d0d1dba62 100644 --- a/src/microsoft/clc/clc_compiler_test.cpp +++ b/src/microsoft/clc/clc_compiler_test.cpp @@ -559,7 +559,7 @@ TEST_F(ComputeTest, DISABLED_complex_types_local_array_long) inout[idx] = tmp[idx];\n\ }\n"; auto inout = ShaderArg({ 0, 0, 0, 0 }, SHADER_ARG_INOUT); - const uint16_t expected[] = { + const uint64_t expected[] = { 0x00000000, 0x10000001, 0x20000020, 0x30000300, }; run_shader(kernel_source, inout.size(), 1, 1, inout); diff --git a/src/microsoft/clc/meson.build b/src/microsoft/clc/meson.build index 504a7867dbc3fc8e29dd161fddff5814aa8cb663..966c17b43f32f5348f6f65637487517e4732cae7 100644 --- a/src/microsoft/clc/meson.build +++ b/src/microsoft/clc/meson.build @@ -42,5 +42,8 @@ if dep_dxheaders.found() include_directories : [inc_include, inc_src, inc_compiler, inc_spirv], ) - test('clc_compiler_test', clc_compiler_test, timeout: 180, protocol : gtest_test_protocol) + if build_machine.system() == 'windows' + test('clc_compiler_test', clc_compiler_test, timeout: 180, protocol : gtest_test_protocol) + endif + endif diff --git a/src/microsoft/vulkan/dzn_pipeline.c b/src/microsoft/vulkan/dzn_pipeline.c index 6eab6abe13f2aa2e9bcd4fa28f3dffc7128a57a3..b3a5997009c41b5aec06ee2f9a73f432c25153ad 100644 --- a/src/microsoft/vulkan/dzn_pipeline.c +++ b/src/microsoft/vulkan/dzn_pipeline.c @@ -1377,7 +1377,7 @@ dzn_graphics_pipeline_get_state(struct dzn_graphics_pipeline *pipeline, HRESULT hres = ID3D12Device2_CreatePipelineState(device->dev, &stream_desc, &IID_ID3D12PipelineState, - &variant->state); + (void**)(&variant->state)); assert(!FAILED(hres)); he = _mesa_hash_table_insert(pipeline->variants, &variant->key, variant); assert(he);