Re: [Mesa-dev] [PATCH 3/4] i965: For color clears, only disable writes to components that exist.

2014-03-21 Thread Paul Berry
2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > Nice find! Series is: Reviewed-by: Paul Berry > > diff --git a/src/mesa/drivers/dri/i965/brw_blorp_clear.cpp > b/src/mesa/drivers/dri/i965/brw_blorp_clear.cpp > index 45b9fa0..7e19c2c 100644 > --- a/src/mesa/drivers/dri/i9

Re: [Mesa-dev] [PATCH] i965: Drop special case for edgeflag thanks to Marek's change to core.

2014-03-17 Thread Paul Berry
On 17 March 2014 14:54, Eric Anholt wrote: > --- > src/mesa/drivers/dri/i965/brw_draw_upload.c | 9 - > 1 file changed, 9 deletions(-) > For future cross-referencing it would be nice to mention the SHA of Marek's change in the commit message. > > diff --git a/src/mesa/drivers/dri/i965

Re: [Mesa-dev] [PATCH 1/6] glsl: Optimize pow(x, 2) into x * x.

2014-03-11 Thread Paul Berry
On 10 March 2014 17:23, Ian Romanick wrote: > I had a pretty similar patch on the top of my pow-optimization branch. > I also expand x**3 and x**4. I had hoped that would enable some cases > to expand then merge to MADs. It should also be faster on older GENs > where POW perf sucks. I didn't s

Re: [Mesa-dev] [RFC PATCH] i965/gs: add snb support

2014-02-24 Thread Paul Berry
On 24 February 2014 00:36, Ilia Mirkin wrote: > Before you read any further, this is nowhere close to working. However > it's in > a state where I think most of the structure is there, albeit with a lot of > XXX > comments. And I haven't actually implemented the new opcodes I've added. > > I was

Re: [Mesa-dev] [PATCH] i965: Don't try to use the hardware blitter for multisampled miptrees.

2014-02-21 Thread Paul Berry
_samples > 0 || dst_mt->num_samples > 0) > + return false; > + > You might consider moving this check up to the top of the function, since it doesn't depend on src_format or dst_format. But it's not a big deal. Either way, the patch is: Reviewed-by: Paul Berry ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Re: [Mesa-dev] [PATCH v3 8/9] i965: support gl_InvocationID for gen7

2014-02-06 Thread Paul Berry
| 16 +--- > 5 files changed, 48 insertions(+), 3 deletions(-) > Hopefully I will get a chance to look at this in more detail soon, but for now, consider this: Acked-by: Paul Berry > > diff --git a/src/mesa/drivers/dri/i965/brw_defines.h > b/src/mesa/drivers/dri/i965/br

Re: [Mesa-dev] [PATCH 30/30] i965/cs: Allow ARB_compute_shader to be enabled via env var.

2014-02-05 Thread Paul Berry
On 4 February 2014 10:03, Jordan Justen wrote: > >> > >> What about trying to make use of > >> MESA_EXTENSION_OVERRIDE=GL_ARB_compute_shader? > >> > >> We could add > >> extensions.c:bool _mesa_is_extension_override_enabled(char *) > >> > >> And then > >> if (_mesa_is_extension_override_enabl

Re: [Mesa-dev] [PATCH 02/10] glsl: serialize methods for IR instructions

2014-02-04 Thread Paul Berry
0; i < num_state_slots; i++) { > + mem.write_int32_t(state_slots[i].swizzle); > + for (unsigned j = 0; j < 5; j++) { > + mem.write_int32_t(state_slots[i].tokens[j]); > + } > + } > + > + if (constant_value) > + constant_value->serializ

Re: [Mesa-dev] [PATCH 01/10] glsl: memory_writer helper class for data serialization

2014-02-04 Thread Paul Berry
On 4 February 2014 19:52, Paul Berry wrote: > Whoops, I discovered another issue: > > > On 29 January 2014 01:24, Tapani Pälli wrote: > >> Class will be used by the shader binary cache implementation. >> >> Signed-off-by: Tapani Pälli >>

Re: [Mesa-dev] [PATCH 01/10] glsl: memory_writer helper class for data serialization

2014-02-04 Thread Paul Berry
Whoops, I discovered another issue: On 29 January 2014 01:24, Tapani Pälli wrote: > Class will be used by the shader binary cache implementation. > > Signed-off-by: Tapani Pälli > --- > src/glsl/memory_writer.h | 188 > +++ > 1 file changed, 188 ins

Re: [Mesa-dev] [PATCH 01/10] glsl: memory_writer helper class for data serialization

2014-02-04 Thread Paul Berry
it. If you would prefer to just add a comment explaining why you're serializing the null terminator, I would be ok with that too. > + } > + > + unsigned position() > + { > + return pos; > + } > + > + /** > +* check if some data was written > +*/ > + bool data_was_written(void *data, uint32_t id) > For functions that ask questions, I recommend using a word order that's unambiguously a question (e.g. "was_data_written"). "data_was_written" sounds more like a statement, so someone might misinterpret this function as a synonym for mark_data_written(). But I'm nit picking again here. With the other issues addressed, this patch is: Reviewed-by: Paul Berry ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Re: [Mesa-dev] [PATCH 30/30] i965/cs: Allow ARB_compute_shader to be enabled via env var.

2014-02-04 Thread Paul Berry
On 1 February 2014 23:21, Jordan Justen wrote: > On Thu, Jan 9, 2014 at 6:19 PM, Paul Berry > wrote: > > This will allow testing of compute shader functionality before it is > > completed. > > > > To enable ARB_compute_shader functionality in the i965 driver,

Re: [Mesa-dev] [PATCH 29/30] i965/cs: Create the brw_compute_program struct, and the code to initialize it.

2014-02-03 Thread Paul Berry
On 1 February 2014 22:37, Jordan Justen wrote: > On Thu, Jan 9, 2014 at 6:19 PM, Paul Berry > wrote: > > --- > > src/mesa/drivers/dri/i965/brw_context.h | 8 > > src/mesa/drivers/dri/i965/brw_program.c | 11 +++ > > 2 files changed, 19 insertio

Re: [Mesa-dev] [PATCH 26/30] main/cs: Implement query for COMPUTE_WORK_GROUP_SIZE.

2014-02-03 Thread Paul Berry
On 1 February 2014 22:28, Jordan Justen wrote: > On Thu, Jan 9, 2014 at 6:19 PM, Paul Berry > wrote: > > --- > > src/mesa/main/shaderapi.c | 18 ++ > > 1 file changed, 18 insertions(+) > > > > diff --git a/src/mesa/main/shaderapi.c b/src/mes

Re: [Mesa-dev] [PATCH 22/30] mesa/cs: Implement MAX_COMPUTE_WORK_GROUP_INVOCATIONS constant.

2014-02-03 Thread Paul Berry
On 1 February 2014 21:25, Jordan Justen wrote: > On Thu, Jan 9, 2014 at 6:19 PM, Paul Berry > wrote: > > --- > > src/glsl/main.cpp | 1 + > > src/glsl/standalone_scaffolding.cpp | 1 + > > src/mesa/main/context.c | 1 + > > src

Re: [Mesa-dev] [PATCH v2 7/7] i965: support instanced GS on gen7

2014-01-31 Thread Paul Berry
+* so without spilling. If the GS invocations count > 1, then we can't > use > +* dual object mode. > */ > - if (likely(!(INTEL_DEBUG & DEBUG_NO_DUAL_OBJECT_GS))) { > + if (c->prog_data.invocations <= 1 || > + likely(!(INTEL_DEBUG & DEBUG_NO_DUAL_OBJ

Re: [Mesa-dev] [PATCH v2 6/7] i965: support gl_InvocationID for gen7

2014-01-31 Thread Paul Berry
On 28 January 2014 11:22, Jordan Justen wrote: > Signed-off-by: Jordan Justen > --- > src/mesa/drivers/dri/i965/brw_defines.h | 5 + > src/mesa/drivers/dri/i965/brw_vec4_gs_visitor.cpp | 24 > --- > 2 files changed, 26 insertions(+), 3 deletions(-) > > diff --

Re: [Mesa-dev] [PATCH v2 4/7] main/shaderapi: GL_GEOMETRY_SHADER_INVOCATIONS GetProgramiv support

2014-01-31 Thread Paul Berry
+ if (check_gs_query(ctx, shProg)) > + *params = shProg->Geom.Invocations; > + return; > case GL_GEOMETRY_INPUT_TYPE: >if (!has_core_gs) > break; > -- > 1.8.5.3 > With that fixed, the patch is: Reviewed-by: Paul Berry __

Re: [Mesa-dev] [PATCH v2 2/7] glsl/linker: produce gl_shader_program Geom.Invocations

2014-01-31 Thread Paul Berry
GLint VerticesIn; >GLint VerticesOut; > + GLint Invocations; > Same comment applies here. >GLenum InputType; /**< GL_POINTS, GL_LINES, GL_LINES_ADJACENCY_ARB, >GL_TRIANGLES, or GL_TRIANGLES_ADJACENCY_ARB > */ >GLenum OutputType; /**< GL_POINTS, GL_LINE_STRIP or > GL_TRIANGLE_STRIP */ > -- > 1.8.5.3 > With those minor issues addressed, this patch is: Reviewed-by: Paul Berry ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Re: [Mesa-dev] [PATCH v2 1/7] glsl: parse invocations layout qualifier for ARB_gpu_shader5

2014-01-31 Thread Paul Berry
On 28 January 2014 11:22, Jordan Justen wrote: > _mesa_glsl_parse_state::gs_invocations will store the > invocation count. > > Signed-off-by: Jordan Justen > This looks like it will work if the shader contains a line like this: layout(triangles, invocations=6) in; But it won't handle this:

[Mesa-dev] [PATCH 1/2] glsl: Make condition_to_hir() callable from outside ast_iteration_statement.

2014-01-31 Thread Paul Berry
In addition to making it public, we also need to change its first argument from an ir_loop * to an exec_list *, so that it can be used to insert the condition anywhere in the IR (rather than just in the body of the loop). This will be necessary in order to make continue statements work properly in

[Mesa-dev] [PATCH 2/2] glsl: Fix continue statements in do-while loops.

2014-01-31 Thread Paul Berry
>From the GLSL 4.40 spec, section 6.4 (Jumps): The continue jump is used only in loops. It skips the remainder of the body of the inner most loop of which it is inside. For while and do-while loops, this jump is to the next evaluation of the loop condition-expression from which the

Re: [Mesa-dev] [PATCH RFC 00/11] glsl: add Single Static Assignment (SSA)

2014-01-31 Thread Paul Berry
gsi can't handle. > I had a detailed look at your patches and I really like where you're going with this. I sent a lot of feedback in response to patches 4, 5, 7, 9, and 10; I don't think any of my feedback would require a major change to your overall plan. Nice work! Consider pat

Re: [Mesa-dev] [PATCH RFC 10/11] glsl: add a pass to convert out of SSA form

2014-01-31 Thread Paul Berry
t; +foreach_list(sig_node, &f->signatures) { > + ir_function_signature *sig = (ir_function_signature *) > sig_node; > + > + convert_from_ssa_function(&sig->body); > +} > + } > + } > +} > It looks like the only reason you need to manually walk through the functions and signatures is so that you can make sure that ir_from_ssa_visitor::base_instrs always points to the correct function's instruction list. Normally the way we achieve that sort of thing is to do: ir_visitor_status ir_from_ssa_visitor::visit_enter(ir_function_signature *ir) { this->base_instrs = &ir->body; return visit_continue; } ir_visitor_status ir_from_ssa_visitor::visit_leave(ir_function_signature *ir) { this->base_instrs = NULL; return visit_continue; } That way you could get rid of convert_from_ssa_function() and convert_from_ssa() would just become: void convert_from_ssa(exec_list *instructions) { ir_from_ssa_visitor v; v.run(instructions); } I don't have really strong feelings about it, though. Provided that the confusing comment in eliminate_phi_if() is fixed, this patch is: Reviewed-by: Paul Berry ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Re: [Mesa-dev] [PATCH 1/2] mesa: Ensure that transform feedback refers to the correct program.

2014-01-28 Thread Paul Berry
On 28 January 2014 13:15, Carl Worth wrote: > Paul Berry writes: > > Previous to this patch, the _mesa_{Begin,Resume}TransformFeedback > > functions were using ctx->Shader.CurrentProgram[MESA_SHADER_VERTEX] > > I see that this commit was nominated for the stable branch

Re: [Mesa-dev] [PATCH RFC 07/11] glsl: add SSA infrastructure

2014-01-28 Thread Paul Berry
On 22 January 2014 09:16, Connor Abbott wrote: > diff --git a/src/glsl/ir_clone.cpp b/src/glsl/ir_clone.cpp > index cb732a5..7075579 100644 > --- a/src/glsl/ir_clone.cpp > +++ b/src/glsl/ir_clone.cpp > @@ -40,7 +40,15 @@ ir_rvalue::clone(void *mem_ctx, struct hash_table *ht) > const > ir_variabl

Re: [Mesa-dev] [PATCH RFC 07/11] glsl: add SSA infrastructure

2014-01-28 Thread Paul Berry
On 22 January 2014 09:16, Connor Abbott wrote: > This patch introduces all the changes to the IR that are necessary for > representing programs in the SSA form. This consists of a new variable > mode, the SSA temporary, which is guarenteed to be written to exactly > once, and classes to represent

Re: [Mesa-dev] [PATCH RFC 05/11] glsl: add loop jump visitor

2014-01-27 Thread Paul Berry
ead of storing the ir_loop *. But I don't feel terribly strongly about it. Either way, the patch is: Reviewed-by: Paul Berry ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Re: [Mesa-dev] [PATCH RFC 04/11] glsl: add dead branch analysis

2014-01-27 Thread Paul Berry
r_visitor_status visit(ir_loop_jump *); > + virtual ir_visitor_status visit_enter(ir_return *); > + virtual ir_visitor_status visit_enter(ir_discard *); > + > + ir_dead_branches *get_dead_branches(ir_if *ir); > + > +private: > + void visit_return(); > + > +

[Mesa-dev] [PATCH] i965: Replace *_generator::shader with is_glsl boolean.

2014-01-22 Thread Paul Berry
The "shader" field in fs_generator, vec4_generator, and gen8_generator was only used for one purpose; to figure out if we were compiling an assembly shader or a GLSL shader. And it wasn't being used properly: in vec4 shaders we were always initializing it based on prog->_LinkedShaders[MESA_SHADER_

Re: [Mesa-dev] [PATCH V3 7/8] glsl: remove remaining is_array variables

2014-01-22 Thread Paul Berry
erts didn't get compiled. If that's the case, I'd like to encourage you to do a debug build and double-check that piglit tests still pass. You can do that by adding the "--enable-debug" option when you run ./autogen.sh. With that fixed, the series is: Re

Re: [Mesa-dev] [v2 23/23] i965/blorp: switch eu-emitter to use FS IR and fs_generator

2014-01-22 Thread Paul Berry
DEX' to the > generator in fs_inst::target instead of hardcoding it > > CC: Paul Berry > Signed-off-by: Topi Pohjolainen > Thanks, Topi. The whole series is now: Reviewed-by: Paul Berry ___ mesa-dev mailing list mesa-dev@

Re: [Mesa-dev] [PATCH 1/2] mesa: Ensure that transform feedback refers to the correct program.

2014-01-22 Thread Paul Berry
On 22 January 2014 08:20, Kenneth Graunke wrote: > On 01/22/2014 06:07 AM, Paul Berry wrote: > > @@ -376,25 +376,48 @@ _mesa_compute_max_transform_feedback_vertices( > > **/ > > > > > > +/** > > + * Figure out which stage of the pipeline is the source of

[Mesa-dev] [PATCH 2/2] i965/gen7: Use to the correct program when uploading transform feedback state.

2014-01-22 Thread Paul Berry
Transform feedback may come from either the geometry shader or the vertex shader, so we can't use ctx->Shader.CurrentProgram[MESA_SHADER_VERTEX] to find the current post-link transform feedback information. Fortunately we can use ctx->TransformFeedback.CurrentObject->shader_program. --- src/mesa/

[Mesa-dev] [PATCH 1/2] mesa: Ensure that transform feedback refers to the correct program.

2014-01-22 Thread Paul Berry
Previous to this patch, the _mesa_{Begin,Resume}TransformFeedback functions were using ctx->Shader.CurrentProgram[MESA_SHADER_VERTEX] to find the program that would be the source of transform feedback data. This isn't correct--if there's a geometry shader present it should be ctx->Shader.CurrentPro

Re: [Mesa-dev] [PATCH] glsl: Add image type to the GLSL IR.

2014-01-22 Thread Paul Berry
On 22 January 2014 04:50, Francisco Jerez wrote: > Paul Berry writes: > > > On 15 January 2014 11:42, Francisco Jerez wrote: > > > >> v2: Reuse the glsl_sampler_dim enum for images. Reuse the > >> glsl_type::sampler_* fields instead of creating new o

Re: [Mesa-dev] [PATCH 13/23] i965/fs: Take into account reg_offset consistently for MRF regs.

2014-01-21 Thread Paul Berry
On 15 January 2014 14:01, Francisco Jerez wrote: > Paul Berry writes: > > > On 2 December 2013 11:31, Francisco Jerez wrote: > > > >> Until now it was only being taken into account in the VEC4 back-end > >> but not in the FS back-end. Do it in both cases.

Re: [Mesa-dev] [PATCH 10/23] i965/fs: Remove fs_reg::sechalf.

2014-01-21 Thread Paul Berry
On 21 January 2014 19:21, Paul Berry wrote: > > not realize that is is safe to call it on a register with 32 bits per > component, because they might erroneously think "oh, this function only > works on 16-component registers; that is, registers that > Oops, sorry about the

Re: [Mesa-dev] [PATCH 10/23] i965/fs: Remove fs_reg::sechalf.

2014-01-21 Thread Paul Berry
On 15 January 2014 13:53, Francisco Jerez wrote: > Paul Berry writes: > > > On 2 December 2013 11:31, Francisco Jerez wrote: > > > >> +/** > >> + * Get either of the 8-component halves of a 16-component register. > >> + */ > >> +static

Re: [Mesa-dev] [PATCH] glsl: Add image type to the GLSL IR.

2014-01-21 Thread Paul Berry
On 15 January 2014 11:42, Francisco Jerez wrote: > v2: Reuse the glsl_sampler_dim enum for images. Reuse the > glsl_type::sampler_* fields instead of creating new ones specific > to image types. Reuse the same constructor as for samplers adding > a new 'base_type' argument. > --- >

Re: [Mesa-dev] [PATCH V2 3/8] glsl: Add array specifier to ast code

2014-01-21 Thread Paul Berry
On 21 January 2014 14:54, Timothy Arceri wrote: > Hi Paul > > Thanks for the thorough review and taking the time to explain how to make > improvements. I can already see a number of improvements that can be made > to patch 5 based on the suggestions you have already made so you could hold > off r

Re: [Mesa-dev] [PATCH V2 8/8] docs: Mark ARB_arrays_of_arrays as started

2014-01-21 Thread Paul Berry
On 21 January 2014 04:19, Timothy Arceri wrote: > Signed-off-by: Timothy Arceri > --- > docs/GL3.txt | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > Reviewed-by: Paul Berry ___ mesa-dev mailing list mesa-dev@lists.freed

Re: [Mesa-dev] [PATCH V2 7/8] glsl: create type name for arrays of arrays

2014-01-21 Thread Paul Berry
them can be combined to: snprintf(n + idx, name_length - idx, "[%u]%s", length, array->name + idx); Good catch on noticing that it's necessary to reverse the order of the dimensions. With that fixed, this patch is: Reviewed-by: Paul Berry > + } else { > +

Re: [Mesa-dev] [PATCH V2 6/8] glsl: Allow arrays of arrays as input to vertex shader

2014-01-21 Thread Paul Berry
On 21 January 2014 18:23, Paul Berry wrote: > On 21 January 2014 04:19, Timothy Arceri wrote: > >> Signed-off-by: Timothy Arceri >> --- >> src/glsl/ast_to_hir.cpp | 4 >> 1 file changed, 4 insertions(+) >> >> diff --git a/src/glsl/ast_to_hir.cpp

Re: [Mesa-dev] [PATCH V2 6/8] glsl: Allow arrays of arrays as input to vertex shader

2014-01-21 Thread Paul Berry
>is_array()) check_type = check_type->element_type(); Then we can leave the switch statement alone. With that fixed, this patch is: Reviewed-by: Paul Berry ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Re: [Mesa-dev] [PATCH V2 5/8] glsl: Aggregate initializer support for arrays of array

2014-01-21 Thread Paul Berry
On 21 January 2014 04:19, Timothy Arceri wrote: > Signed-off-by: Timothy Arceri > --- > src/glsl/ast.h | 19 +++- > src/glsl/ast_function.cpp | 14 +++-- > src/glsl/ast_to_hir.cpp | 29 +- > src/glsl/glsl_parser.yy | 36

[Mesa-dev] [PATCH] glsl: Simplify aggregate type inference to prepare for ARB_arrays_of_arrays.

2014-01-21 Thread Paul Berry
Most of the time it is not necessary to perform type inference to compile GLSL; the type of every expression can be inferred from the contents of the expression itself (and previous type declarations). The exception is aggregate initializers: their type is determined by the LHS of the variable bein

Re: [Mesa-dev] [PATCH V2 4/8] glsl: only call mark_max_array if we are assigning an array

2014-01-21 Thread Paul Berry
On 21 January 2014 04:19, Timothy Arceri wrote: > Signed-off-by: Timothy Arceri > --- > src/glsl/ast_to_hir.cpp | 6 -- > 1 file changed, 4 insertions(+), 2 deletions(-) > Can you say more in the commit message about why you're making this change? Is this fixing an existing bug? Is it pr

Re: [Mesa-dev] [PATCH V2 3/8] glsl: Add array specifier to ast code

2014-01-21 Thread Paul Berry
On 21 January 2014 04:19, Timothy Arceri wrote: > Signed-off-by: Timothy Arceri > --- > src/glsl/ast.h | 44 +++ > src/glsl/ast_array_index.cpp| 13 > src/glsl/ast_to_hir.cpp | 160 > +++- > src/glsl/ast_type.cpp

Re: [Mesa-dev] [PATCH V2 2/8] glsl: Add arrays_of_arrays to yacc definition

2014-01-21 Thread Paul Berry
20" from the error message here. > + } > + > I think we need to add: $$ = $1; here. > + $$->array_dimensions.push_tail(& $3->link); > + $$->dimension_count++; > + $$->set_location(yylloc); > Assuming I'm right about adding &qu

Re: [Mesa-dev] [PATCH V2 1/8] mesa: Add ARB_arrays_of_arrays

2014-01-21 Thread Paul Berry
(in glcpp-parse.y) to call add_builtin_define(parser, "GL_ARB_arrays_of_arrays") if extensions->ARB_arrays_of_arrays is set. With that fixed, this patch is: Reviewed-by: Paul Berry Personally I would also add the extension to the _mesa_glsl_supported_extensions[] table in this

Re: [Mesa-dev] Two small blorp fixes found during refactoring

2014-01-21 Thread Paul Berry
5/test_blorp_blit_eu_gen.cpp| 30 +++--- > 2 files changed, 47 insertions(+), 31 deletions(-) > Series is: Reviewed-by: Paul Berry ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Re: [Mesa-dev] [PATCH] i965: Reserve space for "Vertex Count" in GS outputs.

2014-01-20 Thread Paul Berry
he > visitor. This patch does that - and it is indeed much nicer.) > > --Ken > Looks good, thanks! Reviewed-by: Paul Berry > > diff --git a/src/mesa/drivers/dri/i965/brw_vec4_gs.c > b/src/mesa/drivers/dri/i965/brw_vec4_gs.c > index 018b0b6..c40112b 100644 > --- a

Re: [Mesa-dev] [PATCH 42/42] i965/blorp: switch eu-emitter to use FS IR and fs_generator

2014-01-20 Thread Paul Berry
he changes are correct, and in the unlikely event that we later discover that they aren't, it'll make it easier to bisect to the problem. With this patch split, it is: Reviewed-by: Paul Berry I've sent comments on patches 24, 27, 37, 38, 39, and 41. All the others are: Rev

Re: [Mesa-dev] [PATCH 24/42] i965/blorp: move emission of sample combining into eu-emitter

2014-01-20 Thread Paul Berry
On 20 January 2014 19:36, Paul Berry wrote: > On 20 December 2013 06:38, Topi Pohjolainen wrote: > >> diff --git a/src/mesa/drivers/dri/i965/brw_blorp_blit_eu.cpp >> b/src/mesa/drivers/dri/i965/brw_blorp_blit_eu.cpp >> index b189aa2..dcfd82b 100644 >> -

Re: [Mesa-dev] [PATCH 41/42] i965/eu: introduce blorp specific flavour of lrp

2014-01-20 Thread Paul Berry
On 20 December 2013 06:39, Topi Pohjolainen wrote: > This is rather ugly but as I couldn't think of anything better > for now and wanted to get the rest of the series under review, > I left it as it is. > Even though immediately surrounding code has tabs this piece is > written space-indented. > >

Re: [Mesa-dev] [PATCH 39/42] i965/fs: introduce blorp specific rt-write for fs_generator

2014-01-20 Thread Paul Berry
ely, we could store it in inst->target. With that issue addressed, this patch is: Reviewed-by: Paul Berry > +inst->mlen, > +0, > +true, > +inst->header_present); > +} > + > ___

Re: [Mesa-dev] [PATCH 38/42] i965/fs: allow unit tests to dump the final patched assembly

2014-01-20 Thread Paul Berry
a default value of NULL, and only dump instructions if it is non-NULL? Either way, the patch is: Reviewed-by: Paul Berry ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Re: [Mesa-dev] [PATCH 37/42] i965/blorp: wrap brw_IF/ELSE/ENDIF() into eu-emitter

2014-01-20 Thread Paul Berry
+ brw_CMP(&func, vec16(brw_null_reg()), op, x, y); > + brw_IF(&func, BRW_EXECUTE_16); > + } > Can we maybe call tihs "emit_cmp_if()", so that it's clear when looking at the caller that it performs both a CMP and an IF? With that change, this patch is: Reviewed-by:

Re: [Mesa-dev] [PATCH 27/42] i965/blorp: wrap LRP

2014-01-20 Thread Paul Berry
ALIGN_1); > + for (int k = 0; k < 8; k += 2) > + emit_lrp(vec8(SAMPLE(0, k)), > + offset(y_frac, k & 1), > Same comment applies here. > + vec8(SAMPLE(2, k)), > + vec8(SAMPLE(0, k))); > #undef SAMPLE > } > With those two things fixed, this patch is: Reviewed-by: Paul Berry ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Re: [Mesa-dev] [PATCH 24/42] i965/blorp: move emission of sample combining into eu-emitter

2014-01-20 Thread Paul Berry
eading emt_combine() won't have to look at manual_blend_average() to understand why we use ADD for floats and AVG for ints. With that change, this patch is: Reviewed-by: Paul Berry ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev

[Mesa-dev] [PATCH] i965: Add GS support to INTEL_DEBUG=shader_time.

2014-01-17 Thread Paul Berry
Previously, time spent in geometry shaders would be counted as part of the vertex shader time. --- src/mesa/drivers/dri/i965/brw_context.h | 3 +++ src/mesa/drivers/dri/i965/brw_program.c | 10 +- src/mesa/drivers/dri/i965/brw_vec4.cpp

[Mesa-dev] [PATCH] i965: Modify some error messages to refer to "vec4" instead of "vs".

2014-01-17 Thread Paul Berry
These messages are in code that is shared between the VS and GS back-ends, so use the terminology "vec4" to avoid confusion. --- src/mesa/drivers/dri/i965/brw_vec4_generator.cpp | 8 src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-)

Re: [Mesa-dev] [wip 6/9] glsl: ir_deserializer class for the binary shader cache

2014-01-17 Thread Paul Berry
On 14 January 2014 03:35, Tapani Pälli wrote: > On 01/14/2014 01:24 AM, Paul Berry wrote: > > On 2 January 2014 03:58, Tapani Pälli wrote: > > + var->state_slots = NULL; >> + >> + if (var->num_state_slots > 0) { >> + var->

Re: [Mesa-dev] [wip 1/9] glsl: memory_writer helper class for data serialization

2014-01-17 Thread Paul Berry
On 14 January 2014 02:35, Tapani Pälli wrote: > On 01/13/2014 08:27 PM, Paul Berry wrote: > > On 2 January 2014 03:58, Tapani Pälli wrote: > >> Class will be used by the shader binary cache implementation. >> >> Signed-off-by: Tapani Pälli >> --

Re: [Mesa-dev] [wip 8/9] glsl: functions to serialize gl_shader and gl_shader_program

2014-01-17 Thread Paul Berry
On 15 January 2014 02:46, Tapani wrote: > On 01/14/2014 07:53 PM, Paul Berry wrote: > > On 2 January 2014 03:58, Tapani Pälli wrote: > >> +static void >>> +serialize_uniform_storage(gl_uniform_storage *uni, memory_writer &blob) >>>

Re: [Mesa-dev] [wip 9/9] mesa: OES_get_program_binary extension functionality

2014-01-17 Thread Paul Berry
On 16 January 2014 05:37, Tapani Pälli wrote: > On 01/15/2014 06:13 PM, Paul Berry wrote: > > On 2 January 2014 03:58, Tapani Pälli wrote: > >> Signed-off-by: Tapani Pälli >> --- >> src/mesa/main/shaderapi.c | 44 >> +++

Re: [Mesa-dev] [wip 0/9] GL_OES_get_program_binary extension

2014-01-15 Thread Paul Berry
for string_to_uint_map > glsl: functions to serialize gl_shader and gl_shader_program > mesa: OES_get_program_binary extension functionality > I sent comments on all patches but 4, 5, and 7. Those patches are: Reviewed-by: Paul Berry I se

Re: [Mesa-dev] [wip 9/9] mesa: OES_get_program_binary extension functionality

2014-01-15 Thread Paul Berry
On 2 January 2014 03:58, Tapani Pälli wrote: > Signed-off-by: Tapani Pälli > --- > src/mesa/main/shaderapi.c | 44 > ++-- > 1 file changed, 38 insertions(+), 6 deletions(-) > > diff --git a/src/mesa/main/shaderapi.c b/src/mesa/main/shaderapi.c > index 575

Re: [Mesa-dev] [wip 8/9] glsl: functions to serialize gl_shader and gl_shader_program

2014-01-14 Thread Paul Berry
On 2 January 2014 03:58, Tapani Pälli wrote: > diff --git a/src/glsl/shader_cache.cpp b/src/glsl/shader_cache.cpp > new file mode 100644 > index 000..4b5de45 > --- /dev/null > +++ b/src/glsl/shader_cache.cpp > @@ -0,0 +1,489 @@ > +/* -*- c++ -*- */ > +/* > + * Copyright © 2013 Intel Corporati

Re: [Mesa-dev] [wip 6/9] glsl: ir_deserializer class for the binary shader cache

2014-01-13 Thread Paul Berry
On 2 January 2014 03:58, Tapani Pälli wrote: > + > + > +/** > + * Reads header part of the binary blob. Main purpose of this header is to > + * validate that cached shader was produced with same Mesa driver version. > + */ > +int > +ir_deserializer::read_header(struct gl_shader *shader) > +{ > +

Re: [Mesa-dev] [wip 3/9] glsl: memory_map helper class for data deserialization

2014-01-13 Thread Paul Berry
On 2 January 2014 03:58, Tapani Pälli wrote: > Class will be used by the shader binary cache implementation. > > Signed-off-by: Tapani Pälli > --- > src/glsl/memory_map.h | 174 > ++ > 1 file changed, 174 insertions(+) > create mode 100644 src/gl

Re: [Mesa-dev] [wip 2/9] glsl: serialize methods for IR instructions

2014-01-13 Thread Paul Berry
mall integer, so that we could serialize each type just once (see http://lists.freedesktop.org/archives/mesa-dev/2013-November/047740.html). At the time, it sounded like you liked that idea. Have you made that change? It looks to me like you've stopped serializing the built-in types, bu

Re: [Mesa-dev] [wip 1/9] glsl: memory_writer helper class for data serialization

2014-01-13 Thread Paul Berry
On 2 January 2014 03:58, Tapani Pälli wrote: > Class will be used by the shader binary cache implementation. > > Signed-off-by: Tapani Pälli > --- > src/glsl/memory_writer.h | 147 > +++ > 1 file changed, 147 insertions(+) > create mode 100644 src/gl

[Mesa-dev] [PATCH] i965: Ensure that all necessary state is re-emitted if we run out of aperture.

2014-01-10 Thread Paul Berry
Prior to this patch, if we ran out of aperture space during brw_try_draw_prims(), we would rewind the batch buffer pointer (potentially throwing some state that may have been emitted by brw_upload_state()), flush the batch, and then try again. However, we wouldn't reset the dirty bits to the state

Re: [Mesa-dev] [PATCH 12/30] mesa: Change redundant code into loops in texstate.c.

2014-01-10 Thread Paul Berry
On 10 January 2014 11:41, Kenneth Graunke wrote: > On 01/09/2014 06:19 PM, Paul Berry wrote: > > This is possible now that ctx->Shader.CurrentProgram is an array. > > --- > > src/mesa/main/texstate.c | 75 > +++- > &g

Re: [Mesa-dev] [PATCH 19/30] mesa/cs: Handle compute shaders in _mesa_use_program().

2014-01-10 Thread Paul Berry
On 9 January 2014 22:32, Chris Forbes wrote: > Minor nit, but could CS be done after the ordered pipeline stages, for > consistency? > Sure, no problem. In fact, I just realized that if I change the "type" parameter of use_shader_program to gl_shader_stage, I can call it in a loop. I'll do tha

Re: [Mesa-dev] [PATCH 11/30] mesa: Change redundant code into loops in shaderapi.c.

2014-01-10 Thread Paul Berry
On 9 January 2014 20:03, Chris Forbes wrote: > This is a slightly odd construction (although copied from the existing > code): > > > + if ((shProg == NULL) || (shProg->_LinkedShaders[stage] == NULL)) > > +shProg = NULL; > You're right. This would be much better as: if ((shProg != NUL

Re: [Mesa-dev] [PATCH 05/30] glsl/linker: Refactor in preparation for adding more shader stages.

2014-01-10 Thread Paul Berry
On 9 January 2014 22:17, Chris Forbes wrote: > This is a nice cleanup; I like that this brings both writes to > prog->LastClipDistanceArraySize together -- but it looks like the > behavior changes slightly. > > Previously, if there was no VS and no GS, then we would never write > prog->LastClipDi

Re: [Mesa-dev] [PATCH 2/2] i965: Fix clears of layered framebuffers with mismatched layer counts.

2014-01-09 Thread Paul Berry
On 9 January 2014 18:19, Chris Forbes wrote: > I'm not convinced this is correct/safe, at least for the meta clear. > > The GL 3.2 spec says, on page 221 (page 235 of the PDF): > > * If the number of layers of each attachment are not all identical, > rendering > will be limited to the small

[Mesa-dev] [PATCH 30/30] i965/cs: Allow ARB_compute_shader to be enabled via env var.

2014-01-09 Thread Paul Berry
This will allow testing of compute shader functionality before it is completed. To enable ARB_compute_shader functionality in the i965 driver, set INTEL_COMPUTE_SHADER=1. --- src/mesa/drivers/dri/i965/brw_context.c | 11 ++- src/mesa/drivers/dri/i965/intel_extensions.c | 2 ++ 2 fil

[Mesa-dev] [PATCH 13/30] mesa/cs: Add extension enable flags for ARB_compute_shader.

2014-01-09 Thread Paul Berry
--- src/glsl/glcpp/glcpp-parse.y| 3 +++ src/glsl/glsl_parser_extras.cpp | 1 + src/glsl/glsl_parser_extras.h | 2 ++ src/glsl/standalone_scaffolding.cpp | 1 + src/mesa/main/extensions.c | 1 + src/mesa/main/mtypes.h | 1 + 6 files changed, 9 insertions(+)

[Mesa-dev] [PATCH 27/30] glsl/cs: Prohibit user-defined ins/outs in compute shaders.

2014-01-09 Thread Paul Berry
--- src/glsl/ast_to_hir.cpp | 7 +++ 1 file changed, 7 insertions(+) diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp index c1b1d6a..ed3a4f9 100644 --- a/src/glsl/ast_to_hir.cpp +++ b/src/glsl/ast_to_hir.cpp @@ -2220,6 +2220,13 @@ apply_type_qualifier_to_variable(const struct a

[Mesa-dev] [PATCH 04/30] mesa: use _mesa_validate_shader_target() more frequently.

2014-01-09 Thread Paul Berry
This patch replaces code in _mesa_new_shader() and delete_shader_cb() that checks the type of a shader with calls to _mesa_validate_shader_target(). This has two advantages: it allows for a more thorough check (since _mesa_validate_shader_target() doesn't permit shader targets that aren't supporte

[Mesa-dev] [PATCH 26/30] main/cs: Implement query for COMPUTE_WORK_GROUP_SIZE.

2014-01-09 Thread Paul Berry
--- src/mesa/main/shaderapi.c | 18 ++ 1 file changed, 18 insertions(+) diff --git a/src/mesa/main/shaderapi.c b/src/mesa/main/shaderapi.c index 053f27b..680d449 100644 --- a/src/mesa/main/shaderapi.c +++ b/src/mesa/main/shaderapi.c @@ -663,6 +663,24 @@ get_programiv(struct gl_con

[Mesa-dev] [PATCH 23/30] mesa/cs: Implement MAX_COMPUTE_WORK_GROUP_COUNT constant.

2014-01-09 Thread Paul Berry
--- src/glsl/builtin_variables.cpp | 4 src/glsl/glsl_parser_extras.cpp | 2 ++ src/glsl/glsl_parser_extras.h | 1 + src/glsl/main.cpp | 3 +++ src/glsl/standalone_scaffolding.cpp | 3 +++ src/mesa/main/context.c | 3 +++ src/mesa/main/get.c

[Mesa-dev] [PATCH 11/30] mesa: Change redundant code into loops in shaderapi.c.

2014-01-09 Thread Paul Berry
This is possible now that ctx->Shader.CurrentProgram is an array. --- src/mesa/main/shaderapi.c | 39 +-- 1 file changed, 9 insertions(+), 30 deletions(-) diff --git a/src/mesa/main/shaderapi.c b/src/mesa/main/shaderapi.c index d57748c..61ac0e3 100644 --- a/src

[Mesa-dev] [PATCH 22/30] mesa/cs: Implement MAX_COMPUTE_WORK_GROUP_INVOCATIONS constant.

2014-01-09 Thread Paul Berry
--- src/glsl/main.cpp | 1 + src/glsl/standalone_scaffolding.cpp | 1 + src/mesa/main/context.c | 1 + src/mesa/main/get.c | 1 + src/mesa/main/get_hash_params.py| 3 +++ src/mesa/main/mtypes.h | 1 + 6 files changed, 8 insertions(+)

[Mesa-dev] [PATCH 24/30] glsl/cs: Handle compute shader local_size_{x, y, z} declaration.

2014-01-09 Thread Paul Berry
--- src/glsl/ast.h | 34 +++ src/glsl/ast_to_hir.cpp | 79 ++ src/glsl/ast_type.cpp | 14 ++ src/glsl/builtin_variables.cpp | 20 + src/glsl/glsl_lexer.ll | 3 +- src/glsl/glsl_parser.yy |

[Mesa-dev] [PATCH 21/30] mesa/cs: Implement MAX_COMPUTE_WORK_GROUP_SIZE constant.

2014-01-09 Thread Paul Berry
--- src/glsl/builtin_variables.cpp | 27 +++ src/glsl/glsl_parser_extras.cpp | 4 src/glsl/glsl_parser_extras.h | 3 +++ src/glsl/main.cpp | 3 +++ src/glsl/standalone_scaffolding.cpp | 3 +++ src/mesa/main/context.c |

[Mesa-dev] [PATCH 25/30] mesa/cs: Handle compute shader local size during linking.

2014-01-09 Thread Paul Berry
--- src/glsl/linker.cpp | 64 +++ src/mesa/main/mtypes.h| 17 + src/mesa/main/shaderapi.c | 7 ++ 3 files changed, 88 insertions(+) diff --git a/src/glsl/linker.cpp b/src/glsl/linker.cpp index 7461b17..11e0651 100644 --- a/src

[Mesa-dev] [PATCH 00/30] mesa: Start implementing compute shaders.

2014-01-09 Thread Paul Berry
This is the first of several planned patch series to implement the extension ARB_compute_shader in Mesa. This series allows the Mesa front-end to parse and compile a "do-nothing" compute shader--that is, one which contains nothing but a compute shader input layout declaration and an empty main() f

[Mesa-dev] [PATCH 19/30] mesa/cs: Handle compute shaders in _mesa_use_program().

2014-01-09 Thread Paul Berry
--- src/mesa/main/shaderapi.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/mesa/main/shaderapi.c b/src/mesa/main/shaderapi.c index 519b200..5188e9c 100644 --- a/src/mesa/main/shaderapi.c +++ b/src/mesa/main/shaderapi.c @@ -993,6 +993,7 @@ _mesa_use_program(struct gl_context *ctx, struct

[Mesa-dev] [PATCH 17/30] glsl/cs: Populate default values for ctx->Const.Program[MESA_SHADER_COMPUTE].

2014-01-09 Thread Paul Berry
--- src/glsl/main.cpp | 4 src/glsl/standalone_scaffolding.cpp | 4 2 files changed, 8 insertions(+) diff --git a/src/glsl/main.cpp b/src/glsl/main.cpp index 03b7c78..afc15cb 100644 --- a/src/glsl/main.cpp +++ b/src/glsl/main.cpp @@ -50,6 +50,10 @@ initialize_context(s

[Mesa-dev] [PATCH 29/30] i965/cs: Create the brw_compute_program struct, and the code to initialize it.

2014-01-09 Thread Paul Berry
--- src/mesa/drivers/dri/i965/brw_context.h | 8 src/mesa/drivers/dri/i965/brw_program.c | 11 +++ 2 files changed, 19 insertions(+) diff --git a/src/mesa/drivers/dri/i965/brw_context.h b/src/mesa/drivers/dri/i965/brw_context.h index df32ccb..abc1783 100644 --- a/src/mesa/drive

[Mesa-dev] [PATCH 09/30] meta: Replace save_state::{Vertex, Geometry, Fragment}Shader with an array.

2014-01-09 Thread Paul Berry
Since ctx->Shader.Current{Vertex,Geometry,Fragment}Program is an array, this allows some meta code to be rolled up into loops. --- src/mesa/drivers/common/meta.c | 30 ++ 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/src/mesa/drivers/common/meta.c b/sr

[Mesa-dev] [PATCH 14/30] mesa/cs: Add dispatch API stubs for ARB_compute_shader.

2014-01-09 Thread Paul Berry
--- src/mapi/glapi/gen/ARB_compute_shader.xml | 40 +++ src/mapi/glapi/gen/Makefile.am| 1 + src/mapi/glapi/gen/gl_API.xml | 4 ++- src/mapi/glapi/gen/gl_genexec.py | 1 + src/mesa/Makefile.sources | 1 + src/mesa/SConscript

[Mesa-dev] [PATCH 28/30] glsl/cs: Prohibit mixing of compute and non-compute shaders.

2014-01-09 Thread Paul Berry
Fixes piglit test: spec/ARB_compute_shader/linker/mix_compute_and_non_compute --- src/glsl/linker.cpp | 7 +++ 1 file changed, 7 insertions(+) diff --git a/src/glsl/linker.cpp b/src/glsl/linker.cpp index 11e0651..f1344ea 100644 --- a/src/glsl/linker.cpp +++ b/src/glsl/linker.cpp @@ -2107,6 +2

[Mesa-dev] [PATCH 12/30] mesa: Change redundant code into loops in texstate.c.

2014-01-09 Thread Paul Berry
This is possible now that ctx->Shader.CurrentProgram is an array. --- src/mesa/main/texstate.c | 75 +++- 1 file changed, 29 insertions(+), 46 deletions(-) diff --git a/src/mesa/main/texstate.c b/src/mesa/main/texstate.c index b9c76da..905a9d5 100644 --

[Mesa-dev] [PATCH 16/30] mesa/cs: Add a MESA_SHADER_COMPUTE stage and update switch statements.

2014-01-09 Thread Paul Berry
This patch adds MESA_SHADER_COMPUTE to the gl_shader_stage enum. Also, where it is trivial to do so, it adds a compute shader case to switch statements that switch based on the type of shader. This avoids "unhandled switch case" compiler warnings. --- src/glsl/ast_to_hir.cpp | 9 ++

  1   2   3   4   5   6   7   8   9   10   >