[Mesa-dev] RFC: Increase gallium PIPE_MAX_SHADER_INPUTS/OUTPUTS
PIPE_MAX_SHADER_INPUTS/OUTPUTS are currently set to 16 in p_state.h That's actually not enough to accomodate OpenGL's needs. For example, a Mesa vertex shader has these inputs: typedef enum { VERT_ATTRIB_POS = 0, VERT_ATTRIB_WEIGHT = 1, VERT_ATTRIB_NORMAL = 2, VERT_ATTRIB_COLOR0 = 3, VERT_ATTRIB_COLOR1 = 4, VERT_ATTRIB_FOG = 5, VERT_ATTRIB_COLOR_INDEX = 6, VERT_ATTRIB_POINT_SIZE = 6, /*alias*/ VERT_ATTRIB_EDGEFLAG = 7, VERT_ATTRIB_TEX0 = 8, VERT_ATTRIB_TEX1 = 9, VERT_ATTRIB_TEX2 = 10, VERT_ATTRIB_TEX3 = 11, VERT_ATTRIB_TEX4 = 12, VERT_ATTRIB_TEX5 = 13, VERT_ATTRIB_TEX6 = 14, VERT_ATTRIB_TEX7 = 15, VERT_ATTRIB_GENERIC0 = 16, VERT_ATTRIB_GENERIC1 = 17, VERT_ATTRIB_GENERIC2 = 18, VERT_ATTRIB_GENERIC3 = 19, VERT_ATTRIB_GENERIC4 = 20, VERT_ATTRIB_GENERIC5 = 21, VERT_ATTRIB_GENERIC6 = 22, VERT_ATTRIB_GENERIC7 = 23, VERT_ATTRIB_GENERIC8 = 24, VERT_ATTRIB_GENERIC9 = 25, VERT_ATTRIB_GENERIC10 = 26, VERT_ATTRIB_GENERIC11 = 27, VERT_ATTRIB_GENERIC12 = 28, VERT_ATTRIB_GENERIC13 = 29, VERT_ATTRIB_GENERIC14 = 30, VERT_ATTRIB_GENERIC15 = 31, VERT_ATTRIB_MAX = 32 } gl_vert_attrib; With PIPE_MAX_SHADER_INPUTS=16 there's potentially little or no space left for any user-defined inputs if most of the conventional attributes are used. I propose bumping these limits to 32 each. Any concerns? -Brian ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] RFC: Increase gallium PIPE_MAX_SHADER_INPUTS/OUTPUTS
On Thu, 2010-07-08 at 08:36 -0700, Brian Paul wrote: > PIPE_MAX_SHADER_INPUTS/OUTPUTS are currently set to 16 in p_state.h > > That's actually not enough to accomodate OpenGL's needs. For example, > a Mesa vertex shader has these inputs: > > typedef enum > { > VERT_ATTRIB_POS = 0, > VERT_ATTRIB_WEIGHT = 1, > VERT_ATTRIB_NORMAL = 2, > VERT_ATTRIB_COLOR0 = 3, > VERT_ATTRIB_COLOR1 = 4, > VERT_ATTRIB_FOG = 5, > VERT_ATTRIB_COLOR_INDEX = 6, > VERT_ATTRIB_POINT_SIZE = 6, /*alias*/ > VERT_ATTRIB_EDGEFLAG = 7, > VERT_ATTRIB_TEX0 = 8, > VERT_ATTRIB_TEX1 = 9, > VERT_ATTRIB_TEX2 = 10, > VERT_ATTRIB_TEX3 = 11, > VERT_ATTRIB_TEX4 = 12, > VERT_ATTRIB_TEX5 = 13, > VERT_ATTRIB_TEX6 = 14, > VERT_ATTRIB_TEX7 = 15, > VERT_ATTRIB_GENERIC0 = 16, > VERT_ATTRIB_GENERIC1 = 17, > VERT_ATTRIB_GENERIC2 = 18, > VERT_ATTRIB_GENERIC3 = 19, > VERT_ATTRIB_GENERIC4 = 20, > VERT_ATTRIB_GENERIC5 = 21, > VERT_ATTRIB_GENERIC6 = 22, > VERT_ATTRIB_GENERIC7 = 23, > VERT_ATTRIB_GENERIC8 = 24, > VERT_ATTRIB_GENERIC9 = 25, > VERT_ATTRIB_GENERIC10 = 26, > VERT_ATTRIB_GENERIC11 = 27, > VERT_ATTRIB_GENERIC12 = 28, > VERT_ATTRIB_GENERIC13 = 29, > VERT_ATTRIB_GENERIC14 = 30, > VERT_ATTRIB_GENERIC15 = 31, > VERT_ATTRIB_MAX = 32 > } gl_vert_attrib; > > With PIPE_MAX_SHADER_INPUTS=16 there's potentially little or no space > left for any user-defined inputs if most of the conventional > attributes are used. > > I propose bumping these limits to 32 each. Any concerns? Sounds good. There's also the confusingly almost related value "PIPE_MAX_ATTRIBS" which is already 32. Keith ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] RFC: Increase gallium PIPE_MAX_SHADER_INPUTS/OUTPUTS
On Thursday 08 July 2010 11:40:56 Keith Whitwell wrote: > On Thu, 2010-07-08 at 08:36 -0700, Brian Paul wrote: > > PIPE_MAX_SHADER_INPUTS/OUTPUTS are currently set to 16 in p_state.h > > > > That's actually not enough to accomodate OpenGL's needs. For example, > > a Mesa vertex shader has these inputs: > > > > typedef enum > > { > > > > VERT_ATTRIB_POS = 0, > > VERT_ATTRIB_WEIGHT = 1, > > VERT_ATTRIB_NORMAL = 2, > > VERT_ATTRIB_COLOR0 = 3, > > VERT_ATTRIB_COLOR1 = 4, > > VERT_ATTRIB_FOG = 5, > > VERT_ATTRIB_COLOR_INDEX = 6, > > VERT_ATTRIB_POINT_SIZE = 6, /*alias*/ > > VERT_ATTRIB_EDGEFLAG = 7, > > VERT_ATTRIB_TEX0 = 8, > > VERT_ATTRIB_TEX1 = 9, > > VERT_ATTRIB_TEX2 = 10, > > VERT_ATTRIB_TEX3 = 11, > > VERT_ATTRIB_TEX4 = 12, > > VERT_ATTRIB_TEX5 = 13, > > VERT_ATTRIB_TEX6 = 14, > > VERT_ATTRIB_TEX7 = 15, > > VERT_ATTRIB_GENERIC0 = 16, > > VERT_ATTRIB_GENERIC1 = 17, > > VERT_ATTRIB_GENERIC2 = 18, > > VERT_ATTRIB_GENERIC3 = 19, > > VERT_ATTRIB_GENERIC4 = 20, > > VERT_ATTRIB_GENERIC5 = 21, > > VERT_ATTRIB_GENERIC6 = 22, > > VERT_ATTRIB_GENERIC7 = 23, > > VERT_ATTRIB_GENERIC8 = 24, > > VERT_ATTRIB_GENERIC9 = 25, > > VERT_ATTRIB_GENERIC10 = 26, > > VERT_ATTRIB_GENERIC11 = 27, > > VERT_ATTRIB_GENERIC12 = 28, > > VERT_ATTRIB_GENERIC13 = 29, > > VERT_ATTRIB_GENERIC14 = 30, > > VERT_ATTRIB_GENERIC15 = 31, > > VERT_ATTRIB_MAX = 32 > > > > } gl_vert_attrib; > > > > With PIPE_MAX_SHADER_INPUTS=16 there's potentially little or no space > > left for any user-defined inputs if most of the conventional > > attributes are used. > > > > I propose bumping these limits to 32 each. Any concerns? > > Sounds good. There's also the confusingly almost related value > "PIPE_MAX_ATTRIBS" which is already 32. I think the first actually responds to GL_MAX_VARYING_FLOATS * 4, the other to GL_MAX_VERTEX_ATTRIBS. They're both actually safe minimums, GL says that the first one needs to be at least 8, the other needs to be at least 16. So our values just double the minimum. We probably should have hardware queries for both. Also increasing PIPE_MAX_SHADER_INPUTS to 32 sounds good. z ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [Bug 10966] workaround to avoid the assert main/renderbuffer.c:2041: _mesa_add_renderbuffer:...
https://bugs.freedesktop.org/show_bug.cgi?id=10966 Andrey Melentyev changed: What|Removed |Added CC|r...@yandex.ru | -- Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] RFC: Increase gallium PIPE_MAX_SHADER_INPUTS/OUTPUTS
On Thu, Jul 8, 2010 at 8:50 AM, Zack Rusin wrote: > On Thursday 08 July 2010 11:40:56 Keith Whitwell wrote: >> On Thu, 2010-07-08 at 08:36 -0700, Brian Paul wrote: >> > PIPE_MAX_SHADER_INPUTS/OUTPUTS are currently set to 16 in p_state.h >> > >> > That's actually not enough to accomodate OpenGL's needs. For example, >> > a Mesa vertex shader has these inputs: >> > >> > typedef enum >> > { >> > >> > VERT_ATTRIB_POS = 0, >> > VERT_ATTRIB_WEIGHT = 1, >> > VERT_ATTRIB_NORMAL = 2, >> > VERT_ATTRIB_COLOR0 = 3, >> > VERT_ATTRIB_COLOR1 = 4, >> > VERT_ATTRIB_FOG = 5, >> > VERT_ATTRIB_COLOR_INDEX = 6, >> > VERT_ATTRIB_POINT_SIZE = 6, /*alias*/ >> > VERT_ATTRIB_EDGEFLAG = 7, >> > VERT_ATTRIB_TEX0 = 8, >> > VERT_ATTRIB_TEX1 = 9, >> > VERT_ATTRIB_TEX2 = 10, >> > VERT_ATTRIB_TEX3 = 11, >> > VERT_ATTRIB_TEX4 = 12, >> > VERT_ATTRIB_TEX5 = 13, >> > VERT_ATTRIB_TEX6 = 14, >> > VERT_ATTRIB_TEX7 = 15, >> > VERT_ATTRIB_GENERIC0 = 16, >> > VERT_ATTRIB_GENERIC1 = 17, >> > VERT_ATTRIB_GENERIC2 = 18, >> > VERT_ATTRIB_GENERIC3 = 19, >> > VERT_ATTRIB_GENERIC4 = 20, >> > VERT_ATTRIB_GENERIC5 = 21, >> > VERT_ATTRIB_GENERIC6 = 22, >> > VERT_ATTRIB_GENERIC7 = 23, >> > VERT_ATTRIB_GENERIC8 = 24, >> > VERT_ATTRIB_GENERIC9 = 25, >> > VERT_ATTRIB_GENERIC10 = 26, >> > VERT_ATTRIB_GENERIC11 = 27, >> > VERT_ATTRIB_GENERIC12 = 28, >> > VERT_ATTRIB_GENERIC13 = 29, >> > VERT_ATTRIB_GENERIC14 = 30, >> > VERT_ATTRIB_GENERIC15 = 31, >> > VERT_ATTRIB_MAX = 32 >> > >> > } gl_vert_attrib; >> > >> > With PIPE_MAX_SHADER_INPUTS=16 there's potentially little or no space >> > left for any user-defined inputs if most of the conventional >> > attributes are used. >> > >> > I propose bumping these limits to 32 each. Any concerns? >> >> Sounds good. There's also the confusingly almost related value >> "PIPE_MAX_ATTRIBS" which is already 32. > > I think the first actually responds to GL_MAX_VARYING_FLOATS * 4, the other to > GL_MAX_VERTEX_ATTRIBS. They're both actually safe minimums, GL says that the > first one needs to be at least 8, the other needs to be at least 16. So our > values just double the minimum. We probably should have hardware queries for > both. Also increasing PIPE_MAX_SHADER_INPUTS to 32 sounds good. Sounds fine. We probably do need caps. ~ C. -- When the facts change, I change my mind. What do you do, sir? ~ Keynes Corbin Simpson ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] r300 compiler scheduler fixes
This patch and also http://lists.freedesktop.org/archives/mesa-dev/2010-July/001252.html should fix all the outstanding scheduler bugs. This patch adds a register rename pass that converts the code into quasi-SSA form, which makes it easier for the scheduler to schedule TEX blocks. This fixes: https://bugs.freedesktop.org/show_bug.cgi?id=28606 If there are no major objections to these, I'll push them to master. -Tom ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH] r300/compiler: Add a register rename pass.
This pass renames register in order to make it easier for the pair scheduler to group TEX instructions together. --- src/mesa/drivers/dri/r300/compiler/Makefile|1 + src/mesa/drivers/dri/r300/compiler/SConscript |1 + src/mesa/drivers/dri/r300/compiler/r3xx_fragprog.c | 11 ++ .../drivers/dri/r300/compiler/radeon_rename_regs.c | 131 .../drivers/dri/r300/compiler/radeon_rename_regs.h |9 ++ 5 files changed, 153 insertions(+), 0 deletions(-) create mode 100644 src/mesa/drivers/dri/r300/compiler/radeon_rename_regs.c create mode 100644 src/mesa/drivers/dri/r300/compiler/radeon_rename_regs.h diff --git a/src/mesa/drivers/dri/r300/compiler/Makefile b/src/mesa/drivers/dri/r300/compiler/Makefile index ff3801d..3167d49 100644 --- a/src/mesa/drivers/dri/r300/compiler/Makefile +++ b/src/mesa/drivers/dri/r300/compiler/Makefile @@ -23,6 +23,7 @@ C_SOURCES = \ radeon_dataflow_deadcode.c \ radeon_dataflow_swizzles.c \ radeon_optimize.c \ + radeon_rename_regs.c \ r3xx_fragprog.c \ r300_fragprog.c \ r300_fragprog_swizzle.c \ diff --git a/src/mesa/drivers/dri/r300/compiler/SConscript b/src/mesa/drivers/dri/r300/compiler/SConscript index 50d9cdb..c6f47a6 100755 --- a/src/mesa/drivers/dri/r300/compiler/SConscript +++ b/src/mesa/drivers/dri/r300/compiler/SConscript @@ -22,6 +22,7 @@ r300compiler = env.ConvenienceLibrary( 'radeon_pair_schedule.c', 'radeon_pair_regalloc.c', 'radeon_optimize.c', +'radeon_rename_regs.c', 'radeon_emulate_branches.c', 'radeon_emulate_loops.c', 'radeon_dataflow.c', diff --git a/src/mesa/drivers/dri/r300/compiler/r3xx_fragprog.c b/src/mesa/drivers/dri/r300/compiler/r3xx_fragprog.c index b53571a..4dfa2b1 100644 --- a/src/mesa/drivers/dri/r300/compiler/r3xx_fragprog.c +++ b/src/mesa/drivers/dri/r300/compiler/r3xx_fragprog.c @@ -29,6 +29,7 @@ #include "radeon_emulate_loops.h" #include "radeon_program_alu.h" #include "radeon_program_tex.h" +#include "radeon_rename_regs.h" #include "r300_fragprog.h" #include "r300_fragprog_swizzle.h" #include "r500_fragprog.h" @@ -175,6 +176,16 @@ void r3xx_compile_fragment_program(struct r300_fragment_program_compiler* c) debug_program_log(c, "after dataflow passes"); + if(!c->Base.is_r500){ + /* This pass makes it easier for the scheduler to group TEX +* instructions and reduces the chances of creating too +* many texture indirections.*/ + rc_rename_regs(&c->Base); + if (c->Base.Error) + return; + debug_program_log(c, "after register rename"); + } + rc_pair_translate(c); if (c->Base.Error) return; diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_rename_regs.c b/src/mesa/drivers/dri/r300/compiler/radeon_rename_regs.c new file mode 100644 index 000..c4e8336 --- /dev/null +++ b/src/mesa/drivers/dri/r300/compiler/radeon_rename_regs.c @@ -0,0 +1,131 @@ +/* + * Copyright 2010 Tom Stellard + * + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial + * portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE + * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + */ + +/** + * \file + */ + +#include "radeon_rename_regs.h" + +#include "radeon_compiler.h" +#include "radeon_dataflow.h" + +struct reg_rename { + int old_index; + int new_index; + int temp_index; +}; + +static void rename_reg(void * data, struct rc_instruction * inst, + rc_register_file * file, unsigned int * index) +{ + struct reg_rename *r = data; + + if(r->old_index == *index && *file == RC_FILE_TEMPORARY){ + *index = r->new_index; + } + else if(r->new_index == *index && *file == RC_FILE_TEMPORARY){ + *index = r->temp_index; + } +}
Re: [Mesa-dev] [PATCH] r300/compiler: Add a register rename pass.
On Thu, Jul 8, 2010 at 7:01 PM, Tom Stellard wrote: > This pass renames register in order to make it easier for the pair > scheduler to group TEX instructions together. > --- > src/mesa/drivers/dri/r300/compiler/Makefile | 1 + > src/mesa/drivers/dri/r300/compiler/SConscript | 1 + > src/mesa/drivers/dri/r300/compiler/r3xx_fragprog.c | 11 ++ > .../drivers/dri/r300/compiler/radeon_rename_regs.c | 131 > > .../drivers/dri/r300/compiler/radeon_rename_regs.h | 9 ++ > 5 files changed, 153 insertions(+), 0 deletions(-) > create mode 100644 src/mesa/drivers/dri/r300/compiler/radeon_rename_regs.c > create mode 100644 src/mesa/drivers/dri/r300/compiler/radeon_rename_regs.h > > diff --git a/src/mesa/drivers/dri/r300/compiler/Makefile > b/src/mesa/drivers/dri/r300/compiler/Makefile > index ff3801d..3167d49 100644 > --- a/src/mesa/drivers/dri/r300/compiler/Makefile > +++ b/src/mesa/drivers/dri/r300/compiler/Makefile > @@ -23,6 +23,7 @@ C_SOURCES = \ > radeon_dataflow_deadcode.c \ > radeon_dataflow_swizzles.c \ > radeon_optimize.c \ > + radeon_rename_regs.c \ > r3xx_fragprog.c \ > r300_fragprog.c \ > r300_fragprog_swizzle.c \ > diff --git a/src/mesa/drivers/dri/r300/compiler/SConscript > b/src/mesa/drivers/dri/r300/compiler/SConscript > index 50d9cdb..c6f47a6 100755 > --- a/src/mesa/drivers/dri/r300/compiler/SConscript > +++ b/src/mesa/drivers/dri/r300/compiler/SConscript > @@ -22,6 +22,7 @@ r300compiler = env.ConvenienceLibrary( > 'radeon_pair_schedule.c', > 'radeon_pair_regalloc.c', > 'radeon_optimize.c', > + 'radeon_rename_regs.c', > 'radeon_emulate_branches.c', > 'radeon_emulate_loops.c', > 'radeon_dataflow.c', > diff --git a/src/mesa/drivers/dri/r300/compiler/r3xx_fragprog.c > b/src/mesa/drivers/dri/r300/compiler/r3xx_fragprog.c > index b53571a..4dfa2b1 100644 > --- a/src/mesa/drivers/dri/r300/compiler/r3xx_fragprog.c > +++ b/src/mesa/drivers/dri/r300/compiler/r3xx_fragprog.c > @@ -29,6 +29,7 @@ > #include "radeon_emulate_loops.h" > #include "radeon_program_alu.h" > #include "radeon_program_tex.h" > +#include "radeon_rename_regs.h" > #include "r300_fragprog.h" > #include "r300_fragprog_swizzle.h" > #include "r500_fragprog.h" > @@ -175,6 +176,16 @@ void r3xx_compile_fragment_program(struct > r300_fragment_program_compiler* c) > > debug_program_log(c, "after dataflow passes"); > > + if(!c->Base.is_r500){ > + /* This pass makes it easier for the scheduler to group TEX > + * instructions and reduces the chances of creating too > + * many texture indirections.*/ > + rc_rename_regs(&c->Base); > + if (c->Base.Error) > + return; > + debug_program_log(c, "after register rename"); > + } > + > rc_pair_translate(c); > if (c->Base.Error) > return; > diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_rename_regs.c > b/src/mesa/drivers/dri/r300/compiler/radeon_rename_regs.c > new file mode 100644 > index 000..c4e8336 > --- /dev/null > +++ b/src/mesa/drivers/dri/r300/compiler/radeon_rename_regs.c > @@ -0,0 +1,131 @@ > +/* > + * Copyright 2010 Tom Stellard > + * > + * All Rights Reserved. > + * > + * Permission is hereby granted, free of charge, to any person obtaining > + * a copy of this software and associated documentation files (the > + * "Software"), to deal in the Software without restriction, including > + * without limitation the rights to use, copy, modify, merge, publish, > + * distribute, sublicense, and/or sell copies of the Software, and to > + * permit persons to whom the Software is furnished to do so, subject to > + * the following conditions: > + * > + * The above copyright notice and this permission notice (including the > + * next paragraph) shall be included in all copies or substantial > + * portions of the Software. > + * > + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, > + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF > + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. > + * IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE > + * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION > + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION > + * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. > + * > + */ > + > +/** > + * \file > + */ > + > +#include "radeon_rename_regs.h" > + > +#include "radeon_compiler.h" > +#include "radeon_dataflow.h" > + > +struct reg_rename { > + int old_index; > + int new_index; > + int temp_index; > +}; > + > +static void rename_reg(void * data, struct rc_instruction * inst, > + rc_register_file * file, unsigned int * index) > +{