mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-12 09:09:29 +01:00
Implement GetFramebufferAPITexture for Vulkan
This commit is contained in:
1 parent
0c7ae95df5
commit
6e9cd933b2
2 files changed
+20
-2
No files matched your search
@@ -515,7 +515,8 @@ VkImageView VulkanRenderManager::BindFramebufferAsTexture(VKRFramebuffer *fb, in
|
||||
steps_[i]->render.finalColorLayout = VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL;
|
||||
break;
|
||||
}
|
||||
else {
|
||||
else if (steps_[i]->render.finalColorLayout != VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL) {
|
||||
Crash();
|
||||
// May need to shadow the framebuffer if we re-order passes later.
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1315,11 +1315,28 @@ void VKContext::BindFramebufferAsTexture(Framebuffer *fbo, int binding, FBChanne
|
||||
if (channelBit & FBChannel::FB_COLOR_BIT) aspect |= VK_IMAGE_ASPECT_COLOR_BIT;
|
||||
if (channelBit & FBChannel::FB_DEPTH_BIT) aspect |= VK_IMAGE_ASPECT_DEPTH_BIT;
|
||||
if (channelBit & FBChannel::FB_STENCIL_BIT) aspect |= VK_IMAGE_ASPECT_STENCIL_BIT;
|
||||
|
||||
ILOG("Binding image as texture: %x", (int)fb->GetFB()->color.image);
|
||||
|
||||
boundImageView_[0] = renderManager_.BindFramebufferAsTexture(fb->GetFB(), binding, aspect, attachment);
|
||||
}
|
||||
|
||||
uintptr_t VKContext::GetFramebufferAPITexture(Framebuffer *fbo, int channelBit, int attachment) {
|
||||
return 0;
|
||||
if (!fbo)
|
||||
return 0;
|
||||
|
||||
VKFramebuffer *fb = (VKFramebuffer *)fbo;
|
||||
VkImageView view = VK_NULL_HANDLE;
|
||||
switch (channelBit) {
|
||||
case FB_COLOR_BIT:
|
||||
view = fb->GetFB()->color.imageView;
|
||||
break;
|
||||
case FB_DEPTH_BIT:
|
||||
case FB_STENCIL_BIT:
|
||||
view = fb->GetFB()->depth.imageView;
|
||||
break;
|
||||
}
|
||||
return (uintptr_t)view;
|
||||
}
|
||||
|
||||
void VKContext::GetFramebufferDimensions(Framebuffer *fbo, int *w, int *h) {
|
||||
|
||||
Reference in new issue
Block a user