简体   繁体   English

Oculus Rift / Vulkan:使用计算着色器写入交换链

[英]Oculus Rift / Vulkan : Write to swapchain with a compute shader

I would like to write to the swapchain generated by OVR with a compute shader.我想用计算着色器写入 OVR 生成的交换链。 The problem is that the images don't have the usage VK_IMAGE_USAGE_STORAGE_BIT .问题是图像没有使用VK_IMAGE_USAGE_STORAGE_BIT

The creation of the swapchain is done with ovr_CreateTextureSwapChainVk which ask for a flag BindFlags .交换链的创建是使用ovr_CreateTextureSwapChainVk完成的,它要求一个标志BindFlags I added the flag ovrTextureBind_DX_UnorderedAccess but still the images don't have the correct usage.我添加了标志ovrTextureBind_DX_UnorderedAccess但图像仍然没有正确使用。

The problem is that the images don't have the usage VK_IMAGE_USAGE_STORAGE_BIT .问题是图像没有使用VK_IMAGE_USAGE_STORAGE_BIT

Then you cannot write to a swapchain image directly with a compute shader.然后,您无法使用计算着色器直接写入交换链图像。

The display engine that provides the swapchain images has the right to decide how you may and may not use them.提供交换链图像的显示引擎有权决定您如何使用和不可以使用它们。 The only method of interaction which is required is the ability to use them as a color render target;唯一需要的交互方法是将它们用作颜色渲染目标的能力; everything else is optional.其他一切都是可选的。

So you will have to do this another way, perhaps by writing to an intermediate image and copying/rendering it to the swapchain image.因此,您将不得不以另一种方式执行此操作,可能是通过写入中间图像并将其复制/渲染到交换链图像。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM