Skip to content

Commit

Permalink
Apply MSAA only to the scene framebuffer
Browse files Browse the repository at this point in the history
  • Loading branch information
past-due committed Oct 14, 2023
1 parent 4cc7d73 commit cc35f21
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
4 changes: 2 additions & 2 deletions lib/ivis_opengl/gfx_api_vk.cpp
Expand Up @@ -2694,7 +2694,7 @@ static bool createDepthStencilImage(const vk::PhysicalDevice& physicalDevice, co

void VkRoot::createDefaultRenderpass(vk::Format swapchainFormat, vk::Format depthFormat)
{
bool msaaEnabled = (msaaSamples != vk::SampleCountFlagBits::e1);
bool msaaEnabled = false; // default render pass doesn't get MSAA

auto attachments =
std::vector<vk::AttachmentDescription>{
Expand Down Expand Up @@ -2777,7 +2777,7 @@ void VkRoot::createDefaultRenderpass(vk::Format swapchainFormat, vk::Format dept

renderPasses[DEFAULT_RENDER_PASS_ID].rp_compat_info = std::make_shared<VkhRenderPassCompat>(createInfo);
renderPasses[DEFAULT_RENDER_PASS_ID].rp = dev.createRenderPass(createInfo, nullptr, vkDynLoader);
renderPasses[DEFAULT_RENDER_PASS_ID].msaaSamples = msaaSamples;
renderPasses[DEFAULT_RENDER_PASS_ID].msaaSamples = (msaaEnabled) ? msaaSamples : vk::SampleCountFlagBits::e1;

// createFramebuffers for default render pass
ASSERT(!swapchainImageView.empty(), "No swapchain image views?");
Expand Down
7 changes: 2 additions & 5 deletions lib/sdl/main_sdl.cpp
Expand Up @@ -2560,11 +2560,8 @@ void wzSDLPreWindowCreate_InitOpenGLAttributes(int antialiasing, bool useOpenGLE
// Enable stencil buffer, needed for shadows to work.
SDL_GL_SetAttribute(SDL_GL_STENCIL_SIZE, 8);

if (antialiasing)
{
SDL_GL_SetAttribute(SDL_GL_MULTISAMPLEBUFFERS, 1);
SDL_GL_SetAttribute(SDL_GL_MULTISAMPLESAMPLES, antialiasing);
}
// Do *not* enable multisampling on the default framebuffer (i.e. setting SDL_GL_MULTISAMPLEBUFFERS)
// This is handled separately for the scene render buffer / frame buffer

if (!sdl_OpenGL_Impl::configureOpenGLContextRequest(sdl_OpenGL_Impl::getInitialContextRequest(useOpenGLES), useOpenGLESLibrary))
{
Expand Down

0 comments on commit cc35f21

Please sign in to comment.