Oh, I guess that makes sense, though it's a shame if we can't rely on selectany
, since it's awkward to have to specify a single translation unit to define GUIDs in, especially if we ever needed to use other COM APIs. That's why we went with the -DINITGUID
method in mpv.
Why this? __declspec(selectany)
is supposed to de-dupe GUIDs between translation units.
That's a good point. I think we should avoid COBJMACROS in headers. If it's absolutely necessary to call a COM method, we should do it through lpVtbl.
...or would that be broken for C++? Maybe you were right about not calling D3D11 functions in headers.
Yep, it should definitely be possible to remove the ID3D11Texture2D_GetDesc
call. pl_d3d11_wrap
already has the check to ignore array_slice
for non-array textures.
As for fmt
, I don't think the D3D11_TEXTURE2D_DESC
is needed. The fmt
parameter given to pl_d3d11_wrap
should be the format of the view, not the video texture. So, an R8/R16 format for the luma plane and an R8G8/R16G16 format for the chroma plane.
There's a list of valid view formats for each video format here.
Also what @h.leppkes said is right too. ID3D11Texture2D_GetDesc(d3d11_frame, ...
is just a macro for d3d11_frame->lpVtbl->GetDesc(d3d11_frame, ...
so there should be no harm in calling it.
James Ross-Gowan (6d72f644) at 02 Feb 14:47
d3d11: lower the mapped log level of some spammy debug messages
James Ross-Gowan (95dcc48f) at 02 Feb 14:42
d3d11: lower the mapped log level of some spammy debug messages
This is the fix for log spam introduced by creating and destroying backbuffer view objects on every frame in !216. Rather than disabling debug layer messages, we can now set the log level of specific messages to PL_LOG_TRACE.
James Ross-Gowan (57bae1f9) at 02 Feb 14:38
d3d11: lower the mapped log level of some spammy debug messages
... and 324 more commits
That's because we manually remove PL_FMT_CAP_SAMPLEABLE
from UINT and SINT formats, which are otherwise considered (point) sampleable by D3D11, and gatherable by DXVK.
To be honest, I can't remember why we do that. I can't find anything that says you can't use a point sampler on an integer texture format. Maybe I was confused with linear samplers.
This fixes an assert failure with DXVK (but there's no guarantee DXVK works properly, since I've been testing it in Windows and it doesn't seem to be able to create a swapchain for some reason.)
James Ross-Gowan (1c844e82) at 01 Feb 14:05
d3d11/formats: only set gatherable when sampleable is set
... and 324 more commits
These are some minor fixes for issues found when testing under Windows 7 (and some brief unsuccessful testing with DXVK,) however they should improve context creation in general.
James Ross-Gowan (ca975750) at 30 Jan 14:29
d3d11/context: fix device creation retries and log error code on fa...
... and 319 more commits
LGTM
Technically possibly evil, but as the same data type is utilized (int32_t pointer <-> uint32_t pointer) one would hopefully expect this to work.
Seems like C allows pointers to alias the signed/unsigned version of the same type, so even in a pedantic sense this is fine, or at least no worse than the unsigned case.
The questionable thing that happens in both the signed and unsigned cases is assuming the underlying type of UINT
and int32_t
is the same, since they could both be either int
or long
. Despite being the same length, I think casting an long *
to int *
is technically undefined behaviour, but I'm not worried (and they're both int
on my machine anyway.)
ClearUnorderedAccessView is only available in float and unsigned int formats, so when emulating signed int formats one has to cast across the sign.
Technically possibly evil, but as the same data type is utilized (int32_t pointer <-> uint32_t pointer) one would hopefully expect this to work.
This was a typo: storable -> sampleable
James Ross-Gowan (8d688656) at 24 Jan 14:12
d3d11/formats: correctly mark blittable formats in <FL11_0
... and 314 more commits
Squashed. (Also reworded some comments.)
James Ross-Gowan (b438d2bd) at 19 Jan 08:26
d3d11/pass: allocate HLSL registers based on SPIR-V reflection