Commit graph

37181 commits

Author SHA1 Message Date
Eric Anholt
2621100458 i965: Fix reversed naming of the operations in compute-to-mrf optimization.
Also fix up comments, so that the difference between the two passes is
clarified.
2010-07-26 13:08:25 -07:00
Eric Anholt
b3ea15f12b i965: Clean up a few magic numbers to use brw_defines.h defs. 2010-07-26 13:08:25 -07:00
Eric Anholt
ca0f4e2c10 i965: Use MIN2, MAX2 instead of rolling our own. 2010-07-26 13:08:25 -07:00
Eric Anholt
9e31adfa46 i965: Fold the "is arithmetic" bit of 965 opcodes into the opcode list. 2010-07-26 13:08:25 -07:00
Eric Anholt
b9c84515a5 i965: Remove some duped register size/count definitions 2010-07-26 13:08:25 -07:00
Eric Anholt
22f839292f i965: Move the GRF-to-MRF optimizations to brw_optimize.c. 2010-07-26 13:08:25 -07:00
Benjamin Segovia
a64def5f2a i965: Improve (i.e. remove) some grf-to-mrf unnecessary moves
Several routines directly analyze the grf-to-mrf moves from the Gen
binary code. When it is possible, the mov is removed and the message
register is directly written in the arithmetic instruction

Also redundant mrf-to-grf moves are removed (frequently for example,
when sampling many textures with the same uv)

Code was tested with piglit, warsow and nexuiz on an Ironlake
machine. No regression was found there

Note that the optimizations are *deactivated* on Gen4 and Gen6 since I
did test them properly yet. No reason there are bugs but who knows

The optimizations are currently done in branch free programs *only*.
Considering branches is more complicated and there are actually two
paths: one for branch free programs and one for programs with branches

Also some other optimizations should be done during the emission
itself but considering that some code is shader between vertex shaders
(AOS) and pixel shaders (SOA) and that we may have branches or not, it
is pretty hard to both factorize the code and have one good set of
strategies
2010-07-26 13:08:25 -07:00
Kristian Høgsberg
e4aa9440d9 glx: Drop debug fprintf that snug in with the previous commit 2010-07-26 16:06:05 -04:00
Kristian Høgsberg
2235b1c72d glx: Enable copy subbuffer patch when GLX_DIRECT_RENDERING is #defined
Depending on __DRI_COPY_SUB_BUFFER doesn't work when we no longer include
dri_interface.h.

https://bugs.freedesktop.org/show_bug.cgi?id=29264
2010-07-26 15:52:45 -04:00
nobled
c88fc26ac9 st/egl: Fix debug line
Acked-by: Jakob Bornecrantz <jakob@vmware.com>
2010-07-26 12:27:21 -07:00
nobled
3cef6c42bc util: fix CPU detection on OS X
s/PIPE_OS_DARWIN/PIPE_OS_APPLE, since there is no PIPE_OS_DARWIN.

Acked-by: Vinson Lee <vlee@vmware.com>
2010-07-26 12:27:01 -07:00
nobled
b1ef3e0863 st/xorg: fix use-after-free
Acked-by: Jakob Bornecrantz <jakob@vmware.com>
2010-07-26 12:26:58 -07:00
Jakob Bornecrantz
0697d41fce i965g: Enable llvm in dri driver if built 2010-07-26 12:26:53 -07:00
nobled
4830237660 i915g: Fix llvm build
Acked-by: Jakob Bornecrantz <jakob@vmware.com>
2010-07-26 12:25:05 -07:00
Kristian Høgsberg
bc34aa6128 glx: Drop duplicate psc field in dri context struct
Same problem as fixed for drisw in 4d58b5b482.
2010-07-26 15:18:56 -04:00
Eric Anholt
941b893032 i965: Allow VS MOVs to use immediate constants.
Clarifies program assembly, and with a little tweak to always use
constant_map, we could cut down on constant buffer payload.
2010-07-26 10:11:31 -07:00
Stephan Schmid
0bebdc230f r600g: implememt the LIT instruction 2010-07-26 10:34:05 -04:00
Marek Olšák
a3a42e4696 util: fix another mutex leak in mempool
By fixing one, I introduced another. Crap.
2010-07-26 14:56:48 +02:00
Marek Olšák
d26fb69169 util: fix mutex leaks in mempool 2010-07-26 14:53:27 +02:00
Dave Airlie
8c26dc2bfe r300g: fix macro substitution problem
isn't a problem yet, but have issues in hiz branch.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-07-26 12:02:14 +10:00
Marek Olšák
6f2936c654 r300g: implement D24X8 texture sampling for r3xx-r4xx
Because the hw can't sample it, I reinterpret the format as G16R16 and
sample the G component. This gives 16 bits of precision, which should be
enough for depth texturing (surprisingly, the sampled values are exactly
the same as in D16 textures).

This also enables EXT_packed_depth_stencil on those old chipsets, finally.
2010-07-25 23:40:51 +02:00
Marek Olšák
451a0ddb19 r300g: make sure a texture is large enough for the CBZB clear
The number of macrotiles in the Y direction must be even, otherwise memory
corruption may happen (e.g. broken fonts). Basically, if we get a buffer
in resource_from_handle, we can determine from the buffer size whether it's
safe to use the CBZB clear or not.
2010-07-25 10:33:09 +02:00
Marek Olšák
49330fc5ac r300g: do not use TXPITCH_EN if the width is POT and the height is NPOT 2010-07-25 10:25:21 +02:00
Marek Olšák
c92d232061 r300g: do not use TXPITCH_EN for power-of-two textures from the DDX
We were using TXPITCH_EN for textures from the DDX since ever, for nothing.
2010-07-25 10:25:21 +02:00
Marek Olšák
d779a5d16a r300g: cleanup texture creation code
This decouples initializing a texture layout/miptree description
from an actual texture creation, it also partially unifies texture_create
and texture_from_handle.

r300_texture inherits r300_texture_desc, which inherits u_resource.

The CBZB clear criteria are moved to r300_texture_desc::cbzb_allowed[level].

And other minor cleanups.
2010-07-25 10:25:21 +02:00
Marek Olšák
065e3f7ff2 r300g: reject resources from handles which are not large enough
The driver gets a buffer and its size in resource_from_handle.
It computes the required minimum buffer size from given texture
properties, and compares the two sizes.

This is to early detect DDX bugs.
2010-07-25 10:25:21 +02:00
Marek Olšák
4ce2621084 r300g: cleanup texture debug logging 2010-07-25 10:25:21 +02:00
Marek Olšák
3adb5c7d45 r300g: do not align texture height to 2^n for 1D and 2D non-mipmapped textures
I don't remember why the alignment was there, but it seems to be
no longer needed. I guess it was a dirty fix for some other bug.
2010-07-25 10:25:21 +02:00
Vinson Lee
5603d2e4c4 nvfx: Move declaration before code. 2010-07-24 21:10:45 -07:00
Kristian Høgsberg
4d58b5b482 glx: Drop duplicate psc field in drisw context struct
Causing a crash in drisw MakeCurrent.
2010-07-24 21:43:25 -04:00
Eric Anholt
af6a2aede6 glx: Fix another case of confusing driContext and dri2_context * 2010-07-23 20:58:12 -07:00
Eric Anholt
566373967a glx: Correctly look up the dri2 context pointer for SetTexBuffer.
gc->driContext points at the second member of the dri2 context.  The
dri2 context is just a subclass of the GLX context.

Fixes piglit tfp testcase.
2010-07-23 20:58:12 -07:00
Kristian Høgsberg
d77bb8e059 glx: Don't destroy context with XID 0
We use XID 0 to indicate the context has already been destroyed, but it's
currently bound.
2010-07-23 22:05:53 -04:00
Kristian Høgsberg
6739d52fdc glx: Fix use after free case when destroying screens 2010-07-23 22:05:53 -04:00
Kristian Høgsberg
6393a33944 glx: zero out drawable structs after allocation 2010-07-23 22:05:53 -04:00
Kristian Høgsberg
6ec39db726 glx: Refactor and simplify context creation
This lets us better separate context creation between the different
backends.
2010-07-23 22:05:53 -04:00
Kristian Høgsberg
b5dedd7c3b glx: Fix indirect screen initialization
https://bugs.freedesktop.org/show_bug.cgi?id=29225
2010-07-23 22:05:53 -04:00
Kristian Høgsberg
c796bb0cc3 glx: Move context destroy to context vtable 2010-07-23 22:05:52 -04:00
Vinson Lee
80b331c7f6 util: Add PIPE_OS_CYGWIN to u_network. 2010-07-23 18:50:04 -07:00
Jerome Glisse
33241134e6 r600g: first pass at texture support
This add texture support to the assembler, generated code is
wrong (tested against working dump).

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-07-23 20:57:21 -04:00
Vinson Lee
ac11bdd831 scons: Add sunos5 to list of accepted platforms. 2010-07-23 17:53:35 -07:00
Vinson Lee
bd27db400a r600g: Fix SCons build. 2010-07-23 17:50:35 -07:00
Vinson Lee
32502b0eeb scons: Use '-Wmissing-field-initializers' on GCC 4.0 and greater only. 2010-07-23 17:24:21 -07:00
Vinson Lee
658fc7539d mesa: Fix Cygwin build with llvm enabled.
On Cygwin locale_t in not available but 'llvm-config --cppflags' adds
the compiler flag -D_GNU_SOURCE to the build.
2010-07-23 16:24:35 -07:00
Christopher James Halse Rogers
1874cb7e82 gallium: Fix build with llvm installed in non-standard location
The es1, es2 and gl state trackers include draw_pipe.h, which includes
the llvm headers if MESA_LLVM is true, so we also need to add the
llvm seachpaths.

Similarly, gallivm and other gallium drivers need LLVM_CFLAGS to build when enabled.

Also fix xorg drivers, they didn't include LDFLAGS.
2010-07-23 23:38:07 +01:00
Jerome Glisse
cf864fd58b r600g: fix dp2, dp3, dp4 tokens
We need to make sure dp are all mirror accross the alu unit.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-07-23 18:19:13 -04:00
Jerome Glisse
5cc2974dff r600g: add RSQ token support
Could serve as an example on how to add more token
support.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-07-23 17:49:26 -04:00
Jerome Glisse
de553d906b r600g: drop compiler stuff and switch over dumb tgsi assembler
Writing a compiler is time consuming and error prone in
order to allow r600g to further progress in the meantime
i wrote a simple tgsi assembler, it does stupid thing but
i would rather keep the code simple than having people
trying to optimize code it does.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-07-23 17:35:36 -04:00
Eric Anholt
9a12a3925a glx: Don't try to swap a front buffer if we don't have one.
Fixes glean glsl1 since 7b7845a076
2010-07-23 13:59:22 -07:00
Brian Paul
a2eb8bdcc7 st/mesa: get rid of unneeded ureg_writemask() 2010-07-23 13:50:09 -06:00