Call getNearestSamples() in Framebuffer::setAttachment() The app jp.garud.ssimulator uses the same sample count of '2' for both glRenderbufferStorageMultisampleEXT() and glFramebufferTexture2DMultisampleEXT(). However, when glRenderbufferStorageMultisampleEXT() is called, Renderbuffer::setStorageMultisample() calls TextureCaps::getNearestSamples() which rounds up the sample count from '2' to '4'. Later, when the app tries to draw with the framebuffer, an error is generated by ANGLE: Framebuffer is incomplete: Attachments have different sample counts. The fix is to also call TextureCaps::getNearestSamples() in Framebuffer::setAttachment() to make sure the sample count passed into glFramebufferTexture2DMultisampleEXT() is also rounded up to match the renderbuffer. Bug: angleproject:6183 Test: MultisampledRenderToTextureTest.FramebufferCompletenessSmallSampleCount Change-Id: I58be9986077257f4767f2e528c2f87e496d9d774 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3036254 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Tim Van Patten <timvp@google.com>