MinGW hides float math declarations under strict C89 although its runtime supplies the functions. Force-include scoped declarations in the Win32 C89 lane so viewport rounding and matrix math retain their float return ABI. Keep strict C89 diagnostics; the GNU89 alternative accepts inline and is not used.
Give the three bundled D3DKMDT rotation helpers internal linkage to avoid duplicate definitions across C89 translation units. Add actual runtime and two-unit linkage checks plus seven rejected C99 syntax probes.
Validated through local CI on native Windows/GDB and MinGW/Wine, a fresh complete C89 frontend build, and twelve actual HEVC movie-window frames against independent FFmpeg RGB patches: 796 points, maximum channel error 3, no failures. The previous presentation had 632 failing points.
Import the AV1 StdVideo and decode extension declarations from Vulkan-Headers v1.4.328. Query Main 8/10-bit capabilities with and without film grain before implementing the device adapter, and document native RTX 5090 limits without advertising AV1 playback.
Negotiate the VP9 extension and feature in both device-creation paths, preserving explicit core disable requests. Backport the required VP9 definitions from Vulkan-Headers v1.4.328.
Register a VP9 backend with the existing hardware session and reuse Vulkan NV12/P010 output leases and sampled imports. Preserve effective segmentation/filter state, named-reference aliases and per-slot color metadata. Retain the DPB-to-output copy and capability-based fallback.
Add portable picture and negotiation tests, plus optional native IVF/reference-plane and RGBA comparisons covering show-existing replay, backpressure, retained frames after close and sampled-import fallback.
The video decode extensions (VK_KHR_video_queue, video_decode_queue,
video_decode_h264) and their codec std headers. C++ comments turned
into C89 ones.
The d3d9 Cg and HLSL drivers assign their shader constant vectors, the
rotated-quad corners and the texcoord vertex element after the
declarations instead of initialising them from runtime values, which C89
does not allow; every value and the order it is set in are unchanged.
The bundled d3dcompiler.h stands in for the Windows SDK header and is
marked a system header for GCC, so its C++ comments are not held to the
project's pedantic C89 checks.
tools/mingw_syntax_check.sh's C89 pass defines HAVE_SCREENSHOTS, as the
linux-c89 build does, and gives Windows-only translation units the Win32
feature set of the first pass, the only one they are built with: without
it the pass found wnd_proc_d3d_common undeclared in every d3d driver and
the screenshot settings missing in task_screenshot.c. Over the whole
tree eleven translation units go from failing to clean and none from
clean to failing.
Userland was added at: https://github.com/libretro/RetroArch/pull/8132
However, its only use was with CRTSwitchRes together with VideoCore.
Over the times, the legacy VideoCore drivers have lost usage as
nowadays Mesa supports the VideoCore IV chip in RPi 0..3, and
RPi 4 and/or 64-bit was never supported.
Option is kept to use the legacy drivers, but it is now utilized
from the OS.
The existing dxsdk_sal_compat.h was gated on `_MSC_VER < 1700`, which
made the entire shim body invisible to GCC/MinGW toolchains. This
worked because mingw-w64's <sal.h> historically provided the SAL
macros the bundled DX headers reference -- but not all mingw-w64
releases are complete. MSYS2's current mingw-w64 sal.h omits the
legacy SAL 1 form `_Inout_opt_bytecount_`, which the bundled d3d11.h
references, so the MXE/MinGW cross-build of gfx/common/dx_guids.c
fails to parse d3d11.h.
Fix the gate and extend macro coverage:
* Replace the `_MSC_VER < 1700` gate with a portable form that pulls
in <sal.h> via `__has_include` on non-MSVC toolchains. The shim
body then runs on every toolchain, and the per-macro `#ifndef`
guards prevent redefinition wherever the toolchain already
provides the macro. Net effect on MSVC 2012+ and on complete
mingw-w64 releases: no-op. On MSVC 2003-2010 and incomplete
mingw-w64 releases: missing macros are stubbed.
* Add the SAL 1 underscore-prefix bytecount/ecount family
(`_In_bytecount_[_opt_]`, `_Out_bytecount_[_opt_]`,
`_Inout_bytecount_[_opt_]`, `_Inout_opt_bytecount_`, and the
four `_ecount_[_opt_]` equivalents). `_Inout_opt_bytecount_`
is the one actually observed in the MXE/MSYS2 build log; the
siblings are added together because they commonly surface in
the same parse cascade once any one of them fails.
* Update the file comment to document MinGW-w64 coverage and the
no-op behavior on MSVC 2012+.
Also propagate `#include "dxsdk_sal_compat.h"` to the bundled DX
headers that didn't already have it:
* gfx/include/dxsdk/d3d10.h, d3d10_1.h, d3d11.h, d3d11shader.h,
d3d12.h, d3d12shader.h, d3dcompiler.h: add the shim include at
line 1, ahead of the MIDL-generated preamble.
The dxgi1_*.h, d3dcommon.h, and dxgi.h headers already got this
in an earlier commit; d3d8.h and d3d9.h are not bundled.
Downstream effect:
* MXE/MSYS2 mingw-w64 cross-build: resolves the
`unknown type name '_Inout_opt_bytecount_'` error in
gfx/common/dx_guids.c's transitive include of d3d11.h.
* MSVC 2003-2010: unchanged (every new stub is #ifndef-guarded,
and the SAL 2 additions from the prior dxgi patch remain intact).
* MSVC 2012+: unchanged (<sal.h> provides everything, stubs no-op).
Commit e8191ce ("Add this") routes griffin.c's d3dcompiler_common.c
inclusion through an HAVE_D3D9+HAVE_HLSL arm and redirects
dxgi_common.h to the bundled <dxsdk/dxgi1_6.h>. On legacy MSVC
toolchains (2003-2010) this surfaces a new SAL-annotation parse
cascade: dxgi1_2.h through dxgi1_6.h reference SAL 2 macros that
those toolchains do not know
The bundled DirectX headers in gfx/include/dxsdk/ are modern Windows
8.x/10 SDK headers and use SAL annotations throughout their function
prototypes. These annotations come in two generations:
* SAL 1 (double-underscore): __in, __out, __inout, __in_ecount,
__out_bcount, __deref_out, etc.
* SAL 2 (leading underscore + trailing underscore): _In_, _Out_,
_Inout_, _In_reads_(s), _Out_writes_bytes_(s), _COM_Outptr_,
_Always_(x), _Outptr_opt_result_maybenull_, etc.
Older Microsoft toolchains ship incomplete or nonexistent sal.h:
* MSVC 2003 (_MSC_VER 1310): no sal.h at all. Both SAL 1 and SAL 2
macros are undefined.
* MSVC 2005 (_MSC_VER 1400) and MSVC 2008 RTM (_MSC_VER 1500): sal.h
has SAL 1 only.
* MSVC 2008 SP1 and MSVC 2010 (_MSC_VER 1600): sal.h ships a partial
SAL 2 set (_In_, _Out_, _Inout_, etc.) but is missing the
buffer-size, COM-outptr, and wrapper families.
* MSVC 2012+ (_MSC_VER >= 1700): full SAL 2 in sal.h.
Without definitions for these macros, the preprocessor treats them as
unknown identifiers and every function declaration that uses one fails
to parse, producing cascades like:
error C2143: syntax error : missing ')' before 'type'
error C2081: '_COM_Outptr_' : name in formal parameter list illegal
Add gfx/include/dxsdk/dxsdk_sal_compat.h which stubs out the missing
SAL 1 and SAL 2 macros to empty (or to a pass-through for wrapper forms
like _Always_(x) / _When_(c,x)) so declarations using them parse as
plain C. The shim is structured in four tiers:
* Skip the whole thing on MSVC 2012+ via _MSC_VER < 1700 gate.
* Skip #include <sal.h> on MSVC 2003, where the header does not
exist, via a _MSC_VER >= 1400 gate.
* Stub the SAL 1 family, guarded per-macro with #ifndef so MSVC 2005
through 2010 (which already have them) leave them untouched and
MSVC 2003 gets working definitions.
* Stub the SAL 2 family the same way, filling in whatever the
toolchain is missing without redefinition warnings.
Every macro is wrapped in #ifndef to avoid C4005 redefinition warnings
on toolchains that ship a partial SAL set.
Include the shim from the three bundled headers that tripped MSVC 2008
in griffin builds:
* gfx/include/dxsdk/d3dcommon.h
* gfx/include/dxsdk/d3d11shader.h
* gfx/include/dxsdk/d3dcompiler.h
The shim's outer include guard makes repeat inclusion free, so if
additional DX headers surface the same errors in future build
configurations they can be added with a one-line #include.
This is a build-only fix. The stubs discard static-analysis
information, which older MSVC versions could not consume anyway.
No behavior change on any supported toolchain.
* [WINRT] Enable logging on __WINRT__ and bypass verbosidy in debug
* [UWP] wrong configuration prevents GLES to compile, common functions defines GL symbols
* [UWP] configure project to allow OPENGL on default configuration and copy MESA DLLs into UWP release
* [UWP] add MESA headers
* [UWP] add MESA EGL.lib needed for GLES context. However HAVE_OPENGL is better as GL cores use desktop version, so this is left for reference and to make the solution build with HAVE_OPENGLES
* [UWP] UWP is missing some GDI function definitions, implemented into MESA Gallium
* [UWP] Configure Release project too
* [UWP] Add mesa alpha-2 release dlls
* [UWP] allow griffin and vide_driver to have an OPENGL context
* [UWP] allow wgl context to work with mesa under WINRT
* [UWP] BUG: have to modify height/width getters and align them to MESA because the screen resolution is not right in gl context. Pending further investigation
* [UWP] fix ANGLE build
* [UWP] remove duplicate import code.
* (UWP) Cleanup filters file
* MESA screen destroy fix and Yabasanshiro hack. Align to alpha-2-hack tag
---------
Co-authored-by: Gabriel Morazán <[email protected]>