![]() |
|
How to bind framebuffer as texture in vulkan? - Printable Version +- Dolphin, the GameCube and Wii emulator - Forums (https://forums.dolphin-emu.org) +-- Forum: Dolphin Emulator Discussion and Support (https://forums.dolphin-emu.org/Forum-dolphin-emulator-discussion-and-support) +--- Forum: Development Discussion (https://forums.dolphin-emu.org/Forum-development-discussion) +--- Thread: How to bind framebuffer as texture in vulkan? (/Thread-how-to-bind-framebuffer-as-texture-in-vulkan) |
How to bind framebuffer as texture in vulkan? - weihuoya - 08-30-2018 Could it realized framebuffer fetch in vulkan? My android phone isn't support dual source blend, so I want to bind current framebuffer as texture, and fetch color in shader. But it don't work what I expected. so anyone could help me to do this? Code: void Renderer::BindFramebufferAsTexture(u32 index)Code: void VertexManager::vFlush()Code: ShaderCode GeneratePixelShaderCode(APIType ApiType, const ShaderHostConfig& host_config,RE: How to bind framebuffer as texture in vulkan? - DJBarry004 - 08-31-2018 After a quick search, it seems to be doable only in GL. https://stackoverflow.com/.../bind-screen-framebuffer-to-texture Nonetheless, I think this tutorial could help. https://vulkan-tutorial.com/Drawing_a_triangle/Drawing/Framebuffers RE: How to bind framebuffer as texture in vulkan? - Helios - 08-31-2018 Since they already wrote some code trying to do it, I'm going to assume that they already googled. Anyways, from one of the graphics peeps. < Stenzek> pretty sure it's not going to work well < Stenzek> especially if their GPU is a tiler RE: How to bind framebuffer as texture in vulkan? - JonnyH - 08-31-2018 No, this won't work as is - you need some magic to ensure the texture read is consistent with the last framebuffer write, and not some stale cached value. I don't think this is yet exposed in vulkan. A workaround may be to schedule a copy blit for the current framebuffer to a new texture and read that, but that has obvious performance implications. |