summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2014-10-27 15:03:53 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2014-11-14 10:43:00 +0900
commitcd63cb0215cc859685b90a895af6a29b82d8bdb9 (patch)
tree97599304d8bbaf55f56702b01caa8ada4807da83
parentd2aee4e5caf8765923ca5ff41676195a2fed3146 (diff)
Evas GL: Enable some more GLES2 extension APIs
NOTE: The draw_buffers extension might need to be checked more and wrapped, if it can have adverse effects on how Evas works (could it replace the default render target?). This adds support for the following extensions: - disjoint_timer_query - occlusion_query_boolean - alpha_test - draw_buffers - read_buffer - read_buffer_front - framebuffer_blit
-rw-r--r--src/modules/evas/engines/gl_common/evas_gl_api_ext_def.h163
1 files changed, 138 insertions, 25 deletions
diff --git a/src/modules/evas/engines/gl_common/evas_gl_api_ext_def.h b/src/modules/evas/engines/gl_common/evas_gl_api_ext_def.h
index 3e48845027..9f5a458fec 100644
--- a/src/modules/evas/engines/gl_common/evas_gl_api_ext_def.h
+++ b/src/modules/evas/engines/gl_common/evas_gl_api_ext_def.h
@@ -1093,9 +1093,31 @@ _EVASGL_EXT_END()
1093/////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 1093///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
1094// Other "safe" extensions that are not in Evas_GL_API 1094// Other "safe" extensions that are not in Evas_GL_API
1095/////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 1095///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
1096
1097/*
1098 * IMPORTANT NOTE:
1099 *
1100 * Before adding any extension & function to the list below, it is very
1101 * important to check that the extension does not modify the state in a way
1102 * that would break direct rendering (eg. Scissors) or indirect rendering
1103 * (eg. changes the target FBO).
1104 *
1105 * If any of the following applies, the extension must be wrapped before
1106 * being exposed to client apps:
1107 * - The target FBO is changed (this could break indirect rendering)
1108 * - The scissors geometry is changed (breaks direct rendering)
1109 * - Shared contexts can also be affected (breaks everything since all contexts
1110 * are shared with the main Evas GL context)
1111 *
1112 * There can be a number of other reasons for functions to need wrapping, so
1113 * please read carefully the specifications of all extensions and check that
1114 * they are safe to use. The goal is to contain as much as possible the effects
1115 * of an API call to the surface & context bound to the Evas_GL.
1116 */
1117
1096#if _EVASGL_EXT_WHITELIST_ONLY 1118#if _EVASGL_EXT_WHITELIST_ONLY
1097 1119
1098// TODO: Remove this function. Not actually supported. Just for debugging. 1120// ----------------------------------------------------------
1099_EVASGL_EXT_BEGIN(debug) 1121_EVASGL_EXT_BEGIN(debug)
1100_EVASGL_EXT_DRVNAME(GL_KHR_debug) 1122_EVASGL_EXT_DRVNAME(GL_KHR_debug)
1101 1123
@@ -1135,6 +1157,7 @@ _EVASGL_EXT_FUNCTION_WHITELIST("glGetObjectPtrLabelKHR")
1135_EVASGL_EXT_END() 1157_EVASGL_EXT_END()
1136 1158
1137 1159
1160// ----------------------------------------------------------
1138_EVASGL_EXT_BEGIN(debug_label) 1161_EVASGL_EXT_BEGIN(debug_label)
1139_EVASGL_EXT_DRVNAME(GL_EXT_debug_label) 1162_EVASGL_EXT_DRVNAME(GL_EXT_debug_label)
1140 1163
@@ -1147,6 +1170,7 @@ _EVASGL_EXT_FUNCTION_WHITELIST("glGetObjectLabelEXT")
1147_EVASGL_EXT_END() 1170_EVASGL_EXT_END()
1148 1171
1149 1172
1173// ----------------------------------------------------------
1150_EVASGL_EXT_BEGIN(debug_marker) 1174_EVASGL_EXT_BEGIN(debug_marker)
1151_EVASGL_EXT_DRVNAME(GL_EXT_debug_marker) 1175_EVASGL_EXT_DRVNAME(GL_EXT_debug_marker)
1152 1176
@@ -1161,43 +1185,132 @@ _EVASGL_EXT_FUNCTION_WHITELIST("glPopGroupMarkerEXT")
1161 1185
1162_EVASGL_EXT_END() 1186_EVASGL_EXT_END()
1163 1187
1164#endif // _EVASGL_EXT_WHITELIST_ONLY ("safe" extensions)
1165 1188
1166#if 0 1189// ----------------------------------------------------------
1167// requested extensions 1190_EVASGL_EXT_BEGIN(disjoint_timer_query)
1168/* GL_EXT_debug_marker */ 1191_EVASGL_EXT_DRVNAME(GL_EXT_disjoint_timer_query)
1169void (*glPushGroupMarkerEXT)(int len, const char* name);
1170void (*glPopGroupMarkerEXT)();
1171 1192
1193_EVASGL_EXT_FUNCTION_WHITELIST("glGenQueries")
1194_EVASGL_EXT_FUNCTION_WHITELIST("glGenQueriesEXT")
1172 1195
1173/* GL_QCOM_alpha_test */ 1196_EVASGL_EXT_FUNCTION_WHITELIST("glDeleteQueries")
1174void (*glAlphaFuncQCOM)(GLenum func, GLfloat ref); 1197_EVASGL_EXT_FUNCTION_WHITELIST("glDeleteQueriesEXT")
1175 1198
1199_EVASGL_EXT_FUNCTION_WHITELIST("glIsQuery")
1200_EVASGL_EXT_FUNCTION_WHITELIST("glIsQueryEXT")
1176 1201
1177/* GL_EXT_disjoint_timer_query */ 1202_EVASGL_EXT_FUNCTION_WHITELIST("glBeginQuery")
1178void (*glQueryCounterEXT)(GLuint target, GLuint id); 1203_EVASGL_EXT_FUNCTION_WHITELIST("glBeginQueryEXT")
1179void (*glGetQueryObjectui64vEXT)(GLuint id, GLuint pname, EvasGLuint64* params);
1180 1204
1205_EVASGL_EXT_FUNCTION_WHITELIST("glEndQuery")
1206_EVASGL_EXT_FUNCTION_WHITELIST("glEndQueryEXT")
1181 1207
1182/* GL_EXT_occlusion_query_boolean */ 1208_EVASGL_EXT_FUNCTION_WHITELIST("glQueryCounter")
1183void (*glGenQueriesEXT)(GLsizei n, GLuint* ids); 1209_EVASGL_EXT_FUNCTION_WHITELIST("glQueryCounterEXT")
1184void (*glDeleteQueriesEXT)(GLsizei n, const GLuint* ids);
1185void (*glBeginQueryEXT) (GLenum target, GLuint id);
1186void (*glEndQueryEXT) (GLenum target);
1187void (*glGetQueryObjectuivEXT)(GLuint id, GLenum pname, GLuint* params);
1188 1210
1211_EVASGL_EXT_FUNCTION_WHITELIST("glGetQueryiv")
1212_EVASGL_EXT_FUNCTION_WHITELIST("glGetQueryivEXT")
1189 1213
1190/* GL_NV_draw_buffers */ 1214_EVASGL_EXT_FUNCTION_WHITELIST("glGetQueryObjectiv")
1191void (*glDrawBuffersNV)(GLsizei n, const GLenum* bufs); 1215_EVASGL_EXT_FUNCTION_WHITELIST("glGetQueryObjectivEXT")
1192 1216
1217_EVASGL_EXT_FUNCTION_WHITELIST("glGetQueryObjectuiv")
1218_EVASGL_EXT_FUNCTION_WHITELIST("glGetQueryObjectuivEXT")
1193 1219
1194/* GL_NV_read_buffer */ 1220_EVASGL_EXT_FUNCTION_WHITELIST("glGetQueryObjecti64v")
1195void (*glReadBufferNV) (GLenum mode); 1221_EVASGL_EXT_FUNCTION_WHITELIST("glGetQueryObjecti64vEXT")
1196 1222
1223_EVASGL_EXT_FUNCTION_WHITELIST("glGetQueryObjectui64v")
1224_EVASGL_EXT_FUNCTION_WHITELIST("glGetQueryObjectui64vEXT")
1197 1225
1198/* GL_NV_framebuffer_blit */ 1226_EVASGL_EXT_END()
1199void (*glBlitFramebufferNV) (int srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); 1227
1200#endif 1228
1229// ----------------------------------------------------------
1230_EVASGL_EXT_BEGIN(occlusion_query_boolean)
1231_EVASGL_EXT_DRVNAME(GL_EXT_occlusion_query_boolean)
1232
1233_EVASGL_EXT_FUNCTION_WHITELIST("glGenQueries")
1234_EVASGL_EXT_FUNCTION_WHITELIST("glGenQueriesEXT")
1235
1236_EVASGL_EXT_FUNCTION_WHITELIST("glDeleteQueries")
1237_EVASGL_EXT_FUNCTION_WHITELIST("glDeleteQueriesEXT")
1238
1239_EVASGL_EXT_FUNCTION_WHITELIST("glIsQuery")
1240_EVASGL_EXT_FUNCTION_WHITELIST("glIsQueryEXT")
1241
1242_EVASGL_EXT_FUNCTION_WHITELIST("glBeginQuery")
1243_EVASGL_EXT_FUNCTION_WHITELIST("glBeginQueryEXT")
1244
1245_EVASGL_EXT_FUNCTION_WHITELIST("glEndQuery")
1246_EVASGL_EXT_FUNCTION_WHITELIST("glEndQueryEXT")
1247
1248_EVASGL_EXT_FUNCTION_WHITELIST("glGetQueryiv")
1249_EVASGL_EXT_FUNCTION_WHITELIST("glGetQueryivEXT")
1250
1251_EVASGL_EXT_FUNCTION_WHITELIST("glGetQueryObjectuiv")
1252_EVASGL_EXT_FUNCTION_WHITELIST("glGetQueryObjectuivEXT")
1253
1254_EVASGL_EXT_END()
1255
1256
1257// ----------------------------------------------------------
1258// NOTE: This extension changes state
1259_EVASGL_EXT_BEGIN(alpha_test)
1260_EVASGL_EXT_DRVNAME(GL_QCOM_alpha_test)
1261
1262_EVASGL_EXT_FUNCTION_WHITELIST("glAlphaFunc")
1263_EVASGL_EXT_FUNCTION_WHITELIST("glAlphaFuncQCOM")
1264
1265_EVASGL_EXT_END()
1266
1267
1268// ----------------------------------------------------------
1269// NOTE: This extension changes state
1270/* Also, to be perfectly correct, we would need to wrap the extension:
1271 * << DrawBuffersNV may only be called when the GL is bound to a framebuffer
1272 * object. If called when the GL is bound to the default framebuffer, an
1273 * INVALID_OPERATION error is generated. >>
1274 * This means the function should generate INVALID_OPERATION when indirect
1275 * rendering is active and the default FBO is currently bound.
1276 */
1277_EVASGL_EXT_BEGIN(draw_buffers)
1278_EVASGL_EXT_DRVNAME(GL_NV_draw_buffers)
1279
1280_EVASGL_EXT_FUNCTION_WHITELIST("glDrawBuffers")
1281_EVASGL_EXT_FUNCTION_WHITELIST("glDrawBuffersNV")
1282
1283_EVASGL_EXT_END()
1284
1285
1286// ----------------------------------------------------------
1287// NOTE: This extension changes state
1288_EVASGL_EXT_BEGIN(read_buffer)
1289_EVASGL_EXT_DRVNAME(GL_NV_read_buffer)
1290
1291_EVASGL_EXT_FUNCTION_WHITELIST("glReadBuffer")
1292_EVASGL_EXT_FUNCTION_WHITELIST("glReadBufferNV")
1293
1294_EVASGL_EXT_END()
1295
1296
1297// Another version of the extension (that allows reading from the FRONT color buf)
1298_EVASGL_EXT_BEGIN(read_buffer_front)
1299_EVASGL_EXT_DRVNAME(GL_NV_read_buffer_front)
1300_EVASGL_EXT_END()
1301
1302
1303// ----------------------------------------------------------
1304_EVASGL_EXT_BEGIN(framebuffer_blit)
1305_EVASGL_EXT_DRVNAME(GL_NV_framebuffer_blit)
1306
1307_EVASGL_EXT_FUNCTION_WHITELIST("glBlitFramebuffer")
1308_EVASGL_EXT_FUNCTION_WHITELIST("glBlitFramebufferNV")
1309
1310_EVASGL_EXT_END()
1311
1312
1313#endif // _EVASGL_EXT_WHITELIST_ONLY ("safe" extensions)
1201 1314
1202/////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 1315///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
1203 1316