Implement GetFramebufferAPITexture for Vulkan

This commit is contained in:
Henrik Rydgård committed 2017-10-31 12:34:30 +01:00
1 parent 0c7ae95df5
commit 6e9cd933b2
2 files changed
+20 -2

No files matched your search

+2 -1
View File
@@ -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.
}
}
+18 -1
View File
@@ -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) {