0

I have a case where I am writing to integer framebuffers, and I want to use logic operations when writing to pixels in the fragment shader. These are the steps I followed:

  1. When creating the logical device, I set the VkPhysicalDeviceFeatures.logicOp to VK_TRUE (so this feature is enabled)
  2. when creating the pipeline, I set VkPipelineColorBlendStateCreateInfo.logicOpEnable to VK_TRUE, and VkPipelineColorBlendStateCreateInfo.logicOp to VK_LOGIC_OP_COPY.

My framebuffer format is VK_FORMAT_R32G32B32A32_SINT

Once I render the frame, I see that nothing is getting updated in the frame buffer. Is there any step I am missing? (btw, I don't get any validation errors).

Thanks!

  • "*I see that nothing is getting updated in the frame buffer*" How do you see that? If you turn off logic ops entirely, do you get values in the framebuffer? – Nicol Bolas Aug 27 '22 at 13:32
  • @NicolBolas even with logicOpEnable set to false, nothing gets updated in the framebuffer. As for how I see it --- I simply copy it to the cpu after the rendering pass. Just to make sure, I just replaced the type to float in code. With blend disabled, again empty framebuffer, and with blend enabled the framebuffer gets updated. – Harish Doraiswamy Aug 27 '22 at 14:58
  • "*With blend disabled, again empty framebuffer, and with blend enabled the framebuffer gets updated.*" Your code has a bug in it somewhere, then. I'd guess that there's a lack of synchronization going on or something, but only you can debug it. – Nicol Bolas Aug 27 '22 at 15:09
  • @NicolBolas yeah, looks like there is a bug. and I just found it. Basically, when I set blendEnable to false. I don't any other property in VkPipelineColorBlendAttachmentState which is causing this issue. All I had to do was also set the colorWriteMask, and once this was set, it worked. Even the logicOps started working. Anyways, thanks for the responding... in a way your comment about having "blend disabled" had me look further into why this was happening. – Harish Doraiswamy Aug 27 '22 at 15:20

0 Answers0