Lines Matching refs:ctx

74 _mesa_initialize_context( struct gl_context *ctx,
85 _mesa_initialize_exec_table(struct gl_context *ctx);
88 _mesa_initialize_dispatch_tables(struct gl_context *ctx);
94 _mesa_free_context_data(struct gl_context *ctx, bool destroy_debug_output);
100 _mesa_make_current( struct gl_context *ctx, struct gl_framebuffer *drawBuffer,
104 _mesa_share_state(struct gl_context *ctx, struct gl_context *ctxToShare);
115 _mesa_get_dispatch(struct gl_context *ctx);
118 _mesa_set_context_lost_dispatch(struct gl_context *ctx);
126 _mesa_flush(struct gl_context *ctx);
136 _mesa_inside_begin_end(const struct gl_context *ctx)
138 return ctx->Driver.CurrentExecPrimitive != PRIM_OUTSIDE_BEGIN_END;
146 _mesa_inside_dlist_begin_end(const struct gl_context *ctx)
148 return ctx->Driver.CurrentSavePrimitive <= PRIM_MAX;
162 * \param ctx GL context.
169 #define FLUSH_VERTICES(ctx, newstate, pop_attrib_mask) \
172 _mesa_debug(ctx, "FLUSH_VERTICES in %s\n", __func__); \
173 if (ctx->Driver.NeedFlush & FLUSH_STORED_VERTICES) \
174 vbo_exec_FlushVertices(ctx, FLUSH_STORED_VERTICES); \
175 ctx->NewState |= newstate; \
176 ctx->PopAttribState |= pop_attrib_mask; \
182 * \param ctx GL context.
189 #define FLUSH_CURRENT(ctx, newstate) \
192 _mesa_debug(ctx, "FLUSH_CURRENT in %s\n", __func__); \
193 if (ctx->Driver.NeedFlush & FLUSH_UPDATE_CURRENT) \
194 vbo_exec_FlushVertices(ctx, FLUSH_UPDATE_CURRENT); \
195 ctx->NewState |= newstate; \
201 * \param ctx GL context.
206 #define FLUSH_FOR_DRAW(ctx) \
209 _mesa_debug(ctx, "FLUSH_FOR_DRAW in %s\n", __func__); \
210 if (ctx->Driver.NeedFlush) { \
211 if (ctx->_AllowDrawOutOfOrder) { \
212 if (ctx->Driver.NeedFlush & FLUSH_UPDATE_CURRENT) \
213 vbo_exec_FlushVertices(ctx, FLUSH_UPDATE_CURRENT); \
215 vbo_exec_FlushVertices(ctx, ctx->Driver.NeedFlush); \
224 * \param ctx GL context.
227 #define ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, retval) \
229 if (_mesa_inside_begin_end(ctx)) { \
230 _mesa_error(ctx, GL_INVALID_OPERATION, "Inside glBegin/glEnd"); \
239 * \param ctx GL context.
241 #define ASSERT_OUTSIDE_BEGIN_END(ctx) \
243 if (_mesa_inside_begin_end(ctx)) { \
244 _mesa_error(ctx, GL_INVALID_OPERATION, "Inside glBegin/glEnd"); \
256 _mesa_is_desktop_gl(const struct gl_context *ctx)
258 return ctx->API == API_OPENGL_COMPAT || ctx->API == API_OPENGL_CORE;
266 _mesa_is_gles(const struct gl_context *ctx)
268 return ctx->API == API_OPENGLES || ctx->API == API_OPENGLES2;
276 _mesa_is_gles3(const struct gl_context *ctx)
278 return ctx->API == API_OPENGLES2 && ctx->Version >= 30;
286 _mesa_is_gles31(const struct gl_context *ctx)
288 return ctx->API == API_OPENGLES2 && ctx->Version >= 31;
296 _mesa_is_gles32(const struct gl_context *ctx)
298 return ctx->API == API_OPENGLES2 && ctx->Version >= 32;
303 _mesa_is_no_error_enabled(const struct gl_context *ctx)
305 return ctx->Const.ContextFlags & GL_CONTEXT_FLAG_NO_ERROR_BIT_KHR;
310 _mesa_has_integer_textures(const struct gl_context *ctx)
312 return _mesa_has_EXT_texture_integer(ctx) || _mesa_is_gles3(ctx);
316 _mesa_has_half_float_textures(const struct gl_context *ctx)
318 return _mesa_has_ARB_texture_float(ctx) ||
319 _mesa_has_OES_texture_half_float(ctx);
323 _mesa_has_float_textures(const struct gl_context *ctx)
325 return _mesa_has_ARB_texture_float(ctx) ||
326 _mesa_has_OES_texture_float(ctx) || _mesa_is_gles3(ctx);
330 _mesa_has_texture_rgb10_a2ui(const struct gl_context *ctx)
332 return _mesa_has_ARB_texture_rgb10_a2ui(ctx) || _mesa_is_gles3(ctx);
336 _mesa_has_float_depth_buffer(const struct gl_context *ctx)
338 return _mesa_has_ARB_depth_buffer_float(ctx) || _mesa_is_gles3(ctx);
342 _mesa_has_packed_float(const struct gl_context *ctx)
344 return _mesa_has_EXT_packed_float(ctx) || _mesa_is_gles3(ctx);
348 _mesa_has_rg_textures(const struct gl_context *ctx)
350 return _mesa_has_ARB_texture_rg(ctx) || _mesa_has_EXT_texture_rg(ctx) ||
351 _mesa_is_gles3(ctx);
355 _mesa_has_texture_shared_exponent(const struct gl_context *ctx)
357 return _mesa_has_EXT_texture_shared_exponent(ctx) || _mesa_is_gles3(ctx);
361 _mesa_has_texture_type_2_10_10_10_REV(const struct gl_context *ctx)
363 return _mesa_is_desktop_gl(ctx) ||
364 _mesa_has_EXT_texture_type_2_10_10_10_REV(ctx);
371 _mesa_has_geometry_shaders(const struct gl_context *ctx)
373 return _mesa_has_OES_geometry_shader(ctx) ||
374 (_mesa_is_desktop_gl(ctx) && ctx->Version >= 32);
382 _mesa_has_compute_shaders(const struct gl_context *ctx)
384 return _mesa_has_ARB_compute_shader(ctx) ||
385 (ctx->API == API_OPENGLES2 && ctx->Version >= 31);
392 _mesa_has_tessellation(const struct gl_context *ctx)
394 /* _mesa_has_EXT_tessellation_shader(ctx) is redundant with the OES
397 return _mesa_has_OES_tessellation_shader(ctx) ||
398 _mesa_has_ARB_tessellation_shader(ctx);
402 _mesa_has_texture_cube_map_array(const struct gl_context *ctx)
404 return _mesa_has_ARB_texture_cube_map_array(ctx) ||
405 _mesa_has_OES_texture_cube_map_array(ctx);
409 _mesa_has_texture_view(const struct gl_context *ctx)
411 return _mesa_has_ARB_texture_view(ctx) ||
412 _mesa_has_OES_texture_view(ctx);
416 _mesa_hw_select_enabled(const struct gl_context *ctx)
418 return ctx->RenderMode == GL_SELECT &&
419 ctx->Const.HardwareAcceleratedSelect;