Re: [Mesa-dev] [PATCH] i965/hsw: approximate DDX with a uniform value across a subspan

2013-09-30 Thread Chia-I Wu
On Tue, Oct 1, 2013 at 12:16 PM, Kenneth Graunke wrote: > On 09/30/2013 07:16 PM, Ian Romanick wrote: >> On 09/11/2013 10:00 PM, Chia-I Wu wrote: >>> From: Chia-I Wu >>> >>> Replicate the gradient of the top-left pixel to the other three pixels in >>> the >>> subspan, as how DDY is implemented.

Re: [Mesa-dev] [PATCH] i965/hsw: approximate DDX with a uniform value across a subspan

2013-09-30 Thread Kenneth Graunke
On 09/30/2013 07:16 PM, Ian Romanick wrote: > On 09/11/2013 10:00 PM, Chia-I Wu wrote: >> From: Chia-I Wu >> >> Replicate the gradient of the top-left pixel to the other three pixels in the >> subspan, as how DDY is implemented. Before, different graidents were used >> for >> pixels in the top r

Re: [Mesa-dev] [PATCH] i965/hsw: approximate DDX with a uniform value across a subspan

2013-09-30 Thread Ian Romanick
On 09/11/2013 10:00 PM, Chia-I Wu wrote: > From: Chia-I Wu > > Replicate the gradient of the top-left pixel to the other three pixels in the > subspan, as how DDY is implemented. Before, different graidents were used for > pixels in the top row and pixels in the bottom row. > > This change resu

Re: [Mesa-dev] [PATCH] i965/hsw: approximate DDX with a uniform value across a subspan

2013-09-12 Thread Chris Forbes
Sounds good to me. On Fri, Sep 13, 2013 at 3:11 PM, Chia-I Wu wrote: > On Thu, Sep 12, 2013 at 10:48 PM, Ian Romanick wrote: >> On 09/12/2013 01:06 AM, Chris Forbes wrote: >>> Can we make this approximation conditional on an image-quality control >>> in driconf [or somewhere else]? >> >> There's

Re: [Mesa-dev] [PATCH] i965/hsw: approximate DDX with a uniform value across a subspan

2013-09-12 Thread Chia-I Wu
On Thu, Sep 12, 2013 at 10:48 PM, Ian Romanick wrote: > On 09/12/2013 01:06 AM, Chris Forbes wrote: >> Can we make this approximation conditional on an image-quality control >> in driconf [or somewhere else]? > > There's already a control that applications can use: > GL_FRAGMENT_SHADER_DERIVATIVE_

Re: [Mesa-dev] [PATCH] i965/hsw: approximate DDX with a uniform value across a subspan

2013-09-12 Thread Ian Romanick
On 09/12/2013 01:06 AM, Chris Forbes wrote: > Can we make this approximation conditional on an image-quality control > in driconf [or somewhere else]? There's already a control that applications can use: GL_FRAGMENT_SHADER_DERIVATIVE_HINT. I don't know whether or not /any/ app has ever used it.

Re: [Mesa-dev] [PATCH] i965/hsw: approximate DDX with a uniform value across a subspan

2013-09-12 Thread Chia-I Wu
On Thu, Sep 12, 2013 at 5:27 PM, Chris Forbes wrote: > I guess fast-by-default. I imagine that more apps care about > performance than care about the granularity of their derivatives. That is my preference too. My concern is that the performance gain is only observed on Haswell so far. Why is th

Re: [Mesa-dev] [PATCH] i965/hsw: approximate DDX with a uniform value across a subspan

2013-09-12 Thread Chris Forbes
I guess fast-by-default. I imagine that more apps care about performance than care about the granularity of their derivatives. After a bit more thought -- In HLSL shader model 5 there's both ddx_coarse() and ddx_fine() which gives the shader author the choice between roughly these options. In a *v

Re: [Mesa-dev] [PATCH] i965/hsw: approximate DDX with a uniform value across a subspan

2013-09-12 Thread Chia-I Wu
On Thu, Sep 12, 2013 at 2:06 PM, Chris Forbes wrote: > Can we make this approximation conditional on an image-quality control > in driconf [or somewhere else]? Sure. What would be the default behavior? > On Thu, Sep 12, 2013 at 5:00 PM, Chia-I Wu wrote: >> From: Chia-I Wu >> >> Replicate the g

Re: [Mesa-dev] [PATCH] i965/hsw: approximate DDX with a uniform value across a subspan

2013-09-11 Thread Chris Forbes
Can we make this approximation conditional on an image-quality control in driconf [or somewhere else]? On Thu, Sep 12, 2013 at 5:00 PM, Chia-I Wu wrote: > From: Chia-I Wu > > Replicate the gradient of the top-left pixel to the other three pixels in the > subspan, as how DDY is implemented. Befo

[Mesa-dev] [PATCH] i965/hsw: approximate DDX with a uniform value across a subspan

2013-09-11 Thread Chia-I Wu
From: Chia-I Wu Replicate the gradient of the top-left pixel to the other three pixels in the subspan, as how DDY is implemented. Before, different graidents were used for pixels in the top row and pixels in the bottom row. This change results in a less accurate approximation. However, it impr