Re: [Piglit] [PATCH] framework: Do not run with an empty test list

2017-10-20 Thread Martin Peres

On 19/10/17 19:50, Dylan Baker wrote:

Quoting Martin Peres (2017-10-19 07:17:25)

On 30/09/17 23:42, Dylan Baker wrote:

Actually CC'ing him this time

Quoting Dylan Baker (2017-09-29 20:29:34)

Quoting Arkadiusz Hiler (2017-09-26 03:27:50)

Because in Python we have `bool([]}) == False`, providing empty test
list resulted in hitting the same code path as not providing it at all,
meaning that we run everything.

Let's just exit early with an appropriate message instead.

This will get rid of the rather surprising behavior and will help making
the execution less prone to automated list generation errors (which has
already bitten us) as well as human errors.

Signed-off-by: Arkadiusz Hiler 
---
   framework/programs/run.py | 4 
   1 file changed, 4 insertions(+)

diff --git a/framework/programs/run.py b/framework/programs/run.py
index 4524f171b..0fec264ec 100644
--- a/framework/programs/run.py
+++ b/framework/programs/run.py
@@ -327,6 +327,10 @@ def run(input_):
   stripped = (t.split('#')[0].strip() for t in test_list)
   forced_test_list = [t for t in stripped if t]
   
+# to avoid running everything

+if not forced_test_list:
+raise exceptions.PiglitFatalError("Empty test list provided")
+
   backend = backends.get_backend(args.backend)(
   args.results_path,
   junit_suffix=args.junit_suffix,
--
2.13.5

___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


Hmmm, there is a case that we do want to continue, and that's for resume, CC'ing
Martin to see if this breaks their use case.


Sorry for the delay! Thanks for caring about CI :)

So, I like the patch, but disagree on the "raise" here. Why not simply
print("Empty test list provided") and sys.exit(0)? There is nothing to
do after all, so why report that an error happened?

If you still want to return an error, then please make sure it is one I
can test against.

Thanks,
Martin


PiglitFatalError is actually caught by the main script, the error is printed
with 'Fatal Error: ' prepended and sys.exit(1) is called. So if that's what you
want than this is find as-is I think.


The problem is that execution errors, or abort-on also exit with error 
code 1. So either we introduce a new one for this particular error, or 
we just return 0 which means all went well.


Thinking more about it though, we should still generate results, just 
with nothing inside (since we asked for nothing). This way, we don't 
need to special case the fact that the test list is empty.


What do you think?
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH] framework: Do not run with an empty test list

2017-10-19 Thread Martin Peres

On 30/09/17 23:42, Dylan Baker wrote:

Actually CC'ing him this time

Quoting Dylan Baker (2017-09-29 20:29:34)

Quoting Arkadiusz Hiler (2017-09-26 03:27:50)

Because in Python we have `bool([]}) == False`, providing empty test
list resulted in hitting the same code path as not providing it at all,
meaning that we run everything.

Let's just exit early with an appropriate message instead.

This will get rid of the rather surprising behavior and will help making
the execution less prone to automated list generation errors (which has
already bitten us) as well as human errors.

Signed-off-by: Arkadiusz Hiler 
---
  framework/programs/run.py | 4 
  1 file changed, 4 insertions(+)

diff --git a/framework/programs/run.py b/framework/programs/run.py
index 4524f171b..0fec264ec 100644
--- a/framework/programs/run.py
+++ b/framework/programs/run.py
@@ -327,6 +327,10 @@ def run(input_):
  stripped = (t.split('#')[0].strip() for t in test_list)
  forced_test_list = [t for t in stripped if t]
  
+# to avoid running everything

+if not forced_test_list:
+raise exceptions.PiglitFatalError("Empty test list provided")
+
  backend = backends.get_backend(args.backend)(
  args.results_path,
  junit_suffix=args.junit_suffix,
--
2.13.5

___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


Hmmm, there is a case that we do want to continue, and that's for resume, CC'ing
Martin to see if this breaks their use case.


Sorry for the delay! Thanks for caring about CI :)

So, I like the patch, but disagree on the "raise" here. Why not simply 
print("Empty test list provided") and sys.exit(0)? There is nothing to 
do after all, so why report that an error happened?


If you still want to return an error, then please make sure it is one I 
can test against.


Thanks,
Martin
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH v2] framework: Add --ignore-missing option

2017-08-04 Thread Martin Peres

On 01/08/17 15:06, Arkadiusz Hiler wrote:

Currently, if a test from provided testlist fails to be discovered by
the framework, piglit blows up with an exception.

This is both good - for consistency/early errors - and bad - for
handling some CI/automation scenarios (e.g autobisecting the tests).

So let's keep the current default, but allow some flexibility with the
new option that reports the missing tests as 'notrun'.

v2:
  - change switch name to 'ignore', as skip is too suggestive
  - use DummyTest to get 'notrun' result instead of warnings

bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99649
Cc: Dylan Baker 
Cc: Tomi Sarvela 
Cc: Martin Peres 
Tested-by: Petri Latvala 
Signed-off-by: Arkadiusz Hiler 


Sorry for the delay. Looks clean and neat to me:

Reviewed-by: Martin Peres 
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH] gl30basic: add some extra suspected extension

2017-07-26 Thread Martin Peres

On 26/07/17 15:58, sandra koroniewska wrote:

Hello,
is this patch ok now? Because it hasn't been pushed.

Regards,
Sandra


It still did not get any Reviewed-by. I guess the summer vacation is 
affecting the piglit team.

___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH] framework: remove duplicate import of framework.exceptions

2017-07-20 Thread Martin Peres

On 20/07/17 19:20, Dylan Baker wrote:

Reported-by: Matt Turner 


Splitting the line is indeed the right approach, as it is too easy to 
miss elements. Thanks!


Reviewed-by: Martin Peres 


Signed-off-by: Dylan Baker 
---
  framework/programs/run.py | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/framework/programs/run.py b/framework/programs/run.py
index ef268f722..6444cfedb 100644
--- a/framework/programs/run.py
+++ b/framework/programs/run.py
@@ -33,7 +33,7 @@ import time
  
  import six
  
-from framework import core, backends, exceptions, options

+from framework import core, backends, options
  from framework import dmesg
  from framework import exceptions
  from framework import monitoring


___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH] framework: Don't stop resume because no tests are left to be run

2017-07-13 Thread Martin Peres

On 11/07/17 20:27, Dylan Baker wrote:

It's completely possible that if piglit resume is run with the -n flag
(don't retry incomplete tests), that piglit resume could be invoked with
no tests left to run. In this case it makes sense to let piglit resume
just finalize the backend and produce a unified result.

Signed-off-by: Dylan Baker 
cc: Martin Peres 


Thanks!

Tested-by: Hector Edmundo Ramirez Gomez 




---
  framework/programs/run.py | 15 ++-
  1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/framework/programs/run.py b/framework/programs/run.py
index 508bc05c4..ef268f722 100644
--- a/framework/programs/run.py
+++ b/framework/programs/run.py
@@ -35,6 +35,7 @@ import six
  
  from framework import core, backends, exceptions, options

  from framework import dmesg
+from framework import exceptions
  from framework import monitoring
  from framework import profile
  from framework.results import TimeAttribute
@@ -435,11 +436,15 @@ def resume(input_):
  p.forced_test_list = results.options['forced_test_list']
  
  # This is resumed, don't bother with time since it won't be accurate anyway

-profile.run(
-profiles,
-results.options['log_level'],
-backend,
-results.options['concurrent'])
+try:
+profile.run(
+profiles,
+results.options['log_level'],
+backend,
+results.options['concurrent'])
+except exceptions.PiglitUserError as e:
+if str(e) != 'no matching tests':
+raise
  
  backend.finalize()
  


___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH 3/3] framework: Exit if a filter removes all tests from a profile

2017-07-11 Thread Martin Peres

On 27/06/17 20:44, Martin Peres wrote:



On 27/06/17 19:31, Dylan Baker wrote:

Quoting Martin Peres (2017-06-27 03:38:33)

On 22/06/17 22:12, Dylan Baker wrote:

Quoting Petri Latvala (2017-06-21 01:37:21)

On 06/20/2017 08:59 PM, Dylan Baker wrote:

Quoting Petri Latvala (2017-06-20 05:41:11)

On 04/13/2017 09:46 PM, Dylan Baker wrote:

Quoting Brian Paul (2017-04-12 13:04:59)

On 04/12/2017 11:55 AM, Dylan Baker wrote:
It doesn't makes sense to run if a user has removed all tests 
from a

selected profile, and currently if all tests are removed, then an
assertion will be hit in the backend that isn't extremely 
clear about

what went wrong. This should be much easier to understand.

Signed-off-by: Dylan Baker 
---
  framework/profile.py | 7 +++
  1 file changed, 7 insertions(+)

diff --git a/framework/profile.py b/framework/profile.py
index 4604367e1..ce0b24ce8 100644
--- a/framework/profile.py
+++ b/framework/profile.py
@@ -389,6 +389,13 @@ def run(profiles, logger, backend, 
concurrency):

  profiles = [(p, list(p.itertests())) for p in profiles]
  log = LogManager(logger, sum(len(l) for _, l in 
profiles))


+# check that after the filters are run there are actually 
tests to run

+for p, l in profiles:
+if not l:
+raise exceptions.PiglitUserError(
+'After running filters there are no tests in '
+'profile "{}"'.format(p.name))

Bumped into an issue caused by this commit with IGT tests.

When the last test of a run never finishes and you attempt to

  piglit resume -n test-results-path

this exception is raised instead of the expected result of 
finishing up

the run.


--
Petri Latvala


That is expected with the command line you've supplied.

The -n/--no-retry option instructs piglit to not retry tests that 
started but
didn't finish, if you get the same behavior without the -n option 
that is a bug.


Dylan



What is the supported method then to loop resume until 
results.json.bz2
gets generated? Previous behaviour was that piglit reported that 
there's

nothing more to do and generated that.


--
Petri Latvala



I would use `piglit summary aggregate` to build the results.json.foo 
file.


Hi Dylan,

Petri is on vacation for some time, so let me provide a little more
background on why this patch is problematic for our use-case.

For automated IGT testing, we have a testlist and reboot the machine as
soon as we get a certain error condition or if the test takes more than
a specified timeout, which reboots the machine immediately (watchdog).

Once the machine has rebooted, we re-deploy the right kernel and resume
piglit testing, using the -n option. When the testing is over, piglit
generates the results.json.foo file and returns 0. At this point,
ezbench considers the execution as done and does its own things.

However, since this patch got introduced, if the last test got
interrupted, then piglit will raise the PiglitUserError exception which
is hard to interpret from outside as a way to say that all the tests
have been run and that we should be generating the report. This also
introduces an ill-tested codepath, so Petri and I were wondering why not
make it less confusing for the user by just realizing that there are no
tests left to run, and just generate the report at this point.

Any suggestion as to what we should be doing? Maybe we could only send
this error when no tests have been run already and there are no runs to
be run?

Thanks,
Martin


Hi Martin,

I really don't think we should remove the exception, the majority of 
piglit
users are not wrapping piglit in more infrastructure, I think at this 
point the
Intel kernel and mesa teams are the only ones doing so, and it does 
report a

real error.


Sure, but let's not make it harder for other companies to use piglit, 
especially since piglit is the prefered runner for IGT which is becoming 
less intel-specific (AMD and vc4).




I do think that it would work if `piglit resume` would essentially become
`piglit summary aggregate` if there are no tests left to run, since 
tests have

actually run and a result would be non-empty.


Yes, that is all we are asking and it would make wrapping into more 
infrastructure easier :)


Feel like cooking the patch or should I do it?


Ping, QA hit the same issue...

Should I write the fix or do you want to take care of it?

Thanks,
Martin
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH 3/3] framework: Exit if a filter removes all tests from a profile

2017-06-27 Thread Martin Peres



On 27/06/17 19:31, Dylan Baker wrote:

Quoting Martin Peres (2017-06-27 03:38:33)

On 22/06/17 22:12, Dylan Baker wrote:

Quoting Petri Latvala (2017-06-21 01:37:21)

On 06/20/2017 08:59 PM, Dylan Baker wrote:

Quoting Petri Latvala (2017-06-20 05:41:11)

On 04/13/2017 09:46 PM, Dylan Baker wrote:

Quoting Brian Paul (2017-04-12 13:04:59)

On 04/12/2017 11:55 AM, Dylan Baker wrote:

It doesn't makes sense to run if a user has removed all tests from a
selected profile, and currently if all tests are removed, then an
assertion will be hit in the backend that isn't extremely clear about
what went wrong. This should be much easier to understand.

Signed-off-by: Dylan Baker 
---
  framework/profile.py | 7 +++
  1 file changed, 7 insertions(+)

diff --git a/framework/profile.py b/framework/profile.py
index 4604367e1..ce0b24ce8 100644
--- a/framework/profile.py
+++ b/framework/profile.py
@@ -389,6 +389,13 @@ def run(profiles, logger, backend, concurrency):
  profiles = [(p, list(p.itertests())) for p in profiles]
  log = LogManager(logger, sum(len(l) for _, l in profiles))

+# check that after the filters are run there are actually tests to run
+for p, l in profiles:
+if not l:
+raise exceptions.PiglitUserError(
+'After running filters there are no tests in '
+'profile "{}"'.format(p.name))

Bumped into an issue caused by this commit with IGT tests.

When the last test of a run never finishes and you attempt to

  piglit resume -n test-results-path

this exception is raised instead of the expected result of finishing up
the run.


--
Petri Latvala


That is expected with the command line you've supplied.

The -n/--no-retry option instructs piglit to not retry tests that started but
didn't finish, if you get the same behavior without the -n option that is a bug.

Dylan



What is the supported method then to loop resume until results.json.bz2
gets generated? Previous behaviour was that piglit reported that there's
nothing more to do and generated that.


--
Petri Latvala



I would use `piglit summary aggregate` to build the results.json.foo file.


Hi Dylan,

Petri is on vacation for some time, so let me provide a little more
background on why this patch is problematic for our use-case.

For automated IGT testing, we have a testlist and reboot the machine as
soon as we get a certain error condition or if the test takes more than
a specified timeout, which reboots the machine immediately (watchdog).

Once the machine has rebooted, we re-deploy the right kernel and resume
piglit testing, using the -n option. When the testing is over, piglit
generates the results.json.foo file and returns 0. At this point,
ezbench considers the execution as done and does its own things.

However, since this patch got introduced, if the last test got
interrupted, then piglit will raise the PiglitUserError exception which
is hard to interpret from outside as a way to say that all the tests
have been run and that we should be generating the report. This also
introduces an ill-tested codepath, so Petri and I were wondering why not
make it less confusing for the user by just realizing that there are no
tests left to run, and just generate the report at this point.

Any suggestion as to what we should be doing? Maybe we could only send
this error when no tests have been run already and there are no runs to
be run?

Thanks,
Martin


Hi Martin,

I really don't think we should remove the exception, the majority of piglit
users are not wrapping piglit in more infrastructure, I think at this point the
Intel kernel and mesa teams are the only ones doing so, and it does report a
real error.


Sure, but let's not make it harder for other companies to use piglit, 
especially since piglit is the prefered runner for IGT which is becoming 
less intel-specific (AMD and vc4).




I do think that it would work if `piglit resume` would essentially become
`piglit summary aggregate` if there are no tests left to run, since tests have
actually run and a result would be non-empty.


Yes, that is all we are asking and it would make wrapping into more 
infrastructure easier :)


Feel like cooking the patch or should I do it?

Cheers,
Martin
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH 3/3] framework: Exit if a filter removes all tests from a profile

2017-06-27 Thread Martin Peres

On 22/06/17 22:12, Dylan Baker wrote:

Quoting Petri Latvala (2017-06-21 01:37:21)

On 06/20/2017 08:59 PM, Dylan Baker wrote:

Quoting Petri Latvala (2017-06-20 05:41:11)

On 04/13/2017 09:46 PM, Dylan Baker wrote:

Quoting Brian Paul (2017-04-12 13:04:59)

On 04/12/2017 11:55 AM, Dylan Baker wrote:

It doesn't makes sense to run if a user has removed all tests from a
selected profile, and currently if all tests are removed, then an
assertion will be hit in the backend that isn't extremely clear about
what went wrong. This should be much easier to understand.

Signed-off-by: Dylan Baker 
---
 framework/profile.py | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/framework/profile.py b/framework/profile.py
index 4604367e1..ce0b24ce8 100644
--- a/framework/profile.py
+++ b/framework/profile.py
@@ -389,6 +389,13 @@ def run(profiles, logger, backend, concurrency):
 profiles = [(p, list(p.itertests())) for p in profiles]
 log = LogManager(logger, sum(len(l) for _, l in profiles))

+# check that after the filters are run there are actually tests to run
+for p, l in profiles:
+if not l:
+raise exceptions.PiglitUserError(
+'After running filters there are no tests in '
+'profile "{}"'.format(p.name))

Bumped into an issue caused by this commit with IGT tests.

When the last test of a run never finishes and you attempt to

 piglit resume -n test-results-path

this exception is raised instead of the expected result of finishing up
the run.


--
Petri Latvala


That is expected with the command line you've supplied.

The -n/--no-retry option instructs piglit to not retry tests that started but
didn't finish, if you get the same behavior without the -n option that is a bug.

Dylan



What is the supported method then to loop resume until results.json.bz2
gets generated? Previous behaviour was that piglit reported that there's
nothing more to do and generated that.


--
Petri Latvala



I would use `piglit summary aggregate` to build the results.json.foo file.


Hi Dylan,

Petri is on vacation for some time, so let me provide a little more 
background on why this patch is problematic for our use-case.


For automated IGT testing, we have a testlist and reboot the machine as 
soon as we get a certain error condition or if the test takes more than 
a specified timeout, which reboots the machine immediately (watchdog).


Once the machine has rebooted, we re-deploy the right kernel and resume 
piglit testing, using the -n option. When the testing is over, piglit 
generates the results.json.foo file and returns 0. At this point, 
ezbench considers the execution as done and does its own things.


However, since this patch got introduced, if the last test got 
interrupted, then piglit will raise the PiglitUserError exception which 
is hard to interpret from outside as a way to say that all the tests 
have been run and that we should be generating the report. This also 
introduces an ill-tested codepath, so Petri and I were wondering why not 
make it less confusing for the user by just realizing that there are no 
tests left to run, and just generate the report at this point.


Any suggestion as to what we should be doing? Maybe we could only send 
this error when no tests have been run already and there are no runs to 
be run?


Thanks,
Martin
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH] tests/igt.py: mark segfaulted IGT process as 'crash'

2017-06-14 Thread Martin Peres

Reviewed-by: Martin Peres 

I will push the patch now. It has waited on the list long-enough!

Thanks,
Martin

On 16/05/17 18:08, Tomi Sarvela wrote:

On IGT testing segfaulted processes are lumped together with failed
tests in results. This patch separates the two for correctness: test
doesn't have opportunity to fail if it wasn't even run.

On our testing environment segfaulted IGT tests point to problem on
builder or testhost side, not to the testcase itself.

Signed-off-by: Tomi Sarvela 
---
  tests/igt.py | 2 ++
  1 file changed, 2 insertions(+)

diff --git a/tests/igt.py b/tests/igt.py
index 87b61dc..e6d3963 100644
--- a/tests/igt.py
+++ b/tests/igt.py
@@ -122,6 +122,8 @@ class IGTTest(Test):
  self.result.result = 'skip'
  elif self.result.returncode == 78:
  self.result.result = 'timeout'
+elif self.result.returncode == 139:
+self.result.result = 'crash'
  else:
  self.result.result = 'fail'
  


___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH] framework/backends/json: always flush the metadata to the disk

2017-01-30 Thread Martin Peres

On 30/01/17 20:09, Dylan Baker wrote:

Reviewed-by: Dylan Baker 


Thanks Dylan! Just pushed the patch :)
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH] framework/backends/json: always flush the metadata to the disk

2017-01-30 Thread Martin Peres
This guarantees that whatever the state we are in, we can always
continue the piglit run. Do not use FileBackend.__fsync as it would
not do the fsync call in the non-sync mode.

This change makes it easier to integrate into a CI system that is
hard-reboot-resistant.

Signed-off-by: Martin Peres 
---
 framework/backends/json.py | 4 
 1 file changed, 4 insertions(+)

diff --git a/framework/backends/json.py b/framework/backends/json.py
index 55169191d..174c0ca96 100644
--- a/framework/backends/json.py
+++ b/framework/backends/json.py
@@ -108,6 +108,10 @@ class JSONBackend(FileBackend):
 with open(os.path.join(self._dest, 'metadata.json'), 'w') as f:
 json.dump(metadata, f, default=piglit_encoder)
 
+# Flush the metadata to the disk, always
+f.flush()
+os.fsync(f.fileno())
+
 # make the directory for the tests
 try:
 os.mkdir(os.path.join(self._dest, 'tests'))
-- 
2.11.0

___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH] resume: use the previously-set test-list when resuming

2017-01-12 Thread Martin Peres

On 11/01/17 22:24, Dylan Baker wrote:

Reviewed-by: Dylan Baker 


Thanks Dylan! Pushed it!
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH] resume: use the previously-set test-list when resuming

2017-01-11 Thread Martin Peres
Previously, the test-list was not saved when running and resuming a run
would ignore the test-list and execute the entire test set.

This patch tries to follow Dylan's proposal[0].

[0] https://patchwork.freedesktop.org/patch/122189/

Cc: Rami Ben Hassine 
Cc: Olivier Berthier 
Cc: Julian Dumez 
Cc: Dylan Baker 
Reported-by: Rami Ben Hassine 
Signed-off-by: Martin Peres 
---
 framework/programs/run.py | 31 ---
 1 file changed, 20 insertions(+), 11 deletions(-)

diff --git a/framework/programs/run.py b/framework/programs/run.py
index e5d55837a..177bd535c 100644
--- a/framework/programs/run.py
+++ b/framework/programs/run.py
@@ -220,7 +220,7 @@ def _run_parser(input_):
 return parser.parse_args(unparsed)
 
 
-def _create_metadata(args, name):
+def _create_metadata(args, name, forced_test_list):
 """Create and return a metadata dict for Backend.initialize()."""
 opts = dict(options.OPTIONS)
 opts['profile'] = args.test_profile
@@ -232,6 +232,7 @@ def _create_metadata(args, name):
 opts['monitoring'] = args.monitored
 if args.platform:
 opts['platform'] = args.platform
+opts['forced_test_list'] = forced_test_list
 
 metadata = {'options': opts}
 metadata['name'] = name
@@ -308,26 +309,31 @@ def run(input_):
 'Cannot overwrite existing folder without the -o/--overwrite '
 'option being set.')
 
+# If a test list is provided then set the forced_test_list value.
+forced_test_list = None
+if args.test_list:
+if len(args.test_profile) != 1:
+raise exceptions.PiglitFatalError(
+'Unable to force a test list with more than one profile')
+
+with open(args.test_list) as test_list:
+# Strip newlines
+forced_test_list = [t.strip() for t in test_list]
+
 backend = backends.get_backend(args.backend)(
 args.results_path,
 junit_suffix=args.junit_suffix,
 junit_subtests=args.junit_subtests)
 backend.initialize(_create_metadata(
-args, args.name or path.basename(args.results_path)))
+args, args.name or path.basename(args.results_path), forced_test_list))
 
 profiles = [profile.load_test_profile(p) for p in args.test_profile]
 for p in profiles:
 p.results_dir = args.results_path
 
-# If a test list is provided then set the forced_test_list value.
-if args.test_list:
-if len(args.test_profile) != 1:
-raise exceptions.PiglitFatalError(
-'Unable to force a test list with more than one profile')
-
-with open(args.test_list) as test_list:
-# Strip newlines
-profiles[0].forced_test_list = [t.strip() for t in test_list]
+# Set the forced_test_list, if applicable
+if forced_test_list:
+profiles[0].forced_test_list = forced_test_list
 
 # Set the dmesg type
 if args.dmesg:
@@ -424,6 +430,9 @@ def resume(input_):
 p.filters.append(
 profile.RegexFilter(results.options['include_filter']))
 
+if results.options['forced_test_list']:
+p.forced_test_list = results.options['forced_test_list']
+
 # This is resumed, don't bother with time since it won't be accurate anyway
 profile.run(
 profiles,
-- 
2.11.0

___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH] arb_shader_image_size: actually run in the relevant shader stage

2016-07-01 Thread Martin Peres

On 01/07/16 04:29, Ilia Mirkin wrote:

Previously GL_FRAGMENT_SHADER was being hard-coded.

Signed-off-by: Ilia Mirkin 


Hmm, thanks for catching this! The original version checked only on the 
fragment shader, but when I got the exec time reasonable, I added the 
stage and apparently stopped midway...


Reviewed-by: Martin Peres 

---
 tests/spec/arb_shader_image_size/builtin.c | 9 +
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/tests/spec/arb_shader_image_size/builtin.c 
b/tests/spec/arb_shader_image_size/builtin.c
index c8a7724..b728529 100755
--- a/tests/spec/arb_shader_image_size/builtin.c
+++ b/tests/spec/arb_shader_image_size/builtin.c
@@ -133,16 +133,17 @@ check(const struct grid_info grid, struct image_info 
img_src)
 static bool
 run_test(const struct image_format_info *format,
 const struct image_target_info *target,
+const struct image_stage_info *stage,
 const struct image_extent size)
 {
-   const struct grid_info grid = grid_info(GL_FRAGMENT_SHADER, GL_RGBA32I,
+   const struct grid_info grid = grid_info(stage->stage, GL_RGBA32I,
16, 16);
const struct image_info img = {
target, format, size,
image_format_epsilon(grid.format)
};
GLuint prog = generate_program(
-   grid, GL_FRAGMENT_SHADER,
+   grid, stage->stage,
concat(hunk("#extension GL_ARB_shader_image_size : enable\n"),
   image_hunk(img, ""),
   hunk("readonly IMAGE_UNIFORM_T src_img;\n"
@@ -261,7 +262,7 @@ test_max_dimensions(const struct image_format_info *format,
continue;

subtest(status, true,
-   run_test(format, target, size),
+   run_test(format, target, stage, size),
"%s/%s/image%s max size test/%dx%dx%dx%d",
format->name, stage->name, target->name,
size.x, size.y, size.z, size.w);
@@ -285,7 +286,7 @@ test_small_dimensions(const struct image_format_info 
*format,
return;

subtest(status, true,
-   run_test(format, target, size),
+   run_test(format, target, stage, size),
"%s/%s/image%s size test/%dx%dx%dx%d",
format->name, stage->name, target->name,
size.x, size.y, size.z, size.w);


___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH 0/6] make gen_vs_in_fp64 run faster

2016-06-10 Thread Martin Peres

On 09/06/16 19:50, Dylan Baker wrote:

Quoting Andres Gomez (2016-06-09 06:45:49)

Nice optimizations, Dylan.

I'm quite impressed/surprised on the gain through avoiding the
inheritance/include mechanisms in the mako templates.

This series is:

Reviewed-by: Andres Gomez 

Andres


I was definitely surprised too, I assumed glancing over the code that
calling list on the generators was the big bottleneck.

Thanks for your review.

Dylan



I really recommend SnakeViz for debugging this kind of issues, it is 
really doing a nice job :)

https://jiffyclub.github.io/snakeviz/
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH 0/3] Fix some program input / output issues with ARB_piq

2016-05-27 Thread Martin Peres



On 26/05/16 21:56, Ian Romanick wrote:

On 05/26/2016 11:55 AM, Ian Romanick wrote:

On 05/26/2016 08:01 AM, Martin Peres wrote:

On 26/05/16 01:36, Ian Romanick wrote:

After spending about a week with dEQP, GL_OES_shader_io_blocks, and
GL_OES_geometry_shader, I believe there are some errors with the
expectations of our existing ARB_piq tests.  I have included spec
justifications for the changes, and the changes match tests that I have
seen in dEQP.

I would really like to know the before / after results of the updated
test on modern NVIDIA and AMD closed-source drivers.


Thanks for doing this! Here are the result on GeForce GT 430/PCIe/SSE2,
NVIDIA 355.11

$ ./piglit summary console -d before/ after
spec/arb_program_interface_query/arb_program_interface_query-resource-query/GL_PROGRAM_INPUT(gs):
pass fail
spec/arb_program_interface_query/arb_program_interface_query-resource-query/GL_PROGRAM_INPUT(gs,fs):
pass fail
spec/arb_program_interface_query/arb_program_interface_query-resource-query/GL_PROGRAM_INPUT(tcs):
pass fail
spec/arb_program_interface_query/arb_program_interface_query-resource-query/GL_PROGRAM_INPUT(tcs,tes):
pass fail
spec/arb_program_interface_query/arb_program_interface_query-resource-query/GL_PROGRAM_INPUT(tes):
pass fail


Interesting... is it just that they don't have gl_PerVertex on things,
or is the arrayness also different?  I want to put proper annotations in
the commit messages.


If you want to just send the output of "after"
'bin/arb_program_interface_query-resource-query -auto' on that system, I
should be able to figure out what to put in the commit message.



Sorry for the delay, I was already home when I saw your email. Here it is:

bin/arb_program_interface_query-resource-query -auto -fbo
PIGLIT: {"subtest": {"GL_UNIFORM(vs,gs,fs)" : "pass"}}
PIGLIT: {"subtest": {"GL_UNIFORM(tes,tcs)" : "pass"}}
PIGLIT: {"subtest": {"GL_UNIFORM(cs)" : "pass"}}
PIGLIT: {"subtest": {"GL_UNIFORM_BLOCK(vs,gs,fs)" : "pass"}}
PIGLIT: {"subtest": {"GL_UNIFORM_BLOCK(tcs,tes)" : "pass"}}
PIGLIT: {"subtest": {"GL_UNIFORM_BLOCK(cs)" : "pass"}}
PIGLIT: {"subtest": {"GL_PROGRAM_INPUT(vs)" : "pass"}}
'GL_PROGRAM_INPUT(gs) max length name' expected 25 but got 12
PIGLIT: {"subtest": {"GL_PROGRAM_INPUT(gs)" : "fail"}}
PIGLIT: {"subtest": {"GL_PROGRAM_INPUT(fs)" : "pass"}}
PIGLIT: {"subtest": {"GL_PROGRAM_INPUT(vs,fs)" : "pass"}}
PIGLIT: {"subtest": {"GL_PROGRAM_INPUT(vs,gs)" : "pass"}}
'GL_PROGRAM_INPUT(gs,fs) max length name' expected 25 but got 12
PIGLIT: {"subtest": {"GL_PROGRAM_INPUT(gs,fs)" : "fail"}}
PIGLIT: {"subtest": {"GL_PROGRAM_INPUT(vs,gs,fs)" : "pass"}}
'GL_PROGRAM_INPUT(tes) max length name' expected 25 but got 12
PIGLIT: {"subtest": {"GL_PROGRAM_INPUT(tes)" : "fail"}}
'GL_PROGRAM_INPUT(tcs) active resources' expected 3 but got 2
'GL_PROGRAM_INPUT(tcs) max length name' expected 25 but got 12
PIGLIT: {"subtest": {"GL_PROGRAM_INPUT(tcs)" : "fail"}}
'GL_PROGRAM_INPUT(tcs,tes) active resources' expected 3 but got 2
'GL_PROGRAM_INPUT(tcs,tes) max length name' expected 25 but got 12
PIGLIT: {"subtest": {"GL_PROGRAM_INPUT(tcs,tes)" : "fail"}}
PIGLIT: {"subtest": {"GL_PROGRAM_INPUT(vs,tcs,tes)" : "pass"}}
PIGLIT: {"subtest": {"GL_PROGRAM_INPUT(cs)" : "pass"}}
PIGLIT: {"subtest": {"GL_PROGRAM_OUTPUT(vs)" : "pass"}}
PIGLIT: {"subtest": {"GL_PROGRAM_OUTPUT(gs)" : "pass"}}
PIGLIT: {"subtest": {"GL_PROGRAM_OUTPUT(fs)" : "pass"}}
PIGLIT: {"subtest": {"GL_PROGRAM_OUTPUT(vs,fs)" : "pass"}}
PIGLIT: {"subtest": {"GL_PROGRAM_OUTPUT(vs,gs)" : "pass"}}
PIGLIT: {"subtest": {"GL_PROGRAM_OUTPUT(gs,fs)" : "pass"}}
PIGLIT: {"subtest": {"GL_PROGRAM_OUTPUT(vs,gs,fs)" : "pass"}}
PIGLIT: {"subtest": {"GL_PROGRAM_OUTPUT(tes)" : "pass"}}
'GL_PROGRAM_OUTPUT(tcs) active resources' expected 3 but got 2
'GL_PROGRAM_OUTPUT(tcs) max length name' expected 25 but got 12
PIGLIT: {"subtest": {"GL_PROGRAM_OUTPUT(tcs)" : "fail"}}
PIGLIT: {"subtest": {"GL_PROGRAM_OUTPUT(tcs,tes)" : "pass"}}
PIGLIT: {"subtest": {"GL_PROGRAM_OUTPUT(tcs,tes,gs)" : "pass"}}
PIGLIT

Re: [Piglit] [PATCH 3/3] arb_program_interface_query: Fix TCS input expectations

2016-05-26 Thread Martin Peres

On 26/05/16 01:36, Ian Romanick wrote:

From: Ian Romanick 

Section 7.1 (Built-In Language Variables) of the GLSL 4.00 spec says:

   In the tessellation control language, built-in variables are
   intrinsically declared as:

   in gl_PerVertex {
  vec4 gl_Position;
  float gl_PointSize;
  float gl_ClipDistance[];
   } gl_in[gl_MaxPatchVertices];

   in int gl_PatchVerticesIn;
   in int gl_PrimitiveID;
   in int gl_InvocationID;

Since gl_PointSize, gl_ClipDistance[], gl_PatchVerticesIn, and
gl_PrimitiveID are not used, they are eliminated.


You are right, I should not mandate for them to be available since the 
compiler should be free to get rid of them even if I use SSO as they are 
merely inputs.


Reviewed-by: Martin Peres 



Signed-off-by: Ian Romanick 
Cc: Martin Peres 
Cc: Dave Airlie 
---
 .../arb_program_interface_query/resource-query.c   | 23 +++---
 1 file changed, 7 insertions(+), 16 deletions(-)

diff --git a/tests/spec/arb_program_interface_query/resource-query.c 
b/tests/spec/arb_program_interface_query/resource-query.c
index d16c092..c4d190c 100755
--- a/tests/spec/arb_program_interface_query/resource-query.c
+++ b/tests/spec/arb_program_interface_query/resource-query.c
@@ -211,25 +211,16 @@ static const char *st_r_in_vs[] = {"vs_input0", 
"vs_input1", NULL};
 static const char *st_r_in_gs[] = {"gs_input[0]", "gl_PerVertex.gl_Position", 
NULL};
 static const char *st_r_in_fs[] = {"fs_input1", NULL};
 static const char *st_r_in_tes[] = {"tes_input[0]", 
"gl_PerVertex.gl_Position", NULL};
-static const char *st_r_in_tcs[] = {"tcs_input[0]", 
"gl_PerVertex.gl_Position", NULL};
+static const char *st_r_in_tcs[] = {"tcs_input[0]",
+   "gl_InvocationID",
+   "gl_PerVertex.gl_Position",
+   NULL};
 static const char *st_r_out_vs[] = {"gl_Position", NULL};
 static const char *st_r_out_gs[] = {"gs_output0", "gl_Position", NULL};
 static const char *st_r_out_fs[] = {"fs_output0", "fs_output1", NULL};
 static const char *st_r_out_tes[] = {"tes_output[0]", "gl_Position", NULL};
 static const char *st_r_out_tcs[] = {"tcs_output[0]", "tcs_patch",
 "gl_PerVertex.gl_Position",
-"gl_PerVertex.gl_BackColor",
-"gl_PerVertex.gl_BackSecondaryColor",
-"gl_PerVertex.gl_ClipDistance[0]",
-"gl_PerVertex.gl_CullDistance[0]",
-"gl_PerVertex.gl_FogFragCoord",
-"gl_PerVertex.gl_FrontColor",
-"gl_PerVertex.gl_FrontSecondaryColor",
-"gl_PerVertex.gl_Layer",
-"gl_PerVertex.gl_PointSize",
-"gl_PerVertex.gl_TexCoord[0]",
-"gl_PerVertex.gl_ViewportIndex",
-"gl_PerVertex.gl_ViewportMask[0]",
 NULL};
 static const char *st_r_buffer[] = {"vs_buf_var", "gs_buf_var", "fs_buf_var",
NULL};
@@ -375,8 +366,8 @@ static const struct subtest_t subtests[] = {
  ST( 2, 25, -1, -1,NULL,NULL,NULL,  gs_std,  fs_std,   NULL, 
GL_PROGRAM_INPUT, "(gs,fs)", st_r_in_gs),
  ST( 2, 10, -1, -1,  vs_std,NULL,NULL,  gs_std,  fs_std,   NULL, 
GL_PROGRAM_INPUT, "(vs,gs,fs)", st_r_in_vs),
  ST( 2, 25, -1, -1,NULL,NULL, tes_sub,NULL,NULL,   NULL, 
GL_PROGRAM_INPUT, "(tes)", st_r_in_tes),
- ST( 2, 25, -1, -1,NULL, tcs_sub,NULL,NULL,NULL,   NULL, 
GL_PROGRAM_INPUT, "(tcs)", st_r_in_tcs),
- ST( 2, 25, -1, -1,NULL, tcs_sub, tes_sub,NULL,NULL,   NULL, 
GL_PROGRAM_INPUT, "(tcs,tes)", st_r_in_tcs),
+ ST( 3, 25, -1, -1,NULL, tcs_sub,NULL,NULL,NULL,   NULL, 
GL_PROGRAM_INPUT, "(tcs)", st_r_in_tcs),
+ ST( 3, 25, -1, -1,NULL, tcs_sub, tes_sub,NULL,NULL,   NULL, 
GL_PROGRAM_INPUT, "(tcs,tes)", st_r_in_tcs),
  ST( 2, 10, -1, -1,  vs_std, tcs_sub, tes_sub,NULL,NULL,   NULL, 
GL_PROGRAM_INPUT, "(vs,tcs,tes)", st_r_in_vs),
  ST( 0,  0, -1, -1,NULL,NULL,NULL,NULL,NULL, cs_sub, 
GL_PROGRAM_INPUT, "(cs)", NULL),
  ST( 1, 12, -1, -1,  vs_std,NULL,NULL,NULL,NULL,   NULL, 
GL_PROGRAM_OUTPUT, "(vs)", st_r_out_vs),
@@ -387,7

Re: [Piglit] [PATCH 2/3] arb_program_interface_query: Expect array suffixes on array inputs / outputs

2016-05-26 Thread Martin Peres

On 26/05/16 01:36, Ian Romanick wrote:

From: Ian Romanick 

The ARB_program_interface_query spec says:

   * For an active variable declared as an array of basic types, a single
 entry will be generated, with its name string formed by concatenating
 the name of the array and the string "[0]".

I can find no language that implies that geometry or tessellation inputs
or tessellation control outputs should be excluded from this rule.
Various dEQP tests also expect [0] be added to geometry shader inputs.

Signed-off-by: Ian Romanick 
Cc: Martin Peres 
Cc: Dave Airlie 


I remember discussing with Tapani (Cc:ed) about this, but honestly it 
escaped me and I would trust draw elements more than my memory on this!


In any case, I am all for not making a special case for geometry or 
tesselation.


Reviewed-by: Martin Peres 
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH 1/3] arb_program_interface_query: Expect certain built-ins be prefixed with gl_PerVertex

2016-05-26 Thread Martin Peres

On 26/05/16 01:36, Ian Romanick wrote:

From: Ian Romanick 

The ARB_program_interface_query spec says:

   Issues:

   (16) How are inputs and outputs in the built-in interface block
"gl_PerVertex" enumerated?

...

 For tessellation control, tessellation evaluation, and geometry shaders,
 per-vertex built-in inputs like gl_Position are in a block with an
 instance name of "gl_in[]".  Additionally, for tessellation control
 shaders, per-vertex built-in outputs like gl_Position are in a block
 with an instance name of "gl_out[]".  In these cases, applying the
 standard rules would result in an enumerated name of
 "gl_PerVertex.gl_Position".

Signed-off-by: Ian Romanick 
Cc: Martin Peres 
Cc: Dave Airlie 


Well, this issue indeed seems clear-enough, thanks for fixing it!

Reviewed-by: Martin Peres 
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH 0/3] Fix some program input / output issues with ARB_piq

2016-05-26 Thread Martin Peres

On 26/05/16 01:36, Ian Romanick wrote:

After spending about a week with dEQP, GL_OES_shader_io_blocks, and
GL_OES_geometry_shader, I believe there are some errors with the
expectations of our existing ARB_piq tests.  I have included spec
justifications for the changes, and the changes match tests that I have
seen in dEQP.

I would really like to know the before / after results of the updated
test on modern NVIDIA and AMD closed-source drivers.


Thanks for doing this! Here are the result on GeForce GT 430/PCIe/SSE2, 
NVIDIA 355.11


$ ./piglit summary console -d before/ after
spec/arb_program_interface_query/arb_program_interface_query-resource-query/GL_PROGRAM_INPUT(gs): 
pass fail
spec/arb_program_interface_query/arb_program_interface_query-resource-query/GL_PROGRAM_INPUT(gs,fs): 
pass fail
spec/arb_program_interface_query/arb_program_interface_query-resource-query/GL_PROGRAM_INPUT(tcs): 
pass fail
spec/arb_program_interface_query/arb_program_interface_query-resource-query/GL_PROGRAM_INPUT(tcs,tes): 
pass fail
spec/arb_program_interface_query/arb_program_interface_query-resource-query/GL_PROGRAM_INPUT(tes): 
pass fail


Martin
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH v2] glx_arb_sync_control/wait_for_msc: Add a missing timeout

2016-04-25 Thread Martin Peres

On 20/04/16 14:58, Lofstedt, Marta wrote:




-Original Message-
From: Martin Peres [mailto:martin.pe...@linux.intel.com]
Sent: Wednesday, April 20, 2016 12:30 PM
To: Marta Lofstedt ;
piglit@lists.freedesktop.org
Cc: Lofstedt, Marta 
Subject: Re: [PATCH v2] glx_arb_sync_control/wait_for_msc: Add a missing
timeout

On 19/04/16 11:51, Marta Lofstedt wrote:

From: Marta Lofstedt 

This test requests via GLX to wait until a certain vertical retrace
event (based on the Media Stream Counter, AKA MSC) before being
unblocked by the X-Server. Since there can be bugs in the
implementation, it is possible for the test to not terminate.
Re-enforcing this idea is that all the other glx_arb_sync_control
tests already have a timeout set.

This change adds a timeout to guard against this case and report a failure.

V2: Only added timeout to waitformsc and updated commit message.

Signed-off-by: Marta Lofstedt 


Thanks! Looks good now :)

Reviewed-by: Martin Peres 

I will push it tomorrow!



Thanks Martin!


Pushed:
To ssh://mpe...@git.freedesktop.org/git/piglit
   8e08a5c..8d6a864  master -> master

Sorry for the delay!
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH v2] glx_arb_sync_control/wait_for_msc: Add a missing timeout

2016-04-20 Thread Martin Peres

On 19/04/16 11:51, Marta Lofstedt wrote:

From: Marta Lofstedt 

This test requests via GLX to wait until a certain vertical retrace
event (based on the Media Stream Counter, AKA MSC) before being
unblocked by the X-Server. Since there can be bugs in the
implementation, it is possible for the test to not terminate.
Re-enforcing this idea is that all the other glx_arb_sync_control
tests already have a timeout set.

This change adds a timeout to guard against this case and report a failure.

V2: Only added timeout to waitformsc and updated commit message.

Signed-off-by: Marta Lofstedt 


Thanks! Looks good now :)

Reviewed-by: Martin Peres 

I will push it tomorrow!


---
  tests/spec/glx_oml_sync_control/waitformsc.c | 2 ++
  1 file changed, 2 insertions(+)

diff --git a/tests/spec/glx_oml_sync_control/waitformsc.c 
b/tests/spec/glx_oml_sync_control/waitformsc.c
index 3d08dbc..86c5b25 100644
--- a/tests/spec/glx_oml_sync_control/waitformsc.c
+++ b/tests/spec/glx_oml_sync_control/waitformsc.c
@@ -49,6 +49,8 @@ draw(Display *dpy)
int64_t target_msc;
bool already_wrapped = false;

+   piglit_set_timeout(5, PIGLIT_FAIL);
+
  wrap:
glXGetSyncValuesOML(dpy, win, &start_ust, &start_msc, &start_sbc);



___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH] glx_arb_sync_control: Add timeout

2016-04-18 Thread Martin Peres

On 18/04/16 13:22, Marta Lofstedt wrote:

From: Marta Lofstedt 

The glx_arb_sync_control piglit tests should fail after a
timeout expired, instead of not terminating.

Signed-off-by: Marta Lofstedt 


All the files in tests/spec/glx_oml_sync_control/ already have this 
timeout ... except one, waitformsc.c. Since each test may have a 
different run time, I would rather want to keep it that way, to avoid 
surprises. How about adding the timeout in waitformsc.c:52?


Other than that, the commit message is a bit strange though. How about this?

--

glx_arb_sync_control/wait_for_msc: Add a missing timeout

This test requests via GLX to wait until a certain vertical retrace 
event (based on the Media Stream Counter, AKA MSC) before being 
unblocked by the X-Server. Since there can be bugs in the 
implementation, it is possible for the test to hang. Re-enforcing this 
idea is that all the other glx_arb_sync_control tests already have a 
timeout set.


This change adds a timeout to guard against this case and report a failure.

___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH v2] arb_program_interface_query: Silence uninitialized variable warning.

2015-12-03 Thread Martin Peres

On 02/12/15 01:38, Brian Paul wrote:

On 12/01/2015 04:18 PM, Vinson Lee wrote:

Fixes Coverity "uninitialized scalar variable" defect.

Signed-off-by: Vinson Lee 
---
v2 - Updated after Brian Paul's comments.

  tests/spec/arb_program_interface_query/getprogramresourceiv.c | 6 
++

  1 file changed, 6 insertions(+)

diff --git 
a/tests/spec/arb_program_interface_query/getprogramresourceiv.c 
b/tests/spec/arb_program_interface_query/getprogramresourceiv.c

index 769e29f..e8e917f 100755
--- a/tests/spec/arb_program_interface_query/getprogramresourceiv.c
+++ b/tests/spec/arb_program_interface_query/getprogramresourceiv.c
@@ -668,6 +668,9 @@ check_prop(GLuint prog, GLenum programInterface, 
int index, const char *name,

  case GL_BUFFER_VARIABLE:
  pif = GL_SHADER_STORAGE_BLOCK;
  break;
+default:
+assert(!"unexpected programInterface value");
+pif = GL_NONE;
  }

  parent_idx = glGetProgramResourceIndex(prog, pif,
@@ -739,6 +742,9 @@ check_prop(GLuint prog, GLenum programInterface, 
int index, const char *name,

  case GL_COMPUTE_SUBROUTINE_UNIFORM:
  pif = GL_COMPUTE_SUBROUTINE;
  break;
+default:
+assert(!"unexpected programInterface value");
+pif = GL_NONE;
  }

  /* check that the return count is as expected */



Reviewed-by: Brian Paul 


Thanks for doing this!

Reviewed-by: Martin Peres 
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH][RFC] Add dmesg option for reboot policy

2015-11-24 Thread Martin Peres

On 24/11/15 07:09, Dylan Baker wrote:

On Mon, Nov 23, 2015 at 08:54:46PM -0500, Ilia Mirkin wrote:

On Mon, Nov 23, 2015 at 8:41 PM, Dylan Baker  wrote:

On Mon, Nov 23, 2015 at 08:24:22PM -0500, Ilia Mirkin wrote:

On Mon, Nov 23, 2015 at 8:07 PM, Dylan Baker  wrote:

On Mon, Nov 23, 2015 at 02:48:35PM +0200, Martin Peres wrote:

On 02/11/15 16:57, yann.argo...@linux.intel.com wrote:

This adds a policy which advises when user should reboot system to avoid
noisy test results due to system becoming unstable, for instance, and
therefore continues testing successfully.
To do this, a new Dmesg class is proposed which is not filtering dmesg and
monitors whether or not one of the following event occurs:
- gpu reset failed (not just gpu reset happened, that happens way too
often and many tests even provoke hangs intentionally)
- gpu crash,
- Oops:
- BUG
- lockdep splat that causes the locking validator to get disabled
If one of these issues happen, piglit test execution is stopped
-terminating test thread pool- and exit with code 3 to inform that reboot
is advised.
Then test execution resume, after rebooting system or not, is done like
usually with command line parameter "resume".

To call it, use command line parameter: --dmesg monitored

Hello Yann,

The rationale behind this patch is very sound and we need something like
this. Here are however a list of nitpicks:

  - Please send patches with git send-email, otherwise, it makes it
impossible for us to comment inline which is the usual process for patch
review. Please re-send :)

- varaiable -> variable; double space after "when a reboot may be required"

  - I am not a big fan of changing the semantic of arguments that have been
there forever. Can you think of a case where the user would not want the
test to abort if we reach a state where we cannot trust the result? I am
including Dylan on this. Also, if we are to keep these modes, can we rename
the "simple" mode to "warning" and "monitored" to "abort"? This would make
more sense and clearly state the goal of the modes.

Ilia, Daniel, Thomas, Glenn, I know that y'all use the dmesg support.
What do you think?

Can you provide a summary of what this patch does? It was submitted as
an attachment, so I can't (easily) look at it... either way, as long
as running with --dmesg doesn't break, I probably don't care. I use
--dmesg to know which tests cause the GPU to complain, which I then,
in turn, use to pick which tests to debug further. (And since I
normally run with -1 anyways, it's ~free to add...)

   -ilia

I'm going to interpret that as "I'd be annoyed if piglit just stopped
when there was dmesg chatter"?

That would definitely be a deal breaker. My wifi goes in and out and
complains loudly about it in dmesg :)


That should not happen since it will wait for specific events in dmesg 
for this (gpu reset failed, gpu crash, oops. bug and lockdep splat).

What does your wifi driver produce?



   -ilia

I think that answers that question Martin.

I would lean towards adding a "--dmesg-abort" (or whatever name) flag to
be passed in addition to --dmesg when the user wants to stop on dmesg
errors.


I would personally say that we should not call it dmesg at all and just 
use whatever information we have to detect when we need to abort. So, 
something like --abort-on-critical-error would make more sense and would 
not be misleading the users into thinking it is solely using dmesg as an 
input.


However, I'd really like to see the patch come in with git-send-email so
I can have a proper look at it.


Agreed.

Martin
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH][RFC] Add dmesg option for reboot policy

2015-11-23 Thread Martin Peres

On 02/11/15 16:57, yann.argo...@linux.intel.com wrote:

This adds a policy which advises when user should reboot system to avoid
noisy test results due to system becoming unstable, for instance, and
therefore continues testing successfully.
To do this, a new Dmesg class is proposed which is not filtering dmesg and
monitors whether or not one of the following event occurs:
- gpu reset failed (not just gpu reset happened, that happens way too
often and many tests even provoke hangs intentionally)
- gpu crash,
- Oops:
- BUG
- lockdep splat that causes the locking validator to get disabled
If one of these issues happen, piglit test execution is stopped
-terminating test thread pool- and exit with code 3 to inform that reboot
is advised.
Then test execution resume, after rebooting system or not, is done like
usually with command line parameter "resume".

To call it, use command line parameter: --dmesg monitored


Hello Yann,

The rationale behind this patch is very sound and we need something like 
this. Here are however a list of nitpicks:


 - Please send patches with git send-email, otherwise, it makes it 
impossible for us to comment inline which is the usual process for patch 
review. Please re-send :)


- varaiable -> variable; double space after "when a reboot may be required"

 - I am not a big fan of changing the semantic of arguments that have 
been there forever. Can you think of a case where the user would not 
want the test to abort if we reach a state where we cannot trust the 
result? I am including Dylan on this. Also, if we are to keep these 
modes, can we rename the "simple" mode to "warning" and "monitored" to 
"abort"? This would make more sense and clearly state the goal of the 
modes.


 - I see a potential issue with the dmesg-monitoring class, it can 
generate false positives. Indeed, it completely ignores the fact that 
there may be more than one GPU installed and that it may come from a 
different vendor. It would be good to know which gpu the test got run on 
and only track this gpu for bugs. This is however a complex task and 
would require env_dump to be done properly. I guess we could pass an 
argument to env_dump to track the gpu-vendor-dependent codepath and 
leave the general cases (Oops, BUG and lockdep) up to python. Anyway, 
better safe than sorry in the mean time!


 - I am not a big fan of using dmesg to get information out of the 
kernel because the output format may change. How about listening for 
udev events coming from the gpu or reading i915_error_state/i915_wedged ?


That's it for the first round :)

Thanks for the proposal!
Martin
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH v2] winsys-framework Default to showing window

2015-11-19 Thread Martin Peres


On 17/11/15 22:01, Dave Airlie wrote:

On 18 November 2015 at 05:49, Arthur Huillet  wrote:

Thanks :)

Reviewed by: Arthur Huillet 

Reviewed-by: Dave Airlie 


Pushed
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH] winsys-framework Default to showing window

2015-11-17 Thread Martin Peres

On 09/11/15 05:19, Dave Airlie wrote:

On 21 August 2015 at 22:08, Marek Olšák  wrote:

Hi Alex,

The tests which don't specifically test the behavior of the default
framebuffer should use -fbo. I think this is done by marking a test as
"concurrent" in all.py. A lot of tests don't do that, because nobody
had the time to update all.py and check if it doesn't break them and
if it's okay to do that with regard to the purpose of the tests. (i.e.
do they specifically test the default framebuffer or something else?)


Just FYI classic swrast suffers from this issue, and since I added front buffer
support to softpipe/llvmpipe they now also.

We try to call XGetImage when no window has been mapped, and the X server
correctly throws BadMatch. I'm not sure how to detect this is going to
fail in this
case, as I don't think inside libGL I can detect the unmapped front buffer.

Dave.


Dave, since you see a problem on swrast too, are you willing to give 
your R-b on this change?


I guess this will force us to spend time on moving tests to using fbo, 
to speed things up and be less annoying, but we should not rely on 
unspecified behaviour anyway...


Martin
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] Patchwork

2015-11-11 Thread Martin Peres

On 10/11/15 21:52, Dylan Baker wrote:

Hi ladies and gents,

I've just finished (mostly) cleaning up patchwork, removing tests that
have been superseded, rejected, sent to the wrong list, etc.

We now have four pages of patches for review that are outstanding, some
as far back as 2013, and some for features we have no tests for
currently.

Some of these patches are reviewed (although they may require some
rebasing).

https://patchwork.freedesktop.org/project/piglit/patches/?page=1

Thanks a lot Dylan!

I will have a look at the ones from Laura for DSA in the coming month.
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH 06/15] arb_direct_state_access: Testing CopyNamedBufferSubData.

2015-11-02 Thread Martin Peres

On 01/11/15 03:15, Ilia Mirkin wrote:

What happened here? There are no references to NamedBuffer* in piglit.


Darn it, the series indeed never landed... Laura, can you remember why?
Was it only due to the shortage of time before moving on to another project?

In any case, I should have followed up on this :s

Martin



On Wed, Apr 1, 2015 at 7:52 AM, Martin Peres
 wrote:

On 23/01/15 21:03, Laura Ekstrand wrote:

---
   tests/spec/arb_direct_state_access/namedbufferstorage.c | 7 +--
   1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/tests/spec/arb_direct_state_access/namedbufferstorage.c
b/tests/spec/arb_direct_state_access/namedbufferstorage.c
index 6630467..c68bc27 100644
--- a/tests/spec/arb_direct_state_access/namedbufferstorage.c
+++ b/tests/spec/arb_direct_state_access/namedbufferstorage.c
@@ -218,15 +218,10 @@ read_subtest(GLboolean coherent, GLboolean
client_storage)
 glClear(GL_COLOR_BUFFER_BIT);
 glCreateBuffers(1, &srcbuf);
 glNamedBufferData(srcbuf, BUF_SIZE, array, GL_STATIC_DRAW);
-   glBindBuffer(GL_COPY_READ_BUFFER, srcbuf);
 /* Copy some data to the mapped buffer and check if the CPU can
see it. */
-   glBindBuffer(GL_COPY_WRITE_BUFFER, buffer);
-   glCopyBufferSubData(GL_COPY_READ_BUFFER, GL_COPY_WRITE_BUFFER,
-   0, 0, BUF_SIZE);
+   glCopyNamedBufferSubData(srcbuf, buffer, 0, 0, BUF_SIZE);
   - glBindBuffer(GL_COPY_READ_BUFFER, 0);
-   glBindBuffer(GL_COPY_WRITE_BUFFER, 0);
 glDeleteBuffers(1, &srcbuf);
 if (!coherent)

Same as patch 4.

___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH 3/4] arb_shader_image_size/builtin: test all the image formats

2015-08-24 Thread Martin Peres
This patch introduces the concept of stage and image format of interest in
order to reduce the number of subtests actually being tested.

The quick mode's behaviour is unchanged while we also introduce the slow mode
that forces running the tests over all the image formats and stages.

The slow mode takes 6.5 minutes on a Fermi with the NVIDIA proprietary driver
while the normal execution time is around 1 second.

Signed-off-by: Martin Peres 
---
 tests/spec/arb_shader_image_size/builtin.c | 87 +++---
 1 file changed, 68 insertions(+), 19 deletions(-)

diff --git a/tests/spec/arb_shader_image_size/builtin.c 
b/tests/spec/arb_shader_image_size/builtin.c
index 48a1d1e..854e2b3 100755
--- a/tests/spec/arb_shader_image_size/builtin.c
+++ b/tests/spec/arb_shader_image_size/builtin.c
@@ -131,13 +131,14 @@ check(const struct grid_info grid, struct image_info 
img_src)
 }
 
 static bool
-run_test(const struct image_target_info *target,
+run_test(const struct image_format_info *format,
+const struct image_target_info *target,
 const struct image_extent size)
 {
const struct grid_info grid = grid_info(GL_FRAGMENT_SHADER, GL_RGBA32I,
16, 16);
const struct image_info img = {
-   target, grid.format, size,
+   target, format, size,
image_format_epsilon(grid.format)
};
GLuint prog = generate_program(
@@ -208,14 +209,72 @@ is_test_reasonable(bool quick, const struct image_extent 
size)
return product(size) < (quick ? 4 : 64) * 1024 * 1024;
 }
 
+static bool
+is_format_interesting(const struct image_format_info *format, bool override)
+{
+   switch(format->format)
+   {
+   case GL_RGBA32F:
+   case GL_RGBA16F:
+   case GL_RGBA32I:
+   case GL_RGBA16I:
+   case GL_RGBA8I:
+   case GL_RGBA32UI:
+   case GL_RGBA16UI:
+   case GL_RGBA8UI:
+   return true;
+   default:
+   return override;
+   }
+}
+
+static bool
+is_stage_interesting(const struct image_stage_info *stage, bool override)
+{
+   switch(stage->stage)
+   {
+   case GL_FRAGMENT_SHADER:
+   case GL_COMPUTE_SHADER:
+   return true;
+   default:
+   return override;
+   }
+}
+
+static void
+test_max_dimensions(const struct image_format_info *format,
+   const struct image_target_info *target,
+   const struct image_stage_info *stage,
+   enum piglit_result *status,
+   bool quick, bool slow)
+{
+   int d;
+   for (d = 0; d < 4; ++d) {
+   if (should_test_dimension(target, d)) {
+   const struct image_extent size =
+   get_test_extent(target, d);
+
+   subtest(status,
+   is_test_reasonable(quick, size) &&
+   is_format_interesting(format, slow) &&
+   is_stage_interesting(stage, slow),
+   run_test(format, target, size),
+   "%s/%s/image%s max size test/%dx%dx%dx%d",
+   format->name, stage->name, target->name,
+   size.x, size.y, size.z, size.w);
+   }
+   }
+}
+
 void
 piglit_init(int argc, char **argv)
 {
const bool quick = (argc >= 2 && !strcmp(argv[1], "--quick"));
+   const bool slow = (argc >= 2 && !strcmp(argv[1], "--slow"));
enum piglit_result status = PIGLIT_PASS;
+   const struct image_format_info *format;
const struct image_target_info *target;
const struct image_stage_info *stage;
-   int d;
 
/* The spec of the extension says we should require GL 4.2 but let's
 * just request GL_ARB_shader_image_size which will in turn require
@@ -223,22 +282,12 @@ piglit_init(int argc, char **argv)
 */
piglit_require_extension("GL_ARB_shader_image_size");
 
-
-   for (stage = image_stages(); stage->stage; ++stage) {
-   for (target = image_targets(); target->name; ++target) {
-   for (d = 0; d < 4; ++d) {
-   if (should_test_dimension(target, d)) {
-   const struct image_extent size =
-   get_test_extent(target, d);
-
-   subtest(&status,
-   is_test_reasonable(quick, size),
-   run_test(target, size),
-   "%s/image%s max size test/"
-   "%dx%dx%dx%d", sta

[Piglit] [PATCH 2/4] arb_shader_image_load_store/common: handle uploading non-32-bits buffer_texture images

2015-08-24 Thread Martin Peres
Signed-off-by: Martin Peres 
---
 tests/spec/arb_shader_image_load_store/common.c |  2 +-
 tests/spec/arb_shader_image_load_store/image.c  | 10 --
 tests/spec/arb_shader_image_load_store/image.h  |  6 ++
 3 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/tests/spec/arb_shader_image_load_store/common.c 
b/tests/spec/arb_shader_image_load_store/common.c
index 88b0f75..3e56c22 100644
--- a/tests/spec/arb_shader_image_load_store/common.c
+++ b/tests/spec/arb_shader_image_load_store/common.c
@@ -215,7 +215,7 @@ upload_image_levels(const struct image_info img, unsigned 
num_levels,
 glGenBuffers(1, &buffers[unit]);
 glBindBuffer(GL_PIXEL_PACK_BUFFER, buffers[unit]);
 glBufferData(GL_PIXEL_PACK_BUFFER,
- m * img.size.x * sizeof(uint32_t),
+ img.size.x * image_pixel_size(img.format) / 8,
  NULL, GL_STATIC_DRAW);
 
 glGenTextures(1, &packed_tex);
diff --git a/tests/spec/arb_shader_image_load_store/image.c 
b/tests/spec/arb_shader_image_load_store/image.c
index 7a1867f..9bf7f7f 100644
--- a/tests/spec/arb_shader_image_load_store/image.c
+++ b/tests/spec/arb_shader_image_load_store/image.c
@@ -207,11 +207,17 @@ image_type_name(const struct image_format_info *format)
 return get_image_type(format)->image_type_name;
 }
 
+unsigned int
+image_pixel_size(const struct image_format_info *format)
+{
+return format->bits[0] + format->bits[1] +
+   format->bits[2] + format->bits[3];
+}
+
 GLenum
 image_compat_format(const struct image_format_info *format)
 {
-const unsigned bits = (format->bits[0] + format->bits[1] +
-   format->bits[2] + format->bits[3]);
+const unsigned bits = image_pixel_size(format);
 
 switch (bits) {
 case 128:
diff --git a/tests/spec/arb_shader_image_load_store/image.h 
b/tests/spec/arb_shader_image_load_store/image.h
index fc43f22..d712f93 100644
--- a/tests/spec/arb_shader_image_load_store/image.h
+++ b/tests/spec/arb_shader_image_load_store/image.h
@@ -156,6 +156,12 @@ const char *
 image_type_name(const struct image_format_info *format);
 
 /**
+ * Get the size in bits of one pixel in the specified format.
+ */
+unsigned int
+image_pixel_size(const struct image_format_info *format);
+
+/**
  * Get a compatible unsigned integer format of the same size.
  */
 GLenum
-- 
2.5.0

___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH 1/4] arb_shader_image_size/builtin: Fix the CubeMap image test

2015-08-24 Thread Martin Peres
Signed-off-by: Martin Peres 
---
 tests/spec/arb_shader_image_size/builtin.c | 9 +
 1 file changed, 9 insertions(+)

diff --git a/tests/spec/arb_shader_image_size/builtin.c 
b/tests/spec/arb_shader_image_size/builtin.c
index cb427df..48a1d1e 100755
--- a/tests/spec/arb_shader_image_size/builtin.c
+++ b/tests/spec/arb_shader_image_size/builtin.c
@@ -104,6 +104,15 @@ check(const struct grid_info grid, struct image_info 
img_src)
 */
ret &= check_pixels(img, pixels, img_src.size.x, img_src.size.y,
 img_src.size.z / 6.0, img_src.size.w);
+   } else if (img_src.target->target == GL_TEXTURE_CUBE_MAP) {
+   /* Unlike image-load-store's size (exported by the framework
+* used for this test), image-size reports only the size of one
+* face, not including the number of faces. From the
+* ARB_shader_image_size extension:
+* "Cube images return the dimensions of one face."
+*/
+   ret &= check_pixels(img, pixels, img_src.size.x, img_src.size.y,
+1.0, 1.0);
} else if (image_target_samples(img_src.target) > 1) {
/* Unlike image-load-store's size (exported by the framework
 * used for this test), image-size does not report the sample
-- 
2.5.0

___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH 4/4] arb_shader_image_size/builtin: test a simple size before testing max sizes

2015-08-24 Thread Martin Peres
The normal mode will run the small tests on the interesting stages and formats
while the slow mode will test every stage and every format.

Disable all the max-size tests in quick mode since they are redundant with the
smaller tests anyway which run faster.

Signed-off-by: Martin Peres 
---
 tests/spec/arb_shader_image_size/builtin.c | 16 +++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/tests/spec/arb_shader_image_size/builtin.c 
b/tests/spec/arb_shader_image_size/builtin.c
index 854e2b3..dd240e6 100755
--- a/tests/spec/arb_shader_image_size/builtin.c
+++ b/tests/spec/arb_shader_image_size/builtin.c
@@ -255,7 +255,8 @@ test_max_dimensions(const struct image_format_info *format,
get_test_extent(target, d);
 
subtest(status,
-   is_test_reasonable(quick, size) &&
+   !quick &&
+   is_test_reasonable(!slow, size) &&
is_format_interesting(format, slow) &&
is_stage_interesting(stage, slow),
run_test(format, target, size),
@@ -285,6 +286,19 @@ piglit_init(int argc, char **argv)
for (format = image_formats_load_store; format->format; ++format) {
for (stage = image_stages(); stage->stage; ++stage) {
for (target = image_targets(); target->name; ++target) {
+   const struct image_extent size =
+   image_extent_for_target(target,
+   16, 96);
+
+   subtest(&status,
+   is_format_interesting(format, slow) &&
+   is_stage_interesting(stage, slow),
+   run_test(format, target, size),
+   "%s/%s/image%s size test/%dx%dx%dx%d",
+   format->name, stage->name, target->name,
+   size.x, size.y, size.z, size.w);
+
+
test_max_dimensions(format, target,
stage, &status,
quick, slow);
-- 
2.5.0

___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] Posting tests results

2015-08-24 Thread Martin Peres

On 23/08/15 01:03, Herminio Hernandez Jr. wrote:

I am new to the thread. I am Debian and Ubuntu on PowerPC machines. I have 
installed and ran piglit tests on Radeon graphics cards and would like share my 
results. Just would like to know what is the proper way of doing that. Thanks!


Ilia Mirkin has been collecting the results: 
http://people.freedesktop.org/~imirkin/


I have CCed him. Please just post your results somewhere and link him to it.
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH 2/2] arb_shader_image_size/builtin: make sure that each target gets tested

2015-08-12 Thread Martin Peres
Signed-off-by: Martin Peres 
---
 tests/spec/arb_shader_image_size/builtin.c | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/tests/spec/arb_shader_image_size/builtin.c 
b/tests/spec/arb_shader_image_size/builtin.c
index 48a1d1e..550a913 100755
--- a/tests/spec/arb_shader_image_size/builtin.c
+++ b/tests/spec/arb_shader_image_size/builtin.c
@@ -226,11 +226,15 @@ piglit_init(int argc, char **argv)
 
for (stage = image_stages(); stage->stage; ++stage) {
for (target = image_targets(); target->name; ++target) {
+   bool target_tested = false;
for (d = 0; d < 4; ++d) {
-   if (should_test_dimension(target, d)) {
+   if (should_test_dimension(target, d) ||
+   (d == 3 && target_tested)) {
const struct image_extent size =
get_test_extent(target, d);
 
+   target_tested = true;
+
subtest(&status,
is_test_reasonable(quick, size),
run_test(target, size),
-- 
2.5.0

___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH 1/2] arb_shader_image_size/builtin: Fix the CubeMap image test

2015-08-12 Thread Martin Peres
Signed-off-by: Martin Peres 
---
 tests/spec/arb_shader_image_size/builtin.c | 9 +
 1 file changed, 9 insertions(+)

diff --git a/tests/spec/arb_shader_image_size/builtin.c 
b/tests/spec/arb_shader_image_size/builtin.c
index cb427df..48a1d1e 100755
--- a/tests/spec/arb_shader_image_size/builtin.c
+++ b/tests/spec/arb_shader_image_size/builtin.c
@@ -104,6 +104,15 @@ check(const struct grid_info grid, struct image_info 
img_src)
 */
ret &= check_pixels(img, pixels, img_src.size.x, img_src.size.y,
 img_src.size.z / 6.0, img_src.size.w);
+   } else if (img_src.target->target == GL_TEXTURE_CUBE_MAP) {
+   /* Unlike image-load-store's size (exported by the framework
+* used for this test), image-size reports only the size of one
+* face, not including the number of faces. From the
+* ARB_shader_image_size extension:
+* "Cube images return the dimensions of one face."
+*/
+   ret &= check_pixels(img, pixels, img_src.size.x, img_src.size.y,
+1.0, 1.0);
} else if (image_target_samples(img_src.target) > 1) {
/* Unlike image-load-store's size (exported by the framework
 * used for this test), image-size does not report the sample
-- 
2.5.0

___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH] arb_dsa: avoid non-determinism in create-programpipelines subtests

2015-06-21 Thread Martin Peres

On 18/06/15 15:53, Jose Fonseca wrote:

On 18/06/15 03:37, Ilia Mirkin wrote:

Right now the default label size test fails due to mesa not implementing
the call, and length is uninitialized, which causes the subtest name to
keep changing. A well-behaved impl won't modify the param on error, so
initialize it to a known-bad value.

Signed-off-by: Ilia Mirkin 
---
  tests/spec/arb_direct_state_access/create-programpipelines.c | 10 
++

  1 file changed, 10 insertions(+)

diff --git 
a/tests/spec/arb_direct_state_access/create-programpipelines.c 
b/tests/spec/arb_direct_state_access/create-programpipelines.c

index 981c206..c9992e2 100644
--- a/tests/spec/arb_direct_state_access/create-programpipelines.c
+++ b/tests/spec/arb_direct_state_access/create-programpipelines.c
@@ -87,27 +87,32 @@ piglit_display(void)
  SUBTESTCONDITION(glIsProgramPipeline(ids[2]), pass,
   "IsProgramPipeline()");

+param = -1;
  glGetProgramPipelineiv(ids[2], GL_ACTIVE_PROGRAM, ¶m);
  piglit_check_gl_error(GL_NO_ERROR);
  SUBTESTCONDITION(param == 0, pass,
   "default active program(%d) == 0", param);

+param = -1;
  glGetProgramPipelineiv(ids[2], GL_VERTEX_SHADER, ¶m);
  piglit_check_gl_error(GL_NO_ERROR);
  SUBTESTCONDITION(param == 0, pass,
   "default vertex shader program(%d) == 0", param);

+param = -1;
  glGetProgramPipelineiv(ids[2], GL_GEOMETRY_SHADER, ¶m);
  piglit_check_gl_error(GL_NO_ERROR);
  SUBTESTCONDITION(param == 0, pass,
   "default geometry shader program(%d) == 0", param);

+param = -1;
  glGetProgramPipelineiv(ids[2], GL_FRAGMENT_SHADER, ¶m);
  piglit_check_gl_error(GL_NO_ERROR);
  SUBTESTCONDITION(param == 0, pass,
   "default fragment shader program(%d) == 0", param);

  if (piglit_is_extension_supported("GL_ARB_compute_shader")) {
+param = -1;
  glGetProgramPipelineiv(ids[2], GL_COMPUTE_SHADER, ¶m);
  piglit_check_gl_error(GL_NO_ERROR);
  SUBTESTCONDITION(param == 0, pass,
@@ -119,11 +124,13 @@ piglit_display(void)
  }

  if (piglit_is_extension_supported("GL_ARB_tessellation_shader")) {
+param = -1;
  glGetProgramPipelineiv(ids[2], GL_TESS_CONTROL_SHADER, 
¶m);

  piglit_check_gl_error(GL_NO_ERROR);
  SUBTESTCONDITION(param == 0, pass,
   "default TCS(%d) == 0", param);

+param = -1;
  glGetProgramPipelineiv(ids[2], GL_TESS_EVALUATION_SHADER,
 ¶m);
  piglit_check_gl_error(GL_NO_ERROR);
@@ -137,16 +144,19 @@ piglit_display(void)
   "default TES == 0");
  }

+param = -1;
  glGetProgramPipelineiv(ids[2], GL_VALIDATE_STATUS, ¶m);
  piglit_check_gl_error(GL_NO_ERROR);
  SUBTESTCONDITION(param == GL_FALSE, pass,
   "default validate status(%d) == FALSE", param);

+param = -1;
  glGetProgramPipelineiv(ids[2], GL_INFO_LOG_LENGTH, ¶m);
  piglit_check_gl_error(GL_NO_ERROR);
  SUBTESTCONDITION(param == 0, pass,
   "startup log length(%d) == 0", param);

+length = -1;
  glGetObjectLabel(GL_PROGRAM_PIPELINE, ids[2], 11, &length, label);
  piglit_check_gl_error(GL_NO_ERROR);
  SUBTESTCONDITION(length == 0, pass,



Thanks. I recently stumbled onto this one too, but didn't had 
opportunity to do anything about it.


Reviewed-by: Jose Fonseca 


Sorry about this:
Reviewed-by: Martin Peres 
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH] shaders: add a test counting builtin active uniforms

2015-05-29 Thread Martin Peres

On 28/05/15 21:50, Dylan Baker wrote:

Hey Martin,

I know these have already landed, but I noticed that you added tests in
the shaders/ directory. I Just wanted to let you know that we're not
adding new tests in the shaders directory, in the future putting them in
the appropriate directory under the spec directory. We're also trying to
use descriptive names rather than -.

Dylan


Hello Dylan,

By adding test, you mean non-shader-runner tests?

As for this specific test, it could replace the previous 2 getuniform 
tests and could potentially be moved to another folder in spec/ but I 
will need to check what extension brought the uniforms! Seems like 
archaeological work to me :p


Thanks for the notice though!

Martin
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH 1/3] shaders: test the vec4(mat3) constructor

2015-05-26 Thread Martin Peres
This is currently problematic in mesa.

Signed-off-by: Martin Peres 
---
 tests/shaders/glsl-fs-vec4-mat3.shader_test | 20 
 1 file changed, 20 insertions(+)
 create mode 100644 tests/shaders/glsl-fs-vec4-mat3.shader_test

diff --git a/tests/shaders/glsl-fs-vec4-mat3.shader_test 
b/tests/shaders/glsl-fs-vec4-mat3.shader_test
new file mode 100644
index 000..8e02148
--- /dev/null
+++ b/tests/shaders/glsl-fs-vec4-mat3.shader_test
@@ -0,0 +1,20 @@
+[require]
+GLSL >= 1.10
+
+[vertex shader]
+void main()
+{
+   gl_Position = gl_Vertex;
+}
+
+[fragment shader]
+void main()
+{
+   mat3 matrix3 = mat3(0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9);
+
+   gl_FragColor = vec4(matrix3);
+}
+
+[test]
+draw rect -1 -1 2 2
+probe all rgba 0.1 0.2 0.3 0.4
-- 
2.4.1

___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH 3/3] shaders: test the ivec4(mat3) constructor

2015-05-26 Thread Martin Peres
This is currently problematic in mesa.

Signed-off-by: Martin Peres 
---
 tests/shaders/glsl-fs-ivec4-mat3.shader_test | 20 
 1 file changed, 20 insertions(+)
 create mode 100644 tests/shaders/glsl-fs-ivec4-mat3.shader_test

diff --git a/tests/shaders/glsl-fs-ivec4-mat3.shader_test 
b/tests/shaders/glsl-fs-ivec4-mat3.shader_test
new file mode 100644
index 000..0c8f2e8
--- /dev/null
+++ b/tests/shaders/glsl-fs-ivec4-mat3.shader_test
@@ -0,0 +1,20 @@
+[require]
+GLSL >= 1.10
+
+[vertex shader]
+void main()
+{
+   gl_Position = gl_Vertex;
+}
+
+[fragment shader]
+void main()
+{
+   mat3 matrix3 = mat3(1, 2,3, 4, 5, 6, 7, 8, 9);
+
+   gl_FragColor = vec4(ivec4(matrix3)) / 10.0;
+}
+
+[test]
+draw rect -1 -1 2 2
+probe all rgba 0.1 0.2 0.3 0.4
-- 
2.4.1

___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH 2/3] shaders: test the vec4(mat2) constructor

2015-05-26 Thread Martin Peres
This is currently problematic in mesa.

Signed-off-by: Martin Peres 
---
 tests/shaders/glsl-fs-vec4-mat2.shader_test | 20 
 1 file changed, 20 insertions(+)
 create mode 100644 tests/shaders/glsl-fs-vec4-mat2.shader_test

diff --git a/tests/shaders/glsl-fs-vec4-mat2.shader_test 
b/tests/shaders/glsl-fs-vec4-mat2.shader_test
new file mode 100644
index 000..50f07ae
--- /dev/null
+++ b/tests/shaders/glsl-fs-vec4-mat2.shader_test
@@ -0,0 +1,20 @@
+[require]
+GLSL >= 1.10
+
+[vertex shader]
+void main()
+{
+   gl_Position = gl_Vertex;
+}
+
+[fragment shader]
+void main()
+{
+   mat2 matrix2 = mat2(0.1, 0.2, 0.3, 0.4);
+
+   gl_FragColor = vec4(matrix2);
+}
+
+[test]
+draw rect -1 -1 2 2
+probe all rgba 0.1 0.2 0.3 0.4
-- 
2.4.1

___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH 0/3] Add mulitple vector constructor tests

2015-05-26 Thread Martin Peres
My "shaders: add a test counting builtin active uniforms" test exposed
a bug in mesa related to constructor vectors with a matrix as an input.

This series formally test this unusual feature.

Martin Peres (3):
  shaders: test the vec4(mat3) constructor
  shaders: test the vec4(mat2) constructor
  shaders: test the ivec4(mat3) constructor

 tests/shaders/glsl-fs-ivec4-mat3.shader_test | 20 
 tests/shaders/glsl-fs-vec4-mat2.shader_test  | 20 
 tests/shaders/glsl-fs-vec4-mat3.shader_test  | 20 
 3 files changed, 60 insertions(+)
 create mode 100644 tests/shaders/glsl-fs-ivec4-mat3.shader_test
 create mode 100644 tests/shaders/glsl-fs-vec4-mat2.shader_test
 create mode 100644 tests/shaders/glsl-fs-vec4-mat3.shader_test

-- 
2.4.1

___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH v2] program_interface_query: add new subtest for getprogramresourceiv

2015-05-20 Thread Martin Peres
ck",
   "gs_uniform_block",
-  "fs_uniform_block", NULL};
+  "fs_uniform_block",
+  "fs_array_uniform_block[0]",
+  "fs_array_uniform_block[1]",
+  "fs_array_uniform_block[2]",
+  "fs_array_uniform_block[3]",
+  NULL};
  static const char *st_r_tess_uniform_block[] = {"tcs_uniform_block",
"tes_uniform_block", NULL};
  static const char *st_r_cs_uniform_block[] = {"cs_uniform_block", NULL};
@@ -346,10 +354,10 @@ struct subtest_t {
  }
  
  static const struct subtest_t subtests[] = {

- ST( 6, 12, -1, -1,  vs_std,NULL,NULL,  gs_std,  fs_std,   NULL, GL_UNIFORM, 
"(vs,gs,fs)", st_r_uniform),
+ ST( 8, 35, -1, -1,  vs_std,NULL,NULL,  gs_std,  fs_std,   NULL, GL_UNIFORM, 
"(vs,gs,fs)", st_r_uniform),
   ST( 2,  9, -1, -1,NULL, tcs_sub, tes_sub,NULL,NULL,   NULL, GL_UNIFORM, 
"(tes,tcs)", st_r_tess_uniform),
   ST( 2,  8, -1, -1,NULL,NULL,NULL,NULL,NULL, cs_sub, GL_UNIFORM, 
"(cs)", st_r_cs_uniform),
- ST( 3, 17,  2, -1,  vs_std,NULL,NULL,  gs_std,  fs_std,   NULL, 
GL_UNIFORM_BLOCK, "(vs,gs,fs)", st_r_uniform_block),
+ ST( 7, 26,  2, -1,  vs_std,NULL,NULL,  gs_std,  fs_std,   NULL, 
GL_UNIFORM_BLOCK, "(vs,gs,fs)", st_r_uniform_block),
   ST( 2, 18, -1, -1,NULL, tcs_sub, tes_sub,NULL,NULL,   NULL, 
GL_UNIFORM_BLOCK, "(tcs,tes)", st_r_tess_uniform_block),
   ST( 1, 17, -1, -1,NULL,NULL,NULL,NULL,NULL, cs_sub, 
GL_UNIFORM_BLOCK, "(cs)", st_r_cs_uniform_block),
   ST( 2, 10, -1, -1,  vs_std,NULL,NULL,NULL,NULL,   NULL, 
GL_PROGRAM_INPUT, "(vs)", st_r_in_vs),


Looks good to me! Thanks!

Reviewed-by: Martin Peres 
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH] program_interface_query: add new subtest for getprogramresourceiv

2015-05-20 Thread Martin Peres

On 20/05/15 11:39, Samuel Iglesias Gonsálvez wrote:

On 19/05/15 12:02, Martin Peres wrote:

On 19/05/15 08:46, Samuel Iglesias Gonsalvez wrote:

Test that uniforms inside arrays of uniform blocks with instance name are
queried properly.

Tested on NVIDIA's proprietary driver version 340.65

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

Signed-off-by: Samuel Iglesias Gonsalvez 
---
   tests/spec/arb_program_interface_query/common.h   | 12 +---
   .../getprogramresourceiv.c| 19
+++
   .../spec/arb_program_interface_query/resource-query.c | 16

   tests/spec/arb_shader_storage_buffer_object/minmax.c  |  4 ++--
   4 files changed, 42 insertions(+), 9 deletions(-)

diff --git a/tests/spec/arb_program_interface_query/common.h
b/tests/spec/arb_program_interface_query/common.h
index 55f0358..4079ac8 100755
--- a/tests/spec/arb_program_interface_query/common.h
+++ b/tests/spec/arb_program_interface_query/common.h
@@ -102,13 +102,19 @@ static const char fs_std[] =
   "uniform fs_uniform_block {"
   "vec4 fs_color;\n"
   "float fs_array[4];\n"
-"};"
+"};\n"
+"uniform fs_array_uniform_block {\n"
+"vec4 fs_color;\n"
+"float fs_array[4];\n"
+"} ubo[4];\n"

Hmm, aside from the obvious problem of having ubo != uniform_block,

I am going to rename that name uniform block in the second version of
the patch.


sounds nicer indeed!




I
wonder what would happen if you instead had:

+"} faub1[2], faub2[2];\n"


That kind of definition is not allowed in the spec. I think it is only
one instance name per interface block.

I tried defining "faub2[2]" by repeating the fs_array_uniform_block
definition but i965 doesn't allowed it, although NVIDIA does.


I hope that no games rely on this...




I am worried that you would get the following resources listed:

+   "fs_array_uniform_block[0]",
+   "fs_array_uniform_block[1]",
+   "fs_array_uniform_block[0]",
+   "fs_array_uniform_block[1]",


In my tests on NVIDIA, I get:

+   "fs_array_uniform_block[0]",
+   "fs_array_uniform_block[1]",

But they are not repeated. I guess NVIDIA thinks they are the same
uniform block but I did not check it further.


Seems like a lovely bug!




which would be a clear indication that the driver is broken. My view on
this is that named uniform blocks should use their named version when
being referenced. What do you think?

I have been checking what the specs say about it.

* In ARB_program_interface_query, GetProgramResourceName() is equivalent
to GetActiveUniformBlockName().

* Looking at ARB_uniform_buffer_object, GetActiveUniformBlockName() is
talking about uniform block name.

* Looking at GLSL spec (for example 4.4), when talking about interface
block (4.3.9 Interface Blocks), its definition is:

layout-qualifieropt interface-qualifier block-name { member-list }
instance-nameopt ;

But also, the same sections talks about the name:

"For blocks declared as arrays, the array index must also be included
  when accessing members, as in this example

   uniform Transform { // API uses “Transform[2]” to refer to instance 2
 mat4 ModelViewMatrix;
 mat4 ModelViewProjectionMatrix;
 vec4 a[]; // array will get implicitly sized
 float Deformation;
   } transforms[4];

  [...]
  When using OpenGL API entry points to identify the name of an
  individual block in an array of blocks, the name string must include
  an array index (e.g., Transform[2])."

Notice that it is talking about the block name, not the instance name.
So the current behaviour is right.


Wow, I am baffled by those crazy rules... Thanks for tracking this down 
the spec!





   "in vec4 fs_input1;\n"
   "out vec4 fs_output0;\n"
   "out vec4 fs_output1;\n"
   "void main() {\n"
-"fs_output0 = fs_color * fs_input1 * fs_array[2];\n"
-"fs_output1 = fs_color * fs_input1 * fs_array[3];\n"
+"fs_output0 = fs_color * fs_input1 * fs_array[2] * \n"
+"  ubo[0].fs_array[2] * ubo[2].fs_array[2];\n"
+"fs_output1 = fs_color * fs_input1 * fs_array[3] * \n"
+" ubo[1].fs_array[3] * ubo[3].fs_array[3];\n"
   "}";
 static const char vs_stor[] =
diff --git
a/tests/spec/arb_program_interface_query/getprogramresourceiv.c
b/tests/spec/arb_program_interface_query/getprogramresourceiv.c
index da9751a..03f2fc6 100755
--- a/tests/spec/arb_program_interface_query/getprogramresourceiv.c
+++ b/tests/spec/arb_program_interface_query/getprogramresourceiv

Re: [Piglit] [PATCH 4/4] arb_shader_image_load_store/grid: Iterate over all known shader stages in generate_program_v().

2015-05-19 Thread Martin Peres

On 12/05/15 15:39, Francisco Jerez wrote:

Rather than over all stages that support images.  Implies that the
stage index has to be calculated differently because the stage pointer
may no longer be based on the image_stages() array.  Fixes a number of
tests that were relying on a vertex shader to be present regardless of
the implementation supporting images on that stage, which is optional
according to the spec.
---
  tests/spec/arb_shader_image_load_store/grid.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/spec/arb_shader_image_load_store/grid.c 
b/tests/spec/arb_shader_image_load_store/grid.c
index 766d968..97e4126 100644
--- a/tests/spec/arb_shader_image_load_store/grid.c
+++ b/tests/spec/arb_shader_image_load_store/grid.c
@@ -243,7 +243,7 @@ generate_stage_source(const struct grid_info grid,
  static inline unsigned
  get_stage_idx(const struct image_stage_info *stage)
  {
-return stage - image_stages();
+return ffs(stage->bit);
  }
  
  /**

@@ -270,7 +270,7 @@ generate_program_v(const struct grid_info grid, const char 
**sources)
  GLuint prog = glCreateProgram();
  const struct image_stage_info *stage;
  
-for (stage = image_stages(); stage->stage; ++stage) {

+for (stage = known_image_stages(); stage->stage; ++stage) {
  if (stages & stage->bit) {
  char *source = generate_stage_source(
  grid, stage->stage,


Reviewed-by: Martin Peres 
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH 3/4] arb_shader_image_load_store/image: Expose array of known shader shader stages.

2015-05-19 Thread Martin Peres

On 12/05/15 15:39, Francisco Jerez wrote:

---
  tests/spec/arb_shader_image_load_store/image.c | 24 +---
  tests/spec/arb_shader_image_load_store/image.h |  7 +++
  2 files changed, 24 insertions(+), 7 deletions(-)

diff --git a/tests/spec/arb_shader_image_load_store/image.c 
b/tests/spec/arb_shader_image_load_store/image.c
index 58cda9b..7a1867f 100644
--- a/tests/spec/arb_shader_image_load_store/image.c
+++ b/tests/spec/arb_shader_image_load_store/image.c
@@ -599,9 +599,9 @@ image_target_mipmapping_dimensions(const struct 
image_target_info *target)
  }
  
  const struct image_stage_info *

-image_stages(void)
+known_image_stages(void)
  {
-const struct image_stage_info known[] = {
+static const struct image_stage_info known[] = {
  { "Vertex", GL_VERTEX_SHADER, GL_VERTEX_SHADER_BIT },
  { "Tessellation control", GL_TESS_CONTROL_SHADER,
GL_TESS_CONTROL_SHADER_BIT },
@@ -610,15 +610,25 @@ image_stages(void)
  { "Geometry", GL_GEOMETRY_SHADER, GL_GEOMETRY_SHADER_BIT },
  { "Fragment", GL_FRAGMENT_SHADER, GL_FRAGMENT_SHADER_BIT },
  { "Compute", GL_COMPUTE_SHADER, GL_COMPUTE_SHADER_BIT },
+{ 0 }
  };
-static struct image_stage_info supported[ARRAY_SIZE(known) + 1];
+return known;
+}
+
+const struct image_stage_info *
+image_stages(void)
+{
+static struct image_stage_info supported[7];
  
  if (!supported[0].name) {

-int i, n = 0;
+const struct image_stage_info *stage;
+int n = 0;
  
-for (i = 0; i < ARRAY_SIZE(known); ++i) {

-if (image_stage_max_images(&known[i]))
-supported[n++] = known[i];
+for (stage = known_image_stages(); stage->stage; ++stage) {
+if (image_stage_max_images(stage)) {
+assert(n < ARRAY_SIZE(supported) - 1);
+supported[n++] = *stage;
+}
  }
  }
  
diff --git a/tests/spec/arb_shader_image_load_store/image.h b/tests/spec/arb_shader_image_load_store/image.h

index f35c89f..fc43f22 100644
--- a/tests/spec/arb_shader_image_load_store/image.h
+++ b/tests/spec/arb_shader_image_load_store/image.h
@@ -264,6 +264,13 @@ struct image_stage_info {
  };
  
  /**

+ * Get all shader stages in pipeline order regardless of whether they
+ * support image access.
+ */
+const struct image_stage_info *
+known_image_stages(void);
+
+/**
   * Get all shader stages that support image access in pipeline order.
   */
  const struct image_stage_info *


Reviewed-by: Martin Peres 
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH 2/4] arb_shader_image_load_store/image: Document behaviour of get_image_stage() if images aren't supported.

2015-05-19 Thread Martin Peres

On 12/05/15 15:39, Francisco Jerez wrote:

---
  tests/spec/arb_shader_image_load_store/image.h | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tests/spec/arb_shader_image_load_store/image.h 
b/tests/spec/arb_shader_image_load_store/image.h
index 54d32ed..f35c89f 100644
--- a/tests/spec/arb_shader_image_load_store/image.h
+++ b/tests/spec/arb_shader_image_load_store/image.h
@@ -270,7 +270,8 @@ const struct image_stage_info *
  image_stages(void);
  
  /**

- * Get information for the specified stage.
+ * Get information for the specified stage, or NULL if the specified
+ * stage doesn't support images.
   */
  const struct image_stage_info *
  get_image_stage(GLenum s);

Reviewed-by: Martin Peres 
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH 1/4] arb_shader_image_load_store/indexing: Plug memory leak.

2015-05-19 Thread Martin Peres

On 12/05/15 15:39, Francisco Jerez wrote:

---
  tests/spec/arb_shader_image_load_store/indexing.c | 1 +
  1 file changed, 1 insertion(+)

diff --git a/tests/spec/arb_shader_image_load_store/indexing.c 
b/tests/spec/arb_shader_image_load_store/indexing.c
index ead0866..cab7d3f 100644
--- a/tests/spec/arb_shader_image_load_store/indexing.c
+++ b/tests/spec/arb_shader_image_load_store/indexing.c
@@ -75,6 +75,7 @@ init_images(const struct image_info img, GLuint prog)
  
  asprintf(&name, "imgs[%d]", unit);

  set_uniform_int(prog, name, unit);
+free(name);
  }
  
  return true;


Reviewed-by: Martin Peres 
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH] shaders: add a test counting builtin active uniforms

2015-05-19 Thread Martin Peres
The test will almost-always pass but it is a nice way to catch bugs
in our implementation... More information inside the test!

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=32403
Signed-off-by: Martin Peres 
---
 tests/all.py|   1 +
 tests/shaders/CMakeLists.gl.txt |   1 +
 tests/shaders/getuniform-03.c   | 305 
 3 files changed, 307 insertions(+)
 create mode 100755 tests/shaders/getuniform-03.c

diff --git a/tests/all.py b/tests/all.py
index 5b87410..8159b9b 100755
--- a/tests/all.py
+++ b/tests/all.py
@@ -484,6 +484,7 @@ with profile.group_manager(PiglitGLTest, 'shaders') as g:
 g(['glsl-getattriblocation'])
 g(['getuniform-01'])
 g(['getuniform-02'])
+g(['getuniform-03'])
 g(['glsl-invalid-asm-01'])
 g(['glsl-invalid-asm-02'])
 g(['glsl-novertexdata'])
diff --git a/tests/shaders/CMakeLists.gl.txt b/tests/shaders/CMakeLists.gl.txt
index 35b4c6c..192debb 100644
--- a/tests/shaders/CMakeLists.gl.txt
+++ b/tests/shaders/CMakeLists.gl.txt
@@ -59,6 +59,7 @@ piglit_add_executable (glsl-getactiveuniform-count 
glsl-getactiveuniform-count.c
 piglit_add_executable (glsl-getactiveuniform-length 
glsl-getactiveuniform-length.c)
 piglit_add_executable (getuniform-01 getuniform-01.c)
 piglit_add_executable (getuniform-02 getuniform-02.c)
+piglit_add_executable (getuniform-03 getuniform-03.c)
 piglit_add_executable (glsl-invalid-asm-01 glsl-invalid-asm-01.c)
 piglit_add_executable (glsl-invalid-asm-02 glsl-invalid-asm-02.c)
 piglit_add_executable (glsl-novertexdata glsl-novertexdata.c)
diff --git a/tests/shaders/getuniform-03.c b/tests/shaders/getuniform-03.c
new file mode 100755
index 000..927a98f
--- /dev/null
+++ b/tests/shaders/getuniform-03.c
@@ -0,0 +1,305 @@
+/*
+ * Copyright 2015 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#include "piglit-util-gl.h"
+
+PIGLIT_GL_TEST_CONFIG_BEGIN
+
+   config.supports_gl_compat_version = 21;
+
+   config.window_visual = PIGLIT_GL_VISUAL_RGB | PIGLIT_GL_VISUAL_DOUBLE;
+
+PIGLIT_GL_TEST_CONFIG_END
+
+struct builtin_uniform_t {
+   const char *name;
+   GLenum type;
+   bool is_array;
+   bool found;
+} uniforms[] = {
+   { "gl_DepthRange.near", GL_FLOAT, false , false },
+   { "gl_DepthRange.far", GL_FLOAT, false , false },
+   { "gl_DepthRange.diff", GL_FLOAT, false , false },
+   /* { "gl_NumSamples", GL_INT, false , false }, requires OGL 4.0 */
+   { "gl_ModelViewMatrix", GL_FLOAT_MAT4, false , false },
+   { "gl_ProjectionMatrix", GL_FLOAT_MAT4, false , false  },
+   { "gl_ModelViewProjectionMatrix", GL_FLOAT_MAT4, false , false },
+   { "gl_TextureMatrix", GL_FLOAT_MAT4, true , false  },
+   { "gl_NormalMatrix", GL_FLOAT_MAT3, false , false  },
+   { "gl_ModelViewMatrixInverse", GL_FLOAT_MAT4, false , false },
+   { "gl_ProjectionMatrixInverse", GL_FLOAT_MAT4, false , false  },
+   { "gl_TextureMatrixInverse", GL_FLOAT_MAT4, true , false  },
+   { "gl_ModelViewMatrixTranspose", GL_FLOAT_MAT4, false , false  },
+   { "gl_ProjectionMatrixTranspose", GL_FLOAT_MAT4, false , false },
+   { "gl_ModelViewProjectionMatrixTranspose", GL_FLOAT_MAT4, false , false 
},
+   { "gl_TextureMatrixTranspose", GL_FLOAT_MAT4, true , false  },
+   { "gl_ModelViewMatrixInverseTranspose", GL_FLOAT_MAT4, false , false  },
+   { "gl_ProjectionMatrixInverseTranspose", GL_FLOAT_MAT4, false , false },
+   { "gl_ModelViewProjectionMatrixInverseTranspose", GL_FLOAT_MAT4, false  
},
+   { "gl_TextureM

Re: [Piglit] [PATCH] program_interface_query: add new subtest for getprogramresourceiv

2015-05-19 Thread Martin Peres

On 19/05/15 08:46, Samuel Iglesias Gonsalvez wrote:

Test that uniforms inside arrays of uniform blocks with instance name are
queried properly.

Tested on NVIDIA's proprietary driver version 340.65

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

Signed-off-by: Samuel Iglesias Gonsalvez 
---
  tests/spec/arb_program_interface_query/common.h   | 12 +---
  .../getprogramresourceiv.c| 19 +++
  .../spec/arb_program_interface_query/resource-query.c | 16 
  tests/spec/arb_shader_storage_buffer_object/minmax.c  |  4 ++--
  4 files changed, 42 insertions(+), 9 deletions(-)

diff --git a/tests/spec/arb_program_interface_query/common.h 
b/tests/spec/arb_program_interface_query/common.h
index 55f0358..4079ac8 100755
--- a/tests/spec/arb_program_interface_query/common.h
+++ b/tests/spec/arb_program_interface_query/common.h
@@ -102,13 +102,19 @@ static const char fs_std[] =
"uniform fs_uniform_block {"
"  vec4 fs_color;\n"
"  float fs_array[4];\n"
-   "};"
+   "};\n"
+   "uniform fs_array_uniform_block {\n"
+   "  vec4 fs_color;\n"
+   "  float fs_array[4];\n"
+   "} ubo[4];\n"


Hmm, aside from the obvious problem of having ubo != uniform_block, I 
wonder what would happen if you instead had:


+   "} faub1[2], faub2[2];\n"


I am worried that you would get the following resources listed:

+  "fs_array_uniform_block[0]",
+  "fs_array_uniform_block[1]",
+  "fs_array_uniform_block[0]",
+  "fs_array_uniform_block[1]",


which would be a clear indication that the driver is broken. My view on 
this is that named uniform blocks should use their named version when 
being referenced. What do you think?

"in vec4 fs_input1;\n"
"out vec4 fs_output0;\n"
"out vec4 fs_output1;\n"
"void main() {\n"
-   "fs_output0 = fs_color * fs_input1 * fs_array[2];\n"
-   "fs_output1 = fs_color * fs_input1 * fs_array[3];\n"
+   "fs_output0 = fs_color * fs_input1 * fs_array[2] * \n"
+   "ubo[0].fs_array[2] * ubo[2].fs_array[2];\n"
+   "fs_output1 = fs_color * fs_input1 * fs_array[3] * \n"
+   " ubo[1].fs_array[3] * ubo[3].fs_array[3];\n"
"}";
  
  static const char vs_stor[] =

diff --git a/tests/spec/arb_program_interface_query/getprogramresourceiv.c 
b/tests/spec/arb_program_interface_query/getprogramresourceiv.c
index da9751a..03f2fc6 100755
--- a/tests/spec/arb_program_interface_query/getprogramresourceiv.c
+++ b/tests/spec/arb_program_interface_query/getprogramresourceiv.c
@@ -454,6 +454,25 @@ static const struct subtest_t subtests[] = {
{ GL_REFERENCED_BY_COMPUTE_SHADER, 1, { 0 } },
{ 0, 0, { 0 } }}
   },
+ { &prog_std, GL_UNIFORM, "fs_array_uniform_block.fs_array", 
"fs_array_uniform_block[0]", {
+   { GL_NAME_LENGTH, 1, { 35 } },
+   { GL_TYPE, 1, { GL_FLOAT } },
+   { GL_ARRAY_SIZE, 1, { 4 } },
+   { GL_OFFSET, 1, { 0 } }, /* valid index == anything but -1 */
+   { GL_BLOCK_INDEX, 1, { 2 } }, /* compared to 
fs_array_uniform_block[0]'s idx */
+   { GL_ARRAY_STRIDE, 1, { 0 } }, /* valid index == anything but -1 */
+   { GL_MATRIX_STRIDE, 1, { 0 } },
+   { GL_IS_ROW_MAJOR, 1, { 0 } },
+   { GL_ATOMIC_COUNTER_BUFFER_INDEX, 1, { -1 } }, /* valid index == 
anything but -1 */
+   { GL_REFERENCED_BY_VERTEX_SHADER, 1, { 0 } },
+   { GL_REFERENCED_BY_TESS_CONTROL_SHADER, 1, { 0 } },
+   { GL_REFERENCED_BY_TESS_EVALUATION_SHADER, 1, { 0 } },
+   { GL_REFERENCED_BY_GEOMETRY_SHADER, 1, { 0 } },
+   { GL_REFERENCED_BY_FRAGMENT_SHADER, 1, { 1 } },
+   { GL_REFERENCED_BY_COMPUTE_SHADER, 1, { 0 } },
+   { GL_LOCATION, 1, { -1 } }, /* valid index == anything but -1 */
+   { 0, 0, { 0 } }}
+ },
   { &prog_stor, GL_BUFFER_VARIABLE, "gs_buf_var", "gs_buffer_block", {
{ GL_NAME_LENGTH, 1, { 11 } },
{ GL_TYPE, 1, { GL_FLOAT_VEC4 } },
diff --git a/tests/spec/arb_program_interface_query/resource-query.c 
b/tests/spec/arb_program_interface_query/resource-query.c
index 92b8cd8..1db5585 100755
--- a/tests/spec/arb_program_interface_query/resource-query.c
+++ b/tests/spec/arb_program_interface_query/resource-query.c
@@ -189,13 +189,21 @@ PIGLIT_GL_TEST_CONFIG_END
   * white space anywhere in the string.
   */
  static const char *st_r_uniform[] = {"vs_test", "gs_test", "fs_color",
-"fs_array[0]", "sa[0].a[0]", "sa[1].a[0]",
+"fs_array[0]",
+"fs_array_uniform_block.fs_color",
+"fs_array_uniform_block.fs_array[0]",
+"sa[0].a[0]", "sa[1].a[0]",
 

Re: [Piglit] [PATCH] arb_shader_image_size: test GLSL's builtin imageSize

2015-05-12 Thread Martin Peres

On 08/05/15 18:52, Francisco Jerez wrote:

Martin Peres  writes:


v2:
- make sure that GL_ARB_shader_image_size == 1 in the shaders

Signed-off-by: Martin Peres 
---
  tests/all.py   |   5 +
  tests/quick.py |   7 +
  tests/spec/CMakeLists.txt  |   1 +
  tests/spec/arb_shader_image_size/CMakeLists.gl.txt |  16 ++
  tests/spec/arb_shader_image_size/CMakeLists.txt|   1 +
  tests/spec/arb_shader_image_size/builtin.c | 238 +
  6 files changed, 268 insertions(+)
  create mode 100755 tests/spec/arb_shader_image_size/CMakeLists.gl.txt
  create mode 100644 tests/spec/arb_shader_image_size/CMakeLists.txt
  create mode 100755 tests/spec/arb_shader_image_size/builtin.c

diff --git a/tests/all.py b/tests/all.py
index 18124b7..2fad427 100755
--- a/tests/all.py
+++ b/tests/all.py
@@ -4328,6 +4328,11 @@ with profile.group_manager(
  g(['arb_shader_image_load_store-unused'], 'unused')
  
  with profile.group_manager(

+PiglitGLTest,
+grouptools.join('spec', 'arb_shader_image_size')) as g:
+g(['arb_shader_image_size-builtin'], 'builtin')
+
+with profile.group_manager(
  PiglitGLTest,
  grouptools.join('spec', 'arb_texture_stencil8')) as g:
  g(['arb_texture_stencil8-draw'], 'draw')
diff --git a/tests/quick.py b/tests/quick.py
index d0aca02..26335ba 100644
--- a/tests/quick.py
+++ b/tests/quick.py
@@ -24,5 +24,12 @@ with profile.group_manager(
  g(['arb_shader_image_load_store-shader-mem-barrier', '--quick'],
'shader-mem-barrier')
  
+# Set the --quick flag on a few image_size_tests

Copy-pasto?  You're only planning to do one test at this point right?


Yes, only one test. Fixed this!



+with profile.group_manager(
+PiglitGLTest,
+grouptools.join('spec', 'arb_shader_image_size')) as g:
+with profile.allow_reassignment:
+g(['arb_shader_image_size-builtin', '--quick'], 'builtin')
+
  # These take too long
  profile.filter_tests(lambda n, _: '-explosion' not in n)
diff --git a/tests/spec/CMakeLists.txt b/tests/spec/CMakeLists.txt
index 330b38c..d5a7a16 100644
--- a/tests/spec/CMakeLists.txt
+++ b/tests/spec/CMakeLists.txt
@@ -46,6 +46,7 @@ add_subdirectory (arb_shader_texture_lod/execution)
  add_subdirectory (arb_shader_atomic_counters)
  add_subdirectory (arb_shader_objects)
  add_subdirectory (arb_shader_image_load_store)
+add_subdirectory (arb_shader_image_size)
  add_subdirectory (arb_shading_language_420pack/execution)
  add_subdirectory (arb_stencil_texturing)
  add_subdirectory (arb_sync)
diff --git a/tests/spec/arb_shader_image_size/CMakeLists.gl.txt 
b/tests/spec/arb_shader_image_size/CMakeLists.gl.txt
new file mode 100755
index 000..03de9b0
--- /dev/null
+++ b/tests/spec/arb_shader_image_size/CMakeLists.gl.txt
@@ -0,0 +1,16 @@
+include_directories(
+   ${GLEXT_INCLUDE_DIR}
+   ${OPENGL_INCLUDE_PATH}
+)
+
+link_libraries (
+   piglitutil_${piglit_target_api}
+   ${OPENGL_gl_LIBRARY}
+   ${OPENGL_glu_LIBRARY}
+)
+
+piglit_add_executable (arb_shader_image_size-builtin builtin.c
+   ../arb_shader_image_load_store/image.c
+   ../arb_shader_image_load_store/grid.c
+   ../arb_shader_image_load_store/common.c)
+# vim: ft=cmake:
diff --git a/tests/spec/arb_shader_image_size/CMakeLists.txt 
b/tests/spec/arb_shader_image_size/CMakeLists.txt
new file mode 100644
index 000..144a306
--- /dev/null
+++ b/tests/spec/arb_shader_image_size/CMakeLists.txt
@@ -0,0 +1 @@
+piglit_include_target_api()
diff --git a/tests/spec/arb_shader_image_size/builtin.c 
b/tests/spec/arb_shader_image_size/builtin.c
new file mode 100755
index 000..1b29253
--- /dev/null
+++ b/tests/spec/arb_shader_image_size/builtin.c
@@ -0,0 +1,238 @@
+/*
+ * Copyright 2015 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AN

[Piglit] [PATCH] direct_state_access/queries: add a subtest checking QUERY_TARGET

2015-05-04 Thread Martin Peres
Tested on NVIDIA's proprietary driver version 346.35.

Reported-by: Ilia Mirkin 
Signed-off-by: Martin Peres 
---
 tests/spec/arb_direct_state_access/create-queries.c | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/tests/spec/arb_direct_state_access/create-queries.c 
b/tests/spec/arb_direct_state_access/create-queries.c
index 5112f3b..4f10cd4 100644
--- a/tests/spec/arb_direct_state_access/create-queries.c
+++ b/tests/spec/arb_direct_state_access/create-queries.c
@@ -102,6 +102,12 @@ piglit_display(void)
piglit_check_gl_error(GL_NO_ERROR);
SUBTESTCONDITION(param == 0, pass, "default RESULT(%d) == 0", param);
 
+   /* test the target */
+   glGetQueryObjectiv(ids[2], GL_QUERY_TARGET, ¶m);
+   piglit_check_gl_error(GL_NO_ERROR);
+   SUBTESTCONDITION(param == GL_SAMPLES_PASSED, pass, "TARGET(%s) == "
+"GL_SAMPLES_PASSED", piglit_get_gl_enum_name(param));
+
/* clean up */
glDeleteQueries(10, ids);
 
-- 
2.3.7

___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH] arb_shader_image_size: test GLSL's builtin imageSize

2015-04-29 Thread Martin Peres
v2:
- make sure that GL_ARB_shader_image_size == 1 in the shaders

Signed-off-by: Martin Peres 
---
 tests/all.py   |   5 +
 tests/quick.py |   7 +
 tests/spec/CMakeLists.txt  |   1 +
 tests/spec/arb_shader_image_size/CMakeLists.gl.txt |  16 ++
 tests/spec/arb_shader_image_size/CMakeLists.txt|   1 +
 tests/spec/arb_shader_image_size/builtin.c | 238 +
 6 files changed, 268 insertions(+)
 create mode 100755 tests/spec/arb_shader_image_size/CMakeLists.gl.txt
 create mode 100644 tests/spec/arb_shader_image_size/CMakeLists.txt
 create mode 100755 tests/spec/arb_shader_image_size/builtin.c

diff --git a/tests/all.py b/tests/all.py
index 18124b7..2fad427 100755
--- a/tests/all.py
+++ b/tests/all.py
@@ -4328,6 +4328,11 @@ with profile.group_manager(
 g(['arb_shader_image_load_store-unused'], 'unused')
 
 with profile.group_manager(
+PiglitGLTest,
+grouptools.join('spec', 'arb_shader_image_size')) as g:
+g(['arb_shader_image_size-builtin'], 'builtin')
+
+with profile.group_manager(
 PiglitGLTest,
 grouptools.join('spec', 'arb_texture_stencil8')) as g:
 g(['arb_texture_stencil8-draw'], 'draw')
diff --git a/tests/quick.py b/tests/quick.py
index d0aca02..26335ba 100644
--- a/tests/quick.py
+++ b/tests/quick.py
@@ -24,5 +24,12 @@ with profile.group_manager(
 g(['arb_shader_image_load_store-shader-mem-barrier', '--quick'],
   'shader-mem-barrier')
 
+# Set the --quick flag on a few image_size_tests
+with profile.group_manager(
+PiglitGLTest,
+grouptools.join('spec', 'arb_shader_image_size')) as g:
+with profile.allow_reassignment:
+g(['arb_shader_image_size-builtin', '--quick'], 'builtin')
+
 # These take too long
 profile.filter_tests(lambda n, _: '-explosion' not in n)
diff --git a/tests/spec/CMakeLists.txt b/tests/spec/CMakeLists.txt
index 330b38c..d5a7a16 100644
--- a/tests/spec/CMakeLists.txt
+++ b/tests/spec/CMakeLists.txt
@@ -46,6 +46,7 @@ add_subdirectory (arb_shader_texture_lod/execution)
 add_subdirectory (arb_shader_atomic_counters)
 add_subdirectory (arb_shader_objects)
 add_subdirectory (arb_shader_image_load_store)
+add_subdirectory (arb_shader_image_size)
 add_subdirectory (arb_shading_language_420pack/execution)
 add_subdirectory (arb_stencil_texturing)
 add_subdirectory (arb_sync)
diff --git a/tests/spec/arb_shader_image_size/CMakeLists.gl.txt 
b/tests/spec/arb_shader_image_size/CMakeLists.gl.txt
new file mode 100755
index 000..03de9b0
--- /dev/null
+++ b/tests/spec/arb_shader_image_size/CMakeLists.gl.txt
@@ -0,0 +1,16 @@
+include_directories(
+   ${GLEXT_INCLUDE_DIR}
+   ${OPENGL_INCLUDE_PATH}
+)
+
+link_libraries (
+   piglitutil_${piglit_target_api}
+   ${OPENGL_gl_LIBRARY}
+   ${OPENGL_glu_LIBRARY}
+)
+
+piglit_add_executable (arb_shader_image_size-builtin builtin.c
+   ../arb_shader_image_load_store/image.c
+   ../arb_shader_image_load_store/grid.c
+   ../arb_shader_image_load_store/common.c)
+# vim: ft=cmake:
diff --git a/tests/spec/arb_shader_image_size/CMakeLists.txt 
b/tests/spec/arb_shader_image_size/CMakeLists.txt
new file mode 100644
index 000..144a306
--- /dev/null
+++ b/tests/spec/arb_shader_image_size/CMakeLists.txt
@@ -0,0 +1 @@
+piglit_include_target_api()
diff --git a/tests/spec/arb_shader_image_size/builtin.c 
b/tests/spec/arb_shader_image_size/builtin.c
new file mode 100755
index 000..1b29253
--- /dev/null
+++ b/tests/spec/arb_shader_image_size/builtin.c
@@ -0,0 +1,238 @@
+/*
+ * Copyright 2015 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT 

[Piglit] [PATCH] arb_shader_image_size: test GLSL's builtin imageSize

2015-04-24 Thread Martin Peres
Signed-off-by: Martin Peres 
---
 tests/all.py   |   5 +
 tests/quick.py |   7 +
 tests/spec/CMakeLists.txt  |   1 +
 tests/spec/arb_shader_image_size/CMakeLists.gl.txt |  16 ++
 tests/spec/arb_shader_image_size/CMakeLists.txt|   1 +
 tests/spec/arb_shader_image_size/builtin.c | 234 +
 6 files changed, 264 insertions(+)
 create mode 100755 tests/spec/arb_shader_image_size/CMakeLists.gl.txt
 create mode 100644 tests/spec/arb_shader_image_size/CMakeLists.txt
 create mode 100755 tests/spec/arb_shader_image_size/builtin.c

diff --git a/tests/all.py b/tests/all.py
index 18124b7..2fad427 100755
--- a/tests/all.py
+++ b/tests/all.py
@@ -4328,6 +4328,11 @@ with profile.group_manager(
 g(['arb_shader_image_load_store-unused'], 'unused')
 
 with profile.group_manager(
+PiglitGLTest,
+grouptools.join('spec', 'arb_shader_image_size')) as g:
+g(['arb_shader_image_size-builtin'], 'builtin')
+
+with profile.group_manager(
 PiglitGLTest,
 grouptools.join('spec', 'arb_texture_stencil8')) as g:
 g(['arb_texture_stencil8-draw'], 'draw')
diff --git a/tests/quick.py b/tests/quick.py
index d0aca02..26335ba 100644
--- a/tests/quick.py
+++ b/tests/quick.py
@@ -24,5 +24,12 @@ with profile.group_manager(
 g(['arb_shader_image_load_store-shader-mem-barrier', '--quick'],
   'shader-mem-barrier')
 
+# Set the --quick flag on a few image_size_tests
+with profile.group_manager(
+PiglitGLTest,
+grouptools.join('spec', 'arb_shader_image_size')) as g:
+with profile.allow_reassignment:
+g(['arb_shader_image_size-builtin', '--quick'], 'builtin')
+
 # These take too long
 profile.filter_tests(lambda n, _: '-explosion' not in n)
diff --git a/tests/spec/CMakeLists.txt b/tests/spec/CMakeLists.txt
index 330b38c..d5a7a16 100644
--- a/tests/spec/CMakeLists.txt
+++ b/tests/spec/CMakeLists.txt
@@ -46,6 +46,7 @@ add_subdirectory (arb_shader_texture_lod/execution)
 add_subdirectory (arb_shader_atomic_counters)
 add_subdirectory (arb_shader_objects)
 add_subdirectory (arb_shader_image_load_store)
+add_subdirectory (arb_shader_image_size)
 add_subdirectory (arb_shading_language_420pack/execution)
 add_subdirectory (arb_stencil_texturing)
 add_subdirectory (arb_sync)
diff --git a/tests/spec/arb_shader_image_size/CMakeLists.gl.txt 
b/tests/spec/arb_shader_image_size/CMakeLists.gl.txt
new file mode 100755
index 000..03de9b0
--- /dev/null
+++ b/tests/spec/arb_shader_image_size/CMakeLists.gl.txt
@@ -0,0 +1,16 @@
+include_directories(
+   ${GLEXT_INCLUDE_DIR}
+   ${OPENGL_INCLUDE_PATH}
+)
+
+link_libraries (
+   piglitutil_${piglit_target_api}
+   ${OPENGL_gl_LIBRARY}
+   ${OPENGL_glu_LIBRARY}
+)
+
+piglit_add_executable (arb_shader_image_size-builtin builtin.c
+   ../arb_shader_image_load_store/image.c
+   ../arb_shader_image_load_store/grid.c
+   ../arb_shader_image_load_store/common.c)
+# vim: ft=cmake:
diff --git a/tests/spec/arb_shader_image_size/CMakeLists.txt 
b/tests/spec/arb_shader_image_size/CMakeLists.txt
new file mode 100644
index 000..144a306
--- /dev/null
+++ b/tests/spec/arb_shader_image_size/CMakeLists.txt
@@ -0,0 +1 @@
+piglit_include_target_api()
diff --git a/tests/spec/arb_shader_image_size/builtin.c 
b/tests/spec/arb_shader_image_size/builtin.c
new file mode 100755
index 000..4918f6e
--- /dev/null
+++ b/tests/spec/arb_shader_image_size/builtin.c
@@ -0,0 +1,234 @@
+/*
+ * Copyright 2015 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALIN

Re: [Piglit] [PATCH] DSA: fix error value for *TextureSubImage* when target doesn't match

2015-04-23 Thread Martin Peres

On 23/04/15 15:12, Arthur Huillet wrote:

Hi,

On Thu, 23 Apr 2015 14:26:32 +0300
Martin Peres  wrote:


Does the patch look OK to you?

Yeah, patch looks perfectly fine. But I'd like to hear from Laura (or
Martin perhaps, who reviewed a lot of these) about whether this was
done on purpose or not, pending a spec fix.

I am not aware of any bug report filed by Laura on this. Given that she
wrote this code in October last year, I am sure she would have received
an answer from Khronos if she had filed a bug. This would suggest it is
a bug in the test.

Let's wait for her comment to make sure of it.

Anyway, thanks for the patch Arthur! I know it can be frustrating to
have to check every failing test while wondering whether this is a test
or a driver bug. We should encourage developers writing piglit tests to
try them on multiple drivers that already support the extension they are
testing. This is however impossible to mandate.

Asking Piglit contributors to test their tests (...) on more than one 
implementation
is certainly a good idea, but it's not always practical. I think it is easier 
to ask,
for the tests for which it is appropriate (like the ones I fixed), to quote the 
part
of the specification that they are testing. This also has the advantage of 
making
the reviewers' life easier - I don't think many people know by heart what error
is supposed to be returned by a particular error condition, so having a piece of
spec to check is helpful.


I think we already ask piglit developers to quote the spec at the 
beginning of their tests. I certainly tried to do that on my tests and 
only test the behaviour described in this test. If it has been done, 
then I guess the review was a problem here. It would seem like multiple 
months passed between the moment the patches were written and the moment 
they got commited. I fear that no-one wanted to do a good review so it 
just got pushed.


Sometimes, it is good for readability to re-quote the spec in-line or 
move part of the spec documentation where it is tested (like in this 
test [1]), but this is not always working or possible, like in this test 
[2].


In any case, we indeed need to be careful about these errors.


I'll go a little further and suggest that in order to review a "GL_INVALID_*"
test properly, you *need* to look at the spec. So better quote it directly.
  
Here are more examples from DSA:


"bind-texture-unit.c:63:

 glGenTextures(1, &name);
 glBindTextureUnit(0, name);
 pass &= piglit_check_gl_error(GL_INVALID_ENUM);

But here's the spec:
 "An INVALID_OPERATION error is generated by BindTextureUnit if tex-
ture is not zero or the name of an existing texture object."

So I believe INVALID_OPERATION is the correct thing to return (will send a patch
when I can).

Please do :)

Seems like the test has been written to check for no change in behaviour 
with between the DSA and non-DSA paths instead of a close look at the 
documentation.




Then, bind-texture-unit.c:70:

 /* Texture unit doesn't exist */

 glDeleteTextures(1, &name);
 glCreateTextures(GL_TEXTURE_2D, 1, &name);
 glGetIntegerv(GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS, &nunits);
 glBindTextureUnit(nunits, name); /* Too High */
 pass &= piglit_check_gl_error(GL_INVALID_OPERATION);

I haven't been able to find the relevant language to justify
GL_INVALID_OPERATION here. (NVIDIA returns INVALID_VALUE)
I won't send a patch since I can't back up my claim with spec."


We should not test for unspecified behaviour. That also deserves a patch 
to get rid of the check altogether.



Do you try your tests against Intel's or AMD's driver for Windows? If
so, why not start working on them in the open and push them to piglit
since it now supports Windows?

I'm a Linux engineer and if I can avoid working on Windows, I will. :)


Ah ah, indeed!

I assumed that the tests were written by the windows engineers and 
suggested that they could piglit too. If you also write tests from 
Linux, then you have even less excuses not to make them public in piglit :p




[1] 
http://cgit.freedesktop.org/piglit/commit/?id=8c1d2e8bac5d3526091ca911dd5d4ed0f859d392
[2] 
http://cgit.freedesktop.org/piglit/commit/?id=fa7c2ac879962e3922e7e694955c6879156b7d45 


___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH] DSA: fix error value for *TextureSubImage* when target doesn't match

2015-04-23 Thread Martin Peres

On 22/04/15 20:06, Ilia Mirkin wrote:

[fixing Laura's email]

On Wed, Apr 22, 2015 at 1:05 PM, Ilia Mirkin  wrote:

On Wed, Apr 22, 2015 at 12:53 PM, Arthur Huillet  wrote:

Hi,

On 2015-04-22 18:37, Ilia Mirkin wrote:

 From the ARB_dsa spec:

 An INVALID_ENUM error is generated by *TexSubImage* if  does
 not match the command, as shown in table 8.subtarg.

 An INVALID_OPERATION error is generated by *TextureSubImage* if the
 effective target of  does not match the command, as shown in
 table 8.subtarg.

Probably the source of the confusion?


Yes, I believe this was the source of the confusion. At least it confused
*me* for a few minutes :) That's why I'm suggesting the policy to always
quote spec, so that reviewers and users can more easily spot these problems.

In a universe where you're getting too many piglit contributions and
have you do quality control *somehow*, sure. But in this one, getting
people to write tests is like pulling teeth (and I'm guilty of this as
well), so adding even more onerous requirements on test cases seems
like it might be a losing proposition.


AFAIK a bunch of spec bugs were
filed about these little inconsistencies... (But I don't know exactly
what they were, no Khronos access for me.)


I haven't seen one. I haven't looked very hard.

Does the patch look OK to you?

Yeah, patch looks perfectly fine. But I'd like to hear from Laura (or
Martin perhaps, who reviewed a lot of these) about whether this was
done on purpose or not, pending a spec fix.


I am not aware of any bug report filed by Laura on this. Given that she 
wrote this code in October last year, I am sure she would have received 
an answer from Khronos if she had filed a bug. This would suggest it is 
a bug in the test.


Let's wait for her comment to make sure of it.

Anyway, thanks for the patch Arthur! I know it can be frustrating to 
have to check every failing test while wondering whether this is a test 
or a driver bug. We should encourage developers writing piglit tests to 
try them on multiple drivers that already support the extension they are 
testing. This is however impossible to mandate.


Do you try your tests against Intel's or AMD's driver for Windows? If 
so, why not start working on them in the open and push them to piglit 
since it now supports Windows?

___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH] program_interface_query: add getprogramresourceiv in all.py

2015-04-08 Thread Martin Peres

On 08/04/15 11:13, Tapani Pälli wrote:
Reviewed-by: Tapani Pälli  


Thanks, pushed.
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH] program_interface_query: add getprogramresourceiv in all.py

2015-04-08 Thread Martin Peres
Signed-off-by: Martin Peres 
---
 tests/all.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tests/all.py b/tests/all.py
index 5138f73..507f84f 100755
--- a/tests/all.py
+++ b/tests/all.py
@@ -2287,6 +2287,7 @@ with profile.group_manager(
 g(['arb_program_interface_query-getprograminterfaceiv'], 
run_concurrent=False)
 g(['arb_program_interface_query-getprogramresourceindex'], 
run_concurrent=False)
 g(['arb_program_interface_query-getprogramresourcename'], 
run_concurrent=False)
+g(['arb_program_interface_query-getprogramresourceiv'], 
run_concurrent=False)
 
 # Group ARB_explicit_uniform_location
 with profile.group_manager(
-- 
2.3.5

___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH v5 6/6] program_interface_query: add tests for getprogramresourceiv

2015-04-08 Thread Martin Peres

On 07/04/15 21:20, Dylan Baker wrote:

Martin, do you need to add this test to all.py?
Hmm, it must have been deleted in a rebase. Will send a patch to the ML 
right now.

___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH 02/15] arb_direct_state_access: Testing NamedBufferStorage.

2015-04-07 Thread Martin Peres

On 03/04/15 04:00, Laura Ekstrand wrote:
Well, it wasn't as bad as I thought initially.  Here's the version 
with core = 32:
http://cgit.freedesktop.org/~ldeks/piglit/commit/?h=adsa-buffer-objects&id=2eb0b4b2a4ee17f2981aa834b02d6340bdad174d 



What do you think?


Looks good, thanks Laura! You get your well-deserved R-b :)
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH v6 6/6] program_interface_query: add tests for getprogramresourceiv

2015-04-02 Thread Martin Peres
Tested on NVIDIA's proprietary driver version 346.35.

v2:
- test GL_ATOMIC_COUNTER_BUFFER (hackish since indexes are hardcoded)
- cosmetic changes in a switch
- fix a typo: inconsitent -> inconsistent
- require GL_ARB_separate_shader_objects
- compile some programs as separable

Signed-off-by: Martin Peres 
---
 .../arb_program_interface_query/CMakeLists.gl.txt  |1 +
 .../getprogramresourceiv.c | 1132 
 2 files changed, 1133 insertions(+)
 create mode 100755 
tests/spec/arb_program_interface_query/getprogramresourceiv.c

diff --git a/tests/spec/arb_program_interface_query/CMakeLists.gl.txt 
b/tests/spec/arb_program_interface_query/CMakeLists.gl.txt
index 2508342..91da8ac 100755
--- a/tests/spec/arb_program_interface_query/CMakeLists.gl.txt
+++ b/tests/spec/arb_program_interface_query/CMakeLists.gl.txt
@@ -14,3 +14,4 @@ piglit_add_executable 
(arb_program_interface_query-resource-query resource-query
 piglit_add_executable (arb_program_interface_query-getprograminterfaceiv 
getprograminterfaceiv.c)
 piglit_add_executable (arb_program_interface_query-getprogramresourceindex 
getprogramresourceindex.c)
 piglit_add_executable (arb_program_interface_query-getprogramresourcename 
getprogramresourcename.c)
+piglit_add_executable (arb_program_interface_query-getprogramresourceiv 
getprogramresourceiv.c)
diff --git a/tests/spec/arb_program_interface_query/getprogramresourceiv.c 
b/tests/spec/arb_program_interface_query/getprogramresourceiv.c
new file mode 100755
index 000..da9751a
--- /dev/null
+++ b/tests/spec/arb_program_interface_query/getprogramresourceiv.c
@@ -0,0 +1,1132 @@
+/*
+ * Copyright ?? 2015 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+/**
+ * \file getprogramresourceiv.c
+ *
+ * Tests the values returned by GetProgramResourceiv on multiple pipelines.
+ * Also checks some error cases.
+ *
+ * From the GL_ARB_program_interface_query spec:
+ *  "The command
+ *
+ *  void GetProgramResourceiv(uint program, enum programInterface,
+ *uint index, sizei propCount,
+ *const enum *props, sizei bufSize,
+ *sizei *length, int *params);
+ *
+ *  returns values for multiple properties of a single active resource with an
+ *  index of  in the interface  of program object
+ *  .  For each resource, values for  properties specified
+ *  by the array  are returned.  The error INVALID_VALUE is generated
+ *  if  is zero.  The error INVALID_ENUM is generated if any value
+ *  in  is not one of the properties described immediately below.  The
+ *  error INVALID_OPERATION is generated if any value in  is not
+ *  allowed for .  The set of allowed 
+ *  values for each property can be found in Table X.1.
+
+ *  The values associated with the properties of the active resource are
+ *  written to consecutive entries in , in increasing order according
+ *  to position in .  If no error is generated, only the first
+ *   integer values will be written to ; any extra values
+ *  will not be returned.  If  is not NULL, the actual number of
+ *  integer values written to  will be written to .
+ *
+ *Property Supported Interfaces
+ *---  
+ *NAME_LENGTH  all but ATOMIC_COUNTER_BUFFER
+ *
+ *TYPE UNIFORM, PROGRAM_INPUT, PROGRAM_OUTPUT,
+ *   TRANSFORM_FEEDBACK_VARYING,
+ *   BUFFER_VARIABLE
+ *
+ *ARRAY_SIZE   UNIFORM, BUFFER_VARIABLE, PROGRAM_INPUT,
+ *   PROGRAM_OUTPUT, VERTEX_SUBROUTINE_
+ *   UNIFORM, TESS_CONTROL_SUBROUTINE_UNIFORM,
+ *   T

Re: [Piglit] [PATCH v5 6/6] program_interface_query: add tests for getprogramresourceiv

2015-04-02 Thread Martin Peres



On 02/04/15 14:10, Tapani Pälli wrote:



On 04/01/2015 01:56 PM, Martin Peres wrote:

Tested on NVIDIA's proprietary driver version 346.35.

Signed-off-by: Martin Peres 
---
  .../arb_program_interface_query/CMakeLists.gl.txt  |1 +
  .../getprogramresourceiv.c | 1063 


  2 files changed, 1064 insertions(+)
  create mode 100755 
tests/spec/arb_program_interface_query/getprogramresourceiv.c


diff --git a/tests/spec/arb_program_interface_query/CMakeLists.gl.txt 
b/tests/spec/arb_program_interface_query/CMakeLists.gl.txt

index 2508342..91da8ac 100755
--- a/tests/spec/arb_program_interface_query/CMakeLists.gl.txt
+++ b/tests/spec/arb_program_interface_query/CMakeLists.gl.txt
@@ -14,3 +14,4 @@ piglit_add_executable 
(arb_program_interface_query-resource-query resource-query
  piglit_add_executable 
(arb_program_interface_query-getprograminterfaceiv 
getprograminterfaceiv.c)
  piglit_add_executable 
(arb_program_interface_query-getprogramresourceindex 
getprogramresourceindex.c)
  piglit_add_executable 
(arb_program_interface_query-getprogramresourcename 
getprogramresourcename.c)
+piglit_add_executable 
(arb_program_interface_query-getprogramresourceiv 
getprogramresourceiv.c)
diff --git 
a/tests/spec/arb_program_interface_query/getprogramresourceiv.c 
b/tests/spec/arb_program_interface_query/getprogramresourceiv.c

new file mode 100755
index 000..0f6239c
--- /dev/null
+++ b/tests/spec/arb_program_interface_query/getprogramresourceiv.c
@@ -0,0 +1,1063 @@
+/*
+ * Copyright © 2015 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person 
obtaining a
+ * copy of this software and associated documentation files (the 
"Software"),
+ * to deal in the Software without restriction, including without 
limitation


--- 8< ---


+};
+
+/* WARNING: ATOMIC_COUNTER_BUFFER is left untested because it is 
impossible to
+ * fetch the index of variables which means we cannot reliably test 
anything

+ */


One can fetch indices but do you mean it is impossible to verify the 
these indices later? You could cross-check indices against 
glGetActiveAtomicCounterBufferiv, not sure if this is worth it though 
because it will call the very same functionality anyway.


I meant that it is impossible to fetch the index of a atomic variable 
from its name. I can however compare the index with 
glGetActiveAtomicCounterBufferiv. Will do!





+
+static bool
+check_extensions_prop(GLenum prop)
+{
+/* First check the availability of the extensions */
+if (prop == GL_ATOMIC_COUNTER_BUFFER_INDEX &&
+ !piglit_is_extension_supported("GL_ARB_shader_atomic_counters")) {
+return false;
+}
+
+if ((prop == GL_TOP_LEVEL_ARRAY_SIZE ||
+prop == GL_TOP_LEVEL_ARRAY_STRIDE) &&
+ 
!piglit_is_extension_supported("GL_ARB_shader_storage_buffer_object")) {

+return false;
+}
+
+if ((prop == GL_NUM_COMPATIBLE_SUBROUTINES ||
+ prop == GL_COMPATIBLE_SUBROUTINES) &&
+ !piglit_is_extension_supported("GL_ARB_shader_subroutine")) {
+ return false;
+}
+
+if ((prop == GL_REFERENCED_BY_TESS_CONTROL_SHADER ||
+ prop == GL_REFERENCED_BY_TESS_EVALUATION_SHADER) &&
+ !piglit_is_extension_supported("GL_ARB_tessellation_shader")) {
+ return false;
+}
+
+if ((prop == GL_REFERENCED_BY_COMPUTE_SHADER ||
+ prop == GL_COMPUTE_SUBROUTINE_UNIFORM ||
+ prop == GL_IS_PER_PATCH) &&
+ !piglit_is_extension_supported("GL_ARB_compute_shader") &&
+ !piglit_is_extension_supported("GL_ARB_shader_image_load_store")) {
+ return false;
+}
+
+return true;
+}
+
+static bool
+is_resource_in_list(const char **list, const char *resource, int index,
+bool check_order)
+{
+int i = 0;
+while (list && list[i]) {
+if (strcmp(list[i], resource) == 0) {
+return !check_order || index == i;
+}
+i++;
+}
+
+return false;
+}
+
+static void
+basic_check(const char *subsubtest, int value, int expected_value, 
bool *pass)

+{
+/* no real check can be done other than checking that
+ * the index or offset is not invalid when it was
+ * supposed to be valid (or the other way round).
+ */
+if ((value >= 0  && expected_value == -1) ||
+(value == -1 && expected_value >= 0)) {
+const char *validity = expected_value == -1 ?
+   "an invalid" : "a valid";
+fprintf(stderr, "'%s' expected %s offset or index but "
+"got %i\n", subsubtest, validity, value);
+*pass = false;
+}
+}
+
+static void
+check_prop(GLuint prog, GLenum programInterface, int index, const 
char *name,

+   void *inputs, struct check_t c, bool *pass)
+{
+int values[10], parent_

Re: [Piglit] [PATCH 03/15] arb_direct_state_access: Testing NamedFramebufferRenderbuffer.

2015-04-02 Thread Martin Peres

On 06/03/15 04:01, Laura Ekstrand wrote:

---
  tests/all.py   |   1 +
  .../spec/arb_direct_state_access/CMakeLists.gl.txt |   1 +
  .../namedframebufferrenderbuffer.c | 159 +
  3 files changed, 161 insertions(+)
  create mode 100644 
tests/spec/arb_direct_state_access/namedframebufferrenderbuffer.c

diff --git a/tests/all.py b/tests/all.py
index cd85fc5..8e45442 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -4028,6 +4028,7 @@ spec['ARB_direct_state_access']['unmapnamedbuffer-vbo'] = 
PiglitGLTest(['arb_dir
  spec['ARB_direct_state_access']['flushmappednamedbufferrange'] = 
PiglitGLTest(['arb_direct_state_access-flushmappednamedbufferrange'], 
run_concurrent=True)
  spec['ARB_direct_state_access']['getnamedbufferparameter'] = 
PiglitGLTest(['arb_direct_state_access-getnamedbufferparameter'], 
run_concurrent=True)
  spec['ARB_direct_state_access']['getnamedbuffersubdata'] = 
PiglitGLTest(['arb_direct_state_access-getnamedbuffersubdata'], 
run_concurrent=True)
+spec['ARB_direct_state_access']['namedframebufferrenderbuffer'] = 
PiglitGLTest(['arb_direct_state_access-namedframebufferrenderbuffer'], 
run_concurrent=True)
  
  arb_shader_image_load_store = spec['ARB_shader_image_load_store']

  arb_shader_image_load_store['atomicity'] = 
PiglitGLTest(['arb_shader_image_load_store-atomicity'], run_concurrent=True)
diff --git a/tests/spec/arb_direct_state_access/CMakeLists.gl.txt 
b/tests/spec/arb_direct_state_access/CMakeLists.gl.txt
index a9b82eb..488ca18 100644
--- a/tests/spec/arb_direct_state_access/CMakeLists.gl.txt
+++ b/tests/spec/arb_direct_state_access/CMakeLists.gl.txt
@@ -25,6 +25,7 @@ piglit_add_executable 
(arb_direct_state_access-unmapnamedbuffer-vbo unmapnamedbu
  piglit_add_executable (arb_direct_state_access-flushmappednamedbufferrange 
flushmappednamedbufferrange.c)
  piglit_add_executable (arb_direct_state_access-getnamedbufferparameter 
getnamedbufferparameter.c)
  piglit_add_executable (arb_direct_state_access-getnamedbuffersubdata 
getnamedbuffersubdata.c)
+piglit_add_executable (arb_direct_state_access-namedframebufferrenderbuffer 
namedframebufferrenderbuffer.c)
  piglit_add_executable (arb_direct_state_access-dsa-textures dsa-textures.c 
dsa-utils.c)
  piglit_add_executable (arb_direct_state_access-texturesubimage 
texturesubimage.c)
  piglit_add_executable (arb_direct_state_access-bind-texture-unit 
bind-texture-unit.c)
diff --git a/tests/spec/arb_direct_state_access/namedframebufferrenderbuffer.c 
b/tests/spec/arb_direct_state_access/namedframebufferrenderbuffer.c
new file mode 100644
index 000..df82400
--- /dev/null
+++ b/tests/spec/arb_direct_state_access/namedframebufferrenderbuffer.c
@@ -0,0 +1,159 @@
+/*
+ * Copyright (c) 2012 VMware, Inc.
+ * Copyright 2015 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+/**
+ * Test glViewport w/ FBOs.
+ * In Mesa, on-screen windows and user-created FBOs are stored differently
+ * (inverted).  Make sure viewports are handled properly.
+ * Draw a test pattern (with many viewports) into the window, then draw the
+ * same thing into an FBO.  Compare the images.  They should be the same.
+ */
+
+#include "piglit-util-gl.h"
+
+PIGLIT_GL_TEST_CONFIG_BEGIN
+
+   config.supports_gl_compat_version = 10;

20 minimum and ask for core = 32;

+
+   config.window_width = 500;
+   config.window_height = 500;
+   config.window_visual = PIGLIT_GL_VISUAL_RGB | PIGLIT_GL_VISUAL_DOUBLE;
+
+PIGLIT_GL_TEST_CONFIG_END
+
+/**
+ * Draw an rgbw texture in a bunch of viewports which tile the window.
+ * Note that viewports extend beyond the edges of the window too.
+ */
+static void
+draw_test_image(void)
+{
+   int vx, vy, vw = 200, vh = 200;
+   GLuint texture;
+
+   texture = piglit_rgbw_texture(GL_RGBA8, 32, 32, GL_FALSE, GL_FALSE,
+ GL_UNSIG

Re: [Piglit] [PATCH 01/15] arb_direct_state_access: Test for CreateFramebuffers.

2015-04-02 Thread Martin Peres

On 01/04/15 20:34, Anuj Phogat wrote:

On Thu, Mar 5, 2015 at 6:01 PM, Laura Ekstrand  wrote:

---
  .../arb_direct_state_access/create-framebuffers.c  | 76 ++
  1 file changed, 76 insertions(+)
  create mode 100644 tests/spec/arb_direct_state_access/create-framebuffers.c

diff --git a/tests/spec/arb_direct_state_access/create-framebuffers.c 
b/tests/spec/arb_direct_state_access/create-framebuffers.c
new file mode 100644
index 000..97ba454
--- /dev/null
+++ b/tests/spec/arb_direct_state_access/create-framebuffers.c
@@ -0,0 +1,76 @@
+/*
+ * Copyright 2015 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+/** @file create_framebuffers.c

create-framebuffers.c

+ *
+ * Tests glCreateFramebuffers to see if it behaves in the expected way,
+ * throwing the correct errors, etc.
+ */
+
+#include "piglit-util-gl.h"
+#include "dsa-utils.h"
+
+PIGLIT_GL_TEST_CONFIG_BEGIN
+
+   config.supports_gl_core_version = 32;
+
+   config.window_visual = PIGLIT_GL_VISUAL_RGBA |
+   PIGLIT_GL_VISUAL_DOUBLE;
+
+PIGLIT_GL_TEST_CONFIG_END
+
+void
+piglit_init(int argc, char **argv)
+{
+   piglit_require_extension("GL_ARB_direct_state_access");
+}
+
+enum piglit_result
+piglit_display(void)
+{
+   bool pass = true;
+   GLuint name;
+
+   /* Throw some invalid inputs at glCreateFramebuffers. */
+
+   /* n is negative */
+   glCreateFramebuffers(-1, &name);
+   SUBTEST(GL_INVALID_VALUE, pass, "n < 0");
+
+   /* name is not a valid pointer */
+   glCreateFramebuffers(1, NULL);
+   SUBTEST(GL_NO_ERROR, pass, "framebuffers = NULL");
+
+
+   /* Check if it actually generates a real framebuffer object */
+
+   glCreateFramebuffers(1, &name);
+   pass = piglit_check_gl_error(GL_NO_ERROR) && pass;
+   SUBTESTCONDITION((bool) glIsFramebuffer(name), pass,
+"IsFramebuffer()");
+
+   glDeleteFramebuffers(1, &name);
+
+   return pass ? PIGLIT_PASS : PIGLIT_FAIL;
+}
+
--
2.1.0

With above comment fixed:
Reviewed-by: Anuj Phogat 

With the above comment fixed + the inclusion in all.py:
Reviewed-by: Martin Peres 
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH 02/15] arb_direct_state_access: Testing glCreateFramebuffers "in the wild."

2015-04-02 Thread Martin Peres

On 01/04/15 21:03, Anuj Phogat wrote:

On Thu, Mar 5, 2015 at 6:01 PM, Laura Ekstrand  wrote:

---
  tests/spec/arb_direct_state_access/gettextureimage-formats.c   | 2 +-
  tests/spec/arb_direct_state_access/gettextureimage-luminance.c | 4 ++--
  2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/tests/spec/arb_direct_state_access/gettextureimage-formats.c 
b/tests/spec/arb_direct_state_access/gettextureimage-formats.c
index e2d637c..f00726c 100644
--- a/tests/spec/arb_direct_state_access/gettextureimage-formats.c
+++ b/tests/spec/arb_direct_state_access/gettextureimage-formats.c
@@ -95,7 +95,7 @@ make_texture_image(GLenum intFormat, GLubyte 
upperRightTexel[4])
 }

 /* Initialize the texture with glDrawPixels. */
-   glGenFramebuffers(1, &fb);
+   glCreateFramebuffers(1, &fb);
 glBindFramebuffer(GL_FRAMEBUFFER, fb);
 glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0,
GL_TEXTURE_2D, texture_id, 0);
diff --git a/tests/spec/arb_direct_state_access/gettextureimage-luminance.c 
b/tests/spec/arb_direct_state_access/gettextureimage-luminance.c
index 3add1d7..ec6a2cc 100644
--- a/tests/spec/arb_direct_state_access/gettextureimage-luminance.c
+++ b/tests/spec/arb_direct_state_access/gettextureimage-luminance.c
@@ -158,7 +158,7 @@ test_fbo_readpixels_lum_as_rgba(void)
 /* create an FBO to wrap the texture so we can read it back
  * with glReadPixels
  */
-   glGenFramebuffers(1, &fbo);
+   glCreateFramebuffers(1, &fbo);
 glBindFramebuffer(GL_FRAMEBUFFER, fbo);
 glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0_EXT,
GL_TEXTURE_2D, tex, 0);
@@ -211,7 +211,7 @@ test_fbo_readpixels_rgba_as_lum(void)
 /* create an FBO to wrap the texture so we can read it back
  * with glReadPixels
  */
-   glGenFramebuffers(1, &fbo);
+   glCreateFramebuffers(1, &fbo);
 glBindFramebuffer(GL_FRAMEBUFFER, fbo);
 glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0_EXT,
GL_TEXTURE_2D, tex, 0);
--
2.1.0

___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit

Reviewed-by: Anuj Phogat 

Reviewed-by: Martin Peres 

___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH 15/15] arb_direct_state_access: Testing glGetNamedBufferSubData.

2015-04-02 Thread Martin Peres

On 23/01/15 21:03, Laura Ekstrand wrote:

---
  tests/all.py   |   1 +
  .../spec/arb_direct_state_access/CMakeLists.gl.txt |   1 +
  .../getnamedbuffersubdata.c| 112 +
  3 files changed, 114 insertions(+)
  create mode 100644 tests/spec/arb_direct_state_access/getnamedbuffersubdata.c

diff --git a/tests/all.py b/tests/all.py
index 3d41046..a53e268 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -4430,6 +4430,7 @@ 
spec['ARB_direct_state_access']['mapnamedbuffer-pbo-readpixels'] = PiglitGLTest(
  spec['ARB_direct_state_access']['unmapnamedbuffer-vbo'] = 
PiglitGLTest(['arb_direct_state_access-unmapnamedbuffer-vbo'], 
run_concurrent=True)
  spec['ARB_direct_state_access']['flushmappednamedbufferrange'] = 
PiglitGLTest(['arb_direct_state_access-flushmappednamedbufferrange'], 
run_concurrent=True)
  spec['ARB_direct_state_access']['getnamedbufferparameter'] = 
PiglitGLTest(['arb_direct_state_access-getnamedbufferparameter'], 
run_concurrent=True)
+spec['ARB_direct_state_access']['getnamedbuffersubdata'] = 
PiglitGLTest(['arb_direct_state_access-getnamedbuffersubdata'], 
run_concurrent=True)
  
  profile.tests['hiz'] = hiz

  profile.tests['fast_color_clear'] = fast_color_clear
diff --git a/tests/spec/arb_direct_state_access/CMakeLists.gl.txt 
b/tests/spec/arb_direct_state_access/CMakeLists.gl.txt
index cd14397..d839af7 100644
--- a/tests/spec/arb_direct_state_access/CMakeLists.gl.txt
+++ b/tests/spec/arb_direct_state_access/CMakeLists.gl.txt
@@ -17,6 +17,7 @@ piglit_add_executable 
(arb_direct_state_access-mapnamedbuffer-pbo-readpixels map
  piglit_add_executable (arb_direct_state_access-unmapnamedbuffer-vbo 
unmapnamedbuffer-vbo.c)
  piglit_add_executable (arb_direct_state_access-flushmappednamedbufferrange 
flushmappednamedbufferrange.c)
  piglit_add_executable (arb_direct_state_access-getnamedbufferparameter 
getnamedbufferparameter.c)
+piglit_add_executable (arb_direct_state_access-getnamedbuffersubdata 
getnamedbuffersubdata.c)
  piglit_add_executable (arb_direct_state_access-dsa-textures dsa-textures.c 
dsa-utils.c)
  piglit_add_executable (arb_direct_state_access-texturesubimage 
texturesubimage.c)
  piglit_add_executable (arb_direct_state_access-bind-texture-unit 
bind-texture-unit.c)
diff --git a/tests/spec/arb_direct_state_access/getnamedbuffersubdata.c 
b/tests/spec/arb_direct_state_access/getnamedbuffersubdata.c
new file mode 100644
index 000..2837c2e
--- /dev/null
+++ b/tests/spec/arb_direct_state_access/getnamedbuffersubdata.c
@@ -0,0 +1,112 @@
+/*
+ * Copyright © 2013, 2015 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+/** @file getnamedbuffersubdata.c
+ *
+ * Tests that glBufferSubData() synchronizes correctly with
+ * glCopyBufferSubData().
+ *
+ * We make sure that a subdata over the read buffer after the copy has
+ * no effect, while a subdata over the write buffer after the copy
+ * does have an effect.
+ *
+ * Adapted to test glGetNamedBufferSubData by Laura Ekstrand
+ * , January 2015.
+ */
+
+#include "piglit-util-gl.h"
+
+PIGLIT_GL_TEST_CONFIG_BEGIN
+
+   config.supports_gl_compat_version = 15;

20

+   config.supports_gl_core_version = 31;

32

+
+   config.window_visual = PIGLIT_GL_VISUAL_RGB | PIGLIT_GL_VISUAL_DOUBLE;
+
+PIGLIT_GL_TEST_CONFIG_END
+
+void
+piglit_init(int argc, char *argv[])
+{
+   piglit_require_extension("GL_ARB_direct_state_access");
+   piglit_require_extension("GL_ARB_copy_buffer");
+}
+
+enum piglit_result
+piglit_display(void)
+{
+   bool pass = true;
+   uint32_t dummy_data_1[4], dummy_data_2[4];
+   uint32_t good_data[4] = {0, 1, 2, 3};
+   uint32_t result_data[4];
+   bool subtest_pass;
+   size_t size = sizeof(good_data);
+   GLuint read_buffer, write_buffer;
+
+   memset(dummy_data_1, 0xaa, size);
+   memset(dummy_data_2, 0xbb, s

Re: [Piglit] [PATCH 13/15] arb_direct_state_access: Testing glGetNamedBufferParameteri[64]v.

2015-04-02 Thread Martin Peres



On 23/01/15 21:03, Laura Ekstrand wrote:

---
  tests/all.py   |   1 +
  .../spec/arb_direct_state_access/CMakeLists.gl.txt |   1 +
  .../getnamedbufferparameter.c  | 215 +
  3 files changed, 217 insertions(+)
  create mode 100644 
tests/spec/arb_direct_state_access/getnamedbufferparameter.c

diff --git a/tests/all.py b/tests/all.py
index c146bff..3d41046 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -4429,6 +4429,7 @@ 
spec['ARB_direct_state_access']['clearnamedbuffersubdata-invalid-size'] = Piglit
  spec['ARB_direct_state_access']['mapnamedbuffer-pbo-readpixels'] = 
PiglitGLTest(['arb_direct_state_access-mapnamedbuffer-pbo-readpixels'], 
run_concurrent=True)
  spec['ARB_direct_state_access']['unmapnamedbuffer-vbo'] = 
PiglitGLTest(['arb_direct_state_access-unmapnamedbuffer-vbo'], 
run_concurrent=True)
  spec['ARB_direct_state_access']['flushmappednamedbufferrange'] = 
PiglitGLTest(['arb_direct_state_access-flushmappednamedbufferrange'], 
run_concurrent=True)
+spec['ARB_direct_state_access']['getnamedbufferparameter'] = 
PiglitGLTest(['arb_direct_state_access-getnamedbufferparameter'], 
run_concurrent=True)
  
  profile.tests['hiz'] = hiz

  profile.tests['fast_color_clear'] = fast_color_clear
diff --git a/tests/spec/arb_direct_state_access/CMakeLists.gl.txt 
b/tests/spec/arb_direct_state_access/CMakeLists.gl.txt
index 3523e5d..cd14397 100644
--- a/tests/spec/arb_direct_state_access/CMakeLists.gl.txt
+++ b/tests/spec/arb_direct_state_access/CMakeLists.gl.txt
@@ -16,6 +16,7 @@ piglit_add_executable 
(arb_direct_state_access-clearnamedbuffersubdata-invalid-s
  piglit_add_executable (arb_direct_state_access-mapnamedbuffer-pbo-readpixels 
mapnamedbuffer-pbo-readpixels.c)
  piglit_add_executable (arb_direct_state_access-unmapnamedbuffer-vbo 
unmapnamedbuffer-vbo.c)
  piglit_add_executable (arb_direct_state_access-flushmappednamedbufferrange 
flushmappednamedbufferrange.c)
+piglit_add_executable (arb_direct_state_access-getnamedbufferparameter 
getnamedbufferparameter.c)
  piglit_add_executable (arb_direct_state_access-dsa-textures dsa-textures.c 
dsa-utils.c)
  piglit_add_executable (arb_direct_state_access-texturesubimage 
texturesubimage.c)
  piglit_add_executable (arb_direct_state_access-bind-texture-unit 
bind-texture-unit.c)
diff --git a/tests/spec/arb_direct_state_access/getnamedbufferparameter.c 
b/tests/spec/arb_direct_state_access/getnamedbufferparameter.c
new file mode 100644
index 000..82bbfe2
--- /dev/null
+++ b/tests/spec/arb_direct_state_access/getnamedbufferparameter.c
@@ -0,0 +1,215 @@
+/**
+ * Copyright © 2013, 2015 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+/**
+ * Adapted to test glGetNamedBufferParameteri[64]v by Laura Ekstrand
+ * .
+ */
+
+#include "piglit-util-gl.h"
+
+PIGLIT_GL_TEST_CONFIG_BEGIN
+
+   config.supports_gl_compat_version = 10;

Here too :)

+
+   config.window_visual = PIGLIT_GL_VISUAL_RGB | PIGLIT_GL_VISUAL_DOUBLE;
+
+PIGLIT_GL_TEST_CONFIG_END
+
+void
+piglit_init(int argc, char **argv)
+{
+   piglit_require_extension("GL_ARB_direct_state_access");
+   piglit_require_extension("GL_ARB_map_buffer_range");

Again, the above extension would not be needed with gl_core_compat = 32;

+}
+
+static bool
+storage_test(void)
+{
+   GLuint buffer;
+   bool pass = true;
+   GLint64 data = -2;
+
+   glCreateBuffers(1, &buffer);
+
+   /* Is it mutable? */
+   glGetNamedBufferParameteri64v(buffer, GL_BUFFER_IMMUTABLE_STORAGE,
+ &data);
+   if (data == GL_TRUE) {
+   printf("GL_BUFFER_IMMUTABLE_STORAGE: expected mutable, "
+  "got immutable.\n");
+   pass = false;
+   }
+   pass = piglit_check_gl_error(GL_NO_ERROR) && pass;
+
+   glNamedBufferStorage(buffer, 12 * 4 * sizeof(float)

Re: [Piglit] [PATCH 12/15] arb_direct_state_access: Testing FlushMappedNamedBufferRange.

2015-04-01 Thread Martin Peres
ns, so using offsets which are multiples
+ * of 0x100 is bad.
+ */
+void
+piglit_init(int argc, char *argv[])
+{
+   uint8_t *ptr;
+   uint8_t temp_data[100];
+   GLuint target, verify;
+   int i;
+   bool ret;
+
+   piglit_require_gl_version(15);
+
+   piglit_require_extension("GL_ARB_map_buffer_range");
+   piglit_require_extension("GL_ARB_direct_state_access");
+
+   for (i = 0; i < sizeof(data); i++) {
+   data[i] = i & 0xff;
+   }
+
+   for (i = 0; i < 100; i++) {
+   temp_data[i] = i;
+   }
+
+   glCreateBuffers(1, &target);
+   glCreateBuffers(1, &verify);
+   glNamedBufferData(target, sizeof(data), data, GL_STATIC_DRAW);
+   glNamedBufferData(verify, 0x1000, NULL, GL_STREAM_READ);
+
+   glGetError();
+
+   /* Validate that reads work, this is required for remaining ops */
+   ret = verify_buffer(target, 0x201, 100, &data[0x201]);
+   if (!ret)
+   piglit_report_result(PIGLIT_FAIL);
+
+   /* 3b: test with flushed range */
+   ptr = glMapNamedBufferRange(target, 0xb002, 100,
+   GL_MAP_WRITE_BIT |
+   GL_MAP_FLUSH_EXPLICIT_BIT |
+   GL_MAP_UNSYNCHRONIZED_BIT);
+   memcpy(ptr, temp_data, 100);
+   glFlushMappedNamedBufferRange(target, 0xb002, 100);
+   glUnmapNamedBuffer(target);
+   glCopyNamedBufferSubData(target, verify, 0xb002, 100, 100);
+   ret = verify_buffer(verify, 100, 100, temp_data);
+   if (!ret)
+   piglit_report_result(PIGLIT_FAIL);
+
+   piglit_report_result(PIGLIT_PASS);
+}
This test is also quite problematic since it is hard to detect that a 
cache did not get written back ... in your back.


Anyway, this tests the DSA path so it is fine.

Reviewed-by: Martin Peres 
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH 11/15] arb_direct_state_access: Testing UnmapNamedBuffer.

2015-04-01 Thread Martin Peres



On 23/01/15 21:03, Laura Ekstrand wrote:

---
  tests/all.py   |   1 +
  .../spec/arb_direct_state_access/CMakeLists.gl.txt |   1 +
  .../mapnamedbuffer-pbo-readpixels.c|   6 +-
  .../arb_direct_state_access/unmapnamedbuffer-vbo.c | 128 +
  4 files changed, 133 insertions(+), 3 deletions(-)
  create mode 100644 tests/spec/arb_direct_state_access/unmapnamedbuffer-vbo.c

diff --git a/tests/all.py b/tests/all.py
index 76c4070..e7d0843 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -4427,6 +4427,7 @@ 
spec['ARB_direct_state_access']['namedbuffersubdata-vbo-sync'] = PiglitGLTest(['
  
spec['ARB_direct_state_access']['clearnamedbufferdata-invalid-internal-format'] 
= 
PiglitGLTest(['arb_direct_state_access-clearnamedbufferdata-invalid-internal-format'],
 run_concurrent=True)
  spec['ARB_direct_state_access']['clearnamedbuffersubdata-invalid-size'] = 
PiglitGLTest(['arb_direct_state_access-clearnamedbuffersubdata-invalid-size'], 
run_concurrent=True)
  spec['ARB_direct_state_access']['mapnamedbuffer-pbo-readpixels'] = 
PiglitGLTest(['arb_direct_state_access-mapnamedbuffer-pbo-readpixels'], 
run_concurrent=True)
+spec['ARB_direct_state_access']['unmapnamedbuffer-vbo'] = 
PiglitGLTest(['arb_direct_state_access-unmapnamedbuffer-vbo'], 
run_concurrent=True)
  
  profile.tests['hiz'] = hiz

  profile.tests['fast_color_clear'] = fast_color_clear
diff --git a/tests/spec/arb_direct_state_access/CMakeLists.gl.txt 
b/tests/spec/arb_direct_state_access/CMakeLists.gl.txt
index 37396e4..d0b92aa 100644
--- a/tests/spec/arb_direct_state_access/CMakeLists.gl.txt
+++ b/tests/spec/arb_direct_state_access/CMakeLists.gl.txt
@@ -14,6 +14,7 @@ piglit_add_executable 
(arb_direct_state_access-namedbuffersubdata-vbo-sync named
  piglit_add_executable 
(arb_direct_state_access-clearnamedbufferdata-invalid-internal-format 
clearnamedbufferdata-invalid-internal-format.c)
  piglit_add_executable 
(arb_direct_state_access-clearnamedbuffersubdata-invalid-size 
clearnamedbuffersubdata-invalid-size.c)
  piglit_add_executable (arb_direct_state_access-mapnamedbuffer-pbo-readpixels 
mapnamedbuffer-pbo-readpixels.c)
+piglit_add_executable (arb_direct_state_access-unmapnamedbuffer-vbo 
unmapnamedbuffer-vbo.c)
  piglit_add_executable (arb_direct_state_access-dsa-textures dsa-textures.c 
dsa-utils.c)
  piglit_add_executable (arb_direct_state_access-texturesubimage 
texturesubimage.c)
  piglit_add_executable (arb_direct_state_access-bind-texture-unit 
bind-texture-unit.c)
diff --git a/tests/spec/arb_direct_state_access/mapnamedbuffer-pbo-readpixels.c 
b/tests/spec/arb_direct_state_access/mapnamedbuffer-pbo-readpixels.c
index 6e94a96..cf7fc6f 100644
--- a/tests/spec/arb_direct_state_access/mapnamedbuffer-pbo-readpixels.c
+++ b/tests/spec/arb_direct_state_access/mapnamedbuffer-pbo-readpixels.c
@@ -87,21 +87,21 @@ piglit_display(void)
pass &= probe(1, 0, 0xff00, addr[1]);
pass &= probe(0, 1, 0x00ff, addr[2]);
pass &= probe(1, 1, 0x00ff, addr[3]);
-   glUnmapBuffer(GL_PIXEL_PACK_BUFFER);
+   glUnmapNamedBuffer(pbo);
  
  	/* Read with an offset. */

glReadPixels(1, 0, 1, 1,
 GL_BGRA, GL_UNSIGNED_BYTE, (void *)(uintptr_t)4);
addr = glMapNamedBuffer(pbo, GL_READ_ONLY);
pass &= probe(1, 0, 0xff00, addr[1]);
-   glUnmapBuffer(GL_PIXEL_PACK_BUFFER);
+   glUnmapNamedBuffer(pbo);
  
  	/* Read with an offset. */

glReadPixels(1, 1, 1, 1,
 GL_BGRA, GL_UNSIGNED_BYTE, (void *)(uintptr_t)4);
addr = glMapNamedBuffer(pbo, GL_READ_ONLY);
pass &= probe(1, 1, 0x00ff, addr[1]);
-   glUnmapBuffer(GL_PIXEL_PACK_BUFFER);
+   glUnmapNamedBuffer(pbo);
  
  	piglit_present_results();


Same comment as before. You are not developing mesa anymore so let's 
avoid potentially breaking bisectability for no good reason.
  
diff --git a/tests/spec/arb_direct_state_access/unmapnamedbuffer-vbo.c b/tests/spec/arb_direct_state_access/unmapnamedbuffer-vbo.c

new file mode 100644
index 000..eac88ae
--- /dev/null
+++ b/tests/spec/arb_direct_state_access/unmapnamedbuffer-vbo.c
@@ -0,0 +1,128 @@
+/*
+ * Copyright © 2009, 2015 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INC

Re: [Piglit] [PATCH 10/15] arb_direct_state_access: Testing MapNamedBuffer.

2015-04-01 Thread Martin Peres
uot;Probe color at (%i,%i)\n", x, y);
+   printf("  Expected: 0x%08x\n", expected);
+   printf("  Observed: 0x%08x\n", observed);
+
+   return GL_FALSE;
+   } else {
+   return GL_TRUE;
+   }
+}
+
+enum piglit_result
+piglit_display(void)
+{
+   GLboolean pass = GL_TRUE;
+   uint32_t *addr;
+   GLuint pbo;
+
+   glClearColor(0.0, 0.0, 0.0, 0.0);
+   glClear(GL_COLOR_BUFFER_BIT);
+
+   glCreateBuffers(1, &pbo);
+   glNamedBufferData(pbo, 4 * 4, NULL, GL_STREAM_DRAW);
+   glPixelStorei(GL_PACK_ALIGNMENT, 1);
+
+   glViewport(0, 0, 2, 2);
+   piglit_ortho_projection(2, 2, GL_FALSE);
+   glBindBuffer(GL_PIXEL_PACK_BUFFER, pbo);
+
+   /* bottom: green.  top: blue. */
+   glColor4f(0.0, 1.0, 0.0, 0.0);
+   piglit_draw_rect(0, 0, 2, 1);
+   glColor4f(0.0, 0.0, 1.0, 0.0);
+   piglit_draw_rect(0, 1, 2, 1);
+
+   /* Read the whole buffer. */
+   glReadPixels(0, 0, 2, 2,
+GL_BGRA, GL_UNSIGNED_BYTE, (void *)(uintptr_t)0);
+   addr = glMapNamedBuffer(pbo, GL_READ_ONLY);
+   pass &= probe(0, 0, 0xff00, addr[0]);
+   pass &= probe(1, 0, 0xff00, addr[1]);
+   pass &= probe(0, 1, 0x00ff, addr[2]);
+   pass &= probe(1, 1, 0x00ff, addr[3]);
+   glUnmapBuffer(GL_PIXEL_PACK_BUFFER);
+
+   /* Read with an offset. */
+   glReadPixels(1, 0, 1, 1,
+GL_BGRA, GL_UNSIGNED_BYTE, (void *)(uintptr_t)4);
+   addr = glMapNamedBuffer(pbo, GL_READ_ONLY);
+   pass &= probe(1, 0, 0xff00, addr[1]);
+   glUnmapBuffer(GL_PIXEL_PACK_BUFFER);
+
+   /* Read with an offset. */
+   glReadPixels(1, 1, 1, 1,
+GL_BGRA, GL_UNSIGNED_BYTE, (void *)(uintptr_t)4);
+   addr = glMapNamedBuffer(pbo, GL_READ_ONLY);
+   pass &= probe(1, 1, 0x00ff, addr[1]);
+   glUnmapBuffer(GL_PIXEL_PACK_BUFFER);
+
+   piglit_present_results();
+
+   glDeleteBuffers(1, &pbo);
+
+   return pass ? PIGLIT_PASS : PIGLIT_FAIL;
+}
+
+
+void
+piglit_init(int argc, char **argv)
+{
+   piglit_require_extension("GL_ARB_pixel_buffer_object");
+   piglit_require_extension("GL_ARB_direct_state_access");
+   piglit_ortho_projection(piglit_width, piglit_height, GL_FALSE);

This seems unnecessary.

Otherwise, this looks good to me:

Reviewed-by: Martin Peres


+}


___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH 08/15] arb_direct_state_access: Testing glClearNamedBufferSubData.

2015-04-01 Thread Martin Peres



On 23/01/15 21:03, Laura Ekstrand wrote:

---
  tests/all.py   |   1 +
  .../spec/arb_direct_state_access/CMakeLists.gl.txt |   1 +
  .../clearnamedbuffersubdata-invalid-size.c | 100 +
  3 files changed, 102 insertions(+)
  create mode 100644 
tests/spec/arb_direct_state_access/clearnamedbuffersubdata-invalid-size.c

diff --git a/tests/all.py b/tests/all.py
index 7fbadea..dee8b3b 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -4425,6 +4425,7 @@ spec['ARB_direct_state_access']['texture-buffer-range'] = 
PiglitGLTest(['arb_dir
  spec['ARB_direct_state_access']['namedbufferstorage-persistent'] = 
PiglitGLTest(['arb_direct_state_access-namedbufferstorage-persistent'], 
run_concurrent=True)
  spec['ARB_direct_state_access']['namedbuffersubdata-vbo-sync'] = 
PiglitGLTest(['arb_direct_state_access-namedbuffersubdata-vbo-sync'], 
run_concurrent=True)
  
spec['ARB_direct_state_access']['clearnamedbufferdata-invalid-internal-format'] 
= 
PiglitGLTest(['arb_direct_state_access-clearnamedbufferdata-invalid-internal-format'],
 run_concurrent=True)
+spec['ARB_direct_state_access']['clearnamedbuffersubdata-invalid-size'] = 
PiglitGLTest(['arb_direct_state_access-clearnamedbuffersubdata-invalid-size'], 
run_concurrent=True)
  
  profile.tests['hiz'] = hiz

  profile.tests['fast_color_clear'] = fast_color_clear
diff --git a/tests/spec/arb_direct_state_access/CMakeLists.gl.txt 
b/tests/spec/arb_direct_state_access/CMakeLists.gl.txt
index 6bdedbe..3afd698 100644
--- a/tests/spec/arb_direct_state_access/CMakeLists.gl.txt
+++ b/tests/spec/arb_direct_state_access/CMakeLists.gl.txt
@@ -12,6 +12,7 @@ link_libraries (
  piglit_add_executable (arb_direct_state_access-namedbufferstorage-persistent 
namedbufferstorage.c)
  piglit_add_executable (arb_direct_state_access-namedbuffersubdata-vbo-sync 
namedbuffersubdata-vbo-sync.c)
  piglit_add_executable 
(arb_direct_state_access-clearnamedbufferdata-invalid-internal-format 
clearnamedbufferdata-invalid-internal-format.c)
+piglit_add_executable 
(arb_direct_state_access-clearnamedbuffersubdata-invalid-size 
clearnamedbuffersubdata-invalid-size.c)
  piglit_add_executable (arb_direct_state_access-dsa-textures dsa-textures.c 
dsa-utils.c)
  piglit_add_executable (arb_direct_state_access-texturesubimage 
texturesubimage.c)
  piglit_add_executable (arb_direct_state_access-bind-texture-unit 
bind-texture-unit.c)
diff --git 
a/tests/spec/arb_direct_state_access/clearnamedbuffersubdata-invalid-size.c 
b/tests/spec/arb_direct_state_access/clearnamedbuffersubdata-invalid-size.c
new file mode 100644
index 000..a1557c6
--- /dev/null
+++ b/tests/spec/arb_direct_state_access/clearnamedbuffersubdata-invalid-size.c
@@ -0,0 +1,100 @@
+/*
+ * Copyright © 2014, 2015 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+/**
+ * \file clearnamedbuffersubdata-invalid-size.c
+ *
+ * From the GL_ARB_clear_buffer_object spec:
+ * "If  or  is less than zero, or if  +  is greater
+ *  than the value of BUFFER_SIZE for the buffer bound to  then the
+ *  error INVALID_VALUE is generated."
+ * and
+ * "Both  and  must be multiples of the number of basic machine
+ *  units per-element for that internal format specified by ,
+ *  otherwise the error INVALID_VALUE is generated."
+ *
+ *  Adapted to test glClearNamedBufferSubData by Laura Ekstrand
+ *  , January 2015.
+ */
+
+#include "piglit-util-gl.h"
+
+PIGLIT_GL_TEST_CONFIG_BEGIN
+
+   config.supports_gl_compat_version = 15;
+   config.supports_gl_core_version = 31;
+
+PIGLIT_GL_TEST_CONFIG_END
+
+static GLuint buffer;
+
+void
+piglit_init(int argc, char **argv)
+{
+   bool pass = true;

Re: [Piglit] [PATCH 07/15] arb_direct_state_access: Testing glClearNamedBufferData.

2015-04-01 Thread Martin Peres
D
+
+
+static const struct {
+   GLenum internal_format;
+   GLenum format;
+   GLenum type;
+} formats[] = {
+   /* legacy OpenGL 1.0 "formats" */
+   {1, GL_ALPHA, GL_UNSIGNED_BYTE},
+   {2, GL_LUMINANCE_ALPHA, GL_UNSIGNED_BYTE},
+   {3, GL_RGB, GL_UNSIGNED_BYTE},
+   {4, GL_RGBA, GL_UNSIGNED_BYTE},
+
+   /* unsized formats */
+   {GL_ALPHA, GL_ALPHA, GL_UNSIGNED_BYTE},
+   {GL_DEPTH_COMPONENT, GL_DEPTH_COMPONENT, GL_UNSIGNED_BYTE},
+   {GL_LUMINANCE, GL_LUMINANCE, GL_UNSIGNED_BYTE},
+   {GL_LUMINANCE_ALPHA, GL_LUMINANCE_ALPHA, GL_UNSIGNED_BYTE},
+   {GL_INTENSITY, GL_INTENSITY, GL_UNSIGNED_BYTE},
+   {GL_RGB, GL_RGB, GL_UNSIGNED_BYTE},
+   {GL_RGBA, GL_RGBA, GL_UNSIGNED_BYTE},
+
+   /* depth formats */
+   {GL_DEPTH_COMPONENT16, GL_DEPTH_COMPONENT, GL_UNSIGNED_SHORT},
+   {GL_DEPTH_COMPONENT24, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT},
+   {GL_DEPTH_COMPONENT32, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT},
+
+   /* component not multiple of 8 bit wide */
+   {GL_ALPHA4, GL_ALPHA, GL_UNSIGNED_BYTE},
+   {GL_ALPHA12, GL_ALPHA, GL_UNSIGNED_SHORT},
+   {GL_LUMINANCE4, GL_LUMINANCE, GL_UNSIGNED_BYTE},
+   {GL_LUMINANCE12, GL_LUMINANCE, GL_UNSIGNED_SHORT},
+   {GL_LUMINANCE12_ALPHA4, GL_LUMINANCE_ALPHA, GL_UNSIGNED_INT},
+   {GL_LUMINANCE12_ALPHA12, GL_LUMINANCE_ALPHA, GL_UNSIGNED_INT},
+   {GL_INTENSITY4, GL_INTENSITY, GL_UNSIGNED_BYTE},
+   {GL_INTENSITY12, GL_INTENSITY, GL_UNSIGNED_SHORT},
+   {GL_R3_G3_B2, GL_RGB, GL_UNSIGNED_BYTE_3_3_2},
+   {GL_RGB4, GL_RGB, GL_UNSIGNED_SHORT_4_4_4_4},
+   {GL_RGB5, GL_RGB, GL_UNSIGNED_SHORT_5_5_5_1},
+   {GL_RGB10, GL_RGB, GL_UNSIGNED_INT_10_10_10_2},
+   {GL_RGB12, GL_RGB, GL_UNSIGNED_SHORT},
+   {GL_RGBA2, GL_RGBA, GL_UNSIGNED_BYTE},
+   {GL_RGBA4, GL_RGBA, GL_UNSIGNED_SHORT_4_4_4_4},
+   {GL_RGB5_A1, GL_RGBA, GL_UNSIGNED_SHORT_5_5_5_1},
+   {GL_RGB10_A2, GL_RGBA, GL_UNSIGNED_INT_10_10_10_2},
+   {GL_RGBA12, GL_RGBA, GL_UNSIGNED_SHORT},
+
+   /* format not multiple of 32 bit wide */
+   {GL_RGB8, GL_RGB, GL_UNSIGNED_BYTE},
+
+   /* compressed formats */
+   {GL_COMPRESSED_ALPHA, GL_ALPHA, GL_UNSIGNED_BYTE},
+   {GL_COMPRESSED_LUMINANCE, GL_LUMINANCE, GL_UNSIGNED_BYTE},
+   {GL_COMPRESSED_LUMINANCE_ALPHA, GL_LUMINANCE_ALPHA, GL_UNSIGNED_BYTE},
+   {GL_COMPRESSED_INTENSITY, GL_INTENSITY, GL_UNSIGNED_BYTE},
+   {GL_COMPRESSED_RGB, GL_RGB, GL_UNSIGNED_BYTE},
+   {GL_COMPRESSED_RGBA, GL_RGBA, GL_UNSIGNED_BYTE},
+};


Must have been painful but it looks good to me:

Reviewed-by: Martin Peres 

+
+static GLuint buffer;
+
+static bool
+test_format(const int i)
+{
+   printf("Testing %s...\t",
+   piglit_get_gl_enum_name(formats[i].internal_format));
+
+   glClearNamedBufferData(buffer, formats[i].internal_format,
+  formats[i].format, formats[i].type, NULL);
+
+   if (!piglit_check_gl_error(GL_INVALID_ENUM)) {
+   printf("Failed!\n");
+   return false;
+   }
+   printf("Passed.\n");
+   return true;
+}
+
+
+void
+piglit_init(int argc, char **argv)
+{
+   bool pass = true;
+   int i;
+   const int buffer_size = 3<<20;
+
+   piglit_require_extension("GL_ARB_clear_buffer_object");
+   piglit_require_extension("GL_ARB_direct_state_access");
+
+   glCreateBuffers(1, &buffer);
+   glNamedBufferData(buffer, buffer_size, NULL, GL_STREAM_READ);
+
+   pass = piglit_check_gl_error(GL_NO_ERROR) && pass;
+
+   /* Notice that I never bind the buffer. */
+   for (i = 0; i < ARRAY_SIZE(formats); ++i)
+   test_format(i);
+
+   glDeleteBuffers(1, &buffer);
+
+   pass = piglit_check_gl_error(GL_NO_ERROR) && pass;
+
+   piglit_report_result(pass ? PIGLIT_PASS : PIGLIT_FAIL);
+}
+
+
+enum piglit_result
+piglit_display(void)
+{
+   return PIGLIT_PASS;
+}
+


___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH 05/15] arb_direct_state_access: Testing NamedBufferSubData.

2015-04-01 Thread Martin Peres

On 20/02/15 01:14, Laura Ekstrand wrote:
Again *hopefully* we are testing usage somewhere else.  If we are not, 
let's add a non-DSA test for usage.


I used the same test for Data and SubData because I ended up 
implementing them together.


Fair enough.

Looks good to me:
Reviewed-by: Martin Peres 


On Wed, Feb 18, 2015 at 8:06 AM, Martin Peres 
mailto:martin.pe...@linux.intel.com>> 
wrote:



On 23/01/15 21:03, Laura Ekstrand wrote:

---
  tests/all.py  |   1 +
  .../spec/arb_direct_state_access/CMakeLists.gl.txt |   1 +
  .../namedbuffersubdata-vbo-sync.c  | 119
+
  3 files changed, 121 insertions(+)
  create mode 100644
tests/spec/arb_direct_state_access/namedbuffersubdata-vbo-sync.c

diff --git a/tests/all.py b/tests/all.py
index 7ec9d64..69a7cd7 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -4423,6 +4423,7 @@
spec['ARB_direct_state_access']['texture-storage-multisample']
= PiglitGLTest(['
  spec['ARB_direct_state_access']['texture-buffer'] =
PiglitGLTest(['arb_direct_state_access-texture-buffer'],
run_concurrent=True)
  spec['ARB_direct_state_access']['texture-buffer-range'] =
PiglitGLTest(['arb_direct_state_access-texture-buffer-range'],
run_concurrent=True)
 
spec['ARB_direct_state_access']['namedbufferstorage-persistent']

=
PiglitGLTest(['arb_direct_state_access-namedbufferstorage-persistent'],
run_concurrent=True)
+spec['ARB_direct_state_access']['namedbuffersubdata-vbo-sync'] =
PiglitGLTest(['arb_direct_state_access-namedbuffersubdata-vbo-sync'],
run_concurrent=True)
profile.tests['hiz'] = hiz
  profile.tests['fast_color_clear'] = fast_color_clear
diff --git
a/tests/spec/arb_direct_state_access/CMakeLists.gl.txt
b/tests/spec/arb_direct_state_access/CMakeLists.gl.txt
index 9228917..eedd60d 100644
--- a/tests/spec/arb_direct_state_access/CMakeLists.gl.txt
+++ b/tests/spec/arb_direct_state_access/CMakeLists.gl.txt
@@ -10,6 +10,7 @@ link_libraries (
  )
piglit_add_executable
(arb_direct_state_access-namedbufferstorage-persistent
namedbufferstorage.c)
+piglit_add_executable
(arb_direct_state_access-namedbuffersubdata-vbo-sync
namedbuffersubdata-vbo-sync.c)
  piglit_add_executable (arb_direct_state_access-dsa-textures
dsa-textures.c dsa-utils.c)
  piglit_add_executable
(arb_direct_state_access-texturesubimage texturesubimage.c)
  piglit_add_executable
(arb_direct_state_access-bind-texture-unit bind-texture-unit.c)
diff --git
a/tests/spec/arb_direct_state_access/namedbuffersubdata-vbo-sync.c
b/tests/spec/arb_direct_state_access/namedbuffersubdata-vbo-sync.c
new file mode 100644
index 000..60ebcda
--- /dev/null
+++
b/tests/spec/arb_direct_state_access/namedbuffersubdata-vbo-sync.c
@@ -0,0 +1,119 @@
+/*
+ * Copyright © 2009, 2015 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any
person obtaining a
+ * copy of this software and associated documentation files
(the "Software"),
+ * to deal in the Software without restriction, including
without limitation
+ * the rights to use, copy, modify, merge, publish,
distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons
to whom the
+ * Software is furnished to do so, subject to the following
conditions:
+ *
+ * The above copyright notice and this permission notice
(including the next
+ * paragraph) shall be included in all copies or substantial
portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN
NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ * Authors:
+ *Ben Holmes mailto:shran...@hotmail.com>>
+ *Eric Anholt mailto:e...@anholt.net>&g

Re: [Piglit] [PATCH 03/15] arb_sync: Test to demonstrate ClientWaitSync bug.

2015-04-01 Thread Martin Peres

On 23/01/15 21:03, Laura Ekstrand wrote:

glClientWaitSync(fence, GL_SYNC_FLUSH_COMMANDS_BIT, GL_TIMEOUT_IGNORED)
often returns GL_TIMEOUT_EXPIRED, even though GL_TIMEOUT_IGNORED is a huge
integer (18446744073709551615 on Intel Sandybridge with Mesa). The third
argument to glClientWaitSync should represent the number of nanoseconds the
implementation waits for the signal from fence before giving up and returning
TIMEOUT_EXPIRED.

This test, adapted from bufferstorage-persistent, demonstrates that
glClientWaitSync(fence, GL_SYNC_FLUSH_COMMANDS_BIT, GL_TIMEOUT_IGNORED)
must be called multiple times before the signal is actually recorded and
either GL_CONDITION_SATISFIED or GL_ALREADY_SIGNALED is returned.


Looks good to me:

Reviewed-by: Martin Peres 

---
  tests/all.py |   1 +
  tests/spec/arb_sync/CMakeLists.gl.txt|   1 +
  tests/spec/arb_sync/ClientWaitSync-timeout.c | 203 +++
  3 files changed, 205 insertions(+)
  create mode 100644 tests/spec/arb_sync/ClientWaitSync-timeout.c

diff --git a/tests/all.py b/tests/all.py
index 7df3787..7ec9d64 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -1756,6 +1756,7 @@ arb_sync['repeat-wait'] = 
PiglitGLTest(['arb_sync-repeat-wait'], run_concurrent=
  arb_sync['sync-initialize'] = PiglitGLTest(['arb_sync-sync-initialize'], 
run_concurrent=True)
  arb_sync['timeout-zero'] = PiglitGLTest(['arb_sync-timeout-zero'], 
run_concurrent=True)
  arb_sync['WaitSync-errors'] = PiglitGLTest(['arb_sync-WaitSync-errors'], 
run_concurrent=True)
+arb_sync['ClientWaitSync-timeout'] = 
PiglitGLTest(['arb_sync-ClientWaitSync-timeout'], run_concurrent=True)
  add_plain_test(arb_sync, ['sync_api'])
  
  # Group ARB_ES2_compatibility

diff --git a/tests/spec/arb_sync/CMakeLists.gl.txt 
b/tests/spec/arb_sync/CMakeLists.gl.txt
index 8784ff7..0a55eef 100644
--- a/tests/spec/arb_sync/CMakeLists.gl.txt
+++ b/tests/spec/arb_sync/CMakeLists.gl.txt
@@ -19,3 +19,4 @@ piglit_add_executable (arb_sync-repeat-wait repeat-wait.c)
  piglit_add_executable (arb_sync-sync-initialize sync-initialize.c)
  piglit_add_executable (arb_sync-timeout-zero timeout-zero.c)
  piglit_add_executable (arb_sync-WaitSync-errors WaitSync-errors.c)
+piglit_add_executable (arb_sync-ClientWaitSync-timeout 
ClientWaitSync-timeout.c)
diff --git a/tests/spec/arb_sync/ClientWaitSync-timeout.c 
b/tests/spec/arb_sync/ClientWaitSync-timeout.c
new file mode 100644
index 000..4030a3f
--- /dev/null
+++ b/tests/spec/arb_sync/ClientWaitSync-timeout.c
@@ -0,0 +1,203 @@
+/*
+ * Copyright © 2014 Advanced Micro Devices, Inc.
+ * All rights reserved.
+ * Copyright 2015 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ * Authors:
+ *Marek Olšák 
+ *Laura Ekstrand 
+ *
+ * Adapted to demonstrate a bug in ClientWaitSync by Laura Ekstrand
+ * , January 2015
+ */
+
+#include "piglit-util-gl.h"
+
+PIGLIT_GL_TEST_CONFIG_BEGIN
+
+   config.supports_gl_compat_version = 10;
+   config.window_visual = PIGLIT_GL_VISUAL_RGB | PIGLIT_GL_VISUAL_DOUBLE;
+
+PIGLIT_GL_TEST_CONFIG_END
+
+#define BUF_SIZE (12 * 4 * sizeof(float))
+
+void
+piglit_init(int argc, char **argv)
+{
+   piglit_require_gl_version(15);
+   piglit_require_extension("GL_ARB_buffer_storage");
+   piglit_require_extension("GL_ARB_map_buffer_range");
+   piglit_require_extension("GL_ARB_copy_buffer");
+   piglit_require_extension("GL_ARB_sync");
+
+   piglit_ortho_projection(piglit_width, piglit_height, GL_FALSE);
+}
+
+bool
+create_mapped_buffer(GLuint *buffer, GLfloat **map, GLboolean coherent,
+GLboolean client_storage)
+{
+   glGenBuffers(1, buffer);
+   glBin

Re: [Piglit] [PATCH 02/15] arb_direct_state_access: Testing NamedBufferStorage.

2015-04-01 Thread Martin Peres



On 23/01/15 21:03, Laura Ekstrand wrote:

---
  tests/all.py   |   1 +
  .../spec/arb_direct_state_access/CMakeLists.gl.txt |   1 +
  .../arb_direct_state_access/namedbufferstorage.c   | 283 +
  3 files changed, 285 insertions(+)
  create mode 100644 tests/spec/arb_direct_state_access/namedbufferstorage.c

diff --git a/tests/all.py b/tests/all.py
index 32aa60a..7df3787 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -4421,6 +4421,7 @@ 
spec['ARB_direct_state_access']['getcompressedtextureimage'] = PiglitGLTest(['ar
  spec['ARB_direct_state_access']['texture-storage-multisample'] = 
PiglitGLTest(['arb_direct_state_access-texture-storage-multisample'], 
run_concurrent=True)
  spec['ARB_direct_state_access']['texture-buffer'] = 
PiglitGLTest(['arb_direct_state_access-texture-buffer'], run_concurrent=True)
  spec['ARB_direct_state_access']['texture-buffer-range'] = 
PiglitGLTest(['arb_direct_state_access-texture-buffer-range'], 
run_concurrent=True)
+spec['ARB_direct_state_access']['namedbufferstorage-persistent'] = 
PiglitGLTest(['arb_direct_state_access-namedbufferstorage-persistent'], 
run_concurrent=True)
  
  profile.tests['hiz'] = hiz

  profile.tests['fast_color_clear'] = fast_color_clear
diff --git a/tests/spec/arb_direct_state_access/CMakeLists.gl.txt 
b/tests/spec/arb_direct_state_access/CMakeLists.gl.txt
index 26c0099..9228917 100644
--- a/tests/spec/arb_direct_state_access/CMakeLists.gl.txt
+++ b/tests/spec/arb_direct_state_access/CMakeLists.gl.txt
@@ -9,6 +9,7 @@ link_libraries (
${OPENGL_glu_LIBRARY}
  )
  
+piglit_add_executable (arb_direct_state_access-namedbufferstorage-persistent namedbufferstorage.c)

  piglit_add_executable (arb_direct_state_access-dsa-textures dsa-textures.c 
dsa-utils.c)
  piglit_add_executable (arb_direct_state_access-texturesubimage 
texturesubimage.c)
  piglit_add_executable (arb_direct_state_access-bind-texture-unit 
bind-texture-unit.c)
diff --git a/tests/spec/arb_direct_state_access/namedbufferstorage.c 
b/tests/spec/arb_direct_state_access/namedbufferstorage.c
new file mode 100644
index 000..2ddfab6
--- /dev/null
+++ b/tests/spec/arb_direct_state_access/namedbufferstorage.c
@@ -0,0 +1,283 @@
+/*
+ * Copyright © 2014 Advanced Micro Devices, Inc.
+ * All rights reserved.
+ * Copyright 2015 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ * Authors:
+ *Marek Olšák 
+ *Laura Ekstrand 
+ *
+ * Adapted to test NamedBufferStorage by Laura Ekstrand 
+ * January 2015
+ */
+
+#include "piglit-util-gl.h"
+
+PIGLIT_GL_TEST_CONFIG_BEGIN
+
+   config.supports_gl_compat_version = 10;


You may want to ask for gl_core_version = 32, like you did for your 
texture tests.

+   config.window_visual = PIGLIT_GL_VISUAL_RGB | PIGLIT_GL_VISUAL_DOUBLE;
+
+PIGLIT_GL_TEST_CONFIG_END
+
+#define BUF_SIZE (12 * 4 * sizeof(float))
+
+void
+piglit_init(int argc, char **argv)
+{
+   piglit_require_gl_version(15);
+   piglit_require_extension("GL_ARB_buffer_storage");
+   piglit_require_extension("GL_ARB_map_buffer_range");
This one would not be needed because the extension got introduced in 
OpenGL 3.0.


Otherwise, with all the other relevant commits squashed in this one, 
this is:


Reviewed-by: Martin Peres 

+   piglit_require_extension("GL_ARB_direct_state_access");
+
+   piglit_ortho_projection(piglit_width, piglit_height, GL_FALSE);
+}
+
+static bool
+create_mapped_buffer(GLuint *buffer, GLfloat **map, GLboolean coherent,
+GLboolean client_storage)
+{
+   glCreateBuffers(1, buffer);
+   glNamedBufferStorage(*buffer, BUF_SIZE, N

Re: [Piglit] [PATCH 14/15] arb_direct_state_access: Testing GetNamedBufferPointerv.

2015-04-01 Thread Martin Peres

On 23/01/15 21:03, Laura Ekstrand wrote:

---
  .../arb_direct_state_access/getnamedbufferparameter.c| 16 
  1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/tests/spec/arb_direct_state_access/getnamedbufferparameter.c 
b/tests/spec/arb_direct_state_access/getnamedbufferparameter.c
index 82bbfe2..45fc021 100644
--- a/tests/spec/arb_direct_state_access/getnamedbufferparameter.c
+++ b/tests/spec/arb_direct_state_access/getnamedbufferparameter.c
@@ -22,8 +22,9 @@
   */
  
  /**

- * Adapted to test glGetNamedBufferParameteri[64]v by Laura Ekstrand
- * .
+ * Adapted to test glGetNamedBufferParameteri[64]v and
+ * glGetNamedBufferPointerv by Laura Ekstrand , January
+ * 2015.
   */
  
  #include "piglit-util-gl.h"

@@ -110,6 +111,7 @@ piglit_display(void)
bool pass = true;
GLuint bufname;
GLint64 data = -2;
+   void *dataptr = NULL;
GLint dataint = -2;
  
  	int stuff[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};

@@ -167,13 +169,19 @@ piglit_display(void)
  
  	/* Is it mapped? */

glGetNamedBufferParameteri64v(bufname, GL_BUFFER_MAPPED, &data);
-   if (data != GL_TRUE)
-   {
+   if (data != GL_TRUE) {
printf("GL_BUFFER_MAPPED: expected GL_TRUE, got GL_FALSE.\n");
pass = false;
}
pass = piglit_check_gl_error(GL_NO_ERROR) && pass;
  
+	/* Check the pointer. */

+   glGetNamedBufferPointerv(bufname, GL_BUFFER_MAP_POINTER, &dataptr);
+   if (!dataptr) {
+   printf("GL_BUFFER_MAP_POINTER: Got NULL.\n");
+   pass = false;
+   }
+   pass = piglit_check_gl_error(GL_NO_ERROR) && pass;
  
  	/* What is the offset? */

glGetNamedBufferParameteri64v(bufname, GL_BUFFER_MAP_OFFSET,

Could this be squashed in the previous commit? Same comment as for patch 4.
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH 06/15] arb_direct_state_access: Testing CopyNamedBufferSubData.

2015-04-01 Thread Martin Peres

On 23/01/15 21:03, Laura Ekstrand wrote:

---
  tests/spec/arb_direct_state_access/namedbufferstorage.c | 7 +--
  1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/tests/spec/arb_direct_state_access/namedbufferstorage.c 
b/tests/spec/arb_direct_state_access/namedbufferstorage.c
index 6630467..c68bc27 100644
--- a/tests/spec/arb_direct_state_access/namedbufferstorage.c
+++ b/tests/spec/arb_direct_state_access/namedbufferstorage.c
@@ -218,15 +218,10 @@ read_subtest(GLboolean coherent, GLboolean client_storage)
glClear(GL_COLOR_BUFFER_BIT);
glCreateBuffers(1, &srcbuf);
glNamedBufferData(srcbuf, BUF_SIZE, array, GL_STATIC_DRAW);
-   glBindBuffer(GL_COPY_READ_BUFFER, srcbuf);
  
  	/* Copy some data to the mapped buffer and check if the CPU can see it. */

-   glBindBuffer(GL_COPY_WRITE_BUFFER, buffer);
-   glCopyBufferSubData(GL_COPY_READ_BUFFER, GL_COPY_WRITE_BUFFER,
-   0, 0, BUF_SIZE);
+   glCopyNamedBufferSubData(srcbuf, buffer, 0, 0, BUF_SIZE);
  
-	glBindBuffer(GL_COPY_READ_BUFFER, 0);

-   glBindBuffer(GL_COPY_WRITE_BUFFER, 0);
glDeleteBuffers(1, &srcbuf);
  
  	if (!coherent)

Same as patch 4.
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH 09/15] arb_direct_state_access: Testing MapNamedBufferRange.

2015-04-01 Thread Martin Peres

On 23/01/15 21:03, Laura Ekstrand wrote:

---
  tests/spec/arb_direct_state_access/namedbufferstorage.c | 11 ---
  1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/tests/spec/arb_direct_state_access/namedbufferstorage.c 
b/tests/spec/arb_direct_state_access/namedbufferstorage.c
index c68bc27..a997311 100644
--- a/tests/spec/arb_direct_state_access/namedbufferstorage.c
+++ b/tests/spec/arb_direct_state_access/namedbufferstorage.c
@@ -63,22 +63,19 @@ create_mapped_buffer(GLuint *buffer, GLfloat **map, 
GLboolean coherent,
 (coherent ? GL_MAP_COHERENT_BIT : 0) |
 GL_DYNAMIC_STORAGE_BIT |
 (client_storage ? GL_CLIENT_STORAGE_BIT : 0));
-   glBindBuffer(GL_ARRAY_BUFFER, *buffer);
  
  	piglit_check_gl_error(GL_NO_ERROR);
  
-	*map = glMapBufferRange(GL_ARRAY_BUFFER, 0, BUF_SIZE,

-   GL_MAP_WRITE_BIT |
-   GL_MAP_PERSISTENT_BIT |
-   (coherent ? GL_MAP_COHERENT_BIT : 0));
+   *map = glMapNamedBufferRange(*buffer, 0, BUF_SIZE,
+GL_MAP_WRITE_BIT |
+GL_MAP_PERSISTENT_BIT |
+(coherent ? GL_MAP_COHERENT_BIT : 0));
  
  	piglit_check_gl_error(GL_NO_ERROR);
  
  	if (!*map)

return false;
  
-	glBindBuffer(GL_ARRAY_BUFFER, 0);

-
return true;
  }
  

Same as patch 4.
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH 04/15] arb_direct_state_access: Testing NamedBufferData.

2015-04-01 Thread Martin Peres

On 23/01/15 21:03, Laura Ekstrand wrote:

---
  tests/spec/arb_direct_state_access/namedbufferstorage.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/spec/arb_direct_state_access/namedbufferstorage.c 
b/tests/spec/arb_direct_state_access/namedbufferstorage.c
index 2ddfab6..6630467 100644
--- a/tests/spec/arb_direct_state_access/namedbufferstorage.c
+++ b/tests/spec/arb_direct_state_access/namedbufferstorage.c
@@ -217,8 +217,8 @@ read_subtest(GLboolean coherent, GLboolean client_storage)
  
  	glClear(GL_COLOR_BUFFER_BIT);

glCreateBuffers(1, &srcbuf);
+   glNamedBufferData(srcbuf, BUF_SIZE, array, GL_STATIC_DRAW);
glBindBuffer(GL_COPY_READ_BUFFER, srcbuf);
-   glBufferData(GL_COPY_READ_BUFFER, BUF_SIZE, array, GL_STATIC_DRAW);
  
  	/* Copy some data to the mapped buffer and check if the CPU can see it. */

glBindBuffer(GL_COPY_WRITE_BUFFER, buffer);


While I see the point of having separate commits during the development 
of the mesa functionality, I fail to see the point of not having this 
squashed in the second patch.


Could you please squash this?
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH v5 2/6] program_interface_query: add tests for getprograminterfaceiv

2015-04-01 Thread Martin Peres
This test exercises the error codepaths of getprograminterfaceiv.

Tested on NVIDIA's proprietary driver version 346.35.

Reviewed-by: Tapani Pälli 
Signed-off-by: Martin Peres 
---
 tests/all.py   |   1 +
 .../arb_program_interface_query/CMakeLists.gl.txt  |   1 +
 tests/spec/arb_program_interface_query/common.h|  21 ---
 .../getprograminterfaceiv.c| 202 +
 4 files changed, 204 insertions(+), 21 deletions(-)
 create mode 100755 
tests/spec/arb_program_interface_query/getprograminterfaceiv.c

diff --git a/tests/all.py b/tests/all.py
index f47e198..86f2369 100755
--- a/tests/all.py
+++ b/tests/all.py
@@ -2275,6 +2275,7 @@ with profile.group_manager(
 g(['arb_program_interface_query-resource-location'], run_concurrent=False)
 g(['arb_program_interface_query-resource-index'], run_concurrent=False)
 g(['arb_program_interface_query-resource-query'], run_concurrent=False)
+g(['arb_program_interface_query-getprograminterfaceiv'], 
run_concurrent=False)
 
 # Group ARB_explicit_uniform_location
 with profile.group_manager(
diff --git a/tests/spec/arb_program_interface_query/CMakeLists.gl.txt 
b/tests/spec/arb_program_interface_query/CMakeLists.gl.txt
index 9535798..91ace72 100755
--- a/tests/spec/arb_program_interface_query/CMakeLists.gl.txt
+++ b/tests/spec/arb_program_interface_query/CMakeLists.gl.txt
@@ -12,3 +12,4 @@ link_libraries (
 piglit_add_executable (arb_program_interface_query-resource-location 
resource-location.c)
 piglit_add_executable (arb_program_interface_query-resource-index 
resource-index.c)
 piglit_add_executable (arb_program_interface_query-resource-query 
resource-query.c)
+piglit_add_executable (arb_program_interface_query-getprograminterfaceiv 
getprograminterfaceiv.c)
diff --git a/tests/spec/arb_program_interface_query/common.h 
b/tests/spec/arb_program_interface_query/common.h
index 8c6965c..370875d 100755
--- a/tests/spec/arb_program_interface_query/common.h
+++ b/tests/spec/arb_program_interface_query/common.h
@@ -42,27 +42,6 @@ static const char fs_empty[] =
"void main() {\n"
"}";
 
-static const char vs_array[] =
-   "#version 150\n"
-   "in vec4 vs_input[2];\n"
-   "struct vs_struct {\n"
-   "   vec4 hello;\n"
-   "   vec4 world[2];\n"
-   "};\n"
-   "uniform vs_struct sa[2];\n"
-   "void main() {\n"
-   "   gl_Position = vs_input[0] + sa[0].hello + sa[0].world[0];\n"
-   "}";
-
-static const char vs_aofa[] =
-   "#version 150\n"
-   "#extension GL_ARB_arrays_of_arrays : require\n"
-   "in vec4 vs_input2[2][2];\n"
-   "in vec4 vs_input3[2][2][2];\n"
-   "void main() {\n"
-   "   gl_Position = vs_input2[0][0] + vs_input3[0][0][0];\n"
-   "}";
-
 static const char vs_std[] =
"#version 150\n"
"struct vs_struct {\n"
diff --git a/tests/spec/arb_program_interface_query/getprograminterfaceiv.c 
b/tests/spec/arb_program_interface_query/getprograminterfaceiv.c
new file mode 100755
index 000..1d2ca08
--- /dev/null
+++ b/tests/spec/arb_program_interface_query/getprograminterfaceiv.c
@@ -0,0 +1,202 @@
+/*
+ * Copyright © 2015 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+/**
+ * \file getprograminterfaceiv.c
+ *
+ * Tests the error cases of the GetProgramInterfaceiv interface.
+ *
+ * From the GL_ARB_program_interface_query spec:
+ *  "The command
+ *
+ *  void GetProgramInterfaceiv(uint program, enum programInterface,
+ * enum pname, int *params);
+ *
+ *  queries a pr

[Piglit] [PATCH v5 0/6] program_interface_query: tests for getprograminterfaceiv and getprogramresourceindex/name/iv

2015-04-01 Thread Martin Peres
This patchset provides tests for getprograminterfaceiv,
getprogramresourceindex, getprogramresourcename and getprogramresourceiv.

The first patch is a functional test that tries a lot of different
program pipelines and checks that getprograminterfaceiv returns valid
values. These values are then checked iteratively by calling
getprogramresourceindex and getprogramresourcename. Sorry about the big
table that smashes the 80-column limit...

The last patch is also a monster test that checks for various program
pipelines that the different properties have the right values for
different resources. It also includes some tests for the error cases.

The other tests are more specific and are checking the error paths or
more complex cases. Patch 3/4 superseeds the already-existing
resource-index.c test which thus gets deleted.

All the patches have been written against NVIDIA's proprietary
driver (346.35) which passes the majority of the tests. All the tests
pass on Tapani's implementation for mesa.


Martin Peres (6):
  program_interface_query: add tests for querying the resources
  program_interface_query: add tests for getprograminterfaceiv
  program_interface_query: add tests for getprogramresourceindex
  program_interface_query: add tests for getprogramresourcename
  program_interface_query: move some shaders to common.h
  program_interface_query: add tests for getprogramresourceiv

 tests/all.py   |5 +-
 .../arb_program_interface_query/CMakeLists.gl.txt  |6 +-
 tests/spec/arb_program_interface_query/common.h|  300 ++
 .../getprograminterfaceiv.c|  202 
 .../getprogramresourceindex.c  |  339 +++
 .../getprogramresourceiv.c | 1063 
 .../getprogramresourcename.c   |  183 
 .../arb_program_interface_query/resource-index.c   |  284 --
 .../resource-location.c|   32 +-
 .../arb_program_interface_query/resource-query.c   |  741 ++
 10 files changed, 2842 insertions(+), 313 deletions(-)
 mode change 100644 => 100755 tests/all.py
 mode change 100644 => 100755 
tests/spec/arb_program_interface_query/CMakeLists.gl.txt
 create mode 100755 tests/spec/arb_program_interface_query/common.h
 create mode 100755 
tests/spec/arb_program_interface_query/getprograminterfaceiv.c
 create mode 100755 
tests/spec/arb_program_interface_query/getprogramresourceindex.c
 create mode 100755 
tests/spec/arb_program_interface_query/getprogramresourceiv.c
 create mode 100755 
tests/spec/arb_program_interface_query/getprogramresourcename.c
 delete mode 100644 tests/spec/arb_program_interface_query/resource-index.c
 mode change 100644 => 100755 
tests/spec/arb_program_interface_query/resource-location.c
 create mode 100755 tests/spec/arb_program_interface_query/resource-query.c

-- 
2.3.4

___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH v5 1/6] program_interface_query: add tests for querying the resources

2015-04-01 Thread Martin Peres
This tests primarily glGetProgramInterfaceiv in various (potentially
tricky) program pipelines. All the calls are supposed to succeed as
this test is purely functional.

This test requires a OpenGL 3.2 core context but also has optional
subtests that depend on the following extensions:
 - GL_ARB_shader_atomic_counters
 - GL_ARB_shader_storage_buffer_object
 - GL_ARB_shader_subroutine
 - GL_ARB_tessellation_shader
 - GL_ARB_compute_shader
 - GL_ARB_shader_image_load_store

Tested on NVIDIA's proprietary driver version 346.35.

v2: Martin Peres
- Fix the cs subtest to test PROGRAM_INPUT and not two times the OUTPUT

v3: Review from Tapani
- require GL_ARB_separate_shader_objects
- cosmetic changes
- add a comment in common.h to warn about the existence of strings in
  resource-query.c

v4: Martin Peres
- add a second subroutine in vs_sub

v5: Martin Peres
- introduce a patch output in the TCS outputs

Signed-off-by: Martin Peres 
---
 tests/all.py   |   1 +
 .../arb_program_interface_query/CMakeLists.gl.txt  |   1 +
 tests/spec/arb_program_interface_query/common.h| 278 
 .../arb_program_interface_query/resource-query.c   | 741 +
 4 files changed, 1021 insertions(+)
 mode change 100644 => 100755 tests/all.py
 mode change 100644 => 100755 
tests/spec/arb_program_interface_query/CMakeLists.gl.txt
 create mode 100755 tests/spec/arb_program_interface_query/common.h
 create mode 100755 tests/spec/arb_program_interface_query/resource-query.c

diff --git a/tests/all.py b/tests/all.py
old mode 100644
new mode 100755
index b2266db..f47e198
--- a/tests/all.py
+++ b/tests/all.py
@@ -2274,6 +2274,7 @@ with profile.group_manager(
 grouptools.join('spec', 'ARB_program_interface_query')) as g:
 g(['arb_program_interface_query-resource-location'], run_concurrent=False)
 g(['arb_program_interface_query-resource-index'], run_concurrent=False)
+g(['arb_program_interface_query-resource-query'], run_concurrent=False)
 
 # Group ARB_explicit_uniform_location
 with profile.group_manager(
diff --git a/tests/spec/arb_program_interface_query/CMakeLists.gl.txt 
b/tests/spec/arb_program_interface_query/CMakeLists.gl.txt
old mode 100644
new mode 100755
index 2028553..9535798
--- a/tests/spec/arb_program_interface_query/CMakeLists.gl.txt
+++ b/tests/spec/arb_program_interface_query/CMakeLists.gl.txt
@@ -11,3 +11,4 @@ link_libraries (
 
 piglit_add_executable (arb_program_interface_query-resource-location 
resource-location.c)
 piglit_add_executable (arb_program_interface_query-resource-index 
resource-index.c)
+piglit_add_executable (arb_program_interface_query-resource-query 
resource-query.c)
diff --git a/tests/spec/arb_program_interface_query/common.h 
b/tests/spec/arb_program_interface_query/common.h
new file mode 100755
index 000..8c6965c
--- /dev/null
+++ b/tests/spec/arb_program_interface_query/common.h
@@ -0,0 +1,278 @@
+/*
+ * Copyright © 2015 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#pragma once
+#ifndef __COMMON_H__
+#define __COMMON_H__
+
+
+/* /!\ /!\ /!\ /!\ /!\ /!\ /!\ /!\ /!\ /!\ /!\ /!\ /!\ /!\ /!\ /!\ /!\ /!\ /!\
+ * If you modify any of these shaders, you need to modify the resources names 
in
+ * resource-query.c.
+ * /!\ /!\ /!\ /!\ /!\ /!\ /!\ /!\ /!\ /!\ /!\ /!\ /!\ /!\ /!\ /!\ /!\ /!\ /!\
+ */
+
+static const char vs_empty[] =
+   "#version 150\n"
+   "void main() {\n"
+   "}";
+
+static const char fs_empty[] =
+   "#version 150\n"
+   "void main() {\n"
+   "}";
+
+static const char vs_array[] =
+   "#version 150\n"
+   "in vec4 vs_input[2];\n"
+   "struct vs_struct {\n"
+   "   vec4 hello;\n"
+ 

[Piglit] [PATCH v5 5/6] program_interface_query: move some shaders to common.h

2015-04-01 Thread Martin Peres
This will be needed for the next test.

Signed-off-by: Martin Peres 
---
 tests/spec/arb_program_interface_query/common.h| 22 +++
 .../resource-location.c| 32 --
 2 files changed, 27 insertions(+), 27 deletions(-)
 mode change 100644 => 100755 
tests/spec/arb_program_interface_query/resource-location.c

diff --git a/tests/spec/arb_program_interface_query/common.h 
b/tests/spec/arb_program_interface_query/common.h
index 8c6965c..55f0358 100755
--- a/tests/spec/arb_program_interface_query/common.h
+++ b/tests/spec/arb_program_interface_query/common.h
@@ -169,6 +169,28 @@ static const char fs_atom[] =
"   atomicCounterIncrement(fs_counter);\n"
"}";
 
+static const char vs_loc[] =
+   "#version 150\n"
+   "#extension GL_ARB_explicit_attrib_location : require\n"
+   "layout (location = 3) in vec4 input0;\n"
+   "layout (location = 6) in vec4 input1;\n"
+   "void main() {\n"
+   "gl_Position = input0 * input1;\n"
+   "}";
+
+static const char fs_loc[] =
+   "#version 150\n"
+   "#extension GL_ARB_explicit_attrib_location  : require\n"
+   "#extension GL_ARB_explicit_uniform_location : require\n"
+   "layout (location = 9) uniform vec4 color;\n"
+   "layout (location = 1) uniform float array[4];\n"
+   "layout (location = 1) out vec4 output0;\n"
+   "layout (location = 0) out vec4 output1;\n"
+   "void main() {\n"
+   "output0 = color * array[2];\n"
+   "output1 = color * array[3];\n"
+   "}";
+
 static const char vs_tfv[] =
"#version 150\n"
"in vec4 vs_input0;\n"
diff --git a/tests/spec/arb_program_interface_query/resource-location.c 
b/tests/spec/arb_program_interface_query/resource-location.c
old mode 100644
new mode 100755
index cdae2ee..4085f02
--- a/tests/spec/arb_program_interface_query/resource-location.c
+++ b/tests/spec/arb_program_interface_query/resource-location.c
@@ -57,6 +57,7 @@
  */
 
 #include "piglit-util-gl.h"
+#include "common.h"
 
 PIGLIT_GL_TEST_CONFIG_BEGIN
 
@@ -86,29 +87,6 @@ static const GLenum valid_enums_sub_com[] = {
GL_COMPUTE_SUBROUTINE_UNIFORM
 };
 
-
-static const char vs_text[] =
-   "#version 150\n"
-   "#extension GL_ARB_explicit_attrib_location : require\n"
-   "layout (location = 3) in vec4 input0;\n"
-   "layout (location = 6) in vec4 input1;\n"
-   "void main() {\n"
-   "gl_Position = input0 * input1;\n"
-   "}";
-
-static const char fs_text[] =
-   "#version 150\n"
-   "#extension GL_ARB_explicit_attrib_location  : require\n"
-   "#extension GL_ARB_explicit_uniform_location : require\n"
-   "layout (location = 9) uniform vec4 color;\n"
-   "layout (location = 1) uniform float array[4];\n"
-   "layout (location = 1) out vec4 output0;\n"
-   "layout (location = 0) out vec4 output1;\n"
-   "void main() {\n"
-   "output0 = color * array[2];\n"
-   "output1 = color * array[3];\n"
-   "}";
-
 static const char vs_subroutine_text[] =
"#version 150\n"
"#extension GL_ARB_explicit_attrib_location : require\n"
@@ -264,10 +242,10 @@ test_subroutine_stages_tcs_tes()
}
 
 prog = piglit_build_simple_program_multiple_shaders(
- GL_VERTEX_SHADER, vs_text,
+ GL_VERTEX_SHADER, vs_loc,
  GL_TESS_CONTROL_SHADER, tcs_subroutine_text,
  GL_TESS_EVALUATION_SHADER, tes_subroutine_text,
- GL_FRAGMENT_SHADER, fs_text,
+ GL_FRAGMENT_SHADER, fs_loc,
  0);
 
glUseProgram(prog);
@@ -374,14 +352,14 @@ piglit_init(int argc, char **argv)
}
 
/* Test passing a shader, not program. */
-   shader = piglit_compile_shader_text(GL_VERTEX_SHADER, vs_text);
+   shader = piglit_compile_shader_text(GL_VERTEX_SHADER, vs_loc);
glGetProgramResourceLocation(shader, GL_UNIFORM, "name");
if (!piglit_check_gl_error(GL_INVALID_OPERATION)) {
piglit_report_subtest_result(PIGLIT_FAIL, "invalid program test 
2");
pass = false;
}
 
-   prog = piglit_build_simple_program_unlinked(vs_text, fs_text);
+   prog = piglit_build_simple_program_unlinked(vs_loc, fs_loc);
 
if (!piglit_check_gl_error(GL_NO_ERROR))
piglit_report_result(PIGLIT_FAIL);
-- 
2.3.4

___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH v5 6/6] program_interface_query: add tests for getprogramresourceiv

2015-04-01 Thread Martin Peres
Tested on NVIDIA's proprietary driver version 346.35.

Signed-off-by: Martin Peres 
---
 .../arb_program_interface_query/CMakeLists.gl.txt  |1 +
 .../getprogramresourceiv.c | 1063 
 2 files changed, 1064 insertions(+)
 create mode 100755 
tests/spec/arb_program_interface_query/getprogramresourceiv.c

diff --git a/tests/spec/arb_program_interface_query/CMakeLists.gl.txt 
b/tests/spec/arb_program_interface_query/CMakeLists.gl.txt
index 2508342..91da8ac 100755
--- a/tests/spec/arb_program_interface_query/CMakeLists.gl.txt
+++ b/tests/spec/arb_program_interface_query/CMakeLists.gl.txt
@@ -14,3 +14,4 @@ piglit_add_executable 
(arb_program_interface_query-resource-query resource-query
 piglit_add_executable (arb_program_interface_query-getprograminterfaceiv 
getprograminterfaceiv.c)
 piglit_add_executable (arb_program_interface_query-getprogramresourceindex 
getprogramresourceindex.c)
 piglit_add_executable (arb_program_interface_query-getprogramresourcename 
getprogramresourcename.c)
+piglit_add_executable (arb_program_interface_query-getprogramresourceiv 
getprogramresourceiv.c)
diff --git a/tests/spec/arb_program_interface_query/getprogramresourceiv.c 
b/tests/spec/arb_program_interface_query/getprogramresourceiv.c
new file mode 100755
index 000..0f6239c
--- /dev/null
+++ b/tests/spec/arb_program_interface_query/getprogramresourceiv.c
@@ -0,0 +1,1063 @@
+/*
+ * Copyright © 2015 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+/**
+ * \file getprogramresourceiv.c
+ *
+ * Tests the values returned by GetProgramResourceiv on multiple pipelines.
+ * Also checks some error cases.
+ *
+ * From the GL_ARB_program_interface_query spec:
+ *  "The command
+ *
+ *  void GetProgramResourceiv(uint program, enum programInterface,
+ *uint index, sizei propCount,
+ *const enum *props, sizei bufSize,
+ *sizei *length, int *params);
+ *
+ *  returns values for multiple properties of a single active resource with an
+ *  index of  in the interface  of program object
+ *  .  For each resource, values for  properties specified
+ *  by the array  are returned.  The error INVALID_VALUE is generated
+ *  if  is zero.  The error INVALID_ENUM is generated if any value
+ *  in  is not one of the properties described immediately below.  The
+ *  error INVALID_OPERATION is generated if any value in  is not
+ *  allowed for .  The set of allowed 
+ *  values for each property can be found in Table X.1.
+
+ *  The values associated with the properties of the active resource are
+ *  written to consecutive entries in , in increasing order according
+ *  to position in .  If no error is generated, only the first
+ *   integer values will be written to ; any extra values
+ *  will not be returned.  If  is not NULL, the actual number of
+ *  integer values written to  will be written to .
+ *
+ *Property Supported Interfaces
+ *---  
+ *NAME_LENGTH  all but ATOMIC_COUNTER_BUFFER
+ *
+ *TYPE UNIFORM, PROGRAM_INPUT, PROGRAM_OUTPUT,
+ *   TRANSFORM_FEEDBACK_VARYING,
+ *   BUFFER_VARIABLE
+ *
+ *ARRAY_SIZE   UNIFORM, BUFFER_VARIABLE, PROGRAM_INPUT,
+ *   PROGRAM_OUTPUT, VERTEX_SUBROUTINE_
+ *   UNIFORM, TESS_CONTROL_SUBROUTINE_UNIFORM,
+ *   TESS_EVALUATION_SUBROUTINE_UNIFORM,
+ *   GEOMETRY_SUBROUTINE_UNIFORM, FRAGMENT_
+ *   SUBROUTINE_UNIFORM, COMPUTE_SUBROUTINE_
+ *   UNIFO

[Piglit] [PATCH v5 3/6] program_interface_query: add tests for getprogramresourceindex

2015-04-01 Thread Martin Peres
Tests tricky cases of resource naming along with some error cases of
getprogramresourceindex. It also replaces the resource-index test that
was incomplete and did not consistently report the same number of
subtests depending on errors.

Tested on NVIDIA's proprietary driver version 346.35.

v2:
- also test a NULL name (Tapani)

Reviewed-by: Tapani Pälli 
Signed-off-by: Martin Peres 
---
 tests/all.py   |   2 +-
 .../arb_program_interface_query/CMakeLists.gl.txt  |   2 +-
 tests/spec/arb_program_interface_query/common.h|  21 ++
 .../getprogramresourceindex.c  | 339 +
 .../arb_program_interface_query/resource-index.c   | 284 -
 5 files changed, 362 insertions(+), 286 deletions(-)
 create mode 100755 
tests/spec/arb_program_interface_query/getprogramresourceindex.c
 delete mode 100644 tests/spec/arb_program_interface_query/resource-index.c

diff --git a/tests/all.py b/tests/all.py
index 86f2369..170d5b8 100755
--- a/tests/all.py
+++ b/tests/all.py
@@ -2273,9 +2273,9 @@ with profile.group_manager(
 PiglitGLTest,
 grouptools.join('spec', 'ARB_program_interface_query')) as g:
 g(['arb_program_interface_query-resource-location'], run_concurrent=False)
-g(['arb_program_interface_query-resource-index'], run_concurrent=False)
 g(['arb_program_interface_query-resource-query'], run_concurrent=False)
 g(['arb_program_interface_query-getprograminterfaceiv'], 
run_concurrent=False)
+g(['arb_program_interface_query-getprogramresourceindex'], 
run_concurrent=False)
 
 # Group ARB_explicit_uniform_location
 with profile.group_manager(
diff --git a/tests/spec/arb_program_interface_query/CMakeLists.gl.txt 
b/tests/spec/arb_program_interface_query/CMakeLists.gl.txt
index 91ace72..8b3bbd9 100755
--- a/tests/spec/arb_program_interface_query/CMakeLists.gl.txt
+++ b/tests/spec/arb_program_interface_query/CMakeLists.gl.txt
@@ -10,6 +10,6 @@ link_libraries (
 )
 
 piglit_add_executable (arb_program_interface_query-resource-location 
resource-location.c)
-piglit_add_executable (arb_program_interface_query-resource-index 
resource-index.c)
 piglit_add_executable (arb_program_interface_query-resource-query 
resource-query.c)
 piglit_add_executable (arb_program_interface_query-getprograminterfaceiv 
getprograminterfaceiv.c)
+piglit_add_executable (arb_program_interface_query-getprogramresourceindex 
getprogramresourceindex.c)
diff --git a/tests/spec/arb_program_interface_query/common.h 
b/tests/spec/arb_program_interface_query/common.h
index 370875d..8c6965c 100755
--- a/tests/spec/arb_program_interface_query/common.h
+++ b/tests/spec/arb_program_interface_query/common.h
@@ -42,6 +42,27 @@ static const char fs_empty[] =
"void main() {\n"
"}";
 
+static const char vs_array[] =
+   "#version 150\n"
+   "in vec4 vs_input[2];\n"
+   "struct vs_struct {\n"
+   "   vec4 hello;\n"
+   "   vec4 world[2];\n"
+   "};\n"
+   "uniform vs_struct sa[2];\n"
+   "void main() {\n"
+   "   gl_Position = vs_input[0] + sa[0].hello + sa[0].world[0];\n"
+   "}";
+
+static const char vs_aofa[] =
+   "#version 150\n"
+   "#extension GL_ARB_arrays_of_arrays : require\n"
+   "in vec4 vs_input2[2][2];\n"
+   "in vec4 vs_input3[2][2][2];\n"
+   "void main() {\n"
+   "   gl_Position = vs_input2[0][0] + vs_input3[0][0][0];\n"
+   "}";
+
 static const char vs_std[] =
"#version 150\n"
"struct vs_struct {\n"
diff --git a/tests/spec/arb_program_interface_query/getprogramresourceindex.c 
b/tests/spec/arb_program_interface_query/getprogramresourceindex.c
new file mode 100755
index 000..889b5e1
--- /dev/null
+++ b/tests/spec/arb_program_interface_query/getprogramresourceindex.c
@@ -0,0 +1,339 @@
+/*
+ * Copyright © 2015 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FIT

[Piglit] [PATCH v5 4/6] program_interface_query: add tests for getprogramresourcename

2015-04-01 Thread Martin Peres
Tests the error paths of GetProgramResourceName

Tested on NVIDIA's proprietary driver version 346.35.

v2:
- Test that a NULL name does not crash (suggested by Tapani)

Reviewed-by: Tapani Pälli 
Signed-off-by: Martin Peres 
---
 tests/all.py   |   1 +
 .../arb_program_interface_query/CMakeLists.gl.txt  |   1 +
 .../getprogramresourcename.c   | 183 +
 3 files changed, 185 insertions(+)
 create mode 100755 
tests/spec/arb_program_interface_query/getprogramresourcename.c

diff --git a/tests/all.py b/tests/all.py
index 170d5b8..d0b4b09 100755
--- a/tests/all.py
+++ b/tests/all.py
@@ -2276,6 +2276,7 @@ with profile.group_manager(
 g(['arb_program_interface_query-resource-query'], run_concurrent=False)
 g(['arb_program_interface_query-getprograminterfaceiv'], 
run_concurrent=False)
 g(['arb_program_interface_query-getprogramresourceindex'], 
run_concurrent=False)
+g(['arb_program_interface_query-getprogramresourcename'], 
run_concurrent=False)
 
 # Group ARB_explicit_uniform_location
 with profile.group_manager(
diff --git a/tests/spec/arb_program_interface_query/CMakeLists.gl.txt 
b/tests/spec/arb_program_interface_query/CMakeLists.gl.txt
index 8b3bbd9..2508342 100755
--- a/tests/spec/arb_program_interface_query/CMakeLists.gl.txt
+++ b/tests/spec/arb_program_interface_query/CMakeLists.gl.txt
@@ -13,3 +13,4 @@ piglit_add_executable 
(arb_program_interface_query-resource-location resource-lo
 piglit_add_executable (arb_program_interface_query-resource-query 
resource-query.c)
 piglit_add_executable (arb_program_interface_query-getprograminterfaceiv 
getprograminterfaceiv.c)
 piglit_add_executable (arb_program_interface_query-getprogramresourceindex 
getprogramresourceindex.c)
+piglit_add_executable (arb_program_interface_query-getprogramresourcename 
getprogramresourcename.c)
diff --git a/tests/spec/arb_program_interface_query/getprogramresourcename.c 
b/tests/spec/arb_program_interface_query/getprogramresourcename.c
new file mode 100755
index 000..f2736d7
--- /dev/null
+++ b/tests/spec/arb_program_interface_query/getprogramresourcename.c
@@ -0,0 +1,183 @@
+/*
+ * Copyright © 2015 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+/**
+ * \file getprogramresourcename.c
+ *
+ * Tests the error cases of the GetProgramResourceName interface. The real
+ * functional test is resource-query.
+ *
+ * From the GL_ARB_program_interface_query spec:
+ *  "The command
+ *
+ *  void GetProgramResourceName(uint program, enum programInterface,
+ *  uint index, sizei bufSize, sizei *length,
+ *  char *name);
+ *
+ *  returns the name string assigned to the single active resource with an
+ *  index of  in the interface  of program object
+ *  .  The error INVALID_VALUE is generated if  is greater
+ *  than or equal to the number of entries in the active resource list for
+ *  .  The error INVALID_ENUM is generated if
+ *   is ATOMIC_COUNTER_BUFFER, since active atomic 
counter
+ *  buffer resources are not assigned name strings.
+ *
+ *  The name string assigned to the active resource identified by  
is
+ *  returned as a null-terminated string in .  The actual number of
+ *  characters written into , excluding the null terminator, is
+ *  returned in .  If  is NULL, no length is returned. The
+ *  maximum number of characters that may be written into , including
+ *  the null terminator, is specified by .  If the length of the
+ *  name string (including the null terminator) is greater than ,
+ *  the first -1 characters of the name string will be written to
+ *  , followed by a null terminator.  If  is zero, no error
+ *  will be genera

Re: [Piglit] [PATCH 00/14] Add DSA tests for vertex array objects

2015-04-01 Thread Martin Peres

On 31/03/15 20:26, Fredrik Höglund wrote:

This series adds piglit tests for the VAO portion of
GL_ARB_direct_state_access.

The tests are written so that they can be run against either the core
or compatibility profiles.  The exception is vao-core and vao-compatibility,
which contain all the profile specific tests.

Note that vao-attrib-format fails without this patch:
http://patchwork.freedesktop.org/patch/44068

It would be interesting to know if the tests pass with NVIDIA's
implementation, but I haven't been able to test that.


I see the following warnings when compiling the patches:

Scanning dependencies of target arb_direct_state_access-vao-core
/home/mupuf/piglit/tests/spec/arb_direct_state_access/vao-compat.c: In 
function ‘piglit_init’:
/home/mupuf/piglit/tests/spec/arb_direct_state_access/vao-compat.c:152:48: 
warning: passing argument 6 of 
‘piglit_dispatch_glVertexArrayVertexBuffers’ from incompatible pointer type

  buffers, offsets, strides);
^
/home/mupuf/piglit/tests/spec/arb_direct_state_access/vao-compat.c:152:48: 
note: expected ‘const GLsizei *’ but argument is of type ‘const 
GLsizeiptr *’
/home/mupuf/piglit/tests/spec/arb_direct_state_access/vao-compat.c:181:48: 
warning: passing argument 6 of 
‘piglit_dispatch_glVertexArrayVertexBuffers’ from incompatible pointer type

  buffers, offsets, strides);
^
/home/mupuf/piglit/tests/spec/arb_direct_state_access/vao-compat.c:181:48: 
note: expected ‘const GLsizei *’ but argument is of type ‘const 
GLsizeiptr *’
[ 92%] Linking C executable 
../../../../../bin/arb_direct_state_access-vao-compat-draw
[ 92%] Building C object 
target_api/gl/tests/spec/arb_direct_state_access/CMakeFiles/arb_direct_state_access-vao-core.dir/vao-core.c.o

Scanning dependencies of target arb_direct_state_access-vao-create
Built target arb_direct_state_access-vao-attrib-format
Linking C executable 
../../../../../bin/arb_direct_state_access-vao-binding-divisor
Scanning dependencies of target 
arb_direct_state_access-vao-element-array-buffer

Scanning dependencies of target arb_direct_state_access-vao-get
Linking C executable ../../../../../bin/arb_direct_state_access-vao-compat
[ 92%] [ 92%] Built target arb_direct_state_access-vao-attrib-enabledisable
[ 92%] Building C object 
target_api/gl/tests/spec/arb_direct_state_access/CMakeFiles/arb_direct_state_access-vao-create.dir/vao-create.c.o
Building C object 
target_api/gl/tests/spec/arb_direct_state_access/CMakeFiles/arb_direct_state_access-vao-get.dir/vao-get.c.o 

[ 92%] Scanning dependencies of target 
arb_direct_state_access-vao-vertex-buffer
Building C object 
target_api/gl/tests/spec/arb_direct_state_access/CMakeFiles/arb_direct_state_access-vao-element-array-buffer.dir/vao-element-array-buffer.c.o
[ 92%] /home/mupuf/piglit/tests/spec/arb_direct_state_access/vao-core.c: 
In function ‘piglit_init’:
/home/mupuf/piglit/tests/spec/arb_direct_state_access/vao-core.c:148:48: 
warning: passing argument 6 of 
‘piglit_dispatch_glVertexArrayVertexBuffers’ from incompatible pointer type

  buffers, offsets, strides);
^
/home/mupuf/piglit/tests/spec/arb_direct_state_access/vao-core.c:148:48: 
note: expected ‘const GLsizei *’ but argument is of type ‘const 
GLsizeiptr *’
/home/mupuf/piglit/tests/spec/arb_direct_state_access/vao-core.c:168:48: 
warning: passing argument 6 of 
‘piglit_dispatch_glVertexArrayVertexBuffers’ from incompatible pointer type

  buffers, offsets, strides);
^
/home/mupuf/piglit/tests/spec/arb_direct_state_access/vao-core.c:168:48: 
note: expected ‘const GLsizei *’ but argument is of type ‘const 
GLsizeiptr *’
Building C object 
target_api/gl/tests/spec/arb_direct_state_access/CMakeFiles/arb_direct_state_access-vao-vertex-buffer.dir/vao-vertex-buffer.c.o

[ 92%] [ 92%] [ 92%] Built target arb_direct_state_access-vao-compat-draw
Built target arb_direct_state_access-vao-binding-divisor
[ 92%] Scanning dependencies of target 
arb_direct_state_access-vao-vertex-buffers
[ 92%] Building C object 
target_api/gl/tests/spec/arb_direct_state_access/CMakeFiles/arb_direct_state_access-vao-vertex-buffer.dir/dsa-utils.c.o
Building C object 
target_api/gl/tests/spec/arb_direct_state_access/CMakeFiles/arb_direct_state_access-vao-core.dir/dsa-utils.c.o 


Built target arb_direct_state_access-vao-compat
[ 92%] Building C object 
target_api/gl/tests/spec/arb_direct_state_access/CMakeFiles/arb_direct_state_access-vao-vertex-buffers.dir/vao-vertex-buffers.c.o
/home/mupuf/piglit/tests/spec/arb_direct_state_access/vao-get.c: In 
function ‘test_getvertexarrayindexed64iv’:
/home/mupuf/piglit/tests/spec/arb_direct_state_access/vao-get.c:254:11: 
warning: format ‘%lld’ expects argument of type ‘long long int’, but 
argument 3 ha

Re: [Piglit] [PATCH] arb_arrays_of_arrays: compile test basic types

2015-03-31 Thread Martin Peres

On 01/04/15 08:14, Timothy Arceri wrote:

On Tue, 2015-03-31 at 12:02 +0300, Martin Peres wrote:

On 30/03/15 10:29, Timothy Arceri wrote:

Test results:

Nvidia GeForce 840M - NVIDIA 346.47: pass
---
   This is just 
/tests/spec/glsl-1.20/compiler/structure-and-array-operations/array-of-any-type.vert
   with an extra dimension added.

   .../compiler/arrays-of-any-type.vert   | 44 
++
   1 file changed, 44 insertions(+)
   create mode 100644 
tests/spec/arb_arrays_of_arrays/compiler/arrays-of-any-type.vert

diff --git a/tests/spec/arb_arrays_of_arrays/compiler/arrays-of-any-type.vert 
b/tests/spec/arb_arrays_of_arrays/compiler/arrays-of-any-type.vert
new file mode 100644
index 000..0ce45da
--- /dev/null
+++ b/tests/spec/arb_arrays_of_arrays/compiler/arrays-of-any-type.vert
@@ -0,0 +1,44 @@
+/* [config]
+ * expect_result: pass
+ * glsl_version: 1.20
+ * [end config]
+ *
+ * From page 19 (page 25 of the PDF) of the GLSL 1.20 spec:
+ *
+ * "All basic types and structures can be formed into arrays."
+ */
+#version 120
+#extension GL_ARB_arrays_of_arrays: enable
+
+uniform float array01[1][1];
+uniform int array02[1][1];

For the sake of completeness:
uint and double are missing here.

+uniform bool array03[1][1];
+uniform vec2 array04[1][1];
+uniform vec3 array05[1][1];
+uniform vec4 array06[1][1];
+uniform ivec2 array07[1][1];
+uniform ivec3 array08[1][1];
+uniform ivec4 array09[1][1];

uvec and dvec?

+uniform bvec2 array10[1][1];
+uniform bvec3 array11[1][1];
+uniform bvec4 array12[1][1];
+uniform mat2 array13[1][1];
+uniform mat2x2 array14[1][1];
+uniform mat2x3 array15[1][1];
+uniform mat2x4 array16[1][1];
+uniform mat3 array17[1][1];
+uniform mat3x2 array18[1][1];
+uniform mat3x3 array19[1][1];
+uniform mat3x4 array20[1][1];
+uniform mat4 array21[1][1];
+uniform mat4x2 array22[1][1];
+uniform mat4x3 array23[1][1];
+uniform mat4x4 array24[1][1];
+uniform sampler1D array25[1][1];
+uniform sampler2D array26[1][1];
+uniform sampler3D array27[1][1];
+uniform samplerCube array28[1][1];
+uniform sampler1DShadow array29[1][1];
+uniform sampler2DShadow array30[1][1];

There quite a few missing here: samplerCubeShadow, sampler2DRectShadow,
sampler1DArrayShadow, sampler2DArrayShadow, samplerCubeArrayShadow,
sampler2DRect, and more. Also, you do not test samplers for integers and
unsigned.

I guess you missed the comment at the top:

This is
just 
/tests/spec/glsl-1.20/compiler/structure-and-array-operations/array-of-any-type.vert
 with an extra dimension added.


I definitely missed it, indeed.


So anything added after glsl 1.20 is missing. However you are right I
should create tests to cover everything so I've submitted new tests that
cover all basic types.

Thanks for the feedback.


Thanks :)



I know it is boring but only by increasing coverage can we really test
for non-regression in non-trivial cases (AKA, the ones that make us
loose time when debugging).

It would be great if you could already add tests for image load store
and atomic counters so at it puts the burden of making sure this
extension still works when they get enabled. Of course, they would need
to be in separate tests.

Other than that, I like the idea. Plain simple but quite necessary.

+
+void main() { gl_Position = vec4(0.0); }




___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH] arb_arrays_of_arrays: compile test basic types

2015-03-31 Thread Martin Peres

On 30/03/15 10:29, Timothy Arceri wrote:

Test results:

Nvidia GeForce 840M - NVIDIA 346.47: pass
---
  This is just 
/tests/spec/glsl-1.20/compiler/structure-and-array-operations/array-of-any-type.vert
  with an extra dimension added.

  .../compiler/arrays-of-any-type.vert   | 44 ++
  1 file changed, 44 insertions(+)
  create mode 100644 
tests/spec/arb_arrays_of_arrays/compiler/arrays-of-any-type.vert

diff --git a/tests/spec/arb_arrays_of_arrays/compiler/arrays-of-any-type.vert 
b/tests/spec/arb_arrays_of_arrays/compiler/arrays-of-any-type.vert
new file mode 100644
index 000..0ce45da
--- /dev/null
+++ b/tests/spec/arb_arrays_of_arrays/compiler/arrays-of-any-type.vert
@@ -0,0 +1,44 @@
+/* [config]
+ * expect_result: pass
+ * glsl_version: 1.20
+ * [end config]
+ *
+ * From page 19 (page 25 of the PDF) of the GLSL 1.20 spec:
+ *
+ * "All basic types and structures can be formed into arrays."
+ */
+#version 120
+#extension GL_ARB_arrays_of_arrays: enable
+
+uniform float array01[1][1];
+uniform int array02[1][1];

For the sake of completeness:
uint and double are missing here.

+uniform bool array03[1][1];
+uniform vec2 array04[1][1];
+uniform vec3 array05[1][1];
+uniform vec4 array06[1][1];
+uniform ivec2 array07[1][1];
+uniform ivec3 array08[1][1];
+uniform ivec4 array09[1][1];

uvec and dvec?

+uniform bvec2 array10[1][1];
+uniform bvec3 array11[1][1];
+uniform bvec4 array12[1][1];
+uniform mat2 array13[1][1];
+uniform mat2x2 array14[1][1];
+uniform mat2x3 array15[1][1];
+uniform mat2x4 array16[1][1];
+uniform mat3 array17[1][1];
+uniform mat3x2 array18[1][1];
+uniform mat3x3 array19[1][1];
+uniform mat3x4 array20[1][1];
+uniform mat4 array21[1][1];
+uniform mat4x2 array22[1][1];
+uniform mat4x3 array23[1][1];
+uniform mat4x4 array24[1][1];
+uniform sampler1D array25[1][1];
+uniform sampler2D array26[1][1];
+uniform sampler3D array27[1][1];
+uniform samplerCube array28[1][1];
+uniform sampler1DShadow array29[1][1];
+uniform sampler2DShadow array30[1][1];
There quite a few missing here: samplerCubeShadow, sampler2DRectShadow, 
sampler1DArrayShadow, sampler2DArrayShadow, samplerCubeArrayShadow, 
sampler2DRect, and more. Also, you do not test samplers for integers and 
unsigned.


I know it is boring but only by increasing coverage can we really test 
for non-regression in non-trivial cases (AKA, the ones that make us 
loose time when debugging).


It would be great if you could already add tests for image load store 
and atomic counters so at it puts the burden of making sure this 
extension still works when they get enabled. Of course, they would need 
to be in separate tests.


Other than that, I like the idea. Plain simple but quite necessary.

+
+void main() { gl_Position = vec4(0.0); }


___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH] arb_arrays_of_arrays: compile test basic types

2015-03-31 Thread Martin Peres

On 31/03/15 00:17, Timothy Arceri wrote:

On Mon, 2015-03-30 at 10:51 +0300, Martin Peres wrote:

On 30/03/15 10:29, Timothy Arceri wrote:

Test results:

Nvidia GeForce 840M - NVIDIA 346.47: pass
---
   This is just 
/tests/spec/glsl-1.20/compiler/structure-and-array-operations/array-of-any-type.vert
   with an extra dimension added.

Do you have any other test that would cover more than just the grammar?
Maybe you already sent them (possibly a while ago), sorry if this is the
case.

Yeah there are a bunch of tests already in piglit that I've submitted
over the past year. The main reason for this test is that I haven't got
any tests for sampler arrays of arrays so this seemed like a nice test
to start things off with.


Good luck with it then.
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH] arb_arrays_of_arrays: compile test basic types

2015-03-30 Thread Martin Peres

On 30/03/15 10:29, Timothy Arceri wrote:

Test results:

Nvidia GeForce 840M - NVIDIA 346.47: pass
---
  This is just 
/tests/spec/glsl-1.20/compiler/structure-and-array-operations/array-of-any-type.vert
  with an extra dimension added.


Do you have any other test that would cover more than just the grammar? 
Maybe you already sent them (possibly a while ago), sorry if this is the 
case.




  .../compiler/arrays-of-any-type.vert   | 44 ++
  1 file changed, 44 insertions(+)
  create mode 100644 
tests/spec/arb_arrays_of_arrays/compiler/arrays-of-any-type.vert

diff --git a/tests/spec/arb_arrays_of_arrays/compiler/arrays-of-any-type.vert 
b/tests/spec/arb_arrays_of_arrays/compiler/arrays-of-any-type.vert
new file mode 100644
index 000..0ce45da
--- /dev/null
+++ b/tests/spec/arb_arrays_of_arrays/compiler/arrays-of-any-type.vert
@@ -0,0 +1,44 @@
+/* [config]
+ * expect_result: pass
+ * glsl_version: 1.20
+ * [end config]
+ *
+ * From page 19 (page 25 of the PDF) of the GLSL 1.20 spec:
+ *
+ * "All basic types and structures can be formed into arrays."
+ */
+#version 120
+#extension GL_ARB_arrays_of_arrays: enable
+
+uniform float array01[1][1];
+uniform int array02[1][1];
+uniform bool array03[1][1];
+uniform vec2 array04[1][1];
+uniform vec3 array05[1][1];
+uniform vec4 array06[1][1];
+uniform ivec2 array07[1][1];
+uniform ivec3 array08[1][1];
+uniform ivec4 array09[1][1];
+uniform bvec2 array10[1][1];
+uniform bvec3 array11[1][1];
+uniform bvec4 array12[1][1];
+uniform mat2 array13[1][1];
+uniform mat2x2 array14[1][1];
+uniform mat2x3 array15[1][1];
+uniform mat2x4 array16[1][1];
+uniform mat3 array17[1][1];
+uniform mat3x2 array18[1][1];
+uniform mat3x3 array19[1][1];
+uniform mat3x4 array20[1][1];
+uniform mat4 array21[1][1];
+uniform mat4x2 array22[1][1];
+uniform mat4x3 array23[1][1];
+uniform mat4x4 array24[1][1];
+uniform sampler1D array25[1][1];
+uniform sampler2D array26[1][1];
+uniform sampler3D array27[1][1];
+uniform samplerCube array28[1][1];
+uniform sampler1DShadow array29[1][1];
+uniform sampler2DShadow array30[1][1];
+
+void main() { gl_Position = vec4(0.0); }


___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH 1/4] program_interface_query: add tests for querying the resources

2015-03-27 Thread Martin Peres

On 27/03/15 09:58, Tapani Pälli wrote:
Huh, first of all thanks for taking time to add the 'crosschecking' 
(consistency_check) .. this test has impressive amount of subtests and 
validation of the results!


I did not find any errors from the subtests (excluding that one that 
should be PROGRAM_INPUT not OUTPUT but that you already fixed, right?).


Yes, it is already fixed in my tree and on freedesktop.



Some nitpicking and comments on the layout below; I'd give r-b but I 
want to hear if you will address some of this;



On 03/25/2015 06:01 PM, Martin Peres wrote:

This tests primarily glGetProgramInterfaceiv in various (potentially
tricky) program pipelines. All the calls are supposed to succeed as
this test is purely functional.

This test requires a OpenGL 3.2 core context but also has optional
subtests that depend on the following extensions:
  - GL_ARB_shader_atomic_counters
  - GL_ARB_shader_storage_buffer_object
  - GL_ARB_shader_subroutine
  - GL_ARB_tessellation_shader
  - GL_ARB_compute_shader
  - GL_ARB_shader_image_load_store

Signed-off-by: Martin Peres 
---
  tests/all.py   |   1 +
  .../arb_program_interface_query/CMakeLists.gl.txt  |   1 +
  tests/spec/arb_program_interface_query/common.h| 238 +++
  .../arb_program_interface_query/resource-query.c   | 741 
+

  4 files changed, 981 insertions(+)
  mode change 100644 => 100755 tests/all.py
  mode change 100644 => 100755 
tests/spec/arb_program_interface_query/CMakeLists.gl.txt

  create mode 100755 tests/spec/arb_program_interface_query/common.h
  create mode 100755 
tests/spec/arb_program_interface_query/resource-query.c


diff --git a/tests/all.py b/tests/all.py
old mode 100644
new mode 100755
index b2266db..f47e198
--- a/tests/all.py
+++ b/tests/all.py
@@ -2274,6 +2274,7 @@ with profile.group_manager(
  grouptools.join('spec', 'ARB_program_interface_query')) as g:
  g(['arb_program_interface_query-resource-location'], 
run_concurrent=False)
  g(['arb_program_interface_query-resource-index'], 
run_concurrent=False)
+g(['arb_program_interface_query-resource-query'], 
run_concurrent=False)


  # Group ARB_explicit_uniform_location
  with profile.group_manager(
diff --git a/tests/spec/arb_program_interface_query/CMakeLists.gl.txt 
b/tests/spec/arb_program_interface_query/CMakeLists.gl.txt

old mode 100644
new mode 100755
index 2028553..9535798
--- a/tests/spec/arb_program_interface_query/CMakeLists.gl.txt
+++ b/tests/spec/arb_program_interface_query/CMakeLists.gl.txt
@@ -11,3 +11,4 @@ link_libraries (

  piglit_add_executable 
(arb_program_interface_query-resource-location resource-location.c)
  piglit_add_executable (arb_program_interface_query-resource-index 
resource-index.c)
+piglit_add_executable (arb_program_interface_query-resource-query 
resource-query.c)
diff --git a/tests/spec/arb_program_interface_query/common.h 
b/tests/spec/arb_program_interface_query/common.h

new file mode 100755
index 000..4e5ff01
--- /dev/null
+++ b/tests/spec/arb_program_interface_query/common.h
@@ -0,0 +1,238 @@
+/*
+ * Copyright © 2015 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person 
obtaining a
+ * copy of this software and associated documentation files (the 
"Software"),
+ * to deal in the Software without restriction, including without 
limitation
+ * the rights to use, copy, modify, merge, publish, distribute, 
sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom 
the

+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including 
the next
+ * paragraph) shall be included in all copies or substantial 
portions of the

+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 
EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 
MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO 
EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES 
OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 
ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 
OTHER DEALINGS

+ * IN THE SOFTWARE.
+ */
+
+#pragma once
+#ifndef __COMMON_H__
+#define __COMMON_H__
+
+static const char vs_std[] =
+"#version 150\n"
+"struct vs_struct {\n"
+"vec4 a[2];\n"
+"};\n"
+"uniform vs_uniform_block {\n"
+"vec4 vs_test;\n"
+"};\n"
+"uniform vs_struct sa[2];\n"
+"in vec4 vs_input0;\n"
+"in vec4 vs_input1;\n"
+"void main() {\n"
+"gl_Position = vs_input0 * vs_test * vs_input1 + sa[0].a[1] +"
+"  sa[1].a[1];\n&q

Re: [Piglit] [PATCH 3/4] program_interface_query: add tests for getprogramresourceindex

2015-03-26 Thread Martin Peres

On 25/03/15 18:01, Martin Peres wrote:

Tests tricky cases of resource naming along with some error cases of
getprogramresourceindex. It also replaces the resource-index test that
was incomplete and did not consistently report the same number of
subtests depending on errors.

Signed-off-by: Martin Peres 
---
  tests/all.py   |   2 +-
  .../arb_program_interface_query/CMakeLists.gl.txt  |   2 +-
  tests/spec/arb_program_interface_query/common.h|  21 ++
  .../getprogramresourceindex.c  | 338 +
  .../arb_program_interface_query/resource-index.c   | 284 -
  5 files changed, 361 insertions(+), 286 deletions(-)
  create mode 100755 
tests/spec/arb_program_interface_query/getprogramresourceindex.c
  delete mode 100644 tests/spec/arb_program_interface_query/resource-index.c

diff --git a/tests/all.py b/tests/all.py
index 86f2369..170d5b8 100755
--- a/tests/all.py
+++ b/tests/all.py
@@ -2273,9 +2273,9 @@ with profile.group_manager(
  PiglitGLTest,
  grouptools.join('spec', 'ARB_program_interface_query')) as g:
  g(['arb_program_interface_query-resource-location'], run_concurrent=False)
-g(['arb_program_interface_query-resource-index'], run_concurrent=False)
  g(['arb_program_interface_query-resource-query'], run_concurrent=False)
  g(['arb_program_interface_query-getprograminterfaceiv'], 
run_concurrent=False)
+g(['arb_program_interface_query-getprogramresourceindex'], 
run_concurrent=False)
  
  # Group ARB_explicit_uniform_location

  with profile.group_manager(
diff --git a/tests/spec/arb_program_interface_query/CMakeLists.gl.txt 
b/tests/spec/arb_program_interface_query/CMakeLists.gl.txt
index 91ace72..8b3bbd9 100755
--- a/tests/spec/arb_program_interface_query/CMakeLists.gl.txt
+++ b/tests/spec/arb_program_interface_query/CMakeLists.gl.txt
@@ -10,6 +10,6 @@ link_libraries (
  )
  
  piglit_add_executable (arb_program_interface_query-resource-location resource-location.c)

-piglit_add_executable (arb_program_interface_query-resource-index 
resource-index.c)
  piglit_add_executable (arb_program_interface_query-resource-query 
resource-query.c)
  piglit_add_executable (arb_program_interface_query-getprograminterfaceiv 
getprograminterfaceiv.c)
+piglit_add_executable (arb_program_interface_query-getprogramresourceindex 
getprogramresourceindex.c)
diff --git a/tests/spec/arb_program_interface_query/common.h 
b/tests/spec/arb_program_interface_query/common.h
index cc0b2bd..457e79e 100755
--- a/tests/spec/arb_program_interface_query/common.h
+++ b/tests/spec/arb_program_interface_query/common.h
@@ -35,6 +35,27 @@ static const char fs_empty[] =
"void main() {\n"
"}";
  
+static const char vs_array[] =

+   "#version 150\n"
+   "in vec4 vs_input[2];\n"
+   "struct vs_struct {\n"
+   "  vec4 hello;\n"
+   "  vec4 world[2];\n"
+   "};\n"
+   "uniform vs_struct sa[2];\n"
+   "void main() {\n"
+   "  gl_Position = vs_input[0] + sa[0].hello + sa[0].world[0];\n"
+   "}";
+
+static const char vs_aofa[] =
+   "#version 150\n"
+   "#extension GL_ARB_arrays_of_arrays : require\n"
+   "in vec4 vs_input2[2][2];\n"
+   "in vec4 vs_input3[2][2][2];\n"
+   "void main() {\n"
+   "  gl_Position = vs_input2[0][0] + vs_input3[0][0][0];\n"
+   "}";
+
  static const char vs_std[] =
"#version 150\n"
"struct vs_struct {\n"
diff --git a/tests/spec/arb_program_interface_query/getprogramresourceindex.c 
b/tests/spec/arb_program_interface_query/getprogramresourceindex.c
new file mode 100755
index 000..41aac3d
--- /dev/null
+++ b/tests/spec/arb_program_interface_query/getprogramresourceindex.c
@@ -0,0 +1,338 @@
+/*
+ * Copyright © 2015 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * 

Re: [Piglit] [PATCH 2/4] program_interface_query: add tests for getprograminterfaceiv

2015-03-26 Thread Martin Peres

On 26/03/15 11:01, Tapani Pälli wrote:
Also with this test we could have the NULL input test, to trigger bad 
things I think it needs to have non-empty shaders though, something like:


glGetProgramInterfaceiv(prog, GL_PROGRAM_OUTPUT, GL_MAX_NAME_LENGTH, 
NULL);


(some legal query that triggers driver to iterate resources and try to 
write to NULL)


Otherwise all the errors mentioned in the spec are tested, with null 
test addition;


I disagree with this one. The spec really is undefined for this and 
crashing is an acceptable
behaviour. I am fine with mesa testing for it, but we should not force 
every driver to

not crash.



Reviewed-by: Tapani Pälli 


As discussed IRL, I will keep your R-b :)




On 03/25/2015 06:01 PM, Martin Peres wrote:

This test exercises the error codepaths of getprograminterfaceiv.

Signed-off-by: Martin Peres 
---
  tests/all.py   |   1 +
  .../arb_program_interface_query/CMakeLists.gl.txt  |   1 +
  tests/spec/arb_program_interface_query/common.h|  10 +
  .../getprograminterfaceiv.c| 202 
+

  4 files changed, 214 insertions(+)
  create mode 100755 
tests/spec/arb_program_interface_query/getprograminterfaceiv.c


diff --git a/tests/all.py b/tests/all.py
index f47e198..86f2369 100755
--- a/tests/all.py
+++ b/tests/all.py
@@ -2275,6 +2275,7 @@ with profile.group_manager(
  g(['arb_program_interface_query-resource-location'], 
run_concurrent=False)
  g(['arb_program_interface_query-resource-index'], 
run_concurrent=False)
  g(['arb_program_interface_query-resource-query'], 
run_concurrent=False)
+g(['arb_program_interface_query-getprograminterfaceiv'], 
run_concurrent=False)


  # Group ARB_explicit_uniform_location
  with profile.group_manager(
diff --git a/tests/spec/arb_program_interface_query/CMakeLists.gl.txt 
b/tests/spec/arb_program_interface_query/CMakeLists.gl.txt

index 9535798..91ace72 100755
--- a/tests/spec/arb_program_interface_query/CMakeLists.gl.txt
+++ b/tests/spec/arb_program_interface_query/CMakeLists.gl.txt
@@ -12,3 +12,4 @@ link_libraries (
  piglit_add_executable 
(arb_program_interface_query-resource-location resource-location.c)
  piglit_add_executable (arb_program_interface_query-resource-index 
resource-index.c)
  piglit_add_executable (arb_program_interface_query-resource-query 
resource-query.c)
+piglit_add_executable 
(arb_program_interface_query-getprograminterfaceiv 
getprograminterfaceiv.c)
diff --git a/tests/spec/arb_program_interface_query/common.h 
b/tests/spec/arb_program_interface_query/common.h

index 4e5ff01..cc0b2bd 100755
--- a/tests/spec/arb_program_interface_query/common.h
+++ b/tests/spec/arb_program_interface_query/common.h
@@ -25,6 +25,16 @@
  #ifndef __COMMON_H__
  #define __COMMON_H__

+static const char vs_empty[] =
+"#version 150\n"
+"void main() {\n"
+"}";
+
+static const char fs_empty[] =
+"#version 150\n"
+"void main() {\n"
+"}";
+
  static const char vs_std[] =
  "#version 150\n"
  "struct vs_struct {\n"
diff --git 
a/tests/spec/arb_program_interface_query/getprograminterfaceiv.c 
b/tests/spec/arb_program_interface_query/getprograminterfaceiv.c

new file mode 100755
index 000..1d2ca08
--- /dev/null
+++ b/tests/spec/arb_program_interface_query/getprograminterfaceiv.c
@@ -0,0 +1,202 @@
+/*
+ * Copyright © 2015 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person 
obtaining a
+ * copy of this software and associated documentation files (the 
"Software"),
+ * to deal in the Software without restriction, including without 
limitation
+ * the rights to use, copy, modify, merge, publish, distribute, 
sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom 
the

+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including 
the next
+ * paragraph) shall be included in all copies or substantial 
portions of the

+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 
EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 
MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO 
EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES 
OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 
ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 
OTHER DEALINGS

+ * IN THE SOFTWARE.
+ */
+
+/**
+ * \file getprograminterfaceiv.c
+ *
+ * Tests the error cases of the GetProgramInterfaceiv interface.
+ *
+ * From the GL_ARB_program_interface_query spec:
+ *  "The command
+ *
+ *  void GetProgramInterfaceiv(uint program, enum programInterface,
+ *

Re: [Piglit] [PATCH 3/4] program_interface_query: add tests for getprogramresourceindex

2015-03-26 Thread Martin Peres


On 26/03/15 12:50, Tapani Pälli wrote:

On 03/26/2015 12:35 PM, Tapani Pälli wrote:



On 03/25/2015 06:01 PM, Martin Peres wrote:

Tests tricky cases of resource naming along with some error cases of
getprogramresourceindex. It also replaces the resource-index test that
was incomplete and did not consistently report the same number of
subtests depending on errors.

Signed-off-by: Martin Peres 
---
  tests/all.py   |   2 +-
  .../arb_program_interface_query/CMakeLists.gl.txt  |   2 +-
  tests/spec/arb_program_interface_query/common.h|  21 ++
  .../getprogramresourceindex.c  | 338
+
  .../arb_program_interface_query/resource-index.c   | 284
-
  5 files changed, 361 insertions(+), 286 deletions(-)
  create mode 100755
tests/spec/arb_program_interface_query/getprogramresourceindex.c
  delete mode 100644
tests/spec/arb_program_interface_query/resource-index.c

diff --git a/tests/all.py b/tests/all.py
index 86f2369..170d5b8 100755
--- a/tests/all.py
+++ b/tests/all.py
@@ -2273,9 +2273,9 @@ with profile.group_manager(
  PiglitGLTest,
  grouptools.join('spec', 'ARB_program_interface_query')) as g:
  g(['arb_program_interface_query-resource-location'],
run_concurrent=False)
-g(['arb_program_interface_query-resource-index'],
run_concurrent=False)
  g(['arb_program_interface_query-resource-query'],
run_concurrent=False)
  g(['arb_program_interface_query-getprograminterfaceiv'],
run_concurrent=False)
+ g(['arb_program_interface_query-getprogramresourceindex'],
run_concurrent=False)

  # Group ARB_explicit_uniform_location
  with profile.group_manager(
diff --git a/tests/spec/arb_program_interface_query/CMakeLists.gl.txt
b/tests/spec/arb_program_interface_query/CMakeLists.gl.txt
index 91ace72..8b3bbd9 100755
--- a/tests/spec/arb_program_interface_query/CMakeLists.gl.txt
+++ b/tests/spec/arb_program_interface_query/CMakeLists.gl.txt
@@ -10,6 +10,6 @@ link_libraries (
  )

  piglit_add_executable (arb_program_interface_query-resource-location
resource-location.c)
-piglit_add_executable (arb_program_interface_query-resource-index
resource-index.c)
  piglit_add_executable (arb_program_interface_query-resource-query
resource-query.c)
  piglit_add_executable
(arb_program_interface_query-getprograminterfaceiv
getprograminterfaceiv.c)
+piglit_add_executable
(arb_program_interface_query-getprogramresourceindex
getprogramresourceindex.c)
diff --git a/tests/spec/arb_program_interface_query/common.h
b/tests/spec/arb_program_interface_query/common.h
index cc0b2bd..457e79e 100755
--- a/tests/spec/arb_program_interface_query/common.h
+++ b/tests/spec/arb_program_interface_query/common.h
@@ -35,6 +35,27 @@ static const char fs_empty[] =
  "void main() {\n"
  "}";

+static const char vs_array[] =
+"#version 150\n"
+"in vec4 vs_input[2];\n"
+"struct vs_struct {\n"
+"vec4 hello;\n"
+"vec4 world[2];\n"
+"};\n"
+"uniform vs_struct sa[2];\n"
+"void main() {\n"
+"gl_Position = vs_input[0] + sa[0].hello + sa[0].world[0];\n"
+"}";
+
+static const char vs_aofa[] =
+"#version 150\n"
+"#extension GL_ARB_arrays_of_arrays : require\n"
+"in vec4 vs_input2[2][2];\n"
+"in vec4 vs_input3[2][2][2];\n"
+"void main() {\n"
+"gl_Position = vs_input2[0][0] + vs_input3[0][0][0];\n"
+"}";
+
  static const char vs_std[] =
  "#version 150\n"
  "struct vs_struct {\n"
diff --git
a/tests/spec/arb_program_interface_query/getprogramresourceindex.c
b/tests/spec/arb_program_interface_query/getprogramresourceindex.c
new file mode 100755
index 000..41aac3d
--- /dev/null
+++ b/tests/spec/arb_program_interface_query/getprogramresourceindex.c
@@ -0,0 +1,338 @@
+/*
+ * Copyright © 2015 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person
obtaining a
+ * copy of this software and associated documentation files (the
"Software"),
+ * to deal in the Software without restriction, including without
limitation
+ * the rights to use, copy, modify, merge, publish, distribute,
sublicense,
+ * and/or sell copies of the Software, and to permit persons to 
whom the
+ * Software is furnished to do so, subject to the following 
conditions:

+ *
+ * The above copyright notice and this permission notice (including
the next
+ * paragraph) shall be included in all copies or substantial portions
of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMEN

Re: [Piglit] [PATCH 4/4] program_interface_query: add tests for getprogramresourcename

2015-03-26 Thread Martin Peres



On 26/03/15 10:45, Tapani Pälli wrote:

Hi;

starting with the shortest .. :)

I have one addition to the test, after linking try out giving NULL for 
the name field:


glGetProgramResourceName(prog, GL_UNIFORM, pos, 0, &length, NULL);


This is not really in the spec, hence why I did not add it. Pointers 
should always be valid.


Anyway, better catch a bad implementation so I added it:

diff --git 
a/tests/spec/arb_program_interface_query/getprogramresourcename.c 
b/tests/spec/arb_program_interface_query/getprogramresourcename.c

index 9db705e..7dc3195 100755
--- a/tests/spec/arb_program_interface_query/getprogramresourcename.c
+++ b/tests/spec/arb_program_interface_query/getprogramresourcename.c
@@ -155,6 +155,12 @@ piglit_display(void)
piglit_report_subtest_result(local ? PIGLIT_PASS : PIGLIT_FAIL,
 "size == 0");

+   glGetProgramResourceName(prog, GL_UNIFORM, pos, 0, &length, NULL);
+   local = piglit_check_gl_error(GL_NO_ERROR);
+   pass = pass && local;
+   piglit_report_subtest_result(local ? PIGLIT_PASS : PIGLIT_FAIL,
+"NULL name");
+
if 
(piglit_is_extension_supported("GL_ARB_shader_atomic_counters")) {

glGetProgramResourceName(prog, GL_ATOMIC_COUNTER_BUFFER, 0,
 100, &length, name);




With this addition;
Reviewed-by: Tapani Pälli 


Added too, thanks.



On 03/25/2015 06:01 PM, Martin Peres wrote:

Tests the error paths of GetProgramResourceName

Signed-off-by: Martin Peres 
---
  tests/all.py   |   1 +
  .../arb_program_interface_query/CMakeLists.gl.txt  |   1 +
  .../getprogramresourcename.c   | 177 
+

  3 files changed, 179 insertions(+)
  create mode 100755 
tests/spec/arb_program_interface_query/getprogramresourcename.c


diff --git a/tests/all.py b/tests/all.py
index 170d5b8..d0b4b09 100755
--- a/tests/all.py
+++ b/tests/all.py
@@ -2276,6 +2276,7 @@ with profile.group_manager(
  g(['arb_program_interface_query-resource-query'], 
run_concurrent=False)
  g(['arb_program_interface_query-getprograminterfaceiv'], 
run_concurrent=False)
  g(['arb_program_interface_query-getprogramresourceindex'], 
run_concurrent=False)
+g(['arb_program_interface_query-getprogramresourcename'], 
run_concurrent=False)


  # Group ARB_explicit_uniform_location
  with profile.group_manager(
diff --git a/tests/spec/arb_program_interface_query/CMakeLists.gl.txt 
b/tests/spec/arb_program_interface_query/CMakeLists.gl.txt

index 8b3bbd9..2508342 100755
--- a/tests/spec/arb_program_interface_query/CMakeLists.gl.txt
+++ b/tests/spec/arb_program_interface_query/CMakeLists.gl.txt
@@ -13,3 +13,4 @@ piglit_add_executable 
(arb_program_interface_query-resource-location resource-lo
  piglit_add_executable (arb_program_interface_query-resource-query 
resource-query.c)
  piglit_add_executable 
(arb_program_interface_query-getprograminterfaceiv 
getprograminterfaceiv.c)
  piglit_add_executable 
(arb_program_interface_query-getprogramresourceindex 
getprogramresourceindex.c)
+piglit_add_executable 
(arb_program_interface_query-getprogramresourcename 
getprogramresourcename.c)
diff --git 
a/tests/spec/arb_program_interface_query/getprogramresourcename.c 
b/tests/spec/arb_program_interface_query/getprogramresourcename.c

new file mode 100755
index 000..9db705e
--- /dev/null
+++ b/tests/spec/arb_program_interface_query/getprogramresourcename.c
@@ -0,0 +1,177 @@
+/*
+ * Copyright © 2015 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person 
obtaining a
+ * copy of this software and associated documentation files (the 
"Software"),
+ * to deal in the Software without restriction, including without 
limitation
+ * the rights to use, copy, modify, merge, publish, distribute, 
sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom 
the

+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including 
the next
+ * paragraph) shall be included in all copies or substantial 
portions of the

+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 
EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 
MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO 
EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES 
OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 
ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 
OTHER DEALINGS

+ * IN THE SOFTWARE.
+ */
+
+/**
+ * \file getprogramresourcename.c
+ *
+ * Tests the error cases of the GetProgramResourceName interface. 
The real

+ * 

Re: [Piglit] [PATCH 1/4] program_interface_query: add tests for querying the resources

2015-03-26 Thread Martin Peres

On 25/03/15 18:01, Martin Peres wrote:

This tests primarily glGetProgramInterfaceiv in various (potentially
tricky) program pipelines. All the calls are supposed to succeed as
this test is purely functional.

This test requires a OpenGL 3.2 core context but also has optional
subtests that depend on the following extensions:
  - GL_ARB_shader_atomic_counters
  - GL_ARB_shader_storage_buffer_object
  - GL_ARB_shader_subroutine
  - GL_ARB_tessellation_shader
  - GL_ARB_compute_shader
  - GL_ARB_shader_image_load_store

Signed-off-by: Martin Peres 
---
  tests/all.py   |   1 +
  .../arb_program_interface_query/CMakeLists.gl.txt  |   1 +
  tests/spec/arb_program_interface_query/common.h| 238 +++
  .../arb_program_interface_query/resource-query.c   | 741 +
  4 files changed, 981 insertions(+)
  mode change 100644 => 100755 tests/all.py
  mode change 100644 => 100755 
tests/spec/arb_program_interface_query/CMakeLists.gl.txt
  create mode 100755 tests/spec/arb_program_interface_query/common.h
  create mode 100755 tests/spec/arb_program_interface_query/resource-query.c

diff --git a/tests/all.py b/tests/all.py
old mode 100644
new mode 100755
index b2266db..f47e198
--- a/tests/all.py
+++ b/tests/all.py
@@ -2274,6 +2274,7 @@ with profile.group_manager(
  grouptools.join('spec', 'ARB_program_interface_query')) as g:
  g(['arb_program_interface_query-resource-location'], run_concurrent=False)
  g(['arb_program_interface_query-resource-index'], run_concurrent=False)
+g(['arb_program_interface_query-resource-query'], run_concurrent=False)
  
  # Group ARB_explicit_uniform_location

  with profile.group_manager(
diff --git a/tests/spec/arb_program_interface_query/CMakeLists.gl.txt 
b/tests/spec/arb_program_interface_query/CMakeLists.gl.txt
old mode 100644
new mode 100755
index 2028553..9535798
--- a/tests/spec/arb_program_interface_query/CMakeLists.gl.txt
+++ b/tests/spec/arb_program_interface_query/CMakeLists.gl.txt
@@ -11,3 +11,4 @@ link_libraries (
  
  piglit_add_executable (arb_program_interface_query-resource-location resource-location.c)

  piglit_add_executable (arb_program_interface_query-resource-index 
resource-index.c)
+piglit_add_executable (arb_program_interface_query-resource-query 
resource-query.c)
diff --git a/tests/spec/arb_program_interface_query/common.h 
b/tests/spec/arb_program_interface_query/common.h
new file mode 100755
index 000..4e5ff01
--- /dev/null
+++ b/tests/spec/arb_program_interface_query/common.h
@@ -0,0 +1,238 @@
+/*
+ * Copyright © 2015 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#pragma once
+#ifndef __COMMON_H__
+#define __COMMON_H__
+
+static const char vs_std[] =
+   "#version 150\n"
+   "struct vs_struct {\n"
+   "  vec4 a[2];\n"
+   "};\n"
+   "uniform vs_uniform_block {\n"
+   "  vec4 vs_test;\n"
+   "};\n"
+   "uniform vs_struct sa[2];\n"
+   "in vec4 vs_input0;\n"
+   "in vec4 vs_input1;\n"
+   "void main() {\n"
+   "  gl_Position = vs_input0 * vs_test * vs_input1 + sa[0].a[1] +"
+   "sa[1].a[1];\n"
+   "}";
+
+const char gs_std[] =
+   "#version 150\n"
+   "layout(triangles) in;\n"
+   "layout(triangle_strip, max_vertices = 6) out;\n"
+   "uniform gs_uniform_block {\n"
+   "  vec4 gs_test;\n"
+   "};\n"
+   "in vec4 gs_input[3];\n"
+   "out vec4 gs_output0;\n"
+   "void main() {\n"
+   "  for (int i = 0; i < 6; i++) {\n"
+   "  gl_Position = gs_

[Piglit] [PATCH 1/4] program_interface_query: add tests for querying the resources

2015-03-25 Thread Martin Peres
This tests primarily glGetProgramInterfaceiv in various (potentially
tricky) program pipelines. All the calls are supposed to succeed as
this test is purely functional.

This test requires a OpenGL 3.2 core context but also has optional
subtests that depend on the following extensions:
 - GL_ARB_shader_atomic_counters
 - GL_ARB_shader_storage_buffer_object
 - GL_ARB_shader_subroutine
 - GL_ARB_tessellation_shader
 - GL_ARB_compute_shader
 - GL_ARB_shader_image_load_store

Signed-off-by: Martin Peres 
---
 tests/all.py   |   1 +
 .../arb_program_interface_query/CMakeLists.gl.txt  |   1 +
 tests/spec/arb_program_interface_query/common.h| 238 +++
 .../arb_program_interface_query/resource-query.c   | 741 +
 4 files changed, 981 insertions(+)
 mode change 100644 => 100755 tests/all.py
 mode change 100644 => 100755 
tests/spec/arb_program_interface_query/CMakeLists.gl.txt
 create mode 100755 tests/spec/arb_program_interface_query/common.h
 create mode 100755 tests/spec/arb_program_interface_query/resource-query.c

diff --git a/tests/all.py b/tests/all.py
old mode 100644
new mode 100755
index b2266db..f47e198
--- a/tests/all.py
+++ b/tests/all.py
@@ -2274,6 +2274,7 @@ with profile.group_manager(
 grouptools.join('spec', 'ARB_program_interface_query')) as g:
 g(['arb_program_interface_query-resource-location'], run_concurrent=False)
 g(['arb_program_interface_query-resource-index'], run_concurrent=False)
+g(['arb_program_interface_query-resource-query'], run_concurrent=False)
 
 # Group ARB_explicit_uniform_location
 with profile.group_manager(
diff --git a/tests/spec/arb_program_interface_query/CMakeLists.gl.txt 
b/tests/spec/arb_program_interface_query/CMakeLists.gl.txt
old mode 100644
new mode 100755
index 2028553..9535798
--- a/tests/spec/arb_program_interface_query/CMakeLists.gl.txt
+++ b/tests/spec/arb_program_interface_query/CMakeLists.gl.txt
@@ -11,3 +11,4 @@ link_libraries (
 
 piglit_add_executable (arb_program_interface_query-resource-location 
resource-location.c)
 piglit_add_executable (arb_program_interface_query-resource-index 
resource-index.c)
+piglit_add_executable (arb_program_interface_query-resource-query 
resource-query.c)
diff --git a/tests/spec/arb_program_interface_query/common.h 
b/tests/spec/arb_program_interface_query/common.h
new file mode 100755
index 000..4e5ff01
--- /dev/null
+++ b/tests/spec/arb_program_interface_query/common.h
@@ -0,0 +1,238 @@
+/*
+ * Copyright © 2015 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#pragma once
+#ifndef __COMMON_H__
+#define __COMMON_H__
+
+static const char vs_std[] =
+   "#version 150\n"
+   "struct vs_struct {\n"
+   "   vec4 a[2];\n"
+   "};\n"
+   "uniform vs_uniform_block {\n"
+   "   vec4 vs_test;\n"
+   "};\n"
+   "uniform vs_struct sa[2];\n"
+   "in vec4 vs_input0;\n"
+   "in vec4 vs_input1;\n"
+   "void main() {\n"
+   "   gl_Position = vs_input0 * vs_test * vs_input1 + sa[0].a[1] +"
+   " sa[1].a[1];\n"
+   "}";
+
+const char gs_std[] =
+   "#version 150\n"
+   "layout(triangles) in;\n"
+   "layout(triangle_strip, max_vertices = 6) out;\n"
+   "uniform gs_uniform_block {\n"
+   "   vec4 gs_test;\n"
+   "};\n"
+   "in vec4 gs_input[3];\n"
+   "out vec4 gs_output0;\n"
+   "void main() {\n"
+   "   for (int i = 0; i < 6; i++) {\n"
+   "   gl_Position = gs_input[i % 3] *"
+   

  1   2   >