Skip to content

Instantly share code, notes, and snippets.

/**
* Windows Keyed Mutex Library
* @pabloko - [email protected] - 23/01/2024
* This file is a C / C++ wrapper for windows keyed mutex / events / condition variables.
**/
#include <D3dkmthk.h>
#include <windows.h>
#ifdef __cplusplus
@pabloko
pabloko / Angle on windows SDK.md
Last active October 29, 2025 14:16
There is a hidden distribution of ANGLE in windows that (now) you can use

There is an ANGLE driver in every windows 8-11 included in the system32 named edgeangle.dll that seems to be part of the former edge 11 (spartan) that briefly existed in windows (and still exists as in edgehtml.dll and will take a future post)

This distribution reports ANGLE version OpenGL ES 3.0 (ANGLE 2.1.0.d0cdd066eca2) and it seems only D3D11 backend is available. It reports the next extensions:

GL_ANGLE_client_arrays GL_ANGLE_depth_texture GL_ANGLE_framebuffer_blit GL_ANGLE_framebuffer_multisample GL_ANGLE_instanced_arrays GL_ANGLE_lossy_etc_decode GL_ANGLE_multiview GL_ANGLE_pack_reverse_row_order GL_ANGLE_program_cache_control GL_ANGLE_request_extension GL_ANGLE_robust_client_memory GL_ANGLE_texture_compression_dxt3 GL_ANGLE_texture_compression_dxt5 GL_ANGLE_texture_usage GL_ANGLE_translated_shader_source GL_CHROMIUM_bind_generates_resource GL_CHROMIUM_bind_uniform_location GL_CHROMIUM_color_buffer_float_rgb GL_CHROMIUM_color_buffer_float_rgba GL_CHROMIUM_copy_compressed_texture GL_CHROMIUM_c
@pabloko
pabloko / 1.Query information from NT Handles of shared D3D11 Textures.md
Last active October 29, 2025 14:15
Query information from NT Handles of shared D3D11 Textures

Query information from NT Handles of shared D3D11 Textures

tl;dr: you can't. Only D3D12 and Vulkan resources expose API to query it's physical size

Looking into using the gl extension EXT_external_objects_win32 stumbled upon this <size> parameter in glImportMemoryWin32HandleEXT when using a D3D11 resources

tl;dr: Use 0 as size when using HANDLE_TYPE_D3D11_IMAGE_EXT / HANDLE_TYPE_D3D11_IMAGE_KMT_EXT

the driver implmentation will figure out the internal size of the resource. This size would be alignedWidth * alignedHeight * Bpp where alignment varies depending of the graphics card vendor, model and driver version.

To give some context, here are some values from my NV card with updated drivers