Skip to content

Vulkan: Graphics support does not work for multiple color attachments #543

@sarahM0

Description

@sarahM0

Graphics support does not work for multiple color attachments. For example this amber script does not pass.

SHADER vertex vert_shader PASSTHROUGH
SHADER fragment frag_shader GLSL
#version 430
layout(location = 0) out vec4 color_out;
layout(location = 1) out vec4 color_out1;
void main() {
  color_out = vec4(0.0, 0.5, 0.0, 0.8);
  color_out1 = vec4(1.0, 1.0, 1.0, 1.0);
}
END

BUFFER framebuffer FORMAT B8G8R8A8_UNORM
BUFFER framebuffer1 FORMAT B8G8R8A8_UNORM

PIPELINE graphics my_pipeline
  ATTACH vert_shader
  ATTACH frag_shader
  FRAMEBUFFER_SIZE 800 600
  BIND BUFFER framebuffer AS color LOCATION 0
  BIND BUFFER framebuffer1 AS color LOCATION 1
END

RUN my_pipeline DRAW_RECT POS 0 0 SIZE 250 250
EXPECT framebuffer IDX 0 0 SIZE 250 250 EQ_RGBA 0 127 0 204
EXPECT framebuffer1 IDX 0 0 SIZE 250 250 EQ_RGBA 255 255 255 255
[ERROR] validation layer (Validation):
 [ VUID-VkGraphicsPipelineCreateInfo-attachmentCount-00746 ] Object: 0x565254967b50 (Type = 3) | vkCreateGraphicsPipelines(): Render pass (0x6) subpass 0 has colorAttachmentCount of 2 which doesn't match the pColorBlendState->attachmentCount of 1. The Vulkan spec states: If rasterization is not disabled and the subpass uses color attachments, the attachmentCount member of pColorBlendState must be equal to the colorAttachmentCount used to create subpass (https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-attachmentCount-00746)
../amber/tests/cases/draw_rect_mutliple_color_attachment.amber: Line 40: Probe failed at: 0, 0
  Expected RGBA: 255.000000, 255.000000, 255.000000, 255.000000
  Actual RGBA: 0.000000, 0.000000, 0.000000, 0.000000
Probe failed in 62500 pixels

Summary of Failures:
  ../amber/tests/cases/draw_rect_mutliple_color_attachment.amber

Summary: 0 pass, 1 fail

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions