Fix DX11 shared textures#1759
Merged
Merged
Conversation
Right now creating a texture from a native texture with D3D11_RESOURCE_MISC_SHARED_NTHANDLE will fail unless it is also D3D11_RESOURCE_MISC_SHARED_KEYEDMUTEX. This combination is recomended but not mandatory acording to the specification: https://learn.microsoft.com/en-us/windows/win32/api/d3d11/ne-d3d11-d3d11_resource_misc_flag
Contributor
|
I'm in the process of replacing SharpDX with Silk in the PR #1715. I write here to remind myself (or others) this change must be ported to that PR or it will be lost when merged, as that PR is modifying a lot of the internals of |
manio143
approved these changes
Sep 14, 2023
Member
|
Good find, I'll merge this, looks sensible that one flag doesn't require the other one. |
This was referenced Sep 15, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Details
Right now creating a texture from a native texture with D3D11_RESOURCE_MISC_SHARED_NTHANDLE will fail unless it is also D3D11_RESOURCE_MISC_SHARED_KEYEDMUTEX. This combination is recomended but not mandatory acording to the specification: https://learn.microsoft.com/en-us/windows/win32/api/d3d11/ne-d3d11-d3d11_resource_misc_flag
Description
The PR changes the code that checks for shared handles from a switch/case to an if/else where the check is done for flags using a bitwise and instead of comparing the full flag to an specific value. Shared NT is checked first as Shared & SharedNT can be set at the same time.
Related Issue
#1758
Motivation and Context
Allows to use DX11 textures with an NT handle but no keyed mutex
Types of changes
Checklist