Re: [Mingw-w64-public] [PATCH 2/2] headers: Manually import d3d12.idl from vkd3d

2023-09-08 Thread Alexandre Julliard via Mingw-w64-public
Martin Storsjö  writes:

> This is the latest version of vkd3d_d3d12.idl from
> https://gitlab.winehq.org/wine/vkd3d, plus some additions that still
> are under review at
> https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/332, with
> slight adjustments to the include lines at the top.
>
> Remove d3d12.idl from the list of files that manually are synced
> from main wine, as d3d12.idl there is lacking lots of declarations.
>
> Ideally the d3d12.idl in wine will be brought up to sync at some point,
> but for now, exclude this header and sync it manually from vkd3d
> instead.

Please feel free to send that same patch to Wine, there's no reason for
the headers to be out of sync.

-- 
Alexandre Julliard
julli...@winehq.org


___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


Re: [Mingw-w64-public] [PATCH 2/2] headers: Manually import d3d12.idl from vkd3d

2023-09-08 Thread Alexandre Julliard via Mingw-w64-public
Martin Storsjö  writes:

> On Fri, 8 Sep 2023, Alexandre Julliard wrote:
>
>> Martin Storsjö  writes:
>>
>>> This is the latest version of vkd3d_d3d12.idl from
>>> https://gitlab.winehq.org/wine/vkd3d, plus some additions that still
>>> are under review at
>>> https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/332, with
>>> slight adjustments to the include lines at the top.
>>>
>>> Remove d3d12.idl from the list of files that manually are synced
>>> from main wine, as d3d12.idl there is lacking lots of declarations.
>>>
>>> Ideally the d3d12.idl in wine will be brought up to sync at some point,
>>> but for now, exclude this header and sync it manually from vkd3d
>>> instead.
>>
>> Please feel free to send that same patch to Wine, there's no reason for
>> the headers to be out of sync.
>
> Sure, I can do that.
>
> They were out of sync already to begin with (vkd3d having mostly more
> interfaces implemented, but lacking some few structs, and missing some
> CLSID definitions that were present in wine). The headers in vkd3d
> were closer to what I wanted (we were missing a bunch of interfaces
> needed for building QtBase's D3D12 renderer; vkd3d had most of it but
> not all).

Yes, they haven't been synced properly for a while, but that's not
deliberate, it's just that no one bothered to do it.

> Once the reviews within vkd3d have settled, I can try to look into
> syncing that header back with wine.

Thanks!

-- 
Alexandre Julliard
julli...@winehq.org


___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


Re: [Mingw-w64-public] [PATCH 2/2] headers: Manually import d3d12.idl from vkd3d

2023-09-08 Thread Martin Storsjö

On Fri, 8 Sep 2023, Alexandre Julliard wrote:


Martin Storsjö  writes:


This is the latest version of vkd3d_d3d12.idl from
https://gitlab.winehq.org/wine/vkd3d, plus some additions that still
are under review at
https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/332, with
slight adjustments to the include lines at the top.

Remove d3d12.idl from the list of files that manually are synced
from main wine, as d3d12.idl there is lacking lots of declarations.

Ideally the d3d12.idl in wine will be brought up to sync at some point,
but for now, exclude this header and sync it manually from vkd3d
instead.


Please feel free to send that same patch to Wine, there's no reason for
the headers to be out of sync.


Sure, I can do that.

They were out of sync already to begin with (vkd3d having mostly more 
interfaces implemented, but lacking some few structs, and missing some 
CLSID definitions that were present in wine). The headers in vkd3d were 
closer to what I wanted (we were missing a bunch of interfaces needed for 
building QtBase's D3D12 renderer; vkd3d had most of it but not all).


Once the reviews within vkd3d have settled, I can try to look into syncing 
that header back with wine.


// Martin

___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


[Mingw-w64-public] [PATCH 1/2] headers: Add the D3D12 shader compiler interface dxcapi.h

2023-09-08 Thread Martin Storsjö
This header is appropriately licensed with a compatible open source
license, the University of Illinois Open Source License (a BSD-like
license).

This header originates from Microsoft, available at e.g.
https://github.com/microsoft/DirectXShaderCompiler/blob/main/include/dxc/dxcapi.h.
That version is incompatible with mingw though, but the Mesa project
has a version that adds mingw compatibility, at
https://gitlab.freedesktop.org/mesa/mesa/-/blob/main/src/microsoft/compiler/dxcapi.h.

This includes the current version of the latter header.

Signed-off-by: Martin Storsjö 
---
 mingw-w64-headers/include/dxcapi.h | 777 +
 1 file changed, 777 insertions(+)
 create mode 100644 mingw-w64-headers/include/dxcapi.h

diff --git a/mingw-w64-headers/include/dxcapi.h 
b/mingw-w64-headers/include/dxcapi.h
new file mode 100644
index 0..0cb61dff2
--- /dev/null
+++ b/mingw-w64-headers/include/dxcapi.h
@@ -0,0 +1,777 @@
+
+///
+//   //
+// dxcapi.h  //
+// Copyright (C) Microsoft Corporation. All rights reserved. //
+// This file is distributed under the University of Illinois Open Source //
+// License. See LICENSE.TXT for details. //
+//   //
+// Provides declarations for the DirectX Compiler API entry point.   //
+//   //
+///
+
+#ifndef __DXC_API__
+#define __DXC_API__
+
+#ifdef _WIN32
+#ifndef DXC_API_IMPORT
+#define DXC_API_IMPORT __declspec(dllimport)
+#endif
+#else
+#ifndef DXC_API_IMPORT
+#define DXC_API_IMPORT __attribute__ ((visibility ("default")))
+#endif
+#endif
+
+#include 
+#ifndef CROSS_PLATFORM_UUIDOF
+// Warning: This macro exists in WinAdapter.h as well
+#if defined(_MSC_VER)
+#define CROSS_PLATFORM_UUIDOF(iface, spec) \
+   struct __declspec(uuid(spec)) iface;
+#else /* defined(_MSC_VER) */
+#if defined(__MINGW32__)
+#include 
+#include 
+#ifndef _Maybenull_
+#define _Maybenull_
+#endif
+#ifndef _In_count_
+#define _In_count_(x)
+#endif
+#ifndef _In_opt_count_
+#define _In_opt_count_(x)
+#endif
+#ifndef _In_bytecount_
+#define _In_bytecount_(x)
+#endif
+#endif /*  defined(__MINGW32__) */
+#ifndef __CRT_UUID_DECL
+#define __CRT_UUID_DECL(type, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
+   extern "C++"  \
+   { \
+  template <>\
+  struct __mesa_emulated_uuidof_s  \
+  {  \
+ static constexpr IID __uuid_inst = {\
+ l, w1, w2, {b1, b2, b3, b4, b5, b6, b7, b8}};   \
+  }; \
+  template <>\
+  constexpr const GUID &__mesa_emulated_uuidof()   \
+  {  \
+ return __mesa_emulated_uuidof_s::__uuid_inst; \
+  }  \
+  template <>\
+  constexpr const GUID &__mesa_emulated_uuidof() \
+  {  \
+ return __mesa_emulated_uuidof_s::__uuid_inst; \
+  }  \
+   }
+#define __uuidof(T) __mesa_emulated_uuidof::type>()
+#endif /*__CRT_UUID_DECL */
+constexpr uint8_t nybble_from_hex(char c) {
+   return ((c >= '0' && c <= '9')
+   ? (c - '0')
+   : ((c >= 'a' && c <= 'f')
+  ? (c - 'a' + 10)
+  : ((c >= 'A' && c <= 'F') ? (c - 'A' + 10)
+ : /* Should be an error */ -1)));
+}
+
+constexpr uint8_t byte_from_hex(char c1, char c2) {
+   return nybble_from_hex(c1) << 4 | nybble_from_hex(c2);
+}
+
+constexpr uint8_t byte_from_hexstr(const char str[2]) {
+   return nybble_from_hex(str[0]) << 4 | nybble_from_hex(str[1]);
+}
+
+constexpr unsigned short short_from_hexstr(const char str[2], unsigned shift)
+{
+   return ((unsigned short)(nybble_from_hex(str[0]) << 4 |
+nybble_from_hex(str[1])))
+  << shift;
+}
+
+constexpr unsigned long word_from_hexstr(const char str[2], unsigned shift)
+{
+   return ((unsigned 

Re: [Mingw-w64-public] [PATCH 1/2] tools: Remove the unused tool genlib

2023-09-08 Thread Martin Storsjö

On Fri, 1 Sep 2023, Stephen Kitt wrote:


On Fri, 1 Sep 2023 12:20:37 +0800, LIU Hao  wrote:

在 2023/8/31 18:20, Martin Storsjö 写道:

This tool was meant as a standalone replacement for dlltool,
for generating import libraries, but it never got feature parity
(in particular, it lacked support for generating symbol aliases,
which are cruicial for the core mingw-w64-crt import libraries).


AFAICT Debian has it, although with a weird prefix (`mingw-genlib`). I
agree that dlltool should be preferred, and I don't mind removing genlib.


Yes, but please don’t keep it on our account, nothing I’m aware of uses the
Debian genlib. (The name was modified because genlib was perceived as too
generic.)


Thanks, I pushed this patchset now.

// Martin

___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public