mirror of
https://github.com/MadeOfJelly/MushMachine.git
synced 2024-10-29 22:45:34 +01:00
disable ms for gles
This commit is contained in:
parent
7a461111e1
commit
c48ae81238
@ -46,11 +46,14 @@ FBOBuilder& FBOBuilder::attachTexture(std::shared_ptr<Texture> tex, GLuint attac
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
//glFramebufferTexture2D(target, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, tex->getHandle(), 0);
|
|
||||||
if (tex->samples == 0u) {
|
if (tex->samples == 0u) {
|
||||||
glFramebufferTexture2D(target, attachment_type, GL_TEXTURE_2D, tex->getHandle(), 0);
|
glFramebufferTexture2D(target, attachment_type, GL_TEXTURE_2D, tex->getHandle(), 0);
|
||||||
} else {
|
} else {
|
||||||
|
#ifndef MM_OPENGL_3_GLES
|
||||||
glFramebufferTexture2D(target, attachment_type, GL_TEXTURE_2D_MULTISAMPLE, tex->getHandle(), 0);
|
glFramebufferTexture2D(target, attachment_type, GL_TEXTURE_2D_MULTISAMPLE, tex->getHandle(), 0);
|
||||||
|
#else
|
||||||
|
assert(false && "GLES has no multisampling support");
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
_fbo->_texAttachments.push_back(tex); // keep a ref at the fbo
|
_fbo->_texAttachments.push_back(tex); // keep a ref at the fbo
|
||||||
|
|
||||||
|
@ -37,7 +37,11 @@ void Texture::bind(uint32_t slot) const {
|
|||||||
if (samples == 0) {
|
if (samples == 0) {
|
||||||
glBindTexture(GL_TEXTURE_2D, _handle);
|
glBindTexture(GL_TEXTURE_2D, _handle);
|
||||||
} else {
|
} else {
|
||||||
|
#ifndef MM_OPENGL_3_GLES
|
||||||
glBindTexture(GL_TEXTURE_2D_MULTISAMPLE, _handle);
|
glBindTexture(GL_TEXTURE_2D_MULTISAMPLE, _handle);
|
||||||
|
#else
|
||||||
|
assert(false && "GLES has no multisampling support");
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -48,8 +52,12 @@ void Texture::resize(int32_t new_width, int32_t new_height) {
|
|||||||
glBindTexture(GL_TEXTURE_2D, _handle);
|
glBindTexture(GL_TEXTURE_2D, _handle);
|
||||||
glTexImage2D(GL_TEXTURE_2D, 0, _internalFormat, new_width, new_height, 0, _format, _type, NULL);
|
glTexImage2D(GL_TEXTURE_2D, 0, _internalFormat, new_width, new_height, 0, _format, _type, NULL);
|
||||||
} else {
|
} else {
|
||||||
|
#ifndef MM_OPENGL_3_GLES
|
||||||
glBindTexture(GL_TEXTURE_2D_MULTISAMPLE, _handle);
|
glBindTexture(GL_TEXTURE_2D_MULTISAMPLE, _handle);
|
||||||
glTexImage2DMultisample(GL_TEXTURE_2D_MULTISAMPLE, samples, _internalFormat, new_width, new_height, 0);
|
glTexImage2DMultisample(GL_TEXTURE_2D_MULTISAMPLE, samples, _internalFormat, new_width, new_height, 0);
|
||||||
|
#else
|
||||||
|
assert(false && "GLES has no multisampling support");
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
// HACK: super dirty
|
// HACK: super dirty
|
||||||
@ -71,6 +79,7 @@ Texture::handle_t Texture::createEmpty(int32_t internalFormat, int32_t width, in
|
|||||||
}
|
}
|
||||||
|
|
||||||
Texture::handle_t Texture::createEmptyMultiSampled(int32_t internalFormat, int32_t width, int32_t height, uint32_t samples) {
|
Texture::handle_t Texture::createEmptyMultiSampled(int32_t internalFormat, int32_t width, int32_t height, uint32_t samples) {
|
||||||
|
#ifndef MM_OPENGL_3_GLES
|
||||||
uint32_t id;
|
uint32_t id;
|
||||||
glGenTextures(1, &id);
|
glGenTextures(1, &id);
|
||||||
glBindTexture(GL_TEXTURE_2D_MULTISAMPLE, id);
|
glBindTexture(GL_TEXTURE_2D_MULTISAMPLE, id);
|
||||||
@ -82,6 +91,13 @@ Texture::handle_t Texture::createEmptyMultiSampled(int32_t internalFormat, int32
|
|||||||
|
|
||||||
// HACK: format + type?
|
// HACK: format + type?
|
||||||
return handle_t(new Texture(id, width, height, internalFormat, 0, 0, samples));
|
return handle_t(new Texture(id, width, height, internalFormat, 0, 0, samples));
|
||||||
|
#else
|
||||||
|
(void)internalFormat;
|
||||||
|
(void)width;
|
||||||
|
(void)height;
|
||||||
|
(void)samples;
|
||||||
|
assert(false && "GLES has no multisampling support");
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
} // MM::OpenGL
|
} // MM::OpenGL
|
||||||
|
Loading…
Reference in New Issue
Block a user