rasterizer_storage_gles2.h 37 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262
  1. /*************************************************************************/
  2. /* rasterizer_storage_gles2.h */
  3. /*************************************************************************/
  4. /* This file is part of: */
  5. /* GODOT ENGINE */
  6. /* https://godotengine.org */
  7. /*************************************************************************/
  8. /* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */
  9. /* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */
  10. /* */
  11. /* Permission is hereby granted, free of charge, to any person obtaining */
  12. /* a copy of this software and associated documentation files (the */
  13. /* "Software"), to deal in the Software without restriction, including */
  14. /* without limitation the rights to use, copy, modify, merge, publish, */
  15. /* distribute, sublicense, and/or sell copies of the Software, and to */
  16. /* permit persons to whom the Software is furnished to do so, subject to */
  17. /* the following conditions: */
  18. /* */
  19. /* The above copyright notice and this permission notice shall be */
  20. /* included in all copies or substantial portions of the Software. */
  21. /* */
  22. /* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
  23. /* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
  24. /* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
  25. /* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
  26. /* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
  27. /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
  28. /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
  29. /*************************************************************************/
  30. #ifndef RASTERIZERSTORAGEGLES2_H
  31. #define RASTERIZERSTORAGEGLES2_H
  32. #include "core/pool_vector.h"
  33. #include "core/self_list.h"
  34. #include "servers/visual/rasterizer.h"
  35. #include "servers/visual/shader_language.h"
  36. #include "shader_compiler_gles2.h"
  37. #include "shader_gles2.h"
  38. #include "shaders/copy.glsl.gen.h"
  39. #include "shaders/cubemap_filter.glsl.gen.h"
  40. /*
  41. #include "shaders/blend_shape.glsl.gen.h"
  42. #include "shaders/canvas.glsl.gen.h"
  43. #include "shaders/particles.glsl.gen.h"
  44. */
  45. class RasterizerCanvasGLES2;
  46. class RasterizerSceneGLES2;
  47. class RasterizerStorageGLES2 : public RasterizerStorage {
  48. public:
  49. RasterizerCanvasGLES2 *canvas;
  50. RasterizerSceneGLES2 *scene;
  51. static GLuint system_fbo;
  52. struct Config {
  53. bool shrink_textures_x2;
  54. bool use_fast_texture_filter;
  55. int max_texture_image_units;
  56. int max_texture_size;
  57. // TODO implement wireframe in GLES2
  58. // bool generate_wireframes;
  59. Set<String> extensions;
  60. bool float_texture_supported;
  61. bool s3tc_supported;
  62. bool etc1_supported;
  63. bool pvrtc_supported;
  64. bool rgtc_supported;
  65. bool bptc_supported;
  66. bool keep_original_textures;
  67. bool force_vertex_shading;
  68. bool use_rgba_2d_shadows;
  69. bool use_rgba_3d_shadows;
  70. bool support_32_bits_indices;
  71. bool support_write_depth;
  72. bool support_half_float_vertices;
  73. bool support_npot_repeat_mipmap;
  74. bool support_depth_texture;
  75. bool support_depth_cubemaps;
  76. bool support_shadow_cubemaps;
  77. GLuint depth_internalformat;
  78. GLuint depth_type;
  79. } config;
  80. struct Resources {
  81. GLuint white_tex;
  82. GLuint black_tex;
  83. GLuint normal_tex;
  84. GLuint aniso_tex;
  85. GLuint mipmap_blur_fbo;
  86. GLuint mipmap_blur_color;
  87. GLuint radical_inverse_vdc_cache_tex;
  88. bool use_rgba_2d_shadows;
  89. GLuint quadie;
  90. size_t skeleton_transform_buffer_size;
  91. GLuint skeleton_transform_buffer;
  92. PoolVector<float> skeleton_transform_cpu_buffer;
  93. } resources;
  94. mutable struct Shaders {
  95. ShaderCompilerGLES2 compiler;
  96. CopyShaderGLES2 copy;
  97. CubemapFilterShaderGLES2 cubemap_filter;
  98. ShaderCompilerGLES2::IdentifierActions actions_canvas;
  99. ShaderCompilerGLES2::IdentifierActions actions_scene;
  100. ShaderCompilerGLES2::IdentifierActions actions_particles;
  101. } shaders;
  102. struct Info {
  103. uint64_t texture_mem;
  104. uint64_t vertex_mem;
  105. struct Render {
  106. uint32_t object_count;
  107. uint32_t draw_call_count;
  108. uint32_t material_switch_count;
  109. uint32_t surface_switch_count;
  110. uint32_t shader_rebind_count;
  111. uint32_t vertices_count;
  112. void reset() {
  113. object_count = 0;
  114. draw_call_count = 0;
  115. material_switch_count = 0;
  116. surface_switch_count = 0;
  117. shader_rebind_count = 0;
  118. vertices_count = 0;
  119. }
  120. } render, render_final, snap;
  121. Info() :
  122. texture_mem(0),
  123. vertex_mem(0) {
  124. render.reset();
  125. render_final.reset();
  126. }
  127. } info;
  128. void bind_quad_array() const;
  129. /////////////////////////////////////////////////////////////////////////////////////////
  130. //////////////////////////////////DATA///////////////////////////////////////////////////
  131. /////////////////////////////////////////////////////////////////////////////////////////
  132. struct Instantiable : public RID_Data {
  133. SelfList<RasterizerScene::InstanceBase>::List instance_list;
  134. _FORCE_INLINE_ void instance_change_notify(bool p_aabb, bool p_materials) {
  135. SelfList<RasterizerScene::InstanceBase> *instances = instance_list.first();
  136. while (instances) {
  137. instances->self()->base_changed(p_aabb, p_materials);
  138. instances = instances->next();
  139. }
  140. }
  141. _FORCE_INLINE_ void instance_remove_deps() {
  142. SelfList<RasterizerScene::InstanceBase> *instances = instance_list.first();
  143. while (instances) {
  144. instances->self()->base_removed();
  145. instances = instances->next();
  146. }
  147. }
  148. Instantiable() {}
  149. virtual ~Instantiable() {}
  150. };
  151. struct GeometryOwner : public Instantiable {
  152. };
  153. struct Geometry : public Instantiable {
  154. enum Type {
  155. GEOMETRY_INVALID,
  156. GEOMETRY_SURFACE,
  157. GEOMETRY_IMMEDIATE,
  158. GEOMETRY_MULTISURFACE
  159. };
  160. Type type;
  161. RID material;
  162. uint64_t last_pass;
  163. uint32_t index;
  164. virtual void material_changed_notify() {}
  165. Geometry() {
  166. last_pass = 0;
  167. index = 0;
  168. }
  169. };
  170. /////////////////////////////////////////////////////////////////////////////////////////
  171. //////////////////////////////////API////////////////////////////////////////////////////
  172. /////////////////////////////////////////////////////////////////////////////////////////
  173. /* TEXTURE API */
  174. struct RenderTarget;
  175. struct Texture : RID_Data {
  176. Texture *proxy;
  177. Set<Texture *> proxy_owners;
  178. String path;
  179. uint32_t flags;
  180. int width, height, depth;
  181. int alloc_width, alloc_height;
  182. Image::Format format;
  183. VS::TextureType type;
  184. GLenum target;
  185. GLenum gl_format_cache;
  186. GLenum gl_internal_format_cache;
  187. GLenum gl_type_cache;
  188. int data_size;
  189. int total_data_size;
  190. bool ignore_mipmaps;
  191. bool compressed;
  192. bool srgb;
  193. int mipmaps;
  194. bool resize_to_po2;
  195. bool active;
  196. GLenum tex_id;
  197. uint16_t stored_cube_sides;
  198. RenderTarget *render_target;
  199. Vector<Ref<Image> > images;
  200. bool redraw_if_visible;
  201. VisualServer::TextureDetectCallback detect_3d;
  202. void *detect_3d_ud;
  203. VisualServer::TextureDetectCallback detect_srgb;
  204. void *detect_srgb_ud;
  205. VisualServer::TextureDetectCallback detect_normal;
  206. void *detect_normal_ud;
  207. Texture() :
  208. proxy(NULL),
  209. flags(0),
  210. width(0),
  211. height(0),
  212. alloc_width(0),
  213. alloc_height(0),
  214. format(Image::FORMAT_L8),
  215. type(VS::TEXTURE_TYPE_2D),
  216. target(0),
  217. data_size(0),
  218. total_data_size(0),
  219. ignore_mipmaps(false),
  220. compressed(false),
  221. mipmaps(0),
  222. resize_to_po2(false),
  223. active(false),
  224. tex_id(0),
  225. stored_cube_sides(0),
  226. render_target(NULL),
  227. redraw_if_visible(false),
  228. detect_3d(NULL),
  229. detect_3d_ud(NULL),
  230. detect_srgb(NULL),
  231. detect_srgb_ud(NULL),
  232. detect_normal(NULL),
  233. detect_normal_ud(NULL) {
  234. }
  235. _ALWAYS_INLINE_ Texture *get_ptr() {
  236. if (proxy) {
  237. return proxy; //->get_ptr(); only one level of indirection, else not inlining possible.
  238. } else {
  239. return this;
  240. }
  241. }
  242. ~Texture() {
  243. if (tex_id != 0) {
  244. glDeleteTextures(1, &tex_id);
  245. }
  246. for (Set<Texture *>::Element *E = proxy_owners.front(); E; E = E->next()) {
  247. E->get()->proxy = NULL;
  248. }
  249. if (proxy) {
  250. proxy->proxy_owners.erase(this);
  251. }
  252. }
  253. };
  254. mutable RID_Owner<Texture> texture_owner;
  255. Ref<Image> _get_gl_image_and_format(const Ref<Image> &p_image, Image::Format p_format, uint32_t p_flags, Image::Format &r_real_format, GLenum &r_gl_format, GLenum &r_gl_internal_format, GLenum &r_gl_type, bool &r_compressed, bool p_will_need_resize) const;
  256. virtual RID texture_create();
  257. virtual void texture_allocate(RID p_texture, int p_width, int p_height, int p_depth_3d, Image::Format p_format, VS::TextureType p_type, uint32_t p_flags = VS::TEXTURE_FLAGS_DEFAULT);
  258. virtual void texture_set_data(RID p_texture, const Ref<Image> &p_image, int p_layer = 0);
  259. virtual void texture_set_data_partial(RID p_texture, const Ref<Image> &p_image, int src_x, int src_y, int src_w, int src_h, int dst_x, int dst_y, int p_dst_mip, int p_layer = 0);
  260. virtual Ref<Image> texture_get_data(RID p_texture, int p_layer = 0) const;
  261. virtual void texture_set_flags(RID p_texture, uint32_t p_flags);
  262. virtual uint32_t texture_get_flags(RID p_texture) const;
  263. virtual Image::Format texture_get_format(RID p_texture) const;
  264. virtual VS::TextureType texture_get_type(RID p_texture) const;
  265. virtual uint32_t texture_get_texid(RID p_texture) const;
  266. virtual uint32_t texture_get_width(RID p_texture) const;
  267. virtual uint32_t texture_get_height(RID p_texture) const;
  268. virtual uint32_t texture_get_depth(RID p_texture) const;
  269. virtual void texture_set_size_override(RID p_texture, int p_width, int p_height, int p_depth);
  270. virtual void texture_set_path(RID p_texture, const String &p_path);
  271. virtual String texture_get_path(RID p_texture) const;
  272. virtual void texture_set_shrink_all_x2_on_set_data(bool p_enable);
  273. virtual void texture_debug_usage(List<VS::TextureInfo> *r_info);
  274. virtual RID texture_create_radiance_cubemap(RID p_source, int p_resolution = -1) const;
  275. virtual void textures_keep_original(bool p_enable);
  276. virtual void texture_set_proxy(RID p_texture, RID p_proxy);
  277. virtual Size2 texture_size_with_proxy(RID p_texture) const;
  278. virtual void texture_set_detect_3d_callback(RID p_texture, VisualServer::TextureDetectCallback p_callback, void *p_userdata);
  279. virtual void texture_set_detect_srgb_callback(RID p_texture, VisualServer::TextureDetectCallback p_callback, void *p_userdata);
  280. virtual void texture_set_detect_normal_callback(RID p_texture, VisualServer::TextureDetectCallback p_callback, void *p_userdata);
  281. virtual void texture_set_force_redraw_if_visible(RID p_texture, bool p_enable);
  282. /* SKY API */
  283. struct Sky : public RID_Data {
  284. RID panorama;
  285. GLuint radiance;
  286. int radiance_size;
  287. };
  288. mutable RID_Owner<Sky> sky_owner;
  289. virtual RID sky_create();
  290. virtual void sky_set_texture(RID p_sky, RID p_panorama, int p_radiance_size);
  291. /* SHADER API */
  292. struct Material;
  293. struct Shader : public RID_Data {
  294. RID self;
  295. VS::ShaderMode mode;
  296. ShaderGLES2 *shader;
  297. String code;
  298. SelfList<Material>::List materials;
  299. Map<StringName, ShaderLanguage::ShaderNode::Uniform> uniforms;
  300. uint32_t texture_count;
  301. uint32_t custom_code_id;
  302. uint32_t version;
  303. SelfList<Shader> dirty_list;
  304. Map<StringName, RID> default_textures;
  305. Vector<ShaderLanguage::ShaderNode::Uniform::Hint> texture_hints;
  306. bool valid;
  307. String path;
  308. uint32_t index;
  309. uint64_t last_pass;
  310. struct CanvasItem {
  311. enum BlendMode {
  312. BLEND_MODE_MIX,
  313. BLEND_MODE_ADD,
  314. BLEND_MODE_SUB,
  315. BLEND_MODE_MUL,
  316. BLEND_MODE_PMALPHA,
  317. };
  318. int blend_mode;
  319. enum LightMode {
  320. LIGHT_MODE_NORMAL,
  321. LIGHT_MODE_UNSHADED,
  322. LIGHT_MODE_LIGHT_ONLY
  323. };
  324. int light_mode;
  325. bool uses_screen_texture;
  326. bool uses_screen_uv;
  327. bool uses_time;
  328. } canvas_item;
  329. struct Spatial {
  330. enum BlendMode {
  331. BLEND_MODE_MIX,
  332. BLEND_MODE_ADD,
  333. BLEND_MODE_SUB,
  334. BLEND_MODE_MUL,
  335. };
  336. int blend_mode;
  337. enum DepthDrawMode {
  338. DEPTH_DRAW_OPAQUE,
  339. DEPTH_DRAW_ALWAYS,
  340. DEPTH_DRAW_NEVER,
  341. DEPTH_DRAW_ALPHA_PREPASS,
  342. };
  343. int depth_draw_mode;
  344. enum CullMode {
  345. CULL_MODE_FRONT,
  346. CULL_MODE_BACK,
  347. CULL_MODE_DISABLED,
  348. };
  349. int cull_mode;
  350. bool uses_alpha;
  351. bool uses_alpha_scissor;
  352. bool unshaded;
  353. bool no_depth_test;
  354. bool uses_vertex;
  355. bool uses_discard;
  356. bool uses_sss;
  357. bool uses_screen_texture;
  358. bool uses_depth_texture;
  359. bool uses_time;
  360. bool writes_modelview_or_projection;
  361. bool uses_vertex_lighting;
  362. bool uses_world_coordinates;
  363. } spatial;
  364. struct Particles {
  365. } particles;
  366. bool uses_vertex_time;
  367. bool uses_fragment_time;
  368. Shader() :
  369. dirty_list(this) {
  370. shader = NULL;
  371. valid = false;
  372. custom_code_id = 0;
  373. version = 1;
  374. last_pass = 0;
  375. }
  376. };
  377. mutable RID_Owner<Shader> shader_owner;
  378. mutable SelfList<Shader>::List _shader_dirty_list;
  379. void _shader_make_dirty(Shader *p_shader);
  380. virtual RID shader_create();
  381. virtual void shader_set_code(RID p_shader, const String &p_code);
  382. virtual String shader_get_code(RID p_shader) const;
  383. virtual void shader_get_param_list(RID p_shader, List<PropertyInfo> *p_param_list) const;
  384. virtual void shader_set_default_texture_param(RID p_shader, const StringName &p_name, RID p_texture);
  385. virtual RID shader_get_default_texture_param(RID p_shader, const StringName &p_name) const;
  386. void _update_shader(Shader *p_shader) const;
  387. void update_dirty_shaders();
  388. /* COMMON MATERIAL API */
  389. struct Material : public RID_Data {
  390. Shader *shader;
  391. Map<StringName, Variant> params;
  392. SelfList<Material> list;
  393. SelfList<Material> dirty_list;
  394. Vector<Pair<StringName, RID> > textures;
  395. float line_width;
  396. int render_priority;
  397. RID next_pass;
  398. uint32_t index;
  399. uint64_t last_pass;
  400. Map<Geometry *, int> geometry_owners;
  401. Map<RasterizerScene::InstanceBase *, int> instance_owners;
  402. bool can_cast_shadow_cache;
  403. bool is_animated_cache;
  404. Material() :
  405. list(this),
  406. dirty_list(this) {
  407. can_cast_shadow_cache = false;
  408. is_animated_cache = false;
  409. shader = NULL;
  410. line_width = 1.0;
  411. last_pass = 0;
  412. render_priority = 0;
  413. }
  414. };
  415. mutable SelfList<Material>::List _material_dirty_list;
  416. void _material_make_dirty(Material *p_material) const;
  417. void _material_add_geometry(RID p_material, Geometry *p_geometry);
  418. void _material_remove_geometry(RID p_material, Geometry *p_geometry);
  419. void _update_material(Material *p_material);
  420. mutable RID_Owner<Material> material_owner;
  421. virtual RID material_create();
  422. virtual void material_set_shader(RID p_material, RID p_shader);
  423. virtual RID material_get_shader(RID p_material) const;
  424. virtual void material_set_param(RID p_material, const StringName &p_param, const Variant &p_value);
  425. virtual Variant material_get_param(RID p_material, const StringName &p_param) const;
  426. virtual Variant material_get_param_default(RID p_material, const StringName &p_param) const;
  427. virtual void material_set_line_width(RID p_material, float p_width);
  428. virtual void material_set_next_pass(RID p_material, RID p_next_material);
  429. virtual bool material_is_animated(RID p_material);
  430. virtual bool material_casts_shadows(RID p_material);
  431. virtual void material_add_instance_owner(RID p_material, RasterizerScene::InstanceBase *p_instance);
  432. virtual void material_remove_instance_owner(RID p_material, RasterizerScene::InstanceBase *p_instance);
  433. virtual void material_set_render_priority(RID p_material, int priority);
  434. void update_dirty_materials();
  435. /* MESH API */
  436. struct Mesh;
  437. struct Surface : public Geometry {
  438. struct Attrib {
  439. bool enabled;
  440. bool integer;
  441. GLuint index;
  442. GLint size;
  443. GLenum type;
  444. GLboolean normalized;
  445. GLsizei stride;
  446. uint32_t offset;
  447. };
  448. Attrib attribs[VS::ARRAY_MAX];
  449. Mesh *mesh;
  450. uint32_t format;
  451. GLuint vertex_id;
  452. GLuint index_id;
  453. struct BlendShape {
  454. GLuint vertex_id;
  455. GLuint array_id;
  456. };
  457. Vector<BlendShape> blend_shapes;
  458. AABB aabb;
  459. int array_len;
  460. int index_array_len;
  461. int max_bone;
  462. int array_byte_size;
  463. int index_array_byte_size;
  464. VS::PrimitiveType primitive;
  465. Vector<AABB> skeleton_bone_aabb;
  466. Vector<bool> skeleton_bone_used;
  467. bool active;
  468. PoolVector<uint8_t> data;
  469. PoolVector<uint8_t> index_data;
  470. Vector<PoolVector<uint8_t> > blend_shape_data;
  471. int total_data_size;
  472. Surface() :
  473. mesh(NULL),
  474. array_len(0),
  475. index_array_len(0),
  476. array_byte_size(0),
  477. index_array_byte_size(0),
  478. primitive(VS::PRIMITIVE_POINTS),
  479. active(false),
  480. total_data_size(0) {
  481. }
  482. };
  483. struct MultiMesh;
  484. struct Mesh : public GeometryOwner {
  485. bool active;
  486. Vector<Surface *> surfaces;
  487. int blend_shape_count;
  488. VS::BlendShapeMode blend_shape_mode;
  489. AABB custom_aabb;
  490. mutable uint64_t last_pass;
  491. SelfList<MultiMesh>::List multimeshes;
  492. _FORCE_INLINE_ void update_multimeshes() {
  493. SelfList<MultiMesh> *mm = multimeshes.first();
  494. while (mm) {
  495. mm->self()->instance_change_notify(false, true);
  496. mm = mm->next();
  497. }
  498. }
  499. Mesh() :
  500. blend_shape_count(0),
  501. blend_shape_mode(VS::BLEND_SHAPE_MODE_NORMALIZED) {
  502. }
  503. };
  504. mutable RID_Owner<Mesh> mesh_owner;
  505. virtual RID mesh_create();
  506. virtual void mesh_add_surface(RID p_mesh, uint32_t p_format, VS::PrimitiveType p_primitive, const PoolVector<uint8_t> &p_array, int p_vertex_count, const PoolVector<uint8_t> &p_index_array, int p_index_count, const AABB &p_aabb, const Vector<PoolVector<uint8_t> > &p_blend_shapes = Vector<PoolVector<uint8_t> >(), const Vector<AABB> &p_bone_aabbs = Vector<AABB>());
  507. virtual void mesh_set_blend_shape_count(RID p_mesh, int p_amount);
  508. virtual int mesh_get_blend_shape_count(RID p_mesh) const;
  509. virtual void mesh_set_blend_shape_mode(RID p_mesh, VS::BlendShapeMode p_mode);
  510. virtual VS::BlendShapeMode mesh_get_blend_shape_mode(RID p_mesh) const;
  511. virtual void mesh_surface_update_region(RID p_mesh, int p_surface, int p_offset, const PoolVector<uint8_t> &p_data);
  512. virtual void mesh_surface_set_material(RID p_mesh, int p_surface, RID p_material);
  513. virtual RID mesh_surface_get_material(RID p_mesh, int p_surface) const;
  514. virtual int mesh_surface_get_array_len(RID p_mesh, int p_surface) const;
  515. virtual int mesh_surface_get_array_index_len(RID p_mesh, int p_surface) const;
  516. virtual PoolVector<uint8_t> mesh_surface_get_array(RID p_mesh, int p_surface) const;
  517. virtual PoolVector<uint8_t> mesh_surface_get_index_array(RID p_mesh, int p_surface) const;
  518. virtual uint32_t mesh_surface_get_format(RID p_mesh, int p_surface) const;
  519. virtual VS::PrimitiveType mesh_surface_get_primitive_type(RID p_mesh, int p_surface) const;
  520. virtual AABB mesh_surface_get_aabb(RID p_mesh, int p_surface) const;
  521. virtual Vector<PoolVector<uint8_t> > mesh_surface_get_blend_shapes(RID p_mesh, int p_surface) const;
  522. virtual Vector<AABB> mesh_surface_get_skeleton_aabb(RID p_mesh, int p_surface) const;
  523. virtual void mesh_remove_surface(RID p_mesh, int p_surface);
  524. virtual int mesh_get_surface_count(RID p_mesh) const;
  525. virtual void mesh_set_custom_aabb(RID p_mesh, const AABB &p_aabb);
  526. virtual AABB mesh_get_custom_aabb(RID p_mesh) const;
  527. virtual AABB mesh_get_aabb(RID p_mesh, RID p_skeleton) const;
  528. virtual void mesh_clear(RID p_mesh);
  529. /* MULTIMESH API */
  530. struct MultiMesh : public GeometryOwner {
  531. RID mesh;
  532. int size;
  533. VS::MultimeshTransformFormat transform_format;
  534. VS::MultimeshColorFormat color_format;
  535. VS::MultimeshCustomDataFormat custom_data_format;
  536. Vector<float> data;
  537. AABB aabb;
  538. SelfList<MultiMesh> update_list;
  539. SelfList<MultiMesh> mesh_list;
  540. int visible_instances;
  541. int xform_floats;
  542. int color_floats;
  543. int custom_data_floats;
  544. bool dirty_aabb;
  545. bool dirty_data;
  546. MultiMesh() :
  547. size(0),
  548. transform_format(VS::MULTIMESH_TRANSFORM_2D),
  549. color_format(VS::MULTIMESH_COLOR_NONE),
  550. custom_data_format(VS::MULTIMESH_CUSTOM_DATA_NONE),
  551. update_list(this),
  552. mesh_list(this),
  553. visible_instances(-1),
  554. xform_floats(0),
  555. color_floats(0),
  556. custom_data_floats(0),
  557. dirty_aabb(true),
  558. dirty_data(true) {
  559. }
  560. };
  561. mutable RID_Owner<MultiMesh> multimesh_owner;
  562. SelfList<MultiMesh>::List multimesh_update_list;
  563. virtual RID multimesh_create();
  564. virtual void multimesh_allocate(RID p_multimesh, int p_instances, VS::MultimeshTransformFormat p_transform_format, VS::MultimeshColorFormat p_color_format, VS::MultimeshCustomDataFormat p_data = VS::MULTIMESH_CUSTOM_DATA_NONE);
  565. virtual int multimesh_get_instance_count(RID p_multimesh) const;
  566. virtual void multimesh_set_mesh(RID p_multimesh, RID p_mesh);
  567. virtual void multimesh_instance_set_transform(RID p_multimesh, int p_index, const Transform &p_transform);
  568. virtual void multimesh_instance_set_transform_2d(RID p_multimesh, int p_index, const Transform2D &p_transform);
  569. virtual void multimesh_instance_set_color(RID p_multimesh, int p_index, const Color &p_color);
  570. virtual void multimesh_instance_set_custom_data(RID p_multimesh, int p_index, const Color &p_custom_data);
  571. virtual RID multimesh_get_mesh(RID p_multimesh) const;
  572. virtual Transform multimesh_instance_get_transform(RID p_multimesh, int p_index) const;
  573. virtual Transform2D multimesh_instance_get_transform_2d(RID p_multimesh, int p_index) const;
  574. virtual Color multimesh_instance_get_color(RID p_multimesh, int p_index) const;
  575. virtual Color multimesh_instance_get_custom_data(RID p_multimesh, int p_index) const;
  576. virtual void multimesh_set_as_bulk_array(RID p_multimesh, const PoolVector<float> &p_array);
  577. virtual void multimesh_set_visible_instances(RID p_multimesh, int p_visible);
  578. virtual int multimesh_get_visible_instances(RID p_multimesh) const;
  579. virtual AABB multimesh_get_aabb(RID p_multimesh) const;
  580. void update_dirty_multimeshes();
  581. /* IMMEDIATE API */
  582. struct Immediate : public Geometry {
  583. struct Chunk {
  584. RID texture;
  585. VS::PrimitiveType primitive;
  586. Vector<Vector3> vertices;
  587. Vector<Vector3> normals;
  588. Vector<Plane> tangents;
  589. Vector<Color> colors;
  590. Vector<Vector2> uvs;
  591. Vector<Vector2> uv2s;
  592. };
  593. List<Chunk> chunks;
  594. bool building;
  595. int mask;
  596. AABB aabb;
  597. Immediate() {
  598. type = GEOMETRY_IMMEDIATE;
  599. building = false;
  600. }
  601. };
  602. Vector3 chunk_normal;
  603. Plane chunk_tangent;
  604. Color chunk_color;
  605. Vector2 chunk_uv;
  606. Vector2 chunk_uv2;
  607. mutable RID_Owner<Immediate> immediate_owner;
  608. virtual RID immediate_create();
  609. virtual void immediate_begin(RID p_immediate, VS::PrimitiveType p_primitive, RID p_texture = RID());
  610. virtual void immediate_vertex(RID p_immediate, const Vector3 &p_vertex);
  611. virtual void immediate_normal(RID p_immediate, const Vector3 &p_normal);
  612. virtual void immediate_tangent(RID p_immediate, const Plane &p_tangent);
  613. virtual void immediate_color(RID p_immediate, const Color &p_color);
  614. virtual void immediate_uv(RID p_immediate, const Vector2 &tex_uv);
  615. virtual void immediate_uv2(RID p_immediate, const Vector2 &tex_uv);
  616. virtual void immediate_end(RID p_immediate);
  617. virtual void immediate_clear(RID p_immediate);
  618. virtual void immediate_set_material(RID p_immediate, RID p_material);
  619. virtual RID immediate_get_material(RID p_immediate) const;
  620. virtual AABB immediate_get_aabb(RID p_immediate) const;
  621. /* SKELETON API */
  622. struct Skeleton : RID_Data {
  623. bool use_2d;
  624. int size;
  625. // TODO use float textures for storage
  626. Vector<float> bone_data;
  627. GLuint tex_id;
  628. SelfList<Skeleton> update_list;
  629. Set<RasterizerScene::InstanceBase *> instances;
  630. Transform2D base_transform_2d;
  631. Transform world_transform;
  632. Transform world_transform_inverse;
  633. bool use_world_transform;
  634. Skeleton() :
  635. use_2d(false),
  636. size(0),
  637. tex_id(0),
  638. update_list(this),
  639. use_world_transform(false) {
  640. }
  641. };
  642. mutable RID_Owner<Skeleton> skeleton_owner;
  643. SelfList<Skeleton>::List skeleton_update_list;
  644. void update_dirty_skeletons();
  645. virtual RID skeleton_create();
  646. virtual void skeleton_allocate(RID p_skeleton, int p_bones, bool p_2d_skeleton = false);
  647. virtual int skeleton_get_bone_count(RID p_skeleton) const;
  648. virtual void skeleton_bone_set_transform(RID p_skeleton, int p_bone, const Transform &p_transform);
  649. virtual Transform skeleton_bone_get_transform(RID p_skeleton, int p_bone) const;
  650. virtual void skeleton_bone_set_transform_2d(RID p_skeleton, int p_bone, const Transform2D &p_transform);
  651. virtual Transform2D skeleton_bone_get_transform_2d(RID p_skeleton, int p_bone) const;
  652. virtual void skeleton_set_base_transform_2d(RID p_skeleton, const Transform2D &p_base_transform);
  653. virtual void skeleton_set_world_transform(RID p_skeleton, bool p_enable, const Transform &p_world_transform);
  654. void _update_skeleton_transform_buffer(const PoolVector<float> &p_data, size_t p_size);
  655. /* Light API */
  656. struct Light : Instantiable {
  657. VS::LightType type;
  658. float param[VS::LIGHT_PARAM_MAX];
  659. Color color;
  660. Color shadow_color;
  661. RID projector;
  662. bool shadow;
  663. bool negative;
  664. bool reverse_cull;
  665. uint32_t cull_mask;
  666. VS::LightOmniShadowMode omni_shadow_mode;
  667. VS::LightOmniShadowDetail omni_shadow_detail;
  668. VS::LightDirectionalShadowMode directional_shadow_mode;
  669. VS::LightDirectionalShadowDepthRangeMode directional_range_mode;
  670. bool directional_blend_splits;
  671. uint64_t version;
  672. };
  673. mutable RID_Owner<Light> light_owner;
  674. virtual RID light_create(VS::LightType p_type);
  675. virtual void light_set_color(RID p_light, const Color &p_color);
  676. virtual void light_set_param(RID p_light, VS::LightParam p_param, float p_value);
  677. virtual void light_set_shadow(RID p_light, bool p_enabled);
  678. virtual void light_set_shadow_color(RID p_light, const Color &p_color);
  679. virtual void light_set_projector(RID p_light, RID p_texture);
  680. virtual void light_set_negative(RID p_light, bool p_enable);
  681. virtual void light_set_cull_mask(RID p_light, uint32_t p_mask);
  682. virtual void light_set_reverse_cull_face_mode(RID p_light, bool p_enabled);
  683. virtual void light_omni_set_shadow_mode(RID p_light, VS::LightOmniShadowMode p_mode);
  684. virtual void light_omni_set_shadow_detail(RID p_light, VS::LightOmniShadowDetail p_detail);
  685. virtual void light_directional_set_shadow_mode(RID p_light, VS::LightDirectionalShadowMode p_mode);
  686. virtual void light_directional_set_blend_splits(RID p_light, bool p_enable);
  687. virtual bool light_directional_get_blend_splits(RID p_light) const;
  688. virtual VS::LightDirectionalShadowMode light_directional_get_shadow_mode(RID p_light);
  689. virtual VS::LightOmniShadowMode light_omni_get_shadow_mode(RID p_light);
  690. virtual void light_directional_set_shadow_depth_range_mode(RID p_light, VS::LightDirectionalShadowDepthRangeMode p_range_mode);
  691. virtual VS::LightDirectionalShadowDepthRangeMode light_directional_get_shadow_depth_range_mode(RID p_light) const;
  692. virtual bool light_has_shadow(RID p_light) const;
  693. virtual VS::LightType light_get_type(RID p_light) const;
  694. virtual float light_get_param(RID p_light, VS::LightParam p_param);
  695. virtual Color light_get_color(RID p_light);
  696. virtual AABB light_get_aabb(RID p_light) const;
  697. virtual uint64_t light_get_version(RID p_light) const;
  698. /* PROBE API */
  699. struct ReflectionProbe : Instantiable {
  700. VS::ReflectionProbeUpdateMode update_mode;
  701. float intensity;
  702. Color interior_ambient;
  703. float interior_ambient_energy;
  704. float interior_ambient_probe_contrib;
  705. float max_distance;
  706. Vector3 extents;
  707. Vector3 origin_offset;
  708. bool interior;
  709. bool box_projection;
  710. bool enable_shadows;
  711. uint32_t cull_mask;
  712. int resolution;
  713. };
  714. mutable RID_Owner<ReflectionProbe> reflection_probe_owner;
  715. virtual RID reflection_probe_create();
  716. virtual void reflection_probe_set_update_mode(RID p_probe, VS::ReflectionProbeUpdateMode p_mode);
  717. virtual void reflection_probe_set_intensity(RID p_probe, float p_intensity);
  718. virtual void reflection_probe_set_interior_ambient(RID p_probe, const Color &p_ambient);
  719. virtual void reflection_probe_set_interior_ambient_energy(RID p_probe, float p_energy);
  720. virtual void reflection_probe_set_interior_ambient_probe_contribution(RID p_probe, float p_contrib);
  721. virtual void reflection_probe_set_max_distance(RID p_probe, float p_distance);
  722. virtual void reflection_probe_set_extents(RID p_probe, const Vector3 &p_extents);
  723. virtual void reflection_probe_set_origin_offset(RID p_probe, const Vector3 &p_offset);
  724. virtual void reflection_probe_set_as_interior(RID p_probe, bool p_enable);
  725. virtual void reflection_probe_set_enable_box_projection(RID p_probe, bool p_enable);
  726. virtual void reflection_probe_set_enable_shadows(RID p_probe, bool p_enable);
  727. virtual void reflection_probe_set_cull_mask(RID p_probe, uint32_t p_layers);
  728. virtual void reflection_probe_set_resolution(RID p_probe, int p_resolution);
  729. virtual AABB reflection_probe_get_aabb(RID p_probe) const;
  730. virtual VS::ReflectionProbeUpdateMode reflection_probe_get_update_mode(RID p_probe) const;
  731. virtual uint32_t reflection_probe_get_cull_mask(RID p_probe) const;
  732. virtual int reflection_probe_get_resolution(RID p_probe) const;
  733. virtual Vector3 reflection_probe_get_extents(RID p_probe) const;
  734. virtual Vector3 reflection_probe_get_origin_offset(RID p_probe) const;
  735. virtual float reflection_probe_get_origin_max_distance(RID p_probe) const;
  736. virtual bool reflection_probe_renders_shadows(RID p_probe) const;
  737. /* GI PROBE API */
  738. virtual RID gi_probe_create();
  739. virtual void gi_probe_set_bounds(RID p_probe, const AABB &p_bounds);
  740. virtual AABB gi_probe_get_bounds(RID p_probe) const;
  741. virtual void gi_probe_set_cell_size(RID p_probe, float p_size);
  742. virtual float gi_probe_get_cell_size(RID p_probe) const;
  743. virtual void gi_probe_set_to_cell_xform(RID p_probe, const Transform &p_xform);
  744. virtual Transform gi_probe_get_to_cell_xform(RID p_probe) const;
  745. virtual void gi_probe_set_dynamic_data(RID p_probe, const PoolVector<int> &p_data);
  746. virtual PoolVector<int> gi_probe_get_dynamic_data(RID p_probe) const;
  747. virtual void gi_probe_set_dynamic_range(RID p_probe, int p_range);
  748. virtual int gi_probe_get_dynamic_range(RID p_probe) const;
  749. virtual void gi_probe_set_energy(RID p_probe, float p_range);
  750. virtual float gi_probe_get_energy(RID p_probe) const;
  751. virtual void gi_probe_set_bias(RID p_probe, float p_range);
  752. virtual float gi_probe_get_bias(RID p_probe) const;
  753. virtual void gi_probe_set_normal_bias(RID p_probe, float p_range);
  754. virtual float gi_probe_get_normal_bias(RID p_probe) const;
  755. virtual void gi_probe_set_propagation(RID p_probe, float p_range);
  756. virtual float gi_probe_get_propagation(RID p_probe) const;
  757. virtual void gi_probe_set_interior(RID p_probe, bool p_enable);
  758. virtual bool gi_probe_is_interior(RID p_probe) const;
  759. virtual void gi_probe_set_compress(RID p_probe, bool p_enable);
  760. virtual bool gi_probe_is_compressed(RID p_probe) const;
  761. virtual uint32_t gi_probe_get_version(RID p_probe);
  762. virtual GIProbeCompression gi_probe_get_dynamic_data_get_preferred_compression() const;
  763. virtual RID gi_probe_dynamic_data_create(int p_width, int p_height, int p_depth, GIProbeCompression p_compression);
  764. virtual void gi_probe_dynamic_data_update(RID p_gi_probe_data, int p_depth_slice, int p_slice_count, int p_mipmap, const void *p_data);
  765. /* LIGHTMAP */
  766. struct LightmapCapture : public Instantiable {
  767. PoolVector<LightmapCaptureOctree> octree;
  768. AABB bounds;
  769. Transform cell_xform;
  770. int cell_subdiv;
  771. float energy;
  772. LightmapCapture() {
  773. energy = 1.0;
  774. cell_subdiv = 1;
  775. }
  776. };
  777. mutable RID_Owner<LightmapCapture> lightmap_capture_data_owner;
  778. virtual RID lightmap_capture_create();
  779. virtual void lightmap_capture_set_bounds(RID p_capture, const AABB &p_bounds);
  780. virtual AABB lightmap_capture_get_bounds(RID p_capture) const;
  781. virtual void lightmap_capture_set_octree(RID p_capture, const PoolVector<uint8_t> &p_octree);
  782. virtual PoolVector<uint8_t> lightmap_capture_get_octree(RID p_capture) const;
  783. virtual void lightmap_capture_set_octree_cell_transform(RID p_capture, const Transform &p_xform);
  784. virtual Transform lightmap_capture_get_octree_cell_transform(RID p_capture) const;
  785. virtual void lightmap_capture_set_octree_cell_subdiv(RID p_capture, int p_subdiv);
  786. virtual int lightmap_capture_get_octree_cell_subdiv(RID p_capture) const;
  787. virtual void lightmap_capture_set_energy(RID p_capture, float p_energy);
  788. virtual float lightmap_capture_get_energy(RID p_capture) const;
  789. virtual const PoolVector<LightmapCaptureOctree> *lightmap_capture_get_octree_ptr(RID p_capture) const;
  790. /* PARTICLES */
  791. void update_particles();
  792. virtual RID particles_create();
  793. virtual void particles_set_emitting(RID p_particles, bool p_emitting);
  794. virtual bool particles_get_emitting(RID p_particles);
  795. virtual void particles_set_amount(RID p_particles, int p_amount);
  796. virtual void particles_set_lifetime(RID p_particles, float p_lifetime);
  797. virtual void particles_set_one_shot(RID p_particles, bool p_one_shot);
  798. virtual void particles_set_pre_process_time(RID p_particles, float p_time);
  799. virtual void particles_set_explosiveness_ratio(RID p_particles, float p_ratio);
  800. virtual void particles_set_randomness_ratio(RID p_particles, float p_ratio);
  801. virtual void particles_set_custom_aabb(RID p_particles, const AABB &p_aabb);
  802. virtual void particles_set_speed_scale(RID p_particles, float p_scale);
  803. virtual void particles_set_use_local_coordinates(RID p_particles, bool p_enable);
  804. virtual void particles_set_process_material(RID p_particles, RID p_material);
  805. virtual void particles_set_fixed_fps(RID p_particles, int p_fps);
  806. virtual void particles_set_fractional_delta(RID p_particles, bool p_enable);
  807. virtual void particles_restart(RID p_particles);
  808. virtual void particles_set_draw_order(RID p_particles, VS::ParticlesDrawOrder p_order);
  809. virtual void particles_set_draw_passes(RID p_particles, int p_passes);
  810. virtual void particles_set_draw_pass_mesh(RID p_particles, int p_pass, RID p_mesh);
  811. virtual void particles_request_process(RID p_particles);
  812. virtual AABB particles_get_current_aabb(RID p_particles);
  813. virtual AABB particles_get_aabb(RID p_particles) const;
  814. virtual void particles_set_emission_transform(RID p_particles, const Transform &p_transform);
  815. virtual int particles_get_draw_passes(RID p_particles) const;
  816. virtual RID particles_get_draw_pass_mesh(RID p_particles, int p_pass) const;
  817. virtual bool particles_is_inactive(RID p_particles) const;
  818. /* INSTANCE */
  819. virtual void instance_add_skeleton(RID p_skeleton, RasterizerScene::InstanceBase *p_instance);
  820. virtual void instance_remove_skeleton(RID p_skeleton, RasterizerScene::InstanceBase *p_instance);
  821. virtual void instance_add_dependency(RID p_base, RasterizerScene::InstanceBase *p_instance);
  822. virtual void instance_remove_dependency(RID p_base, RasterizerScene::InstanceBase *p_instance);
  823. /* RENDER TARGET */
  824. struct RenderTarget : public RID_Data {
  825. GLuint fbo;
  826. GLuint color;
  827. GLuint depth;
  828. // TODO post processing effects?
  829. // TODO HDR?
  830. // TODO this is hardcoded for texscreen copies for now
  831. struct Effect {
  832. GLuint fbo;
  833. int width;
  834. int height;
  835. GLuint color;
  836. Effect() :
  837. fbo(0),
  838. width(0),
  839. height(0),
  840. color(0) {
  841. }
  842. };
  843. Effect copy_screen_effect;
  844. int width, height;
  845. bool flags[RENDER_TARGET_FLAG_MAX];
  846. bool used_in_frame;
  847. VS::ViewportMSAA msaa;
  848. RID texture;
  849. RenderTarget() :
  850. fbo(0),
  851. color(0),
  852. depth(0),
  853. width(0),
  854. height(0),
  855. used_in_frame(false),
  856. msaa(VS::VIEWPORT_MSAA_DISABLED) {
  857. for (int i = 0; i < RENDER_TARGET_FLAG_MAX; ++i) {
  858. flags[i] = false;
  859. }
  860. }
  861. };
  862. mutable RID_Owner<RenderTarget> render_target_owner;
  863. void _render_target_clear(RenderTarget *rt);
  864. void _render_target_allocate(RenderTarget *rt);
  865. virtual RID render_target_create();
  866. virtual void render_target_set_size(RID p_render_target, int p_width, int p_height);
  867. virtual RID render_target_get_texture(RID p_render_target) const;
  868. virtual void render_target_set_flag(RID p_render_target, RenderTargetFlags p_flag, bool p_value);
  869. virtual bool render_target_was_used(RID p_render_target);
  870. virtual void render_target_clear_used(RID p_render_target);
  871. virtual void render_target_set_msaa(RID p_render_target, VS::ViewportMSAA p_msaa);
  872. /* CANVAS SHADOW */
  873. struct CanvasLightShadow : public RID_Data {
  874. int size;
  875. int height;
  876. GLuint fbo;
  877. GLuint depth;
  878. GLuint distance; //for older devices
  879. };
  880. RID_Owner<CanvasLightShadow> canvas_light_shadow_owner;
  881. virtual RID canvas_light_shadow_buffer_create(int p_width);
  882. /* LIGHT SHADOW MAPPING */
  883. struct CanvasOccluder : public RID_Data {
  884. GLuint vertex_id; // 0 means, unconfigured
  885. GLuint index_id; // 0 means, unconfigured
  886. PoolVector<Vector2> lines;
  887. int len;
  888. };
  889. RID_Owner<CanvasOccluder> canvas_occluder_owner;
  890. virtual RID canvas_light_occluder_create();
  891. virtual void canvas_light_occluder_set_polylines(RID p_occluder, const PoolVector<Vector2> &p_lines);
  892. virtual VS::InstanceType get_base_type(RID p_rid) const;
  893. virtual bool free(RID p_rid);
  894. struct Frame {
  895. RenderTarget *current_rt;
  896. bool clear_request;
  897. Color clear_request_color;
  898. int canvas_draw_commands;
  899. float time[4];
  900. float delta;
  901. uint64_t count;
  902. } frame;
  903. void initialize();
  904. void finalize();
  905. void _copy_screen();
  906. virtual bool has_os_feature(const String &p_feature) const;
  907. virtual void update_dirty_resources();
  908. virtual void set_debug_generate_wireframes(bool p_generate);
  909. virtual void render_info_begin_capture();
  910. virtual void render_info_end_capture();
  911. virtual int get_captured_render_info(VS::RenderInfo p_info);
  912. virtual int get_render_info(VS::RenderInfo p_info);
  913. RasterizerStorageGLES2();
  914. };
  915. #endif // RASTERIZERSTORAGEGLES2_H