mirror of
https://github.com/blawar/GLideN64.git
synced 2024-07-04 10:03:36 +00:00
Disable multisampling related code for GLES below 3.1
This commit is contained in:
parent
f754943515
commit
b728ab97a7
|
@ -120,21 +120,23 @@ void DepthBuffer::_initDepthBufferTexture(FrameBuffer * _pBuffer, CachedTexture
|
|||
_pTexture->textureBytes = _pTexture->realWidth * _pTexture->realHeight * sizeof(float);
|
||||
textureCache().addFrameBufferTextureSize(_pTexture->textureBytes);
|
||||
|
||||
#ifdef GL_MULTISAMPLING_SUPPORT
|
||||
if (_multisample) {
|
||||
glBindTexture(GL_TEXTURE_2D_MULTISAMPLE, _pTexture->glName);
|
||||
#ifndef GLESX
|
||||
if (_pBuffer != NULL)
|
||||
glTexImage2DMultisample(GL_TEXTURE_2D_MULTISAMPLE, config.video.multisampling, GL_DEPTH_COMPONENT, _pBuffer->m_pTexture->realWidth, _pBuffer->m_pTexture->realHeight, false);
|
||||
else
|
||||
glTexImage2DMultisample(GL_TEXTURE_2D_MULTISAMPLE, config.video.multisampling, GL_DEPTH_COMPONENT, video().getWidth(), video().getHeight(), false);
|
||||
#elif defined(GLES3_1)
|
||||
#if defined(GLES3_1)
|
||||
if (_pBuffer != NULL)
|
||||
glTexStorage2DMultisample(GL_TEXTURE_2D_MULTISAMPLE, config.video.multisampling, GL_DEPTH_COMPONENT, _pBuffer->m_pTexture->realWidth, _pBuffer->m_pTexture->realHeight, false);
|
||||
else
|
||||
glTexStorage2DMultisample(GL_TEXTURE_2D_MULTISAMPLE, config.video.multisampling, GL_DEPTH_COMPONENT, video().getWidth(), video().getHeight(), false);
|
||||
#else
|
||||
if (_pBuffer != NULL)
|
||||
glTexImage2DMultisample(GL_TEXTURE_2D_MULTISAMPLE, config.video.multisampling, GL_DEPTH_COMPONENT, _pBuffer->m_pTexture->realWidth, _pBuffer->m_pTexture->realHeight, false);
|
||||
else
|
||||
glTexImage2DMultisample(GL_TEXTURE_2D_MULTISAMPLE, config.video.multisampling, GL_DEPTH_COMPONENT, video().getWidth(), video().getHeight(), false);
|
||||
#endif
|
||||
}
|
||||
else {
|
||||
} else
|
||||
#endif // GL_MULTISAMPLING_SUPPORT
|
||||
{
|
||||
glBindTexture(GL_TEXTURE_2D, _pTexture->glName);
|
||||
if (_pBuffer != NULL)
|
||||
glTexImage2D(GL_TEXTURE_2D, 0, DEPTH_COMPONENT_FORMAT, _pBuffer->m_pTexture->realWidth, _pBuffer->m_pTexture->realHeight, 0, GL_DEPTH_COMPONENT, GL_FLOAT, NULL);
|
||||
|
@ -149,9 +151,11 @@ void DepthBuffer::_initDepthBufferTexture(FrameBuffer * _pBuffer, CachedTexture
|
|||
|
||||
void DepthBuffer::setDepthAttachment(GLenum _target)
|
||||
{
|
||||
#ifdef GL_MULTISAMPLING_SUPPORT
|
||||
if (config.video.multisampling != 0)
|
||||
glFramebufferTexture2D(_target, GL_DEPTH_ATTACHMENT, GL_TEXTURE_2D_MULTISAMPLE, m_pDepthBufferTexture->glName, 0);
|
||||
else
|
||||
#endif
|
||||
glFramebufferTexture2D(_target, GL_DEPTH_ATTACHMENT, GL_TEXTURE_2D, m_pDepthBufferTexture->glName, 0);
|
||||
m_resolved = false;
|
||||
}
|
||||
|
|
|
@ -190,21 +190,21 @@ void FrameBuffer::init(u32 _address, u32 _endAddress, u16 _format, u16 _size, u1
|
|||
_initTexture(_format, _size, m_pTexture);
|
||||
glBindFramebuffer(GL_FRAMEBUFFER, m_FBO);
|
||||
|
||||
#ifdef GL_MULTISAMPLING_SUPPORT
|
||||
if (config.video.multisampling != 0) {
|
||||
glBindTexture(GL_TEXTURE_2D_MULTISAMPLE, m_pTexture->glName);
|
||||
#ifndef GLESX
|
||||
if (_size > G_IM_SIZ_8b)
|
||||
glTexImage2DMultisample(GL_TEXTURE_2D_MULTISAMPLE, config.video.multisampling, GL_RGBA8, m_pTexture->realWidth, m_pTexture->realHeight, false);
|
||||
else
|
||||
glTexImage2DMultisample(GL_TEXTURE_2D_MULTISAMPLE, config.video.multisampling, monohromeInternalformat, m_pTexture->realWidth, m_pTexture->realHeight, false);
|
||||
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D_MULTISAMPLE, m_pTexture->glName, 0);
|
||||
#elif defined(GLES3_1)
|
||||
#if defined(GLES3_1)
|
||||
if (_size > G_IM_SIZ_8b)
|
||||
glTexStorage2DMultisample(GL_TEXTURE_2D_MULTISAMPLE, config.video.multisampling, GL_RGBA8, m_pTexture->realWidth, m_pTexture->realHeight, false);
|
||||
else
|
||||
glTexStorage2DMultisample(GL_TEXTURE_2D_MULTISAMPLE, config.video.multisampling, monohromeInternalformat, m_pTexture->realWidth, m_pTexture->realHeight, false);
|
||||
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D_MULTISAMPLE, m_pTexture->glName, 0);
|
||||
#else
|
||||
if (_size > G_IM_SIZ_8b)
|
||||
glTexImage2DMultisample(GL_TEXTURE_2D_MULTISAMPLE, config.video.multisampling, GL_RGBA8, m_pTexture->realWidth, m_pTexture->realHeight, false);
|
||||
else
|
||||
glTexImage2DMultisample(GL_TEXTURE_2D_MULTISAMPLE, config.video.multisampling, monohromeInternalformat, m_pTexture->realWidth, m_pTexture->realHeight, false);
|
||||
#endif
|
||||
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D_MULTISAMPLE, m_pTexture->glName, 0);
|
||||
|
||||
m_pResolveTexture = textureCache().addFrameBufferTexture();
|
||||
_initTexture(_format, _size, m_pResolveTexture);
|
||||
|
@ -215,6 +215,7 @@ void FrameBuffer::init(u32 _address, u32 _endAddress, u16 _format, u16 _size, u1
|
|||
|
||||
glBindFramebuffer(GL_FRAMEBUFFER, m_FBO);
|
||||
} else
|
||||
#endif // GL_MULTISAMPLING_SUPPORT
|
||||
_setAndAttachTexture(_size, m_pTexture);
|
||||
}
|
||||
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
#include "glext.h"
|
||||
#include "windows/GLFunctions.h"
|
||||
#define GL_IMAGE_TEXTURES_SUPPORT
|
||||
#define GL_MULTISAMPLING_SUPPORT
|
||||
#else
|
||||
#include "winlnxdefs.h"
|
||||
#ifdef GLES2
|
||||
|
@ -25,6 +26,7 @@
|
|||
#include <GLES3/gl3ext.h>
|
||||
#define GLESX
|
||||
#define GL_IMAGE_TEXTURES_SUPPORT
|
||||
#define GL_MULTISAMPLING_SUPPORT
|
||||
#else
|
||||
#define GL_GLEXT_PROTOTYPES
|
||||
#if defined(OS_MAC_OS_X)
|
||||
|
@ -35,6 +37,7 @@
|
|||
#include <GL/gl.h>
|
||||
#include <GL/glext.h>
|
||||
#define GL_IMAGE_TEXTURES_SUPPORT
|
||||
#define GL_MULTISAMPLING_SUPPORT
|
||||
#endif // OS_MAC_OS_X
|
||||
#endif // GLES2
|
||||
#ifdef USE_SDL
|
||||
|
|
Loading…
Reference in New Issue
Block a user