Home | History | Annotate | Download | only in main

Lines Matching refs:ctx

44 _mesa_lookup_samplerobj(struct gl_context *ctx, GLuint name)
50 _mesa_HashLookup(ctx->Shared->SamplerObjects, name);
58 _mesa_reference_sampler_object_(struct gl_context *ctx,
80 ASSERT(ctx->Driver.DeleteSamplerObject);
81 ctx->Driver.DeleteSamplerObject(ctx, oldSamp);
138 * Fallback for ctx->Driver.NewSamplerObject();
141 _mesa_new_sampler_object(struct gl_context *ctx, GLuint name)
152 * Fallback for ctx->Driver.DeleteSamplerObject();
155 _mesa_delete_sampler_object(struct gl_context *ctx,
165 GET_CURRENT_CONTEXT(ctx);
169 ASSERT_OUTSIDE_BEGIN_END(ctx);
172 _mesa_debug(ctx, "glGenSamplers(%d)\n", count);
175 _mesa_error(ctx, GL_INVALID_VALUE, "glGenSamplers");
182 first = _mesa_HashFindFreeKeyBlock(ctx->Shared->SamplerObjects, count);
187 ctx->Driver.NewSamplerObject(ctx, first + i);
188 _mesa_HashInsert(ctx->Shared->SamplerObjects, first + i, sampObj);
197 GET_CURRENT_CONTEXT(ctx);
200 ASSERT_OUTSIDE_BEGIN_END(ctx);
201 FLUSH_VERTICES(ctx, 0);
204 _mesa_error(ctx, GL_INVALID_VALUE, "glDeleteSamplers(count)");
208 _glthread_LOCK_MUTEX(ctx->Shared->Mutex);
213 _mesa_lookup_samplerobj(ctx, samplers[i]);
216 _mesa_HashRemove(ctx->Shared->SamplerObjects, samplers[i]);
218 _mesa_reference_sampler_object(ctx, &sampObj, NULL);
223 _glthread_UNLOCK_MUTEX(ctx->Shared->Mutex);
231 GET_CURRENT_CONTEXT(ctx);
233 ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, GL_FALSE);
238 sampObj = _mesa_lookup_samplerobj(ctx, sampler);
248 GET_CURRENT_CONTEXT(ctx);
250 if (unit >= ctx->Const.MaxCombinedTextureImageUnits) {
251 _mesa_error(ctx, GL_INVALID_VALUE, "glBindSampler(unit %u)", unit);
263 sampObj = _mesa_lookup_samplerobj(ctx, sampler);
265 _mesa_error(ctx, GL_INVALID_OPERATION, "glBindSampler(sampler)");
270 if (ctx->Texture.Unit[unit].Sampler != sampObj) {
271 FLUSH_VERTICES(ctx, _NEW_TEXTURE);
275 _mesa_reference_sampler_object(ctx, &ctx->Texture.Unit[unit].Sampler,
285 validate_texture_wrap_mode(struct gl_context *ctx, GLenum wrap)
287 const struct gl_extensions * const e = &ctx->Extensions;
313 flush(struct gl_context *ctx)
315 FLUSH_VERTICES(ctx, _NEW_TEXTURE);
324 set_sampler_wrap_s(struct gl_context *ctx, struct gl_sampler_object *samp,
329 if (validate_texture_wrap_mode(ctx, param)) {
330 flush(ctx);
339 set_sampler_wrap_t(struct gl_context *ctx, struct gl_sampler_object *samp,
344 if (validate_texture_wrap_mode(ctx, param)) {
345 flush(ctx);
354 set_sampler_wrap_r(struct gl_context *ctx, struct gl_sampler_object *samp,
359 if (validate_texture_wrap_mode(ctx, param)) {
360 flush(ctx);
369 set_sampler_min_filter(struct gl_context *ctx, struct gl_sampler_object *samp,
382 flush(ctx);
392 set_sampler_mag_filter(struct gl_context *ctx, struct gl_sampler_object *samp,
401 flush(ctx);
411 set_sampler_lod_bias(struct gl_context *ctx, struct gl_sampler_object *samp,
417 flush(ctx);
424 set_sampler_border_colorf(struct gl_context *ctx,
428 flush(ctx);
438 set_sampler_border_colori(struct gl_context *ctx,
442 flush(ctx);
452 set_sampler_border_colorui(struct gl_context *ctx,
456 flush(ctx);
466 set_sampler_min_lod(struct gl_context *ctx, struct gl_sampler_object *samp,
472 flush(ctx);
479 set_sampler_max_lod(struct gl_context *ctx, struct gl_sampler_object *samp,
485 flush(ctx);
492 set_sampler_compare_mode(struct gl_context *ctx,
495 if (!ctx->Extensions.ARB_shadow)
503 flush(ctx);
513 set_sampler_compare_func(struct gl_context *ctx,
516 if (!ctx->Extensions.ARB_shadow)
525 flush(ctx);
534 if (ctx->Extensions.EXT_shadow_funcs) {
535 flush(ctx);
547 set_sampler_max_anisotropy(struct gl_context *ctx,
550 if (!ctx->Extensions.EXT_texture_filter_anisotropic)
559 flush(ctx);
561 samp->MaxAnisotropy = MIN2(param, ctx->Const.MaxTextureMaxAnisotropy);
567 set_sampler_cube_map_seamless(struct gl_context *ctx,
570 if (!ctx->Extensions.AMD_seamless_cubemap_per_texture)
579 flush(ctx);
585 set_sampler_srgb_decode(struct gl_context *ctx,
588 if (!ctx->Extensions.EXT_texture_sRGB_decode)
597 flush(ctx);
607 GET_CURRENT_CONTEXT(ctx);
609 sampObj = _mesa_lookup_samplerobj(ctx, sampler);
611 _mesa_error(ctx, GL_INVALID_VALUE, "glSamplerParameteri(sampler %u)",
618 res = set_sampler_wrap_s(ctx, sampObj, param);
621 res = set_sampler_wrap_t(ctx, sampObj, param);
624 res = set_sampler_wrap_r(ctx, sampObj, param);
627 res = set_sampler_min_filter(ctx, sampObj, param);
630 res = set_sampler_mag_filter(ctx, sampObj, param);
633 res = set_sampler_min_lod(ctx, sampObj, (GLfloat) param);
636 res = set_sampler_max_lod(ctx, sampObj, (GLfloat) param);
639 res = set_sampler_lod_bias(ctx, sampObj, (GLfloat) param);
642 res = set_sampler_compare_mode(ctx, sampObj, param);
645 res = set_sampler_compare_func(ctx, sampObj, param);
648 res = set_sampler_max_anisotropy(ctx, sampObj, (GLfloat) param);
651 ctx, sampObj, param);
654 res = set_sampler_srgb_decode(ctx, sampObj, param);
670 _mesa_error(ctx, GL_INVALID_ENUM, "glSamplerParameteri(pname=%s)\n",
674 _mesa_error(ctx, GL_INVALID_ENUM, "glSamplerParameteri(param=%d)\n",
678 _mesa_error(ctx, GL_INVALID_VALUE, "glSamplerParameteri(param=%d)\n",
692 GET_CURRENT_CONTEXT(ctx);
694 ASSERT_OUTSIDE_BEGIN_END(ctx);
696 sampObj = _mesa_lookup_samplerobj(ctx, sampler);
698 _mesa_error(ctx, GL_INVALID_VALUE, "glSamplerParameterf(sampler %u)",
705 res = set_sampler_wrap_s(ctx, sampObj, (GLint) param);
708 res = set_sampler_wrap_t(ctx, sampObj, (GLint) param);
711 res = set_sampler_wrap_r(ctx, sampObj, (GLint) param);
714 res = set_sampler_min_filter(ctx, sampObj, (GLint) param);
717 res = set_sampler_mag_filter(ctx, sampObj, (GLint) param);
720 res = set_sampler_min_lod(ctx, sampObj, param);
723 res = set_sampler_max_lod(ctx, sampObj, param);
726 res = set_sampler_lod_bias(ctx, sampObj, param);
729 res = set_sampler_compare_mode(ctx, sampObj, (GLint) param);
732 res = set_sampler_compare_func(ctx, sampObj, (GLint) param);
735 res = set_sampler_max_anisotropy(ctx, sampObj, param);
738 res = set_sampler_cube_map_seamless(ctx, sampObj, (GLboolean) param);
741 res = set_sampler_srgb_decode(ctx, sampObj, (GLenum) param);
757 _mesa_error(ctx, GL_INVALID_ENUM, "glSamplerParameterf(pname=%s)\n",
761 _mesa_error(ctx, GL_INVALID_ENUM, "glSamplerParameterf(param=%f)\n",
765 _mesa_error(ctx, GL_INVALID_VALUE, "glSamplerParameterf(param=%f)\n",
778 GET_CURRENT_CONTEXT(ctx);
780 sampObj = _mesa_lookup_samplerobj(ctx, sampler);
782 _mesa_error(ctx, GL_INVALID_VALUE, "glSamplerParameteriv(sampler %u)",
789 res = set_sampler_wrap_s(ctx, sampObj, params[0]);
792 res = set_sampler_wrap_t(ctx, sampObj, params[0]);
795 res = set_sampler_wrap_r(ctx, sampObj, params[0]);
798 res = set_sampler_min_filter(ctx, sampObj, params[0]);
801 res = set_sampler_mag_filter(ctx, sampObj, params[0]);
804 res = set_sampler_min_lod(ctx, sampObj, (GLfloat) params[0]);
807 res = set_sampler_max_lod(ctx, sampObj, (GLfloat) params[0]);
810 res = set_sampler_lod_bias(ctx, sampObj, (GLfloat) params[0]);
813 res = set_sampler_compare_mode(ctx, sampObj, params[0]);
816 res = set_sampler_compare_func(ctx, sampObj, params[0]);
819 res = set_sampler_max_anisotropy(ctx, sampObj, (GLfloat) params[0]);
822 res = set_sampler_cube_map_seamless(ctx, sampObj, params[0]);
825 res = set_sampler_srgb_decode(ctx, sampObj, params[0]);
834 res = set_sampler_border_colorf(ctx, sampObj, c);
849 _mesa_error(ctx, GL_INVALID_ENUM, "glSamplerParameteriv(pname=%s)\n",
853 _mesa_error(ctx, GL_INVALID_ENUM, "glSamplerParameteriv(param=%d)\n",
857 _mesa_error(ctx, GL_INVALID_VALUE, "glSamplerParameteriv(param=%d)\n",
870 GET_CURRENT_CONTEXT(ctx);
872 ASSERT_OUTSIDE_BEGIN_END(ctx);
874 sampObj = _mesa_lookup_samplerobj(ctx, sampler);
876 _mesa_error(ctx, GL_INVALID_VALUE, "glSamplerParameterfv(sampler %u)",
883 res = set_sampler_wrap_s(ctx, sampObj, (GLint) params[0]);
886 res = set_sampler_wrap_t(ctx, sampObj, (GLint) params[0]);
889 res = set_sampler_wrap_r(ctx, sampObj, (GLint) params[0]);
892 res = set_sampler_min_filter(ctx, sampObj, (GLint) params[0]);
895 res = set_sampler_mag_filter(ctx, sampObj, (GLint) params[0]);
898 res = set_sampler_min_lod(ctx, sampObj, params[0]);
901 res = set_sampler_max_lod(ctx, sampObj, params[0]);
904 res = set_sampler_lod_bias(ctx, sampObj, params[0]);
907 res = set_sampler_compare_mode(ctx, sampObj, (GLint) params[0]);
910 res = set_sampler_compare_func(ctx, sampObj, (GLint) params[0]);
913 res = set_sampler_max_anisotropy(ctx, sampObj, params[0]);
916 res = set_sampler_cube_map_seamless(ctx, sampObj, (GLboolean) params[0]);
919 res = set_sampler_srgb_decode(ctx, sampObj, (GLenum) params[0]);
922 res = set_sampler_border_colorf(ctx, sampObj, params);
936 _mesa_error(ctx, GL_INVALID_ENUM, "glSamplerParameterfv(pname=%s)\n",
940 _mesa_error(ctx, GL_INVALID_ENUM, "glSamplerParameterfv(param=%f)\n",
944 _mesa_error(ctx, GL_INVALID_VALUE, "glSamplerParameterfv(param=%f)\n",
957 GET_CURRENT_CONTEXT(ctx);
959 sampObj = _mesa_lookup_samplerobj(ctx, sampler);
961 _mesa_error(ctx, GL_INVALID_VALUE, "glSamplerParameterIiv(sampler %u)",
968 res = set_sampler_wrap_s(ctx, sampObj, params[0]);
971 res = set_sampler_wrap_t(ctx, sampObj, params[0]);
974 res = set_sampler_wrap_r(ctx, sampObj, params[0]);
977 res = set_sampler_min_filter(ctx, sampObj, params[0]);
980 res = set_sampler_mag_filter(ctx, sampObj, params[0]);
983 res = set_sampler_min_lod(ctx, sampObj, (GLfloat) params[0]);
986 res = set_sampler_max_lod(ctx, sampObj, (GLfloat) params[0]);
989 res = set_sampler_lod_bias(ctx, sampObj, (GLfloat) params[0]);
992 res = set_sampler_compare_mode(ctx, sampObj, params[0]);
995 res = set_sampler_compare_func(ctx, sampObj, params[0]);
998 res = set_sampler_max_anisotropy(ctx, sampObj, (GLfloat) params[0]);
1001 res = set_sampler_cube_map_seamless(ctx, sampObj, params[0]);
1004 res = set_sampler_srgb_decode(ctx, sampObj, (GLenum) params[0]);
1007 res = set_sampler_border_colori(ctx, sampObj, params);
1021 _mesa_error(ctx, GL_INVALID_ENUM, "glSamplerParameterIiv(pname=%s)\n",
1025 _mesa_error(ctx, GL_INVALID_ENUM, "glSamplerParameterIiv(param=%d)\n",
1029 _mesa_error(ctx, GL_INVALID_VALUE, "glSamplerParameterIiv(param=%d)\n",
1043 GET_CURRENT_CONTEXT(ctx);
1045 sampObj = _mesa_lookup_samplerobj(ctx, sampler);
1047 _mesa_error(ctx, GL_INVALID_VALUE, "glSamplerParameterIuiv(sampler %u)",
1054 res = set_sampler_wrap_s(ctx, sampObj, params[0]);
1057 res = set_sampler_wrap_t(ctx, sampObj, params[0]);
1060 res = set_sampler_wrap_r(ctx, sampObj, params[0]);
1063 res = set_sampler_min_filter(ctx, sampObj, params[0]);
1066 res = set_sampler_mag_filter(ctx, sampObj, params[0]);
1069 res = set_sampler_min_lod(ctx, sampObj, (GLfloat) params[0]);
1072 res = set_sampler_max_lod(ctx, sampObj, (GLfloat) params[0]);
1075 res = set_sampler_lod_bias(ctx, sampObj, (GLfloat) params[0]);
1078 res = set_sampler_compare_mode(ctx, sampObj, params[0]);
1081 res = set_sampler_compare_func(ctx, sampObj, params[0]);
1084 res = set_sampler_max_anisotropy(ctx, sampObj, (GLfloat) params[0]);
1087 res = set_sampler_cube_map_seamless(ctx, sampObj, params[0]);
1090 res = set_sampler_srgb_decode(ctx, sampObj, (GLenum) params[0]);
1093 res = set_sampler_border_colorui(ctx, sampObj, params);
1107 _mesa_error(ctx, GL_INVALID_ENUM, "glSamplerParameterIuiv(pname=%s)\n",
1111 _mesa_error(ctx, GL_INVALID_ENUM, "glSamplerParameterIuiv(param=%u)\n",
1115 _mesa_error(ctx, GL_INVALID_VALUE, "glSamplerParameterIuiv(param=%u)\n",
1128 GET_CURRENT_CONTEXT(ctx);
1130 sampObj = _mesa_lookup_samplerobj(ctx, sampler);
1132 _mesa_error(ctx, GL_INVALID_VALUE, "glGetSamplerParameteriv(sampler %u)",
1163 if (!ctx->Extensions.ARB_shadow)
1168 if (!ctx->Extensions.ARB_shadow)
1182 if (!ctx->Extensions.AMD_seamless_cubemap_per_texture)
1187 if (!ctx->Extensions.EXT_texture_sRGB_decode)
1197 _mesa_error(ctx, GL_INVALID_ENUM, "glGetSamplerParameteriv(pname=%s)",
1206 GET_CURRENT_CONTEXT(ctx);
1208 sampObj = _mesa_lookup_samplerobj(ctx, sampler);
1210 _mesa_error(ctx, GL_INVALID_VALUE, "glGetSamplerParameterfv(sampler %u)",
1241 if (!ctx->Extensions.ARB_shadow)
1246 if (!ctx->Extensions.ARB_shadow)
1260 if (!ctx->Extensions.AMD_seamless_cubemap_per_texture)
1265 if (!ctx->Extensions.EXT_texture_sRGB_decode)
1275 _mesa_error(ctx, GL_INVALID_ENUM, "glGetSamplerParameterfv(pname=%s)",
1284 GET_CURRENT_CONTEXT(ctx);
1286 sampObj = _mesa_lookup_samplerobj(ctx, sampler);
1288 _mesa_error(ctx, GL_INVALID_VALUE,
1320 if (!ctx->Extensions.ARB_shadow)
1325 if (!ctx->Extensions.ARB_shadow)
1339 if (!ctx->Extensions.AMD_seamless_cubemap_per_texture)
1344 if (!ctx->Extensions.EXT_texture_sRGB_decode)
1354 _mesa_error(ctx, GL_INVALID_ENUM, "glGetSamplerParameterIiv(pname=%s)",
1363 GET_CURRENT_CONTEXT(ctx);
1365 sampObj = _mesa_lookup_samplerobj(ctx, sampler);
1367 _mesa_error(ctx, GL_INVALID_VALUE,
1399 if (!ctx->Extensions.ARB_shadow)
1404 if (!ctx->Extensions.ARB_shadow)
1418 if (!ctx->Extensions.AMD_seamless_cubemap_per_texture)
1423 if (!ctx->Extensions.EXT_texture_sRGB_decode)
1433 _mesa_error(ctx, GL_INVALID_ENUM, "glGetSamplerParameterIuiv(pname=%s)",