Lines Matching refs:ctx
61 GET_CURRENT_CONTEXT(ctx);
64 _mesa_error(ctx, GL_INVALID_VALUE, "vdpDevice");
69 _mesa_error(ctx, GL_INVALID_VALUE, "getProcAddress");
73 if (ctx->vdpDevice || ctx->vdpGetProcAddress || ctx->vdpSurfaces) {
74 _mesa_error(ctx, GL_INVALID_OPERATION, "VDPAUInitNV");
78 ctx->vdpDevice = vdpDevice;
79 ctx->vdpGetProcAddress = getProcAddress;
80 ctx->vdpSurfaces = _mesa_set_create(NULL, _mesa_hash_pointer,
88 GET_CURRENT_CONTEXT(ctx);
95 _mesa_set_remove(ctx->vdpSurfaces, entry);
102 GET_CURRENT_CONTEXT(ctx);
104 if (!ctx->vdpDevice || !ctx->vdpGetProcAddress || !ctx->vdpSurfaces) {
105 _mesa_error(ctx, GL_INVALID_OPERATION, "VDPAUFiniNV");
109 _mesa_set_destroy(ctx->vdpSurfaces, unregister_surface);
111 ctx->vdpDevice = 0;
112 ctx->vdpGetProcAddress = 0;
113 ctx->vdpSurfaces = NULL;
117 register_surface(struct gl_context *ctx, GLboolean isOutput,
124 if (!ctx->vdpDevice || !ctx->vdpGetProcAddress || !ctx->vdpSurfaces) {
125 _mesa_error(ctx, GL_INVALID_OPERATION, "VDPAURegisterSurfaceNV");
130 _mesa_error(ctx, GL_INVALID_ENUM, "VDPAURegisterSurfaceNV");
134 if (target == GL_TEXTURE_RECTANGLE && !ctx->Extensions.NV_texture_rectangle) {
135 _mesa_error(ctx, GL_INVALID_ENUM, "VDPAURegisterSurfaceNV");
153 tex = _mesa_lookup_texture_err(ctx, textureNames[i],
160 _mesa_lock_texture(ctx, tex);
163 _mesa_unlock_texture(ctx, tex);
165 _mesa_error(ctx, GL_INVALID_OPERATION,
172 tex->TargetIndex = _mesa_tex_target_to_index(ctx, target);
174 _mesa_unlock_texture(ctx, tex);
176 _mesa_error(ctx, GL_INVALID_OPERATION,
183 _mesa_unlock_texture(ctx, tex);
188 _mesa_set_add(ctx->vdpSurfaces, surf);
198 GET_CURRENT_CONTEXT(ctx);
201 _mesa_error(ctx, GL_INVALID_VALUE, "VDPAURegisterVideoSurfaceNV");
205 return register_surface(ctx, false, vdpSurface, target,
214 GET_CURRENT_CONTEXT(ctx);
217 _mesa_error(ctx, GL_INVALID_VALUE, "VDPAURegisterVideoSurfaceNV");
221 return register_surface(ctx, true, vdpSurface, target,
229 GET_CURRENT_CONTEXT(ctx);
231 if (!ctx->vdpDevice || !ctx->vdpGetProcAddress || !ctx->vdpSurfaces) {
232 _mesa_error(ctx, GL_INVALID_OPERATION, "VDPAUIsSurfaceNV");
236 if (!_mesa_set_search(ctx->vdpSurfaces, surf)) {
249 GET_CURRENT_CONTEXT(ctx);
251 if (!ctx->vdpDevice || !ctx->vdpGetProcAddress || !ctx->vdpSurfaces) {
252 _mesa_error(ctx, GL_INVALID_OPERATION, "VDPAUUnregisterSurfaceNV");
260 entry = _mesa_set_search(ctx->vdpSurfaces, surf);
262 _mesa_error(ctx, GL_INVALID_VALUE, "VDPAUUnregisterSurfaceNV");
273 _mesa_set_remove(ctx->vdpSurfaces, entry);
282 GET_CURRENT_CONTEXT(ctx);
284 if (!ctx->vdpDevice || !ctx->vdpGetProcAddress || !ctx->vdpSurfaces) {
285 _mesa_error(ctx, GL_INVALID_OPERATION, "VDPAUGetSurfaceivNV");
289 if (!_mesa_set_search(ctx->vdpSurfaces, surf)) {
290 _mesa_error(ctx, GL_INVALID_VALUE, "VDPAUGetSurfaceivNV");
295 _mesa_error(ctx, GL_INVALID_ENUM, "VDPAUGetSurfaceivNV");
300 _mesa_error(ctx, GL_INVALID_VALUE, "VDPAUGetSurfaceivNV");
314 GET_CURRENT_CONTEXT(ctx);
316 if (!ctx->vdpDevice || !ctx->vdpGetProcAddress || !ctx->vdpSurfaces) {
317 _mesa_error(ctx, GL_INVALID_OPERATION, "VDPAUSurfaceAccessNV");
321 if (!_mesa_set_search(ctx->vdpSurfaces, surf)) {
322 _mesa_error(ctx, GL_INVALID_VALUE, "VDPAUSurfaceAccessNV");
329 _mesa_error(ctx, GL_INVALID_VALUE, "VDPAUSurfaceAccessNV");
334 _mesa_error(ctx, GL_INVALID_OPERATION, "VDPAUSurfaceAccessNV");
344 GET_CURRENT_CONTEXT(ctx);
347 if (!ctx->vdpDevice || !ctx->vdpGetProcAddress || !ctx->vdpSurfaces) {
348 _mesa_error(ctx, GL_INVALID_OPERATION, "VDPAUUnmapSurfacesNV");
355 if (!_mesa_set_search(ctx->vdpSurfaces, surf)) {
356 _mesa_error(ctx, GL_INVALID_VALUE, "VDPAUSurfaceAccessNV");
361 _mesa_error(ctx, GL_INVALID_OPERATION, "VDPAUSurfaceAccessNV");
375 _mesa_lock_texture(ctx, tex);
376 image = _mesa_get_tex_image(ctx, tex, surf->target, 0);
378 _mesa_error(ctx, GL_OUT_OF_MEMORY, "VDPAUMapSurfacesNV");
379 _mesa_unlock_texture(ctx, tex);
383 st_FreeTextureImageBuffer(ctx, image);
385 st_vdpau_map_surface(ctx, surf->target, surf->access,
389 _mesa_unlock_texture(ctx, tex);
398 GET_CURRENT_CONTEXT(ctx);
401 if (!ctx->vdpDevice || !ctx->vdpGetProcAddress || !ctx->vdpSurfaces) {
402 _mesa_error(ctx, GL_INVALID_OPERATION, "VDPAUUnmapSurfacesNV");
409 if (!_mesa_set_search(ctx->vdpSurfaces, surf)) {
410 _mesa_error(ctx, GL_INVALID_VALUE, "VDPAUSurfaceAccessNV");
415 _mesa_error(ctx, GL_INVALID_OPERATION, "VDPAUSurfaceAccessNV");
429 _mesa_lock_texture(ctx, tex);
433 st_vdpau_unmap_surface(ctx, surf->target, surf->access,
438 st_FreeTextureImageBuffer(ctx, image);
440 _mesa_unlock_texture(ctx, tex);