Re: [Mesa-dev] [PATCH v3 16/28] gallium: Use _mesa_format_convert to implement st_GetTexImage.

2014-12-09 Thread Iago Toral
On Tue, 2014-12-09 at 15:01 +0100, Roland Scheidegger wrote: > This ought to be st/mesa: not gallium: in the shortlog. Otherwise makes > sense. > > Roland Fixed locally. Thanks! Iago > Am 09.12.2014 um 13:07 schrieb Iago Toral Quiroga: > > Instead of using _mesa_pack_rgba_span_float. This shoul

Re: [Mesa-dev] [PATCH 10/18] radeonsi: emit base vertex and start instance only if they change

2014-12-09 Thread Michel Dänzer
On 09.12.2014 20:39, Marek Olšák wrote: > > @@ -155,4 +155,7 @@ void si_begin_new_cs(struct si_context *ctx) > r600_postflush_resume_features(&ctx->b); > > ctx->b.initial_gfx_cs_size = ctx->b.rings.gfx.cs->cdw; > + ctx->last_base_vertex = SI_BASE_VERTEX_UNKNOWN; > + ctx->last

[Mesa-dev] [PATCH] glsl: Add gl_MaxViewports to available builtin constants

2014-12-09 Thread Maxence Le Doré
It seems to have been forgotten during viewports array implementation time. --- src/glsl/builtin_variables.cpp | 4 src/glsl/glsl_parser_extras.cpp | 3 +++ src/glsl/glsl_parser_extras.h | 3 +++ 3 files changed, 10 insertions(+) diff --git a/src/glsl/builtin_variables.cpp b/src/glsl/buil

Re: [Mesa-dev] [PATCH v3 01/24] mesa/format_utils: Fix a bug in unorm_to_float helper function

2014-12-09 Thread Samuel Iglesias Gonsálvez
On Wednesday, December 10, 2014 03:53:57 PM Michel Dänzer wrote: > On 09.12.2014 21:06, Iago Toral Quiroga wrote: > > From: Jason Ekstrand > > > > This patch fixes the return of a wrong value when x is lower than > > -MAX_INT(src_bits) as the result would not be between [-1.0 1.0]. > > > > v2 by

Re: [Mesa-dev] [PATCH v3 01/24] mesa/format_utils: Fix a bug in unorm_to_float helper function

2014-12-09 Thread Michel Dänzer
On 09.12.2014 21:06, Iago Toral Quiroga wrote: > From: Jason Ekstrand > > This patch fixes the return of a wrong value when x is lower than > -MAX_INT(src_bits) as the result would not be between [-1.0 1.0]. > > v2 by Samuel Iglesias : > - Modify unorm_to_float() to avoid doing the division

Re: [Mesa-dev] [Mesa-stable] [PATCH] egl: Added NULL check in eglCreateContext

2014-12-09 Thread Chad Versace
On 12/08/2014 01:45 PM, Ian Romanick wrote: > On 12/02/2014 12:10 AM, Valentin Corfu wrote: >> With this check we can avoid segmentation fault when invalid value used >> during eglCreateContext. >> >> Cc: mesa-sta...@lists.freedesktop.org >> Cc: mesa-dev@lists.freedesktop.org >> Signed-off-by: Val

Re: [Mesa-dev] [PATCH] r600g: fix regression since UCMP change

2014-12-09 Thread Connor Abbott
On Tue, Dec 9, 2014 at 12:44 AM, Roland Scheidegger wrote: > Am 09.12.2014 um 02:31 schrieb Dave Airlie: >> From: Dave Airlie >> >> Since d8da6deceadf5e48201d848b7061dad17a5b7cac where the >> state tracker started using UCMP on cayman a number of tests >> regressed. >> >> this seems to be r600g i

Re: [Mesa-dev] [PATCH] r600g: only init GS_VERT_ITEMSIZE on r600

2014-12-09 Thread Glenn Kennard
On Wed, 10 Dec 2014 04:55:21 +0100, Dave Airlie wrote: From: Dave Airlie On evergreen there are 4 regs, on r600/700 there is only one. Don't initialise regs and trash someone elses state. Not sure this fixes anything, but hey one less stupid. Signed-off-by: Dave Airlie --- src/gallium/dr

[Mesa-dev] [PATCH] r600g: only init GS_VERT_ITEMSIZE on r600

2014-12-09 Thread Dave Airlie
From: Dave Airlie On evergreen there are 4 regs, on r600/700 there is only one. Don't initialise regs and trash someone elses state. Not sure this fixes anything, but hey one less stupid. Signed-off-by: Dave Airlie --- src/gallium/drivers/r600/r600_state.c | 7 ++- 1 file changed, 2 inse

[Mesa-dev] IGNORE Re: [PATCH 4/4] i965: Make sure VALIGN_4 surfaces are Y tiled

2014-12-09 Thread Ben Widawsky
On Tue, Dec 09, 2014 at 04:03:00PM -0800, Ben Widawsky wrote: > Quoting the workaround already there: > "This field must be set to VALIGN_4 for all tiled Y Render Target surfaces." > > This patch simply asserts we return Y tiled, instead of X or Y. It has no > effect > on the code since the only

[Mesa-dev] [PATCH 2/3] draw: fix flatshade stage for constant interpolated values

2014-12-09 Thread sroland
From: Roland Scheidegger This stage only worked for traditional old-school flatshading, it did ignore constant interpolated values and only handled colors, the code probably predates using of constant interpolated values in gallium. So fix this - the clip stage apparently did this a long time ago

[Mesa-dev] [PATCH 3/3] draw: simplify prim id insertion in prim assembler

2014-12-09 Thread sroland
From: Roland Scheidegger Because all topologies are reduced to basic primitives (i.e. no strips, fans) and the vertices involved are all copied, there's no need for any elaborate decisions where to insert the prim id. The logic employed was correct for first provoking vertex, but didn't account a

[Mesa-dev] [PATCH 1/3] gallium/docs: clarify fragment shader position input w component.

2014-12-09 Thread sroland
From: Roland Scheidegger The previous language was a bit misleading, since it sounded like w was interpolated then the reciprocal calculated which isn't what should be happening. --- src/gallium/docs/source/tgsi.rst | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/ga

[Mesa-dev] [PATCH] r600: fix FMASK allocation on r600/700

2014-12-09 Thread Dave Airlie
From: Dave Airlie According to NDA docs: FMASK surfaces are addressed identically a surface with num_samples bits per element, and log2(num_samples) samples. For example, an FMASK for an 8-sample surface would be addressed identically to a color surface with 8 bits per element and 3 samples. S

Re: [Mesa-dev] [PATCH] r600g/sb: implement r600 gpr index workaround. (v3)

2014-12-09 Thread Glenn Kennard
On Wed, 10 Dec 2014 02:25:23 +0100, Dave Airlie wrote: From: Dave Airlie r600, rv610 and rv630 all have a bug in their GPR indexing and how the hw inserts access to PV. If the base index for the src is the same as the dst gpr in a previous group, then it will use PV instead of using the inde

[Mesa-dev] [PATCH] r600g/sb: implement r600 gpr index workaround. (v3)

2014-12-09 Thread Dave Airlie
From: Dave Airlie r600, rv610 and rv630 all have a bug in their GPR indexing and how the hw inserts access to PV. If the base index for the src is the same as the dst gpr in a previous group, then it will use PV instead of using the indexed gpr correctly. The workaround is to insert a NOP when

Re: [Mesa-dev] [PATCH] gallium/aux: Avoid redefining MAX

2014-12-09 Thread Alexander von Gluck IV
On , Matt Turner wrote: On Tue, Dec 9, 2014 at 1:21 PM, Alexander von Gluck wrote: * Can be redefined on some platforms through u_debug.h I think this is now the fourth copy of this message I've received? ___ mesa-dev mailing list mesa-dev@lists.fre

Re: [Mesa-dev] [PATCH] gallium/aux: Avoid redefining MAX

2014-12-09 Thread Matt Turner
On Tue, Dec 9, 2014 at 1:21 PM, Alexander von Gluck wrote: > * Can be redefined on some platforms through u_debug.h I think this is now the fourth copy of this message I've received? ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.

Re: [Mesa-dev] [PATCH 1/4] i965/byt: Allow 128 bpp to be linear or Y-tiled on

2014-12-09 Thread Ben Widawsky
On Tue, Dec 09, 2014 at 04:14:14PM -0800, Matt Turner wrote: > On Tue, Dec 9, 2014 at 4:02 PM, Ben Widawsky > wrote: > > Let's assume that this IVB specific feature exists on BYT too, since it's > > very > > much like IVB > > To clarify, the feature does *not* exist on Haswell and newer? > > Yo

Re: [Mesa-dev] [PATCH 1/4] i965/byt: Allow 128 bpp to be linear or Y-tiled on

2014-12-09 Thread Matt Turner
On Tue, Dec 9, 2014 at 4:02 PM, Ben Widawsky wrote: > Let's assume that this IVB specific feature exists on BYT too, since it's very > much like IVB To clarify, the feature does *not* exist on Haswell and newer? Your commit summary abruptly ___ mesa-de

Re: [Mesa-dev] FOSDEM15: Graphics DevRoom: call for speakers.

2014-12-09 Thread Luc Verhaegen
On Thu, Oct 02, 2014 at 07:44:57PM +0200, Luc Verhaegen wrote: > Hi, > > At FOSDEM on the 31st of january and the 1st of February 2015, there > will be another graphics DevRoom. URL: https://fosdem.org/2015/ > Slots will be handed out on a first come, first serve basis. The best > slots will go

[Mesa-dev] [PATCH] gallium/aux: Avoid redefining MAX

2014-12-09 Thread Alexander von Gluck
* Can be redefined on some platforms through u_debug.h --- src/gallium/auxiliary/cso_cache/cso_hash.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gallium/auxiliary/cso_cache/cso_hash.c b/src/gallium/auxiliary/cso_cache/cso_hash.c index e04d8ed..2a3f361 100644 --- a/src/gallium/auxili

Re: [Mesa-dev] [PATCH] clover: Fix build after llvm r223802

2014-12-09 Thread Tom Stellard
On Tue, Dec 09, 2014 at 05:42:42PM -0600, Aaron Watry wrote: > Signed-off-by: Aaron Watry Reviewed-by: Tom Stellard > --- > src/gallium/state_trackers/clover/llvm/invocation.cpp | 4 > 1 file changed, 4 insertions(+) > > diff --git a/src/gallium/state_trackers/clover/llvm/invocation.cpp >

[Mesa-dev] [PATCH 2/4] i965: Allow other tiling formats for 128 bpp on gen6+

2014-12-09 Thread Ben Widawsky
The most recent docs I can find say this workaround is needed for Sandybridge only. It says GEN6+ support linear, X, and Y, while GEN6 must be X or Y. commit c189840b21e176d87cbb382e64e848061b8c7b06 Author: Kenneth Graunke Date: Tue Aug 13 15:03:12 2013 -0700 i965: Force X-tiling for 128 b

[Mesa-dev] [PATCH 4/4] i965: Make sure VALIGN_4 surfaces are Y tiled

2014-12-09 Thread Ben Widawsky
Quoting the workaround already there: "This field must be set to VALIGN_4 for all tiled Y Render Target surfaces." This patch simply asserts we return Y tiled, instead of X or Y. It has no effect on the code since the only caller already does the right thing. However, I think it makes the workarou

[Mesa-dev] [PATCH 1/4] i965/byt: Allow 128 bpp to be linear or Y-tiled on

2014-12-09 Thread Ben Widawsky
Let's assume that this IVB specific feature exists on BYT too, since it's very much like IVB Signed-off-by: Ben Widawsky --- src/mesa/drivers/dri/i965/intel_mipmap_tree.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c b/src/mesa

[Mesa-dev] [PATCH 3/4] i965: Set VALIGN constraints for all gens >= 6

2014-12-09 Thread Ben Widawsky
As far as I can tell, this restriction is always needed. --- src/mesa/drivers/dri/i965/intel_mipmap_tree.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c index efe63b5..25bf37b 10064

Re: [Mesa-dev] [PATCH 5/5] tgsi: add tgsi_shader_info::writes_clipvertex

2014-12-09 Thread Roland Scheidegger
Am 09.12.2014 um 12:28 schrieb Marek Olšák: > From: Marek Olšák > > --- > src/gallium/auxiliary/tgsi/tgsi_scan.c | 3 +++ > src/gallium/auxiliary/tgsi/tgsi_scan.h | 1 + > 2 files changed, 4 insertions(+) > > diff --git a/src/gallium/auxiliary/tgsi/tgsi_scan.c > b/src/gallium/auxiliary/tgsi/tg

[Mesa-dev] [PATCH] clover: Fix build after llvm r223802

2014-12-09 Thread Aaron Watry
Signed-off-by: Aaron Watry --- src/gallium/state_trackers/clover/llvm/invocation.cpp | 4 1 file changed, 4 insertions(+) diff --git a/src/gallium/state_trackers/clover/llvm/invocation.cpp b/src/gallium/state_trackers/clover/llvm/invocation.cpp index cda447d..5265d10 100644 --- a/src/galli

[Mesa-dev] DRI3, i965_dri.so, and explicit fences

2014-12-09 Thread Ian Romanick
Okay... forgive my ignorance about this topic. It's my understanding that the ability to use explicit fences in Present exists to support GPUs like those from NVIDIA that have multiple rendering rings. On those GPUs, some mechanism is needed to synchronize across the rings so that rendering is fi

[Mesa-dev] [PATCH] r600g/sb: implement r600 gpr index workaround. (v2)

2014-12-09 Thread Dave Airlie
From: Dave Airlie r600, rv610 and rv630 all have a bug in their GPR indexing and how the hw inserts access to PV. If the base index for the src is the same as the dst gpr in a previous group, then it will use PV instead of using the indexed gpr correctly. The workaround is to insert a NOP when

[Mesa-dev] [PATCH 1/2] gallium/target: Haiku softpipe

2014-12-09 Thread Alexander von Gluck IV
* Use print macro to fix warning on 64-bit systems --- src/gallium/targets/haiku-softpipe/SoftwareRenderer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gallium/targets/haiku-softpipe/SoftwareRenderer.cpp b/src/gallium/targets/haiku-softpipe/SoftwareRenderer.cpp inde

[Mesa-dev] [PATCH 2/2] hgl: traverse add-on entries

2014-12-09 Thread Alexander von Gluck IV
From: Adrien Destugues * Allow using symlinks to add-ons when developing. --- src/hgl/GLRendererRoster.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hgl/GLRendererRoster.cpp b/src/hgl/GLRendererRoster.cpp index d29f7ec..9e5d847 100644 --- a/src/hgl/GLRendererRos

[Mesa-dev] Compiling llvm windows name mangled

2014-12-09 Thread Jason Anderssen
Hi All, I am trying to compile osmesa on linux with llvm for win32. I added the CFLAGS += -DUSE_MGL_NAMESPACE to the environment of the SConstruct, and the build process seems to be ok until the end when it tries to link the opengl32.dll, basically a lot of symbol not defined errors. Was wonde

[Mesa-dev] [PATCH] gallium/aux: Avoid redefining MAX

2014-12-09 Thread Alexander von Gluck IV
* Can be redefined on some platforms through u_debug.h --- src/gallium/auxiliary/cso_cache/cso_hash.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gallium/auxiliary/cso_cache/cso_hash.c b/src/gallium/auxiliary/cso_cache/cso_hash.c index e04d8ed..2a3f361 100644 --- a/src/gallium/auxil

[Mesa-dev] [PATCH] gallium/aux: Avoid redefining MAX

2014-12-09 Thread Alexander von Gluck IV
* Can be redefined on some platforms through u_debug.h --- src/gallium/auxiliary/cso_cache/cso_hash.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gallium/auxiliary/cso_cache/cso_hash.c b/src/gallium/auxiliary/cso_cache/cso_hash.c index e04d8ed..2a3f361 100644 --- a/src/gallium/aux

[Mesa-dev] [PATCH] gallium/aux: Avoid redefining MAX

2014-12-09 Thread Alexander von Gluck IV
* Can be redefined on some platforms through u_debug.h --- src/gallium/auxiliary/cso_cache/cso_hash.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gallium/auxiliary/cso_cache/cso_hash.c b/src/gallium/auxiliary/cso_cache/cso_hash.c index e04d8ed..2a3f361 100644 --- a/src/gallium/auxil

Re: [Mesa-dev] [PATCH] radeonsi: Don't modify PA_SC_RASTER_CONFIG register value if rb_mask == 0

2014-12-09 Thread Tom Stellard
On Tue, Dec 09, 2014 at 05:03:50PM +0900, Michel Dänzer wrote: > From: Michel Dänzer > > E.g. this could happen on older kernels which don't support the > RADEON_INFO_SI_BACKEND_ENABLED_MASK query yet. The code in > si_write_harvested_raster_configs() doesn't deal with this correctly and > would

Re: [Mesa-dev] [PATCH 1/5] gallium/util: add a helper util_create_shader_from_text, cleanup some code

2014-12-09 Thread Ilia Mirkin
On Tue, Dec 9, 2014 at 6:28 AM, Marek Olšák wrote: > diff --git a/src/gallium/auxiliary/util/u_simple_shaders.h > b/src/gallium/auxiliary/util/u_simple_shaders.h > index dd282e0..12f50f8 100644 > --- a/src/gallium/auxiliary/util/u_simple_shaders.h > +++ b/src/gallium/auxiliary/util/u_simple_shade

Re: [Mesa-dev] [PATCH 08/18] radeonsi: get info about VS outputs from tgsi_shader_info

2014-12-09 Thread Marek Olšák
Our hw can only do 6 legacy clip planes without ClipVertex. We would have to lower them to clip distances to be able to support 8, which is something I'd rather not do. (there would be more shader work or more shader variants) Marek On Tue, Dec 9, 2014 at 4:29 PM, Ilia Mirkin wrote: > On Tue, De

Re: [Mesa-dev] [PATCH 08/18] radeonsi: get info about VS outputs from tgsi_shader_info

2014-12-09 Thread Ilia Mirkin
On Tue, Dec 9, 2014 at 10:22 AM, Marek Olšák wrote: > It looks like clip planes are deprecated, so you can only use them > with the compatibility profile. Right. > > Sure we could support 8 clip planes if ClipVertex is written, but: > - we can only support 6 clip planes if ClipVertex isn't writt

Re: [Mesa-dev] [PATCH 08/18] radeonsi: get info about VS outputs from tgsi_shader_info

2014-12-09 Thread Marek Olšák
It looks like clip planes are deprecated, so you can only use them with the compatibility profile. Sure we could support 8 clip planes if ClipVertex is written, but: - we can only support 6 clip planes if ClipVertex isn't written - pipe_context::set_clip_state can set only 6 clip planes Marek O

Re: [Mesa-dev] [PATCH 1/5] gallium/util: add a helper util_create_shader_from_text, cleanup some code

2014-12-09 Thread Brian Paul
Series LGTM. Reviewed-by: Brian Paul On 12/09/2014 04:28 AM, Marek Olšák wrote: From: Marek Olšák It's exposed, because I plan to use it elsewhere later. --- src/gallium/auxiliary/util/u_simple_shaders.c | 103 -- src/gallium/auxiliary/util/u_simple_shaders.h | 3

Re: [Mesa-dev] [PATCH 08/18] radeonsi: get info about VS outputs from tgsi_shader_info

2014-12-09 Thread Ilia Mirkin
On Tue, Dec 9, 2014 at 10:05 AM, Marek Olšák wrote: > If clip distances are used, there can be 8 of them. Otherwise, if user > clip planes are used, there can only be 6 of them. If clip vertex is > used, there can still only be 6 clip planes - even though they are > lowered to clip distances. Ah

Re: [Mesa-dev] [PATCH 08/18] radeonsi: get info about VS outputs from tgsi_shader_info

2014-12-09 Thread Marek Olšák
If clip distances are used, there can be 8 of them. Otherwise, if user clip planes are used, there can only be 6 of them. If clip vertex is used, there can still only be 6 clip planes - even though they are lowered to clip distances. So first the writemask for clip distances is computed: unsigned

Re: [Mesa-dev] [PATCH 08/18] radeonsi: get info about VS outputs from tgsi_shader_info

2014-12-09 Thread Ilia Mirkin
On Tue, Dec 9, 2014 at 6:39 AM, Marek Olšák wrote: > From: Marek Olšák > > --- > src/gallium/drivers/radeonsi/si_shader.c | 27 > src/gallium/drivers/radeonsi/si_shader.h | 11 +- > src/gallium/drivers/radeonsi/si_state_draw.c | 31 > +---

Re: [Mesa-dev] [PATCH 09/18] radeonsi: emit clip registers only if VS or rasterizer is changed

2014-12-09 Thread Marek Olšák
"sctx->clip_regs.dirty = true;" should also be added into si_bind_gs_shader. Consider it done. Marek On Tue, Dec 9, 2014 at 12:39 PM, Marek Olšák wrote: > From: Marek Olšák > > --- > src/gallium/drivers/radeonsi/si_hw_context.c| 1 + > src/gallium/drivers/radeonsi/si_pipe.h | 4

Re: [Mesa-dev] [PATCH v3 16/28] gallium: Use _mesa_format_convert to implement st_GetTexImage.

2014-12-09 Thread Roland Scheidegger
This ought to be st/mesa: not gallium: in the shortlog. Otherwise makes sense. Roland Am 09.12.2014 um 13:07 schrieb Iago Toral Quiroga: > Instead of using _mesa_pack_rgba_span_float. This should allow us to remove > that function in a later patch. > --- > src/mesa/state_tracker/st_cb_texture.c

Re: [Mesa-dev] [PATCH v3 00/24] auto-generate pack/unpack functions

2014-12-09 Thread Iago Toral
On Tue, 2014-12-09 at 13:06 +0100, Iago Toral Quiroga wrote: > This is the first of two series that aim to address: > https://bugs.freedesktop.org/show_bug.cgi?id=84566 > > A branch with this series is available here: > https://github.com/Igalia/mesa/tree/itoral-autogen-packing-review-v3 As with

[Mesa-dev] [PATCH v3 23/24] mesa/pack: refactor _mesa_pack_rgba_span_float()

2014-12-09 Thread Iago Toral Quiroga
From: Samuel Iglesias Gonsalvez Use autogenerated format pack functions and take advantage of some macros to reduce source code, facilitating its maintenance. Unfortunately, dstType == GL_UNSIGNED_SHORT cannot simplified like the others, so keep it as it is. Signed-off-by: Samuel Iglesias Gonsa

[Mesa-dev] [PATCH v3 25/28] mesa: Remove _mesa_(un)pack_index_span

2014-12-09 Thread Iago Toral Quiroga
These are not used anywhere. --- src/mesa/main/pack.c | 219 --- src/mesa/main/pack.h | 15 2 files changed, 234 deletions(-) diff --git a/src/mesa/main/pack.c b/src/mesa/main/pack.c index 7e6f99c..07c64de 100644 --- a/src/mesa/main/pack.c +++

[Mesa-dev] [PATCH v3 18/28] mesa: Remove _mesa_unpack_color_span_uint

2014-12-09 Thread Iago Toral Quiroga
This is no longer used. --- src/mesa/main/pack.c | 646 --- src/mesa/main/pack.h | 6 - 2 files changed, 652 deletions(-) diff --git a/src/mesa/main/pack.c b/src/mesa/main/pack.c index 5d752f5..4e297ea 100644 --- a/src/mesa/main/pack.c +++ b/src/m

[Mesa-dev] [PATCH v3 27/28] mesa: Remove _mesa_rebase_rgba_uint and _mesa_rebase_rgba_float

2014-12-09 Thread Iago Toral Quiroga
These are no longer used anywhere now that we have _mesa_format_convert. --- src/mesa/main/pack.c | 126 --- src/mesa/main/pack.h | 7 --- 2 files changed, 133 deletions(-) diff --git a/src/mesa/main/pack.c b/src/mesa/main/pack.c index 07c64de..c4

[Mesa-dev] [PATCH v3 11/28] mesa: Use _mesa_format_convert to implement texstore_rgba.

2014-12-09 Thread Iago Toral Quiroga
Notice that _mesa_format_convert does not handle byte-swapping scenarios, GL_COLOR_INDEX or MESA_FORMAT_YCBCR(_REV), so these must be handled separately. Also, remove all the code that goes unused after using _mesa_format_convert. --- src/mesa/main/texstore.c | 684 +--

[Mesa-dev] [PATCH v3 20/28] mesa: Remove _mesa_make_temp_float_image

2014-12-09 Thread Iago Toral Quiroga
Now that we have _mesa_format_convert we don't need this. This was only used to create temporary RGBA float images in the process of storing some compressed formats. These can call _mesa_texstore with a RGBA/float dst to achieve the same goal. --- src/mesa/main/texcompress_bptc.c | 20 +++--- sr

[Mesa-dev] [PATCH v3 02/28] mesa: Expose compute_component_mapping as _mesa_compute_component_mapping

2014-12-09 Thread Iago Toral Quiroga
This is necessary to handle conversions between array types where the driver does not support the dst format requested by the client and chooses a different format instead. We will need this in _mesa_format_convert, so move it to format_utils.c, prefix it with '_mesa_' and make it available to oth

[Mesa-dev] [PATCH v3 21/28] mesa: Remove _mesa_unpack_color_span_ubyte

2014-12-09 Thread Iago Toral Quiroga
This is no longer used anywhere after moving to _mesa_format_convert. --- src/mesa/main/pack.c | 256 --- src/mesa/main/pack.h | 9 -- 2 files changed, 265 deletions(-) diff --git a/src/mesa/main/pack.c b/src/mesa/main/pack.c index 4e297ea..db8a3e

[Mesa-dev] [PATCH v3 09/24] swrast: Remove unused variable.

2014-12-09 Thread Iago Toral Quiroga
Reviewed-by: Ian Romanick --- src/mesa/swrast/s_drawpix.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/mesa/swrast/s_drawpix.c b/src/mesa/swrast/s_drawpix.c index f7926e4..227faa2 100644 --- a/src/mesa/swrast/s_drawpix.c +++ b/src/mesa/swrast/s_drawpix.c @@ -414,7 +414,6 @@ draw_rgba

[Mesa-dev] [PATCH v3 10/24] main: Add a concept of an array format

2014-12-09 Thread Iago Toral Quiroga
From: Jason Ekstrand An array format is a 32-bit integer format identifier that can represent any format that can be represented as an array of standard GL datatypes. Whie the MESA_FORMAT enums provide several of these, they don't account for all of them. v2 by Iago Toral Quiroga : - Implement

[Mesa-dev] [PATCH v3 15/28] swrast: Use _mesa_format_convert to implement draw_rgba_pixels.

2014-12-09 Thread Iago Toral Quiroga
This is the only place that uses _mesa_unpack_color_span_float so after this we should be able to remove that function. --- src/mesa/swrast/s_drawpix.c | 39 +++ 1 file changed, 35 insertions(+), 4 deletions(-) diff --git a/src/mesa/swrast/s_drawpix.c b/src/mes

[Mesa-dev] [PATCH v3 05/24] mesa: Fix get_texbuffer_format().

2014-12-09 Thread Iago Toral Quiroga
From: Samuel Iglesias Gonsalvez We were returning incorrect mesa formats for GL_LUMINANCE_ALPHA16I_EXT and GL_LUMINANCE_ALPHA32I_EXT. Signed-off-by: Samuel Iglesias Gonsalvez Reviewed-by: Ian Romanick --- src/mesa/main/teximage.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff

[Mesa-dev] [PATCH v3 22/24] mesa/main/pack_tmp.h: Add float conversion support

2014-12-09 Thread Iago Toral Quiroga
From: Samuel Iglesias Gonsalvez We will use this in a later patch to refactor _mesa_pack_rgba_span_float. Signed-off-by: Samuel Iglesias Gonsalvez --- src/mesa/main/pack_tmp.h | 75 +++- 1 file changed, 74 insertions(+), 1 deletion(-) diff --git a/s

[Mesa-dev] [PATCH v3 11/24] mesa: Let _mesa_get_format_base_format also handle mesa_array_format.

2014-12-09 Thread Iago Toral Quiroga
If we need the base format for a mesa_array_format we have to find the matching mesa_format first. This is expensive because it requires to loop through all existing mesa formats until we find the right match. We can resolve the base format of an array format directly by looking at its swizzle inf

[Mesa-dev] [PATCH v3 16/24] mesa: Add _mesa_pack_uint_rgba_row() format conversion function

2014-12-09 Thread Iago Toral Quiroga
From: Samuel Iglesias Gonsalvez We will use this later on to handle uint conversion scenarios in a master convert function. v2: - Modify pack_uint_*() function generation to use c.datatype() and f.datatype(). - Remove UINT_TO_FLOAT() macro usage from pack_uint*() - Remove "if not f.is_normaliz

[Mesa-dev] [PATCH v3 03/28] mesa: Add a rebase_swizzle parameter to _mesa_format_convert

2014-12-09 Thread Iago Toral Quiroga
The new parameter allows callers to provide a rebase swizzle that the function needs to use to match the requirements of the base internal format involved. This is necessary when the source or destination internal formats (depending on whether we are doing the conversion for a pixel download or a p

[Mesa-dev] [PATCH v3 10/28] mesa: Add helpers to extract GL_COLOR_INDEX to RGBA float/ubyte

2014-12-09 Thread Iago Toral Quiroga
We only use _mesa_make_temp_ubyte_image in texstore.c to convert GL_COLOR_INDEX to RGBA, but this helper does more stuff than this. All uses of this helper can be replaced with calls to _mesa_format_convert except for this GL_COLOR_INDEX conversion. This patch extracts the GL_COLOR_INDEX to RGBA l

[Mesa-dev] [PATCH v3 07/28] mesa/pack: use _mesa_format_from_format_and_type in _mesa_pack_rgba_span_from_*

2014-12-09 Thread Iago Toral Quiroga
From: Samuel Iglesias Gonsalvez We had previously added the needed mesa formats, so we can simplify the code further. Signed-off-by: Samuel Iglesias Gonsalvez --- src/mesa/main/pack.c | 282 +-- 1 file changed, 26 insertions(+), 256 deletions(-)

[Mesa-dev] [PATCH v3 26/28] mesa: Remove _mesa_pack_int_rgba_row() and auxiliary functions

2014-12-09 Thread Iago Toral Quiroga
From: Samuel Iglesias Gonsalvez These are no longer used. Signed-off-by: Samuel Iglesias Gonsalvez --- src/mesa/main/format_pack.h | 4 -- src/mesa/main/format_pack.py | 121 --- 2 files changed, 125 deletions(-) diff --git a/src/mesa/main/format_pac

[Mesa-dev] [PATCH v3 12/28] mesa: use _mesa_format_convert to implement glReadPixels.

2014-12-09 Thread Iago Toral Quiroga
--- src/mesa/main/readpix.c | 321 +++- 1 file changed, 179 insertions(+), 142 deletions(-) diff --git a/src/mesa/main/readpix.c b/src/mesa/main/readpix.c index b09cf54..1124aa7 100644 --- a/src/mesa/main/readpix.c +++ b/src/mesa/main/readpix.c @@ -39,6

[Mesa-dev] [PATCH v3 28/28] mesa: restrict use of GL_ABGR_EXT format to allowed data types

2014-12-09 Thread Iago Toral Quiroga
From: Samuel Iglesias Gonsalvez GL_UNSIGNED_SHORT_5_5_5_1, GL_UNSIGNED_SHORT_1_5_5_5_REV, GL_UNSIGNED_INT_10_10_10_2, GL_UNSIGNED_INT_2_10_10_10_REV data types are not explicitly allowed to work with GL_ABGR_EXT format neither in GL nor GL_EXT_abgr specs. Removed the corresponding mesa formats a

[Mesa-dev] [PATCH v3 22/28] mesa: Remove (signed) integer pack and span functions.

2014-12-09 Thread Iago Toral Quiroga
These are no longer used now that we moved to _mesa_format_convert. --- src/mesa/main/pack.c | 225 --- src/mesa/main/pack.h | 12 --- 2 files changed, 237 deletions(-) diff --git a/src/mesa/main/pack.c b/src/mesa/main/pack.c index db8a3e0..44bee7d

[Mesa-dev] [PATCH v3 24/28] mesa: Remove _mesa_pack_rgba_span_float and tmp_pack.h

2014-12-09 Thread Iago Toral Quiroga
_mesa_pack_rgba_span_float was the last of the color span functions and we have replaced all calls to it with calls to _mesa_format_convert, so we can remove it together with tmp_pack.h which was used to generate the pack functions for multiple types that were used from the various color span funct

[Mesa-dev] [PATCH v3 19/28] mesa: Remove _mesa_make_temp_ubyte_image

2014-12-09 Thread Iago Toral Quiroga
Now that we have _mesa_format_convert we don't need this. texstore_rgba will use the GL_COLOR_INDEX to RGBA conversion helpers instead and compressed formats that used _mesa_make_temp_ubyte_image to create an ubyte RGBA temporary image can call _mesa_texstore with a RGBA/ubyte dst to achieve the s

[Mesa-dev] [PATCH v3 05/28] mesa: Let _mesa_swizzle_and_convert take array format types instead of GL types

2014-12-09 Thread Iago Toral Quiroga
In the future we would like to have a format conversion library that is independent of GL so we can share it with Gallium. This is a step in that direction. --- src/mesa/main/format_utils.c | 262 --- src/mesa/main/format_utils.h | 8 +- 2 files changed, 1

[Mesa-dev] [PATCH v3 04/24] mesa: Fix A1R5G5B5 packing/unpacking

2014-12-09 Thread Iago Toral Quiroga
From: Jason Ekstrand As with B5G6R5, these have been left broken with comments saying they are. Signed-off-by: Jason Ekstrand Reviewed-by: Ian Romanick --- src/mesa/main/format_pack.c | 8 +--- src/mesa/main/format_unpack.c| 11 --- src/mesa/main/formats.c | 3

[Mesa-dev] [PATCH v3 00/28] Use a master format convert function

2014-12-09 Thread Iago Toral Quiroga
This is the second of two series that aim to address: https://bugs.freedesktop.org/show_bug.cgi?id=84566 This series requires the previous series that implements auto-generation of the pack/unpack functions. A branch with both series is available here: https://github.com/Igalia/mesa/tree/itoral-fo

[Mesa-dev] [PATCH v3 08/24] mesa: Fix _mesa_swizzle_and_convert integer conversions to clamp properly

2014-12-09 Thread Iago Toral Quiroga
From: Samuel Iglesias Gonsalvez Fix various conversion paths that involved integer data types of different sizes (uint16_t to uint8_t, int16_t to uint8_t, etc) that were not being clamped properly. Also, one of the paths was incorrectly assigning the value 12, instead of 1, to the constant "one"

[Mesa-dev] [PATCH v3 09/28] mesa: Add RGBA to Luminance conversion helpers

2014-12-09 Thread Iago Toral Quiroga
For glReadPixels with a Luminance destination format we compute luminance values from RGBA as L=R+G+B. This, however, requires ad-hoc implementation, since pack/unpack functions or _mesa_swizzle_and_convert won't do this (and thus, neither will _mesa_format_convert). This patch adds helpers to do t

[Mesa-dev] [PATCH v3 00/24] auto-generate pack/unpack functions

2014-12-09 Thread Iago Toral Quiroga
This is the first of two series that aim to address: https://bugs.freedesktop.org/show_bug.cgi?id=84566 A branch with this series is available here: https://github.com/Igalia/mesa/tree/itoral-autogen-packing-review-v3 Links to previous versions of the series: v2: http://lists.freedesktop.org/arch

[Mesa-dev] [PATCH v3 19/24] mesa/formats: add new mesa formats and their pack/unpack functions.

2014-12-09 Thread Iago Toral Quiroga
From: Samuel Iglesias Gonsalvez This will be used to refactor code in pack.c and support conversion to/from these types in a master convert function that will be added later. v2: - Fix autogeneration of MESA_FORMAT_A2R10G10B10_UNORM pack/unpack functions Signed-off-by: Samuel Iglesias Gonsal

[Mesa-dev] [PATCH v3 08/28] mesa: Add _mesa_swap2_copy and _mesa_swap4_copy

2014-12-09 Thread Iago Toral Quiroga
We have _mesa_swap{2,4} but these do in-place byte-swapping only. The new functions receive an extra parameter so we can swap bytes on a source input array and store the results in a (possibly different) destination array. This is useful to implement byte-swapping in pixel uploads, since in this c

[Mesa-dev] [PATCH v3 14/28] mesa: Use _mesa_format_convert to implement get_tex_rgba_compressed.

2014-12-09 Thread Iago Toral Quiroga
--- src/mesa/main/texgetimage.c | 73 + 1 file changed, 34 insertions(+), 39 deletions(-) diff --git a/src/mesa/main/texgetimage.c b/src/mesa/main/texgetimage.c index 7b11cb4..ad42782 100644 --- a/src/mesa/main/texgetimage.c +++ b/src/mesa/main/texgetim

[Mesa-dev] [PATCH v3 20/24] mesa: use format conversion functions in swrast

2014-12-09 Thread Iago Toral Quiroga
From: Samuel Iglesias Gonsalvez This commit adds a macro to facilitate the task of using format conversions functions but keeps the same API. Signed-off-by: Samuel Iglesias Gonsalvez --- src/mesa/swrast/s_texfetch_tmp.h | 1359 -- 1 file changed, 122 inserti

[Mesa-dev] [PATCH v3 06/28] mesa: Add helper to convert a GL format and type to a mesa (array) format.

2014-12-09 Thread Iago Toral Quiroga
v2 after review by Jason Ekstrand: - Move _mesa_format_from_format_and_type to glformats - Return a mesa_format for GL_UNSIGNED_INT_8_8_8_8(_REV) v3: - Adapted to the new implementation of mesa_array_format as a plain uint32_t bitfield. --- src/mesa/main/glformats.c | 278 ++

[Mesa-dev] [PATCH v3 06/24] mesa: Fix incorrect assertion in init_teximage_fields_ms

2014-12-09 Thread Iago Toral Quiroga
_BaseFormat is a GLenum (unsigned int) so testing if its value is greater than 0 to detect the cases where _mesa_base_tex_format returns -1 doesn't work. Fixing the assertion breaks the arb_texture_view-lifetime-format piglit test on nouveau, since that test calls _mesa_base_tex_format with GL_R16

[Mesa-dev] [PATCH v3 17/24] mesa: Add non-normalized formats support for ubyte packing functions

2014-12-09 Thread Iago Toral Quiroga
From: Samuel Iglesias Gonsalvez v2: - Add clamping for non-normalized integer formats in pack_ubyte*() Signed-off-by: Samuel Iglesias Gonsalvez --- src/mesa/main/format_pack.py | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/mesa/main/format_pack.py b/src/mesa/ma

[Mesa-dev] [PATCH v3 01/24] mesa/format_utils: Fix a bug in unorm_to_float helper function

2014-12-09 Thread Iago Toral Quiroga
From: Jason Ekstrand This patch fixes the return of a wrong value when x is lower than -MAX_INT(src_bits) as the result would not be between [-1.0 1.0]. v2 by Samuel Iglesias : - Modify unorm_to_float() to avoid doing the division when x == -MAX_INT(src_bits) Reviewed-by: Ian Romanick

[Mesa-dev] [PATCH v3 16/28] gallium: Use _mesa_format_convert to implement st_GetTexImage.

2014-12-09 Thread Iago Toral Quiroga
Instead of using _mesa_pack_rgba_span_float. This should allow us to remove that function in a later patch. --- src/mesa/state_tracker/st_cb_texture.c | 17 + 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tra

[Mesa-dev] [PATCH v3 13/24] configure: require python mako module

2014-12-09 Thread Iago Toral Quiroga
From: Samuel Iglesias Gonsalvez It is now a hard dependency because of the autogeneration of format pack and unpack functions. Update the documentation to reflect this change. v2: - Inline python script in m4 file and use PYTHON2 Signed-off-by: Samuel Iglesias Gonsalvez --- configure.ac

[Mesa-dev] [PATCH v3 07/24] mesa/format_utils: Prefix and expose the conversion helper functions

2014-12-09 Thread Iago Toral Quiroga
From: Jason Ekstrand Signed-off-by: Jason Ekstrand v2 by Samuel Iglesias : - Fix compilation errors Signed-off-by: Samuel Iglesias Gonsalvez Reviewed-by: Ian Romanick --- src/mesa/main/format_utils.c | 215 +++ src/mesa/main/format_utils.h | 105 +

[Mesa-dev] [PATCH v3 18/24] mesa/format_pack: Add _mesa_pack_int_rgba_row()

2014-12-09 Thread Iago Toral Quiroga
From: Samuel Iglesias Gonsalvez This will be used to unify code in pack.c. v2: - Modify pack_int_*() function generator to use c.datatype() and f.datatype() Signed-off-by: Samuel Iglesias Gonsalvez --- src/mesa/main/format_pack.h | 3 ++ src/mesa/main/format_pack.py | 121 +++

[Mesa-dev] [PATCH v3 12/24] mesa: Add a _mesa_is_format_color_format helper

2014-12-09 Thread Iago Toral Quiroga
From: Jason Ekstrand --- src/mesa/main/formats.c | 19 +++ src/mesa/main/formats.h | 3 +++ 2 files changed, 22 insertions(+) diff --git a/src/mesa/main/formats.c b/src/mesa/main/formats.c index b10b628..6eb80fb 100644 --- a/src/mesa/main/formats.c +++ b/src/mesa/main/formats.c

[Mesa-dev] [PATCH v3 02/24] mesa: Fix packing/unpacking of MESA_FORMAT_R5G6B5_UNORM

2014-12-09 Thread Iago Toral Quiroga
From: Jason Ekstrand Aparently, the packing/unpacking functions for these formats have differed from the format description in formats.h. Instead of fixing this, people simply left a comment saying it was broken. Let's actually fix it for real. Signed-off-by: Jason Ekstrand --- src/mesa/main

[Mesa-dev] [PATCH v3 04/28] mesa: Add a helper _mesa_compute_rgba2base2rgba_component_mapping

2014-12-09 Thread Iago Toral Quiroga
This will come in handy when callers of _mesa_format_convert need to compute the rebase swizzle parameter to use. --- src/mesa/main/format_utils.c | 55 src/mesa/main/format_utils.h | 3 +++ 2 files changed, 58 insertions(+) diff --git a/src/mesa/main

[Mesa-dev] [PATCH v3 01/28] mesa: Add an implementation of a master convert function.

2014-12-09 Thread Iago Toral Quiroga
From: Jason Ekstrand v2 by Iago Toral : - When testing if we can directly pack we should use the src format to check if we are packing from an RGBA format. The original code used the dst format for the ubyte case by mistake. - Fixed incorrect number of bits for dst, it was computed using the

[Mesa-dev] [PATCH v3 13/28] mesa: use _mesa_format_convert to implement get_tex_rgba_uncompressed.

2014-12-09 Thread Iago Toral Quiroga
--- src/mesa/main/texgetimage.c | 250 +++- 1 file changed, 133 insertions(+), 117 deletions(-) diff --git a/src/mesa/main/texgetimage.c b/src/mesa/main/texgetimage.c index cb5f793..7b11cb4 100644 --- a/src/mesa/main/texgetimage.c +++ b/src/mesa/main/texget

[Mesa-dev] [PATCH v3 17/28] mesa: Replace _mesa_unpack_bitmap with _mesa_unpack_image()

2014-12-09 Thread Iago Toral Quiroga
From: Eduardo Lima Mitev _mesa_unpack_bitmap() was introduced by commit 02b801c to handle the case when data is stored in PBO by display lists, in the context of this bug: Incorrect pixels read back if draw bitmap texture through Display list https://bugs.freedesktop.org/show_bug.cgi?id=10370 S

[Mesa-dev] [PATCH v3 23/28] mesa: Remove _mesa_unpack_color_span_float

2014-12-09 Thread Iago Toral Quiroga
And various helper functions that went unused after removing it. --- src/mesa/main/pack.c | 1033 -- src/mesa/main/pack.h |9 - 2 files changed, 1042 deletions(-) diff --git a/src/mesa/main/pack.c b/src/mesa/main/pack.c index 44bee7d..8640973 10

[Mesa-dev] [PATCH v3 21/24] mesa/pack: use autogenerated format_pack functions

2014-12-09 Thread Iago Toral Quiroga
From: Samuel Iglesias Gonsalvez Take advantage of new mesa formats and new format_pack functions to reduce source code in _mesa_pack_rgba_span_from_ints() and _mesa_pack_rgba_span_from_uints(). Signed-off-by: Samuel Iglesias Gonsalvez --- src/mesa/main/pack.c | 663 +++-

[Mesa-dev] [PATCH v3 03/24] mesa/colormac: Remove an unused macro

2014-12-09 Thread Iago Toral Quiroga
From: Jason Ekstrand The PACK_565_REV macro is no longer used. It was also extremely confusing because it's actually a byteswapped 565 not reversed 565. Signed-off-by: Jason Ekstrand Reviewed-by: Ian Romanick --- src/mesa/main/colormac.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/

  1   2   >