Preflight Checklist
Electron Version
40.2.1
What operating system(s) are you using?
Windows
Operating System Version
Windows 11 25H2
What arch are you using?
x64
Last Known Working Electron version
No response
Does the issue also appear in Chromium / Google Chrome?
I don't know how to test
Expected Behavior
If useSharedTexture is enabled, shared texture should be created with same directx texture flags for any pixelFormat in OffscreenSharedTexture object.
Actual Behavior
Shared textures are created with different directx texture flags.
To be specific
- Shared texture with
pixelFormat: bgra is created only with D3D11_RESOURCE_MISC_SHARED_NTHANDLE flag as stated documentation.
- Shared texture with
pixelFormat: rgbaf16 is created with D3D11_RESOURCE_MISC_SHARED_NTHANDLE and D3D11_RESOURCE_MISC_SHARED_KEYEDMUTEX flags. So IDXGIKeyedMutex must be acquired and locked with key 0. Without this, all GPU operations, such as copying and drawing, will perform as if the texture were transparent, without any error.
Testcase Gist URL
No response
Additional Information
Shared textures should be created using same flags, or at least the differences should be clearly stated in the documentation.
Preflight Checklist
Electron Version
40.2.1
What operating system(s) are you using?
Windows
Operating System Version
Windows 11 25H2
What arch are you using?
x64
Last Known Working Electron version
No response
Does the issue also appear in Chromium / Google Chrome?
I don't know how to test
Expected Behavior
If
useSharedTextureis enabled, shared texture should be created with same directx texture flags for anypixelFormatinOffscreenSharedTextureobject.Actual Behavior
Shared textures are created with different directx texture flags.
To be specific
pixelFormat: bgrais created only withD3D11_RESOURCE_MISC_SHARED_NTHANDLEflag as stated documentation.pixelFormat: rgbaf16is created withD3D11_RESOURCE_MISC_SHARED_NTHANDLEandD3D11_RESOURCE_MISC_SHARED_KEYEDMUTEXflags. SoIDXGIKeyedMutexmust be acquired and locked with key0. Without this, all GPU operations, such as copying and drawing, will perform as if the texture were transparent, without any error.Testcase Gist URL
No response
Additional Information
Shared textures should be created using same flags, or at least the differences should be clearly stated in the documentation.