0

enter image description here

I use pResolveAttachment to implement MSAA with Vulkan on Android, but the result is flipped.

    VkSubpassDescription subpassDesc;
    subpassDesc.flags = 0;
    subpassDesc.pipelineBindPoint = VK_PIPELINE_BIND_POINT_GRAPHICS;
    subpassDesc.inputAttachmentCount = 0;
    subpassDesc.pInputAttachments = nullptr;
    subpassDesc.colorAttachmentCount = colorAttachmentCount;
    subpassDesc.pColorAttachments = attachmentRefs.data();
    subpassDesc.pResolveAttachments = resolveAttachmentCount > 0 ? resolveReferences.data() : nullptr;
    subpassDesc.pDepthStencilAttachment = depthStencilAttachment;
    subpassDesc.preserveAttachmentCount = 0;
    subpassDesc.pPreserveAttachments = nullptr;

// TIPS
resolveReferences[resolveAttachmentCount].attachment = attachmentCount;
resolveReferences[resolveAttachmentCount].layout = VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL;

resolveAttachmentCount++;

....

subpassDesc.pResolveAttachments = resolveAttachmentCount > 0 ? resolveReferences.data() : nullptr;
realxie
  • 109
  • 3
  • I wander whether the result is correspond to the NDC coordinate system and texture coordinate system. – realxie Jan 16 '20 at 02:31
  • That's curious - what device are you using? – Lewis Gordon Jan 21 '20 at 11:15
  • android, and the cpu is snapdragon 835 – realxie Feb 03 '20 at 08:09
  • Weird, I've got some MSAA test code and I've just tested it on a device with the same chipset and it's not flipping for me. I can't think of anything in the resolve path that would have that effect – Lewis Gordon Feb 06 '20 at 14:54
  • yes, it's very weird, maybe I set some wrong parameters for the pipeline object. – realxie Feb 09 '20 at 11:10
  • If you are using the oculus mobile SDK, I unfortunately don't have a solution, but I might have an explanation: Oculus documentation state that vrapi_EnterVrMode() is called from an OpenGL ES context, current on the Android window surface. I guess that explains this behavior. – Leon Apr 19 '20 at 13:55

0 Answers0