Commit Graph

45988 Commits

Author SHA1 Message Date
Eric Anholt feff7c62ce i965/vs: Fix condition code for scalar expression all_equals.
Fixes vs-op-eq-bool-bool.
2011-08-16 13:04:43 -07:00
Eric Anholt 8a649277cb i965/vs: Don't assertion fail on vertex texturing.
The linker will reject the program, but we need to survive until then.
Fixes abort in glsl1-2D Texture lookup with explicit lod (Vertex
shader)
2011-08-16 13:04:43 -07:00
Eric Anholt d0c595ac80 i965/gen6: Force WHILE exec size to 8.
We can't just look at the instruction that happens to appear at the
start of the loop, because it might be some other exec size and cause
us to only loop on the first N channels.  We always want 8 in our
current code (since 16 doesn't work so we don't do 16-wide fragment in
that case).

Fixes loop-03.vert, which was triggering the assertions.
2011-08-16 13:04:43 -07:00
Eric Anholt 905f3d0309 i965/vs: Remove remaining use of foreach_iter. 2011-08-16 13:04:43 -07:00
Eric Anholt 54e66a0a63 i965/vs: Fix abs/negate handling on attributes.
Fixes glsl-vs-neg-attribute and glsl-vs-abs-attribute.
2011-08-16 13:04:43 -07:00
Eric Anholt 7642c1de6b i965/vs: Avoid generating a MOV for most ir_assignment handling.
Removes an average of 11.5% of instructions in 54% of vertex shaders
in shader-db.
2011-08-16 13:04:43 -07:00
Eric Anholt 7fbe7fe133 i965/vs: Run the shader backend at link time and return compile failures.
Link failure is something that shouldn't happen, but we sometimes want
it during development.  The precompile also allows analysis of shader
codegen with shader-db.
2011-08-16 13:04:43 -07:00
Eric Anholt d376fa8e84 i965: Fix assertion failure on a loop consisting of while (true) { break }.
On enabling the precompile step in the VS, we tripped over this
assertion failure in glsl-link-bug-30552.
2011-08-16 13:04:43 -07:00
Eric Anholt e8980c61b2 i965/vs: Fix the trivial register allocator's failure path. 2011-08-16 13:04:43 -07:00
Eric Anholt 193a9a209d i965/vs: Add support for if(any(bvec)) on gen6. 2011-08-16 13:04:43 -07:00
Eric Anholt 072d64121e i965/vs: Add support for GL_FIXED attributes.
Fixes arb_es2_compatibility-fixed-type
2011-08-16 13:04:43 -07:00
Eric Anholt aed5e353e9 i965/vs: Clamp vertex color outputs when required by ARB_color_buffer_float.
Fixes glsl-vs-vertex-color.
2011-08-16 13:04:43 -07:00
Eric Anholt a55fbbc1a2 i965/vs: Fix access of attribute arrays.
By leaving out the column index, we were reading an unallocated
attribute on glsl-mat-attribute.
2011-08-16 13:04:43 -07:00
Eric Anholt fea7d34b35 i965/vs: Fix builtin uniform setup.
I want to intelligently pack them at some point, but for now we have
the params set up in groups of 4.  Fixes glsl-vs-normalscale.
2011-08-16 13:04:43 -07:00
Eric Anholt 0b359e3ea0 i965/vs: Add support for loops.
This is copied from brw_fs.cpp, instead of doing the temporary IR
generation that ir_to_mesa does.  Fixes glsl-vs-loop and friends.
2011-08-16 13:04:43 -07:00
Eric Anholt abf843a797 i965/vs: Add support for ir_binop_pow.
Fixes vs-pow-float-float.
2011-08-16 13:04:43 -07:00
Eric Anholt 250770b74d i965/vs: Respect the gen6 limitation that math opcodes can't be align16.
Fixes vs-acos-vec3 and friends.
2011-08-16 13:04:43 -07:00
Eric Anholt 6408b0295f i965/vs: Fix implementation of ir_unop_any.
We were inheriting whatever previous predicate existed.
2011-08-16 13:04:42 -07:00
Eric Anholt 7b91eefe7c i965/vs: Slightly improve the trivial reg allocator to skip unused regs.
This fixes most of the regressions in the vs array test set from the
varying array indexing work, since the giant array that was originally
allocated in virtual GRF space never gets used and is only ever
read/stored from scratch space.
2011-08-16 13:04:42 -07:00
Eric Anholt e94bdbe04a i965: Add gen6 disassembly for DP render cache messages. 2011-08-16 13:04:42 -07:00
Eric Anholt 54fa706d6f i965/vs: Enable variable array indexing in the VS. 2011-08-16 13:04:42 -07:00
Eric Anholt 584ff40748 i965/vs: Add support for scratch read/write codegen. 2011-08-16 13:04:42 -07:00
Eric Anholt 0f22f98ccd i965: Make some EU emit code for DP read/write messages non-static.
We keep building these strange interfaces for DP read/write where
there's a helper function with some partially-specific,
partially-general controls, which is used in exactly one place in code
generation.  Making these public will let us set up those instructions
in the one place they're to be generated.
2011-08-16 13:04:42 -07:00
Eric Anholt d0e4d71070 i965/vs: Move virtual GRFs with array accesses to them to scratch space. 2011-08-16 13:04:42 -07:00
Eric Anholt 758c3c2b45 i965/vs: Reserve MRF 14/15 for array loads/register unspilling. 2011-08-16 13:04:42 -07:00
Eric Anholt 1ff4f11dd9 i965/vs: Track the variable index of array accesses.
This isn't used currently, as we lower all array accesses.
2011-08-16 13:04:42 -07:00
Eric Anholt 314c2574ff i965: Add remaining scratch space setup emit to unit states. 2011-08-16 13:04:42 -07:00
Eric Anholt 2b224d66a0 i965: Set up allocation of a VS scratch space if required. 2011-08-16 13:04:42 -07:00
Eric Anholt e355b179b2 i965: Remove dead brw->wm.max_threads field. 2011-08-16 13:04:42 -07:00
Eric Anholt 160a5a3ff0 i965/vs: Add support for VUEs larger than a single URB write.
Fixes glsl-max-varyings.
2011-08-16 13:04:42 -07:00
Eric Anholt 31ef2e3ec2 i965/vs: Avoid generating extra moves when setting up large ir_constants.
We were also screwing up the types in the process, and just not
emitting moves was easier.
2011-08-16 13:04:42 -07:00
Eric Anholt aba9801996 i965/vs: Fix types of varying outputs.
For structs/arrays/matrices, they were ending up as uint because we
forgot to set them.  All varyings in GLSL 1.20 are of base type float,
so just force the matter here (which gets inherited at
emit_urb_writes() time).

Fixes vs-varying-array-mat2-col-rd.
2011-08-16 13:04:42 -07:00
Eric Anholt 9790726131 i965/vs: Handle assignment of structures/arrays/matrices better.
This gets the right types on the instructions, as well as emitting
minimal swizzles/writemasks.
2011-08-16 13:04:42 -07:00
Eric Anholt 930afd1774 i965/vs: Don't forget to set up assignment condition code for arrays/structs.
Fixes vs-uniform-array-mat2-index-col-rd.
2011-08-16 13:04:42 -07:00
Eric Anholt cda28bca0d i965/vs: Apply the gen6 math workaround for math1 instructions.
Fixes glsl-vs-masked-cos.
2011-08-16 13:04:42 -07:00
Eric Anholt 2b7632aeaa i965/vs: Add support for if(any_nequal()) and if(all_equal()) on gen6.
Fixes vs-temp-array-mat2-col-rd.shader_test.
2011-08-16 13:04:42 -07:00
Eric Anholt c3752b399a i965/vs: Add support for dot product opcodes.
Fixes glsl-vs-dot-vec2.
2011-08-16 13:04:42 -07:00
Eric Anholt 8e947c2546 i965/vs: Fix the types of array/struct dereferences.
Fixes glsl-vs-arrays-3.
2011-08-16 13:04:42 -07:00
Eric Anholt 814a9bef30 i965/vs: Drop the assertion about dst.reg_offset == 0.
Adding the offset is the right thing to do here, and fixes
glsl-vs-mat-add-1.
2011-08-16 13:04:42 -07:00
Eric Anholt e5363c7fd2 i965/vs: Use an appropriate swizzle on src regs from variables.
Fixes glsl-vs-if-bool.
2011-08-16 13:04:42 -07:00
Eric Anholt eca762d831 i965/vs: Fix support for zero uniforms in use.
We were looking for attributes in the wrong place, and pointlessly
doing the work on gen6 at all.
2011-08-16 13:04:42 -07:00
Eric Anholt 164ccd2778 i965/vs: Fix support for "IF" instructions by copying brw_fs_visitor.cpp.
Fixes glsl-vs-if-greater.
2011-08-16 13:04:41 -07:00
Eric Anholt aa753c5a14 i965/vs: Disable loops for now until rendering is generally correct. 2011-08-16 13:04:41 -07:00
Eric Anholt bb468fc1ed i965/vs: Fix ir_swizzle handling.
I decided to refactor it a bit in adapting ir_to_mesa.cpp code, and
mangled it.  Fixes glsl-vs-cross-2.
2011-08-16 13:04:41 -07:00
Eric Anholt 78fac1892a i965/vs: Allocate storage for "auto" variables just like temps.
Fixes segfault in glsl-vs-cross-2.
2011-08-16 13:04:41 -07:00
Eric Anholt 82aa9299fb i965/vs: Allow scalar values in assignments, too.
Fixes glsl-vs-all-02 and many other tests.
2011-08-16 13:04:41 -07:00
Eric Anholt c0f334a3ed i965/vs: Don't emit an extra copy of the vertex position.
Fixes glsl-vs-abs-neg, glsl-vs-all-01, and probably many other tests.
2011-08-16 13:04:41 -07:00
Eric Anholt 4a4857246c i965/vs: Port the fix for clip plane writemasks from brw_vs_emit.c. 2011-08-16 13:04:41 -07:00
Eric Anholt 83d5850518 i965/vs: Fix constant vector construction.
Fixes some issues noticed in glsl-vs-all-01.
2011-08-16 13:04:41 -07:00
Eric Anholt a070d5f363 i965/vs: Start adding support for uniforms
There's no clever packing here, no pull constants, and no array support.
2011-08-16 13:04:41 -07:00