Commit Graph

40350 Commits

Author SHA1 Message Date
Keith Whitwell ffab84c9a2 llvmpipe: check shader outputs are non-null before using 2010-10-15 14:49:13 +01:00
Vinson Lee a14376218e mesa: Add missing header to shaderobj.h.
Include compiler.h for ASSERT symbol.
2010-10-15 06:13:18 -07:00
Keith Whitwell 39185efd3a llvmpipe: fix non-sse build after recent changes 2010-10-15 14:11:22 +01:00
Keith Whitwell 392b0954c2 llvmpipe: use aligned loads/stores for plane values 2010-10-15 13:52:00 +01:00
Keith Whitwell 9f9a17eba8 llvmpipe: do plane calculations with intrinsics
This is a step towards moving this code into the rasterizer.
2010-10-15 13:38:06 +01:00
Keith Whitwell 15f4e3a8b9 gallium: move some intrinsics helpers to u_sse.h 2010-10-15 13:29:56 +01:00
Keith Whitwell 8965f042b3 llvmpipe: don't store plane.ei value in binned data
Further reduce the size of a binned triangle.
2010-10-15 13:27:47 +01:00
Keith Whitwell 9bf8a55c4b llvmpipe: slightly shrink the size of a binned triangle 2010-10-15 13:27:47 +01:00
Keith Whitwell 0a1c900103 llvmpipe: don't pass frontfacing as a float 2010-10-15 13:27:47 +01:00
Keith Whitwell 4195febeec llvmpipe: reintroduce SET_STATE binner command
But bin lazily only into bins which are receiving geometry.
2010-10-15 13:27:47 +01:00
Chad Versace e2c1fe3eb0 glsl: Fix ir validation for bit logic ops
In ir_validate::visit_leave(), the cases for
    - ir_binop_bit_and
    - ir_binop_bit_xor
    - ir_binop_bit_or
were incorrect. It was incorrectly asserted that both operands must be the
same type, when in fact one may be scalar and the other a vector. It was also
incorrectly asserted that the resultant type was the type of the left operand,
which in fact does not hold when the left operand is a scalar and the right
operand is a vector.
2010-10-15 00:20:18 -07:00
Chad Versace 4761d0d22b glsl: Implement constant expr evaluation for bitwise logic ops
Implement by adding the following cases to
ir_exporession::constant_expression_value():
    - ir_binop_bit_and
    - ir_binop_bit_or
    - ir_binop_bit_xor
2010-10-15 00:20:18 -07:00
Chad Versace adea8150a7 glsl: Implement constant expr evaluation for bit-shift ops
Implement by adding the following cases to
ir_expression::constant_expression_value():
    - ir_binop_lshfit
    - ir_binop_rshfit
2010-10-15 00:20:18 -07:00
Chad Versace 90a8b792c0 glsl: Implement constant expr evaluation for bitwise-not
Implement by adding a case to ir_expression::constant_expression_value()
for ir_unop_bit_not.
2010-10-15 00:20:18 -07:00
Chad Versace 5c4c36f7f3 glsl: Implement ast-to-hir for binary shifts in GLSL 1.30
Implement by adding the following cases to ast_expression::hir():
    - ast_lshift
    - ast_rshift
Also, implement ir validation for the new operators by adding the following
cases to ir_validate::visit_leave():
    - ir_binop_lshift
    - ir_binop_rshift
2010-10-15 00:20:18 -07:00
Chad Versace f88b4eaa8f glsl: Change generated file glsl_lexer.cpp 2010-10-15 00:20:18 -07:00
Chad Versace 7abdc71afa glsl: Add lexer rules for << and >> in GLSL 1.30
Commit for generated file glsl_lexer.cpp follows this commit.
2010-10-15 00:20:18 -07:00
Dave Airlie fc6caef4cb r600g: evergreen interpolation support.
On evergreen, interpolation has moved into the fragment shader,
with the interpolation parmaters being passed via GPRs and LDS entries.

This works out the number of interps required and reserves GPR/LDS
storage for them, it also correctly routes face/position values which
aren't interpolated from the vertex shader.

Also if we noticed nothing is to be interpolated we always setup perspective
interpolation for one value otherwise the GPU appears to lockup.

This fixes about 15 piglit tests on evergreen.
2010-10-15 14:59:17 +10:00
Dave Airlie 07a30e3d18 tgsi: add scanner support for centroid inputs 2010-10-15 14:59:17 +10:00
Ian Romanick 3322fbaf3b glsl: Slightly change the semantic of _LinkedShaders
Previously _LinkedShaders was a compact array of the linked shaders
for each shader stage.  Now it is arranged such that each slot,
indexed by the MESA_SHADER_* defines, refers to a specific shader
stage.  As a result, some slots will be NULL.  This makes things a
little more complex in the linker, but it simplifies things in other
places.

As a side effect _NumLinkedShaders is removed.

NOTE: This may be a candidate for the 7.9 branch.  If there are other
patches that get backported to 7.9 that use _LinkedShader, this patch
should be cherry picked also.
2010-10-14 17:16:59 -07:00
Eric Anholt 4b4284c9c9 i965: Fix texturing on pre-gen5.
I broke it in 06fd639c51 by only testing
2 generations of hardware :(
2010-10-14 17:13:19 -07:00
Brian Paul 3d7479d705 llvmpipe: code to dump bytecode to file (disabled) 2010-10-14 17:28:24 -06:00
Brian Paul 62450b3c49 gallivm: add compile-time option to emit inst addrs and/or line numbers
Disabling address printing is helpful for diffing.
2010-10-14 17:28:24 -06:00
Brian Paul 8fb49554d9 mesa: remove post-convolution width/height vars
These were left-over bits from when convolution was removed.
2010-10-14 17:28:24 -06:00
Kenneth Graunke 2bc704d543 glsl: Refresh autogenerated file builtin_function.cpp. 2010-10-14 15:59:47 -07:00
Kenneth Graunke 27ced5c5ff glsl: Add support for the 1.30 round() built-in.
This implements round() via the ir_unop_round_even opcode, rather than
adding a new opcode.  We may wish to add one in the future, since it
might enable a small performance increase on some hardware, but for now,
this should suffice.
2010-10-14 15:59:47 -07:00
Kenneth Graunke f157812bbb i965: Add support for ir_unop_round_even via the RNDE instruction. 2010-10-14 15:59:47 -07:00
Kenneth Graunke 6dc204c5dc glsl: Add front-end support for GLSL 1.30's roundEven built-in.
Implemented using the op-code introduced in the previous commit.
2010-10-14 15:59:47 -07:00
Kenneth Graunke d85d25dd1f glsl: Add a new ir_unop_round_even opcode for GLSL 1.30's roundEven.
Also, update ir_to_mesa's "1.30 is unsupported" case to "handle" it.
2010-10-14 15:59:47 -07:00
Dave Airlie 510c503762 r300g: clean up warning due to unknown cap. 2010-10-15 08:46:16 +10:00
Keith Whitwell 8260ab9346 r600g: handle absolute modifier in shader translator
This was being classed as unsupported in one place but used in others.
Enabling it seems to work fine.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-10-15 08:33:50 +10:00
Keith Whitwell c28f764572 r600g: emit hardware linewidth
Tested with demos/pixeltest - line rasterization doesn't seem to be
set up for GL conventions yet, but at least width is respected now.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-10-15 08:33:25 +10:00
Keith Whitwell cbf2fb5543 r600/drm: fix segfaults in winsys create failure path
Would try to destroy radeon->cman, radeon->kman both which were still
NULL.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-10-15 08:33:00 +10:00
Hui Qi Tay 26ff7523b6 draw: sanitize llvm variant key
Fixes recompilation, but seems to be broken with llvm 2.8.
2010-10-14 22:34:10 +01:00
Kenneth Graunke 4bab22bca3 i965: Clean up a warning in the old fragment backend.
Hopefully this code can just go away soon.
2010-10-14 13:19:23 -07:00
Eric Anholt a81d423d93 i965: Enable the new FS backend on pre-gen6 as well.
It is now to the point where we have no regressing piglit tests.  It
also fixes Yo Frankie! and Humus DynamicBranching, probably due to the
piglit bias tests that work that didn't on the Mesa IR backend.

As a downside, performance takes about a 5-10% performance hit at the
moment (e.g. nexuiz 19.8fps -> 18.8fps), which I plan to resolve by
reintroducing 16-wide fragment shaders where possible.  It is a win,
though, for fragment shaders using flow control.
2010-10-14 12:40:50 -07:00
Kenneth Graunke 897f6d3c7d i965: Correctly emit the RNDZ instruction.
Simply using RNDU, RNDZ, or RNDE does not produce the desired result.
Rather, the RND* instructions place a value in the destination register
that may be 1 less than the correct answer.  They can also set per-channel
"increment bits" in a flag register, which, if set, mean dest needs to
be incremented by 1.  A second instruction - a predicated add -
completes the job.

Notably, RNDD always produces the correct answer in a single
instruction.

Fixes piglit test glsl-fs-trunc.
2010-10-14 12:40:16 -07:00
Kenneth Graunke f541b685aa i965: Use RNDZ for ir_unop_trunc in the new FS.
The existing code used RNDD, which rounds down, rather than toward zero.
2010-10-14 12:40:16 -07:00
Kenneth Graunke f9bd4c6c26 glsl: Refresh autogenerated file builtin_function.cpp. 2010-10-14 12:40:16 -07:00
Kenneth Graunke 090dd4fcc5 glsl: Add front-end support for the "trunc" built-in. 2010-10-14 12:40:16 -07:00
Kenneth Graunke c4226142f3 i965: Use logical-not when emitting ir_unop_ceil.
Fixes piglit test glsl-fs-ceil.
2010-10-14 12:40:16 -07:00
Eric Anholt 5dd07b442e i965: Add peepholing of conditional mod generation from expressions.
This cuts usually 2 out of 3 instructions for flag reg generation (if
statements, conditional assignment) by producing the conditional mod
in the expression representing the boolean value.

Fixes glsl-fs-vec4-indexing-temp-dst-in-nested-loop-combined (register
allocation no longer fails for the conditional generation
proliferation)
2010-10-14 12:02:54 -07:00
Eric Anholt d5599c0b6a i965: Add a function for handling the move of boolean values to flag regs.
This will be a place to peephole comparisions directly to the flag
regs, and for now avoids using MOV with conditional mod on gen6, which
is now illegal.
2010-10-14 12:02:54 -07:00
Kristian Høgsberg 1d33e940d2 Only install vtxfmt tables for OpenGL
GLES1 and GLES2 install their own exec pointers and don't need the
Save table.  Also, the SET_* macros use different indices for the different
APIs so the offsets used in vtxfmt.c are actually wrong for the ES APIs.
2010-10-14 15:00:22 -04:00
Eric Anholt 4f88550ba0 i965: Add a pass to the FS to split virtual GRFs to float channels.
Improves nexuiz performance 0.91% (+/- 0.54%, n=8)
2010-10-14 10:42:55 -07:00
Eric Anholt b8613d70da i965: Update the live interval when coalescing regs. 2010-10-14 10:42:55 -07:00
Eric Anholt 0c6752026c i965: Set class_sizes[] for the aligned reg pair class.
So far, I've only seen this be a valgrind warning and not a real failure.
2010-10-14 10:42:55 -07:00
Keith Whitwell f0bd76f28d llvmpipe: don't try to emit non-existent color outputs 2010-10-14 14:08:20 +01:00
Kristian Høgsberg 81ccb3e2ce Drop the "neutral" tnl module
Just always check for FLUSH_UPDATE_CURRENT and call Driver.BeginVertices
when necessary.  By using the unlikely() macros, this ends up as
a 10% performance improvement (for isosurf, anyway) over the old,
complicated function pointer swapping.
2010-10-14 08:53:59 -04:00
Chia-I Wu d6de1f44a0 st/egl: Do not finish a fence that is NULL.
i915g would dereference the NULL pointer.
2010-10-14 17:16:14 +08:00