|
|
@@ -184,6 +184,8 @@ typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERPROC) (GLuint index, GLint size,
|
|
|
typedef void (APIENTRYP PFNGLVERTEXATTRIBIPOINTERPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
|
|
|
typedef void (APIENTRYP PFNGLVERTEXATTRIBLPOINTERPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
|
|
|
typedef void (APIENTRYP PFNGLVERTEXATTRIBDIVISORPROC) (GLuint index, GLuint divisor);
|
|
|
+typedef void (APIENTRYP PFNGLDRAWARRAYSINSTANCEDPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount);
|
|
|
+typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount);
|
|
|
#endif // OPENGLES_1
|
|
|
#ifndef OPENGLES
|
|
|
typedef void (APIENTRYP PFNGLGENSAMPLERSPROC) (GLsizei count, GLuint *samplers);
|
|
|
@@ -194,8 +196,6 @@ typedef void (APIENTRYP PFNGLSAMPLERPARAMETERIVPROC) (GLuint sampler, GLenum pna
|
|
|
typedef void (APIENTRYP PFNGLSAMPLERPARAMETERFPROC) (GLuint sampler, GLenum pname, GLfloat param);
|
|
|
typedef void (APIENTRYP PFNGLSAMPLERPARAMETERFVPROC) (GLuint sampler, GLenum pname, const GLfloat *param);
|
|
|
typedef void (APIENTRYP PFNGLPROGRAMPARAMETERIEXTPROC) (GLuint program, GLenum pname, GLint value);
|
|
|
-typedef void (APIENTRYP PFNGLDRAWARRAYSINSTANCEDPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount);
|
|
|
-typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount);
|
|
|
typedef void (APIENTRYP PFNGLCLEARTEXIMAGEPROC) (GLuint texture, GLint level, GLenum format, GLenum type, const void *data);
|
|
|
typedef void (APIENTRYP PFNGLCLEARTEXSUBIMAGEPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *data);
|
|
|
typedef void (APIENTRYP PFNGLBINDTEXTURESPROC) (GLuint first, GLsizei count, const GLuint *textures);
|
|
|
@@ -281,15 +281,19 @@ public:
|
|
|
bool force);
|
|
|
virtual void end_draw_primitives();
|
|
|
|
|
|
+#ifndef OPENGLES
|
|
|
void issue_memory_barrier(GLbitfield barrier);
|
|
|
+#endif
|
|
|
|
|
|
virtual TextureContext *prepare_texture(Texture *tex, int view);
|
|
|
virtual bool update_texture(TextureContext *tc, bool force);
|
|
|
virtual void release_texture(TextureContext *tc);
|
|
|
virtual bool extract_texture_data(Texture *tex);
|
|
|
|
|
|
+#ifndef OPENGLES
|
|
|
virtual SamplerContext *prepare_sampler(const SamplerState &sampler);
|
|
|
virtual void release_sampler(SamplerContext *sc);
|
|
|
+#endif
|
|
|
|
|
|
virtual GeomContext *prepare_geom(Geom *geom);
|
|
|
virtual void release_geom(GeomContext *gc);
|
|
|
@@ -318,12 +322,16 @@ public:
|
|
|
const GeomPrimitivePipelineReader *reader,
|
|
|
bool force);
|
|
|
|
|
|
+#ifndef OPENGLES
|
|
|
virtual void begin_occlusion_query();
|
|
|
virtual PT(OcclusionQueryContext) end_occlusion_query();
|
|
|
+#endif
|
|
|
|
|
|
virtual PT(TimerQueryContext) issue_timer_query(int pstats_index);
|
|
|
|
|
|
+#ifndef OPENGLES
|
|
|
virtual void dispatch_compute(int size_x, int size_y, int size_z);
|
|
|
+#endif
|
|
|
|
|
|
virtual PT(GeomMunger) make_geom_munger(const RenderState *state,
|
|
|
Thread *current_thread);
|
|
|
@@ -337,6 +345,7 @@ public:
|
|
|
virtual bool framebuffer_copy_to_ram
|
|
|
(Texture *tex, int view, int z, const DisplayRegion *dr, const RenderBuffer &rb);
|
|
|
|
|
|
+#ifndef OPENGLES_2
|
|
|
void apply_fog(Fog *fog);
|
|
|
|
|
|
virtual void bind_light(PointLight *light_obj, const NodePath &light,
|
|
|
@@ -345,6 +354,7 @@ public:
|
|
|
int light_id);
|
|
|
virtual void bind_light(Spotlight *light_obj, const NodePath &light,
|
|
|
int light_id);
|
|
|
+#endif
|
|
|
|
|
|
void print_gfx_visual();
|
|
|
|
|
|
@@ -380,18 +390,26 @@ protected:
|
|
|
void do_issue_rescale_normal();
|
|
|
void do_issue_color_write();
|
|
|
void do_issue_depth_test();
|
|
|
+#ifndef OPENGLES_2
|
|
|
void do_issue_alpha_test();
|
|
|
+#endif
|
|
|
void do_issue_depth_write();
|
|
|
void do_issue_cull_face();
|
|
|
+#ifndef OPENGLES_2
|
|
|
void do_issue_fog();
|
|
|
+#endif
|
|
|
void do_issue_depth_offset();
|
|
|
void do_issue_shade_model();
|
|
|
void do_issue_shader(bool state_has_changed = false);
|
|
|
+#ifndef OPENGLES_2
|
|
|
void do_issue_material();
|
|
|
+#endif
|
|
|
void do_issue_texture();
|
|
|
void do_issue_blending();
|
|
|
+#ifndef OPENGLES_2
|
|
|
void do_issue_tex_gen();
|
|
|
void do_issue_tex_matrix();
|
|
|
+#endif
|
|
|
void do_issue_stencil();
|
|
|
void do_issue_scissor();
|
|
|
|
|
|
@@ -414,6 +432,8 @@ protected:
|
|
|
virtual void *do_get_extension_func(const char *name);
|
|
|
|
|
|
virtual void reissue_transforms();
|
|
|
+
|
|
|
+#ifndef OPENGLES_2
|
|
|
virtual void enable_lighting(bool enable);
|
|
|
virtual void set_ambient_light(const LColor &color);
|
|
|
virtual void enable_light(int light_id, bool enable);
|
|
|
@@ -424,6 +444,7 @@ protected:
|
|
|
virtual void begin_bind_clip_planes();
|
|
|
virtual void bind_clip_plane(const NodePath &plane, int plane_id);
|
|
|
virtual void end_bind_clip_planes();
|
|
|
+#endif
|
|
|
|
|
|
virtual void free_pointers();
|
|
|
|
|
|
@@ -447,16 +468,21 @@ protected:
|
|
|
INLINE void set_color_write_mask(int mask);
|
|
|
INLINE void clear_color_write_mask();
|
|
|
|
|
|
+#ifndef OPENGLES_2
|
|
|
INLINE void call_glFogfv(GLenum pname, const LColor &color);
|
|
|
INLINE void call_glMaterialfv(GLenum face, GLenum pname, const LColor &color);
|
|
|
INLINE void call_glLightfv(GLenum light, GLenum pname, const LVecBase4 &value);
|
|
|
INLINE void call_glLightfv(GLenum light, GLenum pname, const LVecBase3 &value);
|
|
|
INLINE void call_glLightModelfv(GLenum pname, const LVecBase4 &value);
|
|
|
INLINE void call_glTexEnvfv(GLenum target, GLenum pname, const LVecBase4 &value);
|
|
|
+#endif
|
|
|
+
|
|
|
INLINE void call_glTexParameterfv(GLenum target, GLenum pname, const LVecBase4 &value);
|
|
|
|
|
|
+#ifndef OPENGLES_2
|
|
|
INLINE GLenum get_light_id(int index) const;
|
|
|
INLINE GLenum get_clip_plane_id(int index) const;
|
|
|
+#endif
|
|
|
|
|
|
void set_draw_buffer(int rbtype);
|
|
|
void set_read_buffer(int rbtype);
|
|
|
@@ -485,10 +511,12 @@ protected:
|
|
|
static GLenum get_usage(Geom::UsageHint usage_hint);
|
|
|
|
|
|
void unbind_buffers();
|
|
|
+#ifndef OPENGLES_2
|
|
|
void disable_standard_vertex_arrays();
|
|
|
bool update_standard_vertex_arrays(bool force);
|
|
|
void disable_standard_texture_bindings();
|
|
|
void update_standard_texture_bindings();
|
|
|
+#endif
|
|
|
|
|
|
#ifndef NDEBUG
|
|
|
void update_show_usage_texture_bindings(int show_stage_index);
|
|
|
@@ -570,7 +598,7 @@ protected:
|
|
|
ShaderContext *_texture_binding_shader_context;
|
|
|
#endif
|
|
|
#ifdef OPENGLES_2
|
|
|
- static PT(Shader) _default_shader;
|
|
|
+ static PT(Shader) _default_shader;
|
|
|
#endif
|
|
|
|
|
|
#ifdef HAVE_CG
|
|
|
@@ -640,21 +668,25 @@ public:
|
|
|
PFNGLWEIGHTDVARBPROC _glWeightdv;
|
|
|
|
|
|
bool _supports_matrix_palette;
|
|
|
-#ifdef OPENGLES
|
|
|
+#ifdef OPENGLES_1
|
|
|
PFNGLCURRENTPALETTEMATRIXOESPROC _glCurrentPaletteMatrix;
|
|
|
PFNGLMATRIXINDEXPOINTEROESPROC _glMatrixIndexPointer;
|
|
|
-#else
|
|
|
+#endif
|
|
|
+#ifndef OPENGLES
|
|
|
PFNGLCURRENTPALETTEMATRIXARBPROC _glCurrentPaletteMatrix;
|
|
|
PFNGLMATRIXINDEXPOINTERARBPROC _glMatrixIndexPointer;
|
|
|
PFNGLMATRIXINDEXUIVARBPROC _glMatrixIndexuiv;
|
|
|
#endif
|
|
|
|
|
|
- bool _supports_draw_range_elements;
|
|
|
+#ifndef OPENGLES
|
|
|
PFNGLDRAWRANGEELEMENTSPROC _glDrawRangeElements;
|
|
|
+#endif
|
|
|
|
|
|
+#ifndef OPENGLES_1
|
|
|
PFNGLTEXIMAGE3DPROC_P _glTexImage3D;
|
|
|
PFNGLTEXSUBIMAGE3DPROC _glTexSubImage3D;
|
|
|
PFNGLCOPYTEXSUBIMAGE3DPROC _glCopyTexSubImage3D;
|
|
|
+#endif
|
|
|
|
|
|
bool _supports_tex_storage;
|
|
|
PFNGLTEXSTORAGE1DPROC _glTexStorage1D;
|
|
|
@@ -678,8 +710,9 @@ public:
|
|
|
bool _supports_rescale_normal;
|
|
|
bool _supports_packed_dabc;
|
|
|
|
|
|
- bool _supports_multitexture;
|
|
|
PFNGLACTIVETEXTUREPROC _glActiveTexture;
|
|
|
+#ifndef OPENGLES_2
|
|
|
+ bool _supports_multitexture;
|
|
|
PFNGLCLIENTACTIVETEXTUREPROC _glClientActiveTexture;
|
|
|
PFNGLMULTITEXCOORD1FPROC _glMultiTexCoord1f;
|
|
|
PFNGLMULTITEXCOORD2FPROC _glMultiTexCoord2f;
|
|
|
@@ -689,6 +722,7 @@ public:
|
|
|
PFNGLMULTITEXCOORD2DPROC _glMultiTexCoord2d;
|
|
|
PFNGLMULTITEXCOORD3DPROC _glMultiTexCoord3d;
|
|
|
PFNGLMULTITEXCOORD4DPROC _glMultiTexCoord4d;
|
|
|
+#endif
|
|
|
|
|
|
bool _supports_buffers;
|
|
|
PFNGLGENBUFFERSPROC _glGenBuffers;
|
|
|
@@ -798,7 +832,9 @@ public:
|
|
|
PFNGLVERTEXATTRIBIPOINTERPROC _glVertexAttribIPointer;
|
|
|
PFNGLVERTEXATTRIBLPOINTERPROC _glVertexAttribLPointer;
|
|
|
PFNGLVERTEXATTRIBDIVISORPROC _glVertexAttribDivisor;
|
|
|
-#endif // OPENGLES_1
|
|
|
+ PFNGLDRAWARRAYSINSTANCEDPROC _glDrawArraysInstanced;
|
|
|
+ PFNGLDRAWELEMENTSINSTANCEDPROC _glDrawElementsInstanced;
|
|
|
+#endif // !OPENGLES_1
|
|
|
#ifndef OPENGLES
|
|
|
PFNGLGENSAMPLERSPROC _glGenSamplers;
|
|
|
PFNGLDELETESAMPLERSPROC _glDeleteSamplers;
|
|
|
@@ -809,8 +845,6 @@ public:
|
|
|
PFNGLSAMPLERPARAMETERFVPROC _glSamplerParameterfv;
|
|
|
PFNGLPROGRAMPARAMETERIPROC _glProgramParameteri;
|
|
|
PFNGLPATCHPARAMETERIPROC _glPatchParameteri;
|
|
|
- PFNGLDRAWARRAYSINSTANCEDPROC _glDrawArraysInstanced;
|
|
|
- PFNGLDRAWELEMENTSINSTANCEDPROC _glDrawElementsInstanced;
|
|
|
PFNGLBINDTEXTURESPROC _glBindTextures;
|
|
|
PFNGLBINDSAMPLERSPROC _glBindSamplers;
|
|
|
PFNGLBINDIMAGETEXTUREPROC _glBindImageTexture;
|
|
|
@@ -828,7 +862,7 @@ public:
|
|
|
PFNGLMAKETEXTUREHANDLENONRESIDENTPROC _glMakeTextureHandleNonResident;
|
|
|
PFNGLUNIFORMHANDLEUI64PROC _glUniformHandleui64;
|
|
|
PFNGLUNIFORMHANDLEUI64VPROC _glUniformHandleui64v;
|
|
|
-#endif // OPENGLES
|
|
|
+#endif // !OPENGLES
|
|
|
|
|
|
GLenum _edge_clamp;
|
|
|
GLenum _border_clamp;
|
|
|
@@ -836,7 +870,7 @@ public:
|
|
|
GLenum _mirror_clamp;
|
|
|
GLenum _mirror_edge_clamp;
|
|
|
GLenum _mirror_border_clamp;
|
|
|
-#ifndef OPENGLES
|
|
|
+#ifndef OPENGLES_1
|
|
|
GLsizei _instance_count;
|
|
|
#endif
|
|
|
|