Home | History | Annotate | Download | only in main

Lines Matching full:ctx

56 validate_texture_wrap_mode(struct gl_context * ctx, GLenum target, GLenum wrap)
58 const struct gl_extensions * const e = & ctx->Extensions;
59 const bool is_desktop_gl = _mesa_is_desktop_gl(ctx);
67 supported = (ctx->API == API_OPENGL)
106 _mesa_error( ctx, GL_INVALID_ENUM, "glTexParameter(param=0x%x)", wrap );
120 get_texobj(struct gl_context *ctx, GLenum target, GLboolean get)
124 if (ctx->Texture.CurrentUnit >= ctx->Const.MaxCombinedTextureImageUnits) {
125 _mesa_error(ctx, GL_INVALID_OPERATION,
130 texUnit = _mesa_get_current_tex_unit(ctx);
134 if (_mesa_is_desktop_gl(ctx))
140 if (ctx->API != API_OPENGLES)
144 if (ctx->Extensions.ARB_texture_cube_map) {
149 if (_mesa_is_desktop_gl(ctx)
150 && ctx->Extensions.NV_texture_rectangle) {
155 if (_mesa_is_desktop_gl(ctx)
156 && (ctx->Extensions.MESA_texture_array ||
157 ctx->Extensions.EXT_texture_array)) {
162 if ((_mesa_is_desktop_gl(ctx) || _mesa_is_gles3(ctx))
163 && (ctx->Extensions.MESA_texture_array ||
164 ctx->Extensions.EXT_texture_array)) {
169 if (_mesa_is_gles(ctx) && ctx->Extensions.OES_EGL_image_external) {
177 _mesa_error(ctx, GL_INVALID_ENUM,
227 flush(struct gl_context *ctx)
229 FLUSH_VERTICES(ctx, _NEW_TEXTURE);
241 incomplete(struct gl_context *ctx, struct gl_texture_object *texObj)
243 FLUSH_VERTICES(ctx, _NEW_TEXTURE);
244 _mesa_dirty_texobj(ctx, texObj, GL_TRUE);
253 set_tex_parameteri(struct gl_context *ctx,
264 flush(ctx);
273 flush(ctx);
289 flush(ctx); /* does not effect completeness */
300 if (validate_texture_wrap_mode(ctx, texObj->Target, params[0])) {
301 flush(ctx);
310 if (validate_texture_wrap_mode(ctx, texObj->Target, params[0])) {
311 flush(ctx);
320 if (validate_texture_wrap_mode(ctx, texObj->Target, params[0])) {
321 flush(ctx);
328 if (!_mesa_is_desktop_gl(ctx) && !_mesa_is_gles3(ctx))
335 _mesa_error(ctx, GL_INVALID_VALUE,
339 incomplete(ctx, texObj);
347 _mesa_error(ctx, GL_INVALID_OPERATION,
351 incomplete(ctx, texObj);
356 if (ctx->API != API_OPENGL && ctx->API != API_OPENGLES)
369 if ((_mesa_is_desktop_gl(ctx) && ctx->Extensions.ARB_shadow)
370 || _mesa_is_gles3(ctx)) {
375 flush(ctx);
384 if ((_mesa_is_desktop_gl(ctx) && ctx->Extensions.ARB_shadow)
385 || _mesa_is_gles3(ctx)) {
391 flush(ctx);
400 if (ctx->Extensions.EXT_shadow_funcs) {
401 flush(ctx);
416 if (ctx->API == API_OPENGL && ctx->Extensions.ARB_depth_texture) {
422 (ctx->Extensions.ARB_texture_rg && params[0] == GL_RED)) {
423 flush(ctx);
433 if (ctx->API != API_OPENGLES || !ctx->Extensions.OES_draw_texture)
447 if ((_mesa_is_desktop_gl(ctx) && ctx->Extensions.EXT_texture_swizzle)
448 || _mesa_is_gles3(ctx)) {
452 _mesa_error(ctx, GL_INVALID_OPERATION,
458 flush(ctx);
466 if ((_mesa_is_desktop_gl(ctx) && ctx->Extensions.EXT_texture_swizzle)
467 || _mesa_is_gles3(ctx)) {
469 flush(ctx);
477 _mesa_error(ctx, GL_INVALID_OPERATION,
487 if (_mesa_is_desktop_gl(ctx)
488 && ctx->Extensions.EXT_texture_sRGB_decode) {
492 flush(ctx);
501 if (_mesa_is_desktop_gl(ctx)
502 && ctx->Extensions.AMD_seamless_cubemap_per_texture) {
508 flush(ctx);
520 _mesa_error(ctx, GL_INVALID_ENUM, "glTexParameter(pname=%s)",
525 _mesa_error(ctx, GL_INVALID_ENUM, "glTexParameter(param=%s)",
536 set_tex_parameterf(struct gl_context *ctx,
542 if (!_mesa_is_desktop_gl(ctx) && !_mesa_is_gles3(ctx))
547 ctx);
552 if (!_mesa_is_desktop_gl(ctx) && !_mesa_is_gles3(ctx))
557 flush(ctx);
562 if (ctx->API != API_OPENGL)
565 flush(ctx);
570 if (ctx->Extensions.EXT_texture_filter_anisotropic) {
574 _mesa_error(ctx, GL_INVALID_VALUE, "glTexParameter(param)" );
577 flush(ctx);
580 ctx->Const.MaxTextureMaxAnisotropy);
595 if (ctx->API != API_OPENGL)
599 flush(ctx);
606 if (!_mesa_is_desktop_gl(ctx))
609 flush(ctx);
611 if (ctx->Extensions.ARB_texture_float) {
630 _mesa_error(ctx, GL_INVALID_ENUM, "glTexParameter(pname=%s)",
641 GET_CURRENT_CONTEXT(ctx);
642 ASSERT_OUTSIDE_BEGIN_END(ctx);
644 texObj = get_texobj(ctx, target, GL_FALSE);
667 need_update = set_tex_parameteri(ctx, texObj, pname, p);
678 need_update = set_tex_parameteri(ctx, texObj, pname, p);
687 need_update = set_tex_parameterf(ctx, texObj, pname, p);
691 if (ctx->Driver.TexParameter && need_update) {
692 ctx->Driver.TexParameter(ctx, target, texObj, pname, &param);
702 GET_CURRENT_CONTEXT(ctx);
703 ASSERT_OUTSIDE_BEGIN_END(ctx);
705 texObj = get_texobj(ctx, target, GL_FALSE);
728 need_update = set_tex_parameteri(ctx, texObj, pname, p);
741 need_update = set_tex_parameteri(ctx, texObj, pname, iparams);
759 need_update = set_tex_parameteri(ctx, texObj, pname, p);
764 need_update = set_tex_parameterf(ctx, texObj, pname, params);
767 if (ctx->Driver.TexParameter && need_update) {
768 ctx->Driver.TexParameter(ctx, target, texObj, pname, params);
778 GET_CURRENT_CONTEXT(ctx);
779 ASSERT_OUTSIDE_BEGIN_END(ctx);
781 texObj = get_texobj(ctx, target, GL_FALSE);
797 need_update = set_tex_parameterf(ctx, texObj, pname, fparam);
806 need_update = set_tex_parameteri(ctx, texObj, pname, iparam);
810 if (ctx->Driver.TexParameter && need_update) {
812 ctx->Driver.TexParameter(ctx, target, texObj, pname, &fparam);
822 GET_CURRENT_CONTEXT(ctx);
823 ASSERT_OUTSIDE_BEGIN_END(ctx);
825 texObj = get_texobj(ctx, target, GL_FALSE);
838 need_update = set_tex_parameterf(ctx, texObj, pname, fparams);
852 need_update = set_tex_parameterf(ctx, texObj, pname, fparams);
857 need_update = set_tex_parameteri(ctx, texObj, pname, params);
860 if (ctx->Driver.TexParameter && need_update) {
869 ctx->Driver.TexParameter(ctx, target, texObj, pname, fparams);
883 GET_CURRENT_CONTEXT(ctx);
884 ASSERT_OUTSIDE_BEGIN_END(ctx);
886 texObj = get_texobj(ctx, target, GL_FALSE);
892 FLUSH_VERTICES(ctx, _NEW_TEXTURE);
913 GET_CURRENT_CONTEXT(ctx);
914 ASSERT_OUTSIDE_BEGIN_END(ctx);
916 texObj = get_texobj(ctx, target, GL_FALSE);
922 FLUSH_VERTICES(ctx, _NEW_TEXTURE);
935 legal_get_tex_level_parameter_target(struct gl_context *ctx, GLenum target)
952 return ctx->Extensions.ARB_texture_cube_map;
955 return ctx->Extensions.NV_texture_rectangle;
960 return (ctx->Extensions.MESA_texture_array ||
961 ctx->Extensions.EXT_texture_array);
980 return _mesa_is_desktop_gl(ctx) && ctx->Version >= 31;
988 get_tex_level_parameter_image(struct gl_context *ctx,
996 img = _mesa_select_tex_image(ctx, texObj, target, level);
1021 *params = _mesa_compressed_format_to_glenum(ctx, texFormat);
1071 if (!ctx->Extensions.ARB_depth_texture)
1076 if (!ctx->Extensions.EXT_packed_depth_stencil &&
1077 !ctx->Extensions.ARB_framebuffer_object)
1082 if (ctx->Version < 30 &&
1083 !ctx->Extensions.EXT_texture_shared_exponent)
1096 _mesa_error(ctx, GL_INVALID_OPERATION,
1112 if (!ctx->Extensions.ARB_texture_float)
1128 _mesa_error(ctx, GL_INVALID_ENUM,
1135 get_tex_level_parameter_buffer(struct gl_context *ctx,
1199 _mesa_error(ctx, GL_INVALID_OPERATION,
1211 if (!ctx->Extensions.ARB_texture_float)
1227 _mesa_error(ctx, GL_INVALID_ENUM,
1250 GET_CURRENT_CONTEXT(ctx);
1251 ASSERT_OUTSIDE_BEGIN_END(ctx);
1253 if (ctx->Texture.CurrentUnit >= ctx->Const.MaxCombinedTextureImageUnits) {
1254 _mesa_error(ctx, GL_INVALID_OPERATION,
1259 texUnit = _mesa_get_current_tex_unit(ctx);
1261 if (!legal_get_tex_level_parameter_target(ctx, target)) {
1262 _mesa_error(ctx, GL_INVALID_ENUM,
1267 maxLevels = _mesa_max_texture_levels(ctx, target);
1271 _mesa_error( ctx, GL_INVALID_VALUE, "glGetTexLevelParameter[if]v" );
1275 texObj = _mesa_select_tex_object(ctx, texUnit, target);
1278 get_tex_level_parameter_buffer(ctx, texObj, pname, params);
1280 get_tex_level_parameter_image(ctx, texObj, target, level, pname, params);
1288 GET_CURRENT_CONTEXT(ctx);
1289 ASSERT_OUTSIDE_BEGIN_END(ctx);
1291 obj = get_texobj(ctx, target, GL_TRUE);
1295 _mesa_lock_texture(ctx, obj);
1313 if (!_mesa_is_desktop_gl(ctx))
1316 if (ctx->NewState & (_NEW_BUFFERS | _NEW_FRAG_CLAMP))
1317 _mesa_update_state_locked(ctx);
1318 if (ctx->Color._ClampFragmentColor) {
1332 if (ctx->API != API_OPENGL)
1338 if (ctx->API != API_OPENGL)
1344 if (!_mesa_is_desktop_gl(ctx) && !_mesa_is_gles3(ctx))
1350 if (!_mesa_is_desktop_gl(ctx) && !_mesa_is_gles3(ctx))
1356 if (!_mesa_is_desktop_gl(ctx) && !_mesa_is_gles3(ctx))
1365 if (!ctx->Extensions.EXT_texture_filter_anisotropic)
1370 if (ctx->API != API_OPENGL && ctx->API != API_OPENGLES)
1376 if ((!_mesa_is_desktop_gl(ctx) || !ctx->Extensions.ARB_shadow)
1377 && !_mesa_is_gles3(ctx))
1382 if ((!_mesa_is_desktop_gl(ctx) || !ctx->Extensions.ARB_shadow)
1383 && !_mesa_is_gles3(ctx))
1391 if (ctx->API != API_OPENGL || !ctx->Extensions.ARB_depth_texture)
1396 if (ctx->API != API_OPENGL)
1403 if (ctx->API != API_OPENGLES || !ctx->Extensions.OES_draw_texture)
1417 if ((!_mesa_is_desktop_gl(ctx)
1418 || !ctx->Extensions.EXT_texture_swizzle)
1419 && !_mesa_is_gles3(ctx))
1425 if ((!_mesa_is_desktop_gl(ctx)
1426 || !ctx->Extensions.EXT_texture_swizzle)
1427 && !_mesa_is_gles3(ctx)) {
1439 if (!_mesa_is_desktop_gl(ctx)
1440 || !ctx->Extensions.AMD_seamless_cubemap_per_texture)
1446 if (!ctx->Extensions.ARB_texture_storage)
1452 if (!ctx->Extensions.EXT_texture_sRGB_decode)
1462 _mesa_unlock_texture(ctx, obj);
1466 _mesa_unlock_texture(ctx, obj);
1467 _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexParameterfv(pname=0x%x)", pname);
1475 GET_CURRENT_CONTEXT(ctx);
1476 ASSERT_OUTSIDE_BEGIN_END(ctx);
1478 obj = get_texobj(ctx, target, GL_TRUE);
1482 _mesa_lock_texture(ctx, obj);
1500 if (!_mesa_is_desktop_gl(ctx))
1516 if (ctx->API != API_OPENGL)
1522 if (ctx->API != API_OPENGL)
1528 if (!_mesa_is_desktop_gl(ctx) && !_mesa_is_gles3(ctx))
1534 if (!_mesa_is_desktop_gl(ctx) && !_mesa_is_gles3(ctx))
1540 if (!_mesa_is_desktop_gl(ctx) && !_mesa_is_gles3(ctx))
1549 if (!ctx->Extensions.EXT_texture_filter_anisotropic)
1554 if (ctx->API != API_OPENGL && ctx->API != API_OPENGLES)
1560 if ((!_mesa_is_desktop_gl(ctx) || !ctx->Extensions.ARB_shadow)
1561 && !_mesa_is_gles3(ctx))
1566 if ((!_mesa_is_desktop_gl(ctx) || !ctx->Extensions.ARB_shadow)
1567 && !_mesa_is_gles3(ctx))
1572 if (ctx->API != API_OPENGL || !ctx->Extensions.ARB_depth_texture)
1577 if (ctx->API != API_OPENGL)
1584 if (ctx->API != API_OPENGLES || !ctx->Extensions.OES_draw_texture)
1597 if ((!_mesa_is_desktop_gl(ctx)
1598 || !ctx->Extensions.EXT_texture_swizzle)
1599 && !_mesa_is_gles3(ctx))
1605 if ((!_mesa_is_desktop_gl(ctx)
1606 || !ctx->Extensions.EXT_texture_swizzle)
1607 && !_mesa_is_gles3(ctx))
1613 if (!_mesa_is_desktop_gl(ctx)
1614 || !ctx->Extensions.AMD_seamless_cubemap_per_texture)
1620 if (!ctx->Extensions.ARB_texture_storage)
1626 if (!_mesa_is_gles(ctx) || !ctx->Extensions.OES_EGL_image_external)
1632 if (!ctx->Extensions.EXT_texture_sRGB_decode)
1642 _mesa_unlock_texture(ctx, obj);
1646 _mesa_unlock_texture(ctx, obj);
1647 _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexParameteriv(pname=0x%x)", pname);
1656 GET_CURRENT_CONTEXT(ctx);
1657 ASSERT_OUTSIDE_BEGIN_END(ctx);
1659 texObj = get_texobj(ctx, target, GL_TRUE);
1678 GET_CURRENT_CONTEXT(ctx);
1679 ASSERT_OUTSIDE_BEGIN_END(ctx);
1681 texObj = get_texobj(ctx, target, GL_TRUE);