Carry backing resource in UI texture handles
This commit is contained in:
@@ -52,6 +52,7 @@ struct UITextureHandle {
|
|||||||
std::uint32_t width = 0;
|
std::uint32_t width = 0;
|
||||||
std::uint32_t height = 0;
|
std::uint32_t height = 0;
|
||||||
UITextureHandleKind kind = UITextureHandleKind::DescriptorHandle;
|
UITextureHandleKind kind = UITextureHandleKind::DescriptorHandle;
|
||||||
|
std::uintptr_t resourceHandle = 0;
|
||||||
|
|
||||||
constexpr bool IsValid() const {
|
constexpr bool IsValid() const {
|
||||||
return nativeHandle != 0 && width > 0 && height > 0;
|
return nativeHandle != 0 && width > 0 && height > 0;
|
||||||
|
|||||||
@@ -229,6 +229,8 @@ inline bool CreateViewportTextureDescriptor(
|
|||||||
targets.textureHandle.width = targets.width;
|
targets.textureHandle.width = targets.width;
|
||||||
targets.textureHandle.height = targets.height;
|
targets.textureHandle.height = targets.height;
|
||||||
targets.textureHandle.kind = ::XCEngine::UI::UITextureHandleKind::ShaderResourceView;
|
targets.textureHandle.kind = ::XCEngine::UI::UITextureHandleKind::ShaderResourceView;
|
||||||
|
targets.textureHandle.resourceHandle =
|
||||||
|
reinterpret_cast<std::uintptr_t>(targets.colorTexture);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user