mesa: set TargetIndex in VDPAURegister*SurfaceNV (v2)
authorMarek Olšák <marek.olsak@amd.com>
Tue, 27 Oct 2015 10:11:19 +0000 (11:11 +0100)
committerMarek Olšák <marek.olsak@amd.com>
Wed, 28 Oct 2015 10:52:17 +0000 (11:52 +0100)
We initialized Target, but not TargetIndex.
This is required since 7d7dd1871174905dfdd3ca874a09d9.

v2: do it in the right place. Noticed by Brian Paul.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=92645

Reviewed-by: Brian Paul <brianp@vmware.com>
src/mesa/main/vdpau.c

index 0efa56e4f4199ba42ec9d0512120087caf7ce733..44be3a37443b95adb057061a892a6970198dacfe 100644 (file)
@@ -163,9 +163,10 @@ register_surface(struct gl_context *ctx, GLboolean isOutput,
          return (GLintptr)NULL;
       }
 
-      if (tex->Target == 0)
+      if (tex->Target == 0) {
          tex->Target = target;
-      else if (tex->Target != target) {
+         tex->TargetIndex = _mesa_tex_target_to_index(ctx, target);
+      } else if (tex->Target != target) {
          _mesa_unlock_texture(ctx, tex);
          free(surf);
          _mesa_error(ctx, GL_INVALID_OPERATION,