[Mesa-dev] [PATCH 1/3] gallivm: support printing of 64 bit integers

2013-10-08 Thread Zack Rusin
only 8 and 32 bit integers were supported before. Signed-off-by: Zack Rusin --- src/gallium/auxiliary/gallivm/lp_bld_printf.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/gallium/auxiliary/gallivm/lp_bld_printf.c b/src/gallium/auxiliary/gallivm/lp_bld_printf.c

[Mesa-dev] [PATCH 2/3] gallium: Add support for 32x32 muls with 64 bit results

2013-10-08 Thread Zack Rusin
destinations and because there's not much (any) difference wrt code-generation. Signed-off-by: Zack Rusin --- src/gallium/auxiliary/tgsi/tgsi_exec.c | 34 ++ src/gallium/auxiliary/tgsi/tgsi_info.c | 6 src/gallium/auxiliary/tgsi/tgsi_opcode_

[Mesa-dev] [PATCH 3/3] llvmpipe: implement 64 bit mul opcodes in llvmpipe

2013-10-08 Thread Zack Rusin
Both the imul_hi and umul_hi are working with this patch. Signed-off-by: Zack Rusin --- src/gallium/auxiliary/gallivm/lp_bld_tgsi_action.c | 60 ++ 1 file changed, 60 insertions(+) diff --git a/src/gallium/auxiliary/gallivm/lp_bld_tgsi_action.c b/src/gallium/auxiliary

[Mesa-dev] [PATCH] llvmpipe: abstract the code to set number of subpixel bits

2013-10-08 Thread Zack Rusin
As we're moving towards expanding the number of subpixel bits and the width of the variables used in the computations we need to make this code a bit more centralized. Signed-off-by: Zack Rusin --- src/gallium/drivers/llvmpipe/lp_rast.h | 9 + src/gallium/drivers/llv

[Mesa-dev] [PATCH] graw: add a test rendering a huge triangle

2013-10-24 Thread Zack Rusin
Used to test rasterization, because we often breakdown on subdivision of triangles with long edges. Signed-off-by: Zack Rusin --- src/gallium/tests/graw/SConscript | 1 + src/gallium/tests/graw/tri-large.c | 173 + 2 files changed, 174 insertions

Re: [Mesa-dev] [PATCH] gallivm: deduplicate some indirect register address code

2013-11-06 Thread Zack Rusin
Looks good. Reviewed-by: Zack Rusin - Original Message - > From: Roland Scheidegger > > There's only one minor functional change, for immediates the pixel offsets > are no longer added since the values are all the same for all elements in > any case (it migh

Re: [Mesa-dev] [PATCH] gallivm: Compile flag to debug TGSI execution through printfs.

2013-11-13 Thread Zack Rusin
That's very nice Jose! Looks good to me. - Original Message - > From: José Fonseca > > It is similar to tgsi_exec.c's DEBUG_EXECUTION compile flag. > > I had prototyped this for a while while debugging an issue, but finally > cleaned this up and added a few more bells and whistles. >

[Mesa-dev] [PATCH] llvmpipe: support 8bit subpixel precision

2013-11-20 Thread Zack Rusin
8 bit precision is required by d3d10 but unfortunately requires 64 bit rasterizer. This commit implements 64 bit rasterization with full support for 8bit subpixel precision. It's a combination of all individual commits from the llvmpipe-rast-64 branch. Signed-off-by: Zack Rusin --- src/ga

Re: [Mesa-dev] [PATCH] llvmpipe: support 8bit subpixel precision

2013-11-21 Thread Zack Rusin
ect. zFrom 55c9a288c7ebc37b32bc75526e6de71a838ccaef Mon Sep 17 00:00:00 2001 From: Zack Rusin Date: Thu, 24 Oct 2013 22:05:22 -0400 Subject: [PATCH] llvmpipe: support 8bit subpixel precision 8 bit precision is required by d3d10 but unfortunately requires 64 bit rasterizer. This commit implements 64 bit rasterizatio

Re: [Mesa-dev] [PATCH 4/8] draw/gs: fix segfault in glsl-1.50-gs-mismatch-prim-type triangles_adjacency

2014-06-10 Thread Zack Rusin
That looks wrong. The total number of verts per buffer is the maximum number of verts that can be output per invocation (primitive_boundary) times number of invocations of geometry shader (num_in_primitives). It's not maximum number of verts that can be output per invocation (primitive_boundar

Re: [Mesa-dev] [PATCH 4/8] draw/gs: fix segfault in glsl-1.50-gs-mismatch-prim-type triangles_adjacency

2014-06-10 Thread Zack Rusin
'd look for the bug there. z - Original Message - > On 11 June 2014 00:02, Zack Rusin wrote: > > That looks wrong. The total number of verts per buffer is the maximum > > number of verts that can be output per invocation (primitive_boundary) > > times num

Re: [Mesa-dev] [PATCH 4/8] draw/gs: fix segfault in glsl-1.50-gs-mismatch-prim-type triangles_adjacency

2014-06-10 Thread Zack Rusin
> I'll revisit it today and see if I can spot something else wrong, it > fails for triangle adj because there are 6 vertices per primitive and > we have only malloced space for 4. It has to be something else because that's impossible, in fact it's 2x impossible ;) 1) It's illegal and impossible

Re: [Mesa-dev] [PATCH] draw: avoid buffer overflows with bad geometry programs.

2014-06-10 Thread Zack Rusin
To be honest I still don't like it. While the tgsi_exec specific paths in draw_gs don't matter to me and can be as ugly as they need to be, they can't be polluting the draw_pt_emit code, in other words the primitive_lengths can't be bogus at that point - prim_info can't lie about the amount of d

Re: [Mesa-dev] [PATCH] tgsi/gs: bound max output vertices in shader

2014-06-10 Thread Zack Rusin
Looks great. If I was into diffs I'd make sweet and passionate love to this one. Reviewed-by: Zack Rusin - Original Message - > From: Dave Airlie > > This limits the number of emitted vertices to the shaders max output > vertices, and avoids us writing things into

[Mesa-dev] [PATCH 1/2] gallivm: handle nan's in min/max

2013-07-16 Thread Zack Rusin
Both D3D10 and OpenCL say that if one the inputs is nan then the other should be returned. To preserve that behavior the patche fixes both the sse and the non-sse paths in both functions. Signed-off-by: Zack Rusin --- src/gallium/auxiliary/gallivm/lp_bld_arit.c | 60

[Mesa-dev] [PATCH 2/2] gallivm: fix edge cases in exp2

2013-07-16 Thread Zack Rusin
exp2(0) needs to be exactly 1, if exp2(src) overflows then it has to be equal to infinity and exp2(nan) has to be equal to a nan. The patches fixes all three cases. Signed-off-by: Zack Rusin --- src/gallium/auxiliary/gallivm/lp_bld_arit.c | 16 +++- 1 file changed, 15 insertions

Re: [Mesa-dev] [PATCH 1/2] llvmpipe: fix blending with SRC_ALPHA_SATURATE with some formats without alpha

2013-07-17 Thread Zack Rusin
Looks good to me. - Original Message - > From: Roland Scheidegger > > We were fixing up the blend factor to ZERO, however this only works correctly > with fixed point render buffers where the input values are clamped to 0/1 > (because src_alpha_saturate is min(As, 1-Ad) so can be negativ

Re: [Mesa-dev] [PATCH] mesa: fix rgtc snorm decoding

2013-07-23 Thread Zack Rusin
Reviewed-by: Zack Rusin - Original Message - > From: Roland Scheidegger > > The codeword must be unsigned (otherwise will shift in 1's from above when > merging low/high parts so some texels decode wrong). > This also affects gallium's util/u_format_rgt

[Mesa-dev] [PATCH 1/3] draw: cleanup and fix instance id computation

2013-07-23 Thread Zack Rusin
instance id. This fixes instance id computation and cleansup buffer offset computation. Signed-off-by: Zack Rusin --- src/gallium/auxiliary/draw/draw_llvm.c |7 +++ src/gallium/auxiliary/draw/draw_pt.c|7 --- src/gallium/auxiliary/translate

[Mesa-dev] [PATCH 2/3] draw: fix vertex id computation

2013-07-23 Thread Zack Rusin
behavior. Signed-off-by: Zack Rusin --- src/gallium/auxiliary/draw/draw_llvm.c| 37 ++--- src/gallium/auxiliary/draw/draw_private.h |1 + src/gallium/auxiliary/draw/draw_pt.c |1 + 3 files changed, 31 insertions(+), 8 deletions(-) diff --git a/src/gallium

[Mesa-dev] [PATCH 3/3] draw/llvmpipe: allow indexed rendering without index buffer bound

2013-07-23 Thread Zack Rusin
this is a wonky requirement of d3d10, which expects that if indexed rendering call is issued without an indexed buffer bound, the rendering should still happen but with all indices set to 0. Signed-off-by: Zack Rusin --- src/gallium/auxiliary/draw/draw_private.h |5 +++-- src/gallium

Re: [Mesa-dev] [PATCH] draw: always call and move util_cpu_detect() to draw context creation.

2013-07-23 Thread Zack Rusin
Nice catch! Thanks! - Original Message - > From: Roland Scheidegger > > CPU detection is not really x86 specific, the ifdef in particular didn't > even catch x86_64. > Also move to draw context creation which seems a lot cleaner, and just > call it always (which seems like a better idea

[Mesa-dev] [PATCH] draw: fix vertex id computation

2013-07-24 Thread Zack Rusin
behavior. Signed-off-by: Zack Rusin --- src/gallium/auxiliary/draw/draw_llvm.c | 36 +++- src/gallium/auxiliary/draw/draw_llvm.h |6 ++-- src/gallium/auxiliary/draw/draw_private.h |1 + src/gallium/auxiliary/draw/draw_pt.c |1

Re: [Mesa-dev] [PATCH 06/34] draw/gs: fix allocation of buffer for GS output vertices

2013-07-29 Thread Zack Rusin
That looks wrong to me. We already account for the "other fields" in the vertex_size. - Original Message - > From: Bryan Cain > > Before, it accounted for the size of the vertices but not the other fields > in the vertex_header struct, which caused memory corruption. > --- > src/galliu

Re: [Mesa-dev] [PATCH 24/34] gallivm: Fix indirect input fetches for gs.

2013-07-29 Thread Zack Rusin
That looks wrong to me as well. What would make get_indirect_index different in this case? - Original Message - > From: Fabian Bieler > > --- > src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/src/gallium/auxiliary/gallivm/lp_

[Mesa-dev] [PATCH] tgsi: add ucmp to the list of opcodes

2013-07-30 Thread Zack Rusin
we forgot to add ucmp to the list of opcodes, so it was never generated for ureg. Signed-off-by: Zack Rusin --- src/gallium/auxiliary/tgsi/tgsi_opcode_tmp.h |2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gallium/auxiliary/tgsi/tgsi_opcode_tmp.h b/src/gallium/auxiliary/tgsi

Re: [Mesa-dev] [PATCH] gallivm: obey clarified shift behavior

2013-07-30 Thread Zack Rusin
> From: Roland Scheidegger > > llvm shifts are undefined for shift counts exceeding (or matching) bit width, > so need to apply a mask for the tgsi shift instructions. > > v2: only use mask for the tgsi shift instructions, not for the build shift > helpers. None of the internal callers need this

[Mesa-dev] [PATCH 1/2] llvmpipe: make the front-face behavior match the gallium spec

2013-07-31 Thread Zack Rusin
The spec says that front-face is true if the value is >0 and false if it's <0. To make sure that we follow the spec, lets just subtract 0.5 from our value (llvmpipe did 1 for frontface and 0 otherwise), which will get us a positive num for frontface and negative for backface. Signed-o

[Mesa-dev] [PATCH 2/2] draw: inject frontface info into wireframe outputs

2013-07-31 Thread Zack Rusin
e'). To fix it allow draw module to inject a fake face semantic into outputs from which the backends can figure out the original frontfacing info of the primitives. Signed-off-by: Zack Rusin --- src/gallium/auxiliary/draw/draw_context.c | 43 src/gallium

Re: [Mesa-dev] [PATCH 2/2] draw: inject frontface info into wireframe outputs

2013-07-31 Thread Zack Rusin
> > + if (draw_will_inject_frontface(lp_context->draw) && > I think it's annoying you have to do these calls to determine if there's > a valid frontface here for each line instead of just per draw call but > it doesn't seem easy to avoid it. Yea, there's no trivial way of avoiding it. > Also, n

[Mesa-dev] [PATCH 1/8] tgsi: detect prim id and front face usage in fs

2013-08-01 Thread Zack Rusin
Adding code to detect the usage of prim id and front face semantics in fragment shaders. Signed-off-by: Zack Rusin --- src/gallium/auxiliary/tgsi/tgsi_scan.c |9 +++-- src/gallium/auxiliary/tgsi/tgsi_scan.h |1 + 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src

[Mesa-dev] [PATCH 2/8] draw: stop crashing with extra shader outputs

2013-08-01 Thread Zack Rusin
cular when running the pipeline which depends on the vertex_id in the vertex_header things were completely broken. The patch adjust the code to correctly use the total number of shader outputs (the standard ones plus the injected ones) to make it all stop crashing and work. Signed-off-by: Zack

[Mesa-dev] [PATCH 3/8] draw/llvm: add some extra debugging output

2013-08-01 Thread Zack Rusin
when dumping shader outputs it's nice to have the integer values of the outputs, in particular because some values are integers. Signed-off-by: Zack Rusin --- src/gallium/auxiliary/draw/draw_llvm.c |6 ++ 1 file changed, 6 insertions(+) diff --git a/src/gallium/auxiliary

[Mesa-dev] [PATCH 4/8] draw: make sure clipping works with injected outputs

2013-08-01 Thread Zack Rusin
propagates the entire vertex. Signed-off-by: Zack Rusin --- src/gallium/auxiliary/draw/draw_pipe_clip.c | 89 --- 1 file changed, 54 insertions(+), 35 deletions(-) diff --git a/src/gallium/auxiliary/draw/draw_pipe_clip.c b/src/gallium/auxiliary/draw/draw_pipe_clip.c index

[Mesa-dev] [PATCH 5/8] draw: use the vertex size

2013-08-01 Thread Zack Rusin
Instead of using the magical 4 use the above computed vertex size. Doesn't change the behavior, just makes the code a bit cleaner. Signed-off-by: Zack Rusin --- src/gallium/auxiliary/draw/draw_pipe_vbuf.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ga

[Mesa-dev] [PATCH 6/8] draw: fix front face injection

2013-08-01 Thread Zack Rusin
Inject front face only if the fragment shader uses it and propagate through all channels because otherwise we'll need to figure out the exact swizzle that the fs expects and it's just simpler to make sure all the components within the front face register are correctly set. Signed-of

[Mesa-dev] [PATCH 7/8] llvmpipe: don't interpolate front face or prim id

2013-08-01 Thread Zack Rusin
the initial scan of fs inputs. Signed-off-by: Zack Rusin --- src/gallium/drivers/llvmpipe/lp_state_derived.c | 30 +++ 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/src/gallium/drivers/llvmpipe/lp_state_derived.c b/src/gallium/drivers/llvmpipe

[Mesa-dev] [PATCH 8/8] draw: implement proper primitive assembler as a pipeline stage

2013-08-01 Thread Zack Rusin
ition is already handled for us. Signed-off-by: Zack Rusin --- src/gallium/auxiliary/Makefile.sources |2 +- src/gallium/auxiliary/draw/draw_context.c |1 + src/gallium/auxiliary/draw/draw_pipe.c |4 + src/gallium/auxiliary/draw/draw_pipe.h |

Re: [Mesa-dev] [PATCH 8/8] draw: implement proper primitive assembler as a pipeline stage

2013-08-02 Thread Zack Rusin
For now though this works, even if it is very ugly. z - Original Message - > Am 02.08.2013 08:28, schrieb Zack Rusin: > > we used to have a face primitive assembler that we ran after if > > the gs was missing but we had adjacency primitives in the pipeline, > > l

Re: [Mesa-dev] [PATCH] util: implement table-based + linear interpolation linear-to-srgb conversion

2013-08-05 Thread Zack Rusin
Looks good to me. A small comment above the disabled version noting that it's disabled because it's a bit slower might be useful for the next person who reads the code. Reviewed-by: Zack Rusin - Original Message - > From: Roland Scheidegger > > Should be much fa

[Mesa-dev] [PATCH] draw: fix slot detection

2013-08-06 Thread Zack Rusin
Nowadays -1 for slots means that the semantic is not present, so we need to store it in a signed variables, otherwise <0 comparisons are pointless. Fixes http://bugzilla.eng.vmware.com/show_bug.cgi?id=67811 (at least with softpipe, edgeflags don't work wit llvmpipe) Signed-off-by: Za

Re: [Mesa-dev] [PATCH 2/2] gallivm: propagate scalar_lod to emit_size_query too

2013-08-07 Thread Zack Rusin
- Original Message - > From: Roland Scheidegger > > Clearly the returned values need to be per-element if the lod is per element. > Does not actually change behavior yet. Looks good. For the entire series: Reviewed-by: Zack Rusin

Re: [Mesa-dev] [PATCH] gallivm: honor d3d10 floating point rules for shadow comparisons

2013-08-07 Thread Zack Rusin
good too. For all three: Reviewed-by: Zack Rusin ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev

[Mesa-dev] [PATCH 1/3] draw: cleanup the extra attribs

2013-08-08 Thread Zack Rusin
Before inserting new front face and prim id outputs cleanup the old extra outputs, otherwise our cache will use previous output slots which will break as soon as outputs of the current shader don't match the last. Signed-off-by: Zack Rusin --- src/gallium/auxiliary/draw/draw_context.c |

[Mesa-dev] [PATCH 2/3] draw: reset the vertex id when injecting new primitive id

2013-08-08 Thread Zack Rusin
ertex data is correctly emitted. Signed-off-by: Zack Rusin --- src/gallium/auxiliary/draw/draw_pipe_ia.c |9 + 1 file changed, 9 insertions(+) diff --git a/src/gallium/auxiliary/draw/draw_pipe_ia.c b/src/gallium/auxiliary/draw/draw_pipe_ia.c index ecbb233..d64f19b 100644 --- a/src/ga

[Mesa-dev] [PATCH 3/3] draw: rewrite primitive assembler

2013-08-08 Thread Zack Rusin
embler and completely removes the useless pipeline stage. Signed-off-by: Zack Rusin --- src/gallium/auxiliary/Makefile.sources |1 - src/gallium/auxiliary/draw/draw_context.c|8 +- src/gallium/auxiliary/draw/draw_pipe.c |4 - src/gallium/auxiliary/draw/d

Re: [Mesa-dev] [PATCH 2/3] draw: reset the vertex id when injecting new primitive id

2013-08-08 Thread Zack Rusin
emit those vertices with the changed > primitive id. So lets reset the vertex id whenever injecting > new primitive id to make sure that the vertex data is correctly > emitted. > > Signed-off-by: Zack Rusin > --- > src/gallium/auxiliary/draw/draw_pipe_ia.c |9 + >

Re: [Mesa-dev] [PATCH 2/2] gallivm: use texture target from shader instead of static state for size query

2013-08-08 Thread Zack Rusin
Series looks good to me. Reviewed-by: Zack Rusin - Original Message - > From: Roland Scheidegger > > d3d10 has no notion of distinct array resources neither at the resource nor > sampler view level. However, shader dcl of resources certainly has, and > d3d10 expects re

Re: [Mesa-dev] [PATCH] gallivm: set non-existing values really to zero in size queries for d3d10

2013-08-08 Thread Zack Rusin
Looks good. Reviewed-by: Zack Rusin - Original Message - > From: Roland Scheidegger > > My previous attempt at doing so double-failed miserably (minification of > zero still gives one, and even if it would not the value was never written > anyway). > While he

Re: [Mesa-dev] [PATCH 3/3] draw: rewrite primitive assembler

2013-08-08 Thread Zack Rusin
> Series looks good though I'm unsure why the pipeline stage doesn't work. > Where does that decomposition happen? Is that something like GS > outputting multiple prims in the same topology which all need the same id? No, it's because the pipeline stage is ran on the decomposed primitives. The i

Re: [Mesa-dev] [PATCH 3/3] draw: rewrite primitive assembler

2013-08-08 Thread Zack Rusin
> Am 09.08.2013 00:40, schrieb Zack Rusin: > > > Series looks good though I'm unsure why the pipeline stage doesn't work. > >> Where does that decomposition happen? Is that something like GS > >> outputting multiple prims in the same topology which all nee

Re: [Mesa-dev] [RFC]: gallium: add new float comparison opcodes returning integer booleans

2013-08-09 Thread Zack Rusin
- Original Message - > This is a proposal for new comparison instructions, as the old ones > don't really fit modern (graphic or opencl I guess for that matter) > languages well. > If you've got objections, think the naming is crazy or whatnot I'm open > for suggestions :-). I would think t

Re: [Mesa-dev] [PATCH] gallivm: simplify geometry shader mask handling a bit

2013-08-12 Thread Zack Rusin
itional logic to do the unsigned comparisons the cpu can't do). > Saves a couple of instructions in some test geometry shader here. > > v2: that was a bit to much optimization, don't skip combining the masks... k, I think that one looks good. Reviewed-by: Zack Rusin __

Re: [Mesa-dev] [PATCH 2/2] draw: simplify prim mask construction

2013-08-12 Thread Zack Rusin
Looks good. Reviewed-by: Zack Rusin - Original Message - > From: Roland Scheidegger > > The code was quite weird, the second comparison was in fact a complete no-op > and we can also do the comparison with the vector directly instead of scalar, > which should not also b

Re: [Mesa-dev] [PATCH] gallivm: fix exec_mask interaction with geometry shader after end of main

2013-08-12 Thread Zack Rusin
Ah, that looks like a great catch. Reviewed-by: Zack Rusin - Original Message - > From: Roland Scheidegger > > Because we must maintain an exec_mask even if there's currently nothing > on the mask stack, we can still have an exec_mask at the end of the program. &g

Re: [Mesa-dev] [PATCH 3/3] gallivm: implement new float comparison instructions returning integer masks

2013-08-12 Thread Zack Rusin
Nice. The entire series looks good. Reviewed-by: Zack Rusin - Original Message - > From: Roland Scheidegger > > FSEQ/FSGE/FSLT/FSNE work just the same as SEQ/SGE/SLT/SNE except skip the > select. > And just for consistency use the same appropriate ordered/unordered >

[Mesa-dev] [PATCH] draw: make sure that the stages setup outputs

2013-08-12 Thread Zack Rusin
fixes all of the reported piglit failures. Signed-off-by: Zack Rusin --- src/gallium/auxiliary/draw/draw_context.c |2 + src/gallium/auxiliary/draw/draw_pipe.h |5 +- src/gallium/auxiliary/draw/draw_pipe_aaline.c | 27 --- src/gallium/auxiliary

[Mesa-dev] [PATCH] llvmpipe: fix pipeline statistics with a null ps

2013-08-12 Thread Zack Rusin
If the fragment shader is null then pixel shader invocations have to be equal to zero. And if we're running a null ps then clipper invocations and primitives should be equal to zero but only if both stancil and depth testing are disabled. Signed-off-by: Zack Rusin --- src/gallium/dr

[Mesa-dev] [PATCH] llvmpipe: fix pipeline statistics with a null ps

2013-08-14 Thread Zack Rusin
If the fragment shader is null then pixel shader invocations have to be equal to zero. And if we're running a null ps then clipper invocations and primitives should be equal to zero but only if both stancil and depth testing are disabled. Signed-off-by: Zack Rusin --- src/gallium/dr

Re: [Mesa-dev] [PATCH] gallivm: already pass coords in the right place in the sampler interface

2013-08-14 Thread Zack Rusin
I have to admit that I don't know the sampling code, but the patches look good to me. z - Original Message - > From: Roland Scheidegger > > This makes things a bit nicer, and more importantly it fixes an issue > where a "downgraded" array texture (due to view reduced to 1 layer and > a

Re: [Mesa-dev] [PATCH] gallivm: do per-sample depth comparison instead of doing it post-filter

2013-08-14 Thread Zack Rusin
> - lp_build_sample_compare(&bld, newcoords[4], texel_out); > + if (0) > + lp_build_sample_compare(&bld, newcoords[4], texel_out); > } What does this do? The rest looks good to me! Reviewed-by: Zack Rusin

Re: [Mesa-dev] [PATCH] llvmpipe: fix stencil bug if we have both stencil and depth tests

2013-08-15 Thread Zack Rusin
- Original Message - > From: Roland Scheidegger > > This is a very well hidden bug found by accident (only the fixed glean > tstencil2 test so far seems to hit it). > We must use new mask with combined s_pass values and orig_mask values > for zpass/zfail stencil ops, otherwise both the sf

[Mesa-dev] [PATCH] draw: handle nan clipdistance

2013-08-15 Thread Zack Rusin
If clipdistance for one of the vertices is nan (or inf) then the entire primitive should be discarded. Signed-off-by: Zack Rusin --- src/gallium/auxiliary/draw/draw_cliptest_tmp.h |2 +- src/gallium/auxiliary/draw/draw_llvm.c |3 ++ src/gallium/auxiliary/draw/draw_pipe_clip.c

Re: [Mesa-dev] [PATCH] draw: handle nan clipdistance

2013-08-15 Thread Zack Rusin
> I realize this function isn't used but it looks unnecessarily > complicated - two constants one AND plus one comparison when you could > simply do a single comparison (compare x with x with unordered not > equal). This is actually doubly bad with AVX because the int comparison > is going to use 4

Re: [Mesa-dev] [PATCH] draw: fix PIPE_MAX_SAMPLER/PIPE_MAX_SHADER_SAMPLER_VIEWS issues

2013-08-30 Thread Zack Rusin
Looks good. Reviewed-by: Zack Rusin - Original Message - > From: Roland Scheidegger > > pstipple/aaline stages used PIPE_MAX_SAMPLER instead of > PIPE_MAX_SHADER_SAMPLER_VIEWS when dealing with sampler views. > Now these stages can't actually handle sampler_unit !=

Re: [Mesa-dev] [PATCH 3/3] gallivm: handle unbound textures in texture sampling / texture queries

2013-08-30 Thread Zack Rusin
Same here. - Original Message - > Series LGTM. > > Jose > > - Original Message - > > From: Roland Scheidegger > > > > Turns out we don't need to do much extra work for detecting this case, > > since we are guaranteed to get a empty static texture state in this case, > > hence j

[Mesa-dev] [PATCH] gallivm: support indirect registers on both dimensions

2013-09-03 Thread Zack Rusin
We support indirect addressing only on the vertex index, but some shaders also use indirect addressing on attributes. This patch adds support for indirect addressing on both dimensions inside gs arrays. Signed-off-by: Zack Rusin --- src/gallium/auxiliary/draw/draw_llvm.c | 23

Re: [Mesa-dev] [PATCH] Revert "draw: cleanup the extra attribs"

2013-09-04 Thread Zack Rusin
> This reverts commit 57cd3267782fcf92d1e7d772760956516d4367df. > > This fixes piglit regressions with additional draw stages on > llvmpipe, softpipe and i915g. The attributes can't be cleared at > this point because they might be in use by the additional draw > stages. The attributes have to cle

Re: [Mesa-dev] [PATCH 1/3] draw: cleanup the extra attribs

2013-09-04 Thread Zack Rusin
es in case another stage is using them). > Stéphane > On Thu, Aug 8, 2013 at 12:46 PM, Zack Rusin < za...@vmware.com > wrote: > > Before inserting new front face and prim id outputs cleanup > > > the old extra outputs, otherwise our cache will use previous >

Re: [Mesa-dev] [PATCH 3/3] util/u_blit: Implement util_blit_pixels via pipe_context::blit.

2013-09-17 Thread Zack Rusin
The entire series looks good to me. Reviewed-by: Zack Rusin - Original Message - > From: José Fonseca > > This removes a lot of code, but not everything, as util_blit_pixels_tex > is still useful when one needs to override pipe_sampler_view::swizzle_?. > --- > src

[Mesa-dev] [PATCH 1/3] llvmpipe: count c_primitives before discarding null prims

2013-09-19 Thread Zack Rusin
We need to count the clipper primitives before the rasterizer discards one it considers to be null. Signed-off-by: Zack Rusin --- src/gallium/drivers/llvmpipe/lp_setup_tri.c | 13 ++--- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/gallium/drivers/llvmpipe

[Mesa-dev] [PATCH 3/3] llvmpipe: increase number of subpixel bits to eight

2013-09-19 Thread Zack Rusin
make it easier to change once to switch to 64bit rasterization. Signed-off-by: Zack Rusin --- src/gallium/drivers/llvmpipe/lp_rast.h | 12 +++- src/gallium/drivers/llvmpipe/lp_setup.c | 14 +- src/gallium/drivers/llvmpipe/lp_setup_tri.c | 2 +- 3 files changed, 17

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

2013-09-19 Thread Zack Rusin
be emitted. Signed-off-by: Zack Rusin --- src/gallium/auxiliary/draw/draw_pipe_clip.c | 39 + 1 file changed, 39 insertions(+) diff --git a/src/gallium/auxiliary/draw/draw_pipe_clip.c b/src/gallium/auxiliary/draw/draw_pipe_clip.c index 0f90bfd..2d6df81 100644 --- a/s

[Mesa-dev] [PATCH] llvmpipe: align the array used for subdivived vertices

2013-09-23 Thread Zack Rusin
When subdiving a triangle we're using a temporary array to store the new coordinates for the subdivided triangles. Unfortunately the array used for that was not aligned properly causing random crashes in the llvm jit code which was trying to load vectors from it. Signed-off-by: Zack

[Mesa-dev] [PATCH] llvmpipe: we need to subdivide if fb is bigger in either direction

2013-09-24 Thread Zack Rusin
We need to subdivide triangles if either of the dimensions is larger than the max edge length, not when both of them are larger. Signed-off-by: Zack Rusin --- src/gallium/drivers/llvmpipe/lp_setup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gallium/drivers/llvmpipe

[Mesa-dev] [PATCH] DRI2: Don't disable GLX_INTEL_swap_event unconditionally

2013-02-14 Thread Zack Rusin
just disable it for drivers which are known to not support it. It makes sense because most drivers do support it right now. We'll be able to remove this once Xserver properly advertises GLX_INTEL_swap_event. Note: This is a candidate for the 9.0 branch. Signed-off-by: Zack Rusin --- src/g

Re: [Mesa-dev] [PATCH] DRI2: Don't disable GLX_INTEL_swap_event unconditionally

2013-02-15 Thread Zack Rusin
> Seems like we should also fix the server to not advertise the extension > if the driver doesn't have the appropriate hooks implemented. But I > have no problem with doing this on the client side too. I've sent a patch last night to xorg-devel to handle it. But since it's likely to only be inc

Re: [Mesa-dev] [PATCH] DRI2: Don't disable GLX_INTEL_swap_event unconditionally

2013-02-15 Thread Zack Rusin
> Should we also test for the swrast driver? That is actually handled by a hack in the Xserver. http://cgit.freedesktop.org/xorg/xserver/commit/glx?id=988d7ace19a009991a4528e783d1a94c2444c66a The extension was manually removed from the list of extensions that are at all available to the software

[Mesa-dev] [PATCH 0/4] Fix geometry shaders in the draw module

2013-02-28 Thread Zack Rusin
pe have working geometry shaders. Bryan Cain (3): draw/gs: fix allocation of buffer for GS output vertices draw: account for separate shader objects in geometry shader code draw: use geometry shader info in clip_init_state if appropriate Zack Rusin (1): draw/llvm: fix inputs to the geometry shade

[Mesa-dev] [PATCH 1/4] draw/gs: fix allocation of buffer for GS output vertices

2013-02-28 Thread Zack Rusin
From: Bryan Cain Before, it accounted for the size of the vertices but not the other fields in the vertex_header struct, which caused memory corruption. Reviewed-by: Zack Rusin --- src/gallium/auxiliary/draw/draw_gs.c |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a

[Mesa-dev] [PATCH 2/4] draw: account for separate shader objects in geometry shader code

2013-02-28 Thread Zack Rusin
wrong assumptions. This was causing several valid vertex/geometry shader combinations to either render incorrectly or trigger an assertion. Conflicts: src/gallium/auxiliary/draw/draw_gs.c Signed-off-by: Zack Rusin --- src/gallium/auxiliary/draw/draw_gs.c | 31

[Mesa-dev] [PATCH 3/4] draw: use geometry shader info in clip_init_state if appropriate

2013-02-28 Thread Zack Rusin
From: Bryan Cain Reviewed-by: Zack Rusin --- src/gallium/auxiliary/draw/draw_pipe_clip.c | 15 +-- 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/gallium/auxiliary/draw/draw_pipe_clip.c b/src/gallium/auxiliary/draw/draw_pipe_clip.c index 3110809..eeaaf41

[Mesa-dev] [PATCH 4/4] draw/llvm: fix inputs to the geometry shader

2013-02-28 Thread Zack Rusin
We can't clip and viewport transform the vertices before we let the geometry shader process them. Lets make sure the generated vertex shader has both disabled if geometry shader is present. Signed-off-by: Zack Rusin --- src/gallium/auxiliary/draw/draw_llvm.c | 15 ++- 1

[Mesa-dev] [PATCH 1/2] tgsi/exec: Correctly reset NumOutputs before parsing the shader

2013-03-07 Thread Zack Rusin
iously ran shaders and our indexes would get completely messed up. Signed-off-by: Zack Rusin --- src/gallium/auxiliary/tgsi/tgsi_exec.c | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/gallium/auxiliary/tgsi/tgsi_exec.c b/src/gallium/auxiliary/tgsi/tgsi_ex

[Mesa-dev] [PATCH 2/2] draw/gs: Correctly iterate the emitted primitives

2013-03-07 Thread Zack Rusin
We were assuming that each emitted primitive had the same number of vertices. That is incorrect. Emitted primitives can have arbirtrary number of vertices. Simply increment index on iteration to fix it. Signed-off-by: Zack Rusin --- src/gallium/auxiliary/draw/draw_gs.c |8 1 file

[Mesa-dev] [PATCH] draw/so: Fix stream output with geometry shaders

2013-03-12 Thread Zack Rusin
If geometry shader is present its stream output info should be used instead of the vs and we shouldn't use the pre-clipped corrdinates. Signed-off-by: Zack Rusin --- .../draw/draw_pt_fetch_shade_pipeline_llvm.c |2 +- src/gallium/auxiliary/draw/draw_pt_so_emit.c |

Re: [Mesa-dev] [PATCH] DRI2: don't advertise GLX_INTEL_swap_event if it can't

2013-03-12 Thread Zack Rusin
> If ddx does not support swap, don't advertise it.  We might also be > able to get rid of the vmwgfx check (I'm not quite sure the purpose of > that check vs. just checking dri2Minor. No, not really. GLX_INTEL_swap_event doesn't have any hooks. You're checking for presence of generic swap exten

Re: [Mesa-dev] [PATCH] DRI2: don't advertise GLX_INTEL_swap_event if it can't

2013-03-12 Thread Zack Rusin
> well, from what I can tell, if you advertise this extension > applications will expect a swap event. Which will never come if > dri/glx on client side remaps scheduleswap to copyregion. > > So maybe there are other conditions where we should not advertise this > extension. But if we know we w

Re: [Mesa-dev] [PATCH] DRI2: don't advertise GLX_INTEL_swap_event if it can't

2013-03-12 Thread Zack Rusin
> hmm, well, I think my fix is not incorrect.. we can tell from dri2 > proto version that the xserver does not support ScheduleSwap. Maybe > there should be other conditions where we also don't advertise this > extension, but this patch still improves things. If we absolutely > know from the dri2

Re: [Mesa-dev] [PATCH] DRI2: don't advertise GLX_INTEL_swap_event if it can't

2013-03-13 Thread Zack Rusin
> well, I'm more familiar w/ EGL where we don't have the xserver > advertising anything, and it is all on the client side.. but when it > is an inexpensive check, it seems reasonable to want mesa to do the > right thing where possible. It's simply silly. In the same sense that adding yet another

[Mesa-dev] [PATCH 1/6] graw/gs: add missing max output vertices to all tests

2013-03-26 Thread Zack Rusin
A few tests were missing this crucial property. Signed-off-by: Zack Rusin --- src/gallium/tests/graw/geometry-shader/add-mix.txt |1 + src/gallium/tests/graw/geometry-shader/add.txt |1 + src/gallium/tests/graw/geometry-shader/mov-cb-2d.txt |1 + src/gallium/tests/graw

[Mesa-dev] [PATCH 6/6] gallivm: implement breakc and implicit primitive flushing

2013-03-26 Thread Zack Rusin
we were missing implementation of the breakc instruction and our TGSI semantics currently require an implicit endprim at the end of GS if none is present - this implements both. Signed-off-by: Zack Rusin --- src/gallium/auxiliary/gallivm/lp_bld_tgsi.h|6 src/gallium/auxiliary

[Mesa-dev] [PATCH 0/6] Gallivm GS and related cleanups

2013-03-26 Thread Zack Rusin
n the common code so we can push it now. Zack Rusin (6): graw/gs: add missing max output vertices to all tests draw/llvm: Remove unused gs_constants from jit_context draw/gs: Abstract the portions of GS that are tgsi specific draw/gs: Fetch more than one primitive per invocation gallium

[Mesa-dev] [PATCH 2/6] draw/llvm: Remove unused gs_constants from jit_context

2013-03-26 Thread Zack Rusin
The member was never used and we'll need to handle it differently because gs will also need samplers/textures setup. Signed-off-by: Zack Rusin --- src/gallium/auxiliary/draw/draw_llvm.c| 17 +++-- src/gallium/auxiliary/draw/draw_llvm.h|

[Mesa-dev] [PATCH 3/6] draw/gs: Abstract the portions of GS that are tgsi specific

2013-03-26 Thread Zack Rusin
To be able to add llvm paths later on we need to have some common interface for them. Signed-off-by: Zack Rusin --- src/gallium/auxiliary/draw/draw_gs.c | 270 ++ src/gallium/auxiliary/draw/draw_gs.h | 14 ++ 2 files changed, 156 insertions(+), 128 deletions

[Mesa-dev] [PATCH 4/6] draw/gs: Fetch more than one primitive per invocation

2013-03-26 Thread Zack Rusin
Allows executing gs on up to 4 primitives at a time. Will also be required by the llvm code because there we definitely don't want to flush with just a single primitive. Signed-off-by: Zack Rusin --- src/gallium/auxiliary/draw/draw_gs.c | 54 ++ src/ga

[Mesa-dev] [PATCH 0/3] A few fixes for the llvm geometry shaders

2013-03-26 Thread Zack Rusin
A few cleanups, plus fixes for texture sampling for the llvm geometry shaders. This is on top of the previous patchset. Zack Rusin (3): draw: Allocate the output buffer for output primitives draw/llvm: Cleanup the store debugging code llvmpipe/draw: Fix texture sampling in geometry shaders

[Mesa-dev] [PATCH 1/3] draw: Allocate the output buffer for output primitives

2013-03-26 Thread Zack Rusin
We were allocating the output buffer but using the input primitives. We need to allocate that buffer using the maximum number of output, not input, primitives. Signed-off-by: Zack Rusin --- src/gallium/auxiliary/draw/draw_gs.c |3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff

[Mesa-dev] [PATCH 2/3] draw/llvm: Cleanup the store debugging code

2013-03-26 Thread Zack Rusin
Signed-off-by: Zack Rusin --- src/gallium/auxiliary/draw/draw_llvm.c | 13 + 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/gallium/auxiliary/draw/draw_llvm.c b/src/gallium/auxiliary/draw/draw_llvm.c index 1b0b1b9..f857183 100644 --- a/src/gallium/auxiliary

[Mesa-dev] [PATCH 3/3] llvmpipe/draw: Fix texture sampling in geometry shaders

2013-03-26 Thread Zack Rusin
We weren't correctly propagating the samplers and sampler views when they were related to geometry shaders. Signed-off-by: Zack Rusin --- src/gallium/auxiliary/draw/draw_context.c |4 +- src/gallium/auxiliary/draw/draw_llvm.c | 83 --- src/gallium/auxiliary

  1   2   3   4   >