Improve OpenGL ES support, add OpenGL ES 3 support
This commit is contained in:
parent
6ddfb0ace3
commit
e73a89705b
|
|
@ -81,6 +81,7 @@ typedef char GLchar;
|
|||
#define GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT GL_FRAMEBUFFER_INCOMPLETE_FORMATS
|
||||
#define GL_DEPTH_ATTACHMENT_EXT GL_DEPTH_ATTACHMENT
|
||||
#define GL_COLOR_ATTACHMENT0_EXT GL_COLOR_ATTACHMENT0
|
||||
#define GL_COLOR_ATTACHMENT1_EXT (GL_COLOR_ATTACHMENT0 + 1)
|
||||
#define GL_STENCIL_ATTACHMENT_EXT GL_STENCIL_ATTACHMENT
|
||||
#define GL_DEPTH_STENCIL GL_DEPTH_STENCIL_OES
|
||||
#define GL_DEPTH_STENCIL_EXT GL_DEPTH_STENCIL_OES
|
||||
|
|
@ -123,6 +124,104 @@ typedef char GLchar;
|
|||
#define GL_COMPRESSED_RGBA_S3TC_DXT3_EXT GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE
|
||||
#define GL_COMPRESSED_RGBA_S3TC_DXT5_EXT GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE
|
||||
|
||||
// For GLES 3 compat - need a better solution for this
|
||||
#define GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT 0x1
|
||||
#define GL_ELEMENT_ARRAY_BARRIER_BIT 0x2
|
||||
#define GL_UNIFORM_BARRIER_BIT 0x4
|
||||
#define GL_TEXTURE_FETCH_BARRIER_BIT 0x8
|
||||
#define GL_SHADER_IMAGE_ACCESS_BARRIER_BIT 0x20
|
||||
#define GL_COMMAND_BARRIER_BIT 0x40
|
||||
#define GL_PIXEL_BUFFER_BARRIER_BIT 0x80
|
||||
#define GL_TEXTURE_UPDATE_BARRIER_BIT 0x100
|
||||
#define GL_BUFFER_UPDATE_BARRIER_BIT 0x200
|
||||
#define GL_FRAMEBUFFER_BARRIER_BIT 0x400
|
||||
#define GL_TRANSFORM_FEEDBACK_BARRIER_BIT 0x800
|
||||
#define GL_ATOMIC_COUNTER_BARRIER_BIT 0x1000
|
||||
#define GL_HALF_FLOAT 0x140B
|
||||
#define GL_COLOR 0x1800
|
||||
#define GL_DEPTH 0x1801
|
||||
#define GL_STENCIL 0x1802
|
||||
#define GL_RGB10_A2 0x8059
|
||||
#define GL_TEXTURE_WRAP_R 0x8072
|
||||
#define GL_TEXTURE_MIN_LOD 0x813A
|
||||
#define GL_TEXTURE_MAX_LOD 0x813B
|
||||
#define GL_TEXTURE_MAX_LEVEL 0x813D
|
||||
#define GL_NUM_EXTENSIONS 0x821D
|
||||
#define GL_RG_INTEGER 0x8228
|
||||
#define GL_PROGRAM_BINARY_RETRIEVABLE_HINT 0x8257
|
||||
#define GL_PROGRAM_BINARY_LENGTH 0x8741
|
||||
#define GL_NUM_PROGRAM_BINARY_FORMATS 0x87FE
|
||||
#define GL_PROGRAM_BINARY_FORMATS 0x87FF
|
||||
#define GL_READ_ONLY 0x88B8
|
||||
#define GL_WRITE_ONLY 0x88B9
|
||||
#define GL_READ_WRITE 0x88BA
|
||||
#define GL_MAX_ARRAY_TEXTURE_LAYERS 0x88FF
|
||||
#define GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH 0x8A35
|
||||
#define GL_ACTIVE_UNIFORM_BLOCKS 0x8A36
|
||||
#define GL_UNIFORM_TYPE 0x8A37
|
||||
#define GL_UNIFORM_SIZE 0x8A38
|
||||
#define GL_UNIFORM_NAME_LENGTH 0x8A39
|
||||
#define GL_UNIFORM_BLOCK_INDEX 0x8A3A
|
||||
#define GL_UNIFORM_OFFSET 0x8A3B
|
||||
#define GL_UNIFORM_ARRAY_STRIDE 0x8A3C
|
||||
#define GL_UNIFORM_MATRIX_STRIDE 0x8A3D
|
||||
#define GL_UNIFORM_IS_ROW_MAJOR 0x8A3E
|
||||
#define GL_UNIFORM_BLOCK_BINDING 0x8A3F
|
||||
#define GL_UNIFORM_BLOCK_DATA_SIZE 0x8A40
|
||||
#define GL_UNIFORM_BLOCK_NAME_LENGTH 0x8A41
|
||||
#define GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS 0x8A42
|
||||
#define GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES 0x8A43
|
||||
#define GL_FLOAT_MAT2x3 0x8B65
|
||||
#define GL_FLOAT_MAT2x4 0x8B66
|
||||
#define GL_FLOAT_MAT3x2 0x8B67
|
||||
#define GL_FLOAT_MAT3x4 0x8B68
|
||||
#define GL_FLOAT_MAT4x2 0x8B69
|
||||
#define GL_FLOAT_MAT4x3 0x8B6A
|
||||
#define GL_TEXTURE_2D_ARRAY 0x8C1A
|
||||
#define GL_TEXTURE_BINDING_2D_ARRAY 0x8C1D
|
||||
#define GL_R11F_G11F_B10F 0x8C3A
|
||||
#define GL_UNSIGNED_INT_10F_11F_11F_REV 0x8C3B
|
||||
#define GL_RGB9_E5 0x8C3D
|
||||
#define GL_UNSIGNED_INT_5_9_9_9_REV 0x8C3E
|
||||
#define GL_UNSIGNED_INT_10F_11F_11F_REV 0x8C3B
|
||||
#define GL_PRIMITIVE_RESTART_FIXED_INDEX 0x8D69
|
||||
#define GL_RED_INTEGER 0x8D94
|
||||
#define GL_RGB_INTEGER 0x8D98
|
||||
#define GL_RGBA_INTEGER 0x8D99
|
||||
#define GL_SAMPLER_2D_ARRAY 0x8DC1
|
||||
#define GL_SAMPLER_2D_ARRAY_SHADOW 0x8DC4
|
||||
#define GL_SAMPLER_CUBE_SHADOW 0x8DC5
|
||||
#define GL_UNSIGNED_INT_VEC2 0x8DC6
|
||||
#define GL_UNSIGNED_INT_VEC3 0x8DC7
|
||||
#define GL_UNSIGNED_INT_VEC4 0x8DC8
|
||||
#define GL_INT_SAMPLER_2D 0x8DCA
|
||||
#define GL_INT_SAMPLER_3D 0x8DCB
|
||||
#define GL_INT_SAMPLER_CUBE 0x8DCC
|
||||
#define GL_INT_SAMPLER_2D_ARRAY 0x8DCF
|
||||
#define GL_UNSIGNED_INT_SAMPLER_2D 0x8DD2
|
||||
#define GL_UNSIGNED_INT_SAMPLER_3D 0x8DD3
|
||||
#define GL_UNSIGNED_INT_SAMPLER_CUBE 0x8DD4
|
||||
#define GL_UNSIGNED_INT_SAMPLER_2D_ARRAY 0x8DD7
|
||||
#define GL_MAX_IMAGE_UNITS 0x8F38
|
||||
#define GL_TEXTURE_CUBE_MAP_ARRAY 0x9009
|
||||
#define GL_IMAGE_2D 0x904D
|
||||
#define GL_IMAGE_3D 0x904E
|
||||
#define GL_IMAGE_CUBE 0x9050
|
||||
#define GL_IMAGE_2D_ARRAY 0x9053
|
||||
#define GL_INT_IMAGE_2D 0x9058
|
||||
#define GL_INT_IMAGE_3D 0x9059
|
||||
#define GL_INT_IMAGE_CUBE 0x905B
|
||||
#define GL_INT_IMAGE_2D_ARRAY 0x905E
|
||||
#define GL_UNSIGNED_INT_IMAGE_2D 0x9063
|
||||
#define GL_UNSIGNED_INT_IMAGE_3D 0x9064
|
||||
#define GL_UNSIGNED_INT_IMAGE_CUBE 0x9066
|
||||
#define GL_UNSIGNED_INT_IMAGE_2D_ARRAY 0x9069
|
||||
#define GL_COMPUTE_SHADER 0x91B9
|
||||
#define GL_FRAMEBUFFER_DEFAULT_WIDTH 0x9310
|
||||
#define GL_FRAMEBUFFER_DEFAULT_HEIGHT 0x9311
|
||||
#define GL_FRAMEBUFFER_DEFAULT_SAMPLES 0x9313
|
||||
#define GL_ALL_BARRIER_BITS 0xFFFFFFFF
|
||||
|
||||
#undef SUPPORT_IMMEDIATE_MODE
|
||||
#define APIENTRY
|
||||
#define APIENTRYP *
|
||||
|
|
|
|||
|
|
@ -73,6 +73,7 @@
|
|||
#define GL_RENDERBUFFER_ALPHA_SIZE_EXT GL_RENDERBUFFER_ALPHA_SIZE_OES
|
||||
#define GL_RENDERBUFFER_DEPTH_SIZE_EXT GL_RENDERBUFFER_DEPTH_SIZE_OES
|
||||
#define GL_RENDERBUFFER_STENCIL_SIZE_EXT GL_RENDERBUFFER_STENCIL_SIZE_OES
|
||||
#define GL_FRAMEBUFFER GL_FRAMEBUFFER_OES
|
||||
#define GL_FRAMEBUFFER_EXT GL_FRAMEBUFFER_OES
|
||||
#define GL_DRAW_FRAMEBUFFER_EXT GL_FRAMEBUFFER_OES
|
||||
#define GL_READ_FRAMEBUFFER_EXT GL_FRAMEBUFFER_OES
|
||||
|
|
@ -119,6 +120,17 @@
|
|||
#define GL_LUMINANCE8 GL_LUMINANCE8_EXT
|
||||
#define GL_LUMINANCE8_ALPHA8 GL_LUMINANCE8_ALPHA8_EXT
|
||||
#define GL_MAX_VERTEX_UNITS_ARB GL_MAX_VERTEX_UNITS_OES
|
||||
#define GL_TEXTURE_MAX_LEVEL GL_TEXTURE_MAX_LEVEL_APPLE
|
||||
|
||||
// These aren't technically part of OpenGL ES 1.0, but some implementations
|
||||
// nonetheless implement it.
|
||||
#define GL_DEBUG_OUTPUT_SYNCHRONOUS 0x8242
|
||||
#define GL_DEBUG_TYPE_PERFORMANCE 0x8250
|
||||
#define GL_DEBUG_SEVERITY_NOTIFICATION 0x826B
|
||||
#define GL_DEBUG_SEVERITY_HIGH 0x9146
|
||||
#define GL_DEBUG_SEVERITY_MEDIUM 0x9147
|
||||
#define GL_DEBUG_SEVERITY_LOW 0x9148
|
||||
#define GL_DEBUG_OUTPUT 0x92E0
|
||||
|
||||
#undef SUPPORT_IMMEDIATE_MODE
|
||||
#define APIENTRY
|
||||
|
|
|
|||
|
|
@ -252,7 +252,7 @@ begin_frame(FrameMode mode, Thread *current_thread) {
|
|||
|
||||
// In case of multisample rendering, we don't need to issue the barrier
|
||||
// until we call glBlitFramebuffer.
|
||||
#ifndef OPENGLES
|
||||
#ifndef OPENGLES_1
|
||||
if (gl_enable_memory_barriers && _fbo_multisample == 0) {
|
||||
CLP(GraphicsStateGuardian) *glgsg;
|
||||
DCAST_INTO_R(glgsg, _gsg, false);
|
||||
|
|
@ -526,7 +526,6 @@ rebuild_bitplanes() {
|
|||
}
|
||||
glgsg->bind_fbo(_fbo[layer]);
|
||||
|
||||
#ifndef OPENGLES
|
||||
if (glgsg->_use_object_labels) {
|
||||
// Assign a label for OpenGL to use when displaying debug messages.
|
||||
if (num_fbos > 1) {
|
||||
|
|
@ -538,7 +537,6 @@ rebuild_bitplanes() {
|
|||
glgsg->_glObjectLabel(GL_FRAMEBUFFER, _fbo[layer], _name.size(), _name.data());
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
// For all slots, update the slot.
|
||||
if (_use_depth_stencil) {
|
||||
|
|
@ -591,7 +589,7 @@ rebuild_bitplanes() {
|
|||
glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
|
||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
|
||||
}
|
||||
#ifndef OPENGLES
|
||||
#ifndef OPENGLES_1
|
||||
} else if (glgsg->_supports_empty_framebuffer) {
|
||||
// Set the "default" width and height, which is required to have an FBO
|
||||
// without any attachments.
|
||||
|
|
@ -751,12 +749,10 @@ bind_slot(int layer, bool rb_resize, Texture **attach, RenderTexturePlane slot,
|
|||
_fb_properties.setup_color_texture(tex);
|
||||
}
|
||||
|
||||
#ifndef OPENGLES
|
||||
GLenum target = glgsg->get_texture_target(tex->get_texture_type());
|
||||
if (target == GL_TEXTURE_CUBE_MAP) {
|
||||
target = GL_TEXTURE_CUBE_MAP_POSITIVE_X + layer;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (attachpoint == GL_DEPTH_ATTACHMENT_EXT) {
|
||||
GLCAT.debug() << "Binding texture " << *tex << " to depth attachment.\n";
|
||||
|
|
@ -815,7 +811,7 @@ bind_slot(int layer, bool rb_resize, Texture **attach, RenderTexturePlane slot,
|
|||
GLuint gl_format = GL_RGBA4;
|
||||
switch (slot) {
|
||||
case RTP_depth_stencil:
|
||||
gl_format = GL_DEPTH_STENCIL_OES;
|
||||
gl_format = GL_DEPTH24_STENCIL8_OES;
|
||||
break;
|
||||
case RTP_depth:
|
||||
if (_fb_properties.get_depth_bits() > 24 && glgsg->_supports_depth32) {
|
||||
|
|
@ -1191,9 +1187,7 @@ attach_tex(int layer, int view, Texture *attach, GLenum attachpoint) {
|
|||
glgsg->_glFramebufferTexture3D(GL_FRAMEBUFFER_EXT, attachpoint,
|
||||
target, gtc->_index, 0, layer);
|
||||
break;
|
||||
#endif
|
||||
#ifndef OPENGLES
|
||||
case GL_TEXTURE_2D_ARRAY_EXT:
|
||||
case GL_TEXTURE_2D_ARRAY:
|
||||
glgsg->_glFramebufferTextureLayer(GL_FRAMEBUFFER_EXT, attachpoint,
|
||||
gtc->_index, 0, layer);
|
||||
break;
|
||||
|
|
@ -1729,7 +1723,7 @@ resolve_multisamples() {
|
|||
|
||||
PStatGPUTimer timer(glgsg, _resolve_multisample_pcollector);
|
||||
|
||||
#ifndef OPENGLES
|
||||
#ifndef OPENGLES_1
|
||||
if (gl_enable_memory_barriers) {
|
||||
// Issue memory barriers as necessary to make sure that the texture memory
|
||||
// is synchronized before we blit to it.
|
||||
|
|
|
|||
|
|
@ -189,6 +189,8 @@ INLINE bool CLP(GraphicsStateGuardian)::
|
|||
is_at_least_gles_version(int major_version, int minor_version) const {
|
||||
#ifndef OPENGLES
|
||||
return false;
|
||||
#elif defined(OPENGLES_1)
|
||||
return major_version == 1 && _gl_version_minor >= minor_version;
|
||||
#else
|
||||
if (_gl_version_major < major_version) {
|
||||
return false;
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -186,8 +186,26 @@ typedef void (APIENTRYP PFNGLVERTEXATTRIBLPOINTERPROC) (GLuint index, GLint size
|
|||
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 PFNGLBINDBUFFERBASEPROC) (GLenum target, GLuint index, GLuint buffer);
|
||||
typedef void (APIENTRYP PFNGLDRAWARRAYSINDIRECTPROC) (GLenum mode, const void *indirect);
|
||||
typedef void (APIENTRYP PFNGLDRAWELEMENTSINDIRECTPROC) (GLenum mode, GLenum type, const void *indirect);
|
||||
typedef void (APIENTRYP PFNGLCLEARBUFFERIVPROC) (GLenum buffer, GLint drawbuffer, const GLint *value);
|
||||
typedef void (APIENTRYP PFNGLCLEARBUFFERUIVPROC) (GLenum buffer, GLint drawbuffer, const GLuint *value);
|
||||
typedef void (APIENTRYP PFNGLCLEARBUFFERFVPROC) (GLenum buffer, GLint drawbuffer, const GLfloat *value);
|
||||
typedef void (APIENTRYP PFNGLCLEARBUFFERFIPROC) (GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil);
|
||||
typedef void (APIENTRYP PFNGLBINDVERTEXBUFFERPROC) (GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride);
|
||||
typedef void (APIENTRYP PFNGLVERTEXATTRIBFORMATPROC) (GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset);
|
||||
typedef void (APIENTRYP PFNGLVERTEXATTRIBIFORMATPROC) (GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset);
|
||||
typedef void (APIENTRYP PFNGLVERTEXATTRIBLFORMATPROC) (GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset);
|
||||
typedef void (APIENTRYP PFNGLVERTEXATTRIBBINDINGPROC) (GLuint attribindex, GLuint bindingindex);
|
||||
typedef void (APIENTRYP PFNGLVERTEXBINDINGDIVISORPROC) (GLuint bindingindex, GLuint divisor);
|
||||
typedef void (APIENTRYP PFNGLGETUNIFORMINDICESPROC) (GLuint program, GLsizei uniformCount, const GLchar *const*uniformNames, GLuint *uniformIndices);
|
||||
typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMSIVPROC) (GLuint program, GLsizei uniformCount, const GLuint *uniformIndices, GLenum pname, GLint *params);
|
||||
typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMNAMEPROC) (GLuint program, GLuint uniformIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformName);
|
||||
typedef GLuint (APIENTRYP PFNGLGETUNIFORMBLOCKINDEXPROC) (GLuint program, const GLchar *uniformBlockName);
|
||||
typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMBLOCKIVPROC) (GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint *params);
|
||||
typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC) (GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformBlockName);
|
||||
typedef void (APIENTRYP PFNGLUNIFORMBLOCKBINDINGPROC) (GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding);
|
||||
typedef void (APIENTRYP PFNGLGENSAMPLERSPROC) (GLsizei count, GLuint *samplers);
|
||||
typedef void (APIENTRYP PFNGLDELETESAMPLERSPROC) (GLsizei count, const GLuint *samplers);
|
||||
typedef void (APIENTRYP PFNGLBINDSAMPLERPROC) (GLuint unit, GLuint sampler);
|
||||
|
|
@ -195,17 +213,22 @@ typedef void (APIENTRYP PFNGLSAMPLERPARAMETERIPROC) (GLuint sampler, GLenum pnam
|
|||
typedef void (APIENTRYP PFNGLSAMPLERPARAMETERIVPROC) (GLuint sampler, GLenum pname, const GLint *param);
|
||||
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 PFNGLPROGRAMPARAMETERIPROC) (GLuint program, GLenum pname, GLint value);
|
||||
typedef void (APIENTRYP PFNGLDISPATCHCOMPUTEPROC) (GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z);
|
||||
typedef void (APIENTRYP PFNGLFRAMEBUFFERPARAMETERIPROC) (GLenum target, GLenum pname, GLint param);
|
||||
typedef void (APIENTRYP PFNGLMEMORYBARRIERPROC) (GLbitfield barriers);
|
||||
typedef void (APIENTRYP PFNGLGETPROGRAMBINARYPROC) (GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, void *binary);
|
||||
typedef void (APIENTRYP PFNGLPROGRAMBINARYPROC) (GLuint program, GLenum binaryFormat, const void *binary, GLsizei length);
|
||||
typedef void (APIENTRYP PFNGLGETINTERNALFORMATIVPROC) (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint *params);
|
||||
typedef void (APIENTRYP PFNGLBUFFERSTORAGEPROC) (GLenum target, GLsizeiptr size, const void *data, GLbitfield flags);
|
||||
typedef void (APIENTRYP PFNGLBINDIMAGETEXTUREPROC) (GLuint unit, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format);
|
||||
#endif // OPENGLES_1
|
||||
#ifndef OPENGLES
|
||||
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);
|
||||
typedef void (APIENTRYP PFNGLBINDSAMPLERSPROC) (GLuint first, GLsizei count, const GLuint *samplers);
|
||||
typedef void (APIENTRYP PFNGLBINDIMAGETEXTUREPROC) (GLuint unit, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format);
|
||||
typedef void (APIENTRYP PFNGLBINDIMAGETEXTURESPROC) (GLuint first, GLsizei count, const GLuint *textures);
|
||||
typedef void (APIENTRYP PFNGLDISPATCHCOMPUTEPROC) (GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z);
|
||||
typedef void (APIENTRYP PFNGLMEMORYBARRIERPROC) (GLbitfield barriers);
|
||||
typedef void (APIENTRYP PFNGLGETPROGRAMBINARYPROC) (GLuint program, GLsizei bufsize, GLsizei *length, GLenum *binaryFormat, void *binary);
|
||||
typedef void (APIENTRYP PFNGLGETINTERNALFORMATIVPROC) (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint *params);
|
||||
typedef GLuint64 (APIENTRYP PFNGLGETTEXTUREHANDLEPROC) (GLuint texture);
|
||||
typedef GLuint64 (APIENTRYP PFNGLGETTEXTURESAMPLERHANDLEPROC) (GLuint texture, GLuint sampler);
|
||||
typedef void (APIENTRYP PFNGLMAKETEXTUREHANDLERESIDENTPROC) (GLuint64 handle);
|
||||
|
|
@ -245,9 +268,7 @@ public:
|
|||
virtual int get_driver_shader_version_major();
|
||||
virtual int get_driver_shader_version_minor();
|
||||
|
||||
#ifndef OPENGLES_1
|
||||
static void debug_callback(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *message, GLvoid *userParam);
|
||||
#endif
|
||||
|
||||
virtual void reset();
|
||||
|
||||
|
|
@ -281,7 +302,7 @@ public:
|
|||
bool force);
|
||||
virtual void end_draw_primitives();
|
||||
|
||||
#ifndef OPENGLES
|
||||
#ifndef OPENGLES_1
|
||||
void issue_memory_barrier(GLbitfield barrier);
|
||||
#endif
|
||||
|
||||
|
|
@ -290,7 +311,7 @@ public:
|
|||
virtual void release_texture(TextureContext *tc);
|
||||
virtual bool extract_texture_data(Texture *tex);
|
||||
|
||||
#ifndef OPENGLES
|
||||
#ifndef OPENGLES_1
|
||||
virtual SamplerContext *prepare_sampler(const SamplerState &sampler);
|
||||
virtual void release_sampler(SamplerContext *sc);
|
||||
#endif
|
||||
|
|
@ -329,7 +350,7 @@ public:
|
|||
|
||||
virtual PT(TimerQueryContext) issue_timer_query(int pstats_index);
|
||||
|
||||
#ifndef OPENGLES
|
||||
#ifndef OPENGLES_1
|
||||
virtual void dispatch_compute(int size_x, int size_y, int size_z);
|
||||
#endif
|
||||
|
||||
|
|
@ -536,7 +557,7 @@ protected:
|
|||
void disable_standard_texture_bindings();
|
||||
void update_standard_texture_bindings();
|
||||
#endif
|
||||
#ifndef OPENGLES
|
||||
#ifndef OPENGLES_1
|
||||
void update_shader_vertex_format(const GeomVertexFormat *format);
|
||||
#endif
|
||||
|
||||
|
|
@ -660,7 +681,7 @@ protected:
|
|||
GLuint _current_ibuffer_index;
|
||||
GLuint _current_fbo;
|
||||
|
||||
#ifndef OPENGLES
|
||||
#ifndef OPENGLES_1
|
||||
pvector<GLuint> _current_vertex_buffers;
|
||||
bool _use_vertex_attrib_binding;
|
||||
CPT(GeomVertexFormat) _current_vertex_format;
|
||||
|
|
@ -704,7 +725,7 @@ public:
|
|||
PFNGLSECONDARYCOLORPOINTERPROC _glSecondaryColorPointer;
|
||||
#endif
|
||||
|
||||
#ifndef OPENGLES
|
||||
#ifndef OPENGLES_1
|
||||
PFNGLDRAWRANGEELEMENTSPROC _glDrawRangeElements;
|
||||
#endif
|
||||
|
||||
|
|
@ -780,8 +801,15 @@ public:
|
|||
#ifndef OPENGLES
|
||||
PFNGLMAPBUFFERPROC _glMapBuffer;
|
||||
PFNGLUNMAPBUFFERPROC _glUnmapBuffer;
|
||||
PFNGLMAPBUFFERRANGEPROC _glMapBufferRange;
|
||||
#endif
|
||||
|
||||
#ifdef OPENGLES
|
||||
PFNGLMAPBUFFERRANGEEXTPROC _glMapBufferRange;
|
||||
#else
|
||||
PFNGLMAPBUFFERRANGEPROC _glMapBufferRange;
|
||||
#endif
|
||||
|
||||
#ifndef OPENGLES_1
|
||||
bool _supports_uniform_buffers;
|
||||
PFNGLBINDBUFFERBASEPROC _glBindBufferBase;
|
||||
|
||||
|
|
@ -789,8 +817,12 @@ public:
|
|||
PFNGLBUFFERSTORAGEPROC _glBufferStorage;
|
||||
#endif
|
||||
|
||||
#ifndef OPENGLES_2
|
||||
PFNGLBLENDEQUATIONPROC _glBlendEquation;
|
||||
#endif
|
||||
#ifndef OPENGLES
|
||||
PFNGLBLENDCOLORPROC _glBlendColor;
|
||||
#endif
|
||||
|
||||
bool _supports_vao;
|
||||
GLuint _current_vao_index;
|
||||
|
|
@ -798,7 +830,7 @@ public:
|
|||
PFNGLDELETEVERTEXARRAYSPROC _glDeleteVertexArrays;
|
||||
PFNGLGENVERTEXARRAYSPROC _glGenVertexArrays;
|
||||
|
||||
#ifndef OPENGLES
|
||||
#ifndef OPENGLES_1
|
||||
PFNGLDRAWARRAYSINDIRECTPROC _glDrawArraysIndirect;
|
||||
PFNGLDRAWELEMENTSINDIRECTPROC _glDrawElementsIndirect;
|
||||
#endif
|
||||
|
|
@ -833,7 +865,7 @@ public:
|
|||
PFNGLGENERATETEXTUREMIPMAPPROC _glGenerateTextureMipmap;
|
||||
#endif
|
||||
|
||||
#ifndef OPENGLES
|
||||
#ifndef OPENGLES_1
|
||||
bool _supports_empty_framebuffer;
|
||||
PFNGLFRAMEBUFFERPARAMETERIPROC _glFramebufferParameteri;
|
||||
#endif
|
||||
|
|
@ -849,7 +881,7 @@ public:
|
|||
PFNGLBLITFRAMEBUFFEREXTPROC _glBlitFramebuffer;
|
||||
PFNGLDRAWBUFFERSPROC _glDrawBuffers;
|
||||
|
||||
#ifndef OPENGLES
|
||||
#ifndef OPENGLES_1
|
||||
PFNGLCLEARBUFFERFVPROC _glClearBufferfv;
|
||||
PFNGLCLEARBUFFERIVPROC _glClearBufferiv;
|
||||
PFNGLCLEARBUFFERFIPROC _glClearBufferfi;
|
||||
|
|
@ -920,10 +952,7 @@ public:
|
|||
PFNGLVERTEXATTRIBDIVISORPROC _glVertexAttribDivisor;
|
||||
PFNGLDRAWARRAYSINSTANCEDPROC _glDrawArraysInstanced;
|
||||
PFNGLDRAWELEMENTSINSTANCEDPROC _glDrawElementsInstanced;
|
||||
#endif // !OPENGLES_1
|
||||
#ifndef OPENGLES
|
||||
PFNGLBINDVERTEXBUFFERPROC _glBindVertexBuffer;
|
||||
PFNGLBINDVERTEXBUFFERSPROC _glBindVertexBuffers;
|
||||
PFNGLVERTEXATTRIBFORMATPROC _glVertexAttribFormat;
|
||||
PFNGLVERTEXATTRIBIFORMATPROC _glVertexAttribIFormat;
|
||||
PFNGLVERTEXATTRIBLFORMATPROC _glVertexAttribLFormat;
|
||||
|
|
@ -940,16 +969,19 @@ public:
|
|||
PFNGLSAMPLERPARAMETERFPROC _glSamplerParameterf;
|
||||
PFNGLSAMPLERPARAMETERFVPROC _glSamplerParameterfv;
|
||||
PFNGLPROGRAMPARAMETERIPROC _glProgramParameteri;
|
||||
PFNGLPATCHPARAMETERIPROC _glPatchParameteri;
|
||||
PFNGLBINDTEXTURESPROC _glBindTextures;
|
||||
PFNGLBINDSAMPLERSPROC _glBindSamplers;
|
||||
PFNGLBINDIMAGETEXTUREPROC _glBindImageTexture;
|
||||
PFNGLBINDIMAGETEXTURESPROC _glBindImageTextures;
|
||||
PFNGLDISPATCHCOMPUTEPROC _glDispatchCompute;
|
||||
PFNGLMEMORYBARRIERPROC _glMemoryBarrier;
|
||||
PFNGLGETPROGRAMBINARYPROC _glGetProgramBinary;
|
||||
PFNGLPROGRAMBINARYPROC _glProgramBinary;
|
||||
PFNGLGETINTERNALFORMATIVPROC _glGetInternalformativ;
|
||||
PFNGLBINDIMAGETEXTUREPROC _glBindImageTexture;
|
||||
#endif // !OPENGLES_1
|
||||
#ifndef OPENGLES
|
||||
PFNGLBINDVERTEXBUFFERSPROC _glBindVertexBuffers;
|
||||
PFNGLPATCHPARAMETERIPROC _glPatchParameteri;
|
||||
PFNGLBINDTEXTURESPROC _glBindTextures;
|
||||
PFNGLBINDSAMPLERSPROC _glBindSamplers;
|
||||
PFNGLBINDIMAGETEXTURESPROC _glBindImageTextures;
|
||||
PFNGLVIEWPORTARRAYVPROC _glViewportArrayv;
|
||||
PFNGLSCISSORARRAYVPROC _glScissorArrayv;
|
||||
PFNGLDEPTHRANGEARRAYVPROC _glDepthRangeArrayv;
|
||||
|
|
@ -968,10 +1000,9 @@ public:
|
|||
GLenum _mirror_edge_clamp;
|
||||
GLenum _mirror_border_clamp;
|
||||
|
||||
#ifndef OPENGLES
|
||||
bool _supports_texture_lod;
|
||||
bool _supports_texture_lod_bias;
|
||||
#endif
|
||||
bool _supports_texture_max_level;
|
||||
|
||||
#ifndef OPENGLES_1
|
||||
GLsizei _instance_count;
|
||||
|
|
@ -982,7 +1013,7 @@ public:
|
|||
DeletedNames _deleted_display_lists;
|
||||
DeletedNames _deleted_queries;
|
||||
|
||||
#ifndef OPENGLES
|
||||
#ifndef OPENGLES_1
|
||||
// Stores textures for which memory bariers should be issued.
|
||||
typedef pset<TextureContext*> TextureSet;
|
||||
TextureSet _textures_needing_fetch_barrier;
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
|
||||
#include "pnotify.h"
|
||||
|
||||
#ifndef OPENGLES
|
||||
#ifndef OPENGLES_1
|
||||
|
||||
TypeHandle CLP(SamplerContext)::_type_handle;
|
||||
|
||||
|
|
@ -68,4 +68,4 @@ reset_data() {
|
|||
// the sampler later. glGenSamplers(1, &_index);
|
||||
}
|
||||
|
||||
#endif // OPENGLES
|
||||
#endif // OPENGLES_1
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
* @date 2014-12-11
|
||||
*/
|
||||
|
||||
#ifndef OPENGLES
|
||||
#ifndef OPENGLES_1
|
||||
|
||||
#include "pandabase.h"
|
||||
#include "samplerContext.h"
|
||||
|
|
@ -56,4 +56,4 @@ private:
|
|||
static TypeHandle _type_handle;
|
||||
};
|
||||
|
||||
#endif // OPENGLES
|
||||
#endif // OPENGLES_1
|
||||
|
|
|
|||
|
|
@ -300,7 +300,6 @@ CLP(ShaderContext)(CLP(GraphicsStateGuardian) *glgsg, Shader *s) : ShaderContext
|
|||
name_buflen = max(64, name_buflen);
|
||||
name_buffer = (char *)alloca(name_buflen);
|
||||
|
||||
#ifndef OPENGLES
|
||||
// Get the used uniform blocks.
|
||||
if (_glgsg->_supports_uniform_buffers) {
|
||||
GLint block_count = 0, block_maxlength = 0;
|
||||
|
|
@ -324,7 +323,6 @@ CLP(ShaderContext)(CLP(GraphicsStateGuardian) *glgsg, Shader *s) : ShaderContext
|
|||
reflect_uniform_block(i, block_name_cstr, name_buffer, name_buflen);
|
||||
}
|
||||
}
|
||||
#endif // !OPENGLES
|
||||
|
||||
// Bind the program, so that we can call glUniform1i for the textures.
|
||||
_glgsg->_glUseProgram(_glsl_program);
|
||||
|
|
@ -402,11 +400,9 @@ reflect_attribute(int i, char *name_buffer, GLsizei name_buflen) {
|
|||
param_type == GL_INT_VEC2 ||
|
||||
param_type == GL_INT_VEC3 ||
|
||||
param_type == GL_INT_VEC4 ||
|
||||
#ifndef OPENGLES
|
||||
param_type == GL_UNSIGNED_INT_VEC2 ||
|
||||
param_type == GL_UNSIGNED_INT_VEC3 ||
|
||||
param_type == GL_UNSIGNED_INT_VEC4 ||
|
||||
#endif
|
||||
param_type == GL_UNSIGNED_INT);
|
||||
|
||||
// Check if it has a p3d_ prefix - if so, assign special meaning.
|
||||
|
|
@ -505,7 +501,6 @@ reflect_attribute(int i, char *name_buffer, GLsizei name_buflen) {
|
|||
_shader->_var_spec.push_back(bind);
|
||||
}
|
||||
|
||||
#ifndef OPENGLES
|
||||
/**
|
||||
* Analyzes the uniform block and stores its format.
|
||||
*/
|
||||
|
|
@ -583,6 +578,7 @@ reflect_uniform_block(int i, const char *name, char *name_buffer, GLsizei name_b
|
|||
numeric_type = GeomEnums::NT_float32;
|
||||
break;
|
||||
|
||||
#ifndef OPENGLES
|
||||
case GL_DOUBLE:
|
||||
case GL_DOUBLE_VEC2:
|
||||
case GL_DOUBLE_VEC3:
|
||||
|
|
@ -592,6 +588,7 @@ reflect_uniform_block(int i, const char *name, char *name_buffer, GLsizei name_b
|
|||
case GL_DOUBLE_MAT4:
|
||||
numeric_type = GeomEnums::NT_float64;
|
||||
break;
|
||||
#endif
|
||||
|
||||
default:
|
||||
GLCAT.info() << "Ignoring uniform '" << name_buffer
|
||||
|
|
@ -604,7 +601,9 @@ reflect_uniform_block(int i, const char *name, char *name_buffer, GLsizei name_b
|
|||
case GL_BOOL_VEC2:
|
||||
case GL_UNSIGNED_INT_VEC2:
|
||||
case GL_FLOAT_VEC2:
|
||||
#ifndef OPENGLES
|
||||
case GL_DOUBLE_VEC2:
|
||||
#endif
|
||||
num_components = 2;
|
||||
break;
|
||||
|
||||
|
|
@ -612,7 +611,9 @@ reflect_uniform_block(int i, const char *name, char *name_buffer, GLsizei name_b
|
|||
case GL_BOOL_VEC3:
|
||||
case GL_UNSIGNED_INT_VEC3:
|
||||
case GL_FLOAT_VEC3:
|
||||
#ifndef OPENGLES
|
||||
case GL_DOUBLE_VEC3:
|
||||
#endif
|
||||
num_components = 3;
|
||||
break;
|
||||
|
||||
|
|
@ -620,12 +621,16 @@ reflect_uniform_block(int i, const char *name, char *name_buffer, GLsizei name_b
|
|||
case GL_BOOL_VEC4:
|
||||
case GL_UNSIGNED_INT_VEC4:
|
||||
case GL_FLOAT_VEC4:
|
||||
#ifndef OPENGLES
|
||||
case GL_DOUBLE_VEC4:
|
||||
#endif
|
||||
num_components = 4;
|
||||
break;
|
||||
|
||||
case GL_FLOAT_MAT3:
|
||||
#ifndef OPENGLES
|
||||
case GL_DOUBLE_MAT3:
|
||||
#endif
|
||||
num_components = 3;
|
||||
contents = GeomEnums::C_matrix;
|
||||
nassertd(param_size <= 1 || astrides[ui] == mstrides[ui] * 3) continue;
|
||||
|
|
@ -633,7 +638,9 @@ reflect_uniform_block(int i, const char *name, char *name_buffer, GLsizei name_b
|
|||
break;
|
||||
|
||||
case GL_FLOAT_MAT4:
|
||||
#ifndef OPENGLES
|
||||
case GL_DOUBLE_MAT4:
|
||||
#endif
|
||||
num_components = 4;
|
||||
contents = GeomEnums::C_matrix;
|
||||
nassertd(param_size <= 1 || astrides[ui] == mstrides[ui] * 4) continue;
|
||||
|
|
@ -655,7 +662,6 @@ reflect_uniform_block(int i, const char *name, char *name_buffer, GLsizei name_b
|
|||
|
||||
// _uniform_blocks.push_back(block);
|
||||
}
|
||||
#endif // !OPENGLES
|
||||
|
||||
/**
|
||||
* Analyzes a single uniform variable and considers how it should be handled
|
||||
|
|
@ -1099,9 +1105,7 @@ reflect_uniform(int i, char *name_buffer, GLsizei name_buflen) {
|
|||
string member_name(name_buffer);
|
||||
if (member_name == "shadowMap") {
|
||||
switch (param_type) {
|
||||
#ifndef OPENGLES
|
||||
case GL_SAMPLER_CUBE_SHADOW:
|
||||
#endif // !OPENGLES
|
||||
case GL_SAMPLER_2D:
|
||||
case GL_SAMPLER_2D_SHADOW:
|
||||
case GL_SAMPLER_CUBE:
|
||||
|
|
@ -1279,26 +1283,26 @@ reflect_uniform(int i, char *name_buffer, GLsizei name_buflen) {
|
|||
if (param_size == 1) {
|
||||
// A single uniform (not an array, or an array of size 1).
|
||||
switch (param_type) {
|
||||
#ifndef OPENGLES
|
||||
case GL_INT_SAMPLER_1D:
|
||||
case GL_INT_SAMPLER_2D:
|
||||
case GL_INT_SAMPLER_3D:
|
||||
case GL_INT_SAMPLER_2D_ARRAY:
|
||||
case GL_INT_SAMPLER_CUBE:
|
||||
case GL_INT_SAMPLER_BUFFER:
|
||||
case GL_INT_SAMPLER_CUBE_MAP_ARRAY:
|
||||
case GL_UNSIGNED_INT_SAMPLER_1D:
|
||||
case GL_UNSIGNED_INT_SAMPLER_2D:
|
||||
case GL_UNSIGNED_INT_SAMPLER_3D:
|
||||
case GL_UNSIGNED_INT_SAMPLER_CUBE:
|
||||
case GL_UNSIGNED_INT_SAMPLER_2D_ARRAY:
|
||||
case GL_UNSIGNED_INT_SAMPLER_BUFFER:
|
||||
case GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY:
|
||||
case GL_SAMPLER_1D_SHADOW:
|
||||
case GL_SAMPLER_1D:
|
||||
case GL_SAMPLER_CUBE_SHADOW:
|
||||
case GL_SAMPLER_2D_ARRAY:
|
||||
case GL_SAMPLER_2D_ARRAY_SHADOW:
|
||||
#ifndef OPENGLES
|
||||
case GL_INT_SAMPLER_1D:
|
||||
case GL_INT_SAMPLER_BUFFER:
|
||||
case GL_INT_SAMPLER_CUBE_MAP_ARRAY:
|
||||
case GL_UNSIGNED_INT_SAMPLER_1D:
|
||||
case GL_UNSIGNED_INT_SAMPLER_BUFFER:
|
||||
case GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY:
|
||||
case GL_SAMPLER_1D:
|
||||
case GL_SAMPLER_1D_SHADOW:
|
||||
case GL_SAMPLER_BUFFER:
|
||||
case GL_SAMPLER_CUBE_MAP_ARRAY:
|
||||
case GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW:
|
||||
|
|
@ -1320,14 +1324,12 @@ reflect_uniform(int i, char *name_buffer, GLsizei name_buflen) {
|
|||
return;
|
||||
}
|
||||
case GL_FLOAT_MAT2:
|
||||
#ifndef OPENGLES
|
||||
case GL_FLOAT_MAT2x3:
|
||||
case GL_FLOAT_MAT2x4:
|
||||
case GL_FLOAT_MAT3x2:
|
||||
case GL_FLOAT_MAT3x4:
|
||||
case GL_FLOAT_MAT4x2:
|
||||
case GL_FLOAT_MAT4x3:
|
||||
#endif
|
||||
GLCAT.warning() << "GLSL shader requested an unsupported matrix type\n";
|
||||
return;
|
||||
case GL_FLOAT_MAT3: {
|
||||
|
|
@ -1461,28 +1463,29 @@ reflect_uniform(int i, char *name_buffer, GLsizei name_buflen) {
|
|||
_shader->_ptr_spec.push_back(bind);
|
||||
return;
|
||||
}
|
||||
#ifndef OPENGLES
|
||||
case GL_IMAGE_1D:
|
||||
case GL_IMAGE_2D:
|
||||
case GL_IMAGE_3D:
|
||||
case GL_IMAGE_CUBE:
|
||||
case GL_IMAGE_2D_ARRAY:
|
||||
case GL_IMAGE_CUBE_MAP_ARRAY:
|
||||
case GL_IMAGE_BUFFER:
|
||||
case GL_INT_IMAGE_1D:
|
||||
case GL_INT_IMAGE_2D:
|
||||
case GL_INT_IMAGE_3D:
|
||||
case GL_INT_IMAGE_CUBE:
|
||||
case GL_INT_IMAGE_2D_ARRAY:
|
||||
case GL_INT_IMAGE_CUBE_MAP_ARRAY:
|
||||
case GL_INT_IMAGE_BUFFER:
|
||||
case GL_UNSIGNED_INT_IMAGE_1D:
|
||||
case GL_UNSIGNED_INT_IMAGE_2D:
|
||||
case GL_UNSIGNED_INT_IMAGE_3D:
|
||||
case GL_UNSIGNED_INT_IMAGE_CUBE:
|
||||
case GL_UNSIGNED_INT_IMAGE_2D_ARRAY:
|
||||
#ifndef OPENGLES
|
||||
case GL_IMAGE_1D:
|
||||
case GL_IMAGE_CUBE_MAP_ARRAY:
|
||||
case GL_IMAGE_BUFFER:
|
||||
case GL_INT_IMAGE_1D:
|
||||
case GL_INT_IMAGE_CUBE_MAP_ARRAY:
|
||||
case GL_INT_IMAGE_BUFFER:
|
||||
case GL_UNSIGNED_INT_IMAGE_1D:
|
||||
case GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY:
|
||||
case GL_UNSIGNED_INT_IMAGE_BUFFER:
|
||||
#endif
|
||||
// This won't really change at runtime, so we might as well bind once
|
||||
// and then forget about it.
|
||||
_glgsg->_glUniform1i(p, _glsl_img_inputs.size());
|
||||
|
|
@ -1494,7 +1497,6 @@ reflect_uniform(int i, char *name_buffer, GLsizei name_buflen) {
|
|||
_glsl_img_inputs.push_back(input);
|
||||
}
|
||||
return;
|
||||
#endif
|
||||
default:
|
||||
GLCAT.warning() << "Ignoring unrecognized GLSL parameter type!\n";
|
||||
}
|
||||
|
|
@ -1502,14 +1504,12 @@ reflect_uniform(int i, char *name_buffer, GLsizei name_buflen) {
|
|||
// A uniform array.
|
||||
switch (param_type) {
|
||||
case GL_FLOAT_MAT2:
|
||||
#ifndef OPENGLES
|
||||
case GL_FLOAT_MAT2x3:
|
||||
case GL_FLOAT_MAT2x4:
|
||||
case GL_FLOAT_MAT3x2:
|
||||
case GL_FLOAT_MAT3x4:
|
||||
case GL_FLOAT_MAT4x2:
|
||||
case GL_FLOAT_MAT4x3:
|
||||
#endif
|
||||
GLCAT.warning() << "GLSL shader requested an unrecognized matrix array type\n";
|
||||
return;
|
||||
case GL_BOOL:
|
||||
|
|
@ -1597,10 +1597,10 @@ get_sampler_texture_type(int &out, GLenum param_type) {
|
|||
case GL_SAMPLER_1D:
|
||||
out = Texture::TT_1d_texture;
|
||||
return true;
|
||||
#endif
|
||||
|
||||
case GL_INT_SAMPLER_2D:
|
||||
case GL_UNSIGNED_INT_SAMPLER_2D:
|
||||
#endif
|
||||
case GL_SAMPLER_2D:
|
||||
out = Texture::TT_2d_texture;
|
||||
return true;
|
||||
|
|
@ -1614,10 +1614,8 @@ get_sampler_texture_type(int &out, GLenum param_type) {
|
|||
}
|
||||
return true;
|
||||
|
||||
#ifndef OPENGLES
|
||||
case GL_INT_SAMPLER_3D:
|
||||
case GL_UNSIGNED_INT_SAMPLER_3D:
|
||||
#endif
|
||||
case GL_SAMPLER_3D:
|
||||
out = Texture::TT_3d_texture;
|
||||
if (_glgsg->_supports_3d_texture) {
|
||||
|
|
@ -1628,7 +1626,6 @@ get_sampler_texture_type(int &out, GLenum param_type) {
|
|||
return false;
|
||||
}
|
||||
|
||||
#ifndef OPENGLES
|
||||
case GL_SAMPLER_CUBE_SHADOW:
|
||||
if (!_glgsg->_supports_shadow_filter) {
|
||||
GLCAT.error()
|
||||
|
|
@ -1638,7 +1635,6 @@ get_sampler_texture_type(int &out, GLenum param_type) {
|
|||
// Fall through
|
||||
case GL_INT_SAMPLER_CUBE:
|
||||
case GL_UNSIGNED_INT_SAMPLER_CUBE:
|
||||
#endif
|
||||
case GL_SAMPLER_CUBE:
|
||||
out = Texture::TT_cube_map;
|
||||
if (!_glgsg->_supports_cube_map) {
|
||||
|
|
@ -1648,7 +1644,6 @@ get_sampler_texture_type(int &out, GLenum param_type) {
|
|||
}
|
||||
return true;
|
||||
|
||||
#ifndef OPENGLES
|
||||
case GL_SAMPLER_2D_ARRAY_SHADOW:
|
||||
if (!_glgsg->_supports_shadow_filter) {
|
||||
GLCAT.error()
|
||||
|
|
@ -1668,6 +1663,7 @@ get_sampler_texture_type(int &out, GLenum param_type) {
|
|||
return false;
|
||||
}
|
||||
|
||||
#ifndef OPENGLES
|
||||
case GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW:
|
||||
if (!_glgsg->_supports_shadow_filter) {
|
||||
GLCAT.error()
|
||||
|
|
@ -1699,7 +1695,7 @@ get_sampler_texture_type(int &out, GLenum param_type) {
|
|||
<< "GLSL shader uses buffer texture, which is unsupported by the driver.\n";
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
#endif // !OPENGLES
|
||||
|
||||
default:
|
||||
GLCAT.error()
|
||||
|
|
@ -2129,7 +2125,6 @@ update_shader_vertex_arrays(ShaderContext *prev, bool force) {
|
|||
|
||||
const GeomVertexArrayDataHandle *array_reader;
|
||||
|
||||
#ifndef OPENGLES
|
||||
if (_glgsg->_use_vertex_attrib_binding) {
|
||||
// Use experimental new separated formatbinding state.
|
||||
const GeomVertexDataPipelineReader *data_reader = _glgsg->_data_reader;
|
||||
|
|
@ -2185,9 +2180,7 @@ update_shader_vertex_arrays(ShaderContext *prev, bool force) {
|
|||
}
|
||||
_glgsg->_enabled_vertex_attrib_arrays = enabled_attribs;
|
||||
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
} else {
|
||||
Geom::NumericType numeric_type;
|
||||
int start, stride, num_values;
|
||||
size_t nvarying = _shader->_var_spec.size();
|
||||
|
|
@ -2230,13 +2223,10 @@ update_shader_vertex_arrays(ShaderContext *prev, bool force) {
|
|||
for (int i = 0; i < num_elements; ++i) {
|
||||
_glgsg->enable_vertex_attrib_array(p);
|
||||
|
||||
#ifndef OPENGLES
|
||||
if (bind._integer) {
|
||||
_glgsg->_glVertexAttribIPointer(p, num_values, _glgsg->get_numeric_type(numeric_type),
|
||||
stride, client_pointer);
|
||||
} else
|
||||
#endif
|
||||
if (numeric_type == GeomEnums::NT_packed_dabc) {
|
||||
} else if (numeric_type == GeomEnums::NT_packed_dabc) {
|
||||
// GL_BGRA is a special accepted value available since OpenGL 3.2.
|
||||
// It requires us to pass GL_TRUE for normalized.
|
||||
_glgsg->_glVertexAttribPointer(p, GL_BGRA, GL_UNSIGNED_BYTE,
|
||||
|
|
@ -2340,9 +2330,7 @@ disable_shader_texture_bindings() {
|
|||
break;
|
||||
|
||||
case Texture::TT_2d_texture_array:
|
||||
#ifndef OPENGLES
|
||||
glBindTexture(GL_TEXTURE_2D_ARRAY_EXT, 0);
|
||||
#endif
|
||||
glBindTexture(GL_TEXTURE_2D_ARRAY, 0);
|
||||
break;
|
||||
|
||||
case Texture::TT_cube_map:
|
||||
|
|
@ -2357,15 +2345,16 @@ disable_shader_texture_bindings() {
|
|||
}
|
||||
}
|
||||
|
||||
#ifndef OPENGLES
|
||||
// Now unbind all the image units. Not sure if we *have* to do this.
|
||||
int num_image_units = min(_glsl_img_inputs.size(), (size_t)_glgsg->_max_image_units);
|
||||
|
||||
if (num_image_units > 0) {
|
||||
#ifndef OPENGLES
|
||||
if (_glgsg->_supports_multi_bind) {
|
||||
_glgsg->_glBindImageTextures(0, num_image_units, NULL);
|
||||
|
||||
} else {
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
for (int i = 0; i < num_image_units; ++i) {
|
||||
_glgsg->_glBindImageTexture(i, 0, 0, GL_FALSE, 0, GL_READ_ONLY, GL_R8);
|
||||
}
|
||||
|
|
@ -2382,7 +2371,6 @@ disable_shader_texture_bindings() {
|
|||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
_glgsg->report_my_gl_errors();
|
||||
}
|
||||
|
|
@ -2402,7 +2390,6 @@ update_shader_texture_bindings(ShaderContext *prev) {
|
|||
return;
|
||||
}
|
||||
|
||||
#ifndef OPENGLES
|
||||
GLbitfield barriers = 0;
|
||||
|
||||
// First bind all the 'image units'; a bit of an esoteric OpenGL feature
|
||||
|
|
@ -2500,7 +2487,6 @@ update_shader_texture_bindings(ShaderContext *prev) {
|
|||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
size_t num_textures = _shader->_tex_spec.size();
|
||||
GLuint *textures;
|
||||
|
|
@ -2781,12 +2767,12 @@ glsl_compile_shader(Shader::ShaderType type) {
|
|||
handle = _glgsg->_glCreateShader(GL_TESS_EVALUATION_SHADER);
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
case Shader::ST_compute:
|
||||
if (_glgsg->get_supports_compute_shaders()) {
|
||||
handle = _glgsg->_glCreateShader(GL_COMPUTE_SHADER);
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
@ -2844,7 +2830,6 @@ glsl_compile_and_link() {
|
|||
_glgsg->_glObjectLabel(GL_PROGRAM, _glsl_program, name.size(), name.data());
|
||||
}
|
||||
|
||||
#ifndef OPENGLES
|
||||
// Do we have a compiled program? Try to load that.
|
||||
unsigned int format;
|
||||
string binary;
|
||||
|
|
@ -2868,7 +2853,6 @@ glsl_compile_and_link() {
|
|||
<< _shader->get_filename() << "\n";
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
bool valid = true;
|
||||
|
||||
|
|
@ -2933,7 +2917,6 @@ glsl_compile_and_link() {
|
|||
|
||||
// If we requested to retrieve the shader, we should indicate that before
|
||||
// linking.
|
||||
#ifndef OPENGLES
|
||||
bool retrieve_binary = false;
|
||||
if (_glgsg->_supports_get_program_binary) {
|
||||
retrieve_binary = _shader->get_cache_compiled_shader();
|
||||
|
|
@ -2946,7 +2929,6 @@ glsl_compile_and_link() {
|
|||
|
||||
_glgsg->_glProgramParameteri(_glsl_program, GL_PROGRAM_BINARY_RETRIEVABLE_HINT, GL_TRUE);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (GLCAT.is_debug()) {
|
||||
GLCAT.debug()
|
||||
|
|
@ -2967,7 +2949,6 @@ glsl_compile_and_link() {
|
|||
// Report any warnings.
|
||||
glsl_report_program_errors(_glsl_program, false);
|
||||
|
||||
#ifndef OPENGLES
|
||||
if (retrieve_binary) {
|
||||
GLint length = 0;
|
||||
_glgsg->_glGetProgramiv(_glsl_program, GL_PROGRAM_BINARY_LENGTH, &length);
|
||||
|
|
@ -2998,7 +2979,6 @@ glsl_compile_and_link() {
|
|||
}
|
||||
#endif // NDEBUG
|
||||
}
|
||||
#endif // OPENGLES
|
||||
|
||||
_glgsg->report_my_gl_errors();
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -35,10 +35,8 @@ public:
|
|||
ALLOC_DELETED_CHAIN(CLP(ShaderContext));
|
||||
|
||||
void reflect_attribute(int i, char *name_buf, GLsizei name_buflen);
|
||||
#ifndef OPENGLES
|
||||
void reflect_uniform_block(int i, const char *block_name,
|
||||
char *name_buffer, GLsizei name_buflen);
|
||||
#endif
|
||||
void reflect_uniform(int i, char *name_buffer, GLsizei name_buflen);
|
||||
bool get_sampler_texture_type(int &out, GLenum param_type);
|
||||
|
||||
|
|
|
|||
|
|
@ -82,7 +82,7 @@ reset_data() {
|
|||
_has_storage = false;
|
||||
_immutable = false;
|
||||
|
||||
#ifndef OPENGLES
|
||||
#ifndef OPENGLES_1
|
||||
// Mark the texture as coherent.
|
||||
if (gl_enable_memory_barriers) {
|
||||
_glgsg->_textures_needing_fetch_barrier.erase(this);
|
||||
|
|
@ -131,7 +131,7 @@ get_handle() {
|
|||
#endif
|
||||
}
|
||||
|
||||
#ifndef OPENGLES
|
||||
#ifndef OPENGLES_1
|
||||
/**
|
||||
*
|
||||
*/
|
||||
|
|
@ -176,4 +176,4 @@ mark_incoherent(bool wrote) {
|
|||
_glgsg->_textures_needing_framebuffer_barrier.insert(this);
|
||||
}
|
||||
|
||||
#endif // OPENGLES
|
||||
#endif // !OPENGLES_1
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ public:
|
|||
void make_handle_resident();
|
||||
GLuint64 get_handle();
|
||||
|
||||
#ifdef OPENGLES
|
||||
#ifdef OPENGLES_1
|
||||
static CONSTEXPR bool needs_barrier(GLbitfield barrier) { return false; };
|
||||
#else
|
||||
bool needs_barrier(GLbitfield barrier);
|
||||
|
|
|
|||
Loading…
Reference in New Issue