diff options
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/gles3/rasterizer_scene_gles3.cpp | 4 | ||||
| -rw-r--r-- | drivers/gles3/storage/material_storage.cpp | 17 | ||||
| -rw-r--r-- | drivers/gles3/storage/particles_storage.cpp | 14 | ||||
| -rw-r--r-- | drivers/gles3/storage/texture_storage.cpp | 9 |
4 files changed, 26 insertions, 18 deletions
diff --git a/drivers/gles3/rasterizer_scene_gles3.cpp b/drivers/gles3/rasterizer_scene_gles3.cpp index 6ed5b3b2f8..e6e7dd6f17 100644 --- a/drivers/gles3/rasterizer_scene_gles3.cpp +++ b/drivers/gles3/rasterizer_scene_gles3.cpp @@ -2063,8 +2063,6 @@ void RasterizerSceneGLES3::_render_list_template(RenderListParameters *p_params, GLES3::MeshStorage *mesh_storage = GLES3::MeshStorage::get_singleton(); GLES3::ParticlesStorage *particles_storage = GLES3::ParticlesStorage::get_singleton(); GLES3::MaterialStorage *material_storage = GLES3::MaterialStorage::get_singleton(); - GLES3::TextureStorage *texture_storage = GLES3::TextureStorage::get_singleton(); - GLES3::Config *config = GLES3::Config::get_singleton(); GLuint prev_vertex_array_gl = 0; GLuint prev_index_array_gl = 0; @@ -2097,6 +2095,8 @@ void RasterizerSceneGLES3::_render_list_template(RenderListParameters *p_params, } if constexpr (p_pass_mode == PASS_MODE_COLOR || p_pass_mode == PASS_MODE_COLOR_TRANSPARENT) { + GLES3::TextureStorage *texture_storage = GLES3::TextureStorage::get_singleton(); + GLES3::Config *config = GLES3::Config::get_singleton(); glActiveTexture(GL_TEXTURE0 + config->max_texture_image_units - 2); GLuint texture_to_bind = texture_storage->get_texture(texture_storage->texture_gl_get_default(GLES3::DEFAULT_GL_TEXTURE_CUBEMAP_BLACK))->tex_id; if (p_render_data->environment.is_valid()) { diff --git a/drivers/gles3/storage/material_storage.cpp b/drivers/gles3/storage/material_storage.cpp index ce9cf78c12..d0746a8fc8 100644 --- a/drivers/gles3/storage/material_storage.cpp +++ b/drivers/gles3/storage/material_storage.cpp @@ -947,7 +947,7 @@ void MaterialData::update_textures(const HashMap<StringName, Variant> &p_paramet } } break; case ShaderLanguage::TYPE_SAMPLERCUBEARRAY: { - ERR_PRINT_ONCE("Type: SamplerCubeArray not supported in OpenGL renderer, please use another type."); + ERR_PRINT_ONCE("Type: SamplerCubeArray not supported in GL Compatibility rendering backend, please use another type."); } break; case ShaderLanguage::TYPE_ISAMPLER3D: @@ -1396,22 +1396,25 @@ MaterialStorage::MaterialStorage() { //actions.renames["GRAVITY"] = "current_gravity"; actions.renames["EMISSION_TRANSFORM"] = "emission_transform"; actions.renames["RANDOM_SEED"] = "random_seed"; - actions.renames["FLAG_EMIT_POSITION"] = "EMISSION_FLAG_HAS_POSITION"; - actions.renames["FLAG_EMIT_ROT_SCALE"] = "EMISSION_FLAG_HAS_ROTATION_SCALE"; - actions.renames["FLAG_EMIT_VELOCITY"] = "EMISSION_FLAG_HAS_VELOCITY"; - actions.renames["FLAG_EMIT_COLOR"] = "EMISSION_FLAG_HAS_COLOR"; - actions.renames["FLAG_EMIT_CUSTOM"] = "EMISSION_FLAG_HAS_CUSTOM"; actions.renames["RESTART_POSITION"] = "restart_position"; actions.renames["RESTART_ROT_SCALE"] = "restart_rotation_scale"; actions.renames["RESTART_VELOCITY"] = "restart_velocity"; actions.renames["RESTART_COLOR"] = "restart_color"; actions.renames["RESTART_CUSTOM"] = "restart_custom"; - actions.renames["emit_subparticle"] = "emit_subparticle"; actions.renames["COLLIDED"] = "collided"; actions.renames["COLLISION_NORMAL"] = "collision_normal"; actions.renames["COLLISION_DEPTH"] = "collision_depth"; actions.renames["ATTRACTOR_FORCE"] = "attractor_force"; + // These are unsupported, but may be used by users. To avoid compile time overhead, we add the stub only when used. + actions.renames["FLAG_EMIT_POSITION"] = "uint(1)"; + actions.renames["FLAG_EMIT_ROT_SCALE"] = "uint(2)"; + actions.renames["FLAG_EMIT_VELOCITY"] = "uint(4)"; + actions.renames["FLAG_EMIT_COLOR"] = "uint(8)"; + actions.renames["FLAG_EMIT_CUSTOM"] = "uint(16)"; + actions.renames["emit_subparticle"] = "emit_subparticle"; + actions.usage_defines["emit_subparticle"] = "\nbool emit_subparticle(mat4 p_xform, vec3 p_velocity, vec4 p_color, vec4 p_custom, uint p_flags) {\n\treturn false;\n}\n"; + actions.render_mode_defines["disable_force"] = "#define DISABLE_FORCE\n"; actions.render_mode_defines["disable_velocity"] = "#define DISABLE_VELOCITY\n"; actions.render_mode_defines["keep_data"] = "#define ENABLE_KEEP_DATA\n"; diff --git a/drivers/gles3/storage/particles_storage.cpp b/drivers/gles3/storage/particles_storage.cpp index dbd86451d2..c50d2c48cc 100644 --- a/drivers/gles3/storage/particles_storage.cpp +++ b/drivers/gles3/storage/particles_storage.cpp @@ -271,13 +271,13 @@ void ParticlesStorage::particles_set_fractional_delta(RID p_particles, bool p_en void ParticlesStorage::particles_set_trails(RID p_particles, bool p_enable, double p_length) { if (p_enable) { - WARN_PRINT_ONCE("The OpenGL 3 renderer does not support particle trails"); + WARN_PRINT_ONCE_ED("The GL Compatibility rendering backend does not support particle trails."); } } void ParticlesStorage::particles_set_trail_bind_poses(RID p_particles, const Vector<Transform3D> &p_bind_poses) { if (p_bind_poses.size() != 0) { - WARN_PRINT_ONCE("The OpenGL 3 renderer does not support particle trails"); + WARN_PRINT_ONCE_ED("The GL Compatibility rendering backend does not support particle trails."); } } @@ -341,12 +341,12 @@ void ParticlesStorage::particles_restart(RID p_particles) { void ParticlesStorage::particles_set_subemitter(RID p_particles, RID p_subemitter_particles) { if (p_subemitter_particles.is_valid()) { - WARN_PRINT_ONCE("The OpenGL 3 renderer does not support particle sub emitters"); + WARN_PRINT_ONCE_ED("The GL Compatibility rendering backend does not support particle sub-emitters."); } } void ParticlesStorage::particles_emit(RID p_particles, const Transform3D &p_transform, const Vector3 &p_velocity, const Color &p_color, const Color &p_custom, uint32_t p_emit_flags) { - WARN_PRINT_ONCE("The OpenGL 3 renderer does not support manually emitting particles"); + WARN_PRINT_ONCE_ED("The GL Compatibility rendering backend does not support manually emitting particles."); } void ParticlesStorage::particles_request_process(RID p_particles) { @@ -613,7 +613,7 @@ void ParticlesStorage::_particles_process(Particles *p_particles, double p_delta attr.extents[2] = extents.z; } break; case RS::PARTICLES_COLLISION_TYPE_VECTOR_FIELD_ATTRACT: { - WARN_PRINT_ONCE("Vector field particle attractors are not available in the OpenGL2 renderer."); + WARN_PRINT_ONCE_ED("Vector field particle attractors are not available in the GL Compatibility rendering backend."); } break; default: { } @@ -646,7 +646,7 @@ void ParticlesStorage::_particles_process(Particles *p_particles, double p_delta col.extents[2] = extents.z; } break; case RS::PARTICLES_COLLISION_TYPE_SDF_COLLIDE: { - WARN_PRINT_ONCE("SDF Particle Colliders are not available in the OpenGL 3 renderer."); + WARN_PRINT_ONCE_ED("SDF Particle Colliders are not available in the GL Compatibility rendering backend."); } break; case RS::PARTICLES_COLLISION_TYPE_HEIGHTFIELD_COLLIDE: { if (collision_heightmap_texture != 0) { //already taken @@ -1304,7 +1304,7 @@ void ParticlesStorage::particles_collision_set_attractor_attenuation(RID p_parti } void ParticlesStorage::particles_collision_set_field_texture(RID p_particles_collision, RID p_texture) { - WARN_PRINT_ONCE("The OpenGL 3 renderer does not support SDF collisions in 3D particle shaders"); + WARN_PRINT_ONCE_ED("The GL Compatibility rendering backend does not support SDF collisions in 3D particle shaders"); } void ParticlesStorage::particles_collision_height_field_update(RID p_particles_collision) { diff --git a/drivers/gles3/storage/texture_storage.cpp b/drivers/gles3/storage/texture_storage.cpp index f362a21d8c..fd6cb722d2 100644 --- a/drivers/gles3/storage/texture_storage.cpp +++ b/drivers/gles3/storage/texture_storage.cpp @@ -644,7 +644,7 @@ Ref<Image> TextureStorage::_get_gl_image_and_format(const Ref<Image> &p_image, I } } break; default: { - ERR_FAIL_V_MSG(Ref<Image>(), "Image Format: " + itos(p_format) + " is not supported by the OpenGL3 Renderer"); + ERR_FAIL_V_MSG(Ref<Image>(), "The image format " + itos(p_format) + " is not supported by the GL Compatibility rendering backend."); } } @@ -1744,7 +1744,12 @@ void TextureStorage::_update_render_target(RenderTarget *rt) { GLenum status = glCheckFramebufferStatus(GL_FRAMEBUFFER); if (status != GL_FRAMEBUFFER_COMPLETE) { glDeleteFramebuffers(1, &rt->fbo); - GLES3::Utilities::get_singleton()->texture_free_data(rt->color); + if (rt->overridden.color.is_null()) { + GLES3::Utilities::get_singleton()->texture_free_data(rt->color); + } + if (rt->overridden.depth.is_null()) { + GLES3::Utilities::get_singleton()->texture_free_data(rt->depth); + } rt->fbo = 0; rt->size.x = 0; rt->size.y = 0; |
