Commit Graph

36440 Commits

Author SHA1 Message Date
Chia-I Wu c17d4999f1 mapi: Clean up u_current interface.
Try not to use macros to make u_current.h appear to be glapi.h.  Use
u_current.h to implement glapi.h instead whenever possible.
2010-12-18 15:05:52 +08:00
Chia-I Wu c7119e281b mapi: Add ABI-tag note.
TLS requires kernel >= 2.4.20.  Per glapi.
2010-12-18 14:46:10 +08:00
Kenneth Graunke a954dbeb8c Refresh autogenerated file builtin_function.cpp.
NOTE: The 7.9 and 7.10 branches will need their builtins refreshed too.
Rather than cherry-picking this commit, run 'make builtins'.
2010-12-17 19:40:56 -08:00
Kenneth Graunke d7423a6531 glsl/builtins: Compute the correct value for smoothstep(vec, vec, vec).
These mistakenly computed 't' instead of t * t * (3.0 - 2.0 * t).

Also, properly vectorize the smoothstep(float, float, vec) variants.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
2010-12-17 19:29:22 -08:00
José Fonseca 3f94d96fce gallivm: Cleanup util_format_xxx_fetch_xxx call generation.
No need to register function prototypes in the module now that we call
the C function pointer directly -- less LLVM objects lying around.

Limited testing with lp_test_format.
2010-12-17 20:14:31 +00:00
Kenneth Graunke 5c229e5fbd glsl: Expose a public glsl_type::void_type const pointer.
This is analogous to glsl_type::int_type and all the others.
2010-12-17 10:55:17 -08:00
Marek Olšák daffaca53e r300g: finally fix the texture corruption on r3xx-r4xx
Even though a bound texture stays bound when calling set_fragment_sampler_views,
it must be assigned a new cache region depending on the occupancy of other
texture units.

This fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=28800

Thanks to Álmos <aaalmosss@gmail.com> for finding the bug in the code.

NOTE: This is a candidate for both the 7.9 and 7.10 branches.
2010-12-17 13:17:52 +01:00
Kenneth Graunke d0f8eea9a0 Remove OES_compressed_paletted_texture from the ES2 extension list.
We don't support it.
2010-12-16 17:40:50 -08:00
Brian Paul 42a0967a36 softpipe: remove sp_tex_tile_cache_border_color()
With swizzling done at the end of texture sampling, we can greatly
simplify swizzling of the border color.

Fixes http://bugs.freedesktop.org/show_bug.cgi?id=32460
2010-12-16 18:18:57 -07:00
Brian Paul 9d9f8aba0a softpipe: fix depth texture sampling regression
We need to keep using the pipe_get_tile_swizzle() even though there's
no swizzling because we need to explicitly pass in the surface format.

Fixes http://bugs.freedesktop.org/show_bug.cgi?id=32459
2010-12-16 17:40:09 -07:00
Brian Paul 3ecf47af12 gallivm: fix copy&paste error from previous commit
Fixes piglit regression, http://bugs.freedesktop.org/show_bug.cgi?id=32452

NOTE: This is a candidate for the 7.10 branch
2010-12-16 14:30:39 -07:00
richard fcc7024afe r600c : inline vertex format is not updated in an app, switch to use vfetch constants. For the 7.9 and 7.10 branches as well. 2010-12-16 15:52:55 -05:00
Eric Anholt 290a1141bc intel: Support glCopyTexImage() from XRGB8888 to ARGB8888.
The only mismatch between the two is that we have to clear the
destination's alpha to 1.0.  Fixes WOW performance on my Ironlake,
from a few frames a second to almost playable.
2010-12-16 10:48:19 -08:00
Eric Anholt ec03b316b4 intel: Try to sanely check that formats match for CopyTexImage.
Before, we were going off of a couple of known (hopeful) matches
between internalFormats and the cpp of the read buffer.  Instead, we
can now just look at the gl_format of the two to see if they match.
We should avoid bad blits that might have been possible before, but
also allow different internalFormats to work without having to
enumerate each one.
2010-12-16 10:48:19 -08:00
Eric Anholt e65c643792 intel: Drop commented intel_flush from copy_teximage.
The blit that follows appears in the command stream so it's serialized
with previous rendering.  Any queued vertices in the tnl layer were
already flushed up in mesa/main/.
2010-12-16 10:48:19 -08:00
Eric Anholt 99c7840b0c intel: Update renderbuffers before looking up CopyTexImage's read buffer.
Not fixing a particular bug, just noticed by code inspection.
2010-12-16 10:48:19 -08:00
Brian Paul ee16e97ed1 gallivm: work around LLVM 2.6 bug when calling C functions
Create a constant int pointer to the C function, then cast it to the
function's type.  This avoids using trampoline code which seem to be
inadvertantly freed by LLVM in some situations (which leads to segfaults).
The root issue and work-around were found by José.

NOTE: This is a candidate for the 7.10 branch
2010-12-16 10:19:16 -07:00
Brian Paul b7e150605d draw: s/varient/variant/ 2010-12-16 10:18:24 -07:00
Brian Paul 2bd9b386e6 svga: s/varient/variant/ 2010-12-16 10:18:24 -07:00
Brian Paul bd75e4b8be i965g: s/varient/variant/ 2010-12-16 10:18:24 -07:00
Brian Paul a185d439bd i915g: s/varient/variant/ 2010-12-16 10:18:24 -07:00
Brian Paul f3955f6fcd softpipe: s/varient/variant 2010-12-16 10:18:23 -07:00
Brian Paul aa5ba96d29 st/mesa: s/varient/variant 2010-12-16 10:18:23 -07:00
Eric Anholt c52adfc2e1 i965: Set the alternative floating point mode on gen6 VS and WM.
This matches how we did the math instructions pre-gen6, though it
applies to non-math as well.

Fixes vp1-LIT test 2 (degenerate case: 0 ^ 0 -> 1)
2010-12-16 09:01:14 -08:00
Shuang He 2bd11ea119 i915: Fix INTEL_DEBUG=wm segmentation fault
The program should be disassembled after it's uploaded
2010-12-16 09:01:14 -08:00
Jakob Bornecrantz 23aa3c552c svga, glhd: Remove incorrect assert and add note
Stride can be lower then the size of the attribute.
But should probably be aligned to component size atleast for floats.
2010-12-16 09:44:02 +01:00
Jakob Bornecrantz 1138775d79 svga: Minor debug text fix 2010-12-16 09:44:02 +01:00
Jakob Bornecrantz c28debbf6f svga: Remove debug print in winsys 2010-12-16 09:44:02 +01:00
Jakob Bornecrantz 486da2cfc0 svga: Correct spelling in swtnl backend 2010-12-16 09:44:01 +01:00
Jakob Bornecrantz d7ff6dd09c svga: Fix newline at EOF 2010-12-16 09:36:51 +01:00
Jakob Bornecrantz f75549a9d8 svga: Add Galahad and Softpipe to scons build 2010-12-16 08:53:26 +01:00
Jakob Bornecrantz 0967d77a9a wrapper: Flush pipe on unmap
For drivers that does DMA transfers instead of mapping directly
2010-12-16 08:53:26 +01:00
Jakob Bornecrantz 8b60bf4e9f wrapper: Fix width and height given to map and remove uneeded fields 2010-12-16 08:53:26 +01:00
Jakob Bornecrantz b7a73c72a6 i915g: Ignore color0 writes all cbufs tgsi property 2010-12-27 00:18:55 +01:00
Chia-I Wu 9f2062fb12 st/egl: Fix eglChooseConfig when configs is NULL.
When configs is NULL, the app wants to know the number of matching
configs.
2010-12-26 23:35:50 +08:00
Vinson Lee aa68dd9a49 swrast: Clean up header file inclusion in ss_vb.h. 2010-12-25 20:53:27 -08:00
Vinson Lee da0bdc7cd5 swrast: Clean up header file inclusion in ss_triangle.h. 2010-12-25 20:48:29 -08:00
Vinson Lee 77d1d35163 swrast: Clean up header file inclusion in s_texfilter.h. 2010-12-25 20:28:17 -08:00
Vinson Lee 06fa986112 swrast: Clean up header file inclusion in s_texcombine.h. 2010-12-25 20:12:06 -08:00
Vinson Lee 77aaaf5fd5 swrast: Clean up header file inclusion in s_masking.h. 2010-12-25 20:03:33 -08:00
Vinson Lee 8ca0aca8dd nvfx: Remove unused variable.
Fixes this GCC warning.
nvfx_vbo.c: In function 'nvfx_idxbuf_emit':
nvfx_vbo.c:410: warning: unused variable 'eng3d'
2010-12-25 19:09:54 -08:00
Xavier Chantry 5f0f9f0486 nvfx: restore BEGIN_RING usage
Michel Hermier reported libdrm segfault (and kernel crash) on nv40 using
gallium :
http://www.mail-archive.com/nouveau@lists.freedesktop.org/msg06563.html

It turns out these were caused by some missing WAIT_RING (or wrong
computation of the WAIT_RING sizes). Unlike all other libdrm_nouveau users,
nvfx gallium tried to use a mininum calls of WAIT_RING, one WAIT_RING could
apply to many methods for different code paths and spread across several
functions. This made it too tricky to find out what the missing or wrong
WAIT_RING was.

By restoring BEGIN_RING, we force one WAIT_RING per method, and it's much
easier to check if the free size required in the pushbuffer is correct.  As
curro said, "let's keep it simple for the maintainers until the big
bottlenecks are gone"

Benchmarked on nv35 with openarena, nexuiz and ut2004 and no performance
regression.

The core of this patch was made with Coccinelle, with minor manual fixes
made on top.

Tested-by: Michel Hermier <hermier@frugalware.org>
Signed-off-by: Francisco Jerez <currojerez@riseup.net>
2010-12-25 20:37:39 +01:00
Eric Anholt b01b73c482 intel: Only do frame throttling at glFlush time when using frontbuffer.
This is the hack for input interactivity of frontbuffer rendering
(like we do for backbuffer at intelDRI2Flush()) by waiting for the n-2
frame to complete before starting a new one.  However, for an
application doing multiple contexts or regular rebinding of a single
context, this would end up lockstepping the CPU to the GPU because
every unbind was considered the end of a frame.

Improves WOW performance on my Ironlake by 48.8% (+/- 2.3%, n=5)
2010-12-25 09:06:52 -08:00
Marek Olšák b606c8a015 r300g: simplify buffer_transfer_inline_write 2010-12-25 16:07:13 +01:00
Marek Olšák 7e752760d4 r300g: simplify the code for buffer uploads 2010-12-25 16:07:13 +01:00
Marek Olšák 9c448817f7 r300g: user index buffers are always aligned 2010-12-25 16:07:13 +01:00
Marek Olšák b10bff1135 r300g: increase the size of upload buffers 2010-12-25 16:07:13 +01:00
Vinson Lee ecc6b7c002 swrast: Clean up header file inclusion in s_logic.h. 2010-12-24 20:43:35 -08:00
Vinson Lee 8dfeb98eb1 swrast: Clean up header file inclusion in s_fragprog.h. 2010-12-24 20:34:53 -08:00
Vinson Lee 3e2ea145b1 swrast: Clean up header file inclusion in s_span.h. 2010-12-24 20:17:18 -08:00
Vinson Lee 7d5f5d3843 swrast: Clean up header file inclusion in s_fog.h. 2010-12-24 20:11:44 -08:00
Vinson Lee ec891d78a0 swrast: Clean up header file inclusion in s_depth.h. 2010-12-24 20:06:11 -08:00
Vinson Lee b3c59acca6 swrast: Clean up header file inclusion in s_blend.h. 2010-12-24 19:55:42 -08:00
Vinson Lee c9a0e25919 swrast: Clean up header file inclusion in s_atifragshader.h. 2010-12-24 19:47:54 -08:00
Vinson Lee eadb90f045 swrast: Clean up header file inclusion in s_alpha.h. 2010-12-24 19:30:38 -08:00
Vinson Lee ebe95d3796 swrast: Clean up header file inclusion in s_accum.h. 2010-12-24 19:25:30 -08:00
Vinson Lee 775e373dd9 swrast: Clean up header file inclusion in s_aatriangle.h. 2010-12-24 18:48:00 -08:00
Vinson Lee d59075303a swrast: Clean up header file inclusion in s_aaline.h. 2010-12-24 18:35:10 -08:00
Vinson Lee 499c77edf1 st/mesa: Clean up header file inclusion in st_mesa_to_tgsi.h. 2010-12-24 18:27:55 -08:00
Vinson Lee b20dac4e2d st/mesa: Clean up header file inclusion in st_gen_mipmap.h. 2010-12-24 18:06:20 -08:00
Marek Olšák 88550083b3 r300g/swtcl: re-enable LLVM
Based on a patch from Drill <drill87@gmail.com>.

NOTE: This is a candidate for the 7.10 branch.
2010-12-24 18:38:03 +01:00
Henri Verbeet 8fc6c5fb36 r600g: r600_blit_uncompress_depth() can't fail. 2010-12-24 11:41:26 +01:00
Henri Verbeet 878519b73e r600g: Get rid of r600_blit_uncompress_depth_ptr. 2010-12-24 11:41:25 +01:00
Chia-I Wu a91a337a7d mapi: Move mapi_func typedef to entry.h.
Make it clear that entry.h does not depend on stub.h.
2010-12-24 17:33:50 +08:00
Chia-I Wu a33e9f049d mapi: Define MAPI_TMP_DEFINES only when needed.
Since struct mapi_table is opaque, MAPI_TMP_DEFINES is not needed in
table.h.
2010-12-24 17:33:49 +08:00
Chia-I Wu e6a7ef3ca6 mapi: Add and use entry_get_public.
Given a dispatch slot, entry_get_public returns the address of the
corresponding public entry point.  There may be more than one of them.
But since they are all equivalent, it is fine to return any one of them.

With entry_get_public, the address of any public entry point can be
calculated at runtime when an assembly dispatcher is used.  There is no
need to have a mapping table in such case.  This omits the unnecessary
relocations from the binary.
2010-12-24 17:33:49 +08:00
Chia-I Wu 897bff6773 mapi: Make struct mapi_stub opaque.
Add accessors for struct mapi_stub and make it opaque.
2010-12-24 17:28:52 +08:00
Chia-I Wu 0c205484bf mapi: Allow blocks to be disabled from the output.
For example, a printer may ask not to output noop dispatch table.
2010-12-24 17:28:52 +08:00
Chia-I Wu b765b1269f mapi: Fix hidden entries.
Hidden entries are just like normal entries except that they are not
exported.  Since it is not always possible to hide them, and two hidden
aliases can share the same entry, the name of hidden aliases are mangled
to '_dispatch_stub_<slot>'.
2010-12-24 17:28:52 +08:00
Chia-I Wu 52ca153349 mapi: Add "handcode" attribute to the script.
Entries with handcode attribute will be handled normally, except no
entry point will be generated for them.
2010-12-24 17:28:52 +08:00
Chia-I Wu 8eee1d522e mapi: Minor ABIPrinter refactoring.
Split out function name generation from _c_decl to _c_function, and use
it everywhere.  Add an optional 'export' argument to _cdecl.  It is
prepended to the returned string.
2010-12-24 17:28:51 +08:00
Chia-I Wu 86d29eab48 mapi: Store alias entry instead of alias name.
An entry can hold more info than plain name.
2010-12-24 17:28:51 +08:00
Dave Airlie 876effb0e7 r600g: hack around property unknown issues.
should fix https://bugs.freedesktop.org/show_bug.cgi?id=32619

Need to add proper support for properties later.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-12-24 17:34:40 +10:00
Dave Airlie ac38ad6156 r300g: turn back on rv530 hiz.
still needs RADEON_HYPERZ=y env var.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-12-24 15:46:12 +10:00
Dave Airlie 7a5fac56b2 r300g: hyperz fixing typo.
Really no idea why I didn't see this before, but these values were opposite
the register spec.

this seems to fix rv530 HiZ on my laptop, will reenable in next commit.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-12-24 15:46:11 +10:00
Vinson Lee a57e2c436b mesa: Assert format is not MESA_FORMAT_COUNT in _mesa_format_to_type_and_comps.
The case of format being MESA_FORMAT_COUNT should never occur.
2010-12-23 18:19:42 -08:00
Xiang, Haihao dc987adc9f i965: use align1 access mode for instructions with execSize=1 in VS
All operands must be 16-bytes aligned in aligh16 mode. This fixes l_xxx.c
in oglconform.
2010-12-24 09:51:44 +08:00
Xiang, Haihao 8249321604 i965: fix register region description
This fixes
 brw_eu_emit.c:179: validate_reg: Assertion `width == 1' failed.
2010-12-24 09:51:22 +08:00
Vinson Lee 1039f36c47 r600g: Rearrange print order of outputs of R600_ERR. 2010-12-23 17:26:36 -08:00
Vinson Lee 38eff56f7e mesa: Assert _mesa_DeleteFragmentShaderATI doesn't ever free static DummyShader. 2010-12-23 16:44:42 -08:00
Vinson Lee 7f178ffbf1 st/egl: Remove unnecessary header. 2010-12-23 16:23:53 -08:00
Vinson Lee 070f5da96d libgl-xlib: Remove unnecessary header. 2010-12-23 16:19:11 -08:00
Vinson Lee 075a807f43 r300g: Remove unnecessary header. 2010-12-23 16:05:28 -08:00
Dave Airlie aaccb73276 tgsi_text: just parse as an integer (value is a boolean).
fixes warning reported by vlee on irc.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-12-24 09:29:19 +10:00
Vinson Lee 0b76255714 mapi: Remove unnecessary header. 2010-12-23 15:25:38 -08:00
Vinson Lee bf4dffb8ef intel: Remove unnecessary headers. 2010-12-23 15:08:53 -08:00
Dave Airlie 4e52e8f746 r300g: add support for color0 writes to all bound color buffers.
Thanks to Marek Olšák for making my initial attempt actually work.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-12-24 07:19:58 +10:00
Dave Airlie 07498075b5 mesa/st: set the color write cbuf property for fragColor writes 2010-12-24 07:19:58 +10:00
Dave Airlie 2f4860f2ab softpipe: add support for color writes all color bufs property 2010-12-24 07:19:57 +10:00
Dave Airlie c9c8a5ed02 gallium: add fragment shader property for color writes to all buffers. (v2)
For GL fragColor semantics we need to tell the pipe drivers that the fragment
shader color result is to be replicated to all bound color buffers, this
adds the basic TGSI + documentation.

v2: fix missing comma pointed out by Tilman on mesa-dev.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-12-24 07:19:57 +10:00
Vinson Lee eccffe2328 i965: Remove unnecessary headers. 2010-12-23 11:54:29 -08:00
Vinson Lee 280750c5ca mesa: Fix #ifdef typo in _mesa_format_to_type_and_comps.
According to the comment, the warning should be for debug builds.
2010-12-23 11:32:16 -08:00
Marek Olšák aedbf05d31 r300g: use a simpler fallback for misaligned ushort indices with triangles
If 'start' is odd, render the first triangle with indices embedded
in the command stream, which adds 3 to 'start' and makes it even.
Then continue with the fast path.
2010-12-23 16:54:59 +01:00
Marek Olšák c420c0e7d6 r300g: add support for B2G3R3 texturing 2010-12-23 16:54:59 +01:00
Marek Olšák bf7b6f60ae mesa: fix texel store functions for some float formats
These are copy-paste errors obviously.
2010-12-23 16:54:58 +01:00
Marek Olšák 4a710469e0 st/mesa: do not require all texture formats to be renderable
This is a bandaid on the problem that if some formats were not renderable
(like luminance_alpha), st/mesa fell back to some RGBA format, so basically
some non-renderable formats were actually not used at all. This is only
a problem with hardware drivers, softpipe can render to anything.

Instead, require only RGB8/RGBA8 to be renderable.
2010-12-23 16:54:58 +01:00
Marek Olšák 998657112b st/mesa: use the formats RGB233, ARGB2101010, AL44, AL1616, A16, L16, I16 2010-12-23 16:54:58 +01:00
Marek Olšák a780490374 gallium: add new formats L16A16_UNORM, A16_UNORM, I16_UNORM, B2G3R3_UNORM 2010-12-23 16:54:58 +01:00
Marek Olšák fd8aa7ac71 mesa: implement new texture format I16 2010-12-23 16:54:58 +01:00
Marek Olšák bb5ace68ce mesa: implement new texture format L16 2010-12-23 16:54:58 +01:00
Marek Olšák eb31837a0d mesa: implement new texture format A16 2010-12-23 16:54:58 +01:00
Marek Olšák bae9d511f3 mesa: implement new texture format AL44
Radeon GPUs can do this. R600 can even do render-to-texture.
Packing and extracting aren't implemented, but we shouldn't hit them (I think).
Tested with swrast, softpipe, and r300g.
2010-12-23 16:54:58 +01:00
Marek Olšák 621e5254ef mesa: implement new texture format ARGB2101010
Radeon GPUs do support GL_RGB10_A2.
2010-12-23 16:54:58 +01:00
Marek Olšák 0a7b60f7ed st/mesa: if Z32 is unsupported, prefer Z24 to Z16 2010-12-23 16:54:58 +01:00
Marek Olšák 888e59fce8 st/mesa: use RGBA16 for RGB12 and RGB16
To provide enough precision if a user wants it.
2010-12-23 16:54:58 +01:00
Marek Olšák 3f9e78ac39 st/mesa: use DXT SRGB formats for COMPRESSED_SRGB
And also check if the formats are supported to return something meaningful
if compression cannot be used.
2010-12-23 16:54:57 +01:00
Eric Anholt bf15ad3782 i965: Keep around a copy of the VS constant surface dumping code.
Just like everywhere else, I never trust my constant uploads to
correctly put constants in the right places, even though that's so
rarely where the issue is.
2010-12-23 01:32:44 -08:00
Eric Anholt 5dc53444c8 i965: Correct the dp_read message descriptor setup on g4x.
It's mostly like gen4 message descriptor setup, except that the sizes
of type/control changed to be like gen5.  Fixes 21 piglit cases on
gm45, including the regressions in bug #32311 from increased VS
constant buffer usage.
2010-12-23 01:32:43 -08:00
Zhenyu Wang de6fd527a5 i965: upload multisample state for fragment program change
This makes conformance tests stable on sandybridge D0 to track
multisample state before SF/WM state.
2010-12-23 17:30:03 +08:00
Zhenyu Wang 845d651cf6 i965: Use MI_FLUSH_DW for blt ring flush on sandybridge
Old MI_FLUSH command is deprecated on sandybridge blt.
2010-12-23 17:29:46 +08:00
Vinson Lee 1e7bfcc707 st/mesa: Remove unnecessary header. 2010-12-23 01:03:32 -08:00
Vinson Lee 492afbce18 gallivm: Disable MMX-disabling code on llvm-2.9.
The disable-mmx option was removed in llvm-2.9svn by revisions 122188
and 122189.

Fixes FDO bug 32564.
2010-12-22 19:56:10 -08:00
Vinson Lee adaa310e39 gallivm: Fix 'cast from pointer to integer of different size' warning.
Fixes this GCC warning.
lp_bld_const.h: In function 'lp_build_const_int_pointer':
lp_bld_const.h:137: warning: cast from pointer to integer of different size
2010-12-22 16:48:19 -08:00
Vinson Lee 38c8b034e2 i915g: Remove unnecessary header. 2010-12-22 00:57:52 -08:00
Vinson Lee 442fcd0620 llvmpipe: Remove unnecessary headers. 2010-12-22 00:55:41 -08:00
Vinson Lee 013fc33462 r300g: Remove unnecessary headers. 2010-12-22 00:52:05 -08:00
Vinson Lee f39d0c791a svga: Remove unnecessary header. 2010-12-22 00:42:23 -08:00
Vinson Lee a91128030e st/vega: Remove unnecessary headers. 2010-12-22 00:38:42 -08:00
Henri Verbeet ca8b4ca478 r600g: Remove the unused "pframebuffer" field from r600_pipe_context. 2010-12-22 09:19:48 +01:00
Henri Verbeet 2fd718d560 r600g: r600_new() and r600_delete() are unused. 2010-12-22 09:19:48 +01:00
Zhenyu Wang 4374703a9b i965: explicit tell header present for fb write on sandybridge
Determine header present for fb write by msg length is not right
for SIMD16 dispatch, and if there're more output attributes, header
present is not easy to tell from msg length. This explicitly adds
new param for fb write to say header present or not.

Fixes many cases' hang and failure in GL conformance test.
2010-12-22 11:08:51 -05:00
Chia-I Wu 445cb9e53b st/egl: Assorted fixes for dri2_display_get_configs.
Set window_bit only when the visual id is greater than zero.  Correct
visual types.  Skip slow configs as they are not relevant.  Finally, do
not return duplicated configs.
2010-12-22 16:05:27 +08:00
Alex Deucher 341d048e45 r600g: remove useless switch statements
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2010-12-22 01:30:41 -05:00
Chia-I Wu a31e2e3312 st/egl: Fix eglCopyBuffers.
Flush before presenting.
2010-12-22 14:21:47 +08:00
Chia-I Wu 18bc427ade st/egl: Plug pbuffer leaks.
Unreference validated resources or remove unnecessary validations.
2010-12-22 14:12:33 +08:00
Chia-I Wu 0fb2dcc98f st/egl: Allow single-buffered pixmaps.
All single-buffered configs were ignored before to make sure
EGL_RENDER_BUFFER is settable for window surfaces.  It is better to
allow single-buffered configs and set EGL_WINDOW_BIT only for
double-buffered ones.  This way there can be single-buffered pixmaps.
2010-12-22 14:12:33 +08:00
Dave Airlie f431e0452b r600g: drop unused code in evergreen.
this code was pretty much duplicated, thanks to Henri Verbeet on irc for
pointing it out.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-12-22 15:58:29 +10:00
Chia-I Wu 975b7ef92a st/egl: Remove native_config::samples.
Multisample buffers are never requested.
2010-12-22 13:22:36 +08:00
Chia-I Wu 3a93c34828 st/egl: Remove native_config::slow_config.
In direct rendering scenario, it is not needed until an EGLDisplay can
support both HW and SW pipe screens.
2010-12-22 13:22:36 +08:00
Chia-I Wu 0364c08d7f st/egl: Remove unnecessary egl_g3d_find_pixmap_config.
It was used to find a compatible config for a given pixmap.  Now that a
config is optional for pixmap surface creation, the function is not
needed.
2010-12-22 13:22:36 +08:00
Chia-I Wu af767ee113 st/egl: Make config optional for create_pixmap_surface.
eglCopyBuffers or EGL_KHR_image_pixmap require creating a pixmap surface
without a config.  Make it just work without relying on
is_pixmap_supported.
2010-12-22 13:22:36 +08:00
Dave Airlie 2dd189a824 r600g: fix evergreen segfaults.
evergreen was crashing running even gears here.

This is a 7.10 candidate if its broken the same.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-12-22 14:54:17 +10:00
Marek Olšák cb4f367b26 r300g: fix precision issues with B10G10R10A2 2010-12-22 03:39:37 +01:00
Marek Olšák 2a95542088 r300g: support B10G10R10A2 render targets only with DRM 2.8.0 or later versions 2010-12-22 03:39:37 +01:00
Eric Anholt 4fe78d3e12 i965: Avoid using float type for raw moves, to work around SNB issue.
The SNB alt-mode math does the denorm and inf reduction even for a
"raw MOV" like we do for g0 message header setup, where we are moving
values that aren't actually floats.  Just use UD type, where raw MOVs
really are raw MOVs.

Fixes glxgears since c52adfc2e1, but no
piglit tests had regressed(!)
2010-12-21 13:06:15 -08:00
Jerome Glisse fa62cf7450 r600g: avoid segfault
Candidates 7.10

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-12-21 10:51:32 -05:00
Chris Wilson 8b9570e685 intel: Check for unsupported texture when finishing using as a render target
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=32541
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-12-21 11:58:35 +00:00
Vinson Lee c1f0f90a97 st/mesa: Clean up header file inclusion in st_format.h. 2010-12-21 01:25:04 -08:00
Vinson Lee 3d03b4d839 st/mesa: Clean up header file inclusion in st_draw.h. 2010-12-21 01:17:37 -08:00
Ben Skeggs 57dcd800ca nvfx: fix fragprog word swapping on big-endian machines
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-12-16 11:13:21 +10:00
Jerome Glisse dbb679e51d gallium: properly check for src->dst blit compatibilities
Spotted by Christoph Bumiller & Jose Fonseca

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-12-15 15:29:31 -05:00
Fredrik Höglund 66f55de31e r600g: fix pow(0, 0) evaluating to NaN
We have to use the non-IEEE compliant version of MUL here, since
log2(0) is -inf, and 0 * -inf is NaN in IEEE arithmetic.

candidates for 7.10 branch
2010-12-15 14:07:00 -05:00
Jerome Glisse 3861a1001c r600g: need to reference upload buffer as the might still live accross flush
Can't get away from referencing upload buffer as after flush a vertex buffer
using the upload buffer might still be active. Likely need to simplify the
pipe_refence a bit so we don't waste so much cpu time in it.

candidates for 7.10 branch

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-12-15 12:07:09 -05:00
Brian Paul a8ca30bc58 st/mesa: fix incorrect prev pointer in destroy_program_variants() 2010-12-14 14:15:22 -07:00
Brian Paul c62bb90d6a softpipe: do texture swizzle during texture sampling
Instead of when we read texture tiles.  Now swizzling happens after
the shadow depth compare step.  This fixes the piglit glsl-fs-shadow2d*
tests (except for proj+bias because of a GLSL bug).
2010-12-14 13:01:03 -07:00
Brian Paul be2aa81f5f mesa: more program debug code 2010-12-14 12:46:01 -07:00
Brian Paul 2a77c3cc0b tgsi: document texture opcodes 2010-12-14 12:45:36 -07:00
Brian Paul bb10e081c8 glsl: new glsl_strtod() wrapper to fix decimal point interpretation
We always want to use '.' as the decimal point.

See http://bugs.freedesktop.org/show_bug.cgi?id=24531

NOTE: this is a candidate for the 7.10 branch.
2010-12-14 12:38:38 -07:00
Brian Paul dfbc20593e gallivm: do texture swizzle after shadow compare
We need to swizzle after the shadow comparison so that the GL_DEPTH_MODE
functionality is handled properly.

This fixes all the piglit glsl-fs-shadow2d*.shader_test cases, except
for glsl-fs-shadow2dproj-bias.shader_test which fails because of a
bug in the GLSL compiler (fd.o 32395).
2010-12-14 12:17:10 -07:00
Brian Paul 68c41a25b4 st/mesa: rename the varient release functions 2010-12-14 12:17:10 -07:00
Jerome Glisse 54773415f4 r600g: fix segfault when translating vertex buffer
Note the support for non float vertex draw likely regressed need to
find what we want to do there.

candidates for 7.10 branches

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-12-14 13:50:46 -05:00
Vinson Lee 4d1b2df6c0 mesa: Clean up header file inclusion in prog_optimize.h. 2010-12-14 00:39:57 -08:00
Vinson Lee 2c582dd25f mesa: Clean up header file inclusion in prog_cache.h. 2010-12-14 00:30:24 -08:00
Vinson Lee 71af07bf40 mesa: Clean up header file inclusion in nvvertparse.h. 2010-12-14 00:22:27 -08:00
Eric Anholt c27285610c i965: Add support for using the BLT ring on gen6. 2010-12-13 19:41:58 -08:00
Eric Anholt d88aa6fe3e i965: Improve the hacks for ARB_fp scalar^scalar POW on gen6.
This is still awful, but my ability to care about reworking the old
backend so we can just get a temporary value into a POW is awfully low
since the new backend does this all sensibly.

Fixes:
fp1-LIT test 1
fp1-LIT test 3 (case x < 0)
fp1-POW test (exponentiation)
fp-lit-mask
2010-12-13 16:47:57 -08:00
Brian Paul 43b7b9d02a st/mesa: 80-columns wrapping, whitespace fixes in st_cb_bitmap.c 2010-12-13 17:34:07 -07:00
Brian Paul c21807d2f7 st/mesa: add geom program code in destroy_program_variants() 2010-12-13 17:29:56 -07:00
Brian Paul b830b62a47 st/mesa: program struct comments 2010-12-13 17:28:02 -07:00
Brian Paul 4312569410 st/mesa: use st_fragment_program() instead of cast 2010-12-13 17:25:29 -07:00
Brian Paul 6c669d0c07 st/mesa: rename variable 2010-12-13 17:25:10 -07:00
Brian Paul 83d50c3ee1 st/mesa: minor re-indenting 2010-12-13 17:20:56 -07:00
Brian Paul 8d8e9491df st/mesa: make st_delete_program() static 2010-12-13 17:20:56 -07:00
Brian Paul 9b4433fe58 st/mesa: add comments, fix formatting in st_cb_program.c 2010-12-13 17:20:56 -07:00
Brian Paul 3d203b6100 Squashed commit of the following (st-mesa-per-context-shaders branch):
commit 4f106f44a32eaddb6cf3fea6ba5ee9787bff609a
Author: Brian Paul <brianp@vmware.com>
Date:   Mon Dec 13 14:06:08 2010 -0700

    st/mesa: reorganize vertex program translation code

    Now it looks like the fragment and geometry program code.
    Also remove the serial number fields from programs.  It was used to
    determine when new translations were needed.  Now the variant key is
    used for that.  And the st_program_string_notify() callback removes all
    variants when the program's code is changed.

commit e12d6791c5e4bff60bb2e6c04414b1b4d1325f3e
Author: Brian Paul <brianp@vmware.com>
Date:   Mon Dec 13 13:38:12 2010 -0700

    st/mesa: implement geometry shader varients

    Only needed in order to support per-context gallium shaders.

commit c5751c673644808ab069259a852f24c4c0e92b9d
Author: Brian Paul <brianp@vmware.com>
Date:   Sun Dec 12 15:28:57 2010 -0700

    st/mesa: restore glDraw/CopyPixels using new fragment program variants

    Clean up the logic for fragment programs for glDraw/CopyPixels.  We now
    generate fragment program variants for glDraw/CopyPixels as needed which
    do texture sampling, pixel scale/bias, pixelmap lookups, etc.

commit 7b0bb99bab6547f503a0176b5c0aef1482b02c97
Author: Brian Paul <brianp@vmware.com>
Date:   Fri Dec 10 17:03:23 2010 -0700

    st/mesa: checkpoint: implement fragment program variants

    The fragment programs variants are per-context, as the vertex programs.

    NOTE: glDrawPixels is totally broken at this point.

commit 2cc926183f957f8abac18d71276dd5bbd1f27be2
Author: Brian Paul <brianp@vmware.com>
Date:   Fri Dec 10 14:59:32 2010 -0700

    st/mesa: make vertex shader variants per-context

    Gallium shaders are per-context but OpenGL shaders aren't.  So we need
    to make a different variant for each context.

    During context tear-down we need to walk over all shaders/programs and
    free all variants for the context being destroyed.
2010-12-13 17:20:53 -07:00
Brian Paul bb7c2691d2 mesa, st/mesa: disable GL_ARB_geometry_shader4
The new GLSL compiler doesn't support geom shaders yet so disable the
GL_ARB_geometry_shader4 extension.  Undo this when geom shaders work again.

NOTE: This is a candidate for the 7.10 branch.
2010-12-13 17:02:48 -07:00
Ian Romanick 2d577ee730 ir_to_mesa: Don't generate swizzles for record derefs of non-scalar/vectors
This is the same as what the array dereference handler does.

Fixes piglit test glsl-link-struct-array (bugzilla #31648).

NOTE: This is a candidate for the 7.9 and 7.10 branches.
2010-12-13 15:47:56 -08:00
Ian Romanick cb2b547a47 linker: Allow built-in arrays to have different sizes between shader stages
Fixes pitlit test glsl-link-varying-TexCoord (bugzilla #31650).
2010-12-13 15:16:39 -08:00
Eric Anholt 036c817f77 i965: Fix gl_FragCoord.z setup on gen6.
Fixes glsl-bug-22603.
2010-12-13 14:02:34 -08:00
Eric Anholt 5fbd8da8df i956: Fix the old FP path fragment position setup on gen6.
Fixes fp-arb-fragment-coord-conventions-none
2010-12-13 14:02:34 -08:00
Eric Anholt 7cec7bf56c i965: Fix ARL to work on gen6.
RNDD isn't one of the instructions that can do conversion from
execution type to destination type.

Fixes glsl-vs-arrays-3.
2010-12-13 14:02:34 -08:00
Eric Anholt df9f891544 intel: Include stdbool so we can stop using GLboolean when we want to.
This requires shuffling the driconf XML macros around, since they use
true and false tokens expecting them to not get expanded to anything.
2010-12-13 14:02:34 -08:00
Brian Paul b363dd43d6 gallivm: store callbacks in a linked list rather than fixed size array
Should fix http://bugs.freedesktop.org/show_bug.cgi?id=32308
2010-12-13 11:47:28 -07:00
Brian Paul 6577f753b2 tnl: a better way to initialize the gl_program_machine memory
This improves commit ef3f7e61b3

NOTE: This is a candidate for the 7.9 and 7.10 branches.
2010-12-13 08:11:58 -07:00
Alex Deucher 4523285e51 r600g: fix rendering with a vertex attrib having a zero stride
The hardware supports zero stride just fine.  This is a port
of 2af8a19831 from r300g.

NOTE: This is a candidate for both the 7.9 and 7.10 branches.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2010-12-12 23:35:37 -05:00
Dave Airlie d19b5cbd31 r300g: fixup rs690 tiling stride alignment calculations.
The RS690 memory controller prefers things to be on a different
boundary than the discrete GPUs, we had an attempt to fix this,
but it still failed, this consolidates the stride calculation
into one place and removes the really special case check.

This fixes gnome-shell and 16 piglit tests on my rs690 system.

NOTE: This is a candidate for both the 7.9 and 7.10 branches.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-12-13 11:29:21 +10:00
Chia-I Wu d6b1478ff0 egl: Do not unload drivers.
When the driver is the last reference to libEGL.so, unloading it will
cause libEGL.so to be unmapped and give problems.  Disable the unloading
for now.  Still have to figure out the right timing to unload drivers.
2010-12-12 18:31:48 +08:00
Chia-I Wu 1c01bedb02 mapi: Fix a warning in !THREADS build.
It should be u_thread_self, not _glthread_GetID.
2010-12-12 17:59:47 +08:00
Vinson Lee bf8242684a mesa: Clean up header file inclusion in nvfragparse.h. 2010-12-11 14:37:18 -08:00
Vinson Lee 7d8c067460 mesa: Clean up header file inclusion in ir_to_mesa.h. 2010-12-11 13:30:13 -08:00
Christoph Bumiller 5138ac033a nvc0: support user clip planes 2010-12-11 16:24:27 +01:00
Christoph Bumiller 67d0c3dd79 nvc0: enable vertex color clamping 2010-12-11 16:24:21 +01:00
Marek Olšák 2af8a19831 r300g: fix rendering with a vertex attrib having a zero stride
The hardware apparently does support a zero stride, so let's use it.

This fixes missing objects in ETQW, but might also fix a ton of other
similar-looking bugs.

NOTE: This is a candidate for both the 7.9 and 7.10 branches.
2010-12-11 14:49:28 +01:00
Marek Olšák c398f1544e tgsi: fix rbug compile error
../mesa/src/gallium/auxiliary/tgsi/tgsi_parse.h:139:
error: dereferencing pointer ‘tokens.25’ does break strict-aliasing rules

Signed-off-by: Marek Olšák <maraeo@gmail.com>
2010-12-11 13:37:57 +01:00
Marek Olšák d0990db6bd r300/compiler: fix swizzle lowering with a presubtract source operand
If a source operand has a non-native swizzle (e.g. the KIL instruction
cannot have a swizzle other than .xyzw), the lowering pass uses one or more
MOV instructions to move the operand to an intermediate temporary with
native swizzles.

This commit fixes that the presubtract information was lost during
the lowering.

NOTE: This is a candidate for both the 7.9 and 7.10 branches.
2010-12-11 13:37:57 +01:00
Marek Olšák 9e1fbd3d6e r300/compiler: fix LIT in VS
This fixes broken rendering of trees in ETQW. The trees still disappear
for an unknown reason when they are close.

Broken since:
2ff9d4474b
r300/compiler: make lowering passes possibly use up to two less temps

NOTE: This is a candidate for the 7.10 branch.
2010-12-11 07:32:24 +01:00
Ian Romanick d7f27e2e76 glsl: Inherrit type of declared variable from initializer after processing assignment
do_assignment may apply implicit conversions to coerce the base type
of initializer to the base type of the variable being declared.  Fixes
piglit test glsl-implicit-conversion-02 (bugzilla #32287).  This
probably also fixes bugzilla #32273.

NOTE: This is a candidate for the 7.9 branch and the 7.10 branch.
2010-12-10 17:52:35 -08:00
Ian Romanick ec53010c4d glsl: Minor clean-up in validate_assignment
This code has been changed around a lot, and there were some temporary
variables left around from previous versions.
2010-12-10 17:52:35 -08:00
Eric Anholt 783e7caadf i965: Put common info on converting MESA_FORMAT to BRW_FORMAT in a table.
There are exceptions to the table for depth texturing or rendering to
not-quite-supported formats thanks to the non-orthogonal component
selection for surface formats, but it's still a lot simpler.
2010-12-10 16:17:01 -08:00
Eric Anholt be72efb4f2 intel: Just use ChooseTextureFormat for renderbuffer format choice.
One less place to forget to put your new MESA_FORMAT support in.
2010-12-10 16:16:13 -08:00
Eric Anholt e339b669a1 intel: Add a couple of helper functions to reduce rb code duplication. 2010-12-10 15:37:16 -08:00
Eric Anholt 28bab24e16 intel: Add spans code for the ARB_texture_rg support.
This starts spantmp2.h down the path of using MESA_FORMAT_* for
specifying the format instead of the crazy GL format/type combo.
2010-12-10 15:37:10 -08:00
Eric Anholt a7e2d64971 mesa: Don't assertion fail for _mesa_get_format_name(MESA_FORMAT_NONE) 2010-12-10 15:29:52 -08:00
Vinson Lee ef3f7e61b3 tnl: Initialize gl_program_machine memory in run_vp.
Fixes piglit valgrind glsl-array-bounds-04 failure (FDO bug 29946).

NOTE:
This is a candidate for the 7.10 branch.
This is a candidate for the 7.9 branch.
2010-12-10 14:24:05 -08:00
Christoph Bumiller dea9d60400 nvc0: fix FACE state and and handle FACE sysval/varying offset 2010-12-10 20:20:37 +01:00
Christoph Bumiller 51f22689a4 nvc0: fix branching ops
- bra is PC relative
- jump to else condition was inverted
- handle integer comparisons
2010-12-10 20:20:34 +01:00
Mathias Fröhlich b3d2ec9942 vbo: Avoid the copy to current in dlists if not required.
The current state is allowed to be undefined past DrawElements et al.
Consequently omit that copying at least in the display list code.
This pays us some percents performance.

Signed-off-by: Brian Paul <brianp@vmware.com>
2010-12-10 10:17:48 -07:00
Brian Paul 2a4df8933e mesa/meta: fix broken assertion, rename stack depth var
assert(current_save_state < MAX_META_OPS_DEPTH) did not compile.

Rename current_save_state to SaveStackDepth to be more consistent with
the style of the other fields.
2010-12-10 10:02:37 -07:00
Jerome Glisse b22c8e8bbc r600g: fix bo size when creating bo from handle
Spoted by Alex Diomin

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-12-10 11:17:27 -05:00
Vinson Lee d5810efca6 mesa: Clean up header file inclusion in arbprogparse.h. 2010-12-09 23:52:28 -08:00
Xiang, Haihao e47eacdc53 i965: support for two-sided lighting on Sandybridge
VS places color attributes together so that SF unit can fetch the right
attribute according to object orientation. This fixes light issue in
mesa demo geartrain, projtex.
2010-12-10 13:25:22 +08:00
Xiang, Haihao d1196bbc19 meta: allow nested meta operations
_mesa_meta_CopyPixels results in nested meta operations on Sandybridge.
Previoulsy the second meta operation overrides all states saved by the
first meta function.
2010-12-10 13:25:17 +08:00
Eric Anholt 3a3b1bd722 i965: Add support for gen6 reladdr VS constant loading. 2010-12-09 20:25:34 -08:00
Eric Anholt 15566183a6 i965: Add support for gen6 constant-index constant loading. 2010-12-09 20:25:34 -08:00
Chia-I Wu 83bdd402aa targets/egl: Improve st_GL.so loading.
When the application is not linked to any libGL*.so, loading st_GL.so
would give

  /usr/local/lib/egl/st_GL.so: undefined symbol: _glapi_tls_Context

In that case, load libGL.so and try again.  This works because
util_dl_open loads with RTLD_GLOBAL.

Fix "clear" OpenGL ES 1.1 demo.
2010-12-10 11:01:05 +08:00
Chia-I Wu 6efd963a23 target/egl: Fix misleading debug message.
When the name of the module is NULL, the process itself is dlopen()ed.
Do not print

  libEGL debug: searching for st module (null)
2010-12-10 11:00:31 +08:00
Brian Paul becc4bb90c draw/llvm: don't flush in vs_llvm_delete()
Fixes piglit glx-shader-sharing crash.

When shaders are shared by multiple contexts, the shader's draw context
pointer may point to a previously destroyed context.  Dereferencing the
context pointer will lead to a crash.

In this case, simply removing the flushing code avoids the crash (the
exec and sse shader paths don't flush here either).

There's a deeper issue here, however, that needs examination.  Shaders
should not keep pointers to contexts since contexts might get destroyed
at any time.

NOTE: This is a candidate for the 7.10 branch (after this has been
tested for a while).
2010-12-09 18:41:22 -07:00
Brian Paul 70ca064454 draw/llvm: remove redundant comment 2010-12-09 18:40:48 -07:00
Brian Paul bd995cf6c0 draw/llvm: remove extraneous conditional 2010-12-09 18:40:48 -07:00
Luca Barbieri 0e50c21e24 glsl: Unroll loops with conditional breaks anywhere (not just the end)
Currently we only unroll loops with conditional breaks at the end, which is
the form that lower_jumps generates.

However, if breaks are not lowered, they tend to appear at the beginning, so
add support for a conditional break anywhere.

Signed-off-by: Luca Barbieri <luca@luca-barbieri.com>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2010-12-09 16:42:05 -08:00
Kenneth Graunke 13c45c590b glsl: Consider the "else" branch when looking for loop breaks.
Found this bug by code inspection.  Based off the comments just before
this code, the intent is to find whether the break exists in the "then"
branch or the "else" branch.  However, the code actually looked at the
last instruction in the "then" branch twice.
2010-12-09 16:42:05 -08:00
Kenneth Graunke 528fa8ce32 glsl: Clean up code by adding a new is_break() function. 2010-12-09 16:42:05 -08:00
Eric Anholt b13a2e640f glsl: Correct the marking of InputsRead/OutputsWritten on in/out matrices.
If you used a constant array index to access the matrix, we'd flag a
bunch of wrong inputs/outputs as being used because the index was
multiplied by matrix columns and the actual used index was left out.

Fixes glsl-mat-attribute.
2010-12-09 14:41:50 -08:00
Eric Anholt 3fb18d6775 intel: Set the swizzling for depth textures using the GL_RED depth mode.
Fixes depth-tex-modes-rg.
2010-12-09 14:41:50 -08:00
Eric Anholt b4e8ec3a57 intel: Use plain R8 and RG8 for COMPRESSED_RED and COMPRESSED_RG.
Fixes texture-rg.
2010-12-09 14:41:50 -08:00
Vinson Lee c3ca384e71 i965: Silence uninitialized variable warning.
Fixes this GCC warning.
brw_fs.cpp: In function 'brw_reg brw_reg_from_fs_reg(fs_reg*)':
brw_fs.cpp:3255: warning: 'brw_reg' may be used uninitialized in this function
2010-12-09 14:17:17 -08:00
Vinson Lee af5f7b3260 r600g: Fix SCons build. 2010-12-09 14:03:58 -08:00
Jerome Glisse 121079bd67 r600g: indentation cleanup
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-12-09 16:16:22 -05:00
Jerome Glisse 7055068eea r600g: specialized upload manager
Allow important performance increase by doing hw specific implementation
of the upload manager helper. Drop the range flushing that is not hit with
this code (and wasn't with previous neither). Performance improvement are
mostly visible on slow CPU.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-12-09 16:07:05 -05:00
Jerome Glisse 15753cf54d r600g: avoid using pb* helper we are loosing previous cpu cycle with it
r600g is up to a point where all small CPU cycle matter and pb* turn
high on profile. It's mostly because pb try to be generic and thus
trigger unecessary check for r600g driver. To avoid having too much
abstraction & too much depth in the call embedded everythings into
r600_bo. Make code simpler & faster. The performance win highly depend
on the CPU & application considered being more important on slower CPU
and marginal/unoticeable on faster one.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-12-09 16:07:01 -05:00
Fabian Bieler ef534f3838 glsl: fix lowering conditional returns in subroutines
this fix applies to the lower_sub_return 'branch' of the lower_jumps pass

Fixes piglit tests glsl-functions-5 and glsl-functions-6.
2010-12-09 11:28:06 -08:00
Eric Anholt 834cc8e501 i965: remove unused variable since brw_wm_glsl.c removal. 2010-12-09 11:11:04 -08:00
Eric Anholt cfcc2ef587 i965: Set render_cache_read_write surface state bit on gen6 constant surfs.
This is said to be required in the spec, even when you aren't doing writes.
2010-12-09 11:11:04 -08:00
Eric Anholt 30f25a1019 i965: Set up the correct texture border color state struct for Ironlake.
This doesn't actually fix border color on Ironlake, but it appears to
be a requirement, and gen6 needs it too.
2010-12-09 10:51:00 -08:00
Eric Anholt 14a9153a32 i965: Clean up VS constant buffer location setup. 2010-12-09 10:51:00 -08:00
Eric Anholt 8fab1c0e2e i965: Fix VS constants regression pre-gen6.
Last minute change for gen6 with 0 used params dropped the multiply.
2010-12-09 10:50:59 -08:00
José Fonseca cdd4f04f80 llvmpipe: Plug fence leaks. 2010-12-09 16:48:26 +00:00
Christoph Bumiller e32ec11278 nvc0: call grobj_alloc for all used classes
Only doing this to notify the DRM that we need a PGRAPH context,
nvc0 hardware doesn't use actual grobjs anymore.
2010-12-09 17:41:13 +01:00
Shuang He 9946f15d30 mesa: allow GLfixed arrays for OpenGL ES 2.0
Signed-off-by: Brian Paul <brianp@vmware.com>
2010-12-09 08:23:54 -07:00
Christoph Bumiller 92f3642a4f nvc0: write texture address to TIC with a RELOC
Direct access to the bo address requires an API change.
2010-12-09 15:22:17 +01:00
Christoph Bumiller 6e753e3c29 nvc0: use tile flags in a way compatible with nouveau 2010-12-09 15:08:29 +01:00
Christoph Bumiller 3ef1616b63 nvc0: buffer suballocation with a primitive slab allocator 2010-12-09 15:01:37 +01:00
Christoph Bumiller 0d1a2bd0fb nvc0: generate shader header for geometry programs 2010-12-09 14:44:21 +01:00
Christoph Bumiller 14a09095d3 nvc0: fix immediate arg for SHL/SHR 2010-12-09 14:43:11 +01:00
Christoph Bumiller 2bb377ee02 nvc0: index buffers are back
Probably because long methods are gone index buffers must be
explicit again.
2010-12-09 14:41:33 +01:00
Christoph Bumiller 7fa7229560 nvc0: upload constants with m2mf for the time being
I get mysterious lockups with the dedicated CB upload ...
2010-12-09 14:35:26 +01:00
Chia-I Wu 0c0eda393a mesa: Fix glTexCoordPointer with type GL_FIXED.
GL_FIXED is also a legal type for glTexCoordPointer.
2010-12-09 19:37:56 +08:00
Chia-I Wu 2d270ac090 mesa: Fix GL_FIXED arrays.
It is broken since 433e5e6def.
2010-12-09 19:25:05 +08:00
Christoph Bumiller 5655f8d42d nvc0: support primitive restart 2010-12-09 12:08:25 +01:00
Christoph Bumiller 548967f9fa nvc0: rcp f32 also supports neg and abs modifiers 2010-12-09 12:05:03 +01:00
Eric Anholt 05e534e6c4 i965: Drop push-mode reladdr constant loading and always use constant_map.
This eases the gen6 implementation, which can only handle up to 32
registers of constants, while likely not penalizing real apps using
reladdr since all of those I've seen also end up hitting the pull
constant buffer.  On gen6, the constant map means that simple NV VPs
fit under the 32-reg limit and now succeed.  Fixes around 10 testcases.
2010-12-08 22:26:18 -08:00
Alex Deucher fd543e1f95 radeon: bump mip tree levels to 15
I forgot to bump this when I bumped the tex levels.
2010-12-09 00:16:02 -05:00
Brian Paul 09a5e028a6 mesa: simplify target checking for TexImage functions 2010-12-08 21:38:35 -07:00
Brian Paul 7404fa3f07 mesa: revamp error checking for compressed texture images
Simplify some code, remove unneeded checks, etc.
2010-12-08 21:38:35 -07:00
Chad Versace f0f2ec4d8a glsl: In ast_to_hir, check sampler array indexing
Raise error if a sampler array is indexed with a non-constant expression.

From section 4.1.7 of the GLSL 1.30 spec:
  "Samplers aggregated into arrays within a shader (using square
  brackets [ ]) can only be indexed with integral constant
  expressions [...]."
2010-12-08 18:53:53 -08:00
Eric Anholt d547ab150a i965: Drop KIL_NV from the ff/ARB_fp path since it was only used for GLSL. 2010-12-08 11:14:52 -08:00
Eric Anholt dba6fde08c i965: Use the new pixel mask location for gen6 ARB_fp KIL instructions.
Fixes:
fp-kil
fp-generic/kil-swizzle.
2010-12-08 11:14:35 -08:00
Eric Anholt 39eaacff14 i965: Set the render target index in gen6 fixed-function/ARB_fp path.
Fixes:
fbo-drawbuffers2-blend
fbo-drawbuffers2-colormask
2010-12-08 10:51:04 -08:00
Eric Anholt 4b4dc778b6 i965: Set up the per-render-target blend state on gen6.
This will let us get EXT_draw_buffers2 blending and colormasking working.
2010-12-08 10:50:57 -08:00
Eric Anholt 0d3b8a5cc2 i965: Set up the color masking for the first drawbuffer on gen6.
Fixes glean/maskedClear
2010-12-08 09:53:16 -08:00
Chia-I Wu d2028ba339 mesa: Do not advertise GL_OES_texture_3D.
GL_OES_texture_3D has a GLSL counterpart.  Since it is not implemented,
GL_OES_texture_3D should not be advertised.
2010-12-08 22:35:40 +08:00
Chia-I Wu 98ee6739d9 vbo: Fix GLES2 glVertexAttrib.
Attribute 0 has no special meaning in GLES2.  Add VertexAttrib4f_nopos
for that purpose and make _es_VertexAttrib* call the new function.

Rename _vbo_* to _es_* to avoid confusion.  These functions are only
used by GLES, and now some of them (_es_VertexAttrib*) even behave
differently than vbo_VertexAttrib*.
2010-12-08 22:19:19 +08:00
Chia-I Wu 9f0d7dd259 vbo: Drop second ATTR macro.
There is no need to have a special version of ATTR for
!FEATURE_beginend, since 81ccb3e2ce.
2010-12-08 22:18:37 +08:00
Brian Paul c64447f47d mesa: make _mesa_test_proxy_teximage() easier to read 2010-12-07 21:37:20 -07:00
Brian Paul 4ff70b7a8f mesa: consolidate glCompressedTexImage1/2/3D() functions 2010-12-07 21:37:20 -07:00
Brian Paul 1c23b860ce mesa: consolidate glCopyTexSubImage1/2/3D() functions 2010-12-07 21:37:20 -07:00
Brian Paul 11f386fb50 mesa: consolidate glCopyTexImage1/2D() code 2010-12-07 21:37:19 -07:00
Brian Paul 45124e043d mesa: consolidate the glTexSubImage1/2/3D() functions 2010-12-07 21:37:19 -07:00
Brian Paul 35f620d55c mesa: simplify proxy texture code in texture_error_check() 2010-12-07 21:37:19 -07:00
Marek Olšák c4f9e55d61 r300/compiler: remove at least unused immediates if externals cannot be removed 2010-12-08 04:39:51 +01:00
Marek Olšák 2ff9d4474b r300/compiler: make lowering passes possibly use up to two less temps
CMP may now use two less temps, other non-native instructions may end up
using one less temp, except for SIN/COS/SCS, which I am leaving unchanged
for now.

This may reduce register pressure inside loops, because the register
allocator doesn't do a very good job there.
2010-12-08 04:39:51 +01:00
Marek Olšák 93f2df0760 r300/compiler: handle DPH and XPD in rc_compute_sources_for_writemask
This bug can only be triggered if you put deadcode before native rewrite.
2010-12-08 04:39:50 +01:00
Marek Olšák 95080fb50f r300/compiler: do not print pair/tex/presub program stats for vertex shaders 2010-12-08 04:39:50 +01:00
Marek Olšák 8fac29d49e r300/compiler: cleanup rc_run_compiler 2010-12-08 04:39:50 +01:00
Marek Olšák 2592a8f506 r300/compiler: add a function to query program stats (alu, tex, temps..) 2010-12-08 04:39:50 +01:00
Marek Olšák 431b4c0c84 r300/compiler: don't terminate regalloc if we surpass max temps limit
The same check is already in a later pass (translate_vertex_program).
2010-12-08 04:39:50 +01:00
Eric Anholt 2f07a744f1 i965: Don't try to store gen6 (float) blend constant color in bytes.
Fixes glean/blendFunc
2010-12-07 19:33:47 -08:00
Ian Romanick 002cd2c8d4 linker: Fix regressions caused by previous commit
That's what I get for not running piglit before pushing.

Don't try to patch types of unsized arrays when linking fails.

Don't try to patch types of unsized arrays that are shared between
shader stages.
2010-12-07 19:00:44 -08:00
Ian Romanick 6f53921c4b linker: Ensure that unsized arrays have a size after linking
Fixes piglit test case glsl-vec-array (bugzilla #31908).

NOTE: This bug does not affect 7.9, but I think this patch is a
candiate for the 7.9 branch anyway.
2010-12-07 18:32:16 -08:00
Eric Anholt b2167a6c01 i965: Fix flipped value of the not-embedded-in-if on gen6.
Fixes:
glean/glsl1-! (not) operator (1, fail)
glean/glsl1-! (not) operator (1, pass)
2010-12-07 17:46:47 -08:00
Ian Romanick b0fc5103cb glsl: Inherrit type of declared variable from initializer
Types of declared variables and their initializer must match excatly
except for unsized arrays.  Previously the type inherritance for
unsized arrays happened implicitly in the emitted assignment.
However, this assignment is never emitted for uniforms.  Now that type
is explicitly copied unconditionally.

Fixes piglit test array-compare-04.vert (bugzilla #32035) and
glsl-array-uniform-length (bugzilla #31985).

NOTE: This is a candidate for the 7.9 branch.
2010-12-07 16:36:44 -08:00
Eric Anholt 7ca7e9b626 i965: Work around gen6 ignoring source modifiers on math instructions.
With the change of extended math from having the arguments moved into
mrfs and handed off through message passing to being directly hooked
up to the EU, it looks like the piece for doing source modifiers
(negate and abs) was left out.

Fixes:
fog-modes
glean/fp1-ARB_fog_exp test
glean/fp1-ARB_fog_exp2 test
glean/fp1-Computed fog exp test
glean/fp1-Computed fog exp2 test
ext_fog_coord-modes
2010-12-07 15:11:27 -08:00
Eric Anholt 2d7dfb8446 i965: Add disabled debug code for dumping out the WM constant payload.
This can significantly ease thinking about the asm.
2010-12-07 15:11:27 -08:00
Ian Romanick 6848e27e14 i965: Correctly emit constants for aggregate types (array, matrix, struct)
Previously the code only handled scalars and vectors.  This new code
is modeled somewhat after similar code in ir_to_mesa.

Reviewed-by: Eric Anholt <eric@anholt.net>
2010-12-07 15:03:14 -08:00
Jerome Glisse b7617346dc r600g: fix userspace fence against lastest kernel
R6XX GPU doesn't like to have two partial flush writting
back to memory in row without a prior flush of the pipeline.
Add PS_PARTIAL_FLUSH to flush all work between the CP and
the ES, GS, VS, PS shaders.

Thanks a lot to Alban Browaeys (prahal on irc) for investigating
this issue.

Signed-off-by: Alban Browaeys <prahal@yahoo.com>
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-12-07 17:54:56 -05:00
Jerome Glisse 69251fc4cd r600g: remove dead code
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-12-07 16:14:18 -05:00
Eric Anholt fa0d5a2c5b i965: Always hand the absolute value to RSQ.
gen6 builtin RSQ apparently clamps negative values to 0 instead of
returning the RSQ of the absolute value like ARB_fragment_program
desires and pre-gen6 apparently does.

Fixes:
glean/fp1-RSQ test 2 (reciprocal square root of negative value)
glean/vp1-RSQ test 2 (reciprocal square root of negative value)
2010-12-07 13:13:27 -08:00
Ian Romanick 6d36be508f glsl: Ensure that equality comparisons don't return a NULL IR tree
This fixes bugzilla #32035 and piglit test case array-compare-01 and
array-compare-02.

NOTE: This is a candidate for the 7.9 branch.
2010-12-07 12:50:38 -08:00
Eric Anholt 72845d206e i965: Handle saturates on gen6 math instructions.
We get saturate as an argument to brw_math() instead of as compile
state, since that's how the pre-gen6 send instructions work.  Fixes
fp-ex2-sat.
2010-12-07 12:21:08 -08:00
Eric Anholt ed492e9544 i965: Fix comment about gen6_wm_constants.
This is the push constant buffer, not the pull constants.
2010-12-07 12:21:08 -08:00
Kenneth Graunke bd74101aeb Refresh autogenerated glcpp parser. 2010-12-07 10:52:59 -08:00
Kenneth Graunke 800eed6765 glcpp: Don't emit SPACE tokens in conditional_tokens production.
Fixes glslparsertest defined-01.vert.

Reported-by: José Fonseca <jfonseca@vmware.com>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Carl Worth <cworth@cworth.org>
2010-12-07 10:52:36 -08:00
Marek Olšák d8b861987d r300g: also revalidate the SWTCL vertex buffer after its reallocation 2010-12-07 19:26:28 +01:00
Zhenyu Wang 27609a8267 i965: upload WM state for _NEW_POLYGON on sandybridge
Be sure polygon stipple mode is updated. This fixes 'gamma' demo.
2010-12-07 17:05:02 +08:00
Vinson Lee 6ee415cc6d r200: Silence uninitialized variable warning.
Fixes this GCC warning.
r200_maos_arrays.c: In function 'r200EmitArrays':
r200_maos_arrays.c:113: warning: 'emitsize' may be used uninitialized in this function
2010-12-07 00:58:54 -08:00
Xiang, Haihao 5ff6ed2b97 i965: set minimum/maximum Point Width on Sandybridge
It is used for point width on vertex. This fixes mesa demo spriteblast and pointblast.
2010-12-07 16:43:24 +08:00
Vinson Lee dda3ccba8c mesa: Clean up header file inclusion in viewport.h. 2010-12-07 00:37:48 -08:00
Vinson Lee dbd3f72662 mesa: Clean up header file inclusion in varray.h. 2010-12-07 00:33:36 -08:00
Vinson Lee 2aa36f78dc mesa: Clean up header file inclusion in transformfeedback.h. 2010-12-07 00:28:57 -08:00
Vinson Lee 8cc3d411ed mesa: Clean up header file inclusion in texrender.h. 2010-12-07 00:19:06 -08:00
Marek Olšák 4953ba6a71 r300g: validate buffers only if any of bound buffers is changed
This prevents needless buffer validation (CS space checking).
2010-12-07 08:46:18 +01:00
Marek Olšák 78068a5fbf r300g: cache packet dwords of 3D_LOAD_VBPNTR in a command buffer if possible
It's not always possible to preprocess the content of 3D_LOAD_VBPNTR
in a command buffer, because the offset to all vertex buffers (which
the packet depends on) is derived from the "start" parameter of draw_arrays
and the "indexBias" parameter of draw_elements, but we can at least lazily
make a command buffer for the case when offset == 0, which should occur
most of the time.
2010-12-07 06:42:05 +01:00
Marek Olšák 857d107bfe u_blitter: use util_is_format_compatible in the assert 2010-12-07 06:22:38 +01:00
Brian Paul d0b2b8da7d mesa: consolidate glTexImage1/2/3D() code
Something similar could be done for glCopyTex[Sub]Image() and the
compressed texture image functions as well.
2010-12-06 17:10:05 -07:00
Brian Paul 6dca66b620 mesa: set gl_texture_object::_Complete=FALSE in incomplete() 2010-12-06 17:10:05 -07:00
Brian Paul ecb7cc3319 mesa: test for cube map completeness in glGenerateMipmap()
The texture is not cube complete if the base level images aren't of
the same size and format.

NOTE: This is a candidate for the 7.9 branch.
2010-12-06 17:10:05 -07:00
Kenneth Graunke c17c790387 glsl: Properly add functions during lazy built-in prototype importing.
The original lazy built-in importing patch did not add the newly created
function to the symbol table, nor actually emit it into the IR stream.

Adding it to the symbol table is non-trivial since importing occurs when
generating some ir_call in a nested scope.  A new add_global_function
method, backed by new symbol_table code in the previous patch, handles
this.

Fixes bug #32030.
2010-12-06 13:43:22 -08:00
Kenneth Graunke a8f52647b0 symbol_table: Add support for adding a symbol at top-level/global scope. 2010-12-06 13:43:22 -08:00
Kenneth Graunke 6fae1e4c4d glsl: Factor out code which emits a new function into the IR stream.
A future commit will use the newly created function in a second place.
2010-12-06 13:43:22 -08:00
Jakob Bornecrantz d72cb9c94d st/mesa: Unbind all constant buffers 2010-12-06 22:10:49 +01:00
Jerome Glisse e0d554ab78 r600g: remove useless flush map
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-12-06 15:50:50 -05:00
Jerome Glisse afc56b1861 r600g: avoid useless shader rebuild at draw call
Avoid rebuilding constant shader state at each draw call,
factor out spi update that might change at each draw call.
Best would be to update spi only when revealent states
change (likely only flat shading & sprite point).

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-12-06 15:50:50 -05:00
Jerome Glisse fa86fc564a r600g: build fetch shader from vertex elements
Vertex elements change are less frequent than draw call, those to
avoid rebuilding fetch shader to often build the fetch shader along
vertex elements. This also allow to move vertex buffer setup out
of draw path and make update to it less frequent.

Shader update can still be improved to only update SPI regs (based
on some rasterizer state like flat shading or point sprite ...).

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-12-06 15:50:50 -05:00
José Fonseca a9fa0f3a2f mesa: Bump the number of bits in the register index.
More than 1023 temporaries were being used for a Cinebench shader before
doing temporary optimization, causing the index value to wrap around to
-1024.
2010-12-06 20:03:51 +00:00
Brian Paul cae2bb76c1 st/mesa: fix mipmap generation bug
In st_finalize_texture() we were looking at the st_texture_object::
lastLevel field instead of the pipe_resource::last_level field to
determine which resource to store the mipmap in.

Then, in st_generate_mipmap() we need to call st_finalize_texture() to
make sure the destination resource is properly allocated.

These changes fix the broken piglit fbo-generatemipmap-formats test.
2010-12-06 11:01:21 -07:00
Brian Paul 4fc62a074c gallium/util: minor formatting fixes 2010-12-06 09:46:45 -07:00
Brian Paul b89a731ff2 mesa: add error margin to clip mask debug/check code
When X or Y or Z is close to W the outcome of the floating point clip
test comparision may be different between the C and x86 asm paths.
That's OK; don't report an error.

See fd.o bug 32093
2010-12-06 09:46:01 -07:00
Eric Anholt 4538ce915b i965: Remove INTEL_DEBUG=glsl_force now that there's no brw_wm_glsl.c 2010-12-06 00:14:23 -08:00
Eric Anholt 5ba517baa2 i965: Nuke brw_wm_glsl.c.
It was only used for gen6 fragment programs (not GLSL shaders) at this
point, and it was clearly unsuited to the task -- missing opcodes,
corrupted texturing, and assertion failures hit various applications
of all sorts.  It was easier to patch up the non-glsl for remaining
gen6 changes than to make brw_wm_glsl.c complete.

Bug #30530
2010-12-06 00:14:23 -08:00
Eric Anholt 245662f308 i965: Add support for the instruction compression bits on gen6.
Since the 8-wide first-quarter and 16-wide first-half have the same
bit encoding, we now need to track "do you want instruction
compression" in the compile state.
2010-12-06 00:14:23 -08:00
Eric Anholt 3f8bcb0d99 i965: Align gen6 push constant size to dispatch width.
The FS backend is fine with register level granularity.  But for the
brw_wm_emit.c backend, it expects pairs of regs to be used for the
constants, because the whole world is pairs of regs.  If an odd number
got used, we went looking for interpolation in the wrong place.
2010-12-06 00:14:23 -08:00
Eric Anholt 237aa33c67 i965: Make the sampler's implied move on gen6 be a raw move.
We were accidentally doing a float-to-uint conversion.
2010-12-06 00:14:23 -08:00
Eric Anholt 5340dd8cca i965: Fix up gen6 samplers for their usage by brw_wm_emit.c
We were trying to do the implied move even when we'd already manually
moved the real header in place.
2010-12-06 00:14:22 -08:00
Eric Anholt ad29e79850 i965: Fix gen6 interpolation setup for 16-wide.
In the SF and brw_fs.cpp fixes to set up interpolation sanely on gen6,
the setup for 16-wide interpolation was left behind.  This brings
relative sanity to that path too.
2010-12-06 00:14:22 -08:00
Eric Anholt ae0df25ab4 i965: Don't smash a group of coordinates doing gen6 16-wide sampler headers. 2010-12-06 00:14:22 -08:00
Eric Anholt d1ead22d1b i965: Fix up 16-wide gen6 FB writes after various refactoring. 2010-12-06 00:14:22 -08:00
Eric Anholt ad35528944 i965: Provide delta_xy reg to gen6 non-GLSL path PINTERP.
Fixes many assertion failures in that path.
2010-12-06 00:14:22 -08:00
Eric Anholt 16f8c82389 i965: Move payload reg setup to compile, not lookup time.
Payload reg setup on gen6 depends more on the dispatch width as well
as the uses_depth, computes_depth, and other flags.  That's something
we want to decide at compile time, not at cache lookup.  As a bonus,
the fragment shader program cache lookup should be cheaper now that
there's less to compute for the hash key.
2010-12-06 00:14:22 -08:00
Chia-I Wu 8f2a974cf2 mapi: Rewrite mapi_abi.py to get rid of preprocessor magic.
The preprocessor magic in mapi was nothing but obfuscation.  Rewrite
mapi_abi.py to generate real C code.

This commit removes the hack added in
43121f2086.
2010-12-06 15:40:37 +08:00
Chia-I Wu 5ae4b6693a egl: _eglFilterArray should not allocate.
Otherwise, when it is called from within a driver, the caller cannot
free the returned data (on Windows).
2010-12-06 15:40:37 +08:00
Zhenyu Wang 2b1469340b i965: Fix GS state uploading on Sandybridge
Need to check the required primitive type for GS on Sandybridge,
and when GS is disabled, the new state has to be issued too, instead
of only updating URB state with no GS entry, that caused hang on Sandybridge.

This fixes hang issue during conformance suite testing.
2010-12-06 15:20:48 +08:00
Xiang, Haihao 08be8d6450 i965: fix for flat shading on Sandybridge
use constant interpolation instead of linear interpolation for
attributes COL0,COL1 if GL_FLAT is used. This fixes mesa demo bounce.
2010-12-06 09:42:28 +08:00
Henri Verbeet 4409435614 r600g: Cleanup fetch shader resources in r600_pipe_shader_destroy(). 2010-12-05 18:44:44 +01:00
Henri Verbeet 308cfb80f5 r600g: Cleanup block bo references in r600_context_fini(). 2010-12-05 18:44:44 +01:00
Marek Olšák c0c929cdac st/mesa: initialize key in st_vp_varient
This fixes endless vertex shader recompilations in find_translated_vp
if the shader contains an edge flag output.

NOTE: This is a candidate for the 7.9 branch.

Signed-off-by Brian Paul <brianp@vmware.com>
2010-12-05 17:38:19 +01:00
Xavier Chantry ccacabe86c gallium/trace: check bind_vertex_sampler_states and set_vertex_sampler_views
Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com>
Reviewed-by: Jakob Bornecrantz <wallbraker at gmail.com>
Signed-off-by: Patrice Mandin <patmandin@gmail.com>
2010-12-05 12:12:25 +01:00
Xavier Chantry e3256ccb04 init ps->context with util_surfaces_get and do_get
Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com>
Reviewed-by: Jakob Bornecrantz <wallbraker at gmail.com>
Signed-off-by: Patrice Mandin <patmandin@gmail.com>
2010-12-05 12:09:38 +01:00
Xavier Chantry af5345d937 nvfx: fixes after array textures merge
Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com>
Signed-off-by: Patrice Mandin <patmandin@gmail.com>
2010-12-05 12:08:00 +01:00
Marek Olšák 66d45567b4 r300g: optimize looping over atoms
This also removes DBG_STATS (the stats can be obtained with valgrind instead).
2010-12-05 05:52:25 +01:00
Marek Olšák 6947e52548 r300g: cleanup winsys 2010-12-05 05:47:10 +01:00
Dave Airlie c1365606c5 r300g: try and use all of vertex constant space
Finished up by Marek Olšák.

We can set the constant space to use a different area per-call to the shader,
we can avoid flushing the PVS as often as we do by spreading out the constants
across the whole constant space.

Signed-off-by: Marek Olšák <maraeo@gmail.com>
2010-12-05 05:47:03 +01:00
Marek Olšák 1774273bde r300g: do not use the index parameter in set_constant_buffer
It appears to be a constant buffer index (in case there are more constant
buffers explicitly used by a shader), i.e. something that Gallium currently
does not use. We treated it incorrectly as the offset to a constant buffer.
2010-12-05 05:46:56 +01:00
Vinson Lee e72651dc5d gallium/noop: Add prototype for noop_init_state_functions.
Silences this GCC warning.
noop_state.c:247: warning: no previous prototype for
'noop_init_state_functions'
2010-12-04 17:30:08 -08:00
Eric Anholt afb80c5315 i965: Fix compile warning about missing opcodes. 2010-12-04 16:27:57 -08:00
Eric Anholt 8f23039f00 i965: Update gen6 SF state on fragment program change too.
SF state depends on what inputs there are to the fragment program, not
just the outputs of the VS.
2010-12-04 16:26:55 -08:00
Eric Anholt 65570d0482 i965: Update gen6 WM state on compiled program change, not just FP change. 2010-12-04 16:26:55 -08:00
Eric Anholt 4ac2f09e20 intel: Add an env var override to execute for a different GPU revision.
Sometimes I'm on the train and want to just read what's generated
under INTEL_DEBUG=vs,wm for some code on another generation.  Or, for
the next gen enablement we'll want to dump aub files before we have
the actual hardware.  This will let us do that.
2010-12-04 16:26:55 -08:00
Chia-I Wu 859106f196 st/vega: Fix pipe blend state for various blend modes.
rgb_src_factor and rgb_dst_factor should be PIPE_BLENDFACTOR_ONE for
VG_BLEND_SRC_IN and VG_BLEND_DST_IN respectively.  VG_BLEND_SRC_OVER can
be supported only when the fb has no alpha channel.  VG_BLEND_DST_OVER
and VG_BLEND_ADDITIVE have to be supported with a shader.

Note that Porter-Duff blending rules assume premultiplied alpha.
2010-12-04 23:46:38 +08:00
Chia-I Wu 0ee73edecc st/vega: Add blend shaders for all blend modes. 2010-12-04 23:41:35 +08:00
Chia-I Wu 5d24411140 st/vega: Fix VG_BLEND_MULTIPLY.
TEMP[1].w will be needed for OUT.w just below.  Use TEMP[0] to store the
intermediate value.
2010-12-04 23:41:30 +08:00
Vinson Lee 09fba30fde mesa: Clean up header file inclusion in texobj.h. 2010-12-04 01:29:50 -08:00
Vinson Lee f657ac951d mesa: Clean up header file inclusion in texgetimage.h. 2010-12-04 01:20:28 -08:00
Vinson Lee 0ed245bd57 mesa: Clean up header file inclusion in texformat.h. 2010-12-04 01:11:33 -08:00
Vinson Lee f8a9f5458b mesa: Clean up header file inclusion in texenvprogram.h. 2010-12-04 01:03:52 -08:00
Vinson Lee f618f4549a mesa: Clean up header file inclusion in texcompress_s3tc.h. 2010-12-04 01:00:21 -08:00
Vinson Lee 8aa4cd0e50 st/vega: Silence uninitialized variable warning.
Fixes this GCC warning.
api_filters.c: In function 'execute_filter':
api_filters.c:184: warning: 'tex_wrap' may be used uninitialized in this function
2010-12-04 00:53:44 -08:00
Vinson Lee 3132591a4d mesa: Clean up header file inclusion in texcompress.h. 2010-12-04 00:52:14 -08:00
Chia-I Wu e87a0cd260 st/vega: Blending should use premultiplied alpha.
Convert color values to and back from premultiplied form for blending.
Finally the rendering result of the blend demo looks much closer to that
of the reference implementation.
2010-12-04 15:44:40 +08:00
Chia-I Wu e8ff3931f8 st/vega: Add support for per-channel alpha.
Drawing an image in VG_DRAW_IMAGE_STENCIL mode produces per-channel
alpha for use in blending.  Add a new shader stage to produce and save
it in TEMP[1].

For other modes that do not need per-channel alpha, the stage does

  MOV TEMP[1], TEMP[0].wwww
2010-12-04 13:20:38 +08:00
Chia-I Wu a19eaaa6c1 st/vega: Move masking after blending.
Masking should happen after blending.  The shader is not entirely
correct, but leave it as is for now.
2010-12-04 13:20:38 +08:00