|
@@ -56,6 +56,8 @@ GLuint RasterizerStorageGLES2::system_fbo = 0;
|
|
|
|
|
|
#define _RED_OES 0x1903
|
|
#define _RED_OES 0x1903
|
|
|
|
|
|
|
|
+#define _DEPTH_COMPONENT24_OES 0x81A6
|
|
|
|
+
|
|
void RasterizerStorageGLES2::bind_quad_array() const {
|
|
void RasterizerStorageGLES2::bind_quad_array() const {
|
|
glBindBuffer(GL_ARRAY_BUFFER, resources.quadie);
|
|
glBindBuffer(GL_ARRAY_BUFFER, resources.quadie);
|
|
glVertexAttribPointer(VS::ARRAY_VERTEX, 2, GL_FLOAT, GL_FALSE, sizeof(float) * 4, 0);
|
|
glVertexAttribPointer(VS::ARRAY_VERTEX, 2, GL_FLOAT, GL_FALSE, sizeof(float) * 4, 0);
|
|
@@ -4307,7 +4309,7 @@ void RasterizerStorageGLES2::_render_target_allocate(RenderTarget *rt) {
|
|
glGenTextures(1, &rt->depth);
|
|
glGenTextures(1, &rt->depth);
|
|
glBindTexture(GL_TEXTURE_2D, rt->depth);
|
|
glBindTexture(GL_TEXTURE_2D, rt->depth);
|
|
|
|
|
|
- glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT, rt->width, rt->height, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, NULL);
|
|
|
|
|
|
+ glTexImage2D(GL_TEXTURE_2D, 0, config.depth_internalformat, rt->width, rt->height, 0, GL_DEPTH_COMPONENT, config.depth_type, NULL);
|
|
|
|
|
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
|
@@ -4534,7 +4536,7 @@ RID RasterizerStorageGLES2::canvas_light_shadow_buffer_create(int p_width) {
|
|
glGenTextures(1, &cls->depth);
|
|
glGenTextures(1, &cls->depth);
|
|
glBindTexture(GL_TEXTURE_2D, cls->depth);
|
|
glBindTexture(GL_TEXTURE_2D, cls->depth);
|
|
|
|
|
|
- glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT, cls->size, cls->height, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, NULL);
|
|
|
|
|
|
+ glTexImage2D(GL_TEXTURE_2D, 0, config.depth_internalformat, cls->size, cls->height, 0, GL_DEPTH_COMPONENT, config.depth_type, NULL);
|
|
|
|
|
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
|
@@ -4974,6 +4976,9 @@ void RasterizerStorageGLES2::initialize() {
|
|
config.pvrtc_supported = false;
|
|
config.pvrtc_supported = false;
|
|
config.etc1_supported = false;
|
|
config.etc1_supported = false;
|
|
config.support_npot_repeat_mipmap = true;
|
|
config.support_npot_repeat_mipmap = true;
|
|
|
|
+ config.depth_internalformat = GL_DEPTH_COMPONENT;
|
|
|
|
+ config.depth_type = GL_UNSIGNED_INT;
|
|
|
|
+
|
|
#else
|
|
#else
|
|
config.float_texture_supported = config.extensions.has("GL_ARB_texture_float") || config.extensions.has("GL_OES_texture_float");
|
|
config.float_texture_supported = config.extensions.has("GL_ARB_texture_float") || config.extensions.has("GL_OES_texture_float");
|
|
config.s3tc_supported = config.extensions.has("GL_EXT_texture_compression_s3tc") || config.extensions.has("WEBGL_compressed_texture_s3tc");
|
|
config.s3tc_supported = config.extensions.has("GL_EXT_texture_compression_s3tc") || config.extensions.has("WEBGL_compressed_texture_s3tc");
|
|
@@ -4981,6 +4986,14 @@ void RasterizerStorageGLES2::initialize() {
|
|
config.pvrtc_supported = config.extensions.has("IMG_texture_compression_pvrtc");
|
|
config.pvrtc_supported = config.extensions.has("IMG_texture_compression_pvrtc");
|
|
config.support_npot_repeat_mipmap = config.extensions.has("GL_OES_texture_npot");
|
|
config.support_npot_repeat_mipmap = config.extensions.has("GL_OES_texture_npot");
|
|
|
|
|
|
|
|
+ if (config.extensions.has("GL_OES_depth24")) {
|
|
|
|
+ config.depth_internalformat = _DEPTH_COMPONENT24_OES;
|
|
|
|
+ config.depth_type = GL_UNSIGNED_INT;
|
|
|
|
+ } else {
|
|
|
|
+ config.depth_internalformat = GL_DEPTH_COMPONENT16;
|
|
|
|
+ config.depth_type = GL_UNSIGNED_SHORT;
|
|
|
|
+ }
|
|
|
|
+
|
|
#endif
|
|
#endif
|
|
#ifdef GLES_OVER_GL
|
|
#ifdef GLES_OVER_GL
|
|
config.use_rgba_2d_shadows = false;
|
|
config.use_rgba_2d_shadows = false;
|