[1/8] shader_runner: Clamp the SIZE directive to the platform's minimum size.

Submitted by Eric Anholt on Aug. 29, 2014, 9:41 p.m.

Details

Message ID 1409348479-15398-1-git-send-email-eric@anholt.net
State New
Headers show

Not browsing as part of any series.

Commit Message

Eric Anholt Aug. 29, 2014, 9:41 p.m.
I want to start declaring small sizes in shader_runner tests, but we
need to avoid angering win8.
---
 tests/shaders/shader_runner.c | 8 ++++++++
 1 file changed, 8 insertions(+)

Patch hide | download patch | download mbox

diff --git a/tests/shaders/shader_runner.c b/tests/shaders/shader_runner.c
index 82b834d..b2bde04 100644
--- a/tests/shaders/shader_runner.c
+++ b/tests/shaders/shader_runner.c
@@ -1121,9 +1121,17 @@  get_required_config(const char *script_name,
 	parse_required_config(&parse_results, script_name);
 	choose_required_gl_version(&parse_results, &required_gl_version);
 
+	/* If the shader has a SIZE directive, then make the window
+	 * only that big (but constrained by whatever the platform's
+	 * limits on window size are).
+	 */
 	if (parse_results.found_size) {
 		config->window_width = parse_results.size[0];
 		config->window_height = parse_results.size[1];
+#if defined(_WIN32)
+                config.window_width = MAX2(config.window_width, 160);
+                config.window_height = MAX2(config.window_height, 160);
+#endif
 	}
 
 	if (required_gl_version.es) {

Comments

On Fri, Aug 29, 2014 at 5:41 PM, Eric Anholt <eric@anholt.net> wrote:
> I want to start declaring small sizes in shader_runner tests, but we
> need to avoid angering win8.

Can I put in a good word for POT sizes?

> ---
>  tests/shaders/shader_runner.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
>
> diff --git a/tests/shaders/shader_runner.c b/tests/shaders/shader_runner.c
> index 82b834d..b2bde04 100644
> --- a/tests/shaders/shader_runner.c
> +++ b/tests/shaders/shader_runner.c
> @@ -1121,9 +1121,17 @@ get_required_config(const char *script_name,
>         parse_required_config(&parse_results, script_name);
>         choose_required_gl_version(&parse_results, &required_gl_version);
>
> +       /* If the shader has a SIZE directive, then make the window
> +        * only that big (but constrained by whatever the platform's
> +        * limits on window size are).
> +        */
>         if (parse_results.found_size) {
>                 config->window_width = parse_results.size[0];
>                 config->window_height = parse_results.size[1];
> +#if defined(_WIN32)
> +                config.window_width = MAX2(config.window_width, 160);

Surely you meant config->window_width/height?

> +                config.window_height = MAX2(config.window_height, 160);
> +#endif
>         }
>
>         if (required_gl_version.es) {
> --
> 2.1.0
>
> _______________________________________________
> Piglit mailing list
> Piglit@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/piglit
Ilia Mirkin <imirkin@alum.mit.edu> writes:

> On Fri, Aug 29, 2014 at 5:41 PM, Eric Anholt <eric@anholt.net> wrote:
>> I want to start declaring small sizes in shader_runner tests, but we
>> need to avoid angering win8.
>
> Can I put in a good word for POT sizes?

You've got shader-capable hardware that's also POT-only?  I'm pretty
sure your driver should be hiding that from people :(

>> diff --git a/tests/shaders/shader_runner.c b/tests/shaders/shader_runner.c
>> index 82b834d..b2bde04 100644
>> --- a/tests/shaders/shader_runner.c
>> +++ b/tests/shaders/shader_runner.c
>> @@ -1121,9 +1121,17 @@ get_required_config(const char *script_name,
>>         parse_required_config(&parse_results, script_name);
>>         choose_required_gl_version(&parse_results, &required_gl_version);
>>
>> +       /* If the shader has a SIZE directive, then make the window
>> +        * only that big (but constrained by whatever the platform's
>> +        * limits on window size are).
>> +        */
>>         if (parse_results.found_size) {
>>                 config->window_width = parse_results.size[0];
>>                 config->window_height = parse_results.size[1];
>> +#if defined(_WIN32)
>> +                config.window_width = MAX2(config.window_width, 160);
>
> Surely you meant config->window_width/height?
>
>> +                config.window_height = MAX2(config.window_height, 160);
>> +#endif

Thanks.
On Sat, Aug 30, 2014 at 4:19 PM, Eric Anholt <eric@anholt.net> wrote:
> Ilia Mirkin <imirkin@alum.mit.edu> writes:
>
>> On Fri, Aug 29, 2014 at 5:41 PM, Eric Anholt <eric@anholt.net> wrote:
>>> I want to start declaring small sizes in shader_runner tests, but we
>>> need to avoid angering win8.
>>
>> Can I put in a good word for POT sizes?
>
> You've got shader-capable hardware that's also POT-only?  I'm pretty
> sure your driver should be hiding that from people :(

I actually realized after I sent it that this was only for
shader_runner, so it won't affect nouveau_vieux. However nv3x (GeForce
FX 5000-series) can only do POT as well...

>
>>> diff --git a/tests/shaders/shader_runner.c b/tests/shaders/shader_runner.c
>>> index 82b834d..b2bde04 100644
>>> --- a/tests/shaders/shader_runner.c
>>> +++ b/tests/shaders/shader_runner.c
>>> @@ -1121,9 +1121,17 @@ get_required_config(const char *script_name,
>>>         parse_required_config(&parse_results, script_name);
>>>         choose_required_gl_version(&parse_results, &required_gl_version);
>>>
>>> +       /* If the shader has a SIZE directive, then make the window
>>> +        * only that big (but constrained by whatever the platform's
>>> +        * limits on window size are).
>>> +        */
>>>         if (parse_results.found_size) {
>>>                 config->window_width = parse_results.size[0];
>>>                 config->window_height = parse_results.size[1];
>>> +#if defined(_WIN32)
>>> +                config.window_width = MAX2(config.window_width, 160);
>>
>> Surely you meant config->window_width/height?
>>
>>> +                config.window_height = MAX2(config.window_height, 160);
>>> +#endif
>
> Thanks.
Series is

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>

I didn't review patch 6 super closely, but given that you've been
running on it for more than 6 months... :)

On 08/29/2014 02:41 PM, Eric Anholt wrote:
> I want to start declaring small sizes in shader_runner tests, but we
> need to avoid angering win8.
> ---
>  tests/shaders/shader_runner.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/tests/shaders/shader_runner.c b/tests/shaders/shader_runner.c
> index 82b834d..b2bde04 100644
> --- a/tests/shaders/shader_runner.c
> +++ b/tests/shaders/shader_runner.c
> @@ -1121,9 +1121,17 @@ get_required_config(const char *script_name,
>  	parse_required_config(&parse_results, script_name);
>  	choose_required_gl_version(&parse_results, &required_gl_version);
>  
> +	/* If the shader has a SIZE directive, then make the window
> +	 * only that big (but constrained by whatever the platform's
> +	 * limits on window size are).
> +	 */
>  	if (parse_results.found_size) {
>  		config->window_width = parse_results.size[0];
>  		config->window_height = parse_results.size[1];
> +#if defined(_WIN32)
> +                config.window_width = MAX2(config.window_width, 160);
> +                config.window_height = MAX2(config.window_height, 160);
> +#endif
>  	}
>  
>  	if (required_gl_version.es) {
>
On Fri, Aug 29, 2014 at 5:41 PM, Eric Anholt <eric@anholt.net> wrote:
> I want to start declaring small sizes in shader_runner tests, but we
> need to avoid angering win8.
> ---
>  tests/shaders/shader_runner.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
>
> diff --git a/tests/shaders/shader_runner.c b/tests/shaders/shader_runner.c
> index 82b834d..b2bde04 100644
> --- a/tests/shaders/shader_runner.c
> +++ b/tests/shaders/shader_runner.c
> @@ -1121,9 +1121,17 @@ get_required_config(const char *script_name,
>         parse_required_config(&parse_results, script_name);
>         choose_required_gl_version(&parse_results, &required_gl_version);
>
> +       /* If the shader has a SIZE directive, then make the window
> +        * only that big (but constrained by whatever the platform's
> +        * limits on window size are).
> +        */
>         if (parse_results.found_size) {
>                 config->window_width = parse_results.size[0];
>                 config->window_height = parse_results.size[1];
> +#if defined(_WIN32)
> +                config.window_width = MAX2(config.window_width, 160);
> +                config.window_height = MAX2(config.window_height, 160);

These should probably be config->window_width/height.

> +#endif
>         }
>
>         if (required_gl_version.es) {
> --
> 2.1.0
>
> _______________________________________________
> Piglit mailing list
> Piglit@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/piglit