Re: [Mesa-dev] [PATCH] i965/hsw: compute DDX in a subspan based only on top row

2013-09-20 Thread Mark Mueller
Wow, it's not often we as developers get to attribute an unexplained performance improvement to silicon. I'm happy to say I guessed wrong here. Did this start specifically with Haswell and is it likely this will persist in future gen hardware - more specifically, what's the proper test by the driv

[Mesa-dev] [PATCH 11/11] ralloc: Remove the rzalloc-based new/delete operator definition macro.

2013-09-20 Thread Francisco Jerez
Using it encourages the (IMHO worrying) practice of leaving member variables uninitialized in constructor definitions. This macro shouldn't be necessary anymore after the last patch series fixing all its users to initialize all member variables from the class constructor. Remove it. --- src/glsl

[Mesa-dev] [PATCH 10/11] i965: Switch vec4_live_variables to the non-zeroing allocator.

2013-09-20 Thread Francisco Jerez
All member variables of vec4_live_variables are already being initialized from its constructor, it's not necessary to use rzalloc to allocate its memory, and doing so makes it more likely that we will start relying on the allocator to zero out all memory if the class is ever extended with new membe

[Mesa-dev] [PATCH 09/11] i965: Switch fs_live_variables to the non-zeroing allocator.

2013-09-20 Thread Francisco Jerez
All member variables of fs_live_variables are already being initialized from its constructor, it's not necessary to use rzalloc to allocate its memory, and doing so makes it more likely that we will start relying on the allocator to zero out all memory if the class is ever extended with new member

[Mesa-dev] [PATCH 08/11] i965: Switch fs_inst to the non-zeroing allocator.

2013-09-20 Thread Francisco Jerez
All member variables of fs_inst are already being initialized from its constructor, it's not necessary to use rzalloc to allocate its memory, and doing so makes it more likely that we will start relying on the allocator to zero out all memory if the class is ever extended with new member variables.

[Mesa-dev] [PATCH 06/11] i965: Initialize all member variables of cfg_t on construction.

2013-09-20 Thread Francisco Jerez
The cfg_t object relies on the memory allocator zeroing out its contents before it's initialized, which is quite an unusual practice in the C++ world because it ties objects to some specific allocation scheme, and gives unpredictable results when an object is created with a different allocator -- S

[Mesa-dev] [PATCH 07/11] i965: Switch ip_record to the non-zeroing allocator.

2013-09-20 Thread Francisco Jerez
All member variables of ip_record are already being initialized from its constructor, it's not necessary to use rzalloc to allocate its memory, and doing so makes it more likely that we will start relying on the allocator to zero out all memory if the class is ever extended with new member variable

[Mesa-dev] [PATCH 05/11] i965: Initialize all member variables of bblock_t on construction.

2013-09-20 Thread Francisco Jerez
The bblock_t object relies on the memory allocator zeroing out its contents before it's initialized, which is quite an unusual practice in the C++ world because it ties objects to some specific allocation scheme, and gives unpredictable results when an object is created with a different allocator -

[Mesa-dev] [PATCH 04/11] glsl: Switch ast_type_qualifier to the non-zeroing allocator.

2013-09-20 Thread Francisco Jerez
All member variables of ast_type_qualifier are already being initialized from its implicitly defined constructor, it's not necessary to use rzalloc to allocate its memory. --- src/glsl/ast.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/glsl/ast.h b/src/glsl/ast.h index f

[Mesa-dev] [PATCH 03/11] glsl: Switch ast_node to the non-zeroing allocator.

2013-09-20 Thread Francisco Jerez
All member variables of ast_node are already being initialized from its constructor, but some of its derived classes were leaving members uninitialized -- Fix them. Using rzalloc makes it more likely that we will start relying on the allocator to zero out all memory if the class is ever extended w

[Mesa-dev] [PATCH 02/11] i965: Initialize all member variables of vec4_instruction on construction.

2013-09-20 Thread Francisco Jerez
The vec4_instruction object relies on the memory allocator zeroing out its contents before it's initialized, which is quite an unusual practice in the C++ world because it ties objects to some specific allocation scheme, and gives unpredictable results when an object is created with a different all

[Mesa-dev] [PATCH 01/11] glsl: Initialize all member variables of _mesa_glsl_parse_state on construction.

2013-09-20 Thread Francisco Jerez
The _mesa_glsl_parse_state object relies on the memory allocator zeroing out its contents before it's initialized, which is quite an unusual practice in the C++ world because it ties objects to some specific allocation scheme, and gives unpredictable results when an object is created with a differe

[Mesa-dev] Zero allocation of C++ classes.

2013-09-20 Thread Francisco Jerez
This is a follow-up patch series on the issue we were discussing in the ARB_shader_atomic_counters thread, it's based on master with Ken's recent patch series that defines macros for implementing ralloc-based new and delete operators. I've done a closer analysis on the classes we used to allocate

[Mesa-dev] [PATCH] glsl: Fix usage of the wrong union member in program_resource_visitor::recursion.

2013-09-20 Thread Francisco Jerez
In the array-of-struct case, recursion() takes the row_major flag for each iteration from 't->fields.structure[i]', but 't' is not a record type. Inherit the array declaration row_major flag instead. This mistake was found by running piglit on valgrind. --- src/glsl/link_uniforms.cpp | 4 ++-- 1

[Mesa-dev] [PATCH 5/7] mesa: Drop an extra copy-and-pasted copy in the program clone function.

2013-09-20 Thread Eric Anholt
--- src/mesa/program/program.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/mesa/program/program.c b/src/mesa/program/program.c index 5dd68d9..aa3c5b4 100644 --- a/src/mesa/program/program.c +++ b/src/mesa/program/program.c @@ -485,7 +485,6 @@ _mesa_clone_program(struct gl_context *ctx,

[Mesa-dev] [PATCH 6/7] glsl: Hide many classes local to individual .cpp files in anon namespaces.

2013-09-20 Thread Eric Anholt
This gives the compiler the chance to inline and not export class symbols even in the absence of LTO. Saves about 60kb on disk. --- src/glsl/builtin_functions.cpp | 4 src/glsl/ir_function_detect_recursion.cpp| 4 src/glsl/ir_import_prototypes.cpp

[Mesa-dev] [PATCH 7/7] mesa: Use -Bsymbolic in the linker to locally resolve Mesa-internal symbols.

2013-09-20 Thread Eric Anholt
Normally, LD_PRELOAD will take precedence over your own symbols, which you want for things like malloc() in libc. But we don't have any local symbols we would want overridden (like hash_table_insert(), for example!), so tell the linker to resolve them internally. This also avoids calls through th

[Mesa-dev] [PATCH 2/7] mesa: Remove the extra enum strings and extra lookup table.

2013-09-20 Thread Eric Anholt
Now that there's no name -> enum direction, we can drop the extra strings, and merge the offsets table and the reduced_enums table. Between the previous commit and this one, Mesa core drops by 30k. --- src/mapi/glapi/gen/gl_enums.py | 61 ++ 1 file changed,

[Mesa-dev] [PATCH 4/7] mesa: Convert some runtime asserts to static asserts.

2013-09-20 Thread Eric Anholt
Noticed while grepping through the code for something else. --- src/mesa/program/program.c | 36 ++-- 1 file changed, 22 insertions(+), 14 deletions(-) diff --git a/src/mesa/program/program.c b/src/mesa/program/program.c index 2529c13..5dd68d9 100644 --- a/src/mesa

[Mesa-dev] Mesa built code size reduction

2013-09-20 Thread Eric Anholt
Since I'm going to be talking about the megadrivers idea next week at XDC, I thought I'd look at what the impact would be of an alternate option, and to do that I wanted to first fix up any stupid wastes of disk space I found. I found more than I expected. The last commit is an important one. I

[Mesa-dev] [PATCH 1/7] mesa: Remove _mesa_lookup_enum_by_name().

2013-09-20 Thread Eric Anholt
It's been unused for a long time. I stopped digging through git history as of 2009. --- src/mapi/glapi/gen/gl_enums.py | 29 - src/mesa/main/enums.h| 2 -- src/mesa/main/tests/enum_strings.cpp | 32 3 files change

[Mesa-dev] [PATCH 3/7] mesa: Shrink the size of the enum string lookup struct.

2013-09-20 Thread Eric Anholt
Since it's only used for debug information, we can misalign the struct and save the disk space. Another 19k on a 64-bit build. --- src/mapi/glapi/gen/gl_enums.py | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/mapi/glapi/gen/gl_enums.py b/src/mapi/glapi/gen/gl_enums.

Re: [Mesa-dev] [PATCH] glsl: Define isnormal and copysign for MSVC to fix build.

2013-09-20 Thread Matt Turner
On Fri, Sep 20, 2013 at 6:03 PM, Vinson Lee wrote: > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=69541 > Signed-off-by: Vinson Lee > --- > src/glsl/ir_constant_expression.cpp | 12 > 1 file changed, 12 insertions(+) > > diff --git a/src/glsl/ir_constant_expression.cpp >

[Mesa-dev] [PATCH] glsl: Define isnormal and copysign for MSVC to fix build.

2013-09-20 Thread Vinson Lee
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=69541 Signed-off-by: Vinson Lee --- src/glsl/ir_constant_expression.cpp | 12 1 file changed, 12 insertions(+) diff --git a/src/glsl/ir_constant_expression.cpp b/src/glsl/ir_constant_expression.cpp index 4579ef2..805e1f3 100644

[Mesa-dev] [Bug 57018] syntax error near unexpected token `[2.4.2]'

2013-09-20 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=57018 --- Comment #3 from Antonio Alecrim Jr --- git sha1: 1569b3e536da9337a28a16d0cc6ed07043bf094b To reproduce this "bug": mesa> ./autogen.sh ... src/egl/drivers/dri2/Makefile.am:37: error: Libtool library used but 'LIBTOOL' is undefined ... autorec

Re: [Mesa-dev] [PATCH 1/3] mesa: Add core support for the GL_AMD_performance_monitor extension.

2013-09-20 Thread Ian Romanick
On 09/20/2013 04:42 PM, Kenneth Graunke wrote: > On 09/20/2013 07:55 AM, Brian Paul wrote: >> On Thu, Sep 19, 2013 at 5:27 PM, Kenneth Graunke >> wrote: > [snip] >>> diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h >>> index 6d700ec..70dba6e 100644 >>> --- a/src/mesa/main/mtypes.h >>>

[Mesa-dev] XDC schedule published

2013-09-20 Thread Ian Romanick
"Final" schedule is now available: http://www.x.org/wiki/Events/XDC2013/Program/ ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Re: [Mesa-dev] [PATCH 1/3] mesa: Add core support for the GL_AMD_performance_monitor extension.

2013-09-20 Thread Kenneth Graunke
On 09/20/2013 07:55 AM, Brian Paul wrote: > On Thu, Sep 19, 2013 at 5:27 PM, Kenneth Graunke > wrote: [snip] >> diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h >> index 6d700ec..70dba6e 100644 >> --- a/src/mesa/main/mtypes.h >> +++ b/src/mesa/main/mtypes.h >> @@ -1778,6 +1778,89 @@ s

Re: [Mesa-dev] [PATCH 1/3] mesa: remove stale comment

2013-09-20 Thread Ian Romanick
How did you send these patches? They came formatted... strangely. Saving the e-mail as a file an using git-am resulted in a commit message: commit 97351aa26b74c33a102af8bf1e6bcfcd706d7a10 Author: Dylan Noblesmith Date: Fri Sep 20 11:55:19 2013 -0400 mesa: remove stale comment --001a1

Re: [Mesa-dev] [PATCH] implement NV_vdpau_interop v2

2013-09-20 Thread Christian König
Am 20.09.2013 17:39, schrieb Marek Olšák: On Fri, Sep 20, 2013 at 4:34 PM, Christian König wrote: [SNIP] diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c index 34615e3..7070812 100644 --- a/src/mesa/main/extensions.c +++ b/src/mesa/main/extensions.c @@ -332,6 +332,7 @@ stat

Re: [Mesa-dev] [PATCH] i965/hsw: compute DDX in a subspan based only on top row

2013-09-20 Thread Kenneth Graunke
On 09/20/2013 08:30 AM, Ian Romanick wrote: > On 09/20/2013 09:50 AM, Paul Berry wrote: [snip] >> Since the SAMPLER_MODE setting allows us to trade off quality vs >> performance, we're also interested to know whether a value less than >> 0x1f is sufficient to produce the performance improvement in

Re: [Mesa-dev] [PATCH] i965/gen7.5: Fix missing Shader Channel Select entries on Haswell

2013-09-20 Thread Kenneth Graunke
On 09/20/2013 03:56 AM, Abdiel Janulgue wrote: > Probably non-intentional, but the SURFACE_STATE setup refactoring > for buffer surfaces had missed the scs bits when creating constant > surface states. > > Fixes broken GLB 2.5 on Haswell where the knight's textures are missing > > Signed-off-by:

[Mesa-dev] [RFC PATCH] i965/fs: Improve accuracy of dFdy().

2013-09-20 Thread Paul Berry
Previously, we computed dFdy() using the following instruction: add(8) dst<1>F src<4,4,0)F -src.2<4,4,0>F { align1 1Q } That had the disadvantage that it computed the same value for all 4 pixels of a 2x2 subspan, which meant that it was less accurate than dFdx(). This patch changes it to the f

[Mesa-dev] [PATCH 3/3] mesa: remove handcounted magic number

2013-09-20 Thread Dylan Noblesmith
Also make it a compile-time error with STATIC_ASSERT. --- src/mesa/main/teximage.c | 33 - 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c index b719fc8..7a1d808 100644 --- a/src/mesa/main/teximag

[Mesa-dev] [PATCH 2/3] mesa: remove outdated comment

2013-09-20 Thread Dylan Noblesmith
No such argument exists since this commit: commit 92f3fca0ea429dcf07123e63447449db53308266 Author: Ian Romanick AuthorDate: Sun Aug 21 17:23:58 2011 -0700 Commit: Ian Romanick CommitDate: Tue Aug 23 14:52:09 2011 -0700 mesa: Remove target parameter from dd_function_table::BufferSubD

[Mesa-dev] [PATCH 1/3] mesa: remove stale comment

2013-09-20 Thread Dylan Noblesmith
This line stopped making sense in the great sed replace of commit f9995b30756140724f41daf963fa06167912be7f --- src/mesa/main/mtypes.h |2 -- 1 file changed, 2 deletions(-) diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index 6d700ec..3c8b018 100644 --- a/src/mesa/main/mtypes.h +

Re: [Mesa-dev] [PATCH] llvmpipe: Fix rendering to PIPE_FORMAT_R10G10B10A2_UNORM.

2013-09-20 Thread Roland Scheidegger
Am 20.09.2013 13:59, schrieb jfons...@vmware.com: > From: José Fonseca > > We must take rounding in consideration when re-scaling to narrow > normalized channels, such as 2-bit normalized alpha. > --- > src/gallium/drivers/llvmpipe/lp_state_fs.c | 84 > +++--- > 1 file c

Re: [Mesa-dev] [PATCH] i965/hsw: compute DDX in a subspan based only on top row

2013-09-20 Thread Ian Romanick
On 09/20/2013 09:50 AM, Paul Berry wrote: > On 17 September 2013 19:54, Chia-I Wu > wrote: > > Hi Paul, > > On Mon, Sep 16, 2013 at 3:46 PM, Chia-I Wu > wrote: > > On Sat, Sep 14, 2013 at 5:15 AM, Paul Berry > mailto:stereo

Re: [Mesa-dev] [PATCH] implement NV_vdpau_interop v2

2013-09-20 Thread Marek Olšák
On Fri, Sep 20, 2013 at 4:34 PM, Christian König wrote: > From: Christian König > > v2: Actually implement interop between the gallium > state tracker and the VDPAU backend. > > Signed-off-by: Christian König > --- > src/gallium/include/state_tracker/vdpau_interop.h | 49 > src/galliu

Re: [Mesa-dev] [PATCH] i965/hsw: compute DDX in a subspan based only on top row

2013-09-20 Thread Paul Berry
On 17 September 2013 19:54, Chia-I Wu wrote: > Hi Paul, > > On Mon, Sep 16, 2013 at 3:46 PM, Chia-I Wu wrote: > > On Sat, Sep 14, 2013 at 5:15 AM, Paul Berry > wrote: > >> On 12 September 2013 22:06, Chia-I Wu wrote: > >>> > >>> From: Chia-I Wu > >>> > >>> Consider only the top-left and top-r

Re: [Mesa-dev] [PATCH 0/4] RFC: gl_shader cache

2013-09-20 Thread Christoph Brill
2013/9/20 Tapani Pälli > Hello; > > This is RFC for shader cache implementation, goal is to optimize > application > startup time. The implementation is based on idea that Kenneth had on a > Mesa > branch for memory based cache. These patches implement a 'behind the > scenes' > cache for shader c

[Mesa-dev] [PATCH] implement NV_vdpau_interop v2

2013-09-20 Thread Christian König
From: Christian König v2: Actually implement interop between the gallium state tracker and the VDPAU backend. Signed-off-by: Christian König --- src/gallium/include/state_tracker/vdpau_interop.h | 49 src/gallium/state_trackers/vdpau/ftab.c | 31 ++- src/gallium/state_trac

Re: [Mesa-dev] [PATCH 2/3] draw/clip: don't emit so many empty triangles

2013-09-20 Thread Jose Fonseca
- Original Message - > Am 19.09.2013 20:43, schrieb Zack Rusin: > > Compress empty triangles (don't emit more than one in a row) and > > never emit empty triangles if we already generated a triangle > > covering a non-null area. We can't skip all null-triangles > > because c_primitives ex

[Mesa-dev] [PATCH] llvmpipe: Fix rendering to PIPE_FORMAT_R10G10B10A2_UNORM.

2013-09-20 Thread jfonseca
From: José Fonseca We must take rounding in consideration when re-scaling to narrow normalized channels, such as 2-bit normalized alpha. --- src/gallium/drivers/llvmpipe/lp_state_fs.c | 84 +++--- 1 file changed, 78 insertions(+), 6 deletions(-) diff --git a/src/gallium/

[Mesa-dev] [PATCH] i965/gen7.5: Fix missing Shader Channel Select entries on Haswell

2013-09-20 Thread Abdiel Janulgue
Probably non-intentional, but the SURFACE_STATE setup refactoring for buffer surfaces had missed the scs bits when creating constant surface states. Fixes broken GLB 2.5 on Haswell where the knight's textures are missing Signed-off-by: Abdiel Janulgue --- src/mesa/drivers/dri/i965/gen7_wm_surfa

[Mesa-dev] [PATCH 4/4] glsl: use gl_shader_cache when compiling (WIP)

2013-09-20 Thread Tapani Pälli
Patch takes gl_shader_cache in to use. When compiling a shader, we first search the cache if it exists already and can be used from there. If cache did not exist, we attempt to cache the shader after compilation. Signed-off-by: Tapani Pälli --- src/glsl/glsl_parser_extras.cpp | 40 ++

[Mesa-dev] [PATCH 2/4] mesa: gl_shader_cache class (WIP)

2013-09-20 Thread Tapani Pälli
Patch introduces gl_shader_cache class that uses ir_cache to save and load shaders from the disk. Known issues / bugs: - lightsmark textures black, unigine and glb2.7 texturing work just fine though .. something is broken there (?) - warsow going crazy at 'move_push_constants_to_pull_constants

[Mesa-dev] [PATCH 3/4] glsl: export populate_symbol_table

2013-09-20 Thread Tapani Pälli
will be used by compiler code when loading shaders from the cache Signed-off-by: Tapani Pälli --- src/glsl/linker.cpp | 2 +- src/glsl/linker.h | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/glsl/linker.cpp b/src/glsl/linker.cpp index 8a143fd..538676b 100644 --- a/s

[Mesa-dev] [PATCH 0/4] RFC: gl_shader cache

2013-09-20 Thread Tapani Pälli
Hello; This is RFC for shader cache implementation, goal is to optimize application startup time. The implementation is based on idea that Kenneth had on a Mesa branch for memory based cache. These patches implement a 'behind the scenes' cache for shader compiler storing gl_shader struct to the di

Re: [Mesa-dev] More questions from a newbie

2013-09-20 Thread Rogovin, Kevin
Hi all, >I'm not aware of any public web servers that serve up the doxygen >documentation right now. If you can find one (or set up one, or convince the >freedesktop.org >maintainers to set up one), I would >be in favor of putting overview style documentation in doxyge