The old API was awkward in that it didn't allow access to the proper
memory type index and was prone to misuse in codepaths when importing
memory instead of allocating it.
Change that.
The old way now requires more code and a local variable, but importing
memory is a lot more straightforward.
And I don't have to spend days tracking down a leak on Windows.
Unlike binary semaphores, timeline semaphores represent a (64bit
unsigned) value and the binary decision about whether they have signaled
or not is decided by comparing their value to a predefined value.
So this code adds the ability to pass that value.
In fact, it now requires this value, but that is not a problem because
Vulkan ignores the value for binary semaphores, so we can just pass
0 everywhere a binary sempahore is used.
There is no use of the code in those commit, but timeline semaphores
are used for explicit sync with dmabufs and D3D12 uses them exclusively.
I am so totally not interested to think about this special header.
Also, I had to hunt it down because everything else includes
just vulkan.h and only Windows does the custom header.
On Windows, we don't want to use GL and let D3D12 do all the work.
But as long as we don't support all formats and implement all the
interfaces GstPlayer expects, we need to have a way to convert.
So we put a d3d12convert for that.
Related: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/3956
Add a gdk_d3d12_texture_import_gl() function to match the EGL import
behavior.
And then use it in the import code.
What makes this a bit awkward is that we need to not just shuffle a
tex_id but also a mem_id around, but oh well...
Makes shared HANDLE handling part of the texture. This handle will be
needed when importing into GL or Vulkan or using elsewhere.
Its lifetime is bound to the texture and so is it's use,
so it's best to maintain it here instead of requiring renderers to
deal with HANDLEs.
This implements initial support for GL_EXT_external_objects.
An external memory object is (unlike EGL images) represented by a
GLuint just like all other GL objects.
It needs to be kept alive for as long as the memory is used, which
means it needs to outlive the texture ID.
That's why the object is handed over to the texture code and the
finalizer will then free the memory object.
This is just plumbing, users will follow in future commits.
This is a simple implementation of a GdkTexture that is backed by
a ID3D12Resource.
The only functionality implemented so far is GdkTexture::download(),
but that is enough to make it work - albeit slowly - in all renderers.
It also doesn't support any fancy formats yet; in particular: no YUV.
These contain utility functions for mapping DXGI formats to the
formats GTK uses in various places.
For now, only the straightforward formats are mapped.
All versions older than Windows 10 are out of support and no longer
receive updates, so we do not want to support them.
We also want to move towards APIs that requires Windows 10 - like
Direct3D 12 - and not having them optional simplifies our code.
See the discussion in !7895 for more details.
3 things you need to know about this change:
1. We use diff(1) in various tests to check generated text against
reference output
2. Windows locates executables not just in $PATH, it also looks in
$cwd and the directory of the current process' binary
3. Multiple tests live together in the same directory
Windows is fun.
We use it everywhere, so it makes sense to enable it everywhere.
For anyone not in the know, defining COBJMACROS makes Micrsoft headers
for COM objects provide C macros so that instead of having to call
foo->lpVtbl->Release();
to unref a COM object, one can call
IFoo_Release (foo);
Note that thes macros are implemented with inheritance as Release()
is defined on the IUnknown base interface (MS' equivalent to GObject)
and would otherwise require
IUnknown_Release ((IUnknown *) foo);
That line works, too - but it is not necessary.
use the modern version using GSubprocess that already exists in
node-parser.
Also change from one function to two - so tests can diff GBytes and
strings, depending on which they prefer.
On Windows, git defaults to maintaining line endings, which means it
changed \n to \r\n on all files it identifies as text. And that includes
our test output.
Luckily diff(1) has an option to undo that. And since we do not care
about line endings in those tests, we can just use it.
We return an empty format list when dmabufs aren't supported, not NULL.
And the sink was treating the empty format list by setting no fourccs
on the caps, which GStreamer conveniently interpreted as "any",
not as "none".