diff options
Diffstat (limited to 'drivers/gles2/rasterizer_storage_gles2.h')
-rw-r--r-- | drivers/gles2/rasterizer_storage_gles2.h | 185 |
1 files changed, 77 insertions, 108 deletions
diff --git a/drivers/gles2/rasterizer_storage_gles2.h b/drivers/gles2/rasterizer_storage_gles2.h index c928f753b1..ec7616b9f3 100644 --- a/drivers/gles2/rasterizer_storage_gles2.h +++ b/drivers/gles2/rasterizer_storage_gles2.h @@ -60,20 +60,12 @@ public: bool shrink_textures_x2; bool use_fast_texture_filter; - // bool use_anisotropic_filter; - - bool hdr_supported; - - bool use_rgba_2d_shadows; - - // float anisotropic_level; int max_texture_image_units; int max_texture_size; - bool generate_wireframes; - - bool use_texture_array_environment; + // TODO implement wireframe in GLES2 + // bool generate_wireframes; Set<String> extensions; @@ -83,7 +75,6 @@ public: bool keep_original_textures; - bool no_depth_prepass; bool force_vertex_shading; } config; @@ -140,10 +131,9 @@ public: } } render, render_final, snap; - Info() { - - texture_mem = 0; - vertex_mem = 0; + Info() : + texture_mem(0), + vertex_mem(0) { render.reset(); render_final.reset(); } @@ -159,20 +149,12 @@ public: struct Instantiable : public RID_Data { SelfList<RasterizerScene::InstanceBase>::List instance_list; - _FORCE_INLINE_ void instance_change_notify() { - SelfList<RasterizerScene::InstanceBase> *instances = instance_list.first(); + _FORCE_INLINE_ void instance_change_notify(bool p_aabb, bool p_materials) { - while (instances) { - instances->self()->base_changed(); - instances = instances->next(); - } - } - - _FORCE_INLINE_ void instance_material_change_notify() { SelfList<RasterizerScene::InstanceBase> *instances = instance_list.first(); - while (instances) { - instances->self()->base_material_changed(); + + instances->self()->base_changed(p_aabb, p_materials); instances = instances->next(); } } @@ -271,33 +253,31 @@ public: VisualServer::TextureDetectCallback detect_normal; void *detect_normal_ud; - Texture() { - flags = 0; - width = 0; - height = 0; - alloc_width = 0; - alloc_height = 0; - format = Image::FORMAT_L8; - - target = 0; - - data_size = 0; - total_data_size = 0; - ignore_mipmaps = false; - - compressed = false; - - active = false; - - tex_id = 0; - - stored_cube_sides = 0; - - proxy = NULL; - - render_target = NULL; - - redraw_if_visible = false; + Texture() : + proxy(NULL), + flags(0), + width(0), + height(0), + alloc_width(0), + alloc_height(0), + format(Image::FORMAT_L8), + target(0), + data_size(0), + total_data_size(0), + ignore_mipmaps(false), + compressed(false), + mipmaps(0), + active(false), + tex_id(0), + stored_cube_sides(0), + render_target(NULL), + redraw_if_visible(false), + detect_3d(NULL), + detect_3d_ud(NULL), + detect_srgb(NULL), + detect_srgb_ud(NULL), + detect_normal(NULL), + detect_normal_ud(NULL) { } _ALWAYS_INLINE_ Texture *get_ptr() { @@ -429,6 +409,7 @@ public: int light_mode; */ + bool uses_screen_texture; bool uses_screen_uv; bool uses_time; @@ -634,20 +615,15 @@ public: int total_data_size; - Surface() { - array_byte_size = 0; - index_array_byte_size = 0; - - array_len = 0; - index_array_len = 0; - - mesh = NULL; - - primitive = VS::PRIMITIVE_POINTS; - - active = false; - - total_data_size = 0; + Surface() : + mesh(NULL), + array_len(0), + index_array_len(0), + array_byte_size(0), + index_array_byte_size(0), + primitive(VS::PRIMITIVE_POINTS), + active(false), + total_data_size(0) { } }; @@ -672,14 +648,14 @@ public: SelfList<MultiMesh> *mm = multimeshes.first(); while (mm) { - mm->self()->instance_material_change_notify(); + mm->self()->instance_change_notify(false, true); mm = mm->next(); } } - Mesh() { - blend_shape_mode = VS::BLEND_SHAPE_MODE_NORMALIZED; - blend_shape_count = 0; + Mesh() : + blend_shape_count(0), + blend_shape_mode(VS::BLEND_SHAPE_MODE_NORMALIZED) { } }; @@ -750,22 +726,18 @@ public: bool dirty_data; MultiMesh() : + size(0), + transform_format(VS::MULTIMESH_TRANSFORM_2D), + color_format(VS::MULTIMESH_COLOR_NONE), + custom_data_format(VS::MULTIMESH_CUSTOM_DATA_NONE), update_list(this), - mesh_list(this) { - dirty_aabb = true; - dirty_data = true; - - xform_floats = 0; - color_floats = 0; - custom_data_floats = 0; - - visible_instances = -1; - - size = 0; - - transform_format = VS::MULTIMESH_TRANSFORM_2D; - color_format = VS::MULTIMESH_COLOR_NONE; - custom_data_format = VS::MULTIMESH_CUSTOM_DATA_NONE; + mesh_list(this), + visible_instances(-1), + xform_floats(0), + color_floats(0), + custom_data_floats(0), + dirty_aabb(true), + dirty_data(true) { } }; @@ -866,10 +838,10 @@ public: Set<RasterizerScene::InstanceBase *> instances; Skeleton() : + use_2d(false), + size(0), + tex_id(0), update_list(this) { - tex_id = 0; - size = 0; - use_2d = false; } }; @@ -1109,6 +1081,8 @@ public: virtual int particles_get_draw_passes(RID p_particles) const; virtual RID particles_get_draw_pass_mesh(RID p_particles, int p_pass) const; + virtual bool particles_is_inactive(RID p_particles) const; + /* INSTANCE */ virtual void instance_add_skeleton(RID p_skeleton, RasterizerScene::InstanceBase *p_instance); @@ -1138,11 +1112,11 @@ public: GLuint color; - Effect() { - fbo = 0; - width = 0; - height = 0; - color = 0; + Effect() : + fbo(0), + width(0), + height(0), + color(0) { } }; @@ -1157,22 +1131,17 @@ public: RID texture; - RenderTarget() { - fbo = 0; - - color = 0; - depth = 0; - - width = 0; - height = 0; - - for (int i = 0; i < RENDER_TARGET_FLAG_MAX; i++) { + RenderTarget() : + fbo(0), + color(0), + depth(0), + width(0), + height(0), + used_in_frame(false), + msaa(VS::VIEWPORT_MSAA_DISABLED) { + for (int i = 0; i < RENDER_TARGET_FLAG_MAX; ++i) { flags[i] = false; } - - used_in_frame = false; - - msaa = VS::VIEWPORT_MSAA_DISABLED; } }; |