Re: [Mesa-dev] [PATCH v2 11/13] nvc0/ir: do not lower shared+atomics on GM107+

2016-03-31 Thread Ilia Mirkin
On Mar 31, 2016 12:09 PM, "Samuel Pitoiset" wrote: > > For Maxwell, the ATOMS instruction can be used to perform atomic > operations on shared memory instead of this load/store lowering pass. > > Signed-off-by: Samuel Pitoiset > --- >

Re: [Mesa-dev] [PATCH v2 08/13] nvc0/ir: add support for compute UBOs on Kepler

2016-03-31 Thread Ilia Mirkin
On Mar 31, 2016 12:09 PM, "Samuel Pitoiset" wrote: > > Make sure to avoid out of bounds access in presence of indirect > array indexing by loading the size from the driver constant buffer. > > Signed-off-by: Samuel Pitoiset > --- >

Re: [Mesa-dev] [PATCH v2 07/13] nvc0: add indirect compute support on Kepler

2016-03-31 Thread Ilia Mirkin
On Mar 31, 2016 12:09 PM, "Samuel Pitoiset" wrote: > > The grid size is stored as three 32-bits integers in the indirect > buffer but the launch descriptor uses a 32-bits integer for both > griddim_y and griddim_z like this (z << 16) | y. To make it work, > the 16 high

Re: [Mesa-dev] [PATCH v2 04/13] nvc0: reserve an area for ubos info in the driver constbuf

2016-03-31 Thread Ilia Mirkin
Please see if you can't rejigger some stuff to make it all fit into 1024... I know it will have to grow for images, but let's try to limit the damage... On Mar 31, 2016 12:09 PM, "Samuel Pitoiset" wrote: > The compute launch descriptor only allows to set up 8 CBs, but

Re: [Mesa-dev] [PATCH v2 01/13] nvc0: bind driver cb for compute on c7[] for Kepler

2016-03-31 Thread Ilia Mirkin
As I recall, we already upload ms offsets for fs. Perhaps reuse the same spot for these CP ones? What are they used for, anyways? Can't think of anything offhand, but perhaps opencl needs something funky? On Mar 31, 2016 12:09 PM, "Samuel Pitoiset" wrote: > Instead of

Re: [Mesa-dev] [android-x86-devel] Re: gralloc_drm_pipe

2016-03-31 Thread Chih-Wei Huang
2016-04-01 2:40 GMT+08:00 Jaap Jan Meijer : > Op donderdag 31 maart 2016 13:02:36 UTC+2 schreef Chih-Wei Huang: > Thanks for the patch, I tested it on both x86 and x64 kernels and it doesn't > crash anymore, previously it did on both. > >> Thanks for the fix. I'll apply it.

Re: [Mesa-dev] [PATCH v3] compiler/glsl: invalidate float suffixes for glsl 1.10

2016-03-31 Thread Lars Hamre
Hi Ian and Roland, I am new to mesa development, so please bare with my questions: - Is there some protocol for testing against the private shader-db? (I assume private means I don't have access) - Would the person checking PlaneShift be someone who owns the game and can test it against

Re: [Mesa-dev] [android-x86-devel] Re: gralloc_drm_pipe

2016-03-31 Thread Jaap Jan Meijer
Op donderdag 31 maart 2016 13:02:36 UTC+2 schreef Chih-Wei Huang: > > 2016-03-31 0:09 GMT+08:00 Rob Herring : > > On Tue, Mar 29, 2016 at 2:49 PM, Jaap Jan Meijer > wrote: > >> > >> First of all, thanks for the hard work! > >> > >> Only one problem I

Re: [Mesa-dev] [PATCH 05/30] r600: refactor binding code for attach buffer to CB.

2016-03-31 Thread eocallaghan
Reviewed-by: Edward O'Callaghan On 2016-03-31 18:03, Dave Airlie wrote: From: Dave Airlie This refactors out the code and fixes it up to be used for images later. It uses the code in the current RAT binding for compute. Signed-off-by: Dave

Re: [Mesa-dev] [PATCH 04/30] r600: refactor out CB setup.

2016-03-31 Thread eocallaghan
Reviewed-by: Edward O'Callaghan On 2016-03-31 18:03, Dave Airlie wrote: From: Dave Airlie This moves the code to create CB info out into a separate function so it can be reused in images code to create RATs. Signed-off-by: Dave Airlie

Re: [Mesa-dev] [PATCH 02/30] r600: factor out the code to initialise a buffer resource.

2016-03-31 Thread eocallaghan
Reviewed-by: Edward O'Callaghan On 2016-03-31 18:03, Dave Airlie wrote: From: Dave Airlie This takes the code required to initialise a buffer resource out of the texture buffer code, into it's own function. This is going to be used for the

Re: [Mesa-dev] [PATCH 03/30] r600: refactor texture resource words setup code.

2016-03-31 Thread eocallaghan
Reviewed-by: Edward O'Callaghan On 2016-03-31 18:03, Dave Airlie wrote: From: Dave Airlie This refactors out the code to setup a texture resource so we can reuse it later from the images code. Signed-off-by: Dave Airlie

[Mesa-dev] [PATCH 35/41] glapi: glX_proto_send.py: Don't shadow builtins.

2016-03-31 Thread Dylan Baker
str is a builtin in python, although python doesn't prevent builtins from being shadowed, its still a bad idea. Signed-off-by: Dylan Baker --- src/mapi/glapi/gen/glX_proto_send.py | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git

[Mesa-dev] [PATCH 29/41] glapi: gl_XML.py: refactor out extra else statement

2016-03-31 Thread Dylan Baker
This is a pretty minor refactor, but it avoids having an else statement with a nested if. It instead makes it one big if statement. Signed-off-by: Dylan Baker --- src/mapi/glapi/gen/gl_XML.py | 13 ++--- 1 file changed, 6 insertions(+), 7 deletions(-) diff

[Mesa-dev] [PATCH 40/41] glapi: gl_x86_asm.py: simplify method with sum and generator

2016-03-31 Thread Dylan Baker
Rather than using a loop, and augmenting a variable use a generator and sum to achieve the same result. Signed-off-by: Dylan Baker --- src/mapi/glapi/gen/gl_x86_asm.py | 10 ++ 1 file changed, 2 insertions(+), 8 deletions(-) diff --git

[Mesa-dev] [PATCH 39/41] glapi: glX_server_table.py: use math.log instead of hand coded log2 function

2016-03-31 Thread Dylan Baker
This just saves a bit of typing. Signed-off-by: Dylan Baker --- src/mapi/glapi/gen/glX_server_table.py | 12 ++-- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/mapi/glapi/gen/glX_server_table.py b/src/mapi/glapi/gen/glX_server_table.py

[Mesa-dev] [PATCH 28/41] glapi: gl_XML.py: add missing method prototype.

2016-03-31 Thread Dylan Baker
This method is a no-op, but it shuts up tools that get upset that Print calls a non-existent method. Signed-off-by: Dylan Baker --- src/mapi/glapi/gen/gl_XML.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/mapi/glapi/gen/gl_XML.py

[Mesa-dev] [PATCH 38/41] glapi: glX_proto_size.py: Remove dead code.

2016-03-31 Thread Dylan Baker
This code has for a long time returned 0 on entry. This makes the code dead, and the one place it is invoked a no-op if statement (it will always go down the if path). Thanks to version control it's rather simple to restore it if someday someone decides that they want it. Signed-off-by: Dylan

[Mesa-dev] [PATCH 33/41] glapi: glX_proto_common.py: use python's _ for unused values

2016-03-31 Thread Dylan Baker
Rather than using a variable called junk, use _ for unused unpacked values. This is much more idiomatic. Signed-off-by: Dylan Baker --- src/mapi/glapi/gen/glX_proto_common.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[Mesa-dev] [PATCH 34/41] glapi: glX_proto_send.py: don't unpack useless values.

2016-03-31 Thread Dylan Baker
There are two ways to handle this. One is to use the _ placeholder value when multiple values are needed. The second is to use list indexing to get only the values actually needed when only one value is desired. Signed-off-by: Dylan Baker ---

[Mesa-dev] [PATCH 41/41] glapi: gl_x86-64_asm.py: use _ for unused variable

2016-03-31 Thread Dylan Baker
Don't assign variables that aren't actually used, just put them in _, the python unused variable. Signed-off-by: Dylan Baker --- src/mapi/glapi/gen/gl_x86-64_asm.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mapi/glapi/gen/gl_x86-64_asm.py

[Mesa-dev] [PATCH 36/41] glapi: glX_proto_send.py: remove useless pass keyword

2016-03-31 Thread Dylan Baker
The pass keyword is the solution for python's whitespace significant code. It's used when something is needed for whitespace rules, but not for programming. Don't add it after actual code. Signed-off-by: Dylan Baker --- src/mapi/glapi/gen/glX_proto_send.py | 1 - 1

[Mesa-dev] [PATCH 31/41] glapi: glX_proto_common.py: return variable from glx_print_proto.size_call

2016-03-31 Thread Dylan Baker
The variable has the same value as the explicit None return, but makes it clearer what's going on. Signed-off-by: Dylan Baker --- src/mapi/glapi/gen/glX_proto_common.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[Mesa-dev] [PATCH 37/41] glapi: glX_proto_send.py: simplify XCB string conversion

2016-03-31 Thread Dylan Baker
This makes the function a little simpler by using a special case for the initial "ARB", and just walking the str as a sequence rather than indexing into it. It also uses a list to join rather than overwritting a str over and over again. Signed-off-by: Dylan Baker ---

[Mesa-dev] [PATCH 23/41] glapi: gl_XML.py: use collections to simplify functionsIterateByCategory

2016-03-31 Thread Dylan Baker
This uses the collections.defaultdict to remove the need to check and add an empty dict, since defaultdict will call the default factory for us whenever a KeyError would be raised (by a missing key value). Signed-off-by: Dylan Baker --- src/mapi/glapi/gen/gl_XML.py |

[Mesa-dev] [PATCH 25/41] glapi: gl_XML.py: simplify is_attr_true

2016-03-31 Thread Dylan Baker
Use a boolean instead of 0 or 1, and use an assert rather than a runtime error. Signed-off-by: Dylan Baker --- src/mapi/glapi/gen/gl_XML.py | 12 +--- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/mapi/glapi/gen/gl_XML.py

[Mesa-dev] [PATCH 11/41] glapi: remove superflous parens in python

2016-03-31 Thread Dylan Baker
Remove parens that don't do anything. Mostly these are extra grouping parens in if statements, that aren't needed. Unlike C python doesn't require parens around the conditions of if statements, except to group them when using logical operators. It also removes them around the assert keyword.

[Mesa-dev] [PATCH 30/41] glapi: gl_XML.py: return a tuple from gl_parameter.get_dimensions

2016-03-31 Thread Dylan Baker
rather than a list. In python tuples are mainly for heterogenous collections, especially when position has relevance. Which makes them the right type for the job. Signed-off-by: Dylan Baker --- src/mapi/glapi/gen/gl_XML.py | 4 ++-- 1 file changed, 2 insertions(+), 2

[Mesa-dev] [PATCH 27/41] glapi: gl_XML.py: store compiled re as a module variable

2016-03-31 Thread Dylan Baker
This avoids recompiles of the re each time the function is called. Signed-off-by: Dylan Baker --- src/mapi/glapi/gen/gl_XML.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/mapi/glapi/gen/gl_XML.py b/src/mapi/glapi/gen/gl_XML.py index

[Mesa-dev] [PATCH 22/41] glapi: gl_XML.py: convert gl_api.functionIterateByOffset to a generator

2016-03-31 Thread Dylan Baker
This implementation is somewhat more efficient than the previous, and is less code. It works by replacing one of the list building functions with a generator, so that the last list can be avoided. It also decreases the size of the list that remains by using sorting instead of a sparse list.

[Mesa-dev] [PATCH 32/41] glapi: glX_proto_common.py: remove commented out code.

2016-03-31 Thread Dylan Baker
This can easily be restored with a revert if it's ever actually needed. Signed-off-by: Dylan Baker --- src/mapi/glapi/gen/glX_proto_common.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/mapi/glapi/gen/glX_proto_common.py

[Mesa-dev] [PATCH 10/41] glapi: Don't use string module in python modules

2016-03-31 Thread Dylan Baker
Rather than using the string module, use the same method for the str instance (join, split, replace, etc). It's more forward looking, since it will make smoothing over the str/bytes/unicode problem between python 2 and python 3. It's also more standard, using the string module isn't very common.

[Mesa-dev] [PATCH 24/41] glapi: gl_XML.py: rework gl_api.functionIterateByOffset

2016-03-31 Thread Dylan Baker
This reworks this method to use the sorted() built-in rather than taking the dictionary keys (which involves creating a brand new copy of the list in memory), sorting it, then iterating the new sorted list and doing a lookup into the dictionary. Then it does away with building a list and returning

[Mesa-dev] [PATCH 06/41] glapi: normalize python newlines

2016-03-31 Thread Dylan Baker
The python code has no standardization on how many newlines to put anywere. Sometimes top level items have one space between them, sometimes two, and sometimes three. Sometiems methods and other sub items had two, sometimes one, sometimes 3. This patches uses PEP8 styling (2 lines between top

[Mesa-dev] [PATCH 18/41] glapi: gl_XML.py: use python's iter() function rather than calling __iter__

2016-03-31 Thread Dylan Baker
Python has what are often referred to as "magic methods". __iter__, __str__, __add__, and countless more. All of these methods exist to be called by another function or by an operator. The __add__ method implements the + operator, for example. There are times to call the magic methods directly,

[Mesa-dev] [PATCH 19/41] glapi: gl_XML.py: remove gl_api.enumIterateByName

2016-03-31 Thread Dylan Baker
Originally I planned to make it more efficient, but then realized that it wasn't actually used anywhere, so lets just delete it. Signed-off-by: Dylan Baker --- src/mapi/glapi/gen/gl_XML.py | 10 -- 1 file changed, 10 deletions(-) diff --git

[Mesa-dev] [PATCH 03/41] glapi: Update copyright in python files to cover more than IBM

2016-03-31 Thread Dylan Baker
It's a bit odd to call IBM out in particular, especially since Brian Paul is listed as a copyright holder on chronologically before IBM. Either way this should probably have the standard "authors and/or copyright holders", in keeping with the standard MIT license.k Signed-off-by: Dylan Baker

[Mesa-dev] [PATCH 05/41] glapi: use python's textwrap.dedent to make code readable

2016-03-31 Thread Dylan Baker
This allows large blocks of C code that is going to be printed to be nested nicely in the python functions that print them, but still be printed at the same level they were previously. This helps to make the code visually more readable, and fixes syntax folding in vim. Signed-off-by: Dylan Baker

[Mesa-dev] [PATCH 14/41] glapi: use xrange instead of range in python

2016-03-31 Thread Dylan Baker
In python 2 range returns a new list, which is okay for very small values, but can get quite expensive for larger lists. xrange on the other hand is an iterator, which requires less memory and processing power. Signed-off-by: Dylan Baker ---

[Mesa-dev] [PATCH 15/41] glapi: remove useless 0 start parameter for (x)range

2016-03-31 Thread Dylan Baker
Python's range and xrange functions start at 0 by default anyway, so don't bother setting it explicitly to 0. Signed-off-by: Dylan Baker --- src/mapi/glapi/gen/glX_proto_size.py | 2 +- src/mapi/glapi/gen/glX_server_table.py | 4 ++-- src/mapi/glapi/gen/gl_XML.py

[Mesa-dev] [PATCH 21/41] glapi: gl_XML.py: simplify gl_api.functionIterateByOffset

2016-03-31 Thread Dylan Baker
Use the max function and a generator expression instead of a loop and if. This is certainly no less efficient, and saves several lines of code. Signed-off-by: Dylan Baker --- src/mapi/glapi/gen/gl_XML.py | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff

[Mesa-dev] [PATCH 17/41] glapi: replace RuntimeError with asserts or Exception

2016-03-31 Thread Dylan Baker
RuntimeError is a very specific type of error. In almost very case it's being raised where an assert is the right choice, and in the rest using a plain Exception is better, at least there it's obvious it's not that the python runtime hit an internal error and died. Signed-off-by: Dylan Baker

[Mesa-dev] [PATCH 09/41] glapi: fix singleton comparisons to use 'is' in python

2016-03-31 Thread Dylan Baker
Python has two equality comparitors, 'is' and '=='. The difference is that 'is' determines whether instance A *is* instance B, while '==' determines if instance A *has the same value as* instance B. Comparisons with singletons (the notable ones being None, True, and False) should always by done

[Mesa-dev] [PATCH 12/41] glapi: have only one statement per line in python files.

2016-03-31 Thread Dylan Baker
One line if statements (if foo: break) are pretty uncommon, and are not nearly as readable as their counterparts in other languages. Signed-off-by: Dylan Baker --- src/mapi/glapi/gen/glX_XML.py| 3 ++- src/mapi/glapi/gen/glX_proto_send.py | 9 ++---

[Mesa-dev] [PATCH 13/41] glapi: replace deprecated has_key method in python

2016-03-31 Thread Dylan Baker
This method (and it's sibling has_* methods) are deprecated in favor of the 'item in container' syntax. There are countless advantages to this for python, but for us this is necessary to get python 3 support. Signed-off-by: Dylan Baker --- src/mapi/glapi/gen/glX_XML.py

[Mesa-dev] [PATCH 16/41] glapi: Use booleans in python code.

2016-03-31 Thread Dylan Baker
All versions of python that are even worth considering for support (2.6+) have booleans (actually, so do a lot of versions not worth supporting), so don't use 1 and 0 for emulating them, which also helps to clarify the code, since returning an actual value of 1 or 0 happens). Signed-off-by: Dylan

[Mesa-dev] [PATCH 26/41] glapi: gl_XML.py: avoid unnecessary method call

2016-03-31 Thread Dylan Baker
Don't call and store a value that might not be used unless it's know it's needed. Signed-off-by: Dylan Baker --- src/mapi/glapi/gen/gl_XML.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/mapi/glapi/gen/gl_XML.py

[Mesa-dev] [PATCH 02/41] glapi: encode python files in utf-8 rather than ascii

2016-03-31 Thread Dylan Baker
This allows, among other things, the proper use of the Copyright symbol in the copyright header (which this patch also does). It cannot be used in the printed templates however, because they are printed, not directly written to a file. If a user doesn't have a UTF-8 locale (or has an operating

[Mesa-dev] [PATCH 07/41] glapi: remove useless returns from python code

2016-03-31 Thread Dylan Baker
In python functions return None by default, and it's uncommon to use an explicit return statement without a return value unless it's to return early. It's also uncommon to return None explicitly unless it's an alternate to another possible return value. This patch changes the code to only use

[Mesa-dev] [PATCH 20/41] glapi: gl_XML.py: make gl_api.categoryIterate a generator

2016-03-31 Thread Dylan Baker
This does basically the same thing as the previous implementation, although it uses sorted() to act on the dictionary without first copying the keys out into a list, and then indexing back into the dict; and uses yield to make the method a generator, removing the need to make another list.

[Mesa-dev] [PATCH 04/41] glapi: remove unnecessary semi-colons in python

2016-03-31 Thread Dylan Baker
They don't do anything, they're not required, and they look weird. The only use for semi-colons in python is to put two statements in a single line, which is quite frowned upon by the python community. Signed-off-by: Dylan Baker --- src/mapi/glapi/gen/glX_proto_size.py

[Mesa-dev] [PATCH 00/41] glapi python cleanups

2016-03-31 Thread Dylan Baker
This is the first part of a much larger project I'm working on to overhaul the generators. The end goal is to use mako templates rather than a massive series of print statements, be python 2.7 (the current) and python 3.3+ (I might be talked into support 3.2 if someone has a really good case)

[Mesa-dev] [PATCH 01/41] glapi: clean imports in python files

2016-03-31 Thread Dylan Baker
Completely clean the imports: - Split so that one module is imported per line - Remove unused imports - Group stdlib imports, then 3rd party modules, and finally local modules - sort alphabetically within those groups Signed-off-by: Dylan Baker ---

Re: [Mesa-dev] [PATCH] gallivm: Use vector selects on LLVM 3.4+.

2016-03-31 Thread Jose Fonseca
On 01/04/16 00:04, Roland Scheidegger wrote: Am 01.04.2016 um 00:42 schrieb Jose Fonseca: This is an old patch I had around. Vector selects seem to work well from LLVM 3.4. Using them might improve code quality, as it might make constant propagation pass more effective. Tested lp_test_* ---

Re: [Mesa-dev] [PATCH] gallivm: Use vector selects on LLVM 3.4+.

2016-03-31 Thread Roland Scheidegger
Am 01.04.2016 um 00:42 schrieb Jose Fonseca: > This is an old patch I had around. > > Vector selects seem to work well from LLVM 3.4. Using them might > improve code quality, as it might make constant propagation pass more > effective. > > Tested lp_test_* > --- >

[Mesa-dev] [PATCH] gallivm: Use vector selects on LLVM 3.4+.

2016-03-31 Thread Jose Fonseca
This is an old patch I had around. Vector selects seem to work well from LLVM 3.4. Using them might improve code quality, as it might make constant propagation pass more effective. Tested lp_test_* --- src/gallium/auxiliary/gallivm/lp_bld_logic.c | 8 +--- 1 file changed, 5 insertions(+),

Re: [Mesa-dev] [PATCH v2 2/2] glsl: raise warning when using uninitialized variables

2016-03-31 Thread Kenneth Graunke
On Thursday, March 31, 2016 12:37:31 AM PDT Jordan Justen wrote: > On 2016-03-30 02:03:29, Alejandro Piñeiro wrote: > > On 30/03/16 09:44, Alejandro Piñeiro wrote: > > > On 30/03/16 06:16, Kenneth Graunke wrote: > > > > >> I was just looking at that today...adding an ordinary global variable > >

[Mesa-dev] [PATCH v2] math: Import isinf and others to global namespace

2016-03-31 Thread Pierre Moreau
Starting from C++11, several math functions, like isinf, moved into the std namespace. Since cmath undefines those functions before redefining them inside the namespace, and glibc 2.23 defines the C variants as macros, the C variants in global namespace are not accessible any longer. v2: Move the

[Mesa-dev] [PATCH] drirc: add a workaround for blackness in Warsow

2016-03-31 Thread Marek Olšák
From: Marek Olšák --- src/mesa/drivers/dri/common/drirc | 8 1 file changed, 8 insertions(+) diff --git a/src/mesa/drivers/dri/common/drirc b/src/mesa/drivers/dri/common/drirc index 183a1dc..3912d8b 100644 --- a/src/mesa/drivers/dri/common/drirc +++

Re: [Mesa-dev] Meaning of "DONE (core only)"

2016-03-31 Thread Romain Failliot
> My take is (and always has been) that the point of GL3.txt is to coordinate > amongst developers, so clarity is paramount. I completely understand and I'm sure we can do both. The problem here is simply that we're mixing dev comments and feature statuses. I'm working on a way to simply edit

Re: [Mesa-dev] [PATCH v2 00/13] nvc0: ARB_compute_shader for Kepler/Maxwell

2016-03-31 Thread Samuel Pitoiset
On 03/31/2016 06:27 PM, Ilia Mirkin wrote: On Thu, Mar 31, 2016 at 12:08 PM, Samuel Pitoiset wrote: Hi, This series adds support for ARB_compute_shader on GK104 and GM107+, except on GK110 where one test miserably fail (related to texelFetch) for really weird

Re: [Mesa-dev] [PATCH 05/10] glsl: Add all system variables to the input resource list.

2016-03-31 Thread Ilia Mirkin
On Thu, Mar 31, 2016 at 2:53 PM, Kenneth Graunke wrote: > System values are just built-in input variables that we've opted to > special-case out of convenience. We need to consider all inputs, > regardless of how we've classified them. > > Unfortunately, there's one

[Mesa-dev] [PATCH 07/10] glsl: Consolidate gl_VertexIDMESA -> gl_VertexID query hacks.

2016-03-31 Thread Kenneth Graunke
A program will either have gl_VertexID or gl_VertexIDMESA (the lowered zero-based version), not both. Just spoof it in the resource list so the hacks are done in a single place. Signed-off-by: Kenneth Graunke --- src/compiler/glsl/linker.cpp | 12 ++--

[Mesa-dev] [PATCH 09/10] glsl: Fix prorgram interface query locations biasing for SSO.

2016-03-31 Thread Kenneth Graunke
With SSO, the GL_PROGRAM_INPUT and GL_PROGRAM_OUTPUT interfaces refer to the first and last shader stage linked into a program. This may not be the vertex and fragment shader stages. So, subtracting VERT_ATTRIB_GENERIC0 and FRAG_RESULT_DATA0 is bogus. We need to subtract VERT_ATTRIB_GENERIC0 for

[Mesa-dev] [PATCH 04/10] glsl: Delete hack for VS system values.

2016-03-31 Thread Kenneth Graunke
This makes no sense. If the stage being considered is the vertex shader, then we'll add inputs and system values appropriately. If we're not considering the vertex shader, then we absolutely should not do anything with it. Signed-off-by: Kenneth Graunke ---

[Mesa-dev] [PATCH 08/10] glsl: Return -1 for program interface query locations in many cases.

2016-03-31 Thread Kenneth Graunke
We were recording locations for all variables, even ones without an explicit location set. Implement the rules from the spec, and record -1 in the resource list accordngly. Make program_resource_location stop doing math on negative values. Remove hacks that are no longer necessary now that

[Mesa-dev] [PATCH 05/10] glsl: Add all system variables to the input resource list.

2016-03-31 Thread Kenneth Graunke
System values are just built-in input variables that we've opted to special-case out of convenience. We need to consider all inputs, regardless of how we've classified them. Unfortunately, there's one exception: we shouldn't add gl_BaseVertex unless ARB_shader_draw_parameters is enabled, because

[Mesa-dev] [PATCH 10/10] glsl: Fix return value of glGetProgramResourceiv of GL_BLOCK_INDEX.

2016-03-31 Thread Kenneth Graunke
According to Timothy, block_index is an index into the BufferInterfaceBlocks array. We want to return an index into the UniformBlocks or ShaderStorageBlocks array, as that's what everything else expects. Fixes several dEQP-GLES31.functional tests: -

[Mesa-dev] [PATCH 03/10] glsl: Make add_interface_variables only consider the appropriate stage.

2016-03-31 Thread Kenneth Graunke
add_interface_variables() is supposed to add variables for the inputs of the first shader stage linked into a program, and the outputs of the last shader stage linked into a program. From the ARB_program_interface_query specification: "* PROGRAM_INPUT corresponds to the set of active input

[Mesa-dev] [PATCH 01/10] glsl: Pass stage to add_interface_variables().

2016-03-31 Thread Kenneth Graunke
add_interface_variables is supposed to add variables from either the first or last stage of a linked shader. But it has no way of knowing the stage it's being asked to process, which makes it impossible to produce correct stagerefs. Signed-off-by: Kenneth Graunke ---

[Mesa-dev] [PATCH 06/10] glsl: Clean up some leftover cruft.

2016-03-31 Thread Kenneth Graunke
stages is always 1 << stage now. Signed-off-by: Kenneth Graunke --- src/compiler/glsl/linker.cpp | 6 +- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/compiler/glsl/linker.cpp b/src/compiler/glsl/linker.cpp index 48aa395..7d6c60a 100644 ---

[Mesa-dev] [PATCH 02/10] glsl: Clarify "mask" variable in add_interface_variables().

2016-03-31 Thread Kenneth Graunke
This is a bitfield of which stages refer to a variable. It is not used to mask off bits. In fact, it's used to contribute additional bits. Rename it and tidy a bit of the logic. Signed-off-by: Kenneth Graunke --- src/compiler/glsl/linker.cpp | 10 +- 1 file

Re: [Mesa-dev] [PATCH 1/3] ptn: Silence unused parameter warning

2016-03-31 Thread Kenneth Graunke
On Wednesday, March 30, 2016 4:23:30 PM PDT Ian Romanick wrote: > From: Ian Romanick > > The KIL instruction doesn't have a destination, so ptn_kil never uses > dest. > > program/prog_to_nir.c: In function ‘ptn_kil’: > program/prog_to_nir.c:547:38: warning: unused

Re: [Mesa-dev] Meaning of "DONE (core only)"

2016-03-31 Thread Ilia Mirkin
On Thu, Mar 31, 2016 at 2:10 PM, Romain Failliot wrote: > Hi! > > Two extensions have been recently flagged "DONE (core only)". > From what we understood [1], it means that it's done in mesa, but drivers > need to implement it. > > So, first: is that it? Yes. (More

[Mesa-dev] Meaning of "DONE (core only)"

2016-03-31 Thread Romain Failliot
Hi! Two extensions have been recently flagged "DONE (core only)". >From what we understood [1], it means that it's done in mesa, but drivers need to implement it. So, first: is that it? And, second: if it is, could we change for the syntax made for it: "DONE ()"? I'll be happy to do the patch

Re: [Mesa-dev] [PATCH] tgsi: split tgsi_util_get_texture_coord_dim() function into two

2016-03-31 Thread Roland Scheidegger
Am 31.03.2016 um 03:06 schrieb Brian Paul: > It was kind of overloaded, returning two different things. Now get > the index of the shadow reference src register with a new > tgsi_util_get_shadow_ref_src_index() function. > > To verify the new code, I added some temp/debug code which looped >

[Mesa-dev] [PATCH v2 00/13] nvc0: ARB_compute_shader for Kepler/Maxwell

2016-03-31 Thread Samuel Pitoiset
Hi, This series adds support for ARB_compute_shader on GK104 and GM107+, except on GK110 where one test miserably fail (related to texelFetch) for really weird reasons. Anyway, this is not going to break anything because NVF0_COMPUTE is still required for using compute on GK110. I will have a

Re: [Mesa-dev] [PATCH v2 00/13] nvc0: ARB_compute_shader for Kepler/Maxwell

2016-03-31 Thread Ilia Mirkin
On Thu, Mar 31, 2016 at 12:08 PM, Samuel Pitoiset wrote: > Hi, > > This series adds support for ARB_compute_shader on GK104 and GM107+, except on > GK110 where one test miserably fail (related to texelFetch) for really weird > reasons. Anyway, this is not going to break

[Mesa-dev] [PATCH v2 06/13] nvc0: reduce likelihood of collision for real buffers on Kepler

2016-03-31 Thread Samuel Pitoiset
Reduce likelihood of collision with real buffers by placing the hole at the top of the 4G area. This fixes some indirect draw+compute tests with large buffers. Suggested by Ilia Mirkin. Signed-off-by: Samuel Pitoiset ---

[Mesa-dev] [PATCH v2 05/13] nvc0: store ubo info to the driver constbuf on Kepler

2016-03-31 Thread Samuel Pitoiset
Signed-off-by: Samuel Pitoiset --- .../drivers/nouveau/codegen/nv50_ir_driver.h | 1 + src/gallium/drivers/nouveau/nvc0/nvc0_context.h| 3 +++ src/gallium/drivers/nouveau/nvc0/nvc0_program.c| 1 + src/gallium/drivers/nouveau/nvc0/nve4_compute.c| 26

[Mesa-dev] [Bug 94752] framebuffer from a destroyed drawable is reused when binding the same context to other drawable

2016-03-31 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=94752 --- Comment #4 from Guilherme --- (In reply to Guilherme from comment #3) > Just to add that I could also reproduce the bug with direct rendering. Of > course, with the patch that forces the second dri_drawable to be allocated

[Mesa-dev] [PATCH v2 13/13] nvc0: enable compute shaders on GK104 and GM107+

2016-03-31 Thread Samuel Pitoiset
Compute support on GK110 is still unstable for weird reasons, but this can be fixed later as the NVF0_COMPUTE envvar prevent using compute. Note that GL3.txt is not updated yet because GL_ARB_compute_shader is a bit useless without ARB_shader_image_load_store. Signed-off-by: Samuel Pitoiset

[Mesa-dev] [PATCH v2 08/13] nvc0/ir: add support for compute UBOs on Kepler

2016-03-31 Thread Samuel Pitoiset
Make sure to avoid out of bounds access in presence of indirect array indexing by loading the size from the driver constant buffer. Signed-off-by: Samuel Pitoiset --- .../nouveau/codegen/nv50_ir_lowering_nvc0.cpp | 55 +-

[Mesa-dev] [PATCH v2 09/13] nvc0/ir: fix wrong pred emission for ld lock on GK104

2016-03-31 Thread Samuel Pitoiset
This fixes 84b9b8f (nvc0/ir: add missing emission of locked load predicate). Signed-off-by: Samuel Pitoiset --- src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nvc0.cpp | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git

[Mesa-dev] [PATCH v2 07/13] nvc0: add indirect compute support on Kepler

2016-03-31 Thread Samuel Pitoiset
The grid size is stored as three 32-bits integers in the indirect buffer but the launch descriptor uses a 32-bits integer for both griddim_y and griddim_z like this (z << 16) | y. To make it work, the 16 high bits of griddim_y are overwritten by griddim_z. Changes from v2: - upload the whole

[Mesa-dev] [PATCH v2 11/13] nvc0/ir: do not lower shared+atomics on GM107+

2016-03-31 Thread Samuel Pitoiset
For Maxwell, the ATOMS instruction can be used to perform atomic operations on shared memory instead of this load/store lowering pass. Signed-off-by: Samuel Pitoiset --- .../nouveau/codegen/nv50_ir_lowering_nvc0.cpp| 20 +--- 1 file changed, 13

[Mesa-dev] [PATCH v2 10/13] nvc0/ir: add atomics support on shared memory for Kepler

2016-03-31 Thread Samuel Pitoiset
Signed-off-by: Samuel Pitoiset --- .../nouveau/codegen/nv50_ir_lowering_nvc0.cpp | 114 - .../nouveau/codegen/nv50_ir_lowering_nvc0.h| 1 + 2 files changed, 114 insertions(+), 1 deletion(-) diff --git

[Mesa-dev] [PATCH v2 12/13] nvc0: bump the maximum number of UBOs for compute on Kepler

2016-03-31 Thread Samuel Pitoiset
The maximum number of uniform blocks (MAX_COMPUTE_UNIFORM_BLOCKS) per compute program must be at least 12. Signed-off-by: Samuel Pitoiset --- src/gallium/drivers/nouveau/nvc0/nvc0_screen.c | 2 -- src/gallium/drivers/nouveau/nvc0/nvc0_screen.h | 1 - 2 files changed,

[Mesa-dev] [PATCH v2 02/13] nvc0: bind shader buffers for compute on Kepler

2016-03-31 Thread Samuel Pitoiset
Signed-off-by: Samuel Pitoiset --- src/gallium/drivers/nouveau/nvc0/nvc0_program.c | 4 +-- src/gallium/drivers/nouveau/nvc0/nve4_compute.c | 38 + 2 files changed, 39 insertions(+), 3 deletions(-) diff --git

[Mesa-dev] [PATCH v2 03/13] nvc0: bind user uniforms for compute on Kepler

2016-03-31 Thread Samuel Pitoiset
Uniform buffer objects will be sticked to the driver constant buffer like buffers because the launch descriptor only allows 8 CBs. Input kernel parameters for OpenCL are still uploaded to screen->parm which is bound on c0, but this will be changed later with a new series. Signed-off-by: Samuel

[Mesa-dev] [PATCH v2 04/13] nvc0: reserve an area for ubos info in the driver constbuf

2016-03-31 Thread Samuel Pitoiset
The compute launch descriptor only allows to set up 8 CBs, but OpenGL requires at least 12 UBOs. To bypass this limitation, we store the ubos info into the driver constant buffer. This will be only used for Kepler. This bumps the size of each shader area from 1K to 2K. Signed-off-by: Samuel

[Mesa-dev] [PATCH v2 01/13] nvc0: bind driver cb for compute on c7[] for Kepler

2016-03-31 Thread Samuel Pitoiset
Instead of using the screen->parm buffer object which will be removed, upload auxiliary constants to uniform_bo to be consistent regarding what we already do for Fermi. This breaks surfaces support (for compute only) but this will be properly re-introduced later for ARB_shader_image_load_store.

Re: [Mesa-dev] [PATCH 1/2] tgsi: fix out of bounds access in exec_atomop()

2016-03-31 Thread Brian Paul
On 03/31/2016 02:54 AM, Samuel Pitoiset wrote: The number of channels must be 4 for all RGBA components. Fixes: 22d129601 ("tgsi: add support for image operations to tgsi_exec. (v2.1)") Signed-off-by: Samuel Pitoiset Cc: Dave Airlie ---

Re: [Mesa-dev] [PATCH] tgsi: split tgsi_util_get_texture_coord_dim() function into two

2016-03-31 Thread Brian Paul
On 03/31/2016 07:02 AM, Marek Olšák wrote: On Thu, Mar 31, 2016 at 3:15 AM, Dave Airlie wrote: On 31 March 2016 at 11:06, Brian Paul wrote: It was kind of overloaded, returning two different things. Now get the index of the shadow reference src register

[Mesa-dev] [PATCH] gallium/radeon: allow multiple exports of the same texture with different usage

2016-03-31 Thread Marek Olšák
From: Marek Olšák Instead of failing an assertion, disable DCC and CMASK on the first export that needs it, and merge the external usage flags. --- src/gallium/drivers/radeon/r600_texture.c | 55 ++- 1 file changed, 33 insertions(+), 22

Re: [Mesa-dev] [PATCH 27/29] nir/lower_to_source_mod: Skip unsafe operations

2016-03-31 Thread Connor Abbott
This seems a little ugly to me. Since these ops are just moving bits around, maybe we should just convert the float64 src/dest to uint64? We do this for other opcodes that just shuffle bits around. On Mon, Mar 21, 2016 at 8:06 AM, Samuel Iglesias Gonsálvez wrote: > From:

Re: [Mesa-dev] [PATCH v3] compiler/glsl: invalidate float suffixes for glsl 1.10

2016-03-31 Thread Roland Scheidegger
Am 31.03.2016 um 04:17 schrieb Ian Romanick: > Arg. :( > > It turns out that shaders in the game PlaneShift use float suffixes in > GLSL 1.10 shaders... at least the version of the shaders in our private > shader-db repo do. Once some one check to make sure the game still does > this, we will

Re: [Mesa-dev] [PATCH v2 2/2] glsl: raise warning when using uninitialized variables

2016-03-31 Thread Ilia Mirkin
On Thu, Mar 31, 2016 at 5:07 AM, Alejandro Piñeiro wrote: > On 31/03/16 09:37, Jordan Justen wrote: >> On 2016-03-30 02:03:29, Alejandro Piñeiro wrote: >>> On 30/03/16 09:44, Alejandro Piñeiro wrote: On 30/03/16 06:16, Kenneth Graunke wrote: > I was just looking at

Re: [Mesa-dev] [RFC PATCH] GBM: Add map/unmap functions

2016-03-31 Thread Rob Herring
On Thu, Mar 31, 2016 at 6:13 AM, Daniel Stone wrote: > Hi, > > On 31 March 2016 at 04:21, Rob Herring wrote: >> diff --git a/include/GL/internal/dri_interface.h >> b/include/GL/internal/dri_interface.h >> index 6bbd3fa..b059112 100644 >> ---

Re: [Mesa-dev] [PATCH 26/27] glsl: always enable ARB_enhanced_layouts in Core Profile

2016-03-31 Thread Ilia Mirkin
Presumably you also want to remove the enable from Consts.Extensions? (mtypes.h) On Thu, Mar 31, 2016 at 6:58 AM, Timothy Arceri wrote: > --- > src/compiler/glsl/glsl_parser_extras.cpp | 2 +- > src/mesa/main/extensions_table.h | 2 +- > 2 files changed, 2

  1   2   3   >