Re: [Mesa-dev] [PATCH] mesa: set the texture target in VDPAUMapSurfacesNV (v2)

2015-10-27 Thread Marek Olšák
Thanks, and sorry, I forgot to update the commit message. I will
commit it shortly with that fixed.

Marek

On Tue, Oct 27, 2015 at 9:19 PM, Brian Paul  wrote:
> On 10/27/2015 02:17 PM, Marek Olšák wrote:
>>
>> From: Marek Olšák 
>>
>> 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
>> ---
>>   src/mesa/main/vdpau.c | 5 +++--
>>   1 file changed, 3 insertions(+), 2 deletions(-)
>>
>> diff --git a/src/mesa/main/vdpau.c b/src/mesa/main/vdpau.c
>> index 0efa56e..44be3a3 100644
>> --- a/src/mesa/main/vdpau.c
>> +++ b/src/mesa/main/vdpau.c
>> @@ -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,
>>
>
> That looks good.
>
> Reviewed-by: Brian Paul 
>
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] mesa: set the texture target in VDPAUMapSurfacesNV (v2)

2015-10-27 Thread Brian Paul

On 10/27/2015 02:17 PM, Marek Olšák wrote:

From: Marek Olšák 

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
---
  src/mesa/main/vdpau.c | 5 +++--
  1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/mesa/main/vdpau.c b/src/mesa/main/vdpau.c
index 0efa56e..44be3a3 100644
--- a/src/mesa/main/vdpau.c
+++ b/src/mesa/main/vdpau.c
@@ -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,



That looks good.

Reviewed-by: Brian Paul 

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH] mesa: set the texture target in VDPAUMapSurfacesNV (v2)

2015-10-27 Thread Marek Olšák
From: Marek Olšák 

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
---
 src/mesa/main/vdpau.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/mesa/main/vdpau.c b/src/mesa/main/vdpau.c
index 0efa56e..44be3a3 100644
--- a/src/mesa/main/vdpau.c
+++ b/src/mesa/main/vdpau.c
@@ -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,
-- 
2.1.4

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] mesa: set the texture target in VDPAUMapSurfacesNV

2015-10-27 Thread Brian Paul

Sorry for causing this regression.  Thanks for fixing it.  Question below...

On 10/27/2015 05:31 AM, Marek Olšák wrote:

From: Marek Olšák 

This is required since 7d7dd1871174905dfdd3ca874a09d9.
---
  src/mesa/main/vdpau.c | 3 +++
  1 file changed, 3 insertions(+)

diff --git a/src/mesa/main/vdpau.c b/src/mesa/main/vdpau.c
index 0efa56e..0c000c4 100644
--- a/src/mesa/main/vdpau.c
+++ b/src/mesa/main/vdpau.c
@@ -375,6 +375,9 @@ _mesa_VDPAUMapSurfacesNV(GLsizei numSurfaces, const 
GLintptr *surfaces)
  return;
   }

+ tex->Target = surf->target;
+ tex->TargetIndex = _mesa_tex_target_to_index(ctx, surf->target);
+
   ctx->Driver.FreeTextureImageBuffer(ctx, image);

   ctx->Driver.VDPAUMapSurface(ctx, surf->target, surf->access,



It looks like tex->Target is getting set at line 167.  Could you simply 
initialize tex->TargetIndex at that point too?


-Brian

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] mesa: set the texture target in VDPAUMapSurfacesNV

2015-10-27 Thread Christian König

On 27.10.2015 13:16, Emil Velikov wrote:

Hi Marek,

On 27 October 2015 at 11:31, Marek Olšák  wrote:

From: Marek Olšák 

This is required since 7d7dd1871174905dfdd3ca874a09d9.

Can you add the bugzilla tag please.

I'd suspect many of us are not fluent in gl-vdpau interop can you
please throw in a small comment. Thinking about the following but I'm
sure you can think of something better.
"With the said commit the initialization of the Target{,Index} was
moved from glBindTexture to glTextureView. One does not need the
latter for GL VDPAU interop thus things broke."

With those
Reviewed-by: Emil Velikov 


Yeah that explanation sounds sane to me. Patch is Reviewed-by: Christian 
König  as well.


Thanks for digging up why that failed,
Christian.



-Emil
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] mesa: set the texture target in VDPAUMapSurfacesNV

2015-10-27 Thread Emil Velikov
Hi Marek,

On 27 October 2015 at 11:31, Marek Olšák  wrote:
> From: Marek Olšák 
>
> This is required since 7d7dd1871174905dfdd3ca874a09d9.
Can you add the bugzilla tag please.

I'd suspect many of us are not fluent in gl-vdpau interop can you
please throw in a small comment. Thinking about the following but I'm
sure you can think of something better.
"With the said commit the initialization of the Target{,Index} was
moved from glBindTexture to glTextureView. One does not need the
latter for GL VDPAU interop thus things broke."

With those
Reviewed-by: Emil Velikov 

-Emil
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH] mesa: set the texture target in VDPAUMapSurfacesNV

2015-10-27 Thread Marek Olšák
From: Marek Olšák 

This is required since 7d7dd1871174905dfdd3ca874a09d9.
---
 src/mesa/main/vdpau.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/mesa/main/vdpau.c b/src/mesa/main/vdpau.c
index 0efa56e..0c000c4 100644
--- a/src/mesa/main/vdpau.c
+++ b/src/mesa/main/vdpau.c
@@ -375,6 +375,9 @@ _mesa_VDPAUMapSurfacesNV(GLsizei numSurfaces, const 
GLintptr *surfaces)
 return;
  }
 
+ tex->Target = surf->target;
+ tex->TargetIndex = _mesa_tex_target_to_index(ctx, surf->target);
+
  ctx->Driver.FreeTextureImageBuffer(ctx, image);
 
  ctx->Driver.VDPAUMapSurface(ctx, surf->target, surf->access,
-- 
2.1.4

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev