Commit graph

40322 commits

Author SHA1 Message Date
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
Eric Anholt
af3c9803d8 i965: Start adding the VS visitor and codegen.
The low-level IR is a mashup of brw_fs.cpp and ir_to_mesa.cpp.  It's
currently controlled by the INTEL_NEW_VS=1 environment variable, and
only tested for the trivial "gl_Position = gl_Vertex;" shader so far.
2011-08-16 13:04:41 -07:00
Eric Anholt
65b5cbbcf7 i965: Rename math FS_OPCODE_* to SHADER_OPCODE_*.
I want to just use the same enums in the VS.
2011-08-16 13:04:41 -07:00
Eric Anholt
6034b9a512 i965: Create a shared enum for hardware and compiler-internal opcodes.
This should make gdbing more pleasant, and it might be used in sharing
part of the codegen between the VS and FS backends.
2011-08-16 13:04:41 -07:00
Eric Anholt
c1f00731fd i965: Generate driver-specific IR for non-fragment shaders as well.
This will be used by the new vertex shader backend.  The scalarizing
passes are skipped for non-fragment, since vertex and geometry threads
are based on vec4s.
2011-08-16 13:04:41 -07:00
Brian Paul
11e4ea0010 mesa: ChooseTextureFormat() returns gl_format, not GLuint 2011-08-16 13:05:34 -06:00
Paul Berry
af501e2b29 glsl: Fix type error when lowering integer divisions
This patch fixes a bug when lowering an integer division:

  x/y

to a multiplication by a reciprocal:

  int(float(x)*reciprocal(float(y)))

If x was a plain int and y was an ivecN, the lowering pass
incorrectly assigned the type of the product to be float, when in fact
it should be vecN.  This caused mesa to abort with an IR validation
error.

Fixes piglit tests {fs,vs}-op-div-int-ivec{2,3,4}.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-08-16 11:00:46 -07:00
Marek Olšák
9e8f556b19 softpipe: fix an obvious copy-paste error in get_query_result
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-08-16 19:56:29 +02:00
Marek Olšák
5e7713caa9 st/dri: remove an unused-but-set variable 2011-08-16 19:39:59 +02:00
Marek Olšák
4a47662bea r600g: rename bc -> bytecode
It took me a while to figure out what it stands for.
2011-08-16 19:39:59 +02:00
Benjamin Franzke
61d2dfbe48 egl: Add include paths for platform autodetection
Needed since commit 85fe9484.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=40145
2011-08-16 19:28:07 +02:00
Cooper Yuan
f272117def dri2: check if context is valid before flushing the pipe 2011-08-16 20:37:13 +08:00
Marek Olšák
e3be513118 r600g: expose ARB_ES2_compatibility by claiming fixed-point format support
I also needed to make some changes in u_vbuf_mgr in order to override
the caps from the driver and enable the fallback even though the driver
claims the format is supported.
2011-08-16 09:15:11 +02:00
Marek Olšák
21c5d11b7e noop: redirect the get_param/is_format.. queries to the underlying driver 2011-08-16 09:15:11 +02:00
Marek Olšák
363295d720 u_blitter: restore some states conditionally 2011-08-16 09:15:11 +02:00
Marek Olšák
233dd4953e u_blitter: rename util_blitter_copy_region -> util_blitter_copy_texture 2011-08-16 09:15:11 +02:00
Marek Olšák
a77431b3b0 r600g: consolidate two files r600d.h 2011-08-16 09:15:11 +02:00
Marek Olšák
47dcfb8dab r600g: set read/write usage flags for each relocation
This takes advantage of the new GEM_WAIT ioctl when mapping buffers.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2011-08-16 09:15:11 +02:00
Marek Olšák
ebfcc58b93 winsys/radeon: take advantage of the new ioctl
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2011-08-16 09:15:11 +02:00
Marek Olšák
1e3c81a068 winsys/radeon: hook up the new DRM_RADEON_GEM_WAIT ioctl
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2011-08-16 09:15:11 +02:00
Marek Olšák
296b899095 winsys/radeon: remove broken bo-is-busy-for-write guessing
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2011-08-16 09:15:11 +02:00
Marek Olšák
c79e9f0ed5 r600g: enable thread offloading
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2011-08-16 09:15:11 +02:00