Re: [Mesa-dev] [PATCH 5/5] glsl: Clarify ir_function::matching_sigature()

2011-08-01 Thread Chris Bandy
On 07/29/2011 08:59 PM, Chad Versace wrote: > The function used a variable named 'score', which was an outright lie. > A signature matches or it doesn't; there is no fuzzy scoring. > > Change the return type of parameter_lists_match() to an enum, and > let ir_function::matching_sigature() switch on

[Mesa-dev] [Bug 3165] texImage.IsCompressed and texImage.CompressedSize issues

2011-08-01 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=3165 --- Comment #8 from Ian Romanick 2011-08-01 09:18:59 PDT --- If I'm not mistaken, most of the issues from this bug have been fixed for some time. The one remaining issue was returning the wrong format for GL_TEXTURE_INTERNAL_FORMAT queries. Tha

Re: [Mesa-dev] [PATCH 5/5] glsl: Clarify ir_function::matching_sigature()

2011-08-01 Thread Chad Versace
On 08/01/2011 08:05 AM, Chris Bandy wrote: > On 07/29/2011 08:59 PM, Chad Versace wrote: >> The function used a variable named 'score', which was an outright lie. >> A signature matches or it doesn't; there is no fuzzy scoring. >> >> Change the return type of parameter_lists_match() to an enum, and

[Mesa-dev] [PATCH 1/7] linker: Make linker_error_printf set LinkStatus to false

2011-08-01 Thread Ian Romanick
From: Ian Romanick Remove the other places that set LinkStatus to false since they all immediately follow a call to linker_error_printf. --- src/glsl/linker.cpp |8 ++-- 1 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/glsl/linker.cpp b/src/glsl/linker.cpp index fe570b6

[Mesa-dev] [PATCH 2/7] linker: Make linker_{error, warning}_printf generally available

2011-08-01 Thread Ian Romanick
From: Ian Romanick linker_warning_printf is a new function. It's identical to linker_error_printf except that it doesn't set LinkStatus=false and it prepends "warning: " on messages instead of "error: ". --- src/glsl/ir_function_detect_recursion.cpp |1 + src/glsl/linker.cpp

[Mesa-dev] [PATCH 3/7] mesa: Ensure that gl_shader_program::InfoLog is never NULL

2011-08-01 Thread Ian Romanick
From: Ian Romanick This prevents assertion failures in ralloc_strcat. The ralloc_free in _mesa_free_shader_program_data can be omitted because freeing the gl_shader_program in _mesa_delete_shader_program will take care of this automatically. A bunch of this code could use a refactor to use rall

[Mesa-dev] [PATCH 4/7] ir_to_mesa: Use Add linker_error_printf instead of fail_link

2011-08-01 Thread Ian Romanick
From: Ian Romanick The functions were almost identical. --- src/mesa/program/ir_to_mesa.cpp | 56 +- 1 files changed, 25 insertions(+), 31 deletions(-) diff --git a/src/mesa/program/ir_to_mesa.cpp b/src/mesa/program/ir_to_mesa.cpp index 8b4a535..3c553a5 100

[Mesa-dev] [PATCH 5/7] ir_to_mesa: Emit warnings instead of errors for IR that can't be lowered

2011-08-01 Thread Ian Romanick
From: Ian Romanick Rely on the driver to do the right thing. This probably means falling back to software. Page 88 of the OpenGL 2.1 spec specifically says: "A shader should not fail to compile, and a program object should not fail to link due to lack of instruction space or lack of

[Mesa-dev] [PATCH 6/7] i915: Fail without crashing if a Mesa IR program uses too many registers

2011-08-01 Thread Ian Romanick
From: Ian Romanick So far this can only happen in GLSL shaders that contain flow-control that could not be lowered. These programs would have failed to run on hardware anyway. --- src/mesa/drivers/dri/i915/i915_fragprog.c | 15 +-- 1 files changed, 13 insertions(+), 2 deletions(-)

[Mesa-dev] [PATCH 7/7] i915: Only emit program errors when INTEL_DEBUG=wm

2011-08-01 Thread Ian Romanick
From: Ian Romanick This makes piglit a lot more happy. --- src/mesa/drivers/dri/i915/i915_program.c | 14 -- 1 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/mesa/drivers/dri/i915/i915_program.c b/src/mesa/drivers/dri/i915/i915_program.c index ca1949b..304ceec 10

Re: [Mesa-dev] [Mesa3d-dev] patches for various problems when playing with egl

2011-08-01 Thread Ian Romanick
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 08/01/2011 10:40 AM, Ian Romanick wrote: > On 07/31/2011 02:51 PM, kristof.ralov...@gmail.com wrote: >> Please apply! > > Send patches using git-send-email. People cannot reply with review > comments to patches sent as attachments. And don't use

Re: [Mesa-dev] [PATCH 7/7] i915: Only emit program errors when INTEL_DEBUG=wm

2011-08-01 Thread Eric Anholt
On Mon, 1 Aug 2011 10:20:23 -0700, "Ian Romanick" wrote: > From: Ian Romanick > > This makes piglit a lot more happy. I'd include DEBUG_FALLBACK, too. That's what's about to happen when someone uses the program, and when people are hitting swrast we tell them to look at INTEL_DEBUG=fall. pg

Re: [Mesa-dev] [PATCH 6/6] ir_to_mesa: Try to avoid emitting a MOV_SAT to saturate an expression tree.

2011-08-01 Thread Ian Romanick
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 07/29/2011 12:48 PM, Eric Anholt wrote: > Fixes a regression in codegen quality for ff_fragment_shader > conversion to GLSL -- glean texCombine produces 7.5% fewer Mesa IR > instructions. > --- > src/mesa/program/ir_to_mesa.cpp | 28 +

[Mesa-dev] S2TC - yet another attempt to solve the "S3TC issue"

2011-08-01 Thread Rudolf Polzer
Hi, I developed, together with Maik Merten, a replacement for S3TC with the following properties: - does not use any "interesting" algorithms (no color ramps, each 4x4 block is just a 2 colors palette - basically, this is Color Cell Compression from August 1986) - is perfectly decodable by an

[Mesa-dev] Status of the GLSL->TGSI translator, part 2

2011-08-01 Thread Bryan Cain
Since Mesa 7.11 is released now, I figure it's time to discuss merging the glsl-to-tgsi branch to master again. The translator is more mature than last time. There are no regressions that I know of on any driver. The code generation has improved so that it's the same as or better than ir_to_mesa

Re: [Mesa-dev] [PATCH 6/7] i915: Fail without crashing if a Mesa IR program uses too many registers

2011-08-01 Thread Eric Anholt
On Mon, 1 Aug 2011 10:20:22 -0700, "Ian Romanick" wrote: > From: Ian Romanick > > So far this can only happen in GLSL shaders that contain flow-control > that could not be lowered. These programs would have failed to run on > hardware anyway. This looks reasonable, but I don't understand why

Re: [Mesa-dev] [PATCH] i965/gen5+: Fix incorrect miptree layout for non-power-of-two cubemaps.

2011-08-01 Thread Kenneth Graunke
On 07/31/2011 07:25 PM, Eric Anholt wrote: > On Sat, 30 Jul 2011 21:35:52 -0700, Kenneth Graunke > wrote: >> For power-of-two sizes, h0 == mt->height0 since it's already a multiple >> of two. However, for NPOT, they're different; h1 should be computed >> based on the original size. >> >> Fixes p

Re: [Mesa-dev] [PATCH] i965/gen5+: Fix incorrect miptree layout for non-power-of-two cubemaps.

2011-08-01 Thread Eric Anholt
On Mon, 01 Aug 2011 13:15:45 -0700, Kenneth Graunke wrote: > On 07/31/2011 07:25 PM, Eric Anholt wrote: > > On Sat, 30 Jul 2011 21:35:52 -0700, Kenneth Graunke > > wrote: > >> For power-of-two sizes, h0 == mt->height0 since it's already a multiple > >> of two. However, for NPOT, they're differ

[Mesa-dev] [PATCH 1/4] Revert "glsl: Skip processing the first function's body in do_dead_functions()."

2011-08-01 Thread Paul Berry
opt_dead_functions contained a shortcut to skip processing the first function's body, based on the assumption that IR functions are topologically sorted, with callees always coming before their callers (therefore the first function cannot contain any calls). This assumption turns out not to be tru

[Mesa-dev] [PATCH 2/4] glsl: Emit function signatures at toplevel, even for built-ins.

2011-08-01 Thread Paul Berry
The ast-to-hir conversion needs to emit function signatures in two circumstances: when a function declaration (or definition) is encountered, and when a built-in function is encountered. To avoid emitting a function signature in an illegal place (such as inside a function), emit_function() checked

[Mesa-dev] [PATCH 3/4] glsl: Constant-fold built-in functions before outputting IR

2011-08-01 Thread Paul Berry
Rearranged the logic for converting the ast for a function call to hir, so that we constant fold before emitting any IR. Previously we would emit some IR, and then only later detect whether we could constant fold. The unnecessary IR would usually get cleaned up by a later optimization step, howev

[Mesa-dev] [PATCH 4/4] glsl: Check array size is const before asserting that no IR was generated.

2011-08-01 Thread Paul Berry
process_array_type() contains an assertion to verify that no IR instructions are generated while processing the expression that specifies the size of the array. This assertion needs to happen _after_ checking whether the expression is constant. Otherwise we may crash on an illegal shader rather t

[Mesa-dev] [PATCH 0/5] glsl: Add switch statement support to the GLSL compiler.

2011-08-01 Thread Dan McCabe
This patch set adds support for switch statements to the GLSL compiler. We modify the grammar for the compiler with productions for switch statements and case labels, while adding supporting supporting productions not already present. New AST classes are defined to support those productions. Howev

[Mesa-dev] [PATCH 1/5] glsl: Create AST data structures for switch statement and case label

2011-08-01 Thread Dan McCabe
Data structures for switch statement and case label are created that parallel the structure of other AST data. --- src/glsl/ast.h | 24 1 files changed, 20 insertions(+), 4 deletions(-) diff --git a/src/glsl/ast.h b/src/glsl/ast.h index 878f48b..2ee0b11 100644 --- a/src

[Mesa-dev] [PATCH 2/5] glsl: Add productions to GLSL grammar for switch statement

2011-08-01 Thread Dan McCabe
The grammar is modified to support switch statements. Rather than follow the grammar in the appendix, which allows case labels to be placed ANYWHERE as a regular statement, we follow the development of the grammar as described in the body of the GLSL spec. In this variation, the switch statement h

[Mesa-dev] [PATCH 3/5] glsl: Create AST structs corresponding to new productions in grammar

2011-08-01 Thread Dan McCabe
Previously we added productions for: switch_body case_label_list case_statement case_statement_list Now add AST structs corresponding to those productions. --- src/glsl/ast.h | 59 1 files changed, 59 insert

[Mesa-dev] [PATCH 4/5] glsl: Reference data structure ctors in grammar

2011-08-01 Thread Dan McCabe
We now tie the grammar to the ctors of the ASTs they reference. This requires that we actually have definitions of the ctors. In addition, we also need to define "print" and "hir" methods for the AST classes. The Print methods are pretty simple to flesh out. However, at this stage of the developm

[Mesa-dev] [PATCH 5/5] glsl: Generate IR for switch statements

2011-08-01 Thread Dan McCabe
Up until now modifying the GLSL compiler has been pretty straightforward. This is where things get interesting. But still pretty straightforward. Switch statements can be thought of a series of if/then/else statements. Case labels are compared with the value of a test expression and the case state

Re: [Mesa-dev] [PATCH 1/4] Revert "glsl: Skip processing the first function's body in do_dead_functions()."

2011-08-01 Thread Ian Romanick
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 08/01/2011 04:07 PM, Paul Berry wrote: > opt_dead_functions contained a shortcut to skip processing the first > function's body, based on the assumption that IR functions are > topologically sorted, with callees always coming before their callers >

Re: [Mesa-dev] [PATCH 2/4] glsl: Emit function signatures at toplevel, even for built-ins.

2011-08-01 Thread Ian Romanick
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 08/01/2011 04:07 PM, Paul Berry wrote: > The ast-to-hir conversion needs to emit function signatures in two > circumstances: when a function declaration (or definition) is > encountered, and when a built-in function is encountered. > > To avoid emi

Re: [Mesa-dev] [PATCH 6/7] i915: Fail without crashing if a Mesa IR program uses too many registers

2011-08-01 Thread Ian Romanick
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 08/01/2011 11:39 AM, Eric Anholt wrote: > On Mon, 1 Aug 2011 10:20:22 -0700, "Ian Romanick" > wrote: >> From: Ian Romanick >> >> So far this can only happen in GLSL shaders that contain flow-control >> that could not be lowered. These programs

Re: [Mesa-dev] [PATCH 1/4] Revert "glsl: Skip processing the first function's body in do_dead_functions()."

2011-08-01 Thread Paul Berry
On 1 August 2011 17:35, Ian Romanick wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > On 08/01/2011 04:07 PM, Paul Berry wrote: >> opt_dead_functions contained a shortcut to skip processing the first >> function's body, based on the assumption that IR functions are >> topologically sor

Re: [Mesa-dev] Mesa (master): Fix PPC detection on darwin

2011-08-01 Thread Michel Dänzer
On Son, 2011-07-31 at 09:47 -0700, Jeremy Huddleston wrote: > Module: Mesa > Branch: master > Commit: e737a99a6fbafe3ba4b5175eea25d1598dbeb9d8 > URL: > http://cgit.freedesktop.org/mesa/mesa/commit/?id=e737a99a6fbafe3ba4b5175eea25d1598dbeb9d8 > > Author: Jeremy Huddleston > Date: Sun Jul 31

Re: [Mesa-dev] [PATCH 6/7] i915: Fail without crashing if a Mesa IR program uses too many registers

2011-08-01 Thread Kenneth Graunke
On 08/01/2011 06:18 PM, Ian Romanick wrote: > On 08/01/2011 11:39 AM, Eric Anholt wrote: >> On Mon, 1 Aug 2011 10:20:22 -0700, "Ian Romanick" >> wrote: >>> From: Ian Romanick >>> >>> So far this can only happen in GLSL shaders that contain flow-control >>> that could not be lowered. These prog

Re: [Mesa-dev] [PATCH 5/7] ir_to_mesa: Emit warnings instead of errors for IR that can't be lowered

2011-08-01 Thread Kenneth Graunke
On 08/01/2011 10:20 AM, Ian Romanick wrote: > From: Ian Romanick > > Rely on the driver to do the right thing. This probably means falling > back to software. Page 88 of the OpenGL 2.1 spec specifically says: > > "A shader should not fail to compile, and a program object should > not f

Re: [Mesa-dev] [PATCH 4/7] ir_to_mesa: Use Add linker_error_printf instead of fail_link

2011-08-01 Thread Kenneth Graunke
On 08/01/2011 10:20 AM, Ian Romanick wrote: > From: Ian Romanick > > The functions were almost identical. > --- > src/mesa/program/ir_to_mesa.cpp | 56 +- > 1 files changed, 25 insertions(+), 31 deletions(-) I might go ahead and call these linker_error and

Re: [Mesa-dev] [PATCH 7/7] i915: Only emit program errors when INTEL_DEBUG=wm

2011-08-01 Thread Kenneth Graunke
On 08/01/2011 10:50 AM, Eric Anholt wrote: > On Mon, 1 Aug 2011 10:20:23 -0700, "Ian Romanick" > wrote: >> From: Ian Romanick >> >> This makes piglit a lot more happy. > > I'd include DEBUG_FALLBACK, too. That's what's about to happen when > someone uses the program, and when people are hitti

Re: [Mesa-dev] [PATCH 1/7] linker: Make linker_error_printf set LinkStatus to false

2011-08-01 Thread Kenneth Graunke
For the series (assuming you make the change Eric suggested to 7/7): Reviewed-by: Kenneth Graunke ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev