|
|
@ -148,6 +148,8 @@ GLenum AttachmentType(PixelFormat format) { |
|
|
switch (const SurfaceType type = VideoCore::Surface::GetFormatType(format); type) { |
|
|
switch (const SurfaceType type = VideoCore::Surface::GetFormatType(format); type) { |
|
|
case SurfaceType::Depth: |
|
|
case SurfaceType::Depth: |
|
|
return GL_DEPTH_ATTACHMENT; |
|
|
return GL_DEPTH_ATTACHMENT; |
|
|
|
|
|
case SurfaceType::Stencil: |
|
|
|
|
|
return GL_STENCIL_ATTACHMENT; |
|
|
case SurfaceType::DepthStencil: |
|
|
case SurfaceType::DepthStencil: |
|
|
return GL_DEPTH_STENCIL_ATTACHMENT; |
|
|
return GL_DEPTH_STENCIL_ATTACHMENT; |
|
|
default: |
|
|
default: |
|
|
@ -907,6 +909,8 @@ void Image::Scale(bool up_scale) { |
|
|
return GL_COLOR_ATTACHMENT0; |
|
|
return GL_COLOR_ATTACHMENT0; |
|
|
case SurfaceType::Depth: |
|
|
case SurfaceType::Depth: |
|
|
return GL_DEPTH_ATTACHMENT; |
|
|
return GL_DEPTH_ATTACHMENT; |
|
|
|
|
|
case SurfaceType::Stencil: |
|
|
|
|
|
return GL_STENCIL_ATTACHMENT; |
|
|
case SurfaceType::DepthStencil: |
|
|
case SurfaceType::DepthStencil: |
|
|
return GL_DEPTH_STENCIL_ATTACHMENT; |
|
|
return GL_DEPTH_STENCIL_ATTACHMENT; |
|
|
default: |
|
|
default: |
|
|
@ -920,8 +924,10 @@ void Image::Scale(bool up_scale) { |
|
|
return GL_COLOR_BUFFER_BIT; |
|
|
return GL_COLOR_BUFFER_BIT; |
|
|
case SurfaceType::Depth: |
|
|
case SurfaceType::Depth: |
|
|
return GL_DEPTH_BUFFER_BIT; |
|
|
return GL_DEPTH_BUFFER_BIT; |
|
|
|
|
|
case SurfaceType::Stencil: |
|
|
|
|
|
return GL_STENCIL_BUFFER_BIT; |
|
|
case SurfaceType::DepthStencil: |
|
|
case SurfaceType::DepthStencil: |
|
|
return GL_STENCIL_BUFFER_BIT | GL_DEPTH_BUFFER_BIT; |
|
|
|
|
|
|
|
|
return GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT; |
|
|
default: |
|
|
default: |
|
|
UNREACHABLE(); |
|
|
UNREACHABLE(); |
|
|
return GL_COLOR_BUFFER_BIT; |
|
|
return GL_COLOR_BUFFER_BIT; |
|
|
@ -933,8 +939,10 @@ void Image::Scale(bool up_scale) { |
|
|
return 0; |
|
|
return 0; |
|
|
case SurfaceType::Depth: |
|
|
case SurfaceType::Depth: |
|
|
return 1; |
|
|
return 1; |
|
|
case SurfaceType::DepthStencil: |
|
|
|
|
|
|
|
|
case SurfaceType::Stencil: |
|
|
return 2; |
|
|
return 2; |
|
|
|
|
|
case SurfaceType::DepthStencil: |
|
|
|
|
|
return 3; |
|
|
default: |
|
|
default: |
|
|
UNREACHABLE(); |
|
|
UNREACHABLE(); |
|
|
return 0; |
|
|
return 0; |
|
|
@ -1264,10 +1272,20 @@ Framebuffer::Framebuffer(TextureCacheRuntime& runtime, std::span<ImageView*, NUM |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (const ImageView* const image_view = depth_buffer; image_view) { |
|
|
if (const ImageView* const image_view = depth_buffer; image_view) { |
|
|
if (GetFormatType(image_view->format) == SurfaceType::DepthStencil) { |
|
|
|
|
|
|
|
|
switch (GetFormatType(image_view->format)) { |
|
|
|
|
|
case SurfaceType::Depth: |
|
|
|
|
|
buffer_bits |= GL_DEPTH_BUFFER_BIT; |
|
|
|
|
|
break; |
|
|
|
|
|
case SurfaceType::Stencil: |
|
|
|
|
|
buffer_bits |= GL_STENCIL_BUFFER_BIT; |
|
|
|
|
|
break; |
|
|
|
|
|
case SurfaceType::DepthStencil: |
|
|
buffer_bits |= GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT; |
|
|
buffer_bits |= GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT; |
|
|
} else { |
|
|
|
|
|
|
|
|
break; |
|
|
|
|
|
default: |
|
|
|
|
|
UNREACHABLE(); |
|
|
buffer_bits |= GL_DEPTH_BUFFER_BIT; |
|
|
buffer_bits |= GL_DEPTH_BUFFER_BIT; |
|
|
|
|
|
break; |
|
|
} |
|
|
} |
|
|
const GLenum attachment = AttachmentType(image_view->format); |
|
|
const GLenum attachment = AttachmentType(image_view->format); |
|
|
AttachTexture(handle, attachment, image_view); |
|
|
AttachTexture(handle, attachment, image_view); |
|
|
|