mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-14 15:46:28 +00:00
nxtSwapChainNextTexture: make texture a union of ptr, u32, u64
Making all textures represented by pointers is a problem for Vulkan where VkImage is a 64bit type and wouldn't fit in a pointer on 32bit builds. Make texture contain on of each useful type so that each backend can choose which one it wants to receive.
This commit is contained in:
committed by
Corentin Wallez
parent
c0f5ca1f5a
commit
0887236c81
@@ -177,7 +177,7 @@ namespace utils {
|
||||
}
|
||||
|
||||
nxtSwapChainError GetNextTexture(nxtSwapChainNextTexture* nextTexture) {
|
||||
nextTexture->texture = mRenderTargetResources[mRenderTargetIndex].Get();
|
||||
nextTexture->texture.ptr = mRenderTargetResources[mRenderTargetIndex].Get();
|
||||
return NXT_SWAP_CHAIN_NO_ERROR;
|
||||
}
|
||||
|
||||
|
||||
@@ -86,7 +86,7 @@ namespace utils {
|
||||
mCurrentTexture = mCurrentDrawable.texture;
|
||||
[mCurrentTexture retain];
|
||||
|
||||
nextTexture->texture = reinterpret_cast<void*>(mCurrentTexture);
|
||||
nextTexture->texture.ptr = reinterpret_cast<void*>(mCurrentTexture);
|
||||
|
||||
return NXT_SWAP_CHAIN_NO_ERROR;
|
||||
}
|
||||
|
||||
@@ -74,7 +74,7 @@ namespace utils {
|
||||
}
|
||||
|
||||
nxtSwapChainError GetNextTexture(nxtSwapChainNextTexture* nextTexture) {
|
||||
nextTexture->texture = reinterpret_cast<void*>(static_cast<size_t>(mBackTexture));
|
||||
nextTexture->texture.u32 = mBackTexture;
|
||||
return NXT_SWAP_CHAIN_NO_ERROR;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user