Re: [Mesa-dev] [PATCH 1/2] st/mesa: adjust blending modes if we don't have destination alpha

2015-04-29 Thread Jose Fonseca
On 29/04/15 15:56, Brian Paul wrote: On 04/29/2015 05:52 AM, Marek Olšák wrote: On Wed, Apr 29, 2015 at 12:44 PM, Jose Fonseca wrote: I think there are two different things here: one is the driver internally fakes BGRX with BGRA, and obviously it's the pipe driver that needs to fix up alpha ch

Re: [Mesa-dev] [PATCH 1/2] st/mesa: adjust blending modes if we don't have destination alpha

2015-04-29 Thread Brian Paul
On 04/29/2015 05:52 AM, Marek Olšák wrote: On Wed, Apr 29, 2015 at 12:44 PM, Jose Fonseca wrote: I think there are two different things here: one is the driver internally fakes BGRX with BGRA, and obviously it's the pipe driver that needs to fix up alpha channel blending to simulate it's one.

Re: [Mesa-dev] [PATCH 1/2] st/mesa: adjust blending modes if we don't have destination alpha

2015-04-29 Thread Marek Olšák
On Wed, Apr 29, 2015 at 12:44 PM, Jose Fonseca wrote: > I think there are two different things here: one is the driver internally > fakes BGRX with BGRA, and obviously it's the pipe driver that needs to fix > up alpha channel blending to simulate it's one. > > The other is the state tracker is fak

Re: [Mesa-dev] [PATCH 1/2] st/mesa: adjust blending modes if we don't have destination alpha

2015-04-29 Thread Jose Fonseca
I think there are two different things here: one is the driver internally fakes BGRX with BGRA, and obviously it's the pipe driver that needs to fix up alpha channel blending to simulate it's one. The other is the state tracker is faking BGRX with BGRA, and in that case, it's the state tracker

Re: [Mesa-dev] [PATCH 1/2] st/mesa: adjust blending modes if we don't have destination alpha

2015-04-29 Thread Marek Olšák
I can't say I like this. Ever since Radeon - Northern Islands, our hardware can do this DST_ALPHA->ONE adjustment automatically, so the new state dependency on _NEW_BUFFERS is unnecessary for us here. Marek On Wed, Apr 29, 2015 at 2:19 AM, Brian Paul wrote: > If the user requested a GL_RGB textu

Re: [Mesa-dev] [PATCH 1/2] st/mesa: adjust blending modes if we don't have destination alpha

2015-04-29 Thread Jose Fonseca
On 28/04/15 23:16, Brian Paul wrote: If the user requested a GL_RGB texture but the driver actually allocated an RGBA texture, the alpha values in the texture may not be defined. If we later bind the texture as a color target and try to blend into it with GL_DST_ALPHA or GL_ONE_MINUS_DST_ALPHA w

Re: [Mesa-dev] [PATCH 1/2] st/mesa: adjust blending modes if we don't have destination alpha

2015-04-28 Thread Ilia Mirkin
if (blend_per_rt(ctx) || colormask_per_rt(ctx)) { num_state = ctx->Const.MaxDrawBuffers; blend->independent_blend_enable = 1; } So independent blend won't get enabled even though the backend supports it in the case where you have the same settings but with one RGB and one RGBA ta

[Mesa-dev] [PATCH 1/2] st/mesa: adjust blending modes if we don't have destination alpha

2015-04-28 Thread Brian Paul
If the user requested a GL_RGB texture but the driver actually allocated an RGBA texture, the alpha values in the texture may not be defined. If we later bind the texture as a color target and try to blend into it with GL_DST_ALPHA or GL_ONE_MINUS_DST_ALPHA we may blend with undefined alpha values

Re: [Mesa-dev] [PATCH 1/2] st/mesa: adjust blending modes if we don't have destination alpha

2015-04-28 Thread Brian Paul
On 04/28/2015 05:52 PM, Ilia Mirkin wrote: On Tue, Apr 28, 2015 at 7:52 PM, Brian Paul wrote: On 04/28/2015 04:35 PM, Ilia Mirkin wrote: On Tue, Apr 28, 2015 at 6:26 PM, Ilia Mirkin wrote: Reviewed-by: Ilia Mirkin ctually Awesome! Now I can go remove this set of hacks from f

Re: [Mesa-dev] [PATCH 1/2] st/mesa: adjust blending modes if we don't have destination alpha

2015-04-28 Thread Roland Scheidegger
Am 29.04.2015 um 01:52 schrieb Brian Paul: > On 04/28/2015 04:35 PM, Ilia Mirkin wrote: >> On Tue, Apr 28, 2015 at 6:26 PM, Ilia Mirkin >> wrote: >>> Reviewed-by: Ilia Mirkin >> >> ctually >> >>> >>> Awesome! Now I can go remove this set of hacks from freedreno. And >>> this fixes the sam

Re: [Mesa-dev] [PATCH 1/2] st/mesa: adjust blending modes if we don't have destination alpha

2015-04-28 Thread Ilia Mirkin
On Tue, Apr 28, 2015 at 7:52 PM, Brian Paul wrote: > On 04/28/2015 04:35 PM, Ilia Mirkin wrote: >> >> On Tue, Apr 28, 2015 at 6:26 PM, Ilia Mirkin wrote: >>> >>> Reviewed-by: Ilia Mirkin >> >> >> ctually >> >>> >>> Awesome! Now I can go remove this set of hacks from freedreno. And >>> th

Re: [Mesa-dev] [PATCH 1/2] st/mesa: adjust blending modes if we don't have destination alpha

2015-04-28 Thread Brian Paul
On 04/28/2015 04:35 PM, Ilia Mirkin wrote: On Tue, Apr 28, 2015 at 6:26 PM, Ilia Mirkin wrote: Reviewed-by: Ilia Mirkin ctually Awesome! Now I can go remove this set of hacks from freedreno. And this fixes the same issue in nouveau. Thanks for doing it the real way :) On Tue, Apr

Re: [Mesa-dev] [PATCH 1/2] st/mesa: adjust blending modes if we don't have destination alpha

2015-04-28 Thread Ilia Mirkin
On Tue, Apr 28, 2015 at 6:26 PM, Ilia Mirkin wrote: > Reviewed-by: Ilia Mirkin ctually > > Awesome! Now I can go remove this set of hacks from freedreno. And > this fixes the same issue in nouveau. Thanks for doing it the real way > :) > > On Tue, Apr 28, 2015 at 6:16 PM, Brian Paul wr

Re: [Mesa-dev] [PATCH 1/2] st/mesa: adjust blending modes if we don't have destination alpha

2015-04-28 Thread Ilia Mirkin
Reviewed-by: Ilia Mirkin Awesome! Now I can go remove this set of hacks from freedreno. And this fixes the same issue in nouveau. Thanks for doing it the real way :) On Tue, Apr 28, 2015 at 6:16 PM, Brian Paul wrote: > If the user requested a GL_RGB texture but the driver actually allocated > a

[Mesa-dev] [PATCH 1/2] st/mesa: adjust blending modes if we don't have destination alpha

2015-04-28 Thread Brian Paul
If the user requested a GL_RGB texture but the driver actually allocated an RGBA texture, the alpha values in the texture may not be defined. If we later bind the texture as a color target and try to blend into it with GL_DST_ALPHA or GL_ONE_MINUS_DST_ALPHA we may blend with undefined alpha values