Compare commits

..

12443 Commits

Author SHA1 Message Date
Stéphane Marchesin
ac8f59b23e i915g: always upload the vs constants.
This fixes a crash in llvm draw.
2011-06-24 19:59:17 -07:00
Eric Anholt
773556e0f5 i965/gen5: Fix grf_used calculation for 16-wide.
If we happened to allocate a texture result (or other vector) to the
highest hardware register slot, and we were in 16-wide, we would
under-count the registers used and potentially wrap around to g0 if
that allocation crossed a 16-register block boundary.  Bad rendering
and hangs ensued.

Tested-by: Ian Romanick <idr@freedesktop.org>
2011-06-24 17:57:53 -07:00
Stéphane Marchesin
7b44830ef4 i915g: add fake occlusion queries.
Those always return 0, but at least we don't crash when exposing GL 2.0.
2011-06-24 17:28:54 -07:00
Stéphane Marchesin
3a7953910a i915g: Don't do shader fixup if no surface is bound. 2011-06-24 16:43:58 -07:00
Stéphane Marchesin
1a69b50b3b i915g: Fix point sprites. 2011-06-24 16:30:19 -07:00
Brian Paul
6b28b44d45 indices: fix conversion of PIPE_PRIM_POLYGON to lines
When the fill mode is PIPE_POLYGON_MODE_LINE we were basically
converting the polygon into triangles, then drawing the outline of all
the triangles.  But we really only want to draw the lines around the
perimeter of the polygon, not the interior lines.

NOTE: This is a candidate for the 7.10 branch.
2011-06-24 16:44:43 -06:00
Paul Berry
95c2e0b601 i965: fix mask used to write to clip distance registers when gen>6
In gen6 and above, clip distances 0-3 are written to message register
3's xyzw components, and 4-7 to message register 4's xyzw components.
Therefore when when writing the clip distances we need to examine the
lower 2 bits of the clip distance index to see which component to
write to.

emit_vertex_write() was examining the lower 3 bits, causing clip
distances 4-7 not to be written correctly.

Fixes piglit test vs-clip-vertex-01.shader_test
2011-06-24 15:35:49 -07:00
Alex Deucher
3acae45915 r600g: limit fs_write_all shader rebuild to eg+
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-24 18:27:39 -04:00
Alex Deucher
feec48114b r600g: eg+ support for FS_COLOR0_WRITES_ALL_CBUFS
Evergreen+ don't support multi-writes so we need to emulate
it in the shader. Fixes the following piglit tests:
fbo-drawbuffers-fragcolor
ati_draw_buffers-arbfp-no-option

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-24 18:22:47 -04:00
Chad Versace
6062692cc6 intel: Fix workaround for _mesa_update_framebuffer
In intel_draw_buffer, there exists a workaround to prevent
_mesa_update_framebuffer from creating a swrast depth wrapper when
using separate stencil. This commit fixes the workaround, which was
incomplete for s8z24 texture renderbuffers.

Fixes fbo-blit-d24s8 on gen5 with separate stencil manually enabled.

Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-24 14:47:21 -07:00
Chad Versace
97f263c229 intel: Change framebuffer validation criteria
Since all infrastructure is now in place to support packed
depth/stencil renderbuffers when using separate stencil, there is no
need for special cases when separate stencil is enabled.

Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-24 14:47:21 -07:00
Chad Versace
e357ae9494 intel: In intel_update_wrapper, support s8z24 textures when using separate stencil
Also, in order to coerce intel_update_tex_wrapper_regions() to
allocate the hiz region, alter intel_update_tex_wrapper_regions() to
examine the renderbuffer format instead of the texture image format.

Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-24 14:47:20 -07:00
Chad Versace
bffae4c9cd intel: Factor region updates out of intel_update_wrapper
... and into new function intel_update_tex_wrapper_regions.

This prevents code duplication in the next commit.

Also add a note explaining that the hiz region is broken for mipmapped
depth textures.

Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-24 14:47:20 -07:00
Chad Versace
d09704b4e9 intel: During glTexImage, allocate renderbuffers for faking s8z24 textures
... when using separate stencil.

Define function intel_tex_image_x8z24_create_renderbuffers and call it
in intelTexImage after the miptree has been created and filled with data.

Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-24 14:47:20 -07:00
Chad Versace
5cd4d85517 intel: Declare some functions in intel_fbo.c as non-static
... because they will be needed by intel_tex_image_s8z24_create_renderbuffers.

Redeclared functions are:
    intel_alloc_renderbuffer_storage
    intel_renderbuffer_set_draw_offsets

Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-24 14:47:20 -07:00
Chad Versace
8869a26237 intel: Change signature of intel_create_wrapped_renderbuffer
Redeclare as non-static because
intel_tex_image_s8z24_create_renderbuffers will use it.

Remove the 'wrapper' parameter, because there is no wrapper for
intel_texture_image.depth_rb and stencil_rb.

Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-24 14:47:20 -07:00
Chad Versace
951b75808e intel: Perform gather on s8z24 texture images during glGetTexImage
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-24 14:47:19 -07:00
Chad Versace
01e493980c intel: Define functions intel_texture_s8z24_scatter/gather
... which copy the stencil bits between intel_image->depth_rb and
intel_image->stencil_rb.

Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-24 14:47:19 -07:00
Chad Versace
1a062dfc6f intel: Add fields to intel_texture for faking s8z24 with separate stencil
Add the fields depth_rb and stencil_rb, and put hooks in place to
release the renderbuffers in intelFreeTextureImageData and
intelTexImage.

Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-24 14:47:19 -07:00
Stéphane Marchesin
407832b0d2 st/mesa: add PIPE_FORMAT_R8G8B8A8_UNORM as the first RGBA format.
Otherwise we can end up creating RGBA render targets (which are BGRA on the
hardware), and then we bind them as RGBA textures (which are RGBA on the
hardware). This generates software fallbacks every time we bind the frame as
a texture.
2011-06-24 14:32:48 -07:00
Marek Olšák
100a37587f mesa: don't allocate memory in _mesa_unpack_depth_span if we don't need it
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-06-24 22:09:27 +02:00
Marek Olšák
12c105b5de mesa: fix a memory leak in _mesa_unpack_depth_span
NOTE: This is a candidate for the 7.10 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-06-24 22:09:27 +02:00
Marek Olšák
e41a91cea7 mesa: fix texstore of DEPTH24_STENCIL8 if srcFormat is STENCIL_INDEX
NOTE: This is a candidate for the 7.10 branch.
2011-06-24 22:09:27 +02:00
Marek Olšák
2b41399bb4 mesa: remove unused function _mesa_new_depthstencil_renderbuffer
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-06-24 22:09:27 +02:00
Brian Paul
09e71cf722 st/mesa: fix pipe_get_transfer() call in fallback_copy_texsubimage()
Commit 1a339b6c71 caused us to take
a different path through the glCopyTexSubImage() code.  The
pipe_get_transfer() call neglected to pass the texture's level, face
and slice info.  So we were always transferring from the 0th mipmap
level even when the source renderbuffer was a non-zero mipmap level
in a texture.

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=38649

NOTE: This is a candidate for the 7.10 branch.
2011-06-24 14:03:40 -06:00
Benjamin Franzke
629c15aaac egl_dri2: Build drm platform only if enabled 2011-06-24 22:00:45 +02:00
Vadim Girlin
eafd331cf3 r600g: implement fragment and vertex color clamp
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=38440

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2011-06-24 15:23:41 -04:00
Vadim Girlin
d81126b714 r600g: optimize spi update
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2011-06-24 15:23:38 -04:00
Vadim Girlin
8567e02dca r600g: LIT: fix x&y slots order
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2011-06-24 15:23:35 -04:00
Eric Anholt
0c27dcb75c i965: Make the brw_format_for_mesa_format table static const.
Once again, assuming the compiler is clever works out so poorly.  The
generated code initialized the structure on the stack, then did a
lookup into it.  This was a performance regression from
70c6cd39bd.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-06-24 10:37:22 -07:00
Eric Anholt
3541cc0d40 i965: Don't bother telling swrast_setup about state updates until fallback.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-06-24 10:37:18 -07:00
Eric Anholt
6cf3d1cace i965: Don't bother telling tnl about state updates unless we fall back.
This was sucking up 1% of the CPU on 3DMMES.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-06-24 10:37:15 -07:00
Eric Anholt
18d4a44bdc i965: Reuse existing program data when a new compiled program matches.
It's common in applications just before the advent of
EXT_separate_shader_objects to have multiple linked shaders with the
same VS or FS.  While we aren't detecting those at the Mesa level, we
can detect when our compiled output happens to match an existing
compiled program.

This patch was created after noting the incredible amount of compiled
program data generated by Heroes of Newerth.  It reduces the program
data in use at the start menu (replayed by apitrace) from 828kb to
632kb, and reduces CACHE_NEW_WM_PROG state flagging by 3/4.  It
doesn't impact our rate of hardware state changes yet, because things
depending on CACHE_NEW_WM_PROG also depend on BRW_NEW_FRAGMENT_PROGRAM
which is still being flagged.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-06-24 10:36:49 -07:00
Brian Paul
d91dc4a356 st/mesa: fix all_varyings_in_vbos() regression
Fixes regression from d631c19db4.
See http://bugs.freedesktop.org/show_bug.cgi?id=38626
2011-06-24 10:41:44 -06:00
Marc Pignat
c0c0bb6cb1 Fix 24bpp software rendering
This patch add the support for 24bpp in the dri/swrast implementation.

Signed-off-by: Marc Pignat <marc@pignat.org>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-06-24 09:38:24 -06:00
Brian Paul
08183357c0 gallium/tests/trivial: update comment 2011-06-24 09:02:57 -06:00
Brian Paul
b663292ae9 gallium/tests/trivial: use CXX to do final link 2011-06-24 09:02:47 -06:00
Alon Levy
c9760c5c89 gallium/tests/trivial: make it build
Signed-off-by: Alon Levy <alevy@redhat.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-06-24 08:59:42 -06:00
Chia-I Wu
febf5e4147 st/egl: make native_buffer interface typed
Use a typed struct to describe the native buffer and let the backends
map the native buffer to winsys_handle for
resource_from_handle/resource_to_handle.
2011-06-24 16:49:27 +09:00
Chia-I Wu
875a1f8960 targets/egl: removed
Not used.
2011-06-24 16:49:27 +09:00
Chia-I Wu
b8f097f7a0 targets/egl-static: replace targets/egl
Build egl_gallium from targets/egl-static intead of targets/egl.  The
latter exposes (unversioned) gallium interfaces and is frowned upon.
2011-06-24 16:49:27 +09:00
Chia-I Wu
7451bffad4 targets/egl-static: allow st/mesa to be dynamically loaded
When shared glapi is not enabled, there are two glapi providers and we
cannot decide which one to link to at build time.  It results in
unresolved symbols in st/mesa.  This commit makes st/mesa a loadable
module when shared glapi is not enabled, and hopes that the apps will
link to one of the glapi providers (GL or GLES).
2011-06-24 16:43:03 +09:00
Chia-I Wu
a000745f80 targets/egl-static: add support for driver lookup
Use pci id to driver map to look up the driver name.  This is based on
a433755ec5.
2011-06-24 16:43:03 +09:00
Chia-I Wu
f36d210c93 targets/gbm: build pipe drivers
Build pipe drivers here instead of using those built by the
soon-to-be-removed targets/egl.

[with an update by Benjamin Franzke to use --{start|end}-group]
2011-06-24 16:43:03 +09:00
Benjamin Franzke
15e64242f9 configure: Disable drm egl platform by default
So that gbm(_dri) which pulls in shared-glapi is not needed.
2011-06-24 09:37:19 +02:00
Stéphane Marchesin
d3d3fea720 dri/r200: properly spell current_atom. 2011-06-23 21:00:26 -07:00
Stéphane Marchesin
5f691ba36f dri/r200: rename __atom to current_atom.
__atom is defined by gcc when the atom compile optimizations are used.
2011-06-23 20:58:05 -07:00
Vinson Lee
ad7387fe12 gallivm: Fix x86 build with llvm-3.0svn.
LLVM revision 133739 renamed StackAlignment to StackAlignmentOverride.
2011-06-23 20:48:05 -07:00
Chia-I Wu
45aecf0114 st/egl: drop guess_gl_api from egl_g3d_loader
It is not used and confusing.
2011-06-24 12:18:52 +09:00
Chia-I Wu
cb29ee91a2 st/egl: use a helper to get st_api from the loader 2011-06-24 12:18:52 +09:00
Brian Paul
ca7510bbf9 mesa: fix incorrect error string 2011-06-23 17:09:13 -06:00
Christoph Bumiller
9c5d15e929 nv50,nvc0: prevent pushbuf flush during ctx reloc emission
Should unify this too, but will delay that until the planned
libdrm_nouveau/winsys changes which are likely to cause major
changes to this bo validation code too.
2011-06-24 00:15:58 +02:00
Brian Paul
1f544cc587 st/mesa: fix format selection regression
Note all gallium formats are supported by Mesa so disable them.
Fixes regression from 1a339b6c71.

See https://bugs.freedesktop.org/show_bug.cgi?id=38602
2011-06-23 16:06:42 -06:00
Eric Anholt
d631c19db4 vbo: Don't discount stride == 0 for testing all varyings in VBOs.
In fixed function, stride == 0 (e.g. glColor4f() outside of the draw
call) would get turned into uniform inputs, which is why it was
ignored originally in this test.  For shaders, drivers end up seeing a
need to upload stride == 0 data, and get confused by needing to upload
when vbo_all_varyings_in_vbos() returned true.  In the 965 driver
case, it wouldn't bother to compute the min/max index, and uploaded
nothing if the min/max wasn't known.

We've talked about removing the ff stride=0-into-uniforms code, so
this check shouldn't be missed once that's gone.

Fixes ARB_vertex_buffer_object/mixed-immediate-and-vbo
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=37934
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-06-23 13:43:23 -07:00
Eric Anholt
8f28c05d07 vbo: Don't bother checking for stride == 0 for "any varying in a VBO".
We would still want to consider that data as being in a VBO even if we
managed to produce this case, which as far as I know we can't.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-06-23 13:43:17 -07:00
Eric Anholt
babe1fc004 i965/gen6: Add a couple more packets to the nonpipelined workaround list.
All the packets chosen before came from grepping the pdf for
nonpipelined, and these two came from grepping for non.pipelined.  We
could stand a review by looking at all packets emitted and identifying
what kind they are.
2011-06-23 13:41:42 -07:00
Paul Berry
935e7e4126 glsl: Flagged extension EXT_texture3D as "supported" in the builtin compiler.
Previously, the builtins in OES_texture_3D.{frag,vert} were only
compiling properly as a consequence of bug 38015, which allows
unsupported extensions to be enabled.  This fix eliminates the builtin
compiler's reliance on bug 38015, so that bug 38015 can be fixed.
2011-06-23 13:39:47 -07:00
Benjamin Franzke
e9d49d282d st/egl: Fix scons build 2011-06-23 22:23:57 +02:00
Benjamin Franzke
737bd7367e st/egl: Hookup gbm for drm backend 2011-06-23 21:07:17 +02:00
Benjamin Franzke
e5fc4c81ce egl_dri2: Hookup gbm as drm platform 2011-06-23 21:07:17 +02:00
Benjamin Franzke
48d4a001b3 gbm: Add gallium (drm) backend 2011-06-23 21:07:17 +02:00
Benjamin Franzke
2ff797060d gbm: Add dri backend 2011-06-23 21:07:17 +02:00
Benjamin Franzke
eddcecbf74 Add gbm (generic/graphics buffer manager) 2011-06-23 21:07:17 +02:00
Benjamin Franzke
15d7f1c1c7 st/dri: Implement DRIimageExtension::dupImage 2011-06-23 21:07:17 +02:00
Benjamin Franzke
3af3c58dfd intel: Implement DRIimageExtension::dupImage 2011-06-23 21:07:17 +02:00
Benjamin Franzke
5fbbd4c19f dri: Add dupImage to DRIimageExtension 2011-06-23 21:07:17 +02:00
Benjamin Franzke
fa5478c5fe r600g: Add R8G8B8A8_UNORM to evergreen colorswap table
Fixes broken glTexImage2D with format=GL_RGBA since
1a339b6c71

The origin for this behaviour is that r600_is_format_supported
checks only against r600_state_inline.h tables not evergreens.
2011-06-23 21:06:36 +02:00
Marek Olšák
1e5cef96d1 r600g: bump shader input limits 2011-06-23 15:58:49 +02:00
Brian Paul
8a5a28b731 st/wgl: return height, not width for WGL_PBUFFER_HEIGHT_ARB
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=38599
2011-06-23 06:54:53 -06:00
Benjamin Franzke
87c3bb65bb st/egl/wayland: Take resize parameters only if size changes
This matches what we do in egl_dri2, and clients should
behave like this anyway.
2011-06-23 12:17:48 +02:00
Chia-I Wu
7587c140cd st/mesa: use a helper for st_framebuffer creation
In st_api_make_current, we would like to reuse the exising
st_framebuffer if possible.  Use a helper function to make the code
clearer.
2011-06-23 10:36:00 +09:00
Stéphane Marchesin
1a339b6c71 st/mesa: prefer native texture formats when possible.
If possible, we want to match the hardware format to what the app uses. By
doing so, we avoid the need for pixel conversions and therefore greatly speed
up texture uploads.
2011-06-22 17:02:21 -07:00
Stéphane Marchesin
98ce1373e4 i915g: Add draw point sprites.
It's not that much work; hopefully blend func separate also works and we get GL 2.0 for real.
2011-06-22 16:51:02 -07:00
Stéphane Marchesin
468c2c0841 i915g: Fix comment.
Reported-by: Marcin Baczynski <marbacz@gmail.com>
2011-06-22 16:47:36 -07:00
Stéphane Marchesin
465183c6ae i915g: Support more texture and render target formats. 2011-06-22 16:44:54 -07:00
Alex Deucher
5ff22ab229 r600c: add missing bank tiling case for evergreen
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-22 12:38:29 -04:00
Alex Deucher
c4930cb417 r600g: fix num_banks interpretation on eg+
Field is encoded:
0 = 4 banks
1 = 8 banks
2 = 16 banks

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-22 12:34:37 -04:00
Michel Dänzer
eb2c9b5814 r600g: Fix use of uninitialized local variable extra_size.
Should fix http://bugs.freedesktop.org/show_bug.cgi?id=38566 .
2011-06-22 16:23:36 +02:00
Thierry Vignaud
76bd1c1818 mesa: add missing DRI Makefiles to tarball
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-06-22 08:22:02 -06:00
Brian Paul
9786688672 mesa: comments and 80-column wrapping 2011-06-22 08:12:10 -06:00
Brian Paul
3c95ff209f mesa: update comments in update_program_enables() 2011-06-22 08:12:10 -06:00
Brian Paul
79dddedfd1 mesa: update/fix comments in update_program() 2011-06-22 08:12:10 -06:00
Brian Paul
f3f080e526 mesa: update comment for gl_texture_unit 2011-06-22 08:12:10 -06:00
Marcin Slusarz
50d7d03a79 xorg/nouveau: blacklist all pre NV30 cards
Bail out early in probe, so other driver can take control of the card.
Doing it in screen_create would be too late.
2011-06-22 12:35:40 +02:00
Andre Maasikas
63e8cda9f1 r600c: use BASE_VTX_LOC & AUTO_INDEX for drawing nonindexed with offset
Saves cmd buffer space as we were generating indexes into cs  in this case.
This was laying around in https://bugs.freedesktop.org/show_bug.cgi?id=32768
for a long time.
2011-06-22 12:40:12 +03:00
Alex Deucher
21972c85ea r600g: fix fbo depth/stencil texture allocation for evergreen+
evergreen+ stores depth and stencil separately so when we
allocate a depth/stencil fbo, make sure we allocate enough
memory for both depth and stencil buffers.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-21 17:32:42 -04:00
Chad Versace
3db27d4a4a intel: Allocate s8_z24 non-texture renderbuffers when using separate stencil
Now all infrastructure is in place to support s8_z24 non-texture
renderbuffers for gen7.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-21 11:22:05 -07:00
Chad Versace
36e05c6870 intel: Unobfuscate intel_alloc_renderbuffer_storage
Hiz buffer allocation can only occur if the 'else' branch has been taken,
so move the hiz buffer allocation into the 'else' branch.

Having the hiz buffer allocation dangling outside of the if-tree was just
damn confusing.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-21 11:21:57 -07:00
Chad Versace
39d0e3632a intel: Add fields to intel_renderbuffer for unwrapping packed depth/stencil buffers
Add the following fields:
    intel_renderbuffer.wrapped_depth;
    intel_renderbuffer.wrapped_stencil

If the intel_context is using separate stencil and the renderbuffer has
a packed depth/stencil format, then wrapped_depth and wrapped_stencil are
the real renderbuffers.

Alter the following functions to accomodate the wrapped buffers:
    intel_delete_renderbuffer
    intel_draw_buffer
    intel_get_renderbuffer
    intel_renderbuffer_map
    intel_renderbuffer_unmap

Subsequent commits allocate renderbuffer storage for wrapped_depth and
wrapped_stencil.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-21 11:21:57 -07:00
Chad Versace
23ed3b90c7 intel: Unconditionally enable support for S8_Z24 texture format
Commit b5c847c7ca erroneously disabled
support for S8_Z24 texture format when the context required separate
stencil (intel_context.must_use_separate_stencil).

But the GL spec requires implementations to support GL_DEPTH24_STENCIL8.
So we better find a way to fake it...

From page 180 (196 of pdf) of the OpenGL 3.0 spec:
    In addition, implementations are required to support the following
    sized internal [texture] formats.

    [...]

    - Combined depth+stencil formats: DEPTH32F_STENCIL8 and and
      DEPTH24_STENCIL8.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-21 11:21:57 -07:00
Benjamin Franzke
0cb356dd5c egl_dri2/wayland: Hook up new buffer.release event 2011-06-21 13:11:43 -04:00
Benjamin Franzke
8c91d751c8 winsys/wayland: Fix warning 2011-06-21 13:11:43 -04:00
Benjamin Franzke
0c74091591 st/mesa: Invalidate drawables on context switch 2011-06-21 15:09:55 +02:00
Dave Airlie
e251b3903a r600g: use maths instead of a loop to work out mask.
This is equivalent results with less looping.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-21 15:18:44 +10:00
Dave Airlie
59a402cecd r600g: optimise draw vbo function a bit more.
this drop a bunch of unnecessary checks (i.e. should be trapped
at gallium level), and also removes the switch statement in favour
of some calculated values for the vgt values.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-21 14:20:49 +10:00
Pierre-Eric Pelloux-Prayer
abe74a9820 r600g: reorder LIT instructions to support src == dst
the attached patch should be an improvement over Vadim Girlin's patch
fixing LIT instruction for r600g (commit
2fe39b46e7).

Instructions used in tgsi_lit have been reordered to always write to a
dst channel after the same channel in src has been read (so if src ==
dst, input values are not overwritten before being used).

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-21 12:50:44 +10:00
Ben Skeggs
4112ca54e3 nvfx: nasty hack to make glFinish() actually finish..
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-06-21 12:59:53 +10:00
Stéphane Marchesin
75be6b76ee glx: Fix compile. 2011-06-20 17:19:00 -07:00
Stéphane Marchesin
649d03d54d st/mesa: Remove unneeded texture format terminators.
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-06-20 18:15:50 -06:00
Brian Paul
bc60a7515a st/mesa: put const qualifer on format_map table 2011-06-20 18:15:50 -06:00
Jeremy Huddleston
4fbdde889c glx: Bind to our context before __glXSetCurrentContext
We want to bind to our context before calling __glXSetCurrentContext or
messing with the gc rect in order to properly handle error conditions.

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-20 16:54:58 -07:00
Jeremy Huddleston
517614141b glx: Destroy the old context only after the new one has been bound
This fixes a regression introduced by 49d7e48b33

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-20 16:54:58 -07:00
Jeremy Huddleston
559e4f8ebc glx: Allow a context-specific fallback for glXGetProcAddress
In applegl, GLX advertises the same extensions provided by OpenGL.framework
even if such extensions are not provided by glapi.  This allows a client
to get access to such API.

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-20 16:54:58 -07:00
Jeremy Huddleston
fbd7448977 glapi: Update specs to correctly list FramebufferTextureLayerARB as an alias of FramebufferTextureLayerEXT
FramebufferTextureLayer is an alias of FramebufferTextureLayerEXT, so
FramebufferTextureLayerARB needs to be listed as an alias of
FramebufferTextureLayerEXT rather than FramebufferTextureLayer.

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-20 16:54:58 -07:00
Ian Romanick
de77324d8f linker: Reject shaders that use too many varyings
Previously it was up to the driver or later code generator to reject
these shaders.  It turns out that nobody did this.

This will need changes to support geometry shaders.

NOTE: This is a candidate for the stable branches.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=37743
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-06-20 15:01:10 -07:00
Dan Nicholson
4e5c51a05e glw: Mark all extern symbols GLAPI to regain default visibility (#31294)
Since switching to hidden visibility on gcc, GLw apps were failing to
link. Use the GLAPI definition to use default visibility where necessary.

$ nm lib/libGLw.so | grep DrawingArea
0000000000004020 T GLwCreateMDrawingArea
0000000000003430 T GLwDrawingAreaMakeCurrent
0000000000003410 T GLwDrawingAreaSwapBuffers
0000000000204c60 D glwDrawingAreaClassRec
0000000000204d48 D glwDrawingAreaWidgetClass
00000000002053c0 D glwMDrawingAreaClassRec
00000000002054e0 D glwMDrawingAreaWidgetClass

Signed-off-by: Dan Nicholson <dbn.lists@gmail.com>
Tested-by: justin <jlec@gentoo.org>
2011-06-20 12:31:01 -07:00
Eric Anholt
f6e5230b26 i965/gen6: Apply documented workaround for nonpipelined state packets.
Fixes a 100% reproducible GPU hang in topogun-1.06-orc-84k.trace.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-06-20 08:42:16 -07:00
Eric Anholt
0ab7d6f437 i965/gen6: Limit the workaround flush to once per primitive.
We're about to call this function in a bunch of state emits, so let's
not spam the hardware with flushes too hard.
2011-06-20 08:37:43 -07:00
Eric Anholt
dfada714f8 i965/gen6: Use an BO instead of writing to address 0 for PIPE_CONTROL W/A.
This was spectacularly unsafe.  On my system, address 0 happens to be
the hardware status page for the render ring, and the first quadword
of that happens to contain nothing we ever look at, but I sure didn't
look forward to having to debug some day when, for example, the kernel
happened to bind the ringbuffer before binding the hwsp.
2011-06-20 08:37:43 -07:00
Eric Anholt
8f9e8d79c8 i965/gen6: Factor the PIPE_CONTROL workaround to a separate function.
We're need this workaorund a lot more than we're currently doing, so
let's reuse it.
2011-06-20 08:37:43 -07:00
Eric Anholt
911768700e i965/gen6: Remove state flagging on BRW_NEW_CURBE_OFFSETS.
That flag was leftover from gen4, where brw_curbe.c is choosing ranges
of the CURBE space for constants to live in, and the unit state tells
where to load them from.  That's not the case on gen6 -- we don't set
this flag (since constants aren't in the URB), nor do we have any
state like that to upload.
2011-06-20 08:37:43 -07:00
Eric Anholt
c860f48f11 i965/gen4: Remove old VS unit state key structure.
We're streaming VS state out now, not caching it.
2011-06-20 08:37:42 -07:00
Eric Anholt
7d4d608240 i965/gen6: Add missing state flag for VS push constants.
It was already annotated up above and everything.
2011-06-20 08:37:42 -07:00
Eric Anholt
b46dc45cee i965/gen6+: Correct gratuitous dependency on NEW_POLYGONSTIPPLE.
That flag is for the contents of the stipple, not the enable flag.
2011-06-20 08:37:42 -07:00
Eric Anholt
416a698b3c i965/gen6+: Add a missing state flag for WM constants. 2011-06-20 08:37:42 -07:00
Kristian Høgsberg
16a04e019d wayland: Pass use_invalidate extension to driver 2011-06-20 11:05:26 -04:00
Benjamin Franzke
80636ff2da egl_dri2/x11: Check availability of the dri2 extension
Do this before query versions, or xcb will shutdown
and the connection can not be used for swrast.
2011-06-20 10:06:24 -04:00
Chia-I Wu
8eea050f5a docs: update EGL for changed configure options 2011-06-20 11:19:16 +09:00
Chia-I Wu
66c71d150a configure.ac: remove deprecated EGL options 2011-06-20 11:19:16 +09:00
Marcin Slusarz
c772d4e6f3 xorg/nouveau: rename to nouveau2
Signed-off-by: Marek Olšák <maraeo@gmail.com>
2011-06-20 02:29:28 +02:00
Marcin Slusarz
a97b40a886 st/xorg: initialize drm_mode.type
it's uninitialized, but used by kernel (drm_mode_setcrtc -> drm_mode_set_crtcinfo)

Signed-off-by: Marek Olšák <maraeo@gmail.com>
2011-06-20 02:28:02 +02:00
Marcin Slusarz
21c0556b61 st/xorg: add GALLIUM_AUXILIARIES to target dependencies
Without it changes to GALLIUM_AUXILIARIES don't induce target rebuild

Signed-off-by: Marek Olšák <maraeo@gmail.com>
2011-06-20 02:26:53 +02:00
Marcin Slusarz
2f6a9687cf gallium/nouveau: remove unused nouveau_screen_bo_user 2011-06-20 02:23:12 +02:00
Marcin Slusarz
fe20edf959 st/xorg: fix crash triggered by rendercheck -t composite -f a8r8g8b8 -o Src, Saturate
samplers[0] may remain uninititialized if src picture/pixmap is null
2011-06-20 02:20:26 +02:00
Marcin Slusarz
54d1b718b8 st/xorg: fix crash triggered by rendercheck -t blend -f a8r8g8b8 -o Clear 2011-06-20 02:11:12 +02:00
Marek Olšák
badf0335ef r600g: implement seamless_cube_map on r600-r700
st/mesa guarantees that all bound sampler states have the same value
in seamless_cube_map.
2011-06-20 00:19:07 +02:00
Marek Olšák
9bcce02f47 r600g: remove some magic numbers 2011-06-19 23:28:33 +02:00
Marek Olšák
1251e1df0f configure.ac: add back --enable-gallium-egl 2011-06-19 21:15:55 +02:00
Cyril Brulebois
9ba2907f2e configure.ac: Avoid running llvm-config when it hadn't been checked for.
If --disable-gallium is passed, llvm-config isn't checked for, so mark
it explicitly as absent, through LLVM_CONFIG=no.

Passing --disable-gallium would result in:
| ../configure: line 9739: --version: command not found
| ../configure: line 9740: --cppflags: command not found
| ../configure: line 9741: --libs: command not found
| ../configure: line 9743: --ldflags: command not found

With this commit, one gets that instead:
| configure: error: LLVM is required to build Gallium R300 on x86 and x86_64

Signed-off-by: Cyril Brulebois <kibi@debian.org>
2011-06-19 21:15:55 +02:00
Marek Olšák
0c7c5b6876 configure.ac: build r600g by default
Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-19 21:15:52 +02:00
Marek Olšák
58b6a19ea4 configure.ac: add option --with-gallium-drivers=DIRS
This removes all the --enable-gallium-$driver options and --disable-gallium.

Gallium can be disabled by --with-gallium-drivers= (without parameters).

Default is:
--with-gallium-drivers=r300,swrast

Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-19 21:15:48 +02:00
Marek Olšák
440d71db78 configure.ac: remove --with-state-trackers
There is an obvious redundancy:

--with-driver=dri VS --with-state-trackers=dri
--with-driver=xlib VS --with-state-trackers=glx
--enable-openvg VS --with-state-trackers=vega
--enable-egl VS --with-state-trackers=egl

This patch adds two new options for the remaining state trackers:
--enable-xorg
--enable-d3d1x

Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-19 21:15:45 +02:00
Marek Olšák
ad50abbac9 configure.ac: remove redundant option --enable-gallium-egl
We already have --enable-gallium, --enable-egl, and --with-state-trackers=egl.

Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-19 21:13:57 +02:00
Marek Olšák
d1f66a9424 u_vbuf_mgr: make u_vbuf_mgr_draw_begin return flags in a bitmask 2011-06-19 21:09:18 +02:00
Marek Olšák
8623c68aec r600g: fix warning: assignment discards qualifiers from pointer target type 2011-06-19 21:09:18 +02:00
Marek Olšák
0d58723cde u_vbuf_mgr: fix uploading if format size is greater than stride 2011-06-19 21:09:18 +02:00
Kenneth Graunke
dd3b812962 i965: Enable extension GL_ARB_shader_texture_lod.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=36987

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-06-18 17:54:01 -07:00
Kenneth Graunke
6430df3773 i965/fs: Add support for TXD with shadow comparisons.
Our hardware doesn't have a sample_d_c message, so we have to do a
regular sample_d and emit instructions to manually perform the
comparison.

This requires a state dependent recompile whenever the sampler's compare
mode or function change.  This adds the per-sampler comparison functions
to brw_wm_prog_key, but only sets them when the sampler's compare mode
is GL_COMPARE_R_TO_TEXTURE (i.e. only for shadow sampling).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-06-18 17:53:57 -07:00
Kenneth Graunke
01fa9addf4 i965/fs: Refactor texture result swizzling into a helper function.
The next patch will add a few additional uses.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-06-18 17:53:55 -07:00
Kenneth Graunke
f1622cfe9c i965/fs: Move sampler fetch to the top of the ir_texture visit function.
This makes it available earlier, which will soon be necessary.
(Separating code motion from actual changes.)

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-06-18 17:53:53 -07:00
Kenneth Graunke
6c947cfd19 i965/fs: Add support for non-shadow textureGrad (TXD) on gen4.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-06-18 17:53:52 -07:00
Kenneth Graunke
2f4a4b943f i965/fs: Add support for non-shadow textureGrad (TXD) on gen5/6.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-06-18 17:53:50 -07:00
Kenneth Graunke
3fa910fff9 i965/fs: Add support for non-shadow textureGrad (TXD) on Ivybridge.
This is somewhat ugly, but I couldn't think of a nicer way to handle the
interleaved coordinate/derivative parameter loading.

Ironlake and Sandybridge will still hit an assertion in visit().

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-06-18 17:53:47 -07:00
Kenneth Graunke
ad9481e128 i965/fs: Check for compilation failure and bail before optimizing.
Prior to this patch, it would attempt to optimize and allocate registers
for the program even if it failed to compile.  This seems wasteful.

More importantly, the "message length > 11" failure seems to choke the
instruction scheduler, making it somehow use an undefined value and
segmentation fault.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-06-18 17:53:24 -07:00
Eric Anholt
c173541d97 i965: Use state streaming on programs, and state base address on gen5+.
There will be a little bit of thrashing of the program cache BO as the
cache warms up, but once the application is in steady state, this
reduces relocations on gen5 and later.

On my T420 laptop, cairogl firefox-talos-gfx performance improves 2.6%
+/- 1.3% (n=6).  No statistically significant performance difference
on nexuiz (n=5).
2011-06-18 16:00:45 -07:00
Eric Anholt
962dab9486 i965: Only flag the new-batch related state as dirty at new batch time.
This was debug code from the initial import of the driver.  No
statistically significant performance difference on cairo-gl or
nexuiz (n=6).
2011-06-18 16:00:45 -07:00
Eric Anholt
6f998b58bc mesa: Fix render-to-texture regression.
Accidentally introduced in fc8c4a3a7b.
Fixes fbo-drawbuffers-maxtargets and friends.
2011-06-18 15:59:00 -07:00
Eric Anholt
001e071443 mesa: Flag _NEW_BUFFERS when unbinding an attachment on glDeleteTextures.
The _ColorDrawBuffers[] wouldn't get updated despite us having updated
what it depends on (Attachments[]->Renderbuffer).  Other callers of
_mesa_remove_attachment are already flagging _NEW_BUFFERS for other
reasons.  The specific bug report that led to this fix (and
the fbo-finish-deleted testcase) was fixed by
23b6f9606d, though.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-06-18 15:26:26 -07:00
Eric Anholt
a5a36d9b15 i965: Don't try to continue space before the start of a VBO.
This loop is trying to see if all the buffers to be uploaded happen to
be the same increment from the start of the 3DSTATE_VERTEX_BUFFERS
currently loaded in the hardware.  However, we might be at a smaller
offset than the previous set of VERTEX_BUFFERS, so we can't reuse
because that packet made the first entry be its starting offset (you
can't access outside the given bounds).

Fixes piglit ARB_vertex_buffer_object/elements-negative-offset.
2011-06-18 15:20:36 -07:00
Eric Anholt
5c2c60175d i965: Add missing state flag for vertex elements on current VS program.
Fixes a missing 3DSTATE_VERTEX_ELEMENTS on topogun.trace.
2011-06-18 15:20:35 -07:00
Marek Olšák
a4f4e24f07 r300g: rename AOS -> VARRAYS 2011-06-18 21:09:08 +02:00
Marek Olšák
7df7eaf845 r300g: fix handling PREP_* options
This should fix rendering >65532 vertices using draw_arrays on r300-r400.

NOTE: This is a candidate for the 7.10 branch.
2011-06-18 21:09:08 +02:00
Vadim Girlin
2fe39b46e7 r600g: fix LIT to handle src==dst properly
Current LIT implementation uses dst components for storing temp
results, possibly overwriting still needed values (depends on the
swizzles).
This patch uses temp reg for one of such cases (found in etqw) and
fixes "LIT R.z, R.xyzz".

Tested on evergreen. Fixes some etqw-demo rendering glitches when
"Lighting" is set to "High" in the settings.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-18 16:03:04 +10:00
Vadim Girlin
8ab1c5328b r600g: fix RSQ to use abs value of operand on evergreen
fixes https://bugs.freedesktop.org/show_bug.cgi?id=36917

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-18 16:01:03 +10:00
Vadim Girlin
a916d4279a r600g: fix source box in r600_resource_copy_region
Source box needs to be adjusted for blitting from compressed formats.

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

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-18 15:45:59 +10:00
Brian Paul
753660780a mesa: allow depth texture arrays
The GL_EXT_texture_array spec allows this (Section 3.8.1).
Fixes failing piglit fbo-depth-array test.

NOTE: This is a candidate for the 7.10 branch.
2011-06-17 13:44:59 -06:00
Brian Paul
da5c852d63 st/mesa: remove unneeded test for GL_TRUE 2011-06-17 13:44:59 -06:00
Brian Paul
15750d89b9 st/mesa: remove redundant _mesa_is_depth_format() call
The _mesa_is_depth_or_stencil_format() call covers all depth
format cases too.
2011-06-17 13:44:59 -06:00
Brian Paul
3ea6fdfdf1 st/mesa: remove trailing whitespace in st_format.c 2011-06-17 13:44:59 -06:00
Brian Paul
befaab8fa1 st/mesa: move comment for ChooseTextureFormat() to right place 2011-06-17 13:44:59 -06:00
Jeremy Huddleston
cb5a5f055b apple: Use apple_cgl_get_dl_handle() rather than opening a new handle
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-17 12:20:57 -07:00
José Fonseca
10562fbc5c scons: List all targets. 2011-06-17 20:13:16 +01:00
José Fonseca
ef4bf40db0 scons: Remember the options set on the command line.
Save them in config.py
2011-06-17 20:13:16 +01:00
José Fonseca
c9be435c79 scons: Don't list MSVS_VERSION option outside windows platforms. 2011-06-17 20:13:16 +01:00
José Fonseca
d6a0fe19e8 scons: Correct glapi USE_xxx_ASM flags. 2011-06-17 20:13:16 +01:00
José Fonseca
c7bd0fa485 scons: Accept verbose=yes instead of quiet=no.
'verbose' is affirmative, and much more common name for this sort of option.
2011-06-17 20:13:16 +01:00
Stéphane Marchesin
bf69ce37f0 glx: implement drawable refcounting.
The current dri context unbind logic will leak drawables until the process
dies (they will then get released by the GEM code). There are two ways to fix
this: either always call driReleaseDrawables every time we unbind a context
(but that costs us round trips to the X server at getbuffers() time) or
implement proper drawable refcounting. This patch implements the latter.

Signed-off-by: Antoine Labour <piman@chromium.org>
Signed-off-by: Stéphane Marchesin <marcheu@chromium.org>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2011-06-17 11:20:19 -07:00
José Fonseca
8173471fc2 scons: Move all env setup to scons/gallium.py 2011-06-17 16:41:05 +01:00
José Fonseca
4175010749 scons: make embedding orthogonal to the platform
To enable embedding in platforms other than linux.
2011-06-17 14:50:37 +01:00
Brian Paul
fc8c4a3a7b mesa: use helper functions to distinguish between user/winsys FBOs
And replace IS_CUBE_FACE() macro w/ inline function.
2011-06-16 07:31:58 -06:00
Brian Paul
37e6ab7b2d mesa: refactor, create _mesa_update_draw_buffers() helper
Move this code out of _mesa_make_current() and put it into a
helper function.
2011-06-16 07:31:58 -06:00
Brian Paul
2960526816 mesa: updated comments in _make_current() 2011-06-16 07:31:58 -06:00
Vadim Girlin
016621ee14 r600: fix SPI inputs setup on r600/r700
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-16 15:23:06 +10:00
Chad Versace
8875dd5871 intel: Fix typo in intel_offset_S8 comments
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-15 15:50:45 -07:00
Chad Versace
d105f6684d i965/gen5,6: Fix hang when emitting hiz buffer without stencil buffer
When emitting either a hiz or stencil buffer, the 'separate stencil
enable' and 'hiz enable' bits are set in 3DSTATE_DEPTH_BUFFER. Therefore
we must emit both 3DSTATE_HIER_DEPTH_BUFFER and 3DSTATE_STENCIL_BUFFER.

Even if there is no stencil buffer, 3DSTATE_STENCIL_BUFFER must be
emitted; failure to do so causes a hang on gen5 and a stall on gen6.

This also fixes a silly, obvious segfault that occured when a hiz buffer
xor separate stencil buffer existed.

Fixes the piglit tests below on Gen5 when hiz and separate stencil are
manually enabled:
    fbo-alphatest-nocolor
    fbo-depth-sample-compare
    fbo
    hiz-depth-read-fbo-d24-s0
    hiz-depth-stencil-test-fbo-d24-s0
    hiz-depth-test-fbo-d24-s0
    hiz-stencil-read-fbo-d0-s8
    hiz-stencil-test-fbo-d0-s8
    fbo-missing-attachment-clear
    fbo-clear-formats
    fbo-depth-*

Changes piglit test result from crash to fail:
    hiz-depth-stencil-test-fbo-d0-s8

Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-15 15:47:59 -07:00
Marek Olšák
6f243ec25d r600g: disable render condition for some blitter operations 2011-06-15 15:24:37 +02:00
Mike Kaplinskiy
40aec11b75 r600g: fix TXD src regs needing fetching.
[airlied: final chunk of Mike's patch from bug 37476
this uses a loop to emit the GRADIENTS and does a check to
see if we need to fetch to a temporary register. It also
increases the context src gpr to 4 which is needed here.]

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-15 16:58:40 +10:00
Mike Kaplinskiy
6415f25663 r600g: use inlines for some common tex instr setup code.
[airlied: taken from Mike's patch in bug 37476]

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-15 16:58:40 +10:00
Kenneth Graunke
ef8f6a8c59 glsl/builtins: Actually implement int/ivec variants of abs().
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>

NOTE: This is a candidate for stable release branches (and don't forget
      to re-run "make builtins" after cherry-picking.)
2011-06-14 23:41:16 -07:00
Mike Kaplinskiy
de91ea1c06 r600g: fix TXD when shadowing is enabled.
Mike had actually done a lot of the TXD support in a patch in bug
37476 which I see now, I'll add the bits of his work that I didn't think
to add to my work.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-15 15:54:21 +10:00
Dave Airlie
13c9a8552b r600g: add TXD support.
This at least passes the piglit arb_shader_texture_lod-texgrad test,
the AMD shader analyzer seems to multiply the V component by an unspecified
constant value no idea why.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-15 15:18:42 +10:00
Brian Paul
34a774797c i915g: add const qualifier to silence warning 2011-06-14 20:47:47 -06:00
Marek Olšák
d9ca94836e r600g: also set TILE_MODE of the base level 2011-06-15 04:16:05 +02:00
Marek Olšák
677a4406d2 r600g: force OpenGL's BASE_LEVEL behavior on r600-r700
This sets the base level as the zero level, which fixes
piglit/texturing/tex-miplevel-selection*.

The r600 hardware ignores the BASE_LEVEL field in some cases, so we can't
use it.

Evergreen might need this too.
2011-06-15 03:39:24 +02:00
Kenneth Graunke
7c7a8a38e5 glsl/generate_builtins.py: Remove regexp to kill pointer addresses.
Commit 56ef62d988
"glsl: Generate readable unique names at print time."
changed ir_print_visitor to not generate @0x1234567 suffixes except
where necessary.  So there's no need to manually remove them.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-06-14 18:29:48 -07:00
Jeremy Huddleston
1e16c34c5c glapi: _glapi_create_table_from_handle: Set missing pointers to NoOp rather than NULL
This change to _glapi_create_table_from_handle causes it to fill the dispatch
table with NoOps for unimplemented functionality.  This matches what is done
in indirect_init.c and also allows us to enable logging (when built with
-DDEBUG and the MESA_DEBUG or LIBGL_DEBUG environment variables are set) to
catch cases where clients are trying to use these unimplemented extentions.

Additionally, this fixes some gcc -pedantic warnings.

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-14 18:22:01 -07:00
Brian Paul
3751aa4592 st/mesa: fix indentation, whitespace 2011-06-14 17:19:53 -06:00
Brian Paul
99feecc7d1 st/mesa: replace st->ctx with ctx 2011-06-14 17:19:53 -06:00
Brian Paul
c1477f6ffe st/mesa: fix comments, whitespace 2011-06-14 17:19:53 -06:00
Brian Paul
cbad86841b docs: 7.10.3 updates 2011-06-14 17:19:53 -06:00
Brian Paul
ee231b30a8 st/mesa: improved is_interleaved_arrays() checking
Check that the difference in array pointers/offsets from the 0th
array are less than the stride, for both VBOs and user-space arrays.
Previously, we were only doing this for the later.

This tightens up the interleaved array test and fixes a problem with
the llvmpipe driver where we were creating way too many vertex fetch
variants only because the pipe_vertex_element::src_offset values were
changing frequently.  This change results in a 5x speed-up for one of
the viewperf tests.

Also, clean up the function to make it easier to understand.
2011-06-14 17:19:53 -06:00
Alex Deucher
24a760e9cb r600c: add tiling support for evergreen+
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-14 18:40:37 -04:00
Marek Olšák
7d488ade23 r600g: fix RGB32F texturing 2011-06-14 20:47:57 +02:00
Marek Olšák
df6355512a r600g: fix indentation and comments 2011-06-14 20:37:57 +02:00
Eric Anholt
10e418f381 mesa: Switch generate_mipmaps_compressed() to using TexImage2D to upload.
The code was playing fast and loose with rowstrides, which meant that
if a driver chose anything different for its alignment requirements,
the generated mipmaps came out garbage.  Unlike the uncompressed case,
we can't generate mipmaps directly into image->Data, so by using
TexImage2D we cut out most of the weird logic that existed to generate
in-place into ->Data.  The up/downside is that the driver recovery
code for the fact that _mesa_generate_mipmaps whacked ->Data has to be
turned off for compressed now.

Fixes 6 piglit tests about compressed mipmap gen.
2011-06-14 11:17:39 -07:00
Eric Anholt
b0c4db68b2 mesa: Remove uncompressed code from generate_mipmaps_compressed(). 2011-06-14 11:17:39 -07:00
Eric Anholt
2bfd81df0a mesa: Remove compressed code from generate_mipmaps_uncompressed(). 2011-06-14 11:17:39 -07:00
Eric Anholt
ba55ccd312 mesa: Split _mesa_generate_mipmap along compressed/uncompressed lines.
The path taken is wildly different based on this (do we generate from
a temporary image, or from level-1's data), and we appear to have
stride bugs in the compressed case that are tough to disentangle.

This just duplicates the code for the moment, the followon commit will
do the actual changes.  Only real code change here is handling
maxLevel in one common place.
2011-06-14 11:17:39 -07:00
Eric Anholt
b9fbb9df22 intel: Fix miptree height alignment for compressed NPOT textures.
This is effectively just "round up when dividing by 4" compared to the
previous code.  Fixes the broken stripe at the top of
fbo-generatemipmap-formats GL_EXT_texture_compression_rgtc.
2011-06-14 11:17:39 -07:00
Eric Anholt
56965aa007 intel: Drop dead preinitialization of align_w, align_h. 2011-06-14 11:17:39 -07:00
Eric Anholt
f94fef83db intel: Drop the cpp argument to intel_miptree_create(). 2011-06-14 11:17:39 -07:00
Eric Anholt
6dcc398ac0 intel: Calculate compress_byte in intel_miptree_create.
One less argument and thing to get wrong.
2011-06-14 11:17:39 -07:00
Eric Anholt
9c5fdbb721 intel: Use the gl_format to get the base_format for miptree create.
One less argument to this insanely long function call.
2011-06-14 11:17:39 -07:00
Eric Anholt
9a523a48af intel: Drop the internal_format field of the mipmap tree.
This has been replaced with the gl_format now.
2011-06-14 11:17:38 -07:00
Eric Anholt
0fac09a87c intel: Make the intel_miptree_match_image format check more specific.
We don't care just about the internalFormat/cpp/compressed, but about
the specific format chosen.  We have no support for format
translations as part of texture validation, and furthermore it has
restrictions in the GL specification.  However, we should be making
consistent decisions for this check anyway.
2011-06-14 11:17:38 -07:00
Eric Anholt
afbe605eff i915: Drop dead argument to translate_texture_format(). 2011-06-14 11:17:38 -07:00
Eric Anholt
4a60b0c8d2 intel: Add block alignment for RGTC textures.
We were using the default 4x2 alignment instead of the 4x4 required
for RGTC textures.
2011-06-14 11:17:26 -07:00
Eric Anholt
d5809115b5 intel: Add the MESA_FORMAT as a field of the miptree.
We only had internal_format before, which is way more irritating to
work with.
2011-06-14 11:15:43 -07:00
Eric Anholt
51ce86b781 intel: Fix 2x2 and 1x1 compressed teximages from _mesa_generate_mipmap()
Generally image uploads to a the region occur at TexImage time, but
that's not the case for fallback _mesa_generate_mipmap(), and in this
path we were forgetting to align the width when dividing height.  We
were just leaving out parts of the compressed block at 2x2 and 1x1
levels.

Fixes gen-compressed-teximage.
2011-06-14 11:15:29 -07:00
Marek Olšák
13dcf3f20d r600g: disable shader_texture_lod until there is driver support 2011-06-14 20:03:04 +02:00
Adam Jackson
130e7ead87 llvmpipe: SSE2 fastpaths for b8g8r8x8 {un,}swizzle
Copy-and-paste from the bgra cases.  The C paths attempt to avoid
copying the 'x' channel, but it's harmless, you might as well.  Good for
about 5% in glxgears (740 to 780 fps).

Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-06-14 11:51:13 -04:00
Christoph Bumiller
a8b9a75b92 nv50: fix copy/paste error in nv50_gmtyprog_validate
Used the vertprog instead of gmtyprog.
2011-06-14 17:15:08 +02:00
Jeremy Huddleston
a128355ecb apple: Set the glapi dispatch table on context bind
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-14 00:48:20 -07:00
Marek Olšák
c17fb8539f configure.ac: cleanup the gallium-r300 option 2011-06-14 04:11:26 +02:00
Marek Olšák
e823ab1b00 st/xorg: remove unused variable 2011-06-14 03:49:26 +02:00
Marek Olšák
f318a15f45 r600g: do not link with softpipe 2011-06-14 01:45:11 +02:00
Marek Olšák
b5b7d2acc6 r300g: do not link with softpipe 2011-06-14 01:45:11 +02:00
Marek Olšák
be2b9bdcee xorg-radeon: rename to xorg-r300 2011-06-14 01:45:11 +02:00
Marek Olšák
63e38bd0f6 target-helpers: remove copy-pasted function inline_noop_helper 2011-06-14 01:45:11 +02:00
Vadim Girlin
9346d895e7 r600g: skip SPI setup for position and face inputs
fixes fdo bug 38145

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-14 09:17:16 +10:00
Dave Airlie
2743851c1a r600g: move depth texture flushing out of line.
this needs a piglit run.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-14 09:17:16 +10:00
Eric Anholt
296e6b9038 meta: Fix glCopyTexImage(GL_LUMINANCE) from non-GL_LUMINANCE source.
glReadPixels() was performing RGB -> L conversion differently from the
glTexImage() style conversion appropriate for glCopyTexImage().

Fixes gles2conform copy_texture.
2011-06-13 15:56:36 -07:00
Eric Anholt
df46eb8ec0 intel: Fix mipmap and format handling of blit glCopyPixels().
Fixes fbo-mipmap-copypix.
2011-06-13 15:56:36 -07:00
Eric Anholt
ef0d548838 intel: Do the drawable x/y offset in intel_renderbuffer_map() for spans.
We were mapping the renderbuffer once, then walking over all the
buffers to map just the texture ones using the other texture mapping
function that handled the x/y offset to the image in the region.  But
then we would go and overwrite *those* mappings with the original
mappings for depth/stencil, which was wrong.

Instead, just walk over the attachments once and map the attachments.
Wasn't that easy?
2011-06-13 15:56:36 -07:00
Eric Anholt
fb60e2061b intel: Use rb->Data and rb->RowStride to handle spans Y flipping.
This is already pointing at 0 or Height - 1 and with an appropriate
pitch, so no need to recompute those values per customization of the
spans code.  Cuts 3 out of 21kb of the compiled size.

Reviewed-by: Chad Versace <chad@chad-versace.us>
2011-06-13 15:56:36 -07:00
Eric Anholt
d29117752f intel: Clean up intel_render_texture with a rename and a helper function.
The "newImage" isn't particularly new -- it might be the same texture
that was attached to the same attachment point before.  This function
also gets called when just rebinding back to an FBO with a texture
attachment.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad@chad-versace.us>
2011-06-13 15:56:36 -07:00
Eric Anholt
b17aab5753 intel: Move the draw_x/draw_y to the renderbuffer where it belongs.
It was originally located in the region because the tracking of
depth/color buffers was on the regions, and getting back to the irb
would have been tricky.  Now, we're keying off of the renderbuffer in
more places, which means we can move these fields where they belong.

This could fix potential rendering failure with a single texture
having multiple images attached to different renderbuffers across
shareCtx (as far as I can tell, this was the only failure we could
cause, since anything else should trigger intel_render_texture in
between, for example a BindFramebuffer).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad@chad-versace.us>
2011-06-13 15:56:36 -07:00
Brian Paul
4fa01d705f dri: include swrast.h, not s_texrender.h 2011-06-13 16:07:55 -06:00
Jeremy Huddleston
816b8acfe8 glx: Remove check for gc->vtable->destroy
gc->vtable->destroy is always set and is used unconditionally
in other places, so don't bother checking for it first.

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-13 14:51:01 -07:00
Jeremy Huddleston
c6cf82fb55 apple: applegl_destroy_context: Pass along the correct display
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-13 14:51:01 -07:00
Jeremy Huddleston
e903cc17bb apple: Dead code removal
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-13 14:51:01 -07:00
Jeremy Huddleston
b44d13e67b glapi: Add check for NULL symbol_prefix in gentable and fix warnings
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-13 14:50:37 -07:00
Daniel Vetter
df8d26ec09 i915g: add a few more render target formats
Snatched from xvmc.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-06-13 23:05:43 +02:00
Brian Paul
755f2e2ae5 mesa: move texrender.c to swrast
This stuff is really for software rendering, it's not core Mesa.
A small step toward pushing the FetchTexel() stuff down into swrast.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-06-13 13:45:39 -06:00
Brian Paul
8852e35e29 vbo: minor simplification in print_draw_arrays() debug function 2011-06-13 13:45:39 -06:00
Brian Paul
e6e1864f1c mesa: move invariant code out of loop in get_tex_rgba() 2011-06-13 13:45:39 -06:00
Mathias Fröhlich
2f0b44f981 r600g: Put shaders into immutable buffers.
Put the shader programs into an immutable buffer object.
Also make sure that those object can be taken from the user
space buffer object pool.
2011-06-13 11:33:20 -04:00
Mathias Fröhlich
b0f1767d77 r600g: Allow VRAM for the initial domain for every buffer binding. 2011-06-13 11:33:14 -04:00
Mathias Fröhlich
e1f88016ec r600g: Set the domains value also for recycled buffer objects. 2011-06-13 11:31:55 -04:00
Mathias Fröhlich
e2529442e6 r600g: Fix typo.
Fix an obvious typo in the yet unused part of the shader setup.
2011-06-13 11:31:13 -04:00
Pierre-Eric Pelloux-Prayer
92563476e4 r600g: remove useless call to u_upload_flush
No regressions found with :
- piglit (quick.tests)
- Unigine Heaven
- Lightsmark
- openarena
- Imprudence (Second Life fork)

agd5f Note: this patch was previously reverted due to piglit
regressions, but I'm not able to reproduce them here.
See this bug:
https://bugs.freedesktop.org/show_bug.cgi?id=34008
and discussion:
http://lists.freedesktop.org/archives/dri-devel/2011-June/011996.html

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-13 11:26:54 -04:00
Marek Olšák
317247390a st/mesa: rebind vertex arrays if _NEW_BUFFER_OBJECT is dirty
This fixes piglit/vbo-bufferdata. It's a regression in 7.11.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-06-13 17:03:56 +02:00
Pierre-Eric Pelloux-Prayer
b19d86701e r600g: fixed bo memory leak issue
pipe_resource_reference call was miossing, thus creating massive memory under certain conditions.
Fix : https://bugs.freedesktop.org/show_bug.cgi?id=37168
2011-06-13 10:47:07 -04:00
Chia-I Wu
77b7e1b58f mapi: declare x86_entry_start/end static
x86_entry_start and x86_entry_end are defined by the inline assembly.
Declaring them static saves one instruction in entry_get_public.
2011-06-13 12:19:47 +08:00
Benjamin Franzke
3e1caf5d26 mapi: Fix tls with shared/es-glapi on x86-64
x86_64_entry_start needs to be declared static in the C code,
in order to have the correct address in entry_get_public
(seems not to be needed on x86).

The compiler needs to lookup a local not a global object.

Otherwise addresses needed for _glapi_proc_address will be computed
from some random offset (0x6400229a61058b48 in my case).
2011-06-13 12:19:47 +08:00
Chia-I Wu
982cb36584 wayland-drm: remove depend on "make clean" 2011-06-13 12:19:47 +08:00
Chia-I Wu
77e031a1c4 egl_dri2: try swrastg_dri if swrast_dri fails
Per libGL.
2011-06-13 12:19:39 +08:00
Chia-I Wu
cf69eeacc6 egl_dri2: add dri2_load_driver_swrast
Refactor dri2_load_driver and add dri2_load_driver_swrast for loading
swrast DRI driver.
2011-06-13 11:11:43 +08:00
Benjamin Franzke
16e30276e8 egl_dri2: Compare configs before matching them
This compares attribs like buffer size, and will prevent merging
unequal configs because of match criterion is e.g. ATLEAST.
2011-06-12 08:56:35 -04:00
Benjamin Franzke
a23bf646bd st/eglwayland: Add support for EGL_DEFAULT_DISPLAY 2011-06-12 08:56:35 -04:00
Benjamin Franzke
b8325fd255 egl_dri2/wayland: Add support for EGL_DEFAULT_DISPLAY 2011-06-12 08:56:35 -04:00
Jeremy Huddleston
9a00dd9746 apple: Request OpenGL 3.2 from OpenGL.framework if available
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-11 23:43:38 -07:00
Jeremy Huddleston
df1dacf093 apple: Store the CGL API version number for future reference
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-11 23:43:03 -07:00
Jeremy Huddleston
02b6e97c75 apple: Use a struct glx_config * rather than a void * in apple_visual_create_pfobj
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-11 22:54:59 -07:00
Jeremy Huddleston
f35913b96e apple: Use _glapi_create_table_from_handle to initialize our dispatch table
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-11 21:55:01 -07:00
Jeremy Huddleston
85937f4c0d glapi: Add API that can create a _glapi_table from a dlfcn handle
Example usage:

void *handle = dlopen(opengl_library_path, RTLD_LOCAL);
struct _glapi_table *disp = _glapi_create_table_from_handle(handle, "gl");

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-11 21:55:01 -07:00
Marek Olšák
837dc61011 r300g: max_anisotropy of 1 is not anisotropic filtering 2011-06-11 23:03:20 +02:00
Daniel Vetter
219150433a i915g: implement fence signalling
v2: Incorporated feedback from Jakob Bornecrantz.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-06-11 17:11:26 +02:00
Eric Anholt
4176025d46 i965: Add support for GL_FIXED vertex attributes.
This sadly requires work in the VS to rescale them, because the
hardware doesn't support this format natively.

Fixes arb_es2_compatibility-fixed-type and gtf/fixed_data_type.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-06-10 13:17:10 -07:00
Eric Anholt
20f087863d glsl: Fix incorrect optimization of instructions before discard statements.
The function was named "find_unconditional_discard", but didn't
actually check that the discard statement found was unconditional.
Fixes piglit glsl-fs-discard-04.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-06-10 13:17:01 -07:00
Eugeni Dodonov
23ef4a6063 Fix format not a string literal error with -Werror=format-security
A trivial fix for error: format not a string literal and no format
arguments with compiling with -Werror=format-security flags.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-06-10 12:20:07 -07:00
Chad Versace
97d230b0bc i965/brw: Fix emit_depthbuffer() when packed depth/stencil texture is attached
If either depth or stencil buffer has packed depth/stencil format, then do
not use separate stencil.

Before this commit, emit_depthbuffer() incorrectly assumed that the
texture's stencil renderbuffer wrapper was a *separate* stencil buffer,
because the depth and stencil renderbuffer wrappers are distinct for
depth/stencil textures (that is, depth_irb != stencil_irb).

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=38134
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-10 10:37:30 -07:00
Alex Deucher
eca3e910ed r600g: VGT_PRIMITIVE_TYPE is special
It's a special reg and does not require a flush like
the other CONFIG regs.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-09 16:54:23 -04:00
Alex Deucher
8681ebcf7f r600g: Handle CONFIG regs properly
CONFIG regs (byte offsets 0x8000-0xac00) are single state and the pipeline
must be flushed and hw idle when they are changed.  Border color regs
are in the CONFIG range and this is why a flush is required when changing
them.  CONTEXT regs (byte offset 0x28000+) are multi-state and those do
not require flushes when changing them.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-09 16:26:50 -04:00
Eric Anholt
6861a70177 i965/gen6: Add support for gl_PointCoord.
This is just like PointSprite overrides, but it's always on for that
attribute.

Fixes glsl-fs-pointcoord, gtf/point_sprites.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2011-06-09 08:41:54 -07:00
Eric Anholt
f304bb8a5d i965/gen6: Fix point sprite texture coordinate overrides.
We were assuming that the input attribute n to the FS was
FRAG_ATTRIB_TEXn, which happened to be true often enough for our
testcases.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2011-06-09 08:41:51 -07:00
Eric Anholt
e7280b16d6 i965/gen6: Refactor SF setup a bit to handle overrides in one place.
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2011-06-09 08:41:45 -07:00
Marek Olšák
da8b4c0798 r300g: fix texturing with non-3D textures and wrap R mode set to sample border
If the wrap R (3rd) mode is set to CLAMP or CLAMP_TO_BORDER and the texture
isn't 3D, r300 always samples the border color regardless of texture
coordinates.

I HATE THIS HARDWARE.

NOTE: This is a candidate for the 7.10 branch.
2011-06-09 04:19:03 +02:00
Marek Olšák
466ce95ddf r300g: don't enable aniso with nearest filtering 2011-06-09 04:19:03 +02:00
Dave Airlie
04554c7d3a r600g: adjust vs/ps gprs on r600/r700 cards when needed.
Ideally we'd have a compiler and register spilling and all that
but this is good enough for now to avoid the gpu hang in piglit,

glsl-vs-vec4-indexing-temp-dst-in-nested-loop-combined

on r600/r700 cards.

based on r600c patch
Andre Maasikas <amaasikas@gmail.com>
r600c: bump sq gpr resources if a shader needs more than default

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-09 11:25:02 +10:00
Marek Olšák
d56fe67c62 r600g: remove unused variable 2011-06-09 01:34:24 +02:00
Marek Olšák
578d4539ba r300g: fix draw_vbo splitting on r3xx-r4xx
NOTE: This is a candidate for the 7.10 branch.
2011-06-09 01:25:52 +02:00
Marek Olšák
f48412c39f r300g: make translate_primitive table-driven 2011-06-09 01:25:52 +02:00
Roland Scheidegger
d302804deb util: fix strict aliasing issues in u_format_r11g11b10f.h 2011-06-09 01:14:51 +02:00
Roland Scheidegger
c1090f3019 mesa: get rid of homegrown logbase2 implementation in drivers
Some of the logbase2 functions did just the same as _mesa_logbase2,
though they were taking signed numbers (but it shouldn't matter for them).
2011-06-09 01:14:51 +02:00
Roland Scheidegger
da009212fe mesa: fix gcc version check for _mesa_bitcount
The version check was bogus, and only inside a non-gcc block anyway.
2011-06-09 01:14:50 +02:00
Roland Scheidegger
b537f54b3a mesa: use __builtin_clz for logbase2 when available
Also rename to _mesa_logbase2 and move to imports.h to keep the ugly
ifdef GNUC stuff outside other files (also to allow reuse).
2011-06-09 01:14:50 +02:00
Roland Scheidegger
b3d5822e93 util: add gcc version check for builtins
Looks like only next_power_of_two, logbase2 and bitcount use builtins
requiring gcc 3.4, so maybe everything else compiles with older gcc.
2011-06-09 01:14:50 +02:00
Benjamin Bellec
894db40f12 util: better logbase2/next_power_of_two implementations
Use __builtin_clz when available for logbase/next_power_of_two,
and replace next_power_of_two with faster implementation otherwise.
2011-06-09 01:14:50 +02:00
José Fonseca
9f865646f1 glx/xlib: Handle glXCreateContextAttribsARB in glXGetProcAddress. 2011-06-08 22:53:27 +01:00
Kenneth Graunke
4ef8464068 i965/gen7: Call gen7_create_constant_surface instead of brw_[...].
Fixes 17 piglit tests:
- glsl-vs-arrays-3
- glsl-vs-texturematrix-2
- glsl-vs-uniform-array-2
- arl
- nv-arl
- nv-init-zero-addr
- vp-address-01
- vp-arl-constant-array
- vp-arl-constant-array-huge
- vp-arl-constant-array-huge-offset
- vp-arl-constant-array-huge-offset-neg
- vp-arl-constant-array-huge-relative-offset
- vp-arl-constant-array-huge-varying
- vp-arl-env-array
- vp-arl-local-array
- vp-arl-neg-array
- vp-arl-neg-array-2

Fixes 4 glean tests:
- glsl1-constant array of vec4 with variable indexing, vertex shader
- glsl1-constant array with variable indexing, vertex shader
- glsl1-constant array with variable indexing, vertex shader (2)
- vp1-ARL test

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-06-08 14:51:11 -07:00
Kenneth Graunke
acf82657f4 i965/gen7: Enable SIMD16 fragment shader dispatch.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-06-08 14:51:11 -07:00
Kenneth Graunke
2a63807616 i965/gen7: Don't emit 3DSTATE_GS_SVB_INDEX on Ivybridge.
According to vol2a.07, it only applies from Cantiga to Sandybridge.

I found this in my ringbuffers while investigating various GPU hangs.
While it may not have been the cause, it seemed wise to remove it.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-06-08 14:51:11 -07:00
Kenneth Graunke
626440add5 i965/gen7: Program stencil buffers on Ivybridge.
Thanks to Chad's hard work implementing separate stencil and HiZ
support, this is entirely straightforward.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-06-08 14:51:11 -07:00
Kenneth Graunke
53b53a141e i965/gen7: Add a prepare_depthbuffer function.
We need to call add_validated_bo to do proper aperture space accounting.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-06-08 14:50:38 -07:00
Kenneth Graunke
a00ca90815 i965/gen7: gen7_emit_depthbuffer needs the _NEW_DEPTH dirty bit.
For ctx->Depth.Mask.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-06-08 14:31:12 -07:00
Kenneth Graunke
bd265201da i965/gen7: Remove stencil renderbuffer from gen7_depth_format.
Since Gen7 doesn't support packed depth/stencil, the stencil buffer
can't possibly be relevant for determining the depth format.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-06-08 14:31:04 -07:00
Brian Paul
e37e196151 st/mesa: more helpful debug message in destroy_program_variants_cb() 2011-06-08 15:15:07 -06:00
Brian Paul
2d22186ca8 svga: fix typos, update comments 2011-06-08 15:08:19 -06:00
Jeremy Huddleston
3b23cf43a4 glx: Remove some GLX_USE_APPLEGL guards around glapi
Now that we're using glapi, we don't need some GLX_USE_APPLEGL ifdef-foo

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-08 12:03:10 -07:00
Jeremy Huddleston
1b90d7d36b darwin: Use -fvisibility=hidden to set default symbol visibility
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-08 11:47:00 -07:00
Jeremy Huddleston
2835c5112d darwin: mklib: Make the real file match the id
This makes mesa more consistent with glibtool and XCode where the
generated file matches the dylib id rather using an extra symlink

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-08 11:24:26 -07:00
Chad Versace
aea2236af6 intel: Request DRI2 buffers for separate stencil and hiz
When it is sensible to do so,
    1) intelCreateBuffer() now attaches separate depth and stencil
       buffers
       to the framebuffer it creates.
    2) intel_update_renderbuffers() requests for the framebuffer
       a separate stencil buffer (DRI2BufferStencil).

The criteria for "sensible" is:
    - The GLX config has nonzero depth and stencil bits.
    - The hardware supports separate stencil.
    - The X driver supports separate stencil, or its support has not yet
      been determined.

If the hardware supports hiz too, then intel_update_renderbuffers()
also requests DRI2BufferHiz.

If after requesting DRI2BufferStencil we determine that X driver did not
actually support separate stencil, we clean up the mistake and never ask
for DRI2BufferStencil again.

CC: Ian Romanick <idr@freedesktop.org>
CC: Kristian Høgsberg <krh@bitplanet.net>
Acked-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-08 10:06:40 -07:00
Chad Versace
f4efb7ff4f intel: Add assertions to intelCreateBuffer()
Assert that the GLX config has an expected depth/stencil bit combination:
one of d24/s8, d16/s0, d0/s0. These are the only depth/stencil
configurations that we advertise.

Remove the check for software stencil, because given the assertions'
constraints the check always fails.

CC: Ian Romanick <idr@freedesktop.org>
CC: Kristian Høgsberg <krh@bitplanet.net>
Acked-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-08 10:06:40 -07:00
Chad Versace
89d34cfd3e intel: Refactor intel_update_renderbuffers()
Extract the code that queries DRI2 to obtain the DRIdrawable's buffers
into intel_query_dri2_buffers_no_separate_stencil().

Extract the code that assigns the DRI buffer's DRM region to the
corresponding renderbuffer into
intel_process_dri2_buffer_no_separate_stencil().

Rationale
---------
The next commit enables intel_update_renderbuffers() to query for separate
stencil and hiz buffers. Without separating the separate-stencil and
no-separate-stencil paths, intel_update_renderbuffers() degenerates into
an impenetrable labyrinth of if-trees.

CC: Ian Romanick <idr@freedesktop.org>
CC: Kristian Høgsberg <krh@bitplanet.net>
Acked-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-08 10:06:40 -07:00
Chad Versace
84294fe26c intel: Add function intel_renderbuffer_set_hiz_region()
It's the analog of intel_renderbuffer_set_region(), but for the hiz region
of course.

CC: Ian Romanick <idr@freedesktop.org>
CC: Kristian Høgsberg <krh@bitplanet.net>
Acked-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-08 10:06:40 -07:00
Chad Versace
beb8b7da20 intel/intel_context.c: Remove unused functions
Remove functions intel_override_hiz() and
intel_override_separate_stencil(). They are now located in intel_screen.c.

CC: Ian Romanick <idr@freedesktop.org>
CC: Kristian Høgsberg <krh@bitplanet.net>
Acked-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-08 10:06:40 -07:00
Chad Versace
6b2bf272ee intel: Add flags to intel_screen for hiz and separate stencil
Add the fields below to intel_screen. The expression in parens is the
value to which intelInitScreen2() currently sets the field.
    GLboolean hw_has_separate_stencil      (true iff gen >= 7)
    GLboolean hw_must_use_separate_stencil (true iff gen >= 7)
    GLboolean hw_has_hiz                   (always false)
    enum intel_dri2_has_hiz dri2_has_hiz   (INTEL_DRI2_HAS_HIZ_UNKNOWN)

The analogous fields in intel_context now inherit their values from
intel_screen.

When hiz and separate stencil become completely implemented for a given
chipset, then the respective fields need to be enabled.

CC: Ian Romanick <idr@freedesktop.org>
CC: Kristian Høgsberg <krh@bitplanet.net>
Acked-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-08 10:06:40 -07:00
Chad Versace
df9f533c67 intel: Define enum intel_dri2_has_hiz
... which indicates if the X driver supports DRI2BufferHiz and
DRI2BufferStencil.

I'm placing this in its own commit due to the large comment block.

CC: Ian Romanick <idr@freedesktop.org>
CC: Kristian Høgsberg <krh@bitplanet.net>
Acked-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-08 10:06:40 -07:00
Chad Versace
4501a5d6e8 dri2: Add token for DRI2BufferHiz
CC: Ian Romanick <idr@freedesktop.org>
CC: Kristian Høgsberg <krh@bitplanet.net>
Acked-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-08 10:06:40 -07:00
Chad Versace
ff99103c0a intel: Define span functions for S8 renderbuffers
Since the stencil buffer is interleaved, the generic Mesa renderbuffer
accessors do not suffice. Custom span functions are necessary.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-08 10:06:39 -07:00
Chad Versace
2abc8cae87 i965/brw: Emit state for hiz and separate stencil buffers
When emitting 3DSTATE_DEPTH_BUFFER, also emit 3DSTATE_HIER_DEPTH_BUFFER if
there is a hiz buffer. Ditto for 3DSTATE_STENCIL_BUFFER and a separate
stencil buffer.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-08 10:06:39 -07:00
Chia-I Wu
6b492d0976 st/egl: set EGL_ALPHA_MASK_SIZE 2011-06-09 00:23:24 +08:00
Chia-I Wu
4bb748b609 mesa: merge glapidispatch.h into dispatch.h
glapidispatch.h was located in glapi and shared with mesa core.  Because
the way it was shared, mesa core must include it indirectly via
main/dispatch.h.

Now that it is no longer needed by glapi and is located in core mesa,
merging it with main/dispatch.h to avoid wrong uses.
2011-06-08 23:19:01 +08:00
Chia-I Wu
0dc45374f2 mesa: fix function remapping for dlist
glapidispatch.h should not be included directly.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=36282
2011-06-08 23:18:57 +08:00
Chia-I Wu
fed482f5e3 mesa: fix GLES remap table setup again
Generate different glapidispatch.h's for GL and GLES.  For GLES, we want
a local remap table.

This reverts commit 5af46e8360.  The
commit will break GL remap table setup when main/glapidispatch.h is
regenerated.
2011-06-08 23:17:57 +08:00
Alex Deucher
fe3a343441 r600g: fix mixup in GPR resource reg setup
GLOBAL_GPR regs should be 0.  Need to set the
number of temp regs in SQ_GPR_RESOURCE_MGMT_1.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-08 10:50:18 -04:00
Brian Paul
7c2847a972 vbo: run 'indent' on vbo_save_api.c 2011-06-08 08:05:41 -06:00
Brian Paul
9404835ccd mesa: add include/c99/*.h files to tarballs
See https://bugs.freedesktop.org/show_bug.cgi?id=36238

NOTE: This is a candidate for the 7.10 branch.
2011-06-08 08:05:41 -06:00
Brian Paul
f1733d16de vbo: rename DO_FALLBACK -> dlist_fallback 2011-06-08 08:05:41 -06:00
Brian Paul
62811057f4 vbo: remove node->count > 0 test in vbo_save_playback_vertex_list()
See piglit dlist-fdo31590.c test and
http://bugs.freedesktop.org/show_bug.cgi?id=31590

In this case we had node->prim_count=1 but node->count==0 because the
display list started with glBegin() but had no vertices.  The call to
glEvalCoord1f() triggered the DO_FALLBACK() path.  When replaying the
display list, the old condition basically no-op'd the call to
vbo_save_playback_vertex_list call().  That led to the invalid operation
error being raised in glEnd().

NOTE: This is a candidate for the 7.10 branch.
2011-06-08 08:05:41 -06:00
Brian Paul
f1cdce95f6 vbo: check array indexes to prevent negative indexing
See the piglit dlist-fdo31590.c test

NOTE: This is a candidate for the 7.10 branch.
2011-06-08 08:05:41 -06:00
Brian Paul
a25271fcb8 st: use _mesa_is_bufferobj() 2011-06-08 08:05:41 -06:00
Brian Paul
d329b68f35 vbo: added a comment 2011-06-08 08:05:41 -06:00
Brian Paul
713fb50759 gallium: fix comments for pipe_stream_output_state 2011-06-08 08:05:40 -06:00
Brian Paul
3d75c42bbf mesa: remove old comment 2011-06-08 08:05:40 -06:00
Brian Paul
f9c2feb96b mesa: add more sampler types to is_sampler_type() 2011-06-08 08:05:40 -06:00
Brian Paul
5f2deba9f3 gallium: s/bool/boolean/ 2011-06-08 08:05:40 -06:00
Brian Paul
f6572017b9 draw: fix edge flag handling in clipper (for unfilled tris/quads/polygons)
Previously, we were errantly drawing some interior edges of clipped
polygons and quads.  Also, we were introducing extra edges where
polygons intersected the view frustum clip planes.

The main problem was that we were ignoring the edgeflags encoded in
the primitive header's 'flags' field which are set during polygon/quad
->tri decomposition.  We need to observe those during clipping.  Since
we can't modify the existing vert's edgeflag fields, we need to store
them in a parallel array.

Edge flags also need to be handled differently for view frustum planes
vs. user-defined clip planes.  In the former case we don't want to draw
new clip edges but in the later case we do.  This matches NVIDIA's
behaviour and it just looks right.

Finally, note that the LLVM draw code does not properly set vertex
edge flags.  It's OK on the regular software path though.
2011-06-08 08:05:40 -06:00
Jeremy Huddleston
0e8d045bf8 osmesa: Fix missing symbols when GLX_INDIRECT_RENDERING is defined.
When GLX_INDIRECT_RENDERING is defined, some symbols are used in
libglapi.a but are not defined.  Define them through the help of
glapitemp.h.

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2011-06-07 23:06:37 -07:00
Jeremy Huddleston
3a71f880d2 apple: Update dispatch table to current OpenGL specs
This updates the apple dispatch table to match the current glapi.
Aliases are still not handled very well.

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-07 23:06:37 -07:00
Jeremy Huddleston
3871e74733 apple: Dead code removal
Now that we're using glapi, all of this is no longer needed.

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-07 23:06:36 -07:00
Jeremy Huddleston
e157f381f2 apple: Remove apple_glx_get_proc_address
Now that we're using glapi, we don't need to special case this.

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-07 23:06:36 -07:00
Jeremy Huddleston
7d215e7c4d apple: Use glapi rather than reinventing the wheel
With this change, Apple's libGL is now using glapi rather than implementing
its own dispatch.  In this implementation, two dispatch tables are created:

__ogl_framework_api always points into OpenGL.framework.
__applegl_api is the vtable that is used.  It points into OpenGL.framework
or to local implementations that override / interpose this in OpenGL.framework

The initialization for __ogl_framework_api was copied from XQuartz with some
modifications and probably still needs further edits to better deal with
aliases.

This is a good step towards supporting both indirect and direct rendering
on darwin.

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-07 23:06:35 -07:00
Jeremy Huddleston
88cec59170 apple: Rename __gl_api to __ogl_framework_api
In starting the migration to using mapi, rename __gl_api to
__ogl_framework_api since it is a vtable for OpenGL.framework

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-07 23:06:35 -07:00
Dave Airlie
19b9e523c5 r600g: missed one line in eg dyn gpr fallback.
need more sleep or something.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-08 14:53:11 +10:00
Dave Airlie
9fb404b47e r600g: set enable always bits for r600/r700 sq registers.
This makes sure these are enabled even if set to 0 at startup.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-08 14:50:58 +10:00
Dave Airlie
190bfea2de r600g: condition evergreen dyn gpr resource management
So only with kernel version 2.7 can this work, thanks to Alex
for pointing that out. Also add a workaround for a hw bug.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-08 14:50:58 +10:00
Dave Airlie
e84981dede r600g: fix warnings in winsys.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-08 14:11:49 +10:00
Dave Airlie
c1f9884bbf r600g: enable dynamic GPR resource management on evergreen
Evergreen can do this as well as cayman, so we should enable it.

This fixes a gpu lockup with
glsl-vs-vec4-indexing-temp-dst-in-nested-loop-combined.shader_test

I need to add a better workaround for r600/r700.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-08 14:11:48 +10:00
Dave Airlie
f659cc46bc r600g: only add blocks once to the dirty/enabled lists.
This caused a loop in some tests.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-08 14:04:26 +10:00
Dave Airlie
a5329d4f78 r600g: fix regression in recent state changes.
We weren't emitting the SQ setup regs at all which really is
fail.

When a state is always enabled we need to add it to the dirty list
as well.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-08 13:22:02 +10:00
Dave Airlie
745abb53cf r600g: move simple part of bo reloc processing inline.
This just moves the messy stuff out of the fast path,
and leaves the fast-case in the fast path.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-08 11:47:01 +10:00
Dave Airlie
e66053d01c r600g: take alpha ref update out of line.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-08 11:47:00 +10:00
Dave Airlie
ba78a5a679 r600g: split resource emit path from main register emit path
Since resources don't generally vary in size, this splits
the emit path, it also takes into a/c that texture and vertex resources
have different number of relocs, and avoids emitting the extra
reloc for vertex resources.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-08 11:47:00 +10:00
Dave Airlie
ff8717527d r600g: exit bo per reg scanning loop early.
Exit this loop early to avoid pointless iterations later.

Move the resource bos to the first two regs, it actually
doesn't matter which regs we use for this in resource land.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-08 11:47:00 +10:00
Dave Airlie
138f660b58 r600g: reorder evergreen draw packets to be smaller.
We were always re-emitting lots of unnecessary changes here,
avoid doing that.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-08 11:47:00 +10:00
Dave Airlie
4707ae20ad r600g: inline r600_bo_reference.
This relies on the reference member being first, so document it.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-08 11:46:59 +10:00
Dave Airlie
ff298a66d7 r600g: no need to drop the references here.
We drop them when we reference the new objects in the next line.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-08 11:46:59 +10:00
Dave Airlie
e21601e46e r600g: use memcmp instead of a loop in state_set_resource
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-08 11:46:50 +10:00
Ian Romanick
bb4758669c mesa: Ignore blits to/from missing buffers
The EXT_framebuffer_object spec (and later specs) say:

     "If a buffer is specified in <mask> and does not exist in both
     the read and draw framebuffers, the corresponding bit is silently
     ignored."

Check for color, depth, and stencil that the source and destination
FBOs have the specified buffers.  If the buffer is missing, remove the
bit from the blit request mask and continue.

Fixes the crash in piglit test 'fbo-missing-attachment-blit from', and
fixes 'fbo-missing-attachment-blit es2 from'.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=37739
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>

NOTE: This is a candidate for the stable branches.
2011-06-07 18:29:52 -07:00
Ian Romanick
7f9c17aaa8 mesa: Don't try to clear a NULL renderbuffer
In an ES2 context (or if GL_ARB_ES2_compatibility) is supported, the
framebuffer can be complete with some attachments be missing.  In this
case the _ColorDrawBuffers pointer will be NULL.

Fixes the crash in piglit test fbo-missing-attachment-clear.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=37739
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>

NOTE: This is a candidate for the stable branches.
2011-06-07 18:29:52 -07:00
Nicolas Kaiser
1d71bbed3b mga: enable GL_ARB_vertex_array_object extension
Tested on a Matrox G550 AGP.

Signed-off-by: Nicolas Kaiser <nikai@nikai.net>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-06-07 16:32:30 -06:00
Benjamin Franzke
ac3c2c8ece egl_dri2: Add missing header 2011-06-07 17:59:16 -04:00
Benjamin Franzke
3b11d67ef6 egl_dri2: Add missing license 2011-06-07 17:58:59 -04:00
Benjamin Franzke
ec2b08de77 egl_dri2: Use libudev only if available
Broken since 7f881c43df.
2011-06-07 17:58:47 -04:00
Pierre-Eric Pelloux-Prayer
bdf2e11285 r600g : fix incorrect size computation in r600_query_result
query->num_results already has the size in dwords of the query
buffer.  There no need to multiply again.  We were reading past
the end of the buffer, resulting in reading garbage.

Fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=37028

agd5f: clarify the comment.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-07 17:40:37 -04:00
Alex Deucher
5d4c479822 r600g: remove pre-r6xx asic families and pci ids
Not sure why these were included originally.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-07 17:04:52 -04:00
Alex Deucher
7c1d478192 r600g: always clear query memory
According to the hw documentation, the driver needs to:
- allocate 128 bits for each possible DB
- clear the 128 bits for each possible DB
- write 1 to bits 127 and 63 for upper DBs that don't
exist on a particular asic

Previously we were only doing these steps if the
asic had less than the max possible DBs.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-07 16:44:40 -04:00
Marek Olšák
d7111353bd r300g: consolidate deducing chipset info
Use the new PCI ID table, make it simpler.
2011-06-07 21:02:52 +02:00
Marek Olšák
4123131f3c r300_pci_ids: set families to match r300g 2011-06-07 21:02:52 +02:00
Marek Olšák
eaae63b715 r600g: add missing r300 families
Wondering why r600g needs to include r300_pci_ids.h
2011-06-07 21:02:52 +02:00
Eric Anholt
6d894f68af intel: Update intel-decode.c from intel-gpu-tools. 2011-06-07 11:44:11 -07:00
Eric Anholt
23b6f9606d intel: Implement glFinish() correctly by waiting on all previous rendering.
Before, we were waiting for (most of) the current framebuffer to be
done, which is not quite the same thing.
2011-06-07 10:46:04 -07:00
Jeremy Huddleston
6ea70600b9 darwin: Fix VG_LIB_GLOB to also match the unversioned symlink
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-07 13:27:42 -04:00
Jeremy Huddleston
cebdffaa2a darwin: Don't link against libGL when building libOSMesa
Everything should be resolved through glapi.

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-07 13:27:42 -04:00
Marek Olšák
ed0e4bb4c1 r300_pci_ids: add missing 4B48
Found in r300_chipset.h.
2011-06-07 18:45:23 +02:00
Benjamin Franzke
42ba8d141f r300g: Remove is_r3xx
Use r300_pci_ids.h instead.

Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-07 10:28:20 -04:00
Benjamin Franzke
2bb253120e r600g: Use radeon pciid list for the family lookup table
Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-07 10:28:20 -04:00
Benjamin Franzke
6b82193677 radeon: Use pciid list to generate PCI_CHIP_<FAMILY>_<ID> defines
Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-07 10:28:20 -04:00
Benjamin Franzke
a433755ec5 targets/egl: Support driver name lookup using pci lists
Make use of this in drm and wayland st/egl backends.

Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-07 10:28:20 -04:00
Benjamin Franzke
7f881c43df egl_dri2: Use external driver pci list
Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-07 10:28:19 -04:00
Benjamin Franzke
88fd16d548 Add radeon pci id lists
Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-07 10:28:19 -04:00
Benjamin Franzke
09f83ce4da Add intel pci id lists
Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-07 10:28:19 -04:00
Brian Paul
681ed756c0 tgsi: s/varient/variant/ 2011-06-07 07:57:26 -06:00
Brian Paul
b3e75a61ee draw: rename draw_vs_varient.c to draw_vs_variant.c 2011-06-07 07:57:26 -06:00
Brian Paul
47f3d5d42d draw/llvm: whitespace, formatting fixes 2011-06-07 07:57:26 -06:00
Brian Paul
57f2f84f0e draw: s/1/TRUE/ 2011-06-07 07:57:26 -06:00
Eric Anholt
ef59049c52 i965: Fix flipped GT1 vs GT2 URB VS entry count limits. 2011-06-07 00:08:42 -07:00
Stéphane Marchesin
7d2cb9a53c Merge branch 'master' of ssh://git.freedesktop.org/git/mesa/mesa 2011-06-06 20:42:30 -07:00
Stéphane Marchesin
abb4365269 i915g: Do generic remapping.
With complex shaders there are often "holes" in the fs inputs, and we only
have 8 tex coorsd to map those to. To fix this, we remap fs inputs to [0..8].
This lets us to run many more GLSL programs.
2011-06-06 20:40:16 -07:00
Jeremy Huddleston
22c320aa2c darwin: Set VG_LIB_{NAME,GLOB} to fix make install
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-06 19:56:19 -04:00
Dave Airlie
ca01fe007d r600g: optimise the draw emission packets for r600/eg
This just reduces code size a bit for this chunk.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-07 09:43:09 +10:00
Dave Airlie
63184bc8b2 r600g: use an enabled list to track enabled blocks.
At the end of flushing we were scanning over 450 blocks
with generally about 50 enabled. This reduces the scanning
to just the list of enabled blocks.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-07 09:33:53 +10:00
Dave Airlie
f356bb74de r600g/winsys: overhaul resource range/blocks.
There isn't much point taking the overhead of range/block lookups on resources
we aren't going to be getting resource registers at wierd offsets.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-07 09:32:29 +10:00
Dave Airlie
be7af43f5a r600g: split out block init
This just splits this function up as pre-cursor to reusing
the internals of it.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-07 09:32:00 +10:00
Dave Airlie
cf0f02e501 r600g: move resource setting to its own structures.
resource setting could be a fair bit more lightweight,
this patch just separates the resource structs from the standard
reg tracking structs in the driver, later patches will improve
the winsys.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-07 09:30:55 +10:00
Dave Airlie
eb4bb48ef4 r600g: only call bo loop if nbos is positive.
we don't need to loop over all the registers unless we have
some bos in the block, also avoid setting the ctx flags,
and move the optional stuff down below this chunk.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-07 09:28:59 +10:00
Dave Airlie
6cd3534676 r600g: don't need to call the packet dirty function if not dirty.
also fix a unneeded dirty check and add a dirty check speedup.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-07 09:25:50 +10:00
Stéphane Marchesin
2292025c49 i915g: implement more opcodes. 2011-06-06 12:36:00 -07:00
Stéphane Marchesin
0f091333d1 i915g: implement TGSI_OPCODE_SEQ. 2011-06-06 12:36:00 -07:00
Stéphane Marchesin
0ce977a66e i915g: handle varyings properly. 2011-06-06 12:36:00 -07:00
Stéphane Marchesin
893b92adff i915g: add missing and unsupported PIPE_CAPs to avoid debug messages. 2011-06-06 12:35:59 -07:00
Stéphane Marchesin
3d3ecb8520 dri2: protect dri2FlushFrontBuffer against NULL buffers. 2011-06-06 12:35:59 -07:00
Stéphane Marchesin
cec2082ae5 Gallium: fix indentation in u_blitter.c 2011-06-06 12:35:59 -07:00
Stéphane Marchesin
3103c08ae9 i915g: don't destroy a texture buffer if it's NULL. 2011-06-06 12:35:58 -07:00
Stéphane Marchesin
1af8b7250f llvmpipe: use $(CXX) instead of g++ for linking.
This allows setting the path to the C++ compiler.
2011-06-06 12:35:58 -07:00
Kenneth Graunke
c2e659037f i965: Update SURFACE_STATE dumping for Ivybridge.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-06-06 11:06:05 -07:00
Kenneth Graunke
4ba9cfe4b8 i965: Update SAMPLER_STATE dumping for Ivybridge.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-06-06 11:06:05 -07:00
Kenneth Graunke
f9a3200adb i965: Update SF_CLIP_VIEWPORT state dumping for Ivybridge.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-06-06 11:06:04 -07:00
Jeremy Huddleston
e5d241ddb2 apple: Package applegl source into MesaLib tarball
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-06 12:48:08 -04:00
Jeremy Huddleston
d563009cd1 darwin: Define GALLIUM_DRIVERS_DIRS in darwin config
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-06 11:38:05 -04:00
Jeremy Huddleston
2ee5272e16 apple: Finish build fixes for applegl_glx.c
libGL.dylib now *builds* on darwin.

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-06 11:27:19 -04:00
Jeremy Huddleston
7c5f37c032 apple: More fixes for compilation failures
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-06 11:17:38 -04:00
Andreas Faenger
f4537f99cc softpipe: Anisotropic filtering extension.
Reference implementation which produces high quality renderings.
Based on Higher Quality Elliptical Weighted Avarage Filter (EWA).

Signed-off-by: Brian Paul <brianp@vmware.com>
2011-06-06 08:21:09 -06:00
Brian Paul
b438005d96 st/mesa: fix renderbuffer internal format for accum buffer
Fixes an accum buffer regression since switching to the table-based
format selection code.
2011-06-06 08:06:34 -06:00
Marcin Slusarz
155cf15ce2 util: add \n to debug_checkpoint_full
Signed-off-by: José Fonseca <jfonseca@vmware.com>
2011-06-06 12:41:07 +01:00
Marcin Slusarz
fb40f1f532 nv50: fix nv50_sampler_state_delete array overflow
num_samplers is array of 3 elements, not 5
2011-06-06 11:20:54 +02:00
Jeremy Huddleston
5d35343d12 apple: Fix multiple build failures in applegl_glx.c
It is still not building, but this gets us many steps closer

See https://bugs.freedesktop.org/show_bug.cgi?id=29162

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-05 21:25:27 -04:00
Jeremy Huddleston
1885cf27c9 apple: Build darwin using applegl rather than indirect
This reverts portions of 6849916170 that caused
the darwin config to fail to build due to missing implementations in that
commit.

See https://bugs.freedesktop.org/show_bug.cgi?id=29162

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-05 20:52:15 -04:00
Jeremy Huddleston
3843bbcb4c glx: Dead code removal
Remove a redundant ifndef GLX_USE_APPLEGL

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-05 20:52:15 -04:00
Jeremy Huddleston
8593bb32ea apple: ifdef out come glapi-foo on darwin
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-05 20:52:14 -04:00
Jeremy Huddleston
7cdf969527 apple: Change from XExtDisplayInfo to struct glx_display
Fixes regression introduced by: ab434f6b76 and
                                c356f5867f

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-05 20:52:14 -04:00
Ben Skeggs
1d24e6ec1d dri/nouveau: fix gnome-shell segfault
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-06-06 10:17:59 +10:00
Jeremy Huddleston
279e471750 apple: Rename GLXcontext
Fixes regression introduced by: c356f5867f

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-05 18:22:47 -04:00
Jeremy Huddleston
b7f0ed8444 apple: Rename _gl_context_modes_find_visual to glx_config_find_visual
Fixes regression introduced by: 6ddf66e923

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-05 18:19:59 -04:00
Jeremy Huddleston
488d6c739f apple: Re-add driContext and do_destroy
Fixes regression introduced by: c491e585e4

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-05 18:10:55 -04:00
Jeremy Huddleston
22613d1670 apple: Rename GLXcontext
Fixes regression introduced by: c356f5867f

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-05 18:10:55 -04:00
Jeremy Huddleston
bb621cb61e apple: Rename __GLcontextModes to struct glx_config
Fixes regression introduced by: 6ddf66e923

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-05 18:07:05 -04:00
Jeremy Huddleston
4c9bab78a1 apple: Rename glcontextmodes.[ch] to glxconfig.[ch]
Fixes regression introduced by: 65d98e2577

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-05 18:03:45 -04:00
Jeremy Huddleston
8e89d0bea7 apple: Update GL specs
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-05 18:03:44 -04:00
Eric Anholt
e8ea8793e3 meta: Don't do sRGB encode for framebuffer blits on sRGB-enabled framebuffers.
Fixes fbo-srgb-blit.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=35373
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-06-05 11:29:00 -07:00
Eric Anholt
a513bee2f2 meta: Don't do srgb to linear decode when blitting srgb textures.
Fixes the GL_SRGB8_ALPHA8 -> GL_RGBA8 blits in fbo-srgb-blit.c

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-06-05 11:28:59 -07:00
Eric Anholt
164108e3db glx: Fix use-before-null-check in dri2InvalidateBuffers().
The compiler used our dereference here to skip the NULL check below.
Fixes window resize in "jconsole -J-Dsun.java2d.opengl=True" under
OpenJDK 6.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=37766
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-06-03 16:03:34 -07:00
Eric Anholt
836a595594 i965: Drop remaining strict conformance fallback for GL_POINT_SMOOTH.
We actually could do this in hardware in the fragment shader using
gl_PointCoord and the point's size.
2011-06-03 16:03:18 -07:00
Eric Anholt
e9868979c5 i965: Drop strict conformance fallback for GL_LINE_STIPPLE.
We implement line stipples, just not *quite* correctly.  We have a
piglit testcase to use when we want to fix it, if we do.  Until then,
don't lie to our test suites.
2011-06-03 16:03:18 -07:00
Eric Anholt
d313346db6 i965: Drop strict conformance fallback for GL_LINE_SMOOTH.
We do have hardware antialised lines.  If we care, we should actually
fix them to be conformant (or as close as possible) instead of using
this knob to fool testcases using swrast.

For some interesting reading on the state of GL_*_SMOOTH across
several drivers, see:
http://homepage.mac.com/arekkusu/bugs/invariance/HWAA.html
2011-06-03 16:03:18 -07:00
Eric Anholt
d8b733643d i965: Drop strict conformance fallback for GL_POLYGON_SMOOTH.
From my reading of the GL 2.1 spec, no antialiasing is strictly
conformant for polygon smoothing.  Yes, it's absurd, but then,
hardware doesn't support this so maybe it's not so absurd.
2011-06-03 16:03:18 -07:00
Eric Anholt
3f05374574 i965: Drop INTEL_CONFORMANCE=2 fallback code.
This was just a duplicate of no_rast=true driconf option, which is
relatively standard across drivers.
2011-06-03 16:03:18 -07:00
Paul Berry
6491e9593d glsl: fixed printing of structure constants.
ir_print_visitor::visit(ir_constant *) was failing to index properly
into ir->type->fields.structure, so the first field name was being
reprinted for every field in the structure.

Signed-off-by: Brian Paul <brianp@vmware.com>
2011-06-03 12:48:49 -06:00
Paul Berry
26b566e19c AST dump: fixed printing of conditionals.
ast_expression::print() had an incorrect index into the subexpressions
array, so (a ? b : c) was being incorrectly rendered as (a ? b : b).

Signed-off-by: Brian Paul <brianp@vmware.com>
2011-06-03 11:07:00 -06:00
Dave Airlie
4077336fc7 r600g: move spi update to only when states change.
This updates the spi state after ps/vs binding or rasteriser state
change.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-03 15:27:00 +10:00
Dave Airlie
1dbcb83881 cso: move cso hashes to a more table driven scheme
this removes a bad branch pain in the hash table lookup fn.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-03 15:26:59 +10:00
Dave Airlie
970726dd6f u_prim: convert u_trim_pipe_prim to table driven.
This makes this function not be an always miss for the branch predictor.

Noticed using cachegrind, makes a minor difference to gears numbers on r600g.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-03 15:26:59 +10:00
Dave Airlie
de0adb691f r600g: make conv pipe prim table driven.
This is a lot more branch predictor friendly, it actually
showed up in cachegrind profiles.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-03 15:26:59 +10:00
Brian Paul
aaeb9a8216 mesa: fix typo (s/GLGL/GLSL/) 2011-06-02 21:49:49 -06:00
Brian Paul
52f6e79b7c mesa: 80-column wrapping 2011-06-02 21:49:49 -06:00
Brian Paul
9653acc52a mesa: consolidate glGetUniform code 2011-06-02 21:49:49 -06:00
Brian Paul
bbce18c647 mesa: refactor/consolidate uniform lookup code 2011-06-02 21:49:49 -06:00
Brian Paul
230c71d9ee mesa: add some minor fixes for geometry shaders 2011-06-02 21:49:49 -06:00
Brian Paul
b03296c1e9 dri: add missing files from 873379a881 2011-06-02 18:27:10 -06:00
Pierre-Eric Pelloux-Prayer
09201cc7a0 mesa: add implementation of glDrawElementsInstancedBaseVertex
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-06-02 17:55:48 -06:00
Pierre-Eric Pelloux-Prayer
0dae94610e glapi: regenerated files
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-06-02 17:55:13 -06:00
Brian Paul
898f4c5133 glapi: add glDrawElementsInstancedBaseVertex() function to xml
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-06-02 17:54:55 -06:00
Johannes Obermayr
873379a881 dri/nouveau: Fix build with --enable-shared-dricore.
- Based on the work of Себастьян Gliţa Κατινα <cglita@yahoo.com>
- Split Makefile.template into Makefile.defines and Makefile.targets
- Adapt other drivers to new situation
- Fixes https://bugs.freedesktop.org/show_bug.cgi?id=35441

Signed-off-by: Brian Paul <brianp@vmware.com>
2011-06-02 17:21:26 -06:00
Brian Paul
a9c5efb111 r300: remove MIN3 macro, already defined in macros.h 2011-06-02 17:21:26 -06:00
Dave Airlie
51d0892ee2 r600g: sampler and texture state doesn't need a range/block.
These are handled separately in the winsys, so don't need the calculations
done at this point. this manifested as a crash in point-sprite,

Thanks to XoD on #radeon for pointing it out.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-03 08:54:25 +10:00
Adam Jackson
e09e5cb7d8 glx: Remove (unused, broken) fastImageUnpack fast path
Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-06-02 15:37:22 -04:00
Adam Jackson
776a2a5447 glx: Fix another case of using req outside of the display lock
Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-06-02 15:37:21 -04:00
Marek Olšák
bddf275db4 softpipe: add a better fake implementation of fences
The flush function, when asked for, should not return a NULL fence.

NULL can only be returned if fences are not implemented, and st/mesa
doesn't call any of the fence functions if it receives a NULL fence
(because some drivers don't even set the fence hooks).

ARB_sync is exposed if fence_finish is set.
2011-06-02 16:50:46 +02:00
Brian Paul
f62e1f41b4 util: faster logbase2 2011-06-02 08:45:27 -06:00
Benjamin Bellec
bab3b4a758 mesa: faster logbase2
With minor clean-ups by Brian Paul.

Signed-off-by: Brian Paul <brianp@vmware.com>
2011-06-02 08:31:20 -06:00
Brian Paul
029ea39fb9 st/mesa: add GL_R11F_G11F_B10F to format table
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=37839
2011-06-02 08:01:28 -06:00
Christoph Bumiller
d1fd740bb7 d3d1x/sm4: don't reset 1st index of multi-dimensional operands to 0 2011-06-02 14:10:37 +02:00
Christoph Bumiller
a531513b06 d3d1x/sm4: fix swizzle for 1 component operands
For example, "mov o0.w, l(1)" would use imm_values[3], which is
not valid.
2011-06-02 14:10:34 +02:00
Chris Wilson
f61d1deac7 i965: Raise const.MaxTextureLevels to 14 (8192)
Mesa now limits, by default, the max number of texture levels to 15 so we
can now support the architectural maximum for gen4-6 of 14.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-06-02 08:30:21 +01:00
Dave Airlie
b0dc2d0c3b r600g: add spi state and move spi/vgt to modify register
This modifies the VGT state and move the SPI setup to its own discrete state.

It then just sets the SPI state up and the VGT state up once and modifies
them thereafter.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-02 15:08:24 +10:00
Dave Airlie
573758fd09 r600g: decrease CPU time on set buffer resources
This splits the initialisation and the setting of values in the resource
buffers. We only should end up initialising once and updateing with new values
when needed.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-02 15:03:52 +10:00
Dave Airlie
4423c79ddf r600g: work out range/block etc at state build time.
This moves the overhead of working out the range/block to state build time,
it also allows the compiler to use constants for a lot of things instead
of working them out each time.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-02 14:59:29 +10:00
Dave Airlie
42502b6f03 r600g: deinline r600_pipe_state_add_reg.
This is going to get too big to be a forced inline. Also going to remove it
from some hotpaths.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-02 14:53:15 +10:00
Dave Airlie
7f6672f6a7 r600g: prepare for passing ctx into _r600_pipe_state_add_reg
This moves the functions down the file, and also adds a ctx parameter.

This is precursor patch just moving stuff around and getting it ready.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-02 14:50:18 +10:00
Dave Airlie
991dbd71fd r600g: migrate macros from r600_priv.h to r600.h
this is just an precursor change for some later patches.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-02 14:42:11 +10:00
Dave Airlie
c1159eea54 r600g: remote ctx arg to block/range macros.
These aren't used anymore.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-02 14:40:40 +10:00
Dave Airlie
8782fdc1db r600g: avoid copying unnecessary pieces of a block.
This just avoids copying stuff if its going to modify the number of dwords
later anyways.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-02 14:29:37 +10:00
Dave Airlie
9eb86f89a9 r600g: optimise state setting in r600_draw_vbo.
This drop the r600_draw_vbo CPU usage on a run of nexuiz from 1.40% to 0.72%
in sysprof for me on my Fusion APU.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-02 14:22:42 +10:00
Dave Airlie
8fcafeb475 r600g: force new evergreen blocks for large range.
This range was 76 dwords long, the 75th dword changes, the first 60 or so
don't. split the block so it emits less often.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-02 14:22:42 +10:00
Brian Paul
57242715cb st/mesa: add format table entry for GL_RGB9_E5
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=37839
2011-06-01 16:25:42 -06:00
Nathan Kidd
f3652f0983 glapi: Make xserver location error more helpful
glx code hasn't lived under xserver/GL for a long time now.

Signed-off-by: Nathan Kidd <nkidd@opentext.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-06-01 08:30:59 -06:00
Marek Olšák
b9e9df78a0 mesa: queries of non-existent FBO attachments should return INVALID_OPERATION
OpenGL 4.0 Compatibility, page 449:

If the value of FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE is NONE, no
framebuffer is bound to target. In this case querying pname FRAMEBUFFER_-
ATTACHMENT_OBJECT_NAME will return zero, and all other queries will generate
an INVALID_OPERATION error.

Reviewed-by: Chad Versace <chad@chad-versace.us>
2011-06-01 16:07:58 +02:00
Marek Olšák
d69dc2e203 mesa: UseShaderProgramEXT and Uniform* shouldn't be allowed inside Begin/End
I couldn't find this being required by the spec.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-06-01 16:03:26 +02:00
Marek Olšák
37a85b1830 r300g: remove unused debug option DBG_UPLOAD
And renumber the options.
2011-06-01 04:47:41 +02:00
Alex Deucher
c5903ed454 r600c: add support for llano
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-05-31 18:10:01 -04:00
Alex Deucher
414cd5df50 r600g: add llano support
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-05-31 18:10:01 -04:00
Eric Anholt
c331b3123e i965/fs: Use the embedded compare in SEL on gen6+.
This avoids the extra CMP and the predication on SEL, so in addition
to one less instruction, it makes scheduling less constrained.

Improves glbenchmark Egypt performance 0.6% +/- 0.2% (n=3).  Reduces
FS instruction count across affected shaders in shader-db by 1.3%
without regressing any.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-31 12:23:50 -07:00
Benjamin Franzke
089aa313b4 wayland-drm: Check visual for being NULL 2011-05-31 15:13:37 -04:00
Benjamin Franzke
fc5aec9342 Fiuxp make tarballs for wayland-egl/drm 2011-05-31 15:13:37 -04:00
Benjamin Franzke
a7cd65fb38 st/egl: Fix udev linkage when egl_dri2 is not build 2011-05-31 15:13:37 -04:00
Benjamin Franzke
aa87a938fb egl_dri2: Fix usage of bool values 2011-05-31 15:13:36 -04:00
Benjamin Franzke
5bf6cc95c1 wayland-egl: Remove left-over headers and struct 2011-05-31 15:13:36 -04:00
Eric Anholt
f04765922c i965: Remove brw_surface_state struct that is now unused.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-05-31 12:07:29 -07:00
Eric Anholt
ee643b23ff i965: Switch brw_state_dump to using bitshifting for surface state.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-05-31 12:07:29 -07:00
Eric Anholt
e764f10ea5 i965: Replace struct with bit shifting for WM null surfaces.
Reduces compiled size of brw_wm_surface_state.o another 1.9%.

Overall, this brw_wm_surface_state reduction series cuts
firefox-talos-gfx runtime by 0.68% +/- 0.42% (n=6).

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-05-31 12:07:29 -07:00
Eric Anholt
9bdc44a528 i965: Replace struct with bit shifting for WM pull constant surfaces.
This reduces compiled size (4.7% of brw_wm_surface_state.o).

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-05-31 12:07:28 -07:00
Eric Anholt
ac11c01dde i965: Replace struct with bit shifting for WM render target surfaces.
This massively reduces compiled size (6.7% of brw_wm_surface_state.o).

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-05-31 12:07:28 -07:00
Eric Anholt
ae5c1fceba i965: Replace structs with bitfield shifting for WM texture surfaces.
This massively reduces compiled size (4.9% of brw_wm_surface_state.o).

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-05-31 12:07:28 -07:00
Eric Anholt
7d437b1f7f i965: Add defines for surface state setup using bitfield shifting.
It turns out that gcc is just awful at generating code for
brw_structs.h style state setup, and using bitshifting on u32s
generates better code while being similarly readable (and more
verifiable compared to the specs, using the INTEL_MASK macro).
2011-05-31 12:07:28 -07:00
Eric Anholt
3412069e23 i965: Don't compute brw->wm.input_size_masks when it's unused.
It's only used in the old fragment program path, to avoid projection
when w is always 1.  We do want to do this in the new path pre-gen6
too, but we'll probably do it through the ir.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-31 12:07:28 -07:00
Eric Anholt
bcbb1a536f i965: Drop a gratuitous "if" that the compiler didn't eliminate at -O2.
Oddly, this increases compiled code size.  (marking the 'if' as likely
also increases code size, but not as much).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-05-31 12:07:28 -07:00
Eric Anholt
d1946f5348 i965: Move prepare_wm_surfaces texobj declarations inside of _ReallyEnabled.
Interestingly, the compiler wasn't doing this for us at -O2, so we
were doing the computation for every non-_ReallyEnabled unit.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-05-31 12:07:28 -07:00
Ian Romanick
f29bc77572 intel: Remove unused NO_TILE macro
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-31 11:46:29 -07:00
Marek Olšák
b1246cf13b r300g: set squared microtiling for the dummy zbuffer
The pitch of 4 is allowed for squared microtiling only.
2011-05-31 18:19:27 +02:00
Alex Deucher
b5518834e3 r600g: cs init fixes
- all asics need to emit CONTEXT_CONTROL
- all r6xx asics need to emit 3D_START_CMDBUF

The ddx and r600c already do this. r600g should as well.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-05-31 10:43:31 -04:00
Marek Olšák
c4175c811e r300g: log when getting unsupported texture format 2011-05-31 15:20:38 +02:00
Dave Airlie
d2ede5e648 gallium: include limits.h in p_config.h
We are getting inconsistent methods for endian detection (same answer when
it works, just doesn't work on some platforms) depending on whether __GLIBC__
is defined, which of course depends on include ordering before p_config.h

Just make p_config.h include limits.h to solve this.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-05-31 17:28:48 +10:00
Dave Airlie
0cdd82df53 r600g: add context control to start of CS
On my original R600 card this at least lets gnome shell run for a while longer
and the piglit r300-readcache test case works a lot more reliably.

Still a few more stability issues running a piglit test run though.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-05-31 15:42:45 +10:00
Dave Airlie
65ee7cd1df r600g: don't emit color blend register on original R600.
The original R600 doesn't have these so don't emit them.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-05-31 10:52:07 +10:00
Marek Olšák
29ceeeba20 mesa: forbid UseProgram to be called inside Begin/End
The spec doesn't state it should be an error, but. We have this piglit test
useprogram-inside-begin that passes with this commit. No idea what's correct.

NOTE: This is a candidate for the 7.10 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-05-30 16:26:02 +02:00
Marek Olšák
1b37a41661 st/mesa: don't use resource_copy_region for CopyPixels with conditional render
The conditional rendering should be able to kill CopyPixels.
I assume the render condition has no effect on resource_copy_region.

This fixes piglit:
- NV_conditional_render/copypixels

NOTE: This is a candidate for the 7.10 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-05-30 10:51:06 +02:00
Marek Olšák
8d45bbc422 st/mesa: conditional rendering should not kill texture decompression via blit
NOTE: This is a candidate for the 7.10 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-05-30 10:51:03 +02:00
Marek Olšák
91e56c8897 st/mesa: CopyTex(Sub)Image should not be killed by conditional rendering
NOTE: This is a candidate for the 7.10 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-05-30 10:51:01 +02:00
Marek Olšák
ccfeb90b75 st/mesa: BlitFramebuffer should not be killed by conditional rendering
NOTE: This is a candidate for the 7.10 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-05-30 10:50:58 +02:00
Marek Olšák
c0277d9539 swrast: BlitFramebuffer should not be killed by conditional rendering
NOTE: This is a candidate for the 7.10 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-05-30 10:50:53 +02:00
Marek Olšák
1c95c3ef9c st/mesa: GenerateMipmap should not be killed by conditional rendering
NOTE: This is a candidate for the 7.10 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-05-30 10:50:43 +02:00
Marek Olšák
24ed0b384b st/mesa: fix typos and add some format fallbacks in format_map
Always default to DEFAULT_*_FORMATS for mandatory GL formats.
   (st_choose_format must not fail for those)
Use DEFAULT_RGBA when alpha is required instead of RGB.
Use DEFAULT_RGB otherwise.

These are more or less the remaining differences between the old code and
the new one.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-05-30 10:49:35 +02:00
Marek Olšák
6c638b7ca1 st/mesa: consolidate listing of depth formats
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-05-30 10:49:31 +02:00
Marek Olšák
26d718ff71 st/mesa: add GL_DEPTH_COMPONENT32 fallback formats
This makes D32 work again on chipsets which can't do it.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-05-30 10:49:27 +02:00
Marek Olšák
49d4e803d3 st/mesa: fix changing internal format via RenderbufferStorage
The problem is: The second time the function is called with a new
internal format, strb->format is usually not PIPE_FORMAT_NONE.

RenderbufferStorage(... GL_RGBA8 ...);
RenderbufferStorage(... GL_RGBA16 ...); // had no effect on the format

Broken with: fd6f2d6e57
Test: piglit/fbo-storage-completeness

NOTE: This is a candidate for the 7.10 branch.
(if fd6f2d6e57 is cherry-picked as well)

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-05-30 10:49:21 +02:00
Marek Olšák
ff038170ff tgsi/ureg: bump the limit of immediates
Lowered indirect addressing can create lots of immediates.

Fixes piglit/glsl-fs-uniform-array-7 on r300g.

NOTE: This is a candidate for the 7.10 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-05-30 10:48:03 +02:00
Marek Olšák
f133ff51a2 trace: implement texture_barrier 2011-05-29 16:17:11 +02:00
Marek Olšák
b9e8cb0a59 trace: implement render_condition 2011-05-29 16:17:11 +02:00
Marek Olšák
76056510bc r300g: clear can be killed by render condition
Fixes piglit:
- NV_conditional_render/clear
2011-05-29 16:17:11 +02:00
Tom Stellard
aae56150f5 r300g: Fix non-dri builds
This is just a temporary solution for now until there is a better way
to share code between mesa and gallium.
2011-05-28 21:16:00 -07:00
Marek Olšák
f76787b3ea r300g: fix occlusion queries when depth test is disabled or zbuffer is missing
From now on, depth test is always enabled in hardware.

If depth test is disabled in Gallium, the hardware Z function is set to ALWAYS.

If there is no zbuffer set, the colorbuffer0 memory is set as a zbuffer
to silence the CS checker.

This fixes piglit:
- occlusion-query-discard
- NV_conditional_render/bitmap
- NV_conditional_render/drawpixels
- NV_conditional_render/vertex_array
2011-05-29 05:15:27 +02:00
Marek Olšák
d18792f93d r300g: cleanup render_condition a bit 2011-05-29 05:15:27 +02:00
Marek Olšák
70b86fb273 r300g: remove fake occlusion queries (debug option) 2011-05-29 05:15:27 +02:00
Marek Olšák
2397f20b6b r300g: remove debug option DBG_FALL 2011-05-29 05:15:27 +02:00
Marek Olšák
9a3f861faf r300g: print some HyperZ debug info 2011-05-29 03:03:14 +02:00
Stéphane Marchesin
fc48de4fab glx: Fix glXGetFBConfigFromVisualSGIX.
We want to check for Success, otherwise it will fail even with the right visual.

NOTE: This is a candidate for the 7.10 branch.

Signed-off-by: Antoine Labour <piman@chromium.org>
Signed-off-by: Stéphane Marchesin <marcheu@chromium.org>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-05-27 11:58:36 -06:00
Pierre-Eric Pelloux-Prayer
4eeabd5a3d mesa: set parameter list StateFlags field in _mesa_layout_parameters()
When using _mesa_layout_parameters, all params copied in the 'layout'
output in the PASS 1 don't modify StateFlags (because they are simply
memcpy'ed).
This patch fixes the problem, assuring output gl_prog_param_list
StateFlags field is the same as the input one.

NOTE: This is a candidate for the 7.10 branch.

Signed-off-by: Brian Paul <brianp@vmware.com>
2011-05-27 11:58:36 -06:00
Eric Anholt
0653c450cc i965/fs: Fix up for 8752764076.
I failed to commit and squash before pushing.
2011-05-27 09:51:28 -07:00
Eric Anholt
9bd7e9c6b2 mesa: Include shader target in dumps of GLSL source.
This makes automatic parsing of MESA_GLSL=dump output easier.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-27 09:07:32 -07:00
Eric Anholt
8752764076 i965/fs: Do a FS compile up front at link time to produce link errors.
At glLinkShaders time, a fail() call in FS compile in 8-wide (the one
that's required to succeed, though we may relax that at some point for
pre-Ironlake performance) will now report out as a link error.
2011-05-27 09:07:32 -07:00
Eric Anholt
d1f70a8a6c i965/fs: Split the GLSL IR -> FS LIR visitor to brw_fs_visitor.cpp.
We now have:
brw_fs.cpp handles calling out to everything and optimization.
brw_fs_visitor.cpp handles translating to our LIR.
brw_fs_emit.cpp handles emitting from our LIR to native code.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-27 08:51:40 -07:00
Eric Anholt
11dd9e9c0f i965/fs: Split the BRW native code emit to brw_fs_emit.cpp
This is all separate from the visitor and the optimization passes
which feed into it.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-27 08:51:39 -07:00
Eric Anholt
b7b700aeb0 i965: Move a couple of GLSL IR -> BRW helper functions to brw_shader.cpp.
These will be used by the VS backend as well.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-27 08:51:30 -07:00
Eric Anholt
14b86f3c91 i965: Move non-FS-specific shader support to brw_shader.cpp.
These only existed in brw_fs.cpp because it was the only .cpp file in
the area when I wrote them.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-27 08:51:05 -07:00
Eric Anholt
53c89c67f3 i965: Avoid generating MOVs for assignments of expressions.
No statistically significant difference measured in 3dbenchmark
egypt/pro.  It does reduce fragment shader instructions across
shader-db by 0.3%.
2011-05-27 08:19:52 -07:00
Eric Anholt
1791857d7d i965/fs: Move the computation of register block count from unit to compile.
No net code size change, but unit update is down 0.8% code size
pre-gen6.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-27 08:19:27 -07:00
Eric Anholt
615117ce4e i965/fs: Track fixed GRF regs separate from allocated GRF file in scheduling.
There's an assumption here that fixed GRFs will never intersect with
the allocated GRFs.  That's true today, though it might change some
day if we decide to register-allocate the regs containing push
constants once they're dead.

This fixes a regression in 0f7325b890 in
Lightsmark from the texture instructions now containing g0 references
instead of having that be implied.  Performance is improved 15.2% +/-
3.6% (n=3).

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=34968
2011-05-27 08:08:23 -07:00
Eric Anholt
40540cc517 i965/fs: Add a helper function for add_dep(before, after, before->latency).
This lets us avoid a bunch of before==NULL checks in the callers.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-27 08:08:23 -07:00
Trevor Davenport
828b26b7eb nv50: fix emit_add_a16 to emit correct source reg
emit_add_a16 was using the incorrect source.
This caused adds in the form of:

   add u16 $a0 s32 $a1 u32 0x00000200

to have a source AREG of $a0 instead of $a1.

Fixes World of Warcraft in OpenGL and D3D without GLSL.
2011-05-27 10:25:40 +02:00
Brian Paul
4609e80288 mesa: s/height/depth/ in texsubimage()
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=37648
2011-05-26 19:25:44 -06:00
Brian Paul
e401c1f57f mesa: plug _mesa_GetObjectParameterivAPPLE into display list dispatch table 2011-05-26 19:25:44 -06:00
Brian Paul
6126d50e75 mesa: plug in GL_ARB_vertex_array_object display list functions 2011-05-26 19:25:44 -06:00
Brian Paul
e00481586c mesa: more geometry shader display list functions 2011-05-26 19:25:44 -06:00
Brian Paul
3b0f431820 mesa: more transform feedback display list functions 2011-05-26 19:25:44 -06:00
Brian Paul
919e260bff mesa: make query object API functions static
Only directly referenced by the _mesa_init_queryobj_dispatch() function.
2011-05-26 19:25:44 -06:00
Brian Paul
848bcd2e8c mesa: simplify query object display list dispatch setup 2011-05-26 19:25:44 -06:00
Eric Anholt
f7b3f40b70 i965: Pack the lookup and line_aa bits into the first dword of the key.
They were occupying whole 32-bit words, despite being only 10 or so
bits.  Reduces code size slightly (80/3300 bytes).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-26 10:07:38 -07:00
Eric Anholt
9a729ab4b2 i965: Remove dead shadowtex_mask entry in the WM key.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-26 10:07:38 -07:00
Eric Anholt
f147599ef4 i965: Remove linear_color for GL_PERSPECTIVE_CORRECTION_HINT.
From the GL 2.1 spec:

   "Required perspective-correct interpolation for all fragment
    attributes except depth in sections 3.4.1 and 3.5.1, effectively
    making GL PERSPECTIVE CORRECT HINT a no-op."

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-26 10:07:38 -07:00
Eric Anholt
c095335fa5 intel: Drop doubly irrelevant code in intelReadBuffers.
First, FBO read/draw == NULL validation happens in mesa core not
intelReadBuffers -> intel_draw_buffers.  Second, that condition is no
longer tested for in our driver since ARB_ES2_compatibility was added.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-05-26 08:54:29 -07:00
Eric Anholt
6d4b974e89 mesa: Flush vertices before updating drawbuffer computed state.
Otherwise, the driver is likely to draw the flushed vertices to the
new drawbuffer instead of the old one, missing the point of the flush.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-05-26 08:54:29 -07:00
Eric Anholt
d3451f7f9c mesa: Allow NULL read/draw in complete FBOs in ARB_ES2_compatibility.
From the ARB_ES2_compatibility spec:

    "(8) How should we handle draw buffer completeness?

    RESOLVED: Remove draw/readbuffer completeness checks, and treat
    drawbuffers referring to missing attachments as if they were NONE."

Fixes arb_es2_compatibility-drawbuffers when the short-circuit for
ARB_ES2_compatibility in the previous commit is dropped.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-05-26 08:54:29 -07:00
Eric Anholt
f73ff463a2 mesa: Trigger FBO validation on DrawBuffers change in non-ES2 mode.
glDrawBuffers pointing at an unattached buffer is supposed to be
incomplete without ARB_ES2_compatibility.  The testcase to catch the
bug of not implementing that bit of the spec was tricked by this
missing piece of state update.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-05-26 08:54:29 -07:00
Brian Paul
179a88d52c mesa: minor whitespace fixes 2011-05-25 21:07:50 -06:00
Brian Paul
f84be846ca mesa: plug in sync object display list functions
Most just dispatch through to the immediate mode functions, except
for glWaitSync(), per the extension spec.
2011-05-25 21:06:51 -06:00
Brian Paul
95fa22c864 mesa: display list support for glProgramParameteriARB() 2011-05-25 20:44:35 -06:00
Brian Paul
001aa6c979 mesa: plug shader object functions into display list dispatch 2011-05-25 20:39:08 -06:00
Brian Paul
4535c98cdb mesa: plug in GL 3.0 ClearBuffer() display list functions 2011-05-25 20:27:44 -06:00
Brian Paul
8f7c815568 mesa: fill in missing sampler object display list functions 2011-05-25 20:20:22 -06:00
Brian Paul
3e06803c2c st/mesa: simplify some st_context(ctx)->pipe code 2011-05-25 18:16:03 -06:00
Brian Paul
bf14ab417c st/mesa: fix incorrect texture level/face/slice accesses
If we use FBOs to access mipmap levels with glRead/Draw/CopyPixels()
we need to be sure to access the correct mipmap level/face/slice.
Before, we were just passing zero in quite a few places.

This fixes the new piglit fbo-mipmap-copypix test.

NOTE: This is a candidate for the 7.10 branch.
2011-05-25 18:07:35 -06:00
Jakob Bornecrantz
1697dac642 i915g: Bump texture sizes
Spotted and tested by Christopher Egert.

Signed-off-by: Jakob Bornecrantz <wallbraker@gmail.com>
2011-05-25 22:06:11 +02:00
Eric Anholt
b5846865de i965: Warnings cleanup.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-25 11:16:36 -07:00
Eric Anholt
fa42de5ad7 i965: Fix assertion failures in unused brw_reg setup by deleting it.
I was using undefined values to create an unused value.  Go me.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=37366
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-25 11:16:36 -07:00
Alex Deucher
5ed7a7b720 r600g: remove duplicate opcode in r600_opcodes.h
V_SQ_CF_WORD1_SQ_CF_INST_HALT is 0x1f on both
evergreen and cayman.

Reported-by: Gustaw Smolarczyk <wielkiegie@gmail.com>
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-05-25 11:04:25 -04:00
Chad Versace
e7bcfadc22 intel: Change FBO validation criteria to accomodate hiz and seprate stencil
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-05-25 07:41:32 -07:00
Chad Versace
ce8fdf666f intel: Fix intel_draw_buffer() to accomodate hiz and separate stencil
The logic of intel_draw_buffers() expected that stencil buffers were
always combined depth/stencil.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-05-25 07:41:32 -07:00
Chad Versace
c270f1a628 intel: Add hiz_region to intel_mipmap_tree
When a texture is attached to multiple FBO's, a separate renderbuffer
wrapper is created for each attachment. This necessitates storing the hiz
region for these renderbuffers in the texture itself instead of the
renderbuffer wrapper.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-05-25 07:41:32 -07:00
Chad Versace
6ed829fe50 intel: Refactor the wrapping of textures with renderbuffers
Before this commit, the renderbuffer's region was updated in
intel_renderbuffer_texture(). This commit moves the update into
intel_update_wrapper(), which is a more logical location for updates.

This is in preparation for the next commit, which allocates and
updates the texture's hiz region in intel_update_wrapper(). Having the two
region updates located in the same function makes good form.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-05-25 07:41:32 -07:00
Chad Versace
7c0e6d9bbc intel: Add hiz_region to intel_renderbuffer
A hiz surface must be supplied to the hardware when rendering to a depth
buffer with hiz. There are three potential places to store that surface:
    1. Allocate a larger intel_region for the depthbuffer, and let the
       region's tail be the hiz surface.
    2. Allocate a separate intel_region for hiz, and store it as
       brw_context state.
    3. Allocate a separate intel_region for hiz, and store it in
       intel_renderbuffer.

We choose method 3.

Method 1 has not been chosen due to future complications it might cause
when requesting a DRI drawable's depth buffer attachment from X.

Method 2 has not been chosen because storing the hiz region apart from
the depth region makes lazy hiz/depth resolves difficult to implement.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-05-25 07:41:32 -07:00
Chad Versace
a9e6509785 intel: Add is_hiz_depth_format() to intel_contex.vtbl
Given a format, is_hiz_depth_format() indicates if HiZ can be enabled on
a depthbuffer of that format.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-05-25 07:41:32 -07:00
Chad Versace
1a1411e09b intel: Allocate region for separate stencil buffer
... in intel_alloc_renderbuffer_storage().  The stencil buffer has quirky
pitch requirements, so its region allocation is a special case.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-05-25 07:41:32 -07:00
Chad Versace
b5c847c7ca intel: Change supported texture formats for separate stencil
When hardware supports separate stencil, enable support for separate
depth/stencil texture formats in the table
intel_context.ctx.TextureFormatsSupported. If the hardware must use
separate stencil, then disable support for combined depth/stencil formats.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-05-25 07:41:31 -07:00
Chad Versace
4e0654ec29 mesa: Add MESA_FORMAT_X8_Z24 to _mesa_choose_tex_format
Prefer MESA_FORMAT_X8_Z24 over MESA_FORMAT_S8_Z24 for textures with
internal format GL_DEPTH_COMPONENT*.

i965 needs MESA_FORMAT_X8_Z24 for HiZ and separate stencil.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-05-25 07:41:31 -07:00
Chad Versace
76f77cb07e intel: Add flags to intel_context for hiz and separate stencil
Add the following flags:
    intel_context.has_separate_stencil
    intel_context.must_use_separate_stencil
    intel_context.has_hiz

The flags are currently set to false, and will be enabled for a given
chipset once the feature is completely implemented.

Since it may be some time before these features are completed, their
values can be overridden with environment variables INTEL_HIZ and
INTEL_SEPARATE_STENCIL. Valid values for these environment variables are
"0" and "1".

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-05-25 07:41:31 -07:00
Adam Jackson
a95ec18549 glx: Don't refer to the request buffer outside of {L,Unl}ockDisplay
... because that's not a safe thing to do.  The request buffer is shared
storage among all threads, and after UnlockDisplay the 'req' pointer may
point into someone else's request.

NOTE: This is a candidate for the 7.10 branch.

Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-05-25 06:19:29 -04:00
Alex Deucher
c44dad559a egl_dri2: add new cayman pci ids
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-05-25 01:27:34 -04:00
Alex Deucher
017cd5dcc3 r600g: fix eg/cayman scissor workaround
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-05-24 22:44:16 -04:00
Dave Airlie
868c04205c r600g: add workaround for buggy hw scissor on eg/cayman.
This is ported from the same fix to the DDX.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-05-25 11:50:17 +10:00
Dave Airlie
7779f6d1df r600g: add initial cayman acceleration support.
Cayman is the RadeonHD 69xx series of GPUs. This adds support for
3D acceleration to the r600g driver.

Major changes:
Some context registers moved around - mainly MSAA and clipping/guardband related.
GPR allocation is all dynamic
no vertex cache - all unified in texture cache.
5-wide to 4-wide shader engines (no scalar or trans slot)
	- some changes to how instructions are placed into slots
	- removal of END_OF_PROGRAM bit in favour of END flow control clause
	- no vertex fetch clause - TC accepts vertex or texture

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-05-25 11:42:45 +10:00
Dave Airlie
d1b8f8e8b3 r600g: don't lookup a vs semantic for position/face.
These don't need one, and I was seeing 0xff being returned and set in
the GPU registers with some tests.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-05-25 10:01:25 +10:00
Dave Airlie
ece871c038 r600g: flush the DB dest base as well.
If we do this for CB bases then we should do it for DB bases.

noticed while adding cayman support.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-05-25 09:37:33 +10:00
Adam Jackson
3869be74af glx: More comment cleanup
Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-05-24 16:45:02 -04:00
Adam Jackson
a3aecd190b glx: Remove some misleading comments
These functions have already been modified for direct rendering.

Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-05-24 16:44:33 -04:00
Adam Jackson
5a6897ff0b drisw: Namespace better for ease of navigation
Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-05-24 16:44:21 -04:00
Adam Jackson
b24f291e42 drisw: dead store removal
Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-05-24 16:43:53 -04:00
Mike Kaplinskiy
d3b6e8a2b8 mesa: fix glGetTexImage for cases when srgb decode is skipped
See http://bugs.freedesktop.org/show_bug.cgi?id=37150

Signed-off-by: Brian Paul <brianp@vmware.com>
2011-05-24 09:06:04 -06:00
Brian Paul
cd5417aac7 st/mesa: prefer formats without stencil for DEPTH_COMPONENT
for fast Z clears to be used more often.

Original patch by Marek Olšák.  Rebased to table-driven st_choose_format()
by Brian Paul.
2011-05-24 09:00:17 -06:00
Brian Paul
d57e95f22a st/mesa: rewrite st_choose_format() to be table driven
Instead of using a giant switch statement with lots of code, use a
table to convert GL format enums to pipe formats.

Tested by running the old code next to the new and asserting that
the return value was the same for piglit tests.

We're doing a linear search, but if that ever appears to be too slow
the table could easily be sorted or hashed.
2011-05-24 08:49:01 -06:00
José Fonseca
c3c1976f52 wgl: Don't hold on to user supplied HDC.
Certain applications (e.g., Bernina My Label, and the Windows
implementation of Processing language) destroy the device context used when
creating the frame-buffer, causing presents to fail because we were still
referring to the old device context internally.

This change ensures we always use the same HDC passed to the ICD
entry-points when available, or our own HDC when not available (necessary
only when flushing on single buffered visuals).
2011-05-24 13:12:39 +01:00
Thierry Reding
5af46e8360 mesa: Fix remap_table setup.
Since the SET_xxx and GET_xxx macros used to initialize the remap_table
have been replaced by inline functions, the missing late macro expansion
leads to driDispatchRemapTable not being redefined to remap_table, which
in turn causes the remap_table not to be setup properly.

This commit fixes the issue by moving the table redefinition after the
definition of driDispatchRemapTable but in front of the inline function
definitions.
2011-05-23 16:19:44 +01:00
Adam Jackson
e8b1c6d6f5 mesa: Fix return type of _mesa_get_format_bytes() (#37351)
Despite that negative values aren't sensible here, making this unsigned
is dangerous.  Consider get_pointer_generic, which computes a value of
the form:

    void *base + (int x * int stride + int y) * unsigned bpp

The usual arithmetic conversions will coerce the (x*stride + y)
subexpression to unsigned.  Since stride can be negative, this is
disastrous.

Fixes at least the following piglit tests on Ironlake:

    fbo/fbo-blit-d24s8
    spec/ARB_depth_texture/fbo-clear-formats
    spec/EXT_packed_depth_stencil/fbo-clear-formats

NOTE: This is a candidate for the 7.10 branch.

Reviewed-by: Chad Versace <chad.versace@intel.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-05-23 11:07:34 -04:00
Kenneth Graunke
d0c6d24a9e i965/gen7: Fix miptree layout for cube surfaces.
Volume 1a section 8.20.4.7.3 gives new equations which multiply by 12
instead of 11.

Fixes 8 piglit tests:
- fbo-cubemap
- texCube
- glsl-fs-texturecube
- glsl-fs-texturecube-2
- glsl-fs-texturecube-2-bias
- glsl-fs-texturecube-bias
- arb_seamless_cubemap
- cubemap

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-22 15:01:16 -07:00
Kenneth Graunke
b522eb0717 i965: Remove comments about pre-965 hardware.
They're irrelevant for this driver.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-22 15:01:16 -07:00
pepp
fd6f2d6e57 st/mesa: assign renderbuffer's format field when allocating storage
See http://bugs.freedesktop.org/show_bug.cgi?id=36173

NOTE: This is a candidate for the 7.10 branch.

Signed-off-by: Brian Paul <brianp@vmware.com>
2011-05-21 09:49:14 -06:00
Christian König
3c5e741862 r600g: fix "Fixed-Point Data Conversions"
According to OpenGL 3.1 chapter 2.1.5 the representation without zero
should only be used for vertex attribute values, but not for textures
or frame-buffers.
2011-05-21 16:40:20 +02:00
Kenneth Graunke
9be8524af7 i965: Fix sampling on Ivybridge after headerless change.
Fixes a regression since 90e922267a.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-20 16:33:43 -07:00
Kenneth Graunke
24de02acac i965: Remove "TXD" from justification of sampler message headers.
The coordinate offsets set in the m1 header are for textureOffset;
they have nothing to do with textureGrad (TXD).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-20 16:33:43 -07:00
Kenneth Graunke
5e48560926 i965/gen7: Add support for rendering to depthbuffer mipmap levels > 0.
The same as 3e43adef95 but for Gen7.

This doesn't quite fix GL_ARB_depth_texture/fbo-clear-formats; there's
still a 1 pixel wide black line on the right edge of the smaller squares.

The results were entirely wrong before, and are at least close now.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-20 16:31:18 -07:00
Benjamin Franzke
733fa000ce st/egl: Add support for EGL_DRM_BUFFER_USE_CURSOR_MESA 2011-05-20 19:10:22 +02:00
Benjamin Franzke
ea90eca44b st/dri: Support dri2 useflags in dri2_create_image 2011-05-20 19:10:22 +02:00
Benjamin Franzke
ca79036fe8 st/egl/wayland: Deal with wayland visual changes
Since wayland 4bde293ff8109d55eeaee8732f5a6ee0c8cd4bd9 we cant
lookup visuals, as we dont receive the visual token events.

The format for pixmap-images thus has to default to argb for now.
2011-05-20 13:05:14 -04:00
Thierry Reding
8e7d4d4e0c mesa: Emit definition of GLAPIENTRYP in es_generator.py.
GLES uses GL_APIENTRYP instead of GLAPIENTRYP, which breaks with the
latest API table generation code. This fixes the issue by emitting a
definition for GL_APIENTRYP when generating the GLES files.
2011-05-20 12:59:23 +01:00
José Fonseca
075d2bfb72 glapi: More type-checking in Get_xxx too. 2011-05-20 12:59:23 +01:00
José Fonseca
a436b3b2d4 gallivm: Fix for dynamically linked LLVM 2.8 library.
This prevents the error

    prog: for the -disable-mmx option: may only occur zero or one times!

when creating a new context after XCloseDisplay with DRI drivers linked
with a shared LLVM 2.8 library.
2011-05-20 11:54:52 +01:00
Brian Paul
4f59b32178 r300: move declaration before code 2011-05-19 21:23:39 -06:00
Brian Paul
38f89c7008 st/glx: define/set new ST_CONTEXT_FLAG_bits 2011-05-19 21:18:33 -06:00
Brian Paul
1929d52fd9 st/glx: pass major, minor, context flags, etc to XMesaCreateContext() 2011-05-19 21:18:33 -06:00
Brian Paul
d1cd1cc871 st/glx: implement glXCreateContextAttribsARB() 2011-05-19 21:18:33 -06:00
Brian Paul
81183b1e3e st/glx: pass version, context flags, etc to create_context() 2011-05-19 21:18:33 -06:00
Brian Paul
7be3e50731 st/glx: refactor create-context functions 2011-05-19 21:18:33 -06:00
Brian Paul
43bdabd47d mesa: fix vertex array enable checking in check_valid_to_render()
In particular, this fixes the case where a vertex shader only uses
generic vertex attributes (non-0th).  Before, we were no-op'ing the
glDrawArrays/Elements().

This fixes the new piglit pos-array test.

NOTE: This is a candidate for the 7.10 branch.
2011-05-19 21:18:33 -06:00
Roland Scheidegger
be0a2f62f3 mesa: handle some srgb cases in the fast path in _mesa_get_teximage
Previously, always did unorm8->float/nonlinear-to-linear conversion (using
lookup table), then convert back to nonlinear (using the expensive math
func pow among others), and finally convert back to int (assuming caller
wants unorm8), because the float texture fetch function is used for getting
the actual texel values. This should probably all be changed at some point,
but for now simply enable the memcpy path also for srgb formats (but if for
instance swizzling is required, still the whole conversion will be done).
2011-05-20 01:43:40 +02:00
Kristian Høgsberg
339544f4bb wayland-drm: Use new generic error event 2011-05-19 12:07:00 -04:00
José Fonseca
ec4dfc2aad glapi: Implement SET_xxx as inline functions instead of macros.
In order to have the benefit of type checking, and detect missing
GLAPIENTRY keywords on public entrypoints.
2011-05-19 16:49:49 +01:00
José Fonseca
f4a9868811 mesa: add another missing GLAPIENTRY keyword
NOTE: this is a candidate for the 7.10 branch.
2011-05-19 16:39:57 +01:00
Maxim Levitsky
116133af34 nv50: add support for user clip planes
Clip distance is calculated each time vertex position is written
which is suboptiomal is some cases but very safe.
User clip planes are an obsolete feature anyway.

Every time number of clip planes increases, the vertex program
is recompiled.
That ensures no overhead in normal case (no user clip planes)
and reasonable overhead otherwise.

Fixes 3D windows in compiz, and reflection effect in neverball.
Also fixes compiz expo plugin when windows were dragged and each
window shown 3 times.
2011-05-19 12:50:28 +02:00
Kristian Høgsberg
bfaa458445 wayland: Fix link order for libwayland-drm.a 2011-05-18 18:57:05 -04:00
Eric Anholt
3e43adef95 i965: Add support for rendering to depthbuffer mipmap levels > 0.
Fixes
GL_ARB_depth_texture/fbo-clear-formats
GL_EXT_packed_depth_stencil/fbo-clear-formats
2011-05-18 13:57:18 -07:00
Eric Anholt
a98dd64af7 i965: Stop caching the combined depth/stencil region in brw_context.c.
This was going to get in the way of separate depth/stencil (which
wants to know about both, and whether they are the same rb), and also
wasn't a sufficient flag for the fix in the following commit.
2011-05-18 13:57:17 -07:00
Eric Anholt
64f8ddaf9b i965/gen6: Add support for point min/max size from ARB_point_parameters.
Fixes glean pointAtten.
2011-05-18 13:57:17 -07:00
Eric Anholt
90e922267a i965/fs: Don't emit a header on gen5+ sample messages unless required.
Improves glbenchmark egypt performance 0.6% +/- 0.4% (n=6).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-18 13:57:17 -07:00
Eric Anholt
4bbc7915f1 i965/fs: Fix GPU hang on texture2d-bias on pre-Ironlake.
In the 16-wide rework, I missed that we were setting some things to be
SIMD16 mode (corresponding to their setup in emit_texture_gen4()).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-18 13:57:17 -07:00
Eric Anholt
b126a0c0cb i965: Add support for correct GL_CLAMP behavior by clamping coordinates.
This removes the stupid strict-conformance fallback code I broke when
adding ARB_sampler_objects.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=36572
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> (v1)
2011-05-18 13:57:17 -07:00
Eric Anholt
7592f00560 i965/fs: Drop the viewport index/rtai clearing in gen6 fb writes.
These fields are documented to be in the payload, and though the FB
write docs say they *aren't* in the payload, for all other fields the
payload and header is structured so that no overwriting is required
except for non-default options.
2011-05-18 13:57:17 -07:00
Eric Anholt
136eb2bde7 i965/fs: Add support for "if" statements in 16-wide mode on gen6+.
It turns out there's nothing in the hardware preventing this.  It
appears that it ought to work on pre-gen6 as well, but just produces
GPU hangs.

Improves glbenchmark Egypt framerate 4.4% +/- 0.3% (n=3), and Pro by
2.6% +/- 0.6% (n=3).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-18 13:57:17 -07:00
Eric Anholt
27b0392661 i965/fs: Fix discard and alpha test in 16-wide.
As of gen6, alt-mode (which we use) MOVs of floats are not raw --
they'll modify infs/nans.  This broke discard and alpha test in
16-wide, where apparently the upper 8 bits of the pixel enables being
set were causing the whole value to get trashed upon being moved.
Treating the values as UD instead of float makes sure they get
preserved.  While I'm here, replace the two 8-wide moves of the halves
of the header with a single compressed move.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=36648
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-18 13:57:17 -07:00
Eric Anholt
367020d87c i965/gen6: Fix blending state when no color buffer is bound.
This is part of fixing fbo-alphatest-nocolor -- a regression in
35e8fe5c99 after the initial regression,
that had us using a garbage BLEND_STATE[0] (in particular, the alpha
test enable) if no color buffer was bound.
2011-05-18 13:57:16 -07:00
Eric Anholt
51761a1aef i965/fs: Cut an instruction and a temporary from gen6 discard statements.
I thought I was thwarted initially when I couldn't do conditional mod
on a MOV, and couldn't use two immediate constants in one instruction.
But g0 != g0 is also a way to produce a failing comparison.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-18 13:57:16 -07:00
Eric Anholt
5dd5be69f0 i965/fs: Fix compiler warnings about dead code from 9634318290 2011-05-18 13:57:16 -07:00
José Fonseca
61c67eca7d gallivm: Tell LLVM to not assume a 16-byte aligned stack on x86.
Fixes fdo 36738.
2011-05-18 18:14:37 +01:00
Andreas Faenger
8a98aabe0b swrast: anisotropic filtering extension
Anisotropic filtering extension for swrast intended to be used by osmesa
to create high quality renderings.
Based on Higher Quality Elliptical Weighted Avarage Filter (EWA).
A 2nd implementation using footprint assembly is also provided.

Signed-off-by: Brian Paul <brianp@vmware.com>
2011-05-18 08:14:33 -06:00
Brian Paul
707eadcb7f mesa: simplify error check in _mesa_MapBufferRange() 2011-05-18 08:14:32 -06:00
Brian Paul
496bf04905 mesa: only update array _MaxElement if array is enabled
Fixes failed assertion when calling _mesa_print_arrays() debug function.
2011-05-18 08:14:32 -06:00
Brian Paul
de1df26b5c mesa: check that flex/bison are installed
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=36651

NOTE: This is a candidate for the 7.10 branch.
2011-05-18 07:51:33 -06:00
Kenneth Graunke
3e0bb02358 i965: Rename IS_GT1 and IS_GT2 to IS_SNB_GT1 and IS_SNB_GT2.
This should help distinguish Sandybridge GT1/GT2 from Ivybridge GT1/GT2.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-18 01:31:29 -07:00
Tapani Pälli
2758e65f28 add $SELINUX_LIBS to EGL and OpenVG lib deps
Correctly links against selinux library when MESA is built with --enable-selinux option.

Fixes bug #36333 in Freedesktop bugzilla

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-05-18 17:58:53 +10:00
Dave Airlie
bb31ecf4fb mesa/st: split updating vertex and fragment shader stages.
this seems like a logical thing to do and sets the correct st flags
for vertex textures.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-05-18 17:31:51 +10:00
Dave Airlie
6bd8647b54 st/mesa: only memset sampler when about to use it.
This function was taking a lot more CPU than required due to it memsetting
a bunch of memory that didn't require it from what I can see.

We should only memset here when we are about to fill out the sampler,
otherwise we end up doing a bunch of memsets for everytime this function
is called, basically setting 0 memory to 0.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-05-18 17:31:51 +10:00
Dave Airlie
ecc051d65b r600g: bump domain selection up one layer.
this is taken from a patch from Mathias Froehlich, just going to
stage it in a few pieces.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-05-18 17:31:51 +10:00
Eric Anholt
4e98318fc1 i965: Instead of fallback on missing region, just bind a null renderbuffer.
The change for GPU hanging in 13bab58f04
fell back even when rb == NULL, which is wrong for GLES2 and caused
segfaulting in GLES2 conformance.  For the GPU hang case (where the
broken 2D driver failed to allocate a BO for the window system
renderbuffer), it also would assertion fail/segfault immediately after
the fallback setup when the renderbuffer map failed.

Fixes GLES2 conformance packed_depth_stencil.

Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-17 23:48:17 -07:00
Kenneth Graunke
461e193971 i965: Updated fixed-point sizes in Ivybridge SAMPLER_STATE.
Texture LOD Bias is now S4.8 instead of S4.6;
Min LOD, and Max LOD are now U4.8 instead of U4.6.

Fixes piglit test tex-miplevel-selection.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-17 23:48:16 -07:00
Kenneth Graunke
ead7d73a51 i965: Ivybridge uses the Gen4 SAMPLER_BORDER_COLOR_STATE.
Volume 5c 1.13.7 lists it as [PreDevILK] and [DevIVB+].

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-17 23:47:52 -07:00
Kenneth Graunke
b2c1f8ff1d egl: Recognize Ivybridge PCI IDs.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:33:02 -07:00
Kenneth Graunke
1b3d354743 intel: Recognize new Ivybridge PCI IDs.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:33:02 -07:00
Kenneth Graunke
7f5e0d2a90 i965: Disable register spilling on Ivybridge for now.
The data port messages for this are rather different.  For now, fail to
compile rather than hanging the GPU.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:33:02 -07:00
Kenneth Graunke
344283de5d i965: Fix RNDZ and RNDE on Sandybridge and Ivybridge.
On gen4/5, the RNDZ and RNDE instructions return floor(x), but set special
"round increment bits" in the flag register; a predicated ADD (+1) fixes
the result.

The documentation still lists '.r' as existing, and says that the
predicated add is necessary, but it apparently lies.  According to the
simulator, BRW_CONDITIONAL_R (7) is not a valid conditional modifier
and the RNDZ and RNDE instructions simply produce the correct value.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:33:02 -07:00
Kenneth Graunke
199a2f90ab i965: Fix data port reads on Ivybridge.
These also need to use gen7_dp.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:33:02 -07:00
Kenneth Graunke
2a95568f64 i965: Avoid register coalescing away MATH workarounds on Ivybridge.
The MATH instruction cannot handle source modifiers, even on Gen7.
So, apply this workaround for Sandybridge on Ivybridge as well.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:33:02 -07:00
Kenneth Graunke
6e918163df i965: Make the CONT instruction point to the WHILE instruction.
This fixes piglit test glsl-fs-loop-continue.shader_test on Ivybridge.
According to the documentation, the CONT instruction's UIP field should
point to the WHILE instruction on both Sandybridge and Ivybridge.

The previous code made UIP point to the implicit DO instruction, which
seems incorrect.  I'm not sure how it could have worked on Sandybridge.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:33:02 -07:00
Kenneth Graunke
77397ef96e i965: Add support for loops on Ivybridge.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:33:02 -07:00
Kenneth Graunke
64ce592679 i965: Add support for IF/ELSE/ENDIF control flow on Ivybridge.
Ivybridge's IF instruction doesn't support conditional modifiers.
It also introduces UIP, which must point to the ENDIF instruction.

ELSE and ENDIF remain the same except that JIP moves from dst to src1.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:33:01 -07:00
Kenneth Graunke
ff6e3c73f6 i965: Add support for Ivybridge texturing messages.
Ivybridge puts the shadow comparator first, then lod/bias, and finally
the coordinate---unlike previous generations which always reserved four
slots for the coordinate at the beginning.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:33:01 -07:00
Kenneth Graunke
36f8de02e7 i965: Fix sampler message descriptor on Ivybridge.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:33:01 -07:00
Kenneth Graunke
3f44043da3 i965: Fix SAMPLER_STATE on Ivybridge.
Most of this code copied from brw_wm_sampler_state.c.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:33:01 -07:00
Kenneth Graunke
3984372104 i965: Mark some brw_wm_sampler_state.c helper functions as non-static.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:33:01 -07:00
Kenneth Graunke
b2b6cc6622 i965: Update SURFACE_STATE for Ivybridge.
I'm still not happy with the amount of code duplication here, but it
will have to do for now.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:33:01 -07:00
Kenneth Graunke
c12a93d5c4 i965: Mark a few more brw_wm_surface_state functions as non-static.
I need to reuse them.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:33:01 -07:00
Kenneth Graunke
70c6cd39bd i965: Change brw_format_for_mesa_format to a non-static function.
This will make it easier to share between files.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:33:01 -07:00
Kenneth Graunke
62b79b4bb9 i965: Set Address Modify Enable in VERTEX_BUFFER on Ivybridge.
Otherwise, Ivybridge seems to ignore the newly supplied data, giving us
rubbish for vertices.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:33:01 -07:00
Kenneth Graunke
09d881bf74 i965: Enable channel masks in Ivybridge's URB_WRITE_HWORD header.
This shouldn't be done using MRFs, but until I have a proper solution
for dealing with MRFs, this allows my hack to keep working.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:33:00 -07:00
Kenneth Graunke
97d4d6f77e i965: Fix the URB write message descriptor on Ivybridge.
The message header is still incorrect, but this is a start.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:33:00 -07:00
Kenneth Graunke
ce526a7452 i965: Fix render target writes on Ivybridge.
Ivybridge shifts the data port messages by one bit.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:33:00 -07:00
Kenneth Graunke
482e8a6cd5 i965: Mad hacks to avoid using MRFs on Ivybridge.
Ivybridge's SEND instruction uses GRFs instead of MRFs.  Unfortunately,
a lot of our code explicitly uses MRFs, and rewriting it would take a
fair bit of effort.  In the meantime, use a hack:

- Change brw_set_dest, brw_set_src0, and brw_set_src1 to implicitly
  convert any MRFs into the top 16 GRFs.
- Enable gen6_resolve_implied_move on Ivybridge: Moving g0 to m0
  actually moves it to g111 thanks to the previous hack.

It remains to officially reserve these registers so the allocator
doesn't try to reuse them.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:33:00 -07:00
Kenneth Graunke
550ad737f7 i965: Emit 3DPRIMITIVE Ivybridge-style.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:33:00 -07:00
Kenneth Graunke
fa4b23581b i965: Don't use the GS for breaking down quads on Ivybridge.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:33:00 -07:00
Kenneth Graunke
d58400eb4a i965: Emit extra 0's in 3DSTATE_MULTISAMPLE on Ivybridge.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:33:00 -07:00
Kenneth Graunke
8c8985bdd7 i965: Add depth buffer support on Ivybridge.
This also disables the HiZ and separate stencil buffers.  We still need
to implement stencil.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:33:00 -07:00
Kenneth Graunke
bc08d4ebb8 i965: Upload sampler state pointers on Ivybridge.
Since we currently only support sampling in the fragment shader, we only
bother to emit the PS variant.  In the future we'll need to emit others.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:33:00 -07:00
Kenneth Graunke
a94fe79464 i965: Disable binding table pointers for unused pipeline stages.
This may not be necessary, but it seems like a good idea.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:33:00 -07:00
Kenneth Graunke
706dbf85f1 i965: Upload binding table pointers on Ivybridge.
Ivybridge uses per-stage commands to update binding table pointers.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:32:59 -07:00
Kenneth Graunke
e0e2c04596 i965: Split BRW_NEW_BINDING_TABLE dirty bit into one per stage.
Ivybridge can update each stage's binding table pointer independently,
so we want separate dirty bits.  Previous generations can simply
subscribe to all three dirty bits and emit as usual.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:32:59 -07:00
Kenneth Graunke
bac10b58de i965: Explicitly disable unused pipeline stages on Ivybridge.
This may not be strictly necessary, but seems wise.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:32:59 -07:00
Kenneth Graunke
6b2010df7d i965: Initial Ivybridge VS state.
Copied from gen6_vs_state.c; reuses create_vs_constant_bo from there.

The 3DSTATE_VS command is identical but 3DSTATE_CONSTANT_VS is not.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:32:59 -07:00
Kenneth Graunke
18402fbf79 i965: Initial Ivybridge Viewport state setup.
SF and CLIP viewport state has been combined into SF_CLIP_VIEWPORT;
SF_CLIP and CC state pointers can now be uploaded independently.

Some portions of the hardware documentation refer to separate upload
commands for SF and CLIP; these are outdated and incorrect.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:32:59 -07:00
Kenneth Graunke
81fd03fe56 i965: Initial Ivybridge Clip state setup.
Copied from gen6_clip_state.c.

This enables early culling and sets the necessary fields.  Otherwise, it
is entirely the same, so I doubt this patch is strictly necessary for a
functional driver.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:32:59 -07:00
Kenneth Graunke
24d0ed72c1 i965: Initial Ivybridge CC state setup.
The state itself still seems to be the same; the only change is that
each part (CC, BLEND, DEPTH_STENCIL) can now be uploaded independently.
Thus, we still rely on the code in gen6_cc.c to set up the state.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:32:59 -07:00
Kenneth Graunke
a924d69b57 i965: Initial Ivybridge WM/PS state setup.
Copied from gen6_wm_state.c.

The main change from Sandybridge seems to be that 3DSTATE_WM was split
into two separate state packet commands: 3DSTATE_WM and 3DSTATE_PS.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:32:59 -07:00
Kenneth Graunke
7d608d0c33 i965: Initial Ivybridge SF/SBE state setup.
Copied from gen6_sf_state.c.

The main change from Sandybridge seems to be that 3DSTATE_SF was split
into two separate state packet commands: 3DSTATE_SF and 3DSTATE_SBE
("setup backend").  The bit-offsets are even the same - only the DWords
numbers have shuffled around a bit.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:32:59 -07:00
Kenneth Graunke
3dc4bc1f78 i965: Make gen6_sf_state.c's get_attr_override non-static.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:32:59 -07:00
Kenneth Graunke
8832920c29 i965: Initial Ivybridge URB space partitioning, including push constants.
Currently this always reserves 16kB for push constants, regardless of
how much space is needed, and partitions it evenly betwen the VS and FS.
This is probably not ideal, but is straightforward.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:32:58 -07:00
Kenneth Graunke
477e2fe031 i965: Set maximum number of threads for Ivybridge.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:32:58 -07:00
Kenneth Graunke
235fa21a09 i965: Split out tracked state atoms for Ivybridge.
Currently, gen7_atoms is a verbatim copy of gen6_atoms; future commits
will update it to contain gen7-specific state.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:32:58 -07:00
Kenneth Graunke
89a82d72ca intel: Initial IS_GEN7 plumbing.
Currently, IS_GEN7, IS_IVYBRIDGE, IS_IVB_GT1, and IS_IVB_GT2 all return
false.  This allows me to write the code for them before actually adding
the PCI IDs and thus enabling the hardware.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:32:58 -07:00
Kenneth Graunke
d55471768e i965: Rename max_vs_handles to max_vs_entries for consistency.
The documentation uses the term "vertex URB entries", the code talks
about "entry size", and so on.  Also, handles are just "pointers" to
entries (actually small integers).

Also rename max_gs_handles to max_gs_entries.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:32:58 -07:00
Kenneth Graunke
d0f0d06482 i965: Convert BRW_NEW_* dirty bits to use an enum.
This will make it much easier to add new dirty bits.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Chad Versace <chad.versace@intel.com>
2011-05-17 23:32:58 -07:00
Kenneth Graunke
c638180fc7 i965: Rework IF/ELSE jump target back-patching.
The primary motivation for this is to better support Ivybridge control
flow.  Ivybridge IF instructions need to point to the first instruction
of the ELSE block -and- the ENDIF instruction; the existing code only
supported back-patching one instruction ago.

A second goal is to simplify and centralize the back-patching, hopefully
clarifying the code somewhat.

Previously, brw_ELSE back-patched the IF instruction, and brw_ENDIF
back-patched the previous instruction (IF or ELSE).  With this patch,
brw_ENDIF is responsible for patching both the IF and (optional) ELSE.

To support this, the control flow stack (if_stack) maintains pointers to
both the IF and ELSE instructions.  Unfortunately, in single program
flow (SPF) mode, both were emitted as ADD instructions, and thus
indistinguishable.

To remedy this, this patch simply emits IF and ELSE, rather than ADDs;
brw_ENDIF will convert them to ADDs (the SPF version of back-patching).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:32:58 -07:00
Kenneth Graunke
5936d96d33 i965: Move IF stack handling into the EU abstraction layer/brw_compile.
This hides the IF stack and back-patching of IF/ELSE instructions from
each of the code generators, greatly simplifying the interface.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:32:58 -07:00
Kenneth Graunke
774fb90db3 i965: Get a ralloc context into brw_compile.
This would be so much easier if we were using C++; we could simply use
constructors and destructors.  Instead, we have to update all the
callers.

While we're at it, ralloc various brw_wm_compile fields rather than
explicitly calloc/free'ing them.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:32:58 -07:00
Kenneth Graunke
ebeea98573 i965/gs: Move generation check for bailing earlier.
On Sandybridge, we don't need to break down primitives.  There's no need
to bother setting up brw_compile and such if it's not going to be used;
bail as early as possible.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:32:57 -07:00
Kenneth Graunke
c6175d7870 i965: Add _NEW_LIGHT to Gen6 clip state dirty bits.
ctx->Light.ProvokingVertex depends on _NEW_LIGHT.

Found by inspection.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:30:46 -07:00
Brian Paul
3559440873 mesa: add some missing GLAPIENTRY keywords
NOTE: this is a candidate for the 7.10 branch.
2011-05-17 21:24:05 -06:00
Tom Stellard
217cd216ea r300/compiler: Fix bug in rc_get_variables()
Variables that write to the same source select need to pe paired
together otherwise the register allocator might fail.

https://bugs.freedesktop.org/show_bug.cgi?id=36753
2011-05-17 19:13:47 -07:00
Marek Olšák
390196ecc7 u_vbuf_mgr: fix max_index computation when src_offset is abused as buffer_offset 2011-05-17 01:21:30 +02:00
Marek Olšák
a3ac28a736 mesa: make RGB9_E5 non-renderable on swrast again
_BaseFormat for RGB9_E5 is GL_RGBA due to the previous revert.
2011-05-17 00:13:43 +02:00
Marek Olšák
947190ab4b Revert "mesa: set reasonable defaults in update_wrapper"
This reverts commit 1d5f16ff8f.

It breaks fbo-readpixels on swrast.
For some reason, swrast likes GL_RGBA and CHAN_TYPE.
2011-05-17 00:13:43 +02:00
Kenneth Graunke
1309d2ea72 i965: Pass brw_compile pointer to brw_set_src[01].
This makes it symmetric with brw_set_dest, which is convenient, and will
also allow for assertions to be made based off of intel->gen.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-16 13:30:16 -07:00
Kenneth Graunke
2b8e7215eb i965: Fix "Paramater" typo in gen6_wm_state.c.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-16 09:41:00 -07:00
Benjamin Franzke
b8033a5651 egl: Compile wayland-drm.a into libEGL independent of egl_dri2
Fixes egl_gallium when egl_dri2 is not enabled.
2011-05-16 10:36:36 +02:00
Dave Airlie
c9aa3bbda4 st/mesa: overhaul vertex/fragment sampler and sampler views.
This fixes piglits fragment-and-vertex-texturing test on llvmpipe for me.

I've no idea if someone had another plan for this that is smarter than what
I've done here, but what I've basically done is

split fragment and vertex sampler and sampler_view setup function, factor
out the common chunks of both.

side-cleanups:
drop st->state.sampler_list - unused
don't update border color if we have no border color.

should fix https://bugs.freedesktop.org/show_bug.cgi?id=35849

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-05-16 06:40:26 +10:00
Dave Airlie
bc16c73407 gallium: block signals for new thread when spawning threads
I'm hard pressed to think of any reason a gallium thread would want to
receive a signal, especially considering its probably loaded as a library
and you don't want the threads interfering with the main threads signal
handling.

This solves a problem loading llvmpipe into the X server for AIGLX,
where the X server relies on the SIGIO signal going to the main thread,
but once llvmpipe loads the SIGIO can end up in any of its threads.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-05-16 06:40:26 +10:00
Dave Airlie
bd5b7a6f71 r600g: reduce flushes so only when texture and CB overlap.
We only need to do this when the texture and CB are using the
same memory area.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-05-15 18:09:15 +10:00
Tom Stellard
6d539579ad r300/compiler: Use ALU Result for IF conditionals
This saves one instruction per IF.
2011-05-14 22:35:28 -07:00
Marek Olšák
8a4136f624 r300g: HiZ fixes
Nothing special, just changing conditions for when HiZ can be enabled and
when HiZ memory becomes invalid.

I was thinking about it again and realized it had not been quite right.
2011-05-15 03:28:32 +02:00
Marek Olšák
19f59dd413 r300g: don't set other HyperZ states if depth and stencil tests are disabled
Such as HiZ.
2011-05-15 03:28:32 +02:00
Marek Olšák
fdd37af3f7 r300g: dynamically ask for and release Hyper-Z access
We ask for Hyper-Z access when clearing a zbuffer.
We release it if no zbuffer clear has been done for 2 seconds.
2011-05-15 03:28:32 +02:00
Marek Olšák
904f43f190 r300g: fix conversion from int to boolean 2011-05-15 03:26:29 +02:00
Marek Olšák
51095f74cf u_vbuf_mgr: fix max_index computation once again
See how I compute and use the 'unused' variable in the code.
It's crucial for getting max_index right.

Fixed with the help of apitrace.
(bisecting the problematic draw call manually was not fun though)

This should fix:
https://bugs.freedesktop.org/show_bug.cgi?id=36268
https://bugs.freedesktop.org/show_bug.cgi?id=36609
2011-05-14 20:03:03 +02:00
Marek Olšák
ad2999d211 st/mesa: set correct baseInternalFormat for _mesa_texstore in DrawPixels
GL_RGBA was always used for baseInternalFormat regardless of the chosen
texture internal format.

https://bugs.freedesktop.org/show_bug.cgi?id=37154

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-05-14 01:53:30 +02:00
Kenneth Graunke
2bba244329 i965: Use BRW_DATAPORT_READ_TARGET_DATA_CACHE instead of 0.
Using the #define'd constant is better than 0 with a comment.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Chad Versace <chad.versace@intel.com>
2011-05-13 15:20:52 -07:00
Kenneth Graunke
c77855d64e i965: Rename dp_render_target struct to gen6_dp.
This is actually just the message descriptor for Gen6+ dataport access;
it has nothing to do with the render cache.  Access to the sampler cache
and constant cache also would use this struct; rename for clarity.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-13 15:20:45 -07:00
Kenneth Graunke
17eaff77b0 i965: Attempt to un-muddle Gen6 data port message target defines.
These are documented on page 245 of IHD_OS_Vol4_Part2.pdf (the public
Sandybridge documentation/SEND instruction description).

Somebody had the bright idea to reuse gen4/5 defines labelled READ/WRITE
which just happened to be the same values as Render Cache/Sampler Cache.
It turns out that this field has nothing to do with READ/WRITE on
Sandybridge, but rather represents which data port to direct it to.

This was especially confusing in brw_set_dp_read_message, which
used "BRW_MESSAGE_TARGET_DATAPORT_WRITE."  In a read function.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-13 15:19:31 -07:00
Christoph Bumiller
5f5d486717 nvc0: prevent overlap between load address and destination regs
For example, an indirect load like "ld b128 $r0q c0[$r0]" seems to
overwrite the address register before finishing the load, but only
if there are a lot of threads running.

Visible as displaced geoemtry in Unigine Heaven.
2011-05-13 18:47:54 +02:00
Marek Olšák
dd445ae120 docs: update relnotes-7.11 2011-05-13 18:10:30 +02:00
Marek Olšák
e28e3a774c st/mesa: expose ARB_shader_texture_lod if SM3 is supported
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-05-13 17:57:56 +02:00
Matt Turner
fae77579ad util_logbase2 takes and returns unsigned, not int
Signed-off-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-05-12 16:37:50 -06:00
Matt Turner
c5ac8a8aa2 Remove redundant util_unsigned_logbase2
util_logbase2 is exactly the same function.

Signed-off-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-05-12 16:37:34 -06:00
Matt Turner
48a0a096f8 u_math.h: Remove redundant mingw32 ffs definition
Signed-off-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-05-12 16:37:20 -06:00
Benjamin Franzke
184bb09ff5 st/egl: Implement EGL_WL_bind_wayland_display for x11,drm,wayland 2011-05-13 09:31:10 -04:00
Benjamin Franzke
83c68758be egl_dri2: Discard similar configs 2011-05-13 09:31:09 -04:00
Kristian Høgsberg
93aea63a33 egl_dri2: Make it possible to not compile in the X11 platform 2011-05-13 09:31:09 -04:00
Francesco Marella
64e3cd0c42 nvfx: fill some PIPE_CAPs
Signed-off-by: Francesco Marella <francesco.marella@gmail.com>
2011-05-13 14:56:40 +02:00
Kenneth Graunke
f247b2d633 i965: Fix incorrectly named data port define.
According to my documentation this is actually "Media Block Write" on
Gen4-5; there has never been a "DWord Block Write."

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-13 08:36:07 -07:00
Kenneth Graunke
ceaec24149 i965: Fix typo in Gen6 "DWord Scattered Write" message define.
It's DWORD, not DWORLD.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-13 08:35:13 -07:00
Vinson Lee
ac85ab066b i915g: Fix typos in print messages. 2011-05-12 23:21:58 -07:00
Dave Airlie
c7b1497f4e r600g: don't unmap if we haven't mapped
should fix https://bugs.freedesktop.org/show_bug.cgi?id=37157

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-05-13 14:03:47 +10:00
Marek Olšák
8a50637453 mesa: EXT_texture_sRGB_decode little fixup
It doesn't fix bug 37150 though.
2011-05-13 01:43:28 +02:00
Dave Airlie
1ca3efe548 r600g: use a local var to store pointer to which register we are working on
this just makes the code a little bit cleaner.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-05-13 09:26:17 +10:00
Dave Airlie
240049adfa r600g: make range/block act more like a page table
only allocate the blocks ptr in the range if we ever have one,
otherwise don't bother wasting the memory.

valgrind glxinfo
before:
==967==     in use at exit: 419,754 bytes in 706 blocks
==967==   total heap usage: 3,552 allocs, 2,846 frees, 3,550,131 bytes allocated

after:
==5227==     in use at exit: 419,754 bytes in 706 blocks
==5227==   total heap usage: 3,452 allocs, 2,746 frees, 3,140,531 bytes allocate

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-05-13 09:26:16 +10:00
Dave Airlie
d79a4a612b r600g: reduce r600_reg footprint
This drops 6k of the text segment, a minor drop in the ocean, however
it also makes the code a lot cleaner and removes a lot of duplicated
information, hopefully making it more maintainable.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-05-13 09:22:41 +10:00
Dave Airlie
d015d2f391 r600g: reduce memory usage from range/block hash table.
This table covered a large range unnecessarily, reduce the address
range covered, use the fact that the bottom two bits aren't significant,
and remove unused fields from the range struct. It also drops the hash_size/shift in context in favour of a define, which should make doing the math
a bit less CPU intensive.

valgrind glxinfo
Before:
==320==     in use at exit: 419,754 bytes in 706 blocks
==320==   total heap usage: 3,691 allocs, 2,985 frees, 7,272,467 bytes allocated

After:
==967==     in use at exit: 419,754 bytes in 706 blocks
==967==   total heap usage: 3,552 allocs, 2,846 frees, 3,550,131 bytes allocated

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-05-13 09:22:40 +10:00
Dave Airlie
5e15497452 r600g: delay mapping until first map request. (v2)
Currently r600g always maps every bo, this is quite pointless as it wastes
VM and on 32-bit with wine running VM space is quite useful.

So with this patch we don't create the mappings until first use, without
tiling enabled this probably won't make a major difference on its own,
but with tiled staged uploads it should avoid keeping maps for most of the
textures unnecessarily.

v2: add bo data ptr check

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-05-13 09:22:39 +10:00
José Fonseca
5de2c67ba7 egl/dri2: Avoid unused static functions. 2011-05-12 15:24:26 +01:00
José Fonseca
4a47d6d46b egl/dri2: Prevent uninitialized variable dereference. 2011-05-12 15:23:48 +01:00
José Fonseca
6c26072bd1 egl/dri2: Fix const pointer duplication, prevent unitialized variable dereference.
Based on zhigang gong <zhigang.gong@gmail.com>'s patch.
2011-05-12 15:23:02 +01:00
José Fonseca
6a661895e9 egl: Fix int <-> ptr casts.
Based on zhigang gong <zhigang.gong@gmail.com>'s patch.
2011-05-12 15:12:16 +01:00
zhigang gong
6699cd4e8d glu: Fix _GLUfuncptr typedef.
typedef void (GLAPIENTRYP _GLUfuncptr)(); causes the following warning:
function declaration isn't a prototype.

Signed-off-by: José Fonseca <jfonseca@vmware.com>
2011-05-12 11:45:30 +01:00
José Fonseca
32a95cb70c mesa: Fix GetVertexAttrib* inside display lists.
GetVertexAttrib*{,ARB} is no longer aliased to the NV calls.

This fixes tracing yofrankie with apitrace, given it requires accurate
results from GetVertexAttribiv*.

NOTE: This is a candidate for the stable branches.
2011-05-12 01:09:55 +01:00
Tom Stellard
95c93651b4 r300/compiler: Fix bug in rc_get_variables()
Variables that share readers were not always being linked together.

https://bugs.freedesktop.org/show_bug.cgi?id=36939
2011-05-11 16:16:29 -07:00
Tom Stellard
4612554dce r300/compiler: Limit instructions to 3 source selects
Some presubtract conversions were generating more than 3 source
selects.

https://bugs.freedesktop.org/show_bug.cgi?id=36527

Note: This is a candidate for the 7.10 branch.
2011-05-11 16:16:29 -07:00
Tom Stellard
d1e8195c07 r300/compiler: Add simple unit test framework
Plus three tests for rc_inst_can_use_presub()
2011-05-11 16:16:29 -07:00
Alex Deucher
b9f2750900 r600g: fix flushes on rs780/rs880
They need the same hack as rv670.

Fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=35312

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-05-11 12:10:01 -04:00
José Fonseca
7a271151a5 mesa: Don't append fog code for programs that don't output color.
Fixes fdo 36919.

NOTE: This is a candidate for the stable branches.

It should be cherry-picked to the sames branches that
3aa21f93dc was.
2011-05-11 14:04:08 +01:00
José Fonseca
2812b60a84 svga/drm: Implement svga_winsys_screen::get_hw_version. 2011-05-10 16:36:35 +01:00
José Fonseca
a67ecfeebc st/wgl: Remove buggy assertion.
The assertion is wrong, now that state tracker can cope with a window with
zero width or height.
2011-05-10 16:13:05 +01:00
Maxim Levitsky
d6b248652a nv50: fix mistake in pipe caps for pre-NVA0 cards
Introduced by 531b12af35.
2011-05-10 10:16:54 +02:00
Kenneth Graunke
68074387a4 ir_to_mesa: Emit TXD instruction.
Mesa already supports this because of NV_fragment_program.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Marek Olšák <maraeo@gmail.com>
2011-05-09 11:23:54 -07:00
Kenneth Graunke
5a3a242a8f glsl: Add compiler support for ARB_shader_texture_lod.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Marek Olšák <maraeo@gmail.com>
2011-05-09 11:23:54 -07:00
Kenneth Graunke
1d4eb8d5d8 mesa: Add ARB_shader_texture_lod to the extension list; off by default.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-09 11:23:54 -07:00
Marcin Slusarz
4e1b1cbd0d nv50/nvc0: make transfers aware of PIPE_TRANSFER_MAP_DIRECTLY
If state tracker asked us to map resource directly and we can't
do it (because of tiling), return NULL instead of doing full transfer
- state tracker should handle it and fallback to some other method
or repeat transfer without PIPE_TRANSFER_MAP_DIRECTLY.

It greatly improves performance of xorg state tracker on nv50+,
because its fallback (DFS/UTS) is much faster than full transfer.
2011-05-09 20:19:19 +02:00
Matt Turner
86852236a3 r300/compiler: align memory allocations to 8-bytes
Eliminates unaligned accesses on strict architectures. Spotted by Jay
Estabrook.

Signed-off-by: Matt Turner <mattst88@gmail.com>

NOTE: This is a candidate for the 7.10 branch.
2011-05-09 20:01:58 +02:00
Marek Olšák
7297f2ac3c r300g: unreference a zbuffer surface after decompression 2011-05-09 20:01:58 +02:00
Marek Olšák
56b39fcd8b r300g: remove redundant state variable hyperz_locked 2011-05-09 20:01:58 +02:00
Marek Olšák
801fbdf286 mesa: document instructions ir_to_mesa emits
GLSL stopped using:
   BRA, EXP, LOG, LRP, NRM3, NRM4, XPD.

GLSL started using:
   KIL, SCS, SSG, SWZ.
(omg why SWZ? isn't proc_src_register flexible enough?)

GLSL doesn't use these opcodes some Radeons do support:
   ARR, DP2A, DST, LRP, XPD.

These opcodes are now unused:
   AND, NOT, NRM3, NRM4, OR, XOR.
(plus maybe the NV extensions which are unused by Gallium)

In addition to that, we don't use two-dimensional indirect addressing,
which the Mesa IR can do.
2011-05-09 20:01:58 +02:00
Michel Dänzer
39be542f73 r300c: Fix up for register allocator rewrite.
Was broken by commit fe622bac0c ('r300/compiler:
Rewrite register allocator').
2011-05-09 18:26:50 +02:00
Jerome Glisse
b9e8ea6a27 r600g: anisotropic filtering support for evergreen hw
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2011-05-09 12:18:41 -04:00
Carl-Philip Haensch
ad904cdf98 r600g: add support for anisotropic filtering 2011-05-09 12:09:16 -04:00
Michel Dänzer
9d792d013c gallium: Factor out unknown endianness detection. 2011-05-09 12:29:47 +02:00
Matt Turner
991c1f0249 Don't allow compilation if endianness isn't known
PIPE_ARCH_UNKNOWN_ENDIAN is used no where else. All #else branches of
ifdef PIPE_ARCH_LITTLE assume big-endian. Not #error'ing out here
only serves to allow bad things to happen.

Signed-off-by: Matt Turner <mattst88@gmail.com>
2011-05-09 12:23:21 +02:00
Matt Turner
5e945863ca p_config.h: Rely on glibc endianness definitions when available
Suggested by Julien Cristau.

Signed-off-by: Matt Turner <mattst88@gmail.com>
2011-05-09 12:22:59 +02:00
Marcin Slusarz
bd3ce30ee7 st/xorg: add some debugging messages to xorg_exa.c 2011-05-09 12:22:50 +02:00
Marcin Slusarz
6e0263fdd4 st/xorg: remove DEBUG_PRINT macro and add exa_debug_printf
Localizes preprocessor usage to one place.
2011-05-09 12:22:45 +02:00
Marcin Slusarz
7c5eaf5a2d st/xorg: fix compilation of xorg_exa.c with DEBUG_PRINT set to 1 2011-05-09 12:22:24 +02:00
Nicolas Kaiser
7074801ed7 cell: fix unbalanced parenthesis
Signed-off-by: Nicolas Kaiser <nikai@nikai.net>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-05-08 07:41:26 -06:00
Matt Turner
de3d9fa956 mesa: add precision to M_PI constant
Value found in my math.h header.

Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-05-06 10:36:32 -06:00
Matt Turner
ebc0b2dca0 mesa: replace ONE_DIV_LN2 constant with M_LOG2E
1/ln(2) is equivalent to log2(e), so define it as such.

log2(e) = ln(e)/ln(2) = 1/ln(2)

Worst of all, the definitions for M_LOG2E and ONE_DIV_LN2
(right beside each other!) weren't the same.

Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-05-06 10:33:15 -06:00
Marek Olšák
03615c02d8 r300/compiler: implement TXD and TXL opcodes 2011-05-07 02:51:38 +02:00
Marek Olšák
d8e222d887 r300g: handle seamless_cube_map caps 2011-05-07 02:51:38 +02:00
Benjamin Franzke
6bb230970c egl/wayland: Follow wl_resource_destroy changes 2011-05-06 16:50:45 -04:00
Christoph Bumiller
531b12af35 nv50,nvc0: activate seamless cube map filtering 2011-05-06 21:11:03 +02:00
Marek Olšák
27d3e0b25c docs: update relnotes-7.11 2011-05-06 20:14:28 +02:00
Marek Olšák
483d2ea5e3 docs: update GL3 status 2011-05-06 20:14:28 +02:00
Marek Olšák
d931b0d8b3 r600g: implement seamless_cube_map for evergreen
The r600/r700 support will follow soon.
2011-05-06 20:13:05 +02:00
Marek Olšák
a5f0a11477 gallium: implement seamless cubemap extensions
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-05-06 20:06:30 +02:00
Marek Olšák
bf65c9ea41 mesa: handle TEXTURE_CUBE_MAP_SEAMLESS in SamplerParameter
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-05-06 20:06:30 +02:00
Marek Olšák
a19c42ffc6 mesa: implement AMD_seamless_cubemap_per_texture 2011-05-06 20:06:30 +02:00
Alex Deucher
3b20a89941 r600g: avoid recursion in rv670 flush workaround
Should fix:
https://bugs.freedesktop.org/show_bug.cgi?id=36914

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-05-06 13:19:21 -04:00
Marcin Slusarz
3b2bc4ac5b gallium/xorg st/nv50: add PIPE_BIND_CURSOR
We need to distinguish surfaces for mouse cursors from scanouts,
because nv50 hardware display engine ignores tiling flags.
2011-05-06 19:09:23 +02:00
Kostas Georgiou
8c3226be90 Add pci id for FirePro 2270
Signed-off-by: Kostas Georgiou <georgiou@opengamma.com>
2011-05-06 13:03:40 -04:00
Alex Deucher
2c3232da7a egl_dri2: add new radeon pci ids
There seriously needs to be a better way to do
this.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-05-06 13:02:24 -04:00
Kristian Høgsberg
e5169e9615 egl: Add a cursor use bit to MESA_drm_image 2011-05-06 10:33:50 -04:00
Benjamin Franzke
834b84149d egl/wayland-drm: Generalize interface
Do not depend on _EGLDisplay and _EGLImage.
2011-05-06 10:33:50 -04:00
nobled
a3e2c8f31f glx: Check flush DRI extension version at runtime
The DRI driver itself might not have version 3 of the
DRI2 flush extension, in which case this would've
pointed to out of bounds memory...
2011-05-06 09:39:24 +02:00
Alex Deucher
31d27259b6 r600g: add back SOURCE_FORMAT setting that get accidently dropped
Spotted by Henri Verbeet

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-05-05 19:30:30 -04:00
Alex Deucher
5939bc03bc r600g: fix up the rules for enabling SOURCE_FORMAT(EXPORT_NORM)
Setting SOURCE_FORMAT to EXPORT_NORM is an optimization.
Leaving SOURCE_FORMAT at 0 will work in all cases, but is less
efficient.  The conditions for the setting the EXPORT_NORM
optimization are as follows:

R600/RV6xx:
BLEND_CLAMP is enabled
BLEND_FLOAT32 is disabled
11-bit or smaller UNORM/SNORM/SRGB

R7xx/evergreen:
11-bit or smaller UNORM/SNORM/SRGB
16-bit or smaller FLOAT

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-05-05 18:54:03 -04:00
Alex Deucher
bf7a3ddca6 r600g: further r6xx cache flush fixes
Don't emit sync packets for additional CBs or DB.
Spotted by Fredrik Höglund.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-05-05 18:45:55 -04:00
Dave Airlie
5066f7cd0e r600g: add rv670 flushing workaround.
Hopefully we can find out the proper fix for this, but for now
this makes the fbo mipmap tests pass on my rv670 (x2 card).

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-05-06 08:41:13 +10:00
Alex Deucher
d116fe51c1 r600g: fix cache flushes on r6xx
r6xx asics have some problems with the surface
sync logic for the CB and DB.  It's recommended
to use the event write interface for flushing
the DB/CB caches rather than the sync packets.
A single event write flush flushes all dst
caches, so we only need one for all CBs and DB.

Should fix:
https://bugs.freedesktop.org/show_bug.cgi?id=35312

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-05-06 08:07:12 +10:00
Marcin Slusarz
a041525ed9 mesa: don't call git if it's not git repository
Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-05-05 13:49:21 -07:00
Marcin Slusarz
02a6c9428d mesa: don't touch git_sha1.h if sha1 didn't change
Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-05-05 13:49:15 -07:00
Henri Verbeet
f60235e73a r600g: Match alpha ref precision to color format precision.
This fixes piglit fbo-alphatest-formats on Evergreen.

Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
2011-05-05 21:00:38 +02:00
Dave Airlie
dc4a3edcf9 Revert "DRI2/GLX: make swap event handling match spec"
This reverts commit 70227e21bb.

revert this until we sort things out, with a new glproto release
with compatible struct names.
2011-05-05 16:25:33 +10:00
Dave Airlie
ae7abf080b r600g: do RV6xx base updates inline with state updates.
This seems more in line with what the documentation suggests we should be
doing. It doesn't fix the rv635 regression, though I thought it might,
so it means I've no idea whats actually going wrong there.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
2011-05-05 09:07:49 +10:00
Jesse Barnes
70227e21bb DRI2/GLX: make swap event handling match spec
We only handle a 32 bit swap count, so use the new structure definitions.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2011-05-04 14:08:48 -07:00
Jesse Barnes
6ae9e8cbab GLX: don't crash when indirect clients try to set an event mask
After sending the GLXChangeDrawableAttributes request, we also set a
local set of attributes on the DRI drawable.  But in the indirect case
this array won't be present, so skip the setting in that case to avoid a
crash.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2011-05-04 14:08:48 -07:00
José Fonseca
37058c3497 scons: Add a few more human friendly messages. 2011-05-04 14:10:24 +01:00
José Fonseca
da87370032 mesa/gdi: Silence gcc warning about unused result. 2011-05-04 14:10:15 +01:00
José Fonseca
9fbd708932 st/wgl: Allow to create pbuffers bigger than the desktop.
We use a hidden window for pbuffer contexts, but Windows limits window
sizes to the desktop size by default. This means that creating a big
pbuffer on a small resolution single monitor would truncate the pbuffer
size to the desktop.

This change overrides the windows maximum size, allow to create windows
arbitrarily large.
2011-05-04 13:09:14 +01:00
José Fonseca
c636daa145 st/wgl: Cope with zero width/height windows.
While ensuring the framebuffer area is never zero.
2011-05-04 13:09:13 +01:00
Brian Paul
fc30910c65 i915g: add const qualifier to silence warning 2011-05-03 18:56:20 -06:00
Brian Paul
f85cd39fc4 mesa: remove unused restart.[ch] files
_mesa_PrimitiveRestartIndex() is in varray.c and glPrimitiveRestart()
is handled in the vbo module.
2011-05-03 18:22:04 -06:00
Ian Romanick
0f0179b8c2 glsl: Remove extra newline from error message 2011-05-03 14:51:02 -07:00
Alex Deucher
27477248d3 r600c: add some new pci ids
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-05-03 16:12:04 -04:00
Alex Deucher
c120d9d1cc r600g: add some new pci ids
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-05-03 15:26:07 -04:00
Marcin Slusarz
a8bbce8d6d st/xorg: flush after loading the cursor
We need cursor data to land in destination buffer before drmModeSetCursor.
It fixes "cursor lag" on nv50.
2011-05-03 16:36:54 +02:00
Michel Dänzer
5829332a9b gallium/draw: Fix enum type taken by draw_get_shader_param().
Pointed out by clang:

src/gallium/auxiliary/draw/draw_context.h:251:41: warning: implicit conversion
from enumeration type 'enum pipe_cap' to different enumeration type
'enum pipe_shader_cap' [-Wconversion]
      return tgsi_exec_get_shader_param(param);
             ~~~~~~~~~~~~~~~~~~~~~~~~~~ ^~~~~
2011-05-03 16:33:15 +02:00
Marek Olšák
5ba2e7adf0 mesa: implement AMD_shader_stencil_export
It's just an alias of the ARB variant with some GLSL compiler changes.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-03 12:03:22 +02:00
Marek Olšák
93754d8499 r600g: reorder caps 2011-05-03 12:03:22 +02:00
Marek Olšák
320adb93a1 r600g: set correct PIPE_CAP_MAX_COMBINED_SAMPLERS 2011-05-03 12:03:22 +02:00
Marek Olšák
a677952e68 mesa: make AMD_draw_buffers_blend an alias of the ARB variant
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-05-03 00:35:50 +02:00
Marek Olšák
3be1c7f260 glapi: regenerate files for AMD_draw_buffers_blend 2011-05-03 00:35:50 +02:00
Marek Olšák
9ecb46f59e glapi: add functions for AMD_draw_buffers_blend
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-05-03 00:35:50 +02:00
Marek Olšák
62aa51b78a mesa: flush vertices before changing GL_RASTERIZER_DISCARD state, not after
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-05-03 00:35:50 +02:00
Marek Olšák
aafbaa9e6a mesa: make _NEW_TEXTURE dirty when changing GL_TEXTURE_CUBE_MAP_SEAMLESS
Otherwise there would be no way to know whether the state has been changed.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-05-03 00:35:50 +02:00
Christoph Bumiller
220abb7adf nv50,nvc0: advertise GL_FIXED vertex buffers as supported
We'll handle them like f64 vertex buffers, by falling back to
copying vertex data to the command buffer through translate.
2011-05-03 00:02:36 +02:00
Christoph Bumiller
f986a6560f mesa,st/mesa: fix WPOS adjustment
Tested-by: Marek Olšák <maraeo@gmail.com>
2011-05-03 00:00:55 +02:00
Jon TURNEY
9cb800a97c Default to --disable-gallium-r300 if not --with-driver=dri
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Signed-off-by: Marek Olšák <maraeo@gmail.com>
2011-05-02 17:34:42 +02:00
Marek Olšák
02b352e2ac gallium: reorder fields of pipe_rasterizer_state to pack it more tightly
sizeof(struct pipe_rasterizer_state):
    Before: 32 bytes
    After: 28 bytes

Reviewed-by: Brian Paul <brianp@vmare.com>
2011-05-02 17:16:09 +02:00
Marek Olšák
ca6896ba14 r600g: document some new evergreen formats 2011-05-02 17:16:09 +02:00
Marek Olšák
929b3d8233 r600g: remove some more FIXME comments 2011-05-02 13:15:43 +02:00
Michel Dänzer
5815d06ac5 st/xorg: Fix two more instances of typo 'accle'. 2011-05-02 09:36:49 +02:00
Marcin Slusarz
951244c4cd st/xorg: fix typos 2011-05-02 09:28:16 +02:00
Eric Anholt
484b51d484 i965/gen6: Align interleaved URB writes for overflow outputs as well.
Fixes glsl-max-varyings.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=35614
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-01 20:13:10 -07:00
Marcin Slusarz
eb0a9e9a5a targets/xorg-nouveau: load nouveau_dri.so instead of i915_dri.so 2011-05-02 02:39:44 +02:00
Marcin Slusarz
1654988562 targets/xorg-nouveau: add libnvc0.a to nouveau libs 2011-05-02 02:39:44 +02:00
Marek Olšák
0d5ceb5891 r600g: remove some FIXME comments
All texture LOD tests pass.
2011-05-02 01:43:33 +02:00
Marek Olšák
72c6a748b9 Revert "r600g: truncate point sampled texture coordinates"
This reverts commit 1dc204d145.

MC_COORD_TRUNCATE is for MPEG and produces quite an interesting behavior
on regular textures. Anyway that commit broke filtering in demos/cubemap.
2011-05-02 01:20:22 +02:00
Marek Olšák
fb8786bda3 st/mesa: remove set-but-unused variables 2011-05-01 14:31:41 +02:00
Marek Olšák
08520bdea2 tgsi: remove set-but-unused variables 2011-05-01 14:13:09 +02:00
Marek Olšák
cacdc42e36 draw: remove set-but-unused variable 2011-05-01 14:12:47 +02:00
Marek Olšák
425cfa139b rbug: remove set-but-unused variables 2011-05-01 14:07:31 +02:00
Marek Olšák
847d397b34 ir_to_mesa: remove set-but-unused variables 2011-05-01 14:02:36 +02:00
Marek Olšák
2032daced1 mesa: remove set-but-unused variables in texcompress_s3tc 2011-05-01 14:02:35 +02:00
Marek Olšák
2d2b546189 mesa: remove set-but-unused variable in bind_attrib_location 2011-05-01 14:02:35 +02:00
Marek Olšák
f507530d25 mesa: remove unused-but-set variable in extract_uint_rgba 2011-05-01 14:02:35 +02:00
Marek Olšák
97398d1d56 r300/compiler: remove set-but-unused variables 2011-05-01 14:02:35 +02:00
Marek Olšák
56e83b4aa2 r600g: remove set-but-unused variable 2011-05-01 13:25:52 +02:00
Marek Olšák
e9d2ef79de r600g: remove FIXME comment
DONTBLOCK is correctly handled in r600_bo_map.
2011-05-01 01:54:29 +02:00
José Fonseca
dc9e5ed5e1 mesa: GL_PROVOKING_VERTEX_EXT is a GLenum, not GLboolean. 2011-04-30 22:38:00 +01:00
Tom Stellard
7679a4ddf4 r300/compiler: Cleanups from the regalloc merge 2011-04-30 13:15:29 -07:00
Tom Stellard
d7cf9833d7 r300/compiler: Add return statement to rc_list() 2011-04-30 12:57:09 -07:00
Tom Stellard
7edf7d1169 r300g: Fix scons build
Broken by the dependency on ralloc introduced by
fe622bac0c
2011-04-30 12:35:06 -07:00
Daniel Vetter
899b786b19 i915g: enable X-tiling for s3tc textures
Tested-by: Christopher Egert <cme3000@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-04-30 20:42:34 +02:00
Tom Stellard
d379e938f0 r300/compiler: Enable swizzle packing in the allocator for r300 and r400 2011-04-30 11:00:16 -07:00
Tom Stellard
1b75d48e84 r300/compiler: Handle loops in the register allocator 2011-04-30 11:00:16 -07:00
Tom Stellard
ac952a11df r300/compiler: Handle loops in rc_get_readers() 2011-04-30 11:00:16 -07:00
Tom Stellard
fe622bac0c r300/compiler: Rewrite register allocator
The new allocator uses ra and does swizzle packing.

Also, a data structure (struct rc_variable) and associated functions have
been added for generating UD and DU chains.
2011-04-30 11:00:15 -07:00
Tom Stellard
e4a765ae2d ra: Add ra_set_node_reg()
This function can be used to avoid creating single register classes for
input/payload registers.  This makes optimistic coloring less likely
to fail.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-04-30 11:00:15 -07:00
Tom Stellard
dbac75fa2f r300/compiler: Use RC_MASK_W when converting RGB to Alpha instructions 2011-04-30 11:00:15 -07:00
Tom Stellard
4f4d1d06da r300/compiler: rc_reader_data: Add ExitOnAbort flag 2011-04-30 11:00:15 -07:00
Tom Stellard
bbcee3268a r300/compiler: Add more info to struct rc_reader
For pair instructions we need a reference to both the arg
and source.
2011-04-30 11:00:15 -07:00
Tom Stellard
6a6068e5e1 r300/compiler: Add remove dead sources pass
The instruction scheduler will sometimes leave orphaned sources when
converting instructions from RGB to Alpha.  If one of these orphaned
sources has an index greater than the maximum temporary register index,
then the compiler will incorrectly report "Too many hardware temporaries
used".  The dead sources pass cleans up these orphaned sources.
2011-04-30 11:00:15 -07:00
Marek Olšák
bd661a933b docs: add ARB_ES2_compatibility in relnotes-7.11 2011-04-30 12:02:01 +02:00
Marek Olšák
fdff7e635b st/mesa: expose ARB_ES2_compatibility if GL_FIXED vertex format is supported
Tested with softpipe and llvmpipe.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-30 12:02:01 +02:00
Marek Olšák
0f1e59deac mesa: accept GL_FIXED in glVertexAttribPointer (ARB_ES2_compatibility)
GL_FIXED should not be accepted in the other gl*Pointer calls in OpenGL.

There is a new piglit for this: arb_es2_compatibility-fixed-type.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-30 12:02:01 +02:00
Brian Paul
076bd11112 mesa: fix error string, remove out of date comment 2011-04-29 18:42:09 -06:00
Brian Paul
be293c14c6 mesa: remove commented-out #include 2011-04-29 18:40:56 -06:00
Thierry Vignaud
04bdb2f314 mesa: fix tarball creation
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-04-29 17:56:35 -06:00
Eric Anholt
6a02679f01 i965/gen6: Fix LogicOp handling for GL_COPY and/or floating-point RTs.
We were accidentally leaving blending enabled for LogicOp GL_COPY,
which ARB_color_buffer_float/GL_RGBA32F-render (and friends) caught.
Additionally, the GL spec says that no LogicOp should be done to
floating-point targets, and the GPU gets really angry even if you say
to LogicOp GL_COPY to float.
2011-04-29 15:27:02 -07:00
Eric Anholt
3032582d03 i965: Remove dead entrypoints to state cache, rename the one that's left.
As we expanded the usage of the state cache, it grew extra
functionality.  However, with the recent state streaming rework, we're
back to the state cache being used only for shader kernels, which is
the piece of GPU state that's actually expensive to compute again from
scratch, since it involves compiling.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-29 15:27:02 -07:00
Eric Anholt
acb4d5cd96 i965/gen4: Move the GS state to state streaming.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-29 15:26:56 -07:00
Eric Anholt
8ba0c025a4 i965/gen4: Move clip state to state streaming
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-29 15:26:50 -07:00
Eric Anholt
d6ba7b1603 i965: Drop the now unused brw_cache_data() function.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-29 15:26:50 -07:00
Eric Anholt
bb7ff01deb i965: Fix up state dumping for SF state.
It was moved to state streaming a while back and this was left over.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-29 15:26:50 -07:00
Eric Anholt
588cebce2d i965/gen4: Move VS state to state streaming.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-29 15:26:43 -07:00
Eric Anholt
04e3f1d3c2 mesa: Add a bunch of documentation to the register allocator.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-29 15:26:34 -07:00
Eric Anholt
a82a43e8d9 i965/gen6: Use the dynamic state base address to reduce relocations.
Now that all the dynamic state is streamed through the top of the
batchbuffer, we can cut out many of our relocations to that state by
using the base address.

Improves 3DMMES taiji performance 3.3% +/- 0.4% (n=15).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-29 15:26:23 -07:00
Eric Anholt
855f56ca13 i965/gen6: Move scissor state to state streaming.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-29 15:26:18 -07:00
Eric Anholt
5c742ea1ee i965: Move sampler state to state streaming.
Overall, across this series since the last set of numbers, gen6 3DMMES
taiji performance has dropped 0.8% +/- 0.3% (n=15), probably due to
the increased reissuing of state from some of the state objects that
otherwise never changed, and increased occurrence of the per-batch
overhead as we've increased how much we put in the batch BO without
increasing the batch BO's size.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-29 15:26:14 -07:00
Eric Anholt
1a447749ed i965/gen4: Move WM state to state streaming.
The samplers are about to become streamed for gen6 performance, which
would cause this unit to blow out the state cache.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-29 15:26:04 -07:00
Eric Anholt
c108a3f863 i965/gen6: Move the depth/stencil state to state streaming.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-29 15:25:59 -07:00
Eric Anholt
35e8fe5c99 i965/gen6: Move the blend state to state streaming.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-29 15:25:54 -07:00
Eric Anholt
2ee1fd2e8f i965/gen6: Move the color calc state to state streaming.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-29 15:25:50 -07:00
Eric Anholt
d67c08319f i965: Move the CC VP to state streaming.
This is in a way a revert of f5bb775fd1.
The tiny win that had will be overwhelmed by the win of using the gen6
dynamic state base address.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-29 15:25:49 -07:00
Eric Anholt
8d2047ca7e i965/gen6: Move the SF VP to state streaming.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-29 15:25:45 -07:00
Eric Anholt
3628e123f1 i965/gen6: Move the clip VP to state streaming.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-29 15:25:41 -07:00
Eric Anholt
32cc0c9d8d i965/gen6: Stream the VS push constants.
Improves 3DMMES taiji demo performance by 10.1% +/- 0.9% (n=15).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-29 15:25:37 -07:00
Eric Anholt
90c70123b8 i965/gen6: Stream the WM push constants.
Improves 3DMMES taiji demo performance by 5.1% +/- 1.9% (n=15), by
reducing CPU time spent thrashing around those tiny little constant BOs.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-29 15:25:30 -07:00
Eric Anholt
530de3a2f5 i965: Give the push constants and pull constants unique function names.
This helps clarify profiling results.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-29 15:23:21 -07:00
Eric Anholt
03b2e0fcdf i965: Fix fragcoord_w on gen6 with 16-wide.
The payload regs can go all the way up to register 60+, so just give
them 8 bits to be addressed by instead of 3-4 (which made source_w_reg
of 8 end up 0).  There's no reason to aggressively pack these fields,
as they are just used as compiler information, where being easier to
access is probably more important than shaving a byte or two off of
the structure.

Fixes piglit fragcoord_w.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=36649
2011-04-29 12:25:21 -07:00
Eric Anholt
8c1637a4c2 meta: Don't ask for floating point textures if not ARB_texture_float.
I was promoting to float for ARB_color_buffer_float unclamped, which
failed when ARB_texture_float wasn't present.  Since the metaops don't
need results outside of [0,1] when not drawing to a floating point
destination, they can just use a fixed point texture when floating
point destinations are impossible.

Fixes regression in fdo23670-depth_test when --enable-texture-float is
not present.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=36473
2011-04-29 12:02:44 -07:00
Brian Paul
2be2e1d3ad mesa: fix a few incorrect error messages 2011-04-29 12:03:48 -06:00
Benjamin Franzke
dc520d4fef egl/wayland: Fix possible lockup in drm initialization
Lockup happens when wl_drm interface is not available.
2011-04-29 17:05:16 +02:00
Jon TURNEY
8a58eccc62 Add git_sha1.h to .gitignore
Since commit de579a1 "Include GIT SHA1 in GL version string"

$ git status
 On branch master
 Your branch is ahead of 'origin/master' by 2 commits.

 Untracked files:
   (use "git add <file>..." to include in what will be committed)

       src/mesa/main/git_sha1.h
nothing added to commit but untracked files present (use "git add" to track)

Add git_sha1.h to .gitignore so git knows not to warn it is present but untracked

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
2011-04-29 12:56:53 +01:00
Marek Olšák
f8279fb9d8 r600g: print opcodes names instead of numbers 2011-04-29 13:16:40 +02:00
Marek Olšák
f974bdebee docs: update relnotes-7.11 2011-04-29 11:32:55 +02:00
Marek Olšák
aed76e5af3 docs: update GL3 status 2011-04-29 11:32:55 +02:00
Marek Olšák
aeac658e25 mesa: remove unused variable bytesPerRow 2011-04-29 11:32:55 +02:00
Marek Olšák
8b558451ad r600g: implement EXT_packed_float 2011-04-29 11:31:55 +02:00
Marek Olšák
e62530a6c0 st/mesa: support EXT_packed_float
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-29 11:31:55 +02:00
Marek Olšák
631d23daa9 mesa: implement EXT_packed_float
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-04-29 11:31:55 +02:00
Marek Olšák
b48359184e util: implement R11G11B10_FLOAT pack/unpack functions
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-29 11:31:55 +02:00
Marek Olšák
1271424615 mesa, util: move RGB9E5 conversion functions to gallium/util
Also use MAX3 and incorporate Ian's suggestion in texformat.c.

I don't think wrapping u_format_rgb9e5.h in another header and thus making it
more complicated is worth it.
2011-04-29 11:31:55 +02:00
Marek Olšák
de9f55437a r600g: trivially implement EXT_texture_shared_exponent
Nothing else needed.
2011-04-29 11:31:55 +02:00
Marek Olšák
349184be36 util: implement R9G9B9E5 pack and unpack functions
softpipe and llvmpipe support done (sampler only).

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-29 11:31:55 +02:00
Marek Olšák
1da44f5923 st/mesa: support EXT_texture_shared_exponent
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-29 11:31:55 +02:00
Marek Olšák
9d7698c468 mesa: implement EXT_texture_shared_exponent
swrast support done.

There is no renderbuffer support in swrast, because it's not required
by the extension.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-29 11:31:55 +02:00
Marek Olšák
1d5f16ff8f mesa: set reasonable defaults in update_wrapper
I was wondering why I had been getting GL_RGBA for GL_RGB9_E5.

Instead of setting GL_RGBA and CHAN_TYPE for most types,
use the helper functions to obtain the info.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-29 11:31:55 +02:00
Christopher Egert
608a4a17fe i915g: Enable S3TC texture support
Reviewed-by: Jakob Bornecrantz <wallbraker@gmail.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Christopher Egert <cme3000@gmail.com>
Signed-off-by: Jakob Bornecrantz <wallbraker@gmail.com>
2011-04-29 02:15:07 +02:00
Kenneth Graunke
19efd1442c prog_print: Add support for printing the TXD opcode.
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-28 14:51:29 -07:00
Brian Paul
8cce283038 llvmpipe: move active_query assignment
Fixes piglit regression.
2011-04-28 12:41:49 -06:00
Brian Paul
284191560b llvmpipe: move active_query assignment in lp_setup_begin_query()
If we run out of bin memory and do an early return from
lp_setup_begin_query() we'd omit setting the setup->active_query
pointer.  Then, when lp_setup_end_query() was later called, the
assertion for setup->active_query == pq would fail.  Moving the
assigment in lp_setup_begin_query() avoids that.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2011-04-28 07:51:55 -06:00
José Fonseca
fa7a051c25 sgi: Fix MSVC build.
Including windows.h was ineffective on MSVC because we define the NOGDI macro,
which skips the wingdi.h include.

Unsetting NOGDI is also a bad idea because it causes all sort of symbol
clashes with SGI code.

The real problem is that WINGDAPI was not being defined, also due to NOGDI,
so simply define it to blank if not done already.  This seems to make
everybody happy.
2011-04-27 19:06:07 +01:00
Brian Paul
f9cc6acbfa st/mesa: raise shader MaxParameters if driver supports more
The default value is 64 but drivers usually advertise more, like 4096.
Allows ARB vp/fp programs to use more parameters.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2011-04-27 11:58:42 -06:00
Brian Paul
f3c92c2323 mesa: emit more info in program parser error message 2011-04-27 11:57:04 -06:00
Brian Paul
0be6ae74e9 svga: emit user-defined clip plane state
User-defined clip planes were a swtnl fallback before.
2011-04-27 11:51:30 -06:00
Eric Anholt
33afdf8356 docs: Note that ES2_compatibility is already done. 2011-04-27 09:48:38 -07:00
Eric Anholt
aa3e1c25d3 Revert "intel: use throttle ioctl for throttling"
This reverts commit 50ade6ea69.

Fixes jerky rendering again on apps that don't block on the GPU per
frame and are GPU bound (e.g. 3DMMES on Ironlake).  The whole point of
this complicated throttle scheme is to wait on frame n-1 to have
started rendering before starting frame n's rendering.  Otherwise, the
GPU-bound app will race ahead and call the GL to draw many
nearly-identical frames, then >0ms later get stuck waiting for them
(all dispatched at about the same time) to retire, then render a new
batch of nearly-identical frames.
2011-04-27 09:48:26 -07:00
Brian Paul
66d95919d5 st/mesa: choose 3-component float formats before 4-component formats
If GL_RGB16F or GL_RGB32F is specified let's try the 3-component float
texture formats before trying the 4-component ones.  Before this,
GL_RGB16/32F were treated the same as GL_RGBA16/32F.

Reviewed-by: Marek Olšák <maraeo@gmail.com>
2011-04-27 09:06:31 -06:00
Brian Paul
48aa772589 st/mesa: whitespace fixes 2011-04-27 09:05:30 -06:00
Marek Olšák
b8de75d537 util: make macros MIN3, MAX3, MIN4, MAX4 little more efficient 2011-04-27 13:16:35 +02:00
Marek Olšák
069a9766a9 mesa: add macros MIN3 and MAX3 2011-04-27 13:16:35 +02:00
Marek Olšák
7e5953fca2 gallium/nouveau: fix printf warnings 2011-04-27 13:16:35 +02:00
Marek Olšák
31200d0688 gallivm: fix warning: ‘value’ may be used uninitialized in this function
The path where it's uninitialized is guarded by an assert.
2011-04-27 13:16:35 +02:00
Marek Olšák
e031bed122 st/mesa: fix warning: ‘user_memory’ may be used uninitialized in this function
It's initialized later in a conditional the condition of which is always true
the first time it's evaluated.
2011-04-27 13:16:35 +02:00
Marek Olšák
1e5dc6a778 svga: fix warning: ‘uc.ui’ may be used uninitialized in this function
This is safe because it's initialized if buffers & PIPE_CLEAR_COLOR and
probably doesn't have any effect otherwise.
2011-04-27 13:16:35 +02:00
nobled
39cd791f34 os: simplify ifdef
The actual code that needs this include is just using
"if defined (PIPE_OS_UNIX)", and the two conditions should match.

This should also make the file compile under Hurd.
2011-04-27 11:35:02 +01:00
Brian Paul
2d422a6c48 docs: fix typo, wrap lines in 7.11 release notes 2011-04-26 14:58:33 -06:00
Brian Paul
83eda35f16 docs: add GL_ARB_robustness to 7.11 release notes 2011-04-26 14:57:57 -06:00
Brian Paul
6b329b9274 Squashed commit of the following:
commit 864fe253b04105b7469e5f7b064dc37637b944f8
Author: Brian Paul <brianp@vmware.com>
Date:   Thu Apr 21 20:13:07 2011 -0600

    mesa: s/exec/disp/ in _mesa_init_histogram_dispatch()

    This function isn't normally compiled (FEATURE_histogram).

commit f4bf45e2b94b582cacd19cdca873c5be627e4250
Author: nobled <nobled@dreamwidth.org>
Date:   Thu Apr 21 07:53:58 2011 -0600

    mesa: hook up GL_ARB_robustness dispatch functions

    ...and advertise the extension.

    Signed-off-by: Brian Paul <brianp@vmware.com>

commit 2b89e38e5f572dc40cebc06381ae7c5d04386998
Author: nobled <nobled@dreamwidth.org>
Date:   Thu Apr 21 07:53:58 2011 -0600

    mesa: regenerated API files for GL_ARB_robustness

    Signed-off-by: Brian Paul <brianp@vmware.com>

commit 5d5ebfb7135cec9d833adef86cbf4d0f3d9beca8
Author: nobled <nobled@dreamwidth.org>
Date:   Thu Apr 21 07:53:57 2011 -0600

    glapi: add ARB_robustness xml

    Signed-off-by: Brian Paul <brianp@vmware.com>

commit 0159d1d6d99f4bbc18381dc2081c20d3aff17ac9
Author: nobled <nobled@dreamwidth.org>
Date:   Thu Apr 21 07:53:57 2011 -0600

    mesa: implement GL_ARB_robustness functions

    Signed-off-by: Brian Paul <brianp@vmware.com>

commit 938fd71f4c4742f274922d53492a7290ab8d9c9b
Author: nobled <nobled@dreamwidth.org>
Date:   Thu Apr 21 07:53:57 2011 -0600

    mesa: add context fields for GL_ARB_robustness

    Signed-off-by: Brian Paul <brianp@vmware.com>

commit 72075137bc79e65be03dac7e97b6dba93c3a86a4
Author: nobled <nobled@dreamwidth.org>
Date:   Thu Apr 21 07:53:57 2011 -0600

    mesa: standardize more bounds-checking error messages

    Signed-off-by: Brian Paul <brianp@vmware.com>

commit 32a3fc23746db49da903fbc08afa0135af3007d2
Author: nobled <nobled@dreamwidth.org>
Date:   Thu Apr 21 07:53:57 2011 -0600

    mesa: standardize some bounds-checking error messages

    Signed-off-by: Brian Paul <brianp@vmware.com>

commit cecbf1f4d164207de373dec0cadee2e84e1f9656
Author: nobled <nobled@dreamwidth.org>
Date:   Thu Apr 21 07:53:57 2011 -0600

    mesa: add more bounds-checking support for client memory buffers

    Signed-off-by: Brian Paul <brianp@vmware.com>

commit edc895b52383d5bd274422db56adead1d81daf5f
Author: nobled <nobled@dreamwidth.org>
Date:   Thu Apr 21 07:53:57 2011 -0600

    mesa: add bounds-checking support for client memory buffers

    Signed-off-by: Brian Paul <brianp@vmware.com>

commit 3a96ef28a538f158a219b406cd090dee70470c85
Author: nobled <nobled@dreamwidth.org>
Date:   Thu Apr 21 07:53:57 2011 -0600

    mesa: use is_bufferobj() helper function

    Signed-off-by: Brian Paul <brianp@vmware.com>
2011-04-26 14:54:41 -06:00
Eric Anholt
37642518b8 i965/fs: Add support for compute-to-mrf in 16-wide mode.
This is more painful than instruction scheduling, as we have to
compare two MRF writes to see if they coincide, and have to handle
partial GRF writes before that (for example, the result of a math
instruction written to color).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-26 12:20:22 -07:00
Eric Anholt
445289b509 i965/fs: Typo fix a comment.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-26 12:20:19 -07:00
Eric Anholt
0834607a89 i965/fs: Enable constant propagation in 16-wide.
All that needed fixing was skipping the newly-possible
uncompressed/sechalf partial GRF constant writes.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-26 12:20:16 -07:00
Eric Anholt
91d1a14158 i965/fs: Fix and enable the instruction scheduler for 16-wide.
Most of the work of the scheduler is agnostic to wide dispatch.  It
operates on our virtual GRF file, which means instructions are
generally referring to 8 or 16 wide naturally.  For the MRF file
management we're trying to track the actual hardware MRF file, so we
need to watch if an instruction writes multiple MRFs.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-26 12:20:12 -07:00
Eric Anholt
3b20f999bb i965/fs: Add support for 16-wide dispatch with uniforms in use.
This is glued in in a bit of an ugly way -- we rely on the uniforms
having been set up by 8-wide dispatch, and we just reuse them without
the ability to add new uniforms for any reason, since the 8-wide
compile is already completed.  Today, this all works out because our
optimization passes are effectively the same for both and even if they
weren't, we don't reduce the set of uniforms pushed after
optimization.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-26 12:20:05 -07:00
Eric Anholt
b061b5ffb0 hash_table: Add an iterator for doing things like cleanup of the HT.
Without this, consumers often have to keep linked lists of the
entries, at additional malloc cost.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-26 12:20:02 -07:00
Eric Anholt
b943b9b1a6 i965/fs: Add a little whitespace between shader dumping debug.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-26 12:19:59 -07:00
Eric Anholt
9c57780dc0 i965/fs: Add support for compr4 MRF writes.
These reduce an emitted (not decoded) instruction per shader on
g4x/gen5, but may allow for additional register coalescing as well.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-26 12:19:52 -07:00
Eric Anholt
42ad2f0b9b i965/fs: Add support for 16-wide dispatch on gen5.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-26 12:19:49 -07:00
Eric Anholt
662f1b48bd i965/fs: Add initial support for 16-wide dispatch on gen6.
At this point it doesn't do uniforms, which have to be laid out the
same between 8 and 16.  Other than that, it supports everything but
flow control, which was the thing that forced us to choose 8-wide for
general GLSL support.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-26 12:19:46 -07:00
Eric Anholt
76b7a0c1af i965/fs: Add support for discard instructions in 16-wide mode.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-26 12:19:43 -07:00
Eric Anholt
148a32e622 i965/fs: Add support for math instructions in 16-wide mode.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-26 12:19:40 -07:00
Eric Anholt
54990673a6 i965/fs: Fix interference calculation of pixel_[xy] in 16-wide.
Fixes glsl-fs-ceil in that mode, which produced the code in the comment.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-26 12:19:33 -07:00
Eric Anholt
af20328271 i965/fs: Disable some optimization passes under 16-wide for now.
These are fixable for 16, but that can wait until after it's basically
working.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-26 12:19:30 -07:00
Eric Anholt
8575d18362 i965/fs: Add support for 16-wide texturing on gen5+.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-26 12:19:27 -07:00
Eric Anholt
141b0bb277 i965/fs: Add support for computing pixel_[xy] in 16-wide.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-26 12:19:25 -07:00
Eric Anholt
2ac1cb8b83 i965/fs: Add support for 16-wide dispatch to the register allocator.
Note that the virtual grfs are in increments of the dispatch_width,
not hardware registers -- this makes the 16-wide emit and 8-wide emit
mostly the same.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-26 12:19:21 -07:00
Eric Anholt
7c647a2fe9 i965: Move the destination reg setup for 8/16 wide to the emit code.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-26 12:19:05 -07:00
Kristian Høgsberg
5dfba09d49 intel: Use tiling for dri2AllocateBuffer implementation 2011-04-26 13:26:34 -04:00
Kristian Høgsberg
7363088f9f intel: Set gen in intelInitScreen, just copy value in intelInitContext 2011-04-26 13:26:31 -04:00
Kristian Høgsberg
63325a0586 intel: Use X tiling for DRM EGL Images 2011-04-26 13:26:28 -04:00
Ian Romanick
cd354b4eb8 mesa: Remove SWcontext::_FogMode, use gl_context::gl_fog_attrib::Mode everywhere
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-25 18:27:17 -07:00
Kristian Høgsberg
f274dfaca4 egl: Use the right extension name in #ifdef 2011-04-25 15:34:04 -04:00
Kristian Høgsberg
b6ed837ffe wayland: Fix prototypes for EGL_WL_bind_wayland_display extension 2011-04-25 15:07:15 -04:00
Nicolas Kaiser
4dfbb81891 main: remove duplicated includes
Remove duplicated includes of guarded headers.

Signed-off-by: Nicolas Kaiser <nikai@nikai.net>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-04-25 11:03:01 -06:00
Benjamin Franzke
6a35ed1f66 winsys/wayland: Fix typo in Makefile
Reported by dir1212 on irc.
2011-04-25 18:17:07 +02:00
Benjamin Franzke
d72e7f0dd9 st/egl: Add wayland shm softpipe support 2011-04-25 10:45:57 -04:00
Benjamin Franzke
34fd282b27 st/egl: Generalize wayland backend a bit 2011-04-25 10:45:56 -04:00
Benjamin Franzke
aaa3c0d6de winsys: Add wayland shm sw winsys 2011-04-25 10:45:56 -04:00
Henri Verbeet
b2a98c3531 r600g: Unify comment style somewhat.
Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
2011-04-25 14:06:22 +02:00
Henri Verbeet
d7577ae3a6 r600g: Cleanup the big endian support a bit.
In particular, make sure the code is at least compiled on little endian
systems.

Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
2011-04-25 14:06:21 +02:00
Henri Verbeet
32001c2244 r600g: Use EG constants in EG r600_colorformat_endian_swap().
This would actually fail to compile when PIPE_ARCH_BIG_ENDIAN is defined.

Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
2011-04-25 14:06:21 +02:00
Marek Olšák
0fecb928f5 configure.ac: require LLVM for r300g on x86 and x86_64 2011-04-25 13:45:05 +02:00
Marek Olšák
a86fc719d6 configure.ac: enable LLVM by default on x86 and x86_64 2011-04-25 13:45:05 +02:00
Marek Olšák
9e59ed59c1 mesa: add stricter checks for float formats in the texstore memcpy path
E.g. when the internal format was RGBA16F and the source was RG, it would use
memcpy.
2011-04-25 13:45:05 +02:00
Marek Olšák
628544421d mesa: implement generate-mipmap fallback for RGB10_A2
I hit this when testing RV350, which lacks RGB10_A2 render target
support. It had been missed when implementing the format and probably
unused by anything else too.

Not applicable to 7.10.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-04-25 13:45:05 +02:00
Vinson Lee
077b1a6144 r600g: Remove r600_helper.c from SConscript.
This is a follow-up to commit d737857ed2.
2011-04-24 23:58:39 -07:00
Marek Olšák
774c165d76 docs: update GL3 status 2011-04-25 01:54:12 +02:00
Marek Olšák
71667533d1 r600g: remove some pointless and unused functions 2011-04-25 01:20:40 +02:00
Marek Olšák
512c814849 r600g: do not reset device to 0 when doing unrelated operations
Seems to be a copy-paste bug.
2011-04-25 01:20:40 +02:00
Marek Olšák
def6a91a62 r600g: trivially implement LATC/3DC
Passes fbo-generatemipmap-formats.
2011-04-25 01:20:40 +02:00
Dave Airlie
d737857ed2 r600g: drop r600_helper.c no point in it
move the one function into state common

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-04-25 09:06:14 +10:00
Dave Airlie
de48199693 r600g: enable EXT_draw_buffers2
Doesn't cause any piglit regression and passes the fbo-draw-buffers-blend
test.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-04-25 06:55:09 +10:00
Dave Airlie
863eecd0d8 st/mesa: fix regression since a22aba4eae
"st/mesa: check image size before copy_image_data_to_texture()" caused
a regression in piglit fbo-generatemipmap-formats test on all gallium drivers.

Level 0 for NPOT textures will not match minified values, so don't do this
check for level 0.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-04-25 05:59:47 +10:00
Dave Airlie
0a9cec3475 r600g: fix glean clipflat test.
the provoking vertex doesn't apply to quad/strip/polygon.

This fixes clipFlat on r600g.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-04-24 20:35:06 +10:00
Marek Olšák
0b3122cfcb r300g: reorder caps 2011-04-24 12:00:00 +02:00
Marek Olšák
0c71da18ee r300g: fix exposing caps on r300-r400
Broken with 72239d16cd.
2011-04-24 12:00:00 +02:00
Bryan Cain
f18a086326 glsl: Fix typos in comments. 2011-04-23 21:33:47 -07:00
Dave Airlie
6372660d12 r600g: fix glsl-fs-abs-neg
the hw does neg after abs, so don't neg the source in the ABS instruction case.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-04-24 11:04:46 +10:00
Dave Airlie
77dc4c154c r600g: fix bank swizzle calcs for scalar only operations.
In the initial code if we had nothing in the vector slots r would
never get reset to 0, so we'd fail to compile shaders, after the previous
commit this would happen for the LIT tests. When I fixed that we did a lot
of unnecessary loops through all the vector states when we had no vector
slots filled. So this patch optimises thing for the scalar only state.

This fixes the 3 LIT piglit tests on r600g.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-04-24 08:33:19 +10:00
Dave Airlie
22d5a71e4d r600g: PV/PS have cycle restrictions in scalar operations
In the R600 ISA document:
Section 4.7.5 Cycle restrictions for the ALU.trans states that
PV/PS have cycle restrictions wrt constants.

This is part of a fix for the LIT tests

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-04-24 08:30:08 +10:00
Eric Anholt
e4da46e007 mesa: Add some comments about FRAG_RESULT_COLOR vs FRAG_RESULT_DATAn.
This came from reading what swrast does, and 965 now behaves the same
and gallium appears to as well.
2011-04-23 13:21:58 -07:00
Eric Anholt
d7f4c4e1b1 mesa: Fix fragment.color (no index) writes with OPTION ARB_draw_buffers.
Fixes a bug in Trine where fragment.color would write
FRAG_RESULT_COLOR (which is interpreted by drivers as being the "write
this to all color buffers" option) instead of FRAG_RESULT_DATA0 (just
the first target).

Fixes piglit ATI_draw_buffers/arbfp-no-index.
2011-04-23 13:21:57 -07:00
Eric Anholt
79bde19ef9 i965: Don't double-emit fragment.color writes for MRT with ARB_fp. 2011-04-23 13:21:57 -07:00
Eric Anholt
bad8da8b00 i965: Fill in the remaining fields of gen5+ sampler default color.
Still doesn't fix texwrap.
2011-04-23 13:21:57 -07:00
Eric Anholt
e1e6545c88 i965: Fix batch decode for the gen5+ sampler default color. 2011-04-23 13:21:57 -07:00
Eric Anholt
1f32c665c8 intel: Add support for ARB_sampler_objects.
This extension support consists of replacing
"gl_texture_obj->Sampler." with "_mesa_get_samplerobj(ctx, unit)->".
One instance of referencing the texture's base sampler remains in the
initial miptree allocation, where I'm not sure we have a clear
association with any texture unit.

Tested with piglit ARB_sampler_objects/sampler-objects.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-23 13:21:57 -07:00
Eric Anholt
1df72402d9 i965: Add support for NV_conditional_render.
Since we lack hardware support for it, this is a simple matter of
checking _mesa_check_conditional_render at the entrypoints, and
suppressing it for the metaops where it doesn't apply.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-23 13:21:57 -07:00
Eric Anholt
332822bd3d swrast: Disable glAccum drawing during conditional rendering. 2011-04-23 13:21:56 -07:00
Eric Anholt
fb60040b69 meta: Don't do conditional rendering on GenerateMipmaps and BlitFramebuffer.
The NV_conditional_render spec calls out specific operations that
conditional rendering applies to, which doesn't include these.

Fixes NV_conditional_render/generatemipmap on swrast.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-23 13:14:56 -07:00
Eric Anholt
4093fdce6d i965: Add support for ARB_texture_compression_rgtc.
Tested with rgtc-teximage-0[12].
EXT_texture_compression_rgtc/fbo-generatemipmap-formats fails in NPOT
just like S3TC does.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-23 13:14:56 -07:00
Eric Anholt
7d1a2056a8 mesa: Don't assert on the compressed convertformat for GenerateMipmaps.
This assertion doesn't make any sense to me -- the convertFormat is
already something valid (tested above), and the BaseFormat dictated by
convertFormat doesn't matter to the function about to be called (it's
the datatype/comps that were pulled out of convertFormat).

Fixes assertion failure in
GL_EXT_texture_compression_rgtc/fbo-generatemipmap-formats

(still has a rendering failure in NPOT like S3TC does).

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-23 13:14:56 -07:00
Eric Anholt
bc880b8d40 mesa: Choose RGTC formats for GL_COMPRESSED_RED, GL_COMPRESSED_RG.
We were falling through to the default R8 and RG88 formats instead of
compressing when possible.  Noticed by swrast fbo-blending-formats
actually doing rendering.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-23 13:14:56 -07:00
José Fonseca
da49de811d mesa/gdi: Address compiler warnings.
In particular the function prototypes.
2011-04-23 20:25:11 +01:00
José Fonseca
5bd545f5aa mesa/gdi: Remove InitCritSections.cpp.
We are now able to declare global critical sections through other
mechanisms so this is useless code.
2011-04-23 18:44:19 +01:00
José Fonseca
336487450e Drop fx windows driver.
Irrelevant now that glide driver was removed.
2011-04-23 18:32:56 +01:00
Jakob Bornecrantz
fed8a07ddb glu: Fix linux build 2011-04-23 17:01:19 +02:00
Jakob Bornecrantz
97efac09b2 glu: Clone the enviroment 2011-04-23 16:58:48 +02:00
José Fonseca
c2c44f2641 docs: Remove MSVS project files.
They were totally broken for several releases.

scons now builds everything the project files built and more, and can be
kept up-to-date with little effort.
2011-04-23 13:18:45 +01:00
José Fonseca
d34ddad9a5 scons: Build glu. 2011-04-23 13:16:03 +01:00
José Fonseca
15eaf8297e scons: Build classic mesa gdi driver.
Build as

  scons platform=windows mesagdi
2011-04-23 12:41:28 +01:00
José Fonseca
4c92f3fa6e osmesa: Fix Mingw build.
Build as

  scons platform=windows osmesa
2011-04-23 12:23:42 +01:00
José Fonseca
8e8a56eaa0 scons: Build osmesa.
Just type

  scons osmesa
2011-04-23 12:22:59 +01:00
José Fonseca
c89cca648d mapi/glapi: Avoid warnings about visibility being unsupported on MinGW. 2011-04-23 12:14:39 +01:00
José Fonseca
abda64efce mesa/vf: Remove.
Unused.  Probably replaced by translate module.
2011-04-23 11:49:41 +01:00
José Fonseca
de29ee0e6d graw: Replace dead symlinks to delete python statetracker shaders with their contents. 2011-04-23 11:07:27 +01:00
Brian Paul
931432fea6 draw: fix point/line/tri flushing bug in vbuf code
Need to reset the point/line/tri functions to point to the "first"
versions whenever we flush vertices.  Fixes unfilled polygon rendering
errors seen in demos/samples/logo.c.  See comments for more info.

NOTE: This is a candidate for the 7.10 branch.
2011-04-22 13:39:50 -06:00
Marek Olšák
72239d16cd r300g: do not advertise color_buffer_float on r300 and r400
It seems they can't do unclamped vertex colors. Tested on RV350.
2011-04-22 20:25:24 +02:00
Marek Olšák
9d07ff63fc r300/compiler: fix up error message 2011-04-22 20:25:24 +02:00
Benjamin Franzke
01b036adea egl/wayland: Follow buffer.attach removal 2011-04-22 12:21:46 -04:00
Benjamin Franzke
b1a9172277 egl/wayland: Update to buffer.damage addition 2011-04-22 12:21:37 -04:00
Marek Olšák
5b2ff543ab configure.ac: fix up the help text for --enable-gallium-r300 2011-04-22 16:56:31 +02:00
Marek Olšák
673cec467a r300g: disallow A16F,L16F,LA16F,I16F texture formats on DRM<2.8.0 2011-04-22 16:19:41 +02:00
Benjamin Franzke
400a99a679 st/egl: Update to wayland protocol,egl changes 2011-04-22 08:56:36 -04:00
Benjamin Franzke
f09c66b3cc egl_dri2: Create wl_buffers for pixmap surfaces
Needed since wayland-egl doesnt do this anymore.
2011-04-22 08:56:33 -04:00
Benjamin Franzke
1617b268ef egl/wayland: Add new version parameter for post_drm 2011-04-22 08:56:30 -04:00
Benjamin Franzke
2225397d1c egl/wayland: Fix prefixes for interface names 2011-04-22 08:56:27 -04:00
Marek Olšák
1faf079a69 swrast: fix readpix clamping
Broken with e5c6a92a12. (ARB_color_buffer_float)

Clamping should occur if type != float, otherwise the MSBs of the resulting
pixels are killed off. For example, reading back LUMINANCE = R+G+B can be
greater than 0xff, but the result is naturally masked by 0xff
for UNSIGNED_BYTE, leading to bogus results.

The following bug report seems to want clamping to occur if type == half_float
too. Not sure what's correct.

Bug: [bisected pineview] oglc case pxconv-read failed
https://bugs.freedesktop.org/show_bug.cgi?id=35852

Tested by: Fang Xun <xunx.fang@intel.com>
Reviewed-and-tested-by: Ian Romanick <ian.d.romanick@intel.com>
2011-04-22 06:35:36 +02:00
Kristian Høgsberg
7142a67473 WL_bind_wayland_display: clarify that context must be NULL 2011-04-21 23:47:59 -04:00
Ian Romanick
d439491a77 i915: Gut all remaining bits of hardware fog
None of this ever gets used.  Fog is always calculated by a fragment
program.  Even though the fixed-function fog unit is never used, state
updates are still sent to the hardware.  Removing those spurious state
updates can't hurt performance.

Reviewed-by: Eric Anholt <eric@anholt.net>
Acked-by: Corbin Simpson <MostAwesomeDude@gmail.com>
Acked-by: Alex Deucher <alexdeucher@gmail.com>
2011-04-21 17:33:41 -07:00
Ian Romanick
499f7c0114 i915: i915_context::vertex_fog is always I915_FOG_NONE, so kill it
Reviewed-by: Eric Anholt <eric@anholt.net>
Acked-by: Corbin Simpson <MostAwesomeDude@gmail.com>
Acked-by: Alex Deucher <alexdeucher@gmail.com>
2011-04-21 17:33:38 -07:00
Ian Romanick
c41cb17037 i915: There's always a fragment program
Fragment programs are generated by core Mesa for fixed-function.
Because of this, there's no reason to handle cases where there is no
fragment program for fog.

Reviewed-by: Eric Anholt <eric@anholt.net>
Acked-by: Corbin Simpson <MostAwesomeDude@gmail.com>
Acked-by: Alex Deucher <alexdeucher@gmail.com>
2011-04-21 17:33:35 -07:00
Ian Romanick
8fc5ed18bc i915: Delete disabled try_pixel_fog paths
Reviewed-by: Eric Anholt <eric@anholt.net>
Acked-by: Corbin Simpson <MostAwesomeDude@gmail.com>
Acked-by: Alex Deucher <alexdeucher@gmail.com>
2011-04-21 17:33:32 -07:00
Ian Romanick
4d203a01e2 mesa: Kill gl_fragment_program::FogOption with fire
All drivers expect this to always be GL_NONE.  Don't let there be any
opportunity for a bad value to leak out and infect some unsuspecting
driver.  If any driver for hardware that had fixed-function
per-fragment fog (i915 and perhaps some r300-ish) was ever going to
add support, it would have done it by now.

Reviewed-by: Eric Anholt <eric@anholt.net>
Acked-by: Corbin Simpson <MostAwesomeDude@gmail.com>
Acked-by: Alex Deucher <alexdeucher@gmail.com>
2011-04-21 17:33:29 -07:00
Ian Romanick
df7555e763 i915: gl_fragment_program::FogOption is always GL_NONE so don't check it
Reviewed-by: Eric Anholt <eric@anholt.net>
Acked-by: Corbin Simpson <MostAwesomeDude@gmail.com>
Acked-by: Alex Deucher <alexdeucher@gmail.com>
2011-04-21 17:33:26 -07:00
Ian Romanick
8780c38983 i965: gl_fragment_program::FogOption is always GL_NONE so don't check it
Reviewed-by: Eric Anholt <eric@anholt.net>
Acked-by: Corbin Simpson <MostAwesomeDude@gmail.com>
Acked-by: Alex Deucher <alexdeucher@gmail.com>
2011-04-21 17:33:24 -07:00
Ian Romanick
f0188d4b08 mesa: gl_fragment_program::FogOption is always GL_NONE so don't check it
Reviewed-by: Eric Anholt <eric@anholt.net>
Acked-by: Corbin Simpson <MostAwesomeDude@gmail.com>
Acked-by: Alex Deucher <alexdeucher@gmail.com>
2011-04-21 17:33:21 -07:00
Ian Romanick
3aa21f93dc mesa: Fix bugs in ff fragment shader fog handling
This patch fixes two bugs related to fog in the fixed-function
fragment shader generation code.

Fog was only lowered to instructions if MRTs were used.  The fragment
shader assembler always lowers "fog option" code to instructions, and
many drivers (e.g., r300) expect this.

When fog lowering did happen, it was after the instruction count was
checked against implementation limits.  Since fog lowering may add up
to 5 instructions, a program that was below the limits before lowering
may exceed the limits after lowering.

NOTE: This is a candidate for the stable branches.

Reviewed-by: Eric Anholt <eric@anholt.net>
Acked-by: Corbin Simpson <MostAwesomeDude@gmail.com>
Acked-by: Alex Deucher <alexdeucher@gmail.com>
2011-04-21 17:33:18 -07:00
Brian Paul
a22aba4eae st/mesa: check image size before copy_image_data_to_texture()
We should only copy images into the dest texture if the size is correct.
This fixes a failed assertion when finalizing a texture with mis-defined
mipmap levels such as:
level 0: 32x32
level 1: 8x8

Also, fix incorrect mipmap level used in assertion at the top of
copy_image_data_to_texture().

NOTE: This is a candidate for the 7.10 branch.
2011-04-21 13:02:02 -06:00
Marek Olšák
4ad63659c0 galahad,util: warn on resource target mismatch in copy_region
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2011-04-21 15:51:18 +02:00
Marek Olšák
f9dafcb8f2 st/mesa: implement CopyBufferSubData using resource_copy_region
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2011-04-21 15:51:18 +02:00
Marek Olšák
883d8a0b44 gallium: add fallback for copying buffers to all drivers
Just to keep drivers working.

Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2011-04-21 15:51:18 +02:00
Marek Olšák
64f55216e4 util: add a simple memcpy path for copying buffers in util_resource_copy_region
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2011-04-21 15:51:18 +02:00
Kenneth Graunke
08ba9778db glsl/ast_to_hir: Only use the local 'type' variable as a temporary.
Lots of code (deleted by this patch) tried to make type == result->type,
but not all cases did.  Don't pretend; just use result->type.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-04-20 16:46:17 -07:00
Kenneth Graunke
dfaaf7c5e8 i965: Remove dead vertex buffer structs.
We do this OUT_BATCH-style in brw_draw_upload.c.
2011-04-20 16:43:52 -07:00
Kristian Høgsberg
c0f8c9911c wayland-egl: Update to wayland-egl.h changes, drop struct wl_egl_display 2011-04-20 17:47:20 -04:00
Brian Paul
42d377224a mesa: fix void pointer arithmetic warning 2011-04-20 12:04:25 -06:00
Eric Anholt
2ea0aa4cd9 docs: Mention that GLSL 1.30 is started.
Things definitely remaining todo: switch statements, clip distances.
On 965, we also need real integers in the VS, and implementations of
some things like isinf/isnan.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-20 10:35:43 -07:00
Eric Anholt
6e13cbcb74 docs: Update for Intel ARB_texture_float and ARB_color_buffer_float.
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-20 10:35:43 -07:00
Eric Anholt
d22e2ebe35 intel: Add support for ARB_color_buffer_float.
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-20 10:35:42 -07:00
Eric Anholt
99fa449bb9 meta: Add support for ARB_color_buffer_float to _mesa_meta_Clear().
Tested with piglit arb_color_buffer_float-clear.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-20 10:35:42 -07:00
Eric Anholt
b249197259 meta: Add support for ARB_color_buffer_float to _mesa_meta_DrawPixels.
Tested with piglit arb_color_buffer_float-drawpixels.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-20 10:35:42 -07:00
Eric Anholt
87478cd6e3 intel: Add support for ARB_texture_float.
For 1 and 2-channel formats the hardware only supports rendering to R
and RG.  To do I and L render targets we just call them R and
everything works out.  For A, we would need to rewrite the CC to do
the alpha channel's blending on color instead, and send the fragment
alpha down the red channel.  For LA, there doesn't seem to be any
hope, because we can't do independent color/alpha blending while
treating the LA surface as RG.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-20 10:35:42 -07:00
Eric Anholt
0bbbeba2db intel: Add support for blit copies of >32bpp formats.
The blitter only does up 32bpp at a time, so we handle it by mangling
coordinates and calling the surface 32bpp.

Fixes ARB_texture_rg/fbo-generatemipmap-formats-float with ARB_texture_float.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-20 10:35:42 -07:00
Eric Anholt
b31a99367c mesa: Add renderbuffer accessors for A, I, L, FLOAT32.
Of these, intel will be using I and L initially, and A once we rewrite
fragment shaders and the CC for rendering to it as R.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-20 10:35:42 -07:00
Eric Anholt
bad08969b5 mesa: Add renderbuffer accessors for MESA_FORMAT_R_FLOAT32, RG_FLOAT32.
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-20 10:35:42 -07:00
Eric Anholt
f7c26109c2 mesa: Add ChooseTexFormat fallbacks for floating point textures.
This covers X_FLOAT16 -> X_FLOAT32, and X -> RGBA_FLOAT32.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-20 10:35:41 -07:00
Eric Anholt
ba99c2fbd9 mesa: Add renderbuffer accessors for MESA_FORMAT_RGBA_FLOAT32.
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-20 10:35:41 -07:00
Eric Anholt
a45b757f78 swrast: Add LUMINANCE, INTENSITY, LUMINANCE_ALPHA to span asserts.
Fixes ARB_texture_float/fbo-alphatest-formats.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-20 10:35:41 -07:00
Alex Deucher
abee17057f r600g: fix userspace fences again
reinstate b7617346dc after the
rework in 6067a2a67f.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-04-20 13:09:09 -04:00
Fredrik Höglund
6067a2a67f r600g: don't flush the dest caches on every draw
Keep track of when the caches are dirty, and only flush them when
the framebuffer state is set and when the context is flushed.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-04-20 09:08:15 +10:00
Brian Paul
8b7f760f83 translate: disable clamping of instanced array indexes
This fixes piglit's draw-instanced-divisor test for softpipe on both
the generic and SSE paths.  This is temporary until we have the
correct per-array max_index information.
2011-04-19 16:13:47 -06:00
Alex Deucher
08d1c91e6c r600g: add evergreen+ big endian support
Based on Cédric's r6xx/r7xx patch.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-04-19 13:35:19 -04:00
Cédric Cano
843dfe3206 r600g: add big endian support for r6xx/r7xx
Signed-off-by: Cedric Cano <ccano@interfaceconcept.com>
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-04-19 13:02:14 -04:00
Alex Deucher
b545b2987a r600c: add evergreen big endian support
Based on Cedric's r6xx/r7xx patch.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-04-19 12:06:52 -04:00
Cédric Cano
3c3a259603 r600c: add big endian support for r6xx/r7xx
Signed-off-by: Cedric Cano <ccano@interfaceconcept.com>
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-04-19 12:06:52 -04:00
Brian Paul
7a6061d7a6 Makefile: add missing Scons files 2011-04-19 09:07:44 -06:00
Thierry Vignaud
494b333b03 Makefile: add missing .cpp, .ll, .yy files
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-04-19 08:34:06 -06:00
Dave Airlie
66866d642f r600g: add cb support for snorm formats.
Check for signed type and enable SNORM.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-04-19 20:44:13 +10:00
Marek Olšák
5722286be2 configure.ac: rename --enable-gallium-radeon to --enable-gallium-r300
Also fix up the help string for both r300 and r600.
2011-04-19 12:28:51 +02:00
Marek Olšák
ab13ebf7c1 r200: enable some extensions
Such as:
- GL_ARB_half_float_pixel
- GL_ARB_vertex_array_object
- GL_APPLE_vertex_array_object
- GL_EXT_gpu_program_parameters
2011-04-19 12:23:41 +02:00
Dave Airlie
c98fa6be4b r600g: fix warnings with piglit texture-rg test.
Fill in the swaps for the formats to fix warnings.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-04-19 18:45:58 +10:00
Dave Airlie
723e35d4a6 r600g: make loop const always flush
this needs revisiting, we really don't want to be flushing all 32 of these,
but currently we don't flush any of them, and it seems to have caused a regression
as reported on irc with doom3 on evergreen.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-04-19 16:39:50 +10:00
Tom Stellard
ffc1d166d2 r300/compiler: Fix dataflow analysis bug with ELSE blocks
Writes within ELSE blocks were being ignored which prevented us from
discovering all possible writers for some register values.

Fixes piglit glsl-fs-raytrace-bug27060
2011-04-18 21:27:03 -07:00
Bryan Cain
f41e1db327 glsl: fix conversions from uint to bool and from float/bool to uint
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2011-04-18 17:09:47 -07:00
Dave Airlie
f05adb83f5 r600g: add dirty tracking to context reg.
just makes the code more consistent.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-04-19 10:12:20 +10:00
Dave Airlie
5b5a16e320 r600g: deinline some large functions.
really at these sort of sizes these are pointless inlines.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-04-19 10:12:20 +10:00
Dave Airlie
a6e32da8bd r600g: consolidate r600/evergreen code for resource emission.
These really didn't have much difference, and totally not inline material.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-04-19 10:12:20 +10:00
Bas Nieuwenhuizen
02522b76a1 r600g: don't flush caches if we already did so, even for a subset of the flags
Merging the flushes that are left doesn't seem to give a significant
performance improvement

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-04-19 10:12:20 +10:00
Dave Airlie
e3b9cf15bb r600g: attempt to avoid emitting resources that are the same
This just avoids reemitting resources that haven't changed.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-04-19 10:12:20 +10:00
Dave Airlie
162bc40eed r600g: modify block to only emit the first few dirty registers. (v2)
This gets me from 2200 to 1978 dwords for a gears frame.

This is due to us having some 32-dwords blocks in the SPI, that we only
modify the first dwords off.

v2: fix dirty reg count from Bas Nieuwenhuizen

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-04-19 10:12:19 +10:00
Dave Airlie
c058067e57 r600g: track dirty registers better. (v2)
This is a first step to decreasing the CPU usage, by decreasing how much
stuff we pass to the GPU and hence to the kernel CS checker.

This adds a check to see if the values we need to write are actually dirty,
and avoids writing if they are. However certain register need to always
be written so we add a new flag to say which ones should be always written
if used. (Note this could probably be done cleaner with a larger refactoring,
 since I think the CONST_BUFFER_SIZE_PS/VS and CONST_CACHE_PS/VS might
be better off as a special state).

It also moves the need_bo to be a flags on the register now.

With this, a frame of gears goes from emitting 3k dwords to emitting 2k dwords,
and I'm sure it could get a lot smaller.

v2: fix some evergreen dirty bits.

Original patch from: Bas Nieuwenhuizen, I NIHed nearly the same thing
before seeing his patch on the list, oops.

Reviewed-by: Bas Nieuwenhuizen
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-04-19 10:12:19 +10:00
Ian Romanick
edf2e4f79d glsl: 80-column wrapping and whitespace fixes 2011-04-18 17:06:08 -07:00
Kenneth Graunke
ff5dd55e26 i965: Convert 3DPRIMITIVE command from struct-style to OUT_BATCH style.
Most of the newer portions of the code use OUT_BATCH style.  I prefer
this style because it offers a clear distinction between a) hardware
messages/structures with a mandatory format, and b) data structures for
our own internal use that we can format however we want.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-04-18 15:26:34 -07:00
Kenneth Graunke
42a8057000 i965: Allocate the whole URB to the VS and fix calculations for Gen6.
Since we never enable the GS on Sandybridge, there's no need to allocate
it any URB space.

Furthermore, the previous calculation was incorrect: it neglected to
multiply by nr_vs_entries, instead comparing whether twice the size of
a single VS URB entry was bigger than the entire URB space.  It also
neglected to take into account that vs_size is in units of 128 byte
blocks, while urb_size is in bytes.

Despite the above problems, the calculations resulted in an acceptable
programming of the URB in most cases, at least on GT2.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-04-18 15:26:34 -07:00
Ian Romanick
3d5cfcfed1 glsl: Emit a warning when the left-hand operand of a comma has no effect
The expression

    x = y, 5, 3;

will generate

    0:7(9): warning: left-hand operand of comma expression has no effect

The warning is only emitted for the left-hand operands, becuase the
right-most operand is the result of the expression.  This could be
used in an assignment, etc.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-18 14:43:48 -07:00
Brian Paul
7ca38f5d97 mesa: fix void pointer arithmetic warnings
And fix a couple logic errors in the put_*_generic() functions.
2011-04-18 13:01:05 -06:00
Brian Paul
9418d05914 mesa: fix wrong parameter type in set_sampler_max_lod() 2011-04-18 12:43:42 -06:00
Brian Paul
1249e54f8b nvfx: comment-out unused var 2011-04-18 12:34:29 -06:00
Eric Anholt
dad95c112f intel: Add I8 and L8 to intel_mesa_format_to_rb_datatype().
Fixes warnings in fbo-storage-formats.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-18 11:19:54 -07:00
Eric Anholt
bc57df0356 Revert "intel: Add spans code for the ARB_texture_rg support."
This reverts what remains of commit
28bab24e16.  It was garbage, trying to
use a MESA_FORMAT enum as a preprocessor token, and I don't know how I
thought it was even tested.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-18 11:19:54 -07:00
Eric Anholt
73f0700481 intel: Use mesa core's R8, RG88, R16, RG1616 RB accessors.
Fixes:
ARB_texture_rg/fbo-alphatest-formats

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-18 11:19:54 -07:00
Eric Anholt
2b624634dd swrast: Don't try to adjust_colors for <8bpc when handling R16, RG1616.
The GL_RED and GL_RG were tricking this code into executing, but it's
totally unprepared for a 16-bit channel and just rescaled the values
down to 0.  We don't have anything with <8bit channels alongside >8bit
channels, so disabling it should be safe.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-18 11:19:54 -07:00
Eric Anholt
f0471d904c mesa: Add renderbuffer accessors for R8/RG88/R16/RG1616.
This will replace the current (broken by trying to use an enum in the
preprocessor) spantmp2.h support I wrote for the intel driver.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-18 11:19:54 -07:00
Eric Anholt
a52803e108 mesa: Use _mesa_get_format_bytes to refactor out the RB get_row_*
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-18 11:19:54 -07:00
Eric Anholt
6ab9889a27 mesa: Use _mesa_get_format_bytes to refactor out the RB get_pointer_*
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-18 11:19:54 -07:00
Eric Anholt
0778fdb002 intel: Use Mesa core's renderbuffer accessors for depth.
Since we're using GTT mappings now (no manual detiling), there's
really nothing special to accessing these buffers, other than needing
the new RowStride field of gl_renderbuffer to accomodate padding.

Reduces the driver size by 2.7kb, and improves glean depthStencil
performance 3-10x (!)

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-18 11:19:54 -07:00
Eric Anholt
9f164823c7 mesa: Add a function to set up the default renderbuffer accessors.
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-18 11:19:53 -07:00
Eric Anholt
155200c154 mesa: Add a gl_renderbuffer.RowStride field like textures have.
This will allow some drivers to reuse the core renderbuffer.c get/put
row functions in place of using the spantmp.h macros.  Note that
unlike textures, we use a signed integer here to allow for handling
FBO orientation.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-18 11:19:53 -07:00
Eric Anholt
348ea34d03 mesa: Repack single-byte fields in gl_renderbuffer.
Cuts 8 out of 120 bytes in the struct.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-18 11:19:53 -07:00
Eric Anholt
91226ce648 mesa: Remove renderbuffer deletion debug field.
It has presumably served its purpose by now, and other object deletion
doesn't do this.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-18 11:19:53 -07:00
Eric Anholt
641dd899bd swrast: Don't assert against glReadPixels of GL_RED and GL_RG.
Everything appears to already be in place for this.  Fixes aborts in:
ARB_texture_rg/fbo-alphatest-formats-float
ARB_texture_rg/fbo-blending-formats-float.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-18 11:19:53 -07:00
Eric Anholt
cd3568c329 intel: Use _mesa_base_tex_format for FBO texture attachments.
The _mesa_base_fbo_format variant doesn't handle some texture
internalformats, such as "3".

Fixes:
fbo-blending-formats.
fbo-alphatest-formats
EXT_texture_sRGB/fbo-alphatest-formats

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-18 11:19:53 -07:00
Marek Olšák
699ecec58c r300g: remove non-existing include path from SConscript 2011-04-18 03:07:46 +02:00
Marek Olšák
d35aeff4bb r300g/winsys: rename r300->radeon and do a little cleanup
Renaming a few files, types, and functions.
Also make the winsys independent of r300g.
2011-04-18 02:52:32 +02:00
Thierry Vignaud
f79717d27a Fix mesa tarball creation again
Signed-off-by: Marek Olšák <maraeo@gmail.com>
2011-04-18 01:26:47 +02:00
Marek Olšák
fc8e30edbc r600g: disable ARB_draw_instanced
The very presence of this extension breaks things.
This should bring us closer to being able to run Unigine Heaven.

The extension will be re-enabled once gl_InstanceID is implemented.
2011-04-18 00:44:17 +02:00
Marek Olšák
3f32efa2b8 r300g: disable ARB_draw_instanced on SWTCL chipsets.
This fixes Unigine Heaven.
2011-04-18 00:44:17 +02:00
Eric Anholt
4673f9433f i965: Quit spamming gen6 DP read/write send instructions with gen5 bits.
This was copy-and-paste from originally trying to get DP read/write
working reliably, and notably for other common messages (URB, sampler)
we weren't doing this.
2011-04-17 10:26:09 -07:00
Eric Anholt
59c6b775a6 i965/fs: Add gen6 register spilling support.
Most of this is code movement to get the scratch space allocated in a
shared location.  Other than that, the only real changes are that the
old oword block messages now operate on oword-aligned areas (with new
messages for unaligned access, which we don't do), and that the
caching control is in the SFID part of the descriptor instead of
message control.

Fixes glsl-fs-convolution-1.
2011-04-17 10:26:09 -07:00
Eric Anholt
14eedf3028 mesa: Fix _mesa_unpack_dudv_span_byte assertion.
It was accepting only GL_DUDV_ATI and not the specific sized format
GL_DU8DV8_ATI.  Fixes assertion failure at startup in Shadowgrounds.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-17 10:26:09 -07:00
Carl Worth
9dacbe2226 glcpp: Fix attempts to expand recursive macros infinitely (bug #32835).
The 095-recursive-define test case was triggering infinite recursion
with the following test case:

	#define A(a, b) B(a, b)
	#define C A(0, C)
	C

Here's what was happening:

  1. "C" was pushed onto the active list to expand the C node

  2. While expanding the "0" argument, the active list would be
     emptied by the code at the end of _glcpp_parser_expand_token_list

  3. When expanding the "C" argument, the active list was now empty,
     so lather, rinse, repeat.

We fix this by adjusting the final popping at the end of
_glcpp_parser_expand_token_list to never pop more nodes then this
particular invocation had pushed itself. This is as simple as saving
the original state of the active list, and then interrupting the
popping when we reach this same state.

With this fix, all of the glcpp-test tests now pass.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=32835
Signed-off-by: Carl Worth <cworth@cworth.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-and-tested-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-17 01:02:24 -07:00
Dave Airlie
93d42571a6 r600g: use some loops.
unrolling loops is for Gentoo users, and I really want to put something
else inside these loops later.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-04-17 17:19:28 +10:00
Dave Airlie
70de2705b4 r600g: consolidate the same piece of cut-n-paste code into a function.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-04-17 17:11:36 +10:00
Marcin Slusarz
b5dfc38eea gallium: include u_format.h for util_format_is_supported
Without it gcc complains:
nv50_screen.c: In function ‘nv50_screen_is_format_supported’:
nv50_screen.c:48: warning: implicit declaration of function ‘util_format_is_supported’

and handles it wrongly - util_format_is_supported returns boolean, which is typedef'ed
to uchar, but function without prototype is assumed to return int.

For me nv50_screen_is_format_supported was returning true for float formats without
--enable-texture-float...
2011-04-17 01:15:52 +02:00
Christoph Bumiller
25a7f66214 nvc0: work around what looks like a code prefetch bug
Sounds very unlikely, but I don't have a better explanation at the
moment.
The GPU throws page faults at the first page after the code buffer
quite frequently on startup, and traces don't show us overflowing.
2011-04-17 00:17:14 +02:00
Christoph Bumiller
f4ad25fefb nv50,nvc0: add new texture and render target formats 2011-04-17 00:17:14 +02:00
Christoph Bumiller
b4c7cd3fd6 nv50,nvc0: fix normalized RG16 and RGBA32 texture format entries 2011-04-17 00:17:14 +02:00
Christoph Bumiller
a582b859f7 nvc0: fix viewport rectangle calculation 2011-04-17 00:17:14 +02:00
Tom Stellard
97535699ee prog_optimize: Add simplify CMP optimization pass
This pass coverts CMP T0, T1 T2 T0 -> MOV T0, T2 when the CMP
instruction is the first instruction to write to register T0.
This pass is useful for hardware that requires a lot of lowering passes
that generate many CMP instructions.
2011-04-16 13:55:55 -07:00
Tom Stellard
257cc48de2 prog_optimize: get_src_arg_mask() respect writemask for more opcodes
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-04-16 13:55:54 -07:00
Tom Stellard
0fa81d6d05 r300/compiler: Fix incorrect presubtract conversion
ADD instructions with constant swizzles can't be converted to
presubtract operations.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
2011-04-16 13:55:54 -07:00
Carl-Philip Haensch
d5a5893adc mesa: provide more info for glCompressedTexImage() errors
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-04-16 08:13:47 -06:00
Brian Paul
af0e2ef8cc mesa: move error check code in compressedteximage()
This was mistakenly inside the #if FEATURE_ES block.
2011-04-16 08:05:14 -06:00
José Fonseca
77db34b50d docs: Reapply some of Marek's typo fixes.
There were some typos too.
2011-04-16 11:15:29 +01:00
José Fonseca
bb78f6ad78 gallium/docs: Improve min_index/max_index description. 2011-04-16 10:18:20 +01:00
José Fonseca
4ee40c37a0 docs: Undo Marek typo fixes to original text.
Not really typos.
2011-04-16 09:41:00 +01:00
Brian Paul
41b38bd21c translate: s/varient/variant/ 2011-04-15 10:16:53 -06:00
Brian Paul
0630593c5f vbo: init prim[] array with memset()
This fixes a Coverity warning about uninitialized data.
2011-04-15 08:33:20 -06:00
Brian Paul
1b800c10e4 vega: move ureg_destroy(ureg) after last use of ureg var 2011-04-15 08:33:20 -06:00
Brian Paul
2c57caa893 st/mesa: simplify a bit of the previous patch
Grrr, this was supposed to go in the previous commit.
2011-04-15 08:33:20 -06:00
Pierre-Eric Pelloux-Prayer
6e9c7c4c11 st/mesa: add handling for 'PIPE_FORMAT_B8G8R8X8_UNORM' in st_fast_readpixels
With minor edits by Brian Paul.

Signed-off-by: Brian Paul <brianp@vmware.com>
2011-04-15 08:30:10 -06:00
Marek Olšák
d2afae33f8 Revert "r300/compiler: Don't try to convert RGB to Alpha in full instructions"
This reverts commit cd2857fae1.

It breaks Unigine Heaven.
2011-04-15 05:08:00 +02:00
Marek Olšák
9305922563 docs: update relnotes-7.11
I made a glxinfo diff between 7.10 and master and added missing items
and also sorted the list.
2011-04-15 05:08:00 +02:00
Marek Olšák
397e478683 docs: update GL3 status 2011-04-15 05:08:00 +02:00
Marek Olšák
75fa5c99a8 gallium: add and use generic function for querying patented format support (v2)
v2: Unsigned floats are allowed regardless of the configure switch.
2011-04-15 05:08:00 +02:00
Marek Olšák
848f7d368d configure.ac: add an enable switch for float textures (v2)
So --enable-texture-float it is.

Hardware drivers (including the Gallium ones) should
use #ifdef TEXTURE_FLOAT_ENABLED to hide any code that may
expose floating-point renderbuffers via any interface,
public or private.

v2: Print a warning when using --enable-texture-float.
2011-04-15 05:08:00 +02:00
Marek Olšák
2d12dbb28d docs: add patents.txt
Thanks to José Fonseca for writing this.
2011-04-15 05:08:00 +02:00
Marek Olšák
faba01d171 r300g: enable A/L/LA/I float render targets 2011-04-15 05:08:00 +02:00
Marek Olšák
8e28d842d1 st/mesa: convert Mesa float formats to Gallium
Squashed commit of the following:

Author: Marek Olšák <maraeo@gmail.com>

    st/mesa: require RGBA16F and RGBA32F to be renderable
    st/mesa: fix L32F and L16F format translation
    st/mesa: also convert the R/RG float formats

commit 49a9948b6a81b7d813304d081139d98e95ba5d1a
Author: Luca Barbieri <luca@luca-barbieri.com>
Date:   Fri Aug 20 10:36:17 2010 +0200

    mesa/st: enable ARB_texture_float if supported formats allow it

commit 7383632f7b6f9021b65f4973b7e7c99f0e8ce9b2
Author: Luca Barbieri <luca@luca-barbieri.com>
Date:   Tue Aug 24 21:00:46 2010 +0200

    mesa/st: support ARB_texture_float internal formats

commit 7c362cc06982586c2d29fac55f6bcc4bcd1550b5
Author: Luca Barbieri <luca@luca-barbieri.com>
Date:   Tue Aug 24 21:00:33 2010 +0200

    mesa/st: convert L/A/I floating point formats
2011-04-15 05:08:00 +02:00
Luca Barbieri
33128310b0 gallium: add A/L/LA/I floating point formats 2011-04-15 05:08:00 +02:00
Marek Olšák
15f99d1362 mesa: finish up ARB_texture_float
Squashed commit of the following:

Author: Marek Olšák <maraeo@gmail.com>

    mesa: handle floating-point formats in _mesa_base_fbo_format
    mesa: add ARB/ATI_texture_float, remove MESAX_texture_float

commit 123bb110852739dffadcc81ad80b005b1c4f586d
Author: Luca Barbieri <luca@luca-barbieri.com>
Date:   Wed Aug 25 01:35:42 2010 +0200

    mesa: compute floatMode for FBOs and return it on RGBA_FLOAT_MODE
2011-04-15 05:08:00 +02:00
Marek Olšák
0ecbb0ab74 mesa: add R/RG floating-point formats 2011-04-15 05:08:00 +02:00
Marek Olšák
19648fcf01 mesa: fix L16F and L32F format properties 2011-04-15 05:08:00 +02:00
Carl Worth
3d78f83cde Add expected file for 095-recursive-define test case.
It's clear enough that the current segmentation fault isn't what we
want. And it's also very easy to know what we do want here, (just
check with any functional C preprocessor such as "gcc -E").

Add the desired output as an expected file so that the test suite
gives useful output, (showing the omitted output and the segfault),
rather than just reporting "No such file" for the expected file.
2011-04-14 16:20:49 -07:00
Carl Worth
02d293c08e glcpp: Simplify calling convention of parser's active_list functions
These were all written as generic list functions, (accepting and returning
a list to act upon). But they were only ever used with parser->active as
the list. By simply accepting the parser itself, these functions can update
parser->active and now return nothing at all. This makes the code a bit
more compact.

And hopefully the code is no less readable since the functions are also
now renamed to have "_parser_active" in the name for better correlation
with nearby tests of the parser->active field.
2011-04-14 15:35:41 -07:00
Carl Worth
0b80f2d4c9 glcpp: Add --valgrind option to the glcpp-test utility
The common case for this test suite is to quickly test that everything
returns the correct results. In this case, the second run of the test
suite under valgrind was just annoying, (and the user would often
interrupt it).

Now, do what is wanted in the common case by default (just run the
test suite), and require a run with "glcpp-test --valgrind" in order
to test with valgrind.
2011-04-14 14:55:52 -07:00
Carl Worth
6affa4806a Add an expected file for 084-unbalanced-parentheses
The expected file here captures the current behavior of glcpp (which
is to generate an obscure "syntax error, unexpected $end" diagnostic
for this case).

It would certainly be better for glcpp to generate a nicer diagnostic,
(such as "missing closing parenthesis in function-like macro
definition" or so), but the current behavior is at least correct, and
expected. So we can make the test suite more useful by marking the
current behavior as expected.
2011-04-14 14:43:11 -07:00
Carl Worth
d3c6ed382d Add an expected file for 094-divide-by-zero-short-circuit
The expected file here captures the current behavior of glcpp (which
is to generate a division-by-zero error) for this case.

It's easy to argue that it should be short-circuiting the evaluation
and not generating the diagnostic (which happens to be what gcc does).
But it doesn't seem like we should force this behavior on our
pre-processor, (and, as always, the GLSL specification of the
pre-processor is too vague on this point).
2011-04-14 14:42:52 -07:00
Carl Worth
ea3b2560b1 Add an expected file for 093-divide-by-zero
This test is behaving just fine already---it's generating an informative
diagnostic, ("error: division by 0 in preprocessor directive"), so adding
this in the expected file makes things pass.
2011-04-14 14:29:34 -07:00
José Fonseca
6881cfc7f7 mesa/st: Avoid spurious transfers when creating fbo textures without image data.
We could actually try to do an early return both for gallium textures and
malloc memory textures, but I'm not sure exactly which situations
stImage->pt is NULL, and whether texImage->Data == NULL would be acceptible
or not.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-14 19:51:45 +01:00
pepp
78e90bf247 st/mesa: add support for GL_RGBA + GL_UNSIGNED_INT_8_8_8_8 in st_fast_readpixels
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-04-14 07:55:02 -06:00
Eric Anholt
a9a02c8a39 mesa: Expose ATI_draw_buffers.
This is the same as ARB_draw_buffers (which derived from it), except
for s/ARB/ATI/.  The glapi bits were already in place, and what was
missing was just the ARB_fp part.  The new Humble Bundle game "trine"
tries to use this extension without checking that it's exposed, which
this works around.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=36182
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-04-13 18:07:32 -07:00
Eric Anholt
fb6e39737a mesa: Add support for OPTION ATI_draw_buffers to ARB_fp.
Tested by piglit ati_draw_buffers-arbfp.
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-04-13 18:07:01 -07:00
Eric Anholt
28cec9e832 mesa: Add support for the ARB_fragment_program part of ARB_draw_buffers.
Fixes fbo-drawbuffers-arbfp.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=34321
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-04-13 18:05:44 -07:00
Eric Anholt
4847f802c2 i965/fs: Constant-fold immediates in src0 of SEL instructions.
This is like what we do for add/mul, but we have to invert the
predicate to choose the other source instead.

This removes 5 extra moves of constants in nexuiz shaders.  No
statistically significant performance difference on my Sandybridge
laptop (n=5).

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-04-13 17:57:53 -07:00
Eric Anholt
811c147220 i965/fs: Constant-fold immediates in src0 of CMP instructions.
This is like what we do with add/mul, but we also have to flip the
conditional test.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-04-13 17:57:46 -07:00
Eric Anholt
756c262756 glsl: Perform type checking on "^^" operands.
We were letting any old operand through, which generally resulted in
assertion failures later.

Fixes array-logical-xor.vert.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-04-13 17:57:43 -07:00
Eric Anholt
175829f1a8 glsl: When we've emitted a semantic error for ==, return a bool constant.
This prevents later errors (including an assertion failure) from
cascading the failure.

Fixes invalid-equality-04.vert.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=33303
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@intel.com>
2011-04-13 15:48:26 -07:00
Eric Anholt
9e04b190b5 glsl: Semantically check the RHS of `||' even when short-circuiting.
We just do the AST-to-HIR processing, and only push the instructions
if needed in the constant false case.

Fixes glslparsertest/glsl2/logic-02.frag

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-04-13 15:48:26 -07:00
Eric Anholt
7ec0c97896 glsl: Semantically check the RHS of `&&' even when short-circuiting.
We just do the AST-to-HIR processing, and only push the instructions
if needed in the constant true case.

Fixes glslparsertest/glsl2/logic-01.frag

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-04-13 15:48:25 -07:00
Eric Anholt
01822706ec glsl: Avoid cascading errors when looking for a scalar boolean and failing.
By always using a boolean, we should generally avoid further
complaints.  The failure case I see is logic_not, where the user might
understandably make the mistake of using `!' on a boolean vector (like
a piglit case did recently!), and then get a further complaint that
the new boolean type doesn't match the bvec it gets assigned to.

Fixes invalid-logic-not-06.vert (assertion failure when the bad type
ends up in an expression and ir_constant_expression gets angry).

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=33314
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-04-13 15:48:02 -07:00
Eric Anholt
6a35cbb656 glsl/opt_cpe: Reenable opt_copy_propagation_elements.cpp pass. 2011-04-13 10:51:03 -07:00
Eric Anholt
909bd476ca glsl/opt_cpe: Fix a crash when a kill kills for two reasons.
Fixes glsl-copy-propagation-loop-2 when this optimization pass is
re-enabled.

Reported-by: David Lamparter <equinox@diac24.net>
2011-04-13 10:51:03 -07:00
Eric Anholt
487debfda5 glsl/opt_cpe: Kill when the assignment isn't something we recognize.
A few GLES2 tests tripped over this when using array dereferences to
hit channels on the LHS (see piglit test
glsl-copy-propagation-vector-indexing).  We wouldn't find the
ir_dereference_variable, and assume that that meant that it wasn't an
assignment to a scalar/vector, and thus not notice that the variable
had been changed.
2011-04-13 10:51:03 -07:00
Brian Paul
b9c8b2a1f1 svga: defined QSZ in terms of SVGA3D_MAX_DRAW_PRIMITIVE_RANGES 2011-04-13 09:52:21 -06:00
Brian Paul
32aab51df5 svga: define SVGA3D_MAX_DRAW_PRIMITIVE_RANGES and update comments 2011-04-13 09:52:16 -06:00
Brian Paul
4cbb261eba st/mesa: minor clean-ups in update_textures() 2011-04-13 07:37:03 -06:00
Brian Paul
032a7ef0a1 mesa: 80-column wrapping and whitespace fixes 2011-04-13 07:35:25 -06:00
Brian Paul
75d585e544 mesa: fix some comments in sampler object code 2011-04-13 07:35:25 -06:00
Chad Versace
d3cc3901ab i965: Change assertion condition from implicit to explicit
... because grokking explicit assertions requires fewer neurons.

In brw_misc_state.c:emit_depthbuffer, change assertion condition
    tiling != I915_TILING_X && tiling != I915_TILING_NONE
to
    tiling == I915_TILING_Y

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad.versace@intel.com>
2011-04-12 17:52:09 -07:00
Chad Versace
4d7c187167 i965: Define BRW_DEPTHFORMAT_D24_UNORM_X8_UINT
This depth format was added in Gen5.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad.versace@intel.com>
2011-04-12 17:52:09 -07:00
Chad Versace
05173c61c7 i965: Document brw_context.state.depth_region
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad.versace@intel.com>
2011-04-12 17:52:09 -07:00
Chad Versace
9949d2a251 i965: Remove unnecessary release/reference of brw_context.state.depth_region
Release the old depth region and reference the new one *only* if it has
changed.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad.versace@intel.com>
2011-04-12 17:52:09 -07:00
Kenneth Graunke
3f7318c1b8 i965: Add comments about URB size units and limits.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-04-12 15:21:21 -07:00
Kenneth Graunke
35b3f597bd i965: Never enable the GS on Gen6.
Prior to Gen6, we use the GS for breaking down quads, quad-strips,
and line loops.  On Gen6, earlier stages already take care of this,
so we never need the GS.

Since this code is likely completely untested, remove it for now.
We can write new code when enabling real geometry shaders.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-04-12 15:19:47 -07:00
Chris Wilson
f703ba8c42 Revert "i965: Reinstate max-index paranoia"
This reverts commit b4cbd2b312.

It looked like a safe sanity check. It missed the issue of the start of
the buffer not being at 0, but even that was not enough to explain why
setting the max vertex index caused glyphs to be dropped from the game
'Achron'.

Instead, the issue appears to be related to the use of the vertex bias
and so we would need to re-emit the max-index every time we adjusted the
bias, so re-emitting the relocations and defeating the original
optimisation.

Reported-and-tested-by: Thomas Jones <thomas.jones@utoronto.ca>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=35163
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-04-12 19:14:27 +01:00
Benjamin Franzke
f05751aa2a egl/wayland: Update to per-surface frame events 2011-04-12 11:08:17 -04:00
Dave Airlie
b27f206b0c nouveau_vieux: fix build since sampler objects merge 2011-04-12 21:23:00 +10:00
José Fonseca
16d42af618 st/wgl: Prevent spurious framebuffer sizes when the window is minimized.
When the window is minimized GetClientRect will return zeros.

Instead of creating a 1x1 framebuffer, simply preserve the current window
size, until the window is restored or maximized again.
2011-04-12 12:00:49 +01:00
José Fonseca
b5829c0d64 st/wgl: Fix debug output format specifiers of stw_framebuffer_get_size(). 2011-04-12 12:00:49 +01:00
José Fonseca
6b95cfb0de svga: Rebind framebuffer and tss bindings strictly when necessary.
The earlier change to ensure rendertargets and textures are always
rebound at every command buffer start had the downside of making
successive flushes no longer no-ops, as a command buffer with merely
the rebinding commands were being unnecessarily sent to the vGPU.

This change only re-emits the bindings when necessary, by keeping track
of the need to rebind outside of the dirty state update mechanism.
2011-04-12 12:00:49 +01:00
Hans de Goede
e338a1b0ce texstore: fix regression stricter check for memcpy path for unorm88 and unorm1616
According to https://bugs.freedesktop.org/show_bug.cgi?id=34280
commit 5d1387b2da causes the font corruption
problems people have been seeing under various apps and gnome-shell on r200
cards.

This commit changed (loosened) the check for using the memcpy path in the
former al88 / al1616 texstore functions, which are now also used to
store rg texures. This patch restores the old strict check in case of
al textures. I've no idea why this fixes things, since I don't know the
code in question at all. But after seeing the bisect in bfdo34280 point
to this commit, I gave this fix a try and it fixes the font issues seen on
r200 cards.

[airlied:
r200 has no native working A8, so it does an internal storage format of AL88
however srcFormat == internalFormat == ALPHA when we get to this point,
so it copies, but it wants to store into an AL88 not ALPHA so fails,
I'll also push a piglit test for this on r200].

Many thanks to Nicolas Kaiser who did all the hard work of tracking this down!

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-04-12 20:32:45 +10:00
Brian Paul
847f991a87 ir_to_mesa: silence signed/unsigned comparison warnings 2011-04-11 21:29:06 -06:00
Brian Paul
482a64dcf1 configs: add r600 dir to DRI_DIRS 2011-04-11 21:23:14 -06:00
Brian Paul
155a9670e6 r600: silence various compiler warnings 2011-04-11 21:22:54 -06:00
Brian Paul
1ca5585459 Merge branch 'arb_sampler_objects' 2011-04-11 21:19:41 -06:00
Zou Nan hai
2432ca1c2e Revert "i965: clear global offset to zero in m0.2 for VS DP read."
This reverts commit 66b66295d0.
it was already fixed by commit 9d60a7ce08
2011-04-12 10:52:50 +08:00
Ian Romanick
a7fa203f0d i965: Remove hint_gs_always and resulting dead code
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-11 14:43:42 -07:00
Ian Romanick
7e809f0b8d intel: Fix ROUND_DOWN_TO macro
Previously the macro would (ALIGN(value - alignment - 1, alignment)).
At the very least, this was missing parenthesis around "alignment -
1".  As a result, if value was already aligned, it would be reduced by
alignment.  Condisder:

     x = ROUND_DOWN_TO(256, 128);

This becomes:

    x = ALIGN(256 - 128 - 1, 128);

Or:

    x = ALIGN(127, 128);

Which becomes:

    x = 128;

This macro is currently only used in brw_state_batch
(brw_state_batch.c).  It looks like the original version of this macro
would just use too much space in the batch buffer.  It's possible, but
not at all clear to me from the code, that the original behavior is
actually desired.

In any case, this patch does not cause any piglit regressions on my
Ironlake system.

I also think that ALIGN_FLOOR would be a better name for this macro,
but ROUND_DOWN_TO matches rounddown in the Linux kernel.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Keith Whitwell <keithw@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-11 14:43:42 -07:00
Ian Romanick
03eade164d glsl: Make GL_ARB_shader_stencil_export enable block be similar to other blocks
Tested-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-11 14:43:42 -07:00
Ian Romanick
f2bda1b566 glsl: Only let a shader enable GL_ARB_draw_instanced if the driver supports it
Also make the GL_ARB_draw_instanced block follow the same pattern as
the other blocks.

Tested-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-11 14:43:41 -07:00
Brian Paul
65b024d63a mesa: fixup r600 DRI driver for sampler object changes 2011-04-11 13:26:42 -06:00
Eric Anholt
88022278f7 i965: Move the SF VP from state caching to state streaming.
This is a 49.6% +/- 2.0% (n=9, IPS outlier removed) performance
improvement for the hacked-up-for-cache-misses scissor-many, and no
statistically significant performance difference for the
hacked-up-for-cache-hits version (n=9, IPS outlier removed).  No
statistically significant performance difference from ETQW (n=5) from
these last two commits.
2011-04-11 11:55:25 -07:00
Eric Anholt
b1be5bd205 i965: Change the SF unit from state caching to state streaming.
This is a 28.1% +/- 1.4% (n=10) performance improvement for the
hacked-up-for-cache-misses scissor-many (n=10), and no statistically
significant wall-time performance difference for the
hacked-up-for-cache-hits version (n=9, first outlier in each removed
since IPS was warming up.  User time increased by about 4.7%, but
kernel time decreased equivalently).
2011-04-11 11:55:17 -07:00
Eric Anholt
aaf188e3bb i965: Turn SF unit and viewport structs into pointers to prep for streaming.
I wanted to separate this mechanical change from the actual work.
2011-04-11 11:43:40 -07:00
pepp
45920d2ecb u_vbuf_mgr: fixed vbo max_index calculation
Signed-off-by: Marek Olšák <maraeo@gmail.com>
2011-04-11 17:35:28 +02:00
Marek Olšák
5c477ab2de r600g: handle PIPE_CAP_FRAGMENT_COLOR_CLAMP_CONTROL in get_param 2011-04-11 14:38:32 +02:00
Brian Paul
da8d0c965c docs: GL_ARB_sampler_objects updates 2011-04-10 13:12:50 -06:00
Brian Paul
34a5d3b9f4 mesa: plug in new functions for GL_ARB_sampler_objects
Build the new sources, plug the new functions into the dispatch table,
implement display list support.  And enable extension in the gallium
state tracker.
2011-04-10 13:12:49 -06:00
Brian Paul
f22d49de0f mesa: new code/functions for GL_ARB_sampler_objects
This implements the infrastructure for sampler objects and all the new
API functions.
2011-04-10 13:12:49 -06:00
Brian Paul
6bb4d807f7 mesa: alloc/free shared sampler objects 2011-04-10 13:12:49 -06:00
Brian Paul
0308beebc2 mesa: new driver hooks for GL_ARB_sampler_objects 2011-04-10 13:12:49 -06:00
Brian Paul
aebe16da53 mesa: add glGet for GL_ARB_sampler_objects 2011-04-10 13:12:49 -06:00
Brian Paul
ecfaab88b2 mesa: move sampler state into new gl_sampler_object type
gl_texture_object contains an instance of this type for the regular
texture object sampling state.  glGenSamplers() generates new instances
of gl_sampler_object which can override that state with glBindSampler().
2011-04-10 13:12:49 -06:00
Brian Paul
1cbd3a1cc7 glapi: regenerated files for GL_ARB_sampler_objects 2011-04-10 13:12:49 -06:00
Brian Paul
d40ec9a884 glapi: interface for GL_ARB_sampler_objects 2011-04-10 13:12:49 -06:00
Henri Verbeet
a26121f375 glx: Only remove the glx_display from the list after it's destroyed.
Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
2011-04-10 18:53:34 +02:00
Henri Verbeet
a75de67c51 glx: Destroy dri2Hash on DRI2 display destruction.
Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
2011-04-10 18:53:33 +02:00
Henri Verbeet
158d42c8b0 mesa: Also update the color draw buffer if it's explicitly set to GL_NONE.
NOTE: This is a candidate for the 7.10 branch.

Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
2011-04-10 18:53:33 +02:00
Nicolas Kaiser
82cb6e6519 docs: fix typos in wayland spec
Signed-off-by: Nicolas Kaiser <nikai@nikai.net>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-04-10 10:00:10 -06:00
Nicolas Kaiser
ae5776c41f docs: fix typos in Mesa specs
Signed-off-by: Nicolas Kaiser <nikai@nikai.net>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-04-10 09:58:53 -06:00
Christoph Bumiller
74559abbef nv50,nvc0: silence shader debug output 2011-04-10 14:06:52 +02:00
Christoph Bumiller
003224bd97 nvc0: make the card permit separate colour outputs 2011-04-10 14:06:52 +02:00
Christoph Bumiller
7b4e478496 nv50-nvc0: make use of COLOR_MASK,BLEND_ENABLE_COMMON 2011-04-10 14:06:52 +02:00
Christoph Bumiller
d9ef976967 nvc0: shrink CSOs a little 2011-04-10 14:06:52 +02:00
Christoph Bumiller
843d5391c3 nv50,nvc0: identify some line rasterization state
Fixes width of non-smooth (aliased) lines on nvc0.
2011-04-10 14:06:52 +02:00
Christoph Bumiller
d546df4d9c nvc0: force perspective correction hint to nicest
Fixes issues in e.g. nexuiz (desertfactory) or supertuxkart that
look like lighting bugs.

They're not visible with the software rasterizers because their
notion of linear interpolation seems to be different from that
of nv50/nvc0.
2011-04-10 14:06:52 +02:00
Christoph Bumiller
ee2a8ea7d9 nv50,nvc0: don't insert instructions after the block terminator 2011-04-10 14:06:51 +02:00
Alan Coopersmith
d27ff8c5cd Make st_pipe_vertex_format return type in st_draw.h match st_draw.c
Fixes compiler error from Sun compilers:
"state_tracker/st_draw.c", line 185: identifier redeclared: st_pipe_vertex_format
        current : function(unsigned int, unsigned int, unsigned int, unsigned char) returning enum pipe_format
        previous: function(unsigned int, unsigned int, unsigned int, unsigned char) returning unsigned int : "state_tracker/st_draw.h", line 73

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-04-08 17:36:46 -07:00
Alan Coopersmith
64ce3933f5 Fix GET_PROGRAM_NAME() on Solaris to not try to modify a read-only string
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-04-08 17:36:46 -07:00
Marek Olšák
ee678895e9 Revert "r300g: handle DISCARD_WHOLE_RESOURCE for buffers"
This reverts commit 437c748bf5.

The commit is wrong for several reasons. One of them is when we grab
a new buffer, we should update all the states it is bound in,
including all parallel contexts. I don't think this is even doable.

The correct solution would be upload data via a temporary buffer and
do resource_copy_region to the original one.

https://bugs.freedesktop.org/show_bug.cgi?id=36088
2011-04-08 23:20:00 +02:00
Marek Olšák
69c71396c6 r300g: fix another crash with hyperz
https://bugs.freedesktop.org/show_bug.cgi?id=36086
2011-04-08 23:17:15 +02:00
Jon TURNEY
c6e33ca285 Disable direct rendering on Cygwin
Add Cygwin platform-specific settings and drivers to build for dri driver:
- by default, disable direct rendering.
- if direct rendering is enabled, the swrast dridriver is the only one it's
sensible to try to build (this doesn't work at the moment as additional patches
are required to build a libGL which can load just swrast without the DRM headers,
even though there's no actual functional dependency)

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Julien Cristau <jcristau@debian.org>
2011-04-08 20:37:41 +01:00
nobled
e7d18ed1ef Disable direct rendering on GNU/Hurd
The Hurd kernel doesn't have DRM yet.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Julien Cristau <jcristau@debian.org>
Reviewed-By: Jakob Bornecrantz <wallbraker@gmail.com>
2011-04-08 20:37:38 +01:00
Samuel Thibault
758561786c Only require libdrm if direct rendering is actually enabled.
Fix build when configured --with-driver=dri --disable-driglx-direct on targets
without drm e.g. GNU/Hurd and Cygwin

Based on the Debian patch file '05_hurd-ftbfs.diff' by Samuel Thibault.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Julien Cristau <jcristau@debian.org>
Reviewed-By: Jakob Bornecrantz <wallbraker@gmail.com>
2011-04-08 20:37:36 +01:00
Marek Olšák
aac4bae986 r300g: fix crash when adding a new relocation
No idea why it's so hard to reproduce.
Broken with: c35572352e

Thanks to Toni Spets for assistance.
2011-04-08 21:34:16 +02:00
Marek Olšák
ff3d7ce201 r300g: emit US_FORMAT on R520 only 2011-04-08 20:07:01 +02:00
Eric Anholt
9634318290 i965/fs: Remove broken optimization for live intervals in loops.
The theory here was to detect a temporary variable used within a loop,
and avoid considering it live across the entire loop.  However, it was
overeager and failed when the first definition of the variable
appeared within the loop but was only conditionally defined.

Fixes glsl-fs-loop-redundant-condition.
2011-04-08 08:04:00 -10:00
Marek Olšák
a0d154dc13 u_vbuf_mgr: fix crash with unsupported vertex format in hw VBOs 2011-04-08 19:31:26 +02:00
Marek Olšák
1329d94334 r300g: fix crash with hyperz
r300_update_hyperz_state is no longer required to be called here.
2011-04-08 13:27:14 +02:00
Henri Verbeet
1bcdc1e319 r300g: Properly take the sampler view's first_level into account when sampling.
Signed-off-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Marek Olšák <maraeo@gmail.com>
2011-04-08 04:47:37 +02:00
Fabian Bieler
08070cead0 llvmpipe: Take the sampler view's first_level into account when sampling. 2011-04-08 04:47:04 +02:00
Henri Verbeet
9acdd7739b softpipe: Take the sampler view's first_level into account when sampling.
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-04-08 04:45:38 +02:00
Henri Verbeet
79db70bd8a st/mesa: Clamp min_lod to the max miplevel as well.
Otherwise min_lod can potentially be larger than the clamped max_lod. The
code that follows will swap min_lod and max_lod in that case, resulting in a
max_lod larger than MAX_LEVEL.

Signed-off-by: Brian Paul <brianp@vmware.com>
2011-04-08 04:45:03 +02:00
Henri Verbeet
2ecb73379e st/mesa: Set samplers views' first_level.
Base level and min LOD aren't equivalent. In particular, min LOD has no
effect on image array selection for magnification and non-mipmapped
minification.

Signed-off-by: Brian Paul <brianp@vmware.com>
2011-04-08 04:44:21 +02:00
Marek Olšák
7984c2d42d r300g: do not advertise R16F and RG16F on DRM < 2.8.0 2011-04-08 04:38:36 +02:00
Marek Olšák
10ea8567f4 r300g: fix texturing with sizes > 2048 on r500 2011-04-08 04:38:36 +02:00
Marek Olšák
9d5de0fcb6 r300g: add 'radeon: ' prefix to error messages in winsys 2011-04-08 04:38:36 +02:00
Marek Olšák
6eff8479af mesa: fix dstRowDiff computation in RGTC texstore functions
Copied from libtxc_dxtn, this fixes NPOT RGTC1 textures with r300g.
I also did the same for RGTC2.
2011-04-08 04:38:36 +02:00
Kristian Høgsberg
55a629cee5 egl_dri2.c: Open drm device with O_CLOEXEC
Not a good fd to leak.
2011-04-07 18:27:56 -04:00
Henri Verbeet
09eff39a58 r600g: Unreference framebuffer state on context destruction.
Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
2011-04-07 22:29:56 +02:00
Henri Verbeet
3e15fa86d7 r600g: Use symbolic names for NUMBER_TYPE.
Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
2011-04-07 22:29:56 +02:00
Brian Paul
0da2a22ba6 docs: replace llvmpipe/README with docs/llvmpipe.html 2011-04-07 13:56:45 -06:00
Brian Paul
06613b7b3a llvmpipe: document issue with LLVM 2.8 and earlier with AVX 2011-04-07 13:43:00 -06:00
Brian Paul
ef2c80f506 util: add cpu detection for sse 4.2 and avx 2011-04-07 13:41:52 -06:00
Brian Paul
1e105741f1 util: simplify bit shifting in util_cpu_detect() 2011-04-07 13:41:52 -06:00
Brian Paul
6638b4a590 svga: another tweak to adjust_x term (use -0.5) 2011-04-07 11:25:46 -06:00
José Fonseca
584d1e2309 mesa: Update _ElementSize in a few more places. 2011-04-07 13:35:25 +01:00
José Fonseca
0c501bacef mesa/st: Fix user buffer size computation when stride is zero.
Although for GL a zero stride means tightly packed elements, Mesa
internally uses zero strides for constant arrays.

Therefore user buffers need to be defined from

  buffer_offset + src_offset + min_index*stride

to

  buffer_offset + src_offset + max_index*stride + elem_size

Simplifying the later with (max_index + 1)*stride will give zero
sized buffers.

This change also aggregates the st_context's info about user buffers
into a single array.
2011-04-07 12:20:06 +01:00
Brian Paul
204991bf5d mesa: Update _ElementSize. 2011-04-07 12:20:06 +01:00
José Fonseca
23d75936a7 mesa/st: Prevent 'end' < 'start' in vbo_exec_DrawRangeElementsBaseVertex()
We adjust 'end' to fit into _MaxElement, but that may result into a 'start'
value bigger than 'end' being passed downstream, causing havoc.

This could be seen with arb_robustness_draw-vbo-bounds, due to an
application bug.
2011-04-07 12:20:06 +01:00
José Fonseca
aa61b15351 mesa/st: Handle feedback draw when VBO offsets are not sorted in ascending order.
Simply port the same logic from setup_interleaved_attribs().

Avoids overflow in mustpass.c and feedback.c conform tests.
2011-04-07 12:20:06 +01:00
Zou Nan hai
66b66295d0 i965: clear global offset to zero in m0.2 for VS DP read.
Signed-off-by: Zou Nan hai <nanhai.zou@intel.com>
2011-04-07 21:07:57 +08:00
Vinson Lee
8800a798d1 mesa: Fix allocation size of extension_indices array.
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-06 16:14:22 -07:00
Brian Paul
95368f25c1 mesa: fix error message text 2011-04-06 16:52:48 -06:00
Brian Paul
7b8830d81d mesa: consolidate code in _mesa_update_array_max_element() 2011-04-06 16:52:48 -06:00
Ian Romanick
de4cb19a1c mesa: Add link to 7.10.2 release notes 2011-04-06 13:46:58 -07:00
Ian Romanick
130872a2a6 docs: update news.html with 7.10.2 release
(cherry picked from commit b0866f6cfd)
2011-04-06 13:46:37 -07:00
Ian Romanick
2c8ba760fa Import 7.10.2 release notes from 7.10 branch 2011-04-06 13:46:20 -07:00
Julian Adams
3f8455d07b r600g: Fix non-independent blend state.
This fixes piglit fbo/fbo-drawbuffers-blend-add.

Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
2011-04-06 21:16:40 +02:00
Brian Paul
122275760d mesa: init/release the default texture buffer object 2011-04-06 13:00:14 -06:00
Brian Paul
53245fffc0 mesa: fix popping of texture state for GL_TEXTURE_BUFFER
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=36032
2011-04-06 12:45:30 -06:00
Brian Paul
c1f4b2364f mesa: TEXTURE_BUFFER fix-up
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=36033
2011-04-06 12:33:30 -06:00
Tom Stellard
cd2857fae1 r300/compiler: Don't try to convert RGB to Alpha in full instructions
Note: This is a candidate for the 7.10 branch.
2011-04-06 00:31:53 -07:00
José Fonseca
740282b417 mesa: Recognize MESA_VERBOSE=all as shortcut for all debug options. 2011-04-06 08:27:53 +01:00
José Fonseca
dcbc9be38e draw: Fix thinko in debug warnings. 2011-04-06 08:27:52 +01:00
José Fonseca
c0f6bfd489 trace: Correct/cleanup.
Observe the actual type hierarchy and polymorphism of sampler views and
surface state.

s/texture/resource/

etc.
2011-04-06 08:26:44 +01:00
José Fonseca
391f7147e7 Revert "trace: Dump blend state as a binary blob."
This reverts commit dcdf94c87c.

No retrace support anymore, so human-legible representation of blend
state is much more useful than a blob.
2011-04-06 08:26:04 +01:00
José Fonseca
afeaf1771d st/python: Remove bindings, and all its dependencies.
Because:
- bindings are not fully automatic, and they are broken most of the time
- unit tests/samples can be written in C on top of graw
- tracing/retracing is more useful at API levels with stable ABIs such as
  GL, producing traces that cover more layers of the driver stack and and
  can be used for regression testing
2011-04-06 08:26:04 +01:00
Brian Paul
14b574433c swrast: simplify assertion to silence warning 2011-04-05 20:18:46 -06:00
Brian Paul
874a2c0b7d mesa: core support for GL_ARB_texture_buffer_object
No GLSL or driver support yet.
2011-04-05 19:02:09 -06:00
Brian Paul
9a77e285e8 mesa: regenerated API entrypoints for GL_ARB_texture_buffer_object 2011-04-05 18:50:39 -06:00
Brian Paul
13ba6b7369 mesa: API spec for GL_ARB_texture_buffer_object 2011-04-05 18:48:26 -06:00
Vinson Lee
622ee08e51 scons: Generate empty git_sha1.h for all platforms.
Fixes MinGW SCons build.
2011-04-05 15:34:30 -07:00
Kenneth Graunke
b4dfb7473e ir_to_mesa: Use gl_register_file enum type rather than 'int'.
src_reg already used this; make dst_reg use it too.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-04-05 15:31:58 -07:00
Kenneth Graunke
ce5d969adf ir_to_mesa: Unprefix ir_to_mesa_undef* and ir_to_mesa_address_reg.
Rename ir_to_mesa_undef to undef_src, for clarity.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-04-05 15:31:58 -07:00
Kenneth Graunke
5d9718f0db ir_to_mesa: Use emit overloads to avoid passing undef registers.
Makes the code just a little bit cleaner.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-04-05 15:31:58 -07:00
Kenneth Graunke
01e19fcf1f ir_to_mesa: Rename ir_to_mesa_emit_*_opX methods to emit_*.
There's really no need for a prefix on member functions, and overloading
takes care of the _op1/_op2 distinction quite nicely.  Eric already made
a similar change in the i965 FS backend.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-04-05 15:31:58 -07:00
Kenneth Graunke
cb21fa91b8 ir_to_mesa: Use constructors to convert between src_reg and dst_reg.
Rather than ir_to_mesa_dst_reg_from_src and ir_to_mesa_src_reg_from_dst.

The new constructors are marked 'explicit' so that the compiler can
catch cases where source and destination registers were accidentally
interchanged.

This also necessitated using constructors to initialize the undef and
address registers, as well as adding a default constructor.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-04-05 15:29:07 -07:00
Kenneth Graunke
fc6b4332c3 ir_to_mesa: Remove the "ir_to_mesa_" prefix on src_reg/dst_reg types.
Both classes are completely private to ir_to_mesa.cpp, so there won't be
any name conflicts with other parts of Mesa.  The prefix simply makes it
harder to read.

Also, use a class rather than typedef structs.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-04-05 15:29:07 -07:00
Kenneth Graunke
461273e910 ir_to_mesa: Rename src_reg and dst_reg variables to src and dst.
This is in preparation from removing the "ir_to_mesa_" prefix on the
src_reg and dst_reg types, which would cause a naming conflict.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-04-05 15:29:07 -07:00
Brian Paul
0c2455031d scons: generate empty git_sha1.h file for now
My feeble attempt to invoke the extract_git_sha1 script from
SConscript didn't work.  Hopefully this will do for now.
2011-04-05 14:07:48 -06:00
Ian Romanick
de579a1629 mesa: Include GIT SHA1 in GL version string
Reviewed-by: Corbin Simpson <MostAwesomeDude@gmail.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Tested-by: Sedat Dilek <sedat.dilek@gmail.com>
2011-04-05 11:21:01 -07:00
Ian Romanick
0fe34b7bbc dri: Remove driver date from renderer string
Reviewed-by: Corbin Simpson <MostAwesomeDude@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Tested-by: Sedat Dilek <sedat.dilek@gmail.com>
2011-04-05 11:21:01 -07:00
Ian Romanick
9996a86085 ir_to_mesa: Handle shadow compare w/projection and LOD bias correctly
The code would previously handle the projection, then swizzle the
shadow comparitor into place.  However, when the projection is done
"by hand," as in the TXB case, the unprojected shadow comparitor would
over-write the projected shadow comparitor.

Shadow comparison with projection and LOD is an extremely rare case in
real application code, so it shouldn't matter that we don't handle
that case with the greatest efficiency.

NOTE: This is a candidate for the stable branches.

Reviewed-by: Brian Paul <brianp@vmware.com>
References: https://bugs.freedesktop.org/show_bug.cgi?id=32395
2011-04-05 10:57:27 -07:00
Marek Olšák
4af3fe857d r300g: postpone fragment shader state validation until draw_vbo 2011-04-05 19:25:25 +02:00
Tom Stellard
d8361400b7 r300/compiler: Fix vertex shader MAD instructions with constant swizzles
NOTE: This is a candidate for the 7.9 and 7.10 branches.
2011-04-05 09:04:42 -07:00
Fabian Bieler
5d5db24a26 st/mesa: Apply LOD from texture object
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-04-05 09:08:19 -06:00
Fabian Bieler
d863bd7d7b st/mesa: Apply LOD bias from correct texture unit
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-04-05 09:07:07 -06:00
Brian Paul
8778bf221e mesa: fix alpha value for texstore_rgbx8888
Silences constant overflow compiler warning.
2011-04-05 07:53:09 -06:00
Fabian Bieler
c7339d42c6 mesa: Guard against null pointer deref in fbo validation
This matches the behaviour below when numSamples is compared.

At least with the gallium state tracker this can actually occur if st_render_texture fails.

Signed-off-by: Brian Paul <brianp@vmware.com>
2011-04-05 07:51:01 -06:00
Brian Paul
db0f9e701d mesa: added _mesa_get_attachment_teximage() helpers 2011-04-05 07:51:01 -06:00
Brian Paul
e9375cd0e8 mesa: 80-column wrapping 2011-04-05 07:51:01 -06:00
Dave Airlie
9ac64f7301 r300c: fix build since last r300g commit 2011-04-05 16:54:08 +10:00
Marek Olšák
b3011ea60c r300g: fix RG/LATC1_SNORM by doing UNORM->SNORM conversion in the shader 2011-04-05 06:36:56 +02:00
Marek Olšák
20141d9efd r300/compiler: implement the CND opcode
No one uses it now, but I will need it for a lowering pass.
2011-04-05 06:36:56 +02:00
Marek Olšák
c97234507a r300/compiler: set the MSB of ADDR for inline constants
The docs say so.
2011-04-05 06:36:56 +02:00
Brian Paul
5d92596c56 st/mesa: minor assorted clean-ups and fixes 2011-04-04 17:42:43 -06:00
Brian Paul
ed9396782e st/mesa: use 'array' local var to simplify the code a bit 2011-04-04 17:42:43 -06:00
Brian Paul
6cab07685f st/mesa: fix zero-sized user vertex buffer bug
Commit 4c4ab5668c didn't properly
handle the stride==0 case.

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=35961
2011-04-04 17:42:43 -06:00
Ian Romanick
e397b3a7c0 mesa: Add fall-back formats for unsupported snorm formats
This is always the way with real hardware and desktop OpenGL.  Some
hardware can't do some formats natively.  The alpha-only, luminance,
and intensity formats are usually the most problematic.  Some sized
formats can also be problematic.  This patch provides fall-back
formats for those that are not natively supported.

At some point it would be interesting to try providing
device-independent conversions using EXT_texture_swizzle.  The drivers
that support EXT_texture_swizzle could, for example, see
GL_LUMINANCE16_SNORM as MESA_FORMAT_SIGNED_R16 with a { r, r, r, 1 }
swizzle.  Care would need to be taken to prevent issues with using
those textures for FBO rendering.

This is the rest of the fix for glean's pixelFormats test on i965.

Reviewed-by: Marek Olšák <maraeo@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-04 15:18:37 -07:00
Ian Romanick
ad3fbac00b i965: Add the missing supportable EXT_texture_snorm formats
This class of hardware can natively sample all of the snorm surface
formats that DX10 requires, but it can't do some of the legacy GL
formats.  In particular, all of the alpha, luminance, and intensity
formats are unsupported.

This partially fixes the breakage in glean's pixelFormats test since
GL_EXT_texture_snorm support was added to Mesa.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-04 14:32:01 -07:00
Bryan Cain
19d06b5c05 nv50: prevent NV_OP_SELECT from having flags_def defined 2011-04-04 23:08:54 +02:00
Brian Paul
fdb04c0384 mesa: work around failed assertion for GL_RGBA16_SNORM accum buffer
We use this format to represent the accum buffer.  No snorm texture
sampling or rendering takes place.

Fixes failed assertion with swrast and any app using the accum buffer
(and glxinfo).
2011-04-04 14:37:28 -06:00
Brian Paul
32a11e5324 docs: update prerequisites, remove old demo info 2011-04-04 11:30:46 -06:00
Brian Paul
48f696c793 docs: update info about Mesa packaging/contents 2011-04-04 11:17:55 -06:00
Marek Olšák
0d96ae8fc7 r300/compiler: apply the texture swizzle to shadow pass and fail values too
Piglit tests:
- glsl-fs-shadow2d-01
- glsl-fs-shadow2d-02
- glsl-fs-shadow2d-03
- fs-shadow2d-red-01
- fs-shadow2d-red-02
- fs-shadow2d-red-03

NOTE: This is a candidate for the stable branches.
2011-04-04 19:13:01 +02:00
Marek Olšák
2679760834 r300/compiler: propagate SaturateMode down to the result of shadow comparison
NOTE: This is a candidate for the stable branches.
2011-04-04 19:13:01 +02:00
Alex Deucher
a0fc40f0d5 r600g: add some additional ontario pci ids
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-04-04 11:15:18 -04:00
Alex Deucher
b0da65bd0e r600c: add new ontario pci ids
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-04-04 11:13:44 -04:00
Marek Olšák
6caac3ecb8 r300g: do not wait for a busy BO if neither GPU nor CPU is changing it
Improves frame rate in apps with at least one user vertex buffer and
a hw index buffer.
2011-04-03 22:49:22 +02:00
Marek Olšák
9d881cbd5a r300g: remove unused RADEON_PB_USAGE_CACHE 2011-04-03 21:18:03 +02:00
Marek Olšák
f814dd7a81 r300g: tell the GLSL compiler to lower the continue opcode
NOTE: This is a candidate for the stable branches.
2011-04-03 19:35:43 +02:00
Marek Olšák
652bf121f2 r300g: avoid mapping the same buffer twice
Shouldn't happen, but you never know.
2011-04-03 19:32:27 +02:00
Marek Olšák
437c748bf5 r300g: handle DISCARD_WHOLE_RESOURCE for buffers 2011-04-03 19:32:27 +02:00
Marek Olšák
c35572352e r300g: remove the redundant reference counter in radeon_bo
We already have pb_buffer::reference::count.
2011-04-03 19:32:27 +02:00
Tom Stellard
381d32af74 Revert "r300/compiler: Remove obsolete compiler passes"
This reverts commit 9f013a8233.

These passes are still need for non-GLSL paths like g3dvl and ARB
programs.
2011-04-02 23:22:48 -07:00
Kenneth Graunke
5d7fefb9af i965/fs: Switch W and 1/W in Sandybridge interpolation setup.
Various documentation mentions that "W" is handed to the WM stage,
but further digging seems to indicate that they really mean 1/W.

The code here is still unclear, but changing this fixes piglit
test "fragcoord_w" on Sandybridge as well as a Khronos ES2 conformance
test.  I also tested 3DMarkMobile ES2.0's taiji and hoverjet demos, as
well as Nexuiz, just to be safe.

NOTE: This is a candidate for the 7.10 branch.
2011-04-02 18:58:16 -07:00
Kenneth Graunke
a019dd0d6e i965: Fix null register use in Sandybridge implied move resolution.
Fixes regressions caused by commit 9a21bc6401, namely GPU hangs when
running gnome-shell or compiz (Mesa bugs #35820 and #35853).

I incorrectly refactored the case that dealt with ARF_NULL; even in that
case, the source register needs to be changed to the MRF.

NOTE: This is a candidate for the 7.10 branch (if 9a21bc6401 is
cherry-picked, take this one too).
2011-04-03 00:57:30 -07:00
Eric Anholt
904b8ba1bb i965: Fix the VS thread limits for GT1, and clarify the WM limits on both. 2011-04-01 14:12:32 -07:00
José Fonseca
6586a3b287 tests: Use elts in translate_test. 2011-04-01 20:18:22 +01:00
José Fonseca
3f68d4b058 scons: Add aliases for unit tests. 2011-04-01 20:18:22 +01:00
José Fonseca
17bbc1f042 translate: Respect translate_buffer::max_index. 2011-04-01 20:18:18 +01:00
José Fonseca
3733da31e8 draw: Prevent out-of-bounds vertex buffer access.
Based on some code and ideas from Keith Whitwell.
2011-04-01 20:18:18 +01:00
Marek Olšák
4a7f013f9d gallium: set PIPE_CAP_MIXED_COLORBUFFER_FORMATS in some drivers 2011-04-01 13:48:01 +02:00
Marek Olšák
25f2699767 gallium: add a CAP for mixed colorbuffer format support
Some GPUs can't do it (I think most of DX9 ones), so they should have
the option not to allow it.
2011-04-01 13:48:01 +02:00
Tom Stellard
9f013a8233 r300/compiler: Remove obsolete compiler passes
Branch emulation and loop unrolling are done in the GLSL frontend.
Transforming loops is no longer needed for fragment shaders, but it is still
necessary for vertex shaders.
2011-03-31 23:45:26 -07:00
Tom Stellard
18dcbd358f prog_optimize: Fix reallocating registers for shaders with loops
Registers that are used inside of loops need to be considered live
starting with the first instruction of the outermost loop.

https://bugs.freedesktop.org/show_bug.cgi?id=34370

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

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-03-31 21:20:46 -07:00
Christoph Bumiller
c3526585b7 nv50: fix for GPR allocation granularity being 16 bit 2011-03-31 16:51:32 +02:00
Christoph Bumiller
3f625689ac nv50: copy regalloc fixes from nvc0
Should fix gnome-shell's fade shader.

Unification of the shader backend which is supposed to remove the
code duplication is still WIP.
2011-03-31 16:24:59 +02:00
José Fonseca
3dedd39cdd draw: Revert code reorg in previous change.
Because

  fetch_count = max_index - min_index + 1

overflows for min_index = 0 and max_index = 0xffffffff.

Fixes fdo 35815.
2011-03-31 12:20:37 +01:00
Chris Wilson
c40b7910ee intel: Fix regression in clear_with_blit from 7bae1c3d
Oops, the mask was being used in the loop to determine whether to use
include the stencil || depth values. This began to fail when mask was
cleared at the beginning of the loop. So reorder the tests and do the
work up-front along with determining the depth_stencil value to use.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=35822
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-03-31 11:58:36 +01:00
Luca Barbieri
5f996e2b1d draw: implement vertex color clamping, and disable SSE and PPC paths
(some little changes by Marek Olšák)

Squashed commit of the following:

commit 737c0c6b7d591ac0fc969a7590e1691eeef0ce5e
Author: Luca Barbieri <luca@luca-barbieri.com>
Date:   Fri Aug 27 02:13:57 2010 +0200

    draw: disable SSE and PPC paths (use LLVM instead)

    These paths don't support vertex clamping, and are anyway
    obsoleted by LLVM.

    If you want to re-enable them, add vertex clamping and test that it
    works with the ARB_color_buffer_float piglit tests.

commit fed3486a7ca0683b403913604a26ee49a3ef48c7
Author: Luca Barbieri <luca@luca-barbieri.com>
Date:   Thu Aug 26 18:27:38 2010 +0200

    draw_llvm: respect vertex color clamp

commit ef0efe9f3d1d0f9b40ebab78940491d2154277a9
Author: Luca Barbieri <luca@luca-barbieri.com>
Date:   Thu Aug 26 18:26:43 2010 +0200

    draw: respect vertex clamping in interpreter path
2011-03-31 03:35:31 +02:00
Jerome Glisse
ebe304fa54 gallium: list use inline function to avoid macro shot coming
Macro can lead to hard to debug list bugs. For instance consider
the following :
LIST_ADD(item, list->prev)
3 instruction of the macro became :
(list->prev)->next->prev = item
which is equivalent to :
list->prev = item
Thus list prev field changes and next instruction in the macro
(list->prev)->next = item
became :
item->next = item
And you endup with list corruption, other case lead to similar
list corruption. Inline function are not affected by this short
coming

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2011-03-30 17:03:00 -04:00
José Fonseca
dcad6fb670 draw: Forgot to remove one istart usage. 2011-03-30 16:09:34 +01:00
José Fonseca
713230ff39 draw: Fix bug when drawing ushort indices.
When the condition

 min_index == 0 && sizeof(ib[0]) == sizeof(draw_elts[0])

was true, we were wrongly ignoring istart and processing indices 0.

Reorder some statements to make the code easier to understand.
2011-03-30 16:05:24 +01:00
Chris Wilson
6584d0cd4f intel: Remove the unrelaxed relocation assertion
Now that we purposefully generate delta that point outside of the target
buffer, the assertion has outlived its usefulness.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-03-30 15:13:05 +01:00
Feng, Haitao
58f95f9d01 egl_dri2 x11: Fix a typo
Signed-off-by: Haitao Feng <haitao.feng@intel.com>
2011-03-30 08:29:09 -04:00
Chris Wilson
5eb9f68708 intel: Add some defense against buffer allocation failure for subimage blits
Once more! This time without the unwarranted conversion from
drm_intel_bo_alloc_tiled.

Signed-off-by: [a very embarrassed] Chris Wilson <chris@chris-wilson.co.uk>
2011-03-30 11:01:42 +01:00
Chris Wilson
f5a9a0bc22 Revert "intel: Add some defense against buffer allocation failure for subimage blits"
This reverts commit de7678ef52.

The conversion from using drm_intel_bo_alloc_tiled to a plain
drm_intel_bo_alloc forgot that the tiled variant adjusts the
allocation height even for TILING_NONE.

Reported-by: Dave Airlie <airlied@redhat.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=35786
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-03-30 11:01:42 +01:00
Michel Dänzer
167d35c303 gallium: Use explicit values in caps enums.
Simplifies mapping between numbers and identifiers for these.
2011-03-30 10:50:11 +02:00
Michel Dänzer
72e82418ef Use row stride instead of width when getting colour index texels.
Untested, noticed while working on the depth/stencil fix.
2011-03-30 10:48:37 +02:00
Michel Dänzer
b082e04619 Use proper source row stride when getting depth/stencil texels. 2011-03-30 09:31:21 +02:00
Kenneth Graunke
ee8d182426 intel: Add IS_GT2 macro for recognizing Sandybridge GT2 systems.
Also, refactor IS_GEN6 to use the IS_GT1 and IS_GT2 macros.
2011-03-29 17:08:53 -07:00
Christoph Bumiller
8f060df60d nv50,nvc0: implement colour clamping controls 2011-03-29 23:09:02 +02:00
Fredrik Höglund
d04ab396a5 r600g: implement texture barrier 2011-03-29 16:54:19 -04:00
Fredrik Höglund
948e1eb8e9 r600g: implement the pipe_screen fence functions
v2: Allocate the fences from a single shared buffer object.
v3: Allocate the r600_fence structs in blocks of 16.
    Spin a few times before calling sched_yield in r600_fence_finish().
2011-03-29 16:37:04 -04:00
Ian Romanick
a99e80d795 mesa: Fix ugly indentation left from previous commit
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Chad Versace <chad.versace@intel.com>
2011-03-29 13:21:09 -07:00
Ian Romanick
89d81ab16c glsl: Calcluate Mesa state slots in front-end instead of back-end
This should be the last bit of infrastructure changes before
generating GLSL IR for assembly shaders.

This commit leaves some odd code formatting in ir_to_mesa and brw_fs.
This was done to minimize whitespace changes / reindentation in some
loops.  The following commit will restore formatting sanity.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Chad Versace <chad.versace@intel.com>
2011-03-29 13:21:08 -07:00
Ian Romanick
92e412e788 glsl: Move _mesa_builtin_uniform_desc from uniforms.c to ir_variable.cpp
This array is going to be used in the main compiler soon.  Leaving
them uniforms.c caused problems for building the stand-alone compiler.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Chad Versace <chad.versace@intel.com>
2011-03-29 13:21:08 -07:00
Marek Olšák
0420ae3d90 r300g: add support for all render targets with one and two channels
The hardware should be set according to this table:

FORMAT -> R300 COLORFORMAT
-------------------------
X16    -> UV88
X16Y16 -> ARGB8888
X32    -> ARGB8888
X32Y32 -> ARGB16161616

US_OUT_FMT must contain the real format.

I wasn't able to make B3G3R2 and L4A4 work, but those aren't important.
2011-03-29 18:47:02 +02:00
Marek Olšák
7d41857566 intel: fix build
broken with e5c6a92a12
(mesa: implement clamping controls (ARB_color_buffer_float))
2011-03-29 18:03:19 +02:00
Chris Wilson
7bae1c3d85 intel: Protect intel_clear_with_blit from failed buffer allocations
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=34419
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-03-29 15:43:56 +01:00
Chris Wilson
252eaa765e i965: Avoid name clash of loop counter and member
src/mesa/drivers/dri/i965/brw_fs.cpp:565 warning: name lookup of ‘c’ changed

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-03-29 15:43:56 +01:00
Chris Wilson
b094dff50a i915: Detect allocation failure of batch buffer
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-03-29 15:43:55 +01:00
Marek Olšák
8cbdfe1de4 docs: update GL3 status 2011-03-29 13:04:15 +02:00
Marek Olšák
2e6a69939c r300g: finish up signed normalized textures and render targets 2011-03-29 12:50:28 +02:00
Marek Olšák
f037914670 r300g: enable clamping controls 2011-03-29 12:50:28 +02:00
Marek Olšák
8d4ec87d7f gallium: remove PIPE_CAP_VERTEX_COLOR_CLAMP_CONTROL
The vertex color clamp control is a property of an API,
a lot like gl_rasterization_rules.

The state should be set according to the API being implemented, for example:
   OpenGL Compatibility: enabled by default
   OpenGL Core: disabled by default
   D3D11: always disabled

This patch also changes the way ARB_color_buffer_float is advertised.
If no SNORM or FLOAT render target is supported, fragment color clamping
is not required.
2011-03-29 12:50:27 +02:00
Marek Olšák
e28fe8fe5d mesa: clamp texture border color if ARB_texture_float is unsupported
ARB_texture_float disables clamping of the texture border color,
ARB_color_buffer_float only modifies clamping of the glGet query.
2011-03-29 12:50:27 +02:00
Marek Olšák
b518f4d0ea st/mesa: choose an appropriate texture format for DrawPixels 2011-03-29 12:50:22 +02:00
Marek Olšák
2af1da1546 gallium: add EXT_texture_snorm support 2011-03-29 12:04:55 +02:00
Marek Olšák
daa5242f9e mesa: implement texstore and texfetch hooks for signed normalized formats
The snorm texstore functions were all broken.

swrast support done except for mipmap generation, but I leave it disabled.
2011-03-29 12:04:55 +02:00
Marek Olšák
0be369975f mesa: initial EXT_texture_snorm support
The component ordering of some formats has been been reversed to match
Gallium types.
2011-03-29 12:04:55 +02:00
Luca Barbieri
47e3896dfd gallium: implement clamping controls (ARB_color_buffer_float)
BTW this changes the gallium interface.
Some rather cosmetic changes by Marek.

Squashed commit of the following:

commit 513b37d484f0318311e84bb86ed4c93cdff71f13
Author: Luca Barbieri <luca@luca-barbieri.com>
Date:   Thu Aug 26 18:17:54 2010 +0200

    mesa/st: respect fragment clamping in st_DrawPixels

commit 546a31e42cad459d7a7a10ebf77fc5ffcf89e9b8
Author: Luca Barbieri <luca@luca-barbieri.com>
Date:   Thu Aug 26 18:17:28 2010 +0200

    mesa/st: support fragment and vertex color clamping

commit c406514a1fbee6891da4cf9ac3eebe4e4407ec13
Author: Luca Barbieri <luca@luca-barbieri.com>
Date:   Tue Aug 24 21:56:37 2010 +0200

    mesa/st: expose ARB_color_buffer_float if unclamping is supported

commit d0c5ea11b6f75f3da2f4ca989115f150ebc7cf8d
Author: Luca Barbieri <luca@luca-barbieri.com>
Date:   Thu Aug 26 17:53:41 2010 +0200

    mesa/st: use unclamped colors

    This assumes that Gallium is to be interpreted as given drivers the
    responsibility to clamp these colors if necessary.

commit aef5c3c6be6edd076e955e37c80905bc447f8a82
Author: Luca Barbieri <luca@luca-barbieri.com>
Date:   Thu Aug 26 18:12:34 2010 +0200

    mesa, mesa/st: handle read color clamping properly

    We set IMAGE_CLAMP_BIT in the caller based on _ClampReadColor, where
    the operation mandates it. (see the removed XXX comment. -Marek)

    TODO: did I get the set of operations mandating it right?

commit 76bdfcfe3ff4145a1818e6cb6e227b730a5f12d8
Author: Luca Barbieri <luca@luca-barbieri.com>
Date:   Thu Aug 26 18:18:25 2010 +0200

    gallium: add color clamping to the interface
2011-03-29 12:04:55 +02:00
Marek Olšák
e5c6a92a12 mesa: implement clamping controls (ARB_color_buffer_float)
Squashed commit of the following:

Author: Marek Olšák <maraeo@gmail.com>

    mesa: fix getteximage so that it doesn't clamp values
    mesa: update the compute_version function
    mesa: add display list support for ARB_color_buffer_float
    mesa: fix glGet query with GL_ALPHA_TEST_REF and ARB_color_buffer_float

commit b2f6ddf907935b2594d2831ddab38cf57a1729ce
Author: Luca Barbieri <luca@luca-barbieri.com>
Date:   Tue Aug 31 16:50:57 2010 +0200

    mesa: document known possible deviations from ARB_color_buffer_float

commit 5458935be800c1b19d1c9d1569dc4fa30a97e8b8
Author: Luca Barbieri <luca@luca-barbieri.com>
Date:   Tue Aug 24 21:54:56 2010 +0200

    mesa: expose GL_ARB_color_buffer_float

commit aef5c3c6be6edd076e955e37c80905bc447f8a82
Author: Luca Barbieri <luca@luca-barbieri.com>
Date:   Thu Aug 26 18:12:34 2010 +0200

    mesa, mesa/st: handle read color clamping properly

    (I'll squash the st/mesa part to a separate commit. -Marek)

    We set IMAGE_CLAMP_BIT in the caller based on _ClampReadColor, where
    the operation mandates it.

    TODO: did I get the set of operations mandating it right?

commit 3a9cb5e59b676b6148c50907ce6eef5441677e36
Author: Luca Barbieri <luca@luca-barbieri.com>
Date:   Thu Aug 26 18:09:41 2010 +0200

    mesa: respect color clamping in texenv programs (v2)

    Changes in v2:
    - Fix attributes other than vertex color sometimes getting clamped

commit de26f9e47e886e176aab6e5a2c3d4481efb64362
Author: Luca Barbieri <luca@luca-barbieri.com>
Date:   Thu Aug 26 18:05:53 2010 +0200

    mesa: restore color clamps on glPopAttrib

commit a55ac3c300c189616627c05d924c40a8b55bfafa
Author: Luca Barbieri <luca@luca-barbieri.com>
Date:   Thu Aug 26 18:04:26 2010 +0200

    mesa: clamp color queries if and only if fragment clamping is enabled

commit 9940a3e31c2fb76cc3d28b15ea78dde369825107
Author: Luca Barbieri <luca@luca-barbieri.com>
Date:   Wed Aug 25 00:00:16 2010 +0200

    mesa: introduce derived _ClampXxxColor state resolving FIXED_ONLY

    To do this, we make ClampColor call FLUSH_VERTICES with the appropriate
    _NEW flag.

    We introduce _NEW_FRAG_CLAMP since fragment clamping has wide-ranging
    effects, despite being in the Color attrib group.

    This may be easily changed by s/_NEW_FRAG_CLAMP/_NEW_COLOR/g

commit 6244c446e3beed5473b4e811d10787e4019f59d6
Author: Luca Barbieri <luca@luca-barbieri.com>
Date:   Thu Aug 26 17:58:24 2010 +0200

    mesa: add unclamped color parameters
2011-03-29 12:04:55 +02:00
Marek Olšák
3bdd12ecb5 mesa: regenerate glapi files 2011-03-29 12:04:54 +02:00
Kenneth Graunke
9d60a7ce08 i965: Resolve implied moves in brw_dp_READ_4_vs_relative.
Fixes piglit test glsl-vs-arrays-3 on Sandybridge, as well as garbage
rendering in 3DMarkMobileES 2.0's Taiji demo and GLBenchmark 2.0's
Egypt and PRO demos.

NOTE: This a candidate for stable release branches.  It depends on
commit 9a21bc6401.
2011-03-29 06:22:48 -07:00
Kenneth Graunke
9a21bc6401 i965: Refactor Sandybridge implied move handling.
This was open-coded in three different places, and more are necessary.
Extract this into a function so it can be reused.

Unfortunately, not all variations were the same: in particular, one set
compression control and checked that the source register was not
ARF_NULL.  This seemed like a good idea, so all cases now do so.
2011-03-29 05:29:06 -07:00
Vinson Lee
4f94e0b76a mesa: Add missing parentheses in glBlitFramebufferEXT error strings. 2011-03-28 20:32:01 -07:00
Ian Romanick
e21beaeb10 intel: Don't leak the tex object miptree when replacing it
Eventually the miptree refcounting interface should be cleaned up.
The assymmetry dramatically increases the probability of bugs like
this.  It should be made to like like libdrm refcounting or the
refcounting style used in other parts of Mesa.

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=33046

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-03-28 19:54:51 -07:00
Vinson Lee
92e29dc5b0 gallivm: Fix build with llvm-2.9.
The build fix of commit 40ae214067 does
not apply to llvm-2.9 but rather to llvm-3.0svn.
2011-03-28 17:48:37 -07:00
Vinson Lee
2737350157 i915g: Fix build.
Fix build failures introduced with commit 0fbb64a529.

Reviewed-by: Jakob Bornecrantz <wallbraker@gmail.com>
2011-03-28 17:37:33 -07:00
Daniel Vetter
0fbb64a529 i915g: use drm ioctl to get pci devid
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-03-28 21:23:31 +02:00
Tobias Droste
40ae214067 gallivm: Fix build with llvm-2.9
In llvm-2.9 Target->createMCInstPrinter() takes different arguments

Signed-off-by: Tobias Droste <tdroste@gmx.de>
2011-03-28 17:23:45 +01:00
Henri Verbeet
5d7c27f5ec st/mesa: Validate state before doing blits.
Specifically, this ensures things like the front buffer actually exist. This
fixes piglt fbo/fbo-sys-blit and fd.o bug 35483.

Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
2011-03-27 15:01:59 +02:00
Fabian Bieler
244a3bbf14 r600g: Handle texture fetch instructions with relative addressing
Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
2011-03-27 15:00:07 +02:00
Fabian Bieler
da5b4764b2 r600g: Handle texture fetch instructions with neg or abs on source register
Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
2011-03-27 15:00:07 +02:00
Fabian Bieler
78037d95da r600g: Handle texture fetch instructions with swizzle on source register
Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
2011-03-27 15:00:07 +02:00
Kenneth Graunke
8752824f27 glsl: Accept precision qualifiers on sampler types, but only in ES.
GLSL 1.30 states clearly that only float and int are allowed, while the
GLSL ES specification's issues section states that sampler types may
take precision qualifiers.

Fixes compilation failures in 3DMarkMobileES 2.0 and GLBenchmark 2.0.

NOTE: This is a candidate for stable release branches.
2011-03-26 23:56:18 -07:00
Kenneth Graunke
0c8beb0ab5 i965/fs: Fix linear gl_Color interpolation on pre-gen6 hardware.
Civilization 4's shaders make heavy use of gl_Color and don't use
perspective interpolation.  This resulted in rivers, units, trees, and
so on being rendered almost entirely white.  This is a regression
compared to the old fragment shader backend.

Found by inspection (comparing the old and new FS backend code).

References: https://bugs.freedesktop.org/show_bug.cgi?id=32949

NOTE: This is a candidate for the 7.10 branch.
2011-03-26 22:20:11 -07:00
Benjamin Franzke
62d5f7a04a egl/wayland-drm: Fix include path
src/egl/main/egltypedefs.h needs the path for EGL/egl.h

Reported by jlind on irc.
2011-03-26 10:57:31 -04:00
Kristian Høgsberg
a1bd012473 egl_dri2: We don't actually support KHR_gl_texture_2D_image 2011-03-26 10:57:31 -04:00
Kristian Høgsberg
981e338611 egl_dri2: Enable image extensions in one place
We know what we can support in egl_dri2.c so just enable the extensions
there.
2011-03-26 10:57:31 -04:00
Kenneth Graunke
56ef62d988 glsl: Generate readable unique names at print time.
Since GLSL IR allows multiple ir_variables to share the same name, we
need to generate unique names when printing the IR.  Previously, we
always used %s@%p, appending the ir_variable's memory address.

While this worked, it had two drawbacks:
- When there aren't duplicates, the extra "@0x669a3e88" is useless
  and makes the code harder to read.
- Real duplicates were hard to tell apart:
  channel_expressions@0x6699e3c8 vs. channel_expressions@0x6699ddd8

We now append @2, @3, @4, and so on, but only where necessary to
distinguish duplicates.  Since we only do this at print time, any
performance impact is irrelevant.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <idr@freedesktop.org>
2011-03-25 16:31:53 -07:00
Vinson Lee
eb0dd37094 gallivm: Fix build with llvm-2.9.
In llvm-2.9, the header file llvm/System/Host.h has been moved to
llvm/Support/Host.h.
2011-03-25 12:47:06 -07:00
Ian Romanick
dfdff940b6 glsl: Make add_variable, add_uniform, et. al. have similar signatures
While making some other changes in this area I was finding it annoying
each of these functions took mostly the same set of parameters in
differing orders.
2011-03-25 11:28:08 -07:00
Ian Romanick
4e994e150f i965/fs: Use different name for inner loop counter
'i' is already used for the outer loop.  This caused some problems
while doing other work in this area.  No bug exists here... until you
want to use the outer loop counter in the inner loop.
2011-03-25 11:28:07 -07:00
Ian Romanick
0d9d036004 glsl: Fix off-by-one error setting max_array_access for non-constant indexing
NOTE: This is a candidate for the stable branches.
2011-03-25 11:28:07 -07:00
Ian Romanick
bc83f6bd58 glsl: Add array access bounds checking to ir_validate 2011-03-25 11:28:07 -07:00
Brian Paul
cf290344cc mesa: add void to save_TextureBarrierNV() 2011-03-25 10:33:51 -06:00
José Fonseca
28f1d6ab49 glsl: Add void to _mesa_destroy_shader_compiler() argument list.
At least MSVC sees a distinction between foo() and foo(void) and warns
about it.
2011-03-25 16:22:34 +00:00
José Fonseca
a81828cb96 mesa: Avoid redefining PUBLIC/USE/likely/unlikely macros. 2011-03-25 16:22:32 +00:00
José Fonseca
7fbe020bbc mesa: Use appropriate call convention in VertexAttribI*v.
We were using typecasts because the functions pointers are polymorphic
in the second argument type, which.

Surprisingly the wrong calling convention didn't cause crashes on Windows,
but it was causing certain registers to be trashed in MSVC optimized
builds, when processing callists in the ClearView RC Flight Simulator.
2011-03-25 16:22:30 +00:00
José Fonseca
5858abec6e gallium: Avoid redefinition of likely/unlikely macros on non gcc compilers. 2011-03-25 16:22:28 +00:00
José Fonseca
acd7ce57f7 mesa,mapi: Remove spurious const keyword from ClearBufferfi args. 2011-03-25 16:22:26 +00:00
Marek Olšák
226ae9d6c8 r300g: fix alpha-test with no colorbuffer
Piglit:
- fbo-alphatest-nocolor

NOTE: This is a candidate for the stable branches.
2011-03-24 23:37:51 +01:00
Brian Paul
e1a9ef2304 mesa: added _mesa_dump_image() for debugging 2011-03-24 13:38:28 -06:00
Brian Paul
e4852ae4d2 mesa: minor whitespace fixes 2011-03-24 13:38:27 -06:00
Eric Anholt
2911fa0cca i965/fs: Make compile failure more verbose with INTEL_DEBUG=wm. 2011-03-24 11:31:36 -07:00
Eric Anholt
4a101f9577 i965/fs: Clean up reg_undef args from long ago lack of fs_inst overloads. 2011-03-24 11:31:36 -07:00
Eric Anholt
53d78be3bd i965/fs: Clean up the emit calls by introducing emit() overload helpers.
I think the code ends up a lot more legible this way, though we've
still got the overloads in the fs_inst as well (even though there's
only one caller left currently).
2011-03-24 11:31:36 -07:00
Brian Paul
82dd62fb22 mesa: new MESA_EXTENSION_MAX_YEAR env var
If set to year X, only report extensions up to that year.  This is a
work-around for games that try to copy the extensions string to a fixed
size buffer and overflow.  If a game was released in year X, setting
MESA_EXTENSION_MAX_YEAR to that year will likely fix the problem.
2011-03-24 11:39:23 -06:00
Brian Paul
4c75d5ae63 svga: adjust triangle rasterization offset
Fixes minor sub-pixel positioning error in some apps.
2011-03-24 11:32:38 -06:00
Iain Hibbert
c22a7f9045 radeon: use C99 style in macros with variable arguments
Signed-off-by: Iain Hibbert <plunky@netbsd.org>
2011-03-24 08:36:31 -06:00
Brian Paul
ff2950dd69 radeon: reorder #includes to silence warnings
Silences warnings about RADEON_TILING_SURFACE being redefined.
Only compile tested, not run tested.
2011-03-24 08:34:44 -06:00
Brian Paul
b5745429d7 r128: fix an old annoying warning 2011-03-24 08:29:28 -06:00
Brian Paul
7d40bf2566 radeon: fix radeon_create_image_from_name() wrong parameter type 2011-03-24 08:29:28 -06:00
José Fonseca
f4e392bf8d st/wgl: Adjust the pbuffer invisible window size.
Thanks to Brian Paul for diagnosing the issue.
2011-03-24 10:47:03 +00:00
José Fonseca
81992010b5 mesa: More glGet* fixes.
glGet(GL_NORMAL_ARRAY) giving potentially wrong results.

Most of glGet(GL_XXX_ARRAY_BUFFER_BINDING) giving totally bogus results.
2011-03-23 16:47:41 +00:00
Brian Paul
12b9e07966 mesa: remove unused _MESA_NEW_NEED_NORMALS 2011-03-23 09:05:04 -06:00
Brian Paul
7ecb61c30c mesa: remove _MESA_NEW_TRANSFER_STATE 2011-03-23 09:04:22 -06:00
José Fonseca
f6970872c0 mesa: Fix typo glGet*v(GL_TEXTURE_COORD_ARRAY_*). 2011-03-22 22:48:02 +00:00
Fabian Bieler
8d7c12de1e r600g: Check for relative addressing in destination register when trying to merge instruction groups
Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
2011-03-22 21:24:09 +01:00
Dave Airlie
e4b040c2b9 r600g: fix bo names causing -35 EDEADLCK
this is a port of the r300 winsys code to do the same thing.
2011-03-22 11:48:36 +10:00
José Fonseca
b881ea87f1 svga: Avoid synchronizing when doing piecewise upload of textures. 2011-03-21 18:47:24 +00:00
José Fonseca
29288249e3 svga: Undo the DMA buffer size limiting.
Move this to the winsys, given it is not a virtual device limitation,
but a limitation specific to certain winsyses.

Also update debug message.
2011-03-21 18:46:59 +00:00
Dave Airlie
9b13c988ac glapi: drop glapi.[ch] and glapitemp.h from being copied to the X server.
These files are no longer considered shared as the X code is a lot simpler
without sharing them.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-03-21 12:03:20 +10:00
Brian Paul
cfc7ded3ff mesa: 80-column wrapping and comment updates 2011-03-19 14:17:42 -06:00
Brian Paul
d0d767ad4c mesa: 80-column wrapping, update comment 2011-03-19 14:17:41 -06:00
Brian Paul
912c4ec6df gl.h: reorder some #defines 2011-03-19 14:17:41 -06:00
Brian Paul
933b99f113 mesa: consolidate enable/disable code for GL_TEXTURE_GEN_S/T/R/Q 2011-03-19 14:17:41 -06:00
Brian Paul
ec4a21b0e2 mesa: consolidate clip plane update code 2011-03-19 14:17:41 -06:00
Brian Paul
957552fce0 mesa: 80-column wrapping 2011-03-19 14:17:41 -06:00
Brian Paul
aafcbd2cf7 mesa: replace macro with function 2011-03-19 14:17:41 -06:00
Brian Paul
9459cc593c mesa: 80-column wrapping 2011-03-19 14:17:41 -06:00
Brian Paul
630d925666 mesa: rename functions to follow Mesa conventions 2011-03-19 14:17:40 -06:00
Brian Paul
79f4281a52 mesa: 80-column wrapping 2011-03-19 14:17:40 -06:00
Christoph Bumiller
83ff3809f1 nv50,nvc0: implement texture barrier 2011-03-19 14:45:55 +01:00
Tom Stellard
9d2ef284bb r300/compiler: Use a 4-bit writemask in pair instructions
We now use a 4-bit writemask for all instruction types, which makes it
easier to write generic helper functions to manipulte writemasks.

NOTE: This is a candidate for the 7.10 branch.
2011-03-18 12:04:20 -07:00
Johannes Obermayr
8042d751de nouveau: Fix serious compiler warnings
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=35025

Signed-off-by: Brian Paul <brianp@vmware.com>
2011-03-18 12:10:11 -06:00
Brian Paul
5b902a08c1 mesa: minor improvements in glTexEnvfv() 2011-03-17 20:31:58 -06:00
Brian Paul
582570a04c mesa: only report up to 50 _mesa_problem() calls
http://bugs.freedesktop.org/show_bug.cgi?id=35200 reports a disk
partition getting filled because of warning messages.  Stop emitting
after 50.
2011-03-17 20:31:58 -06:00
Brian Paul
147148fd50 swrast: report data type in error message 2011-03-17 20:31:58 -06:00
Kenneth Graunke
5e9aa9926b mesa: Remove the CompileShader driver hook; it's just a no-op. 2011-03-17 14:48:54 -07:00
Brian Paul
cbadedb511 mesa: use _mesa_get_current_tex_unit() helper in BindTexture() 2011-03-16 21:13:31 -06:00
Brian Paul
552f54bf04 mesa: remove unneeded local var in BindTexture() 2011-03-16 21:13:31 -06:00
Brian Paul
dfda559b98 mesa: clean up the glBindTexture early out code a bit 2011-03-16 21:13:31 -06:00
Kenneth Graunke
2279156fe7 i965: Rename brw_(IF|CONT)_gen6 functions to gen6_(IF|CONT). 2011-03-16 14:18:03 -07:00
Tobias Droste
f3a828c21f autoconf: don't use CFLAGS for cpp files
Signed-off-by: Tobias Droste <tdroste@gmx.de>
2011-03-16 13:54:50 -07:00
Kenneth Graunke
2baac48f39 i965: Rename BRW_DATAPORT_..._GEN6 messages to GEN6_... for consistency. 2011-03-16 13:51:44 -07:00
Kenneth Graunke
cc48d663f7 i965: Rename BRW_SAMPLER_MESSAGE_..._GEN5 to GEN5_SAMPLER_MESSAGE.
We already have lots of GEN6_* defines; this seems more consistent.
2011-03-16 13:51:44 -07:00
José Fonseca
b47d508412 svga: Leave any_user_vertex_buffers flag alone.
It is pointless to change, now that we don't replace user vertex buffer
with uploaded copy, per commit 52e598d200.
2011-03-16 15:46:21 +00:00
José Fonseca
74651f5738 svga: Hardcode SVGA_COMBINE_USERBUFFERS to 1.
The code no longer supports otherwise -- it relies on buffers being
uploaded via u_upload_mgr -- so make this clear.

Also, there's no need to flush after draws from user buffers, given all
user content should have been copied by then.
2011-03-16 15:43:00 +00:00
José Fonseca
8767fe2437 mesa: Sort extensions in extension string by year.
The years were obtained automatically by scraping the first year from
the spec text file.  They are approximate.
2011-03-16 11:38:53 +00:00
José Fonseca
e08a3d674a svga: Use transfer information on buffer transfers.
Should prevent the assert failure

  svga_buffer_flush_mapped_range: Assertion `sbuf->map.writing' failed.

on nested transfers.
2011-03-16 11:21:12 +00:00
José Fonseca
6b3713f8b8 glsl2: Silence unused added variable gcc warning. 2011-03-16 09:16:01 +00:00
José Fonseca
5fc5820cbc mesa: Use typecast in BITFIELD64_BIT macro.
Unsigned long is 32bit on several platforms (e.g., Windows), yielding
1UL << 32 to be zero.

Note that BITFIELD64_BIT result is often assigned to variables of type
GLbitfield, instead of GLbitfield64. That's probably wrong and should be
addressed in a later change.
2011-03-16 09:15:30 +00:00
Brian Paul
11150e4667 mesa: use BITFIELD64_BIT() macro 2011-03-15 18:21:36 -06:00
Brian Paul
aa878f94ab st/mesa: use BITFIELD64_BIT() macro in a few more places 2011-03-15 18:21:35 -06:00
Brian Paul
d350ef1682 glsl: add cast to silence signed/unsigned comparison warning 2011-03-15 18:21:35 -06:00
Brian Paul
d029ba9ec0 mesa: use 1UL for 64-bit unsigned constant for C++
This fixes C++ warnings where BITFIELD64_BIT() is used.
2011-03-15 18:21:35 -06:00
Ian Romanick
85caea29c1 glsl: Only allow unsized array assignment in an initializer
It should have been a tip when the spec says "However, implicitly
sized arrays cannot be assigned to. Note, this is a rare case that
*initializers and assignments appear to have different semantics*."
(empahsis mine)

Fixes bugzilla #34367.

NOTE: This is a candidate for stable release branches.
2011-03-15 16:41:23 -07:00
Daniel Vetter
d04348aaf6 i915g: fix braino in the static state rework
For mip-map level rendering, both draw offset and size tend to change ...

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-03-15 21:49:25 +01:00
Daniel Vetter
11ee41fe7f i915g: implement early z
v2: Make it actually work.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-03-15 18:36:25 +01:00
Daniel Vetter
288504fac7 i915g: split up static state
Early Z support is set in the DST_VARS command. Hence split up static
state emission to avoid reissuing to much on fragment shader changes,
especially the costly dst buffer relocations.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-03-15 18:36:00 +01:00
Eric Anholt
a99447314c i965: Fix alpha testing when there is no color buffer in the FBO.
We were alpha testing against an unwritten value, resulting in garbage.
(part of) Bug #35073.
2011-03-15 10:14:52 -07:00
Eric Anholt
b60651a17b i965: Do our lowering passes before the loop of optimization.
The optimization loop won't reinsert noise instructions or quadop
vectors, so we were traversing the tree for nothing.  Lowering vector
indexing was in the loop after do_common_optimization() to avoid the
work if it ended up that the index was actually constant, but that has
been called already in the core.
2011-03-15 10:14:52 -07:00
Eric Anholt
c75427f4c8 glsl: Skip processing the first function's body in do_dead_functions().
It can't call anything, so there's no point.
2011-03-15 10:14:51 -07:00
Eric Anholt
11af045ea8 glsl: Whitespace fixup in opt_dead_functions.cpp. 2011-03-15 10:14:51 -07:00
Eric Anholt
2b13e13594 glsl: Skip processing of expression trees in discard simplification.
It only cares about "if", "loop", and "discard".
2011-03-15 09:49:01 -07:00
Eric Anholt
05cf1ad82e glsl: Reduce processing of expression trees in do_structure_splitting.
Most of the time we don't have a non-uniform struct variable in the
shader, so this cuts the time spent in do_structure_splitting during
glean texCombine by about 2/3.
2011-03-15 09:49:01 -07:00
Eric Anholt
991fa4d3d0 glsl: Skip processing expression trees in do_if_simplification().
Reduces time spent in this during glean texCombine by about 2/3.
2011-03-15 09:49:00 -07:00
Eric Anholt
d3a444af2d glsl: Skip processing expression trees in optimize_redundant_jumps()
Cuts the time spent in this function during glean texCombine by 2/3.
2011-03-15 09:49:00 -07:00
José Fonseca
b0fff8d17e svga: Tell the host to discard when doing writes without FLUSH_EXPLICIT. 2011-03-15 15:44:03 +00:00
José Fonseca
147ca90bd3 svga: Update svga_winsys_screen::buffer_map comments. 2011-03-15 15:43:33 +00:00
José Fonseca
ef33c82bfd svga: Ensure DMA commands are serialized with unsynchronized flag is unset. 2011-03-15 15:38:18 +00:00
Jose Fonseca
a946e84071 scons: copy hash_table.c, symbol_table.c to glsl directory
This fixes an issue where the .obj files wound up in the src/
directory rather than the build/ directory.  That prevented
combined 32-bit and 64-bit builds from working.

Signed-off-by: Brian Paul <brianp@vmware.com>
2011-03-15 15:32:00 +00:00
Marek Olšák
d0e805ebd8 mesa: fix scons build 2011-03-15 16:25:16 +01:00
Marek Olšák
79ddcb93fb r300g: implement the texture barrier 2011-03-15 15:58:12 +01:00
Marek Olšák
aea4ed41ed gallium: add texture barrier support to the interface and st/mesa (v2)
v2: change the gallium entry point to texture_barrier.
2011-03-15 15:58:12 +01:00
Marek Olšák
9a9c1e1ae1 mesa: add display list support for NV_texture_barrier 2011-03-15 15:58:12 +01:00
Marek Olšák
7fa53f37e6 mesa: regenerate glapi files
Be sure to type "make clean" after this commit, otherwise your binaries
will segfault.
2011-03-15 15:58:00 +01:00
Marek Olšák
867f9b07d4 mesa: add NV_texture_barrier 2011-03-15 15:47:27 +01:00
Mathias Fröhlich
65942e141f gallium/util: Use PIPE_TRANSFER_DISCARD_RANGE in pipe_buffer_write.
Additionally, to discarding the whole buffer, use
PIPE_TRANSFER_DISCARD_RANGE in pipe_buffer_write when the
write covers only part of the buffer.

Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
2011-03-15 15:39:38 +01:00
Mathias Fröhlich
baab835a1f st/mesa: Make use of the new PIPE_TRANSFER_DISCARD_* for buffer object.
In memory mapping buffer objects make use of
PIPE_TRANSFER_DISCARD_WHOLE_RESOURCE and PIPE_TRANSFER_DISCARD_RANGE
when appropriate.

Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
2011-03-15 15:39:31 +01:00
Dave Airlie
fedc5b03db glx: add ARB_create_context functions/ops to glx xml 2011-03-15 14:27:27 +10:00
Henri Verbeet
df3d11f6ca r600g: FLT_TO_INT_FLOOR and FLT_TO_INT_RPI are vector-only instructions on Evergreen.
Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
2011-03-15 01:15:50 +01:00
Alex Deucher
39d60610e8 r600g: fix logic error in 028987c803
Spotted by Henri on IRC.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-03-14 18:07:15 -04:00
Alex Deucher
3e30148900 r600g: don't set per-MRT blend bits on R600
It doesn't support them.  Also, we shouldn't be
emitting CB_BLENDx_CONTROL on R600 as the regs don't
exist there, but I'm not sure of the best way to deal
with this in the current r600 winsys.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-03-14 17:53:00 -04:00
Alex Deucher
d6fea4a985 r600g: Original R600 does not support per-MRT blends
Only rv6xx+ support them.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-03-14 17:47:21 -04:00
Alex Deucher
028987c803 r600g: emit SURFACE_BASE_UPDATE packet on rv6xx
This packet is required when updating the DB, CB,
or STRMOUT base addresses on rv6xx for the surface
sync logic to work correctly.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-03-14 17:42:19 -04:00
Henri Verbeet
1a8dc1539b r600g: Properly update MULTIWRITE_ENABLE in r600_pipe_shader_ps().
This sort of worked because blend state setup cleared MULTIWRITE_ENABLE again,
but that's not something we want to depend on.

Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
2011-03-14 22:15:56 +01:00
Henri Verbeet
ab1a2e454e r600g: Fix the DB_SHADER_CONTROL mask in create_ds_state().
Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
2011-03-14 22:15:56 +01:00
Henri Verbeet
2342e89979 r600g: Properly update DB_SHADER_CONTROL in evergreen_pipe_shader_ps().
Disable Z_EXPORT / STENCIL_EXPORT / KILL_ENABLE again if a shader doesn't
use those. This is similar to 0a6f09a76a.

Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
2011-03-14 22:15:56 +01:00
Henri Verbeet
a2ef38368b r600g: Move fetch shader register setup to r600_state.c / evergreen_state.c.
Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
2011-03-14 22:15:56 +01:00
Henri Verbeet
f262ba26f0 r600g: Move r600_pipe_shader_ps() to r600_state.c.
Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
2011-03-14 22:15:56 +01:00
Henri Verbeet
c0ca43e507 r600g: Move r600_pipe_shader_vs() to r600_state.c.
The idea behind this is that anything touching registers should be in
r600_state.c or evergreen_state.c. This is also consistent with
evergreen_pipe_shader_vs().

Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
2011-03-14 22:15:56 +01:00
Rafael Monica
112ffdfd07 r600g: Evergreen add support for log opcode.
Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
2011-03-14 22:15:56 +01:00
José Fonseca
202c345c7c autoconf/make: Don't specify individual llvm libraries.
We need more and more of these, and it is difficult and prone to version
incompatability issues trying to single out every one of them.

This mimicks what was done in SCons.
2011-03-14 20:05:56 +00:00
Kenneth Graunke
25e3114095 i965: Enable texture lookups whose return type is 'float'
This enables the new shadow texture functions in GLSL 1.30.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@intel.com>
2011-03-14 13:03:50 -07:00
Chad Versace
1842b89f77 i965: Fix tex_swizzle when depth mode is GL_RED
Change swizzle from (x000) to (x001).

Signed-off-by: Chad Versace <chad.versace@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-03-14 13:03:50 -07:00
Chad Versace
e0cbb154f2 i965: Remove dead assignment
The assignment on line 368, `tex_swizzles[i] = SWIZZLE_NOOP`, is rendered
dead by the reassignment on line 392.

Signed-off-by: Chad Versace <chad.versace@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-03-14 13:03:50 -07:00
Kenneth Graunke
233b88eab9 glsl: Explicitly specify a type when reading/printing ir_texture.
This is necessary for GLSL 1.30+ shadow sampling functions, which return
a single float rather than splatting the value to a vec4 based on
GL_DEPTH_TEXTURE_MODE.
2011-03-14 13:03:50 -07:00
Kenneth Graunke
cb3317b85a texture_builtins.py: Add support for 130-style Shadow sampler variants. 2011-03-14 13:03:50 -07:00
Marek Olšák
bb0910bfa6 mesa: rename _mesa_texstore_a8 -> _mesa_texstore_unorm8
It's a generic function capable of storing A8, L8, I8, R8.
2011-03-14 18:51:29 +01:00
Marek Olšák
c0110d5450 mesa: fix up assertion in _mesa_source_buffer_exists
This was probably missed when implementing luminance and luminance alpha
render targets.

_mesa_get_format_bits checks for both GL_*_BITS and GL_TEXTURE_*_SIZE.

This fixes:
main/framebuffer.c:892: _mesa_source_buffer_exists: Assertion `....' failed.
2011-03-14 10:24:24 +01:00
Marek Olšák
23ccab39cd r300g: clamp after blending for fixed-point formats only 2011-03-14 10:09:34 +01:00
Dave Airlie
340e15c79b glx: the server still needs __GLXcontext.
This file generates code for the X server and it still uses
the __GLXcontext structure name.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-03-14 15:03:53 +10:00
Marek Olšák
0f84ddad29 ir_to_mesa: do not check the number of uniforms against hw limits
The r300 compiler can eliminate unused uniforms and remap uniform locations
if their number surpasses hardware limits, so the limit is actually
NumParameters + NumUnusedParameters. This is important for some apps
under Wine to run.

Wine sometimes declares a uniform array of 256 vec4's and some Wine-specific
constants on top of that, so in total there is more uniforms than r300 can
handle. This was the main motivation for implementing the elimination
of unused constants.

We should allow drivers to implement fail & recovery paths where it makes
sense, so giving up too early especially when comes to uniforms is not
so good idea, though I agree there should be some hard limit for all drivers.

This patch fixes:
- glsl-fs-uniform-array-5
- glsl-vs-large-uniform-array
on drivers which can eliminate unused uniforms.
2011-03-14 03:12:34 +01:00
Dave Airlie
110f5e2056 autoconf/llvm: fix build for disassembler
tested by okias on irc
2011-03-14 09:37:08 +10:00
José Fonseca
c27e58c109 gallivm: Fix build with llvm 2.6 on 32bit platforms 2011-03-13 19:49:21 +00:00
José Fonseca
e6314db0ac gallivm: Use LLVM MC disassembler, instead of udis86.
Included in LLVM 2.7+. Unlink udis86, should support all instructions that
LLVM can emit.
2011-03-13 19:24:26 +00:00
José Fonseca
d2332569d2 util: Silence gcc unitialized member warning 2011-03-13 18:56:19 +00:00
José Fonseca
b79b05e17e draw: Fix draw_variant_output::format's type. 2011-03-13 18:56:07 +00:00
Christoph Bumiller
c448a556e9 nv50,nvc0: don't assert on cso with 0 vertex elements 2011-03-13 18:19:22 +01:00
Jakob Bornecrantz
07838ff990 rbug: Use the call mutex
Fixes crashes in [soft|llvm]pipe when replacing shaders
2011-03-13 18:13:55 +01:00
Mathias Fröhlich
0a6f09a76a r600g: Only update DB_SHADER_CONTROL once in r600_pipe_shader_ps().
Avoid setting the same gpu register several times in a r600_pipe_state.
Compute the final value of the register and set that one time. This avoids
some overhead in r600_context_pipe_state_set().

Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
2011-03-13 17:25:16 +01:00
Jakob Bornecrantz
629bc76b75 tgsi: Fix parsing of properties with digits in the name 2011-03-13 15:35:35 +01:00
Jakob Bornecrantz
f4e6061d88 rbug: Skip drawing on disabled shaders 2011-03-13 13:36:21 +01:00
Jakob Bornecrantz
dfac72208d rbug: Remove flags from flush 2011-03-13 13:36:21 +01:00
Jakob Bornecrantz
c7894dfad9 i915g: Lie more so we get GLSL
Lots of piglit tests are lazy and wants GLSL
2011-03-13 13:36:21 +01:00
Jakob Bornecrantz
c03be14d42 i915g: Point sprite cap could be supported 2011-03-13 13:36:21 +01:00
Jakob Bornecrantz
6d86429bd9 i915g: Sort cap list 2011-03-13 13:36:21 +01:00
Christoph Bumiller
07f73577af nvc0: support edge flags 2011-03-13 13:23:55 +01:00
Christoph Bumiller
c0f53fe8aa nvc0: fix POLYGON_MODE_BACK macro copy/paste error 2011-03-13 13:23:55 +01:00
Christoph Bumiller
e864ccb3f2 nv50,nvc0: fix pipe context switch 2011-03-13 13:23:55 +01:00
Christoph Bumiller
4388817a67 nv50,nvc0: clean up flushes 2011-03-13 13:23:55 +01:00
Christoph Bumiller
26a199efac nv50,nvc0: add some missing resource referencing 2011-03-13 13:23:55 +01:00
Christoph Bumiller
259efc90e7 nvc0: mask out centroid bit for writing FP header
It's only 2 bit per input, centroid is set in the instruction.
2011-03-13 13:23:55 +01:00
Christoph Bumiller
0abaaac872 nvc0: identify VERTEX_QUARANTINE
Well, not sure what exactly it is, but it certainly doesn't contain
the control flow stack, but vertex data.

Not sure about size, I've only seen the first few KiB written, but
the binary driver seems to allocate more.
2011-03-13 13:23:55 +01:00
Christoph Bumiller
f0ee7d8bb4 nvc0: don't enable early-z if alpha test is enabled
Depth values are also written before the shader is executed, so if
early tests are enabled, fragments that failed the alpha test were
modifying the depth buffer, but they shouldn't.
2011-03-13 13:23:54 +01:00
Christoph Bumiller
d9f1310e51 nvc0: move sprite coord replace state into cso
It's not dependent on any other state anymore now.
2011-03-13 13:23:54 +01:00
Christoph Bumiller
11f07a35f4 nvc0: s/nblocksx/nblocksy for height in resource_copy_region 2011-03-13 13:23:54 +01:00
Christoph Bumiller
d7a23cfb88 nvc0: fix unitialized variable in TGSI sysval decl processing 2011-03-13 13:23:54 +01:00
Christoph Bumiller
f10b2021c1 nvc0: update/fix supported instruction src modifiers 2011-03-13 13:23:54 +01:00
Chad Versace
dedc81e1dc glsl: Document glsl_type::sampler_dimensionality 2011-03-12 17:39:48 -08:00
Eric Anholt
098f9c5325 Revert "mesa: Convert fixed function fragment program generator to GLSL IR."
This reverts commit 7cb87dffce.
There were regressions (Bug #35244) and more review has been requested.
2011-03-12 15:11:01 -08:00
Eric Anholt
07c420a3c6 Revert "mesa: Track a computed _CurrentFragmentProgram for current gl_shader_program"
This reverts commit b4452c3baa.
2011-03-12 15:11:00 -08:00
Eric Anholt
403be11111 Revert "i965: Use the fixed function GLSL program instead of the ARB program."
This reverts commit 81b34a4e3a.  There
were regressions in the core change that this depends on.
2011-03-12 15:11:00 -08:00
Daniel Vetter
7735f8c6e5 i915g: fix transfer coherency
The kernel drm takes care of all coherency as long as we don't forget
to submit all outstanding commands in the batchbuffer ...

Also move batchbuffer initialization up because otherwise transfers
for some helper textures fail with a segmentation fault.

And kill the dead code, flushes should now be correct everywhere.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-03-12 22:58:19 +01:00
Daniel Vetter
f608795588 i915g: don't recalculate fb dimension
The statetracker should do this for us correctly.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-03-12 20:32:30 +01:00
Daniel Vetter
d46c6084ce i915g: use y-tiling when the blitter is not used
The blitter is broken. Who'd have guessed?

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-03-12 20:32:29 +01:00
Daniel Vetter
f0c56e2a23 i915g: implement copy_region using u_blitter
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>works
2011-03-12 20:32:29 +01:00
Daniel Vetter
06713a4079 i915g: fix use after free
Pipe templates should be copied if still needed after the create
call completes.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-03-12 20:31:30 +01:00
Jakob Bornecrantz
1a79064da1 gallium: Delay the creation of simple helper shaders 2011-03-12 19:39:45 +01:00
Carl-Philip Hänsch
7339915a4b r600g: Fix VS sampler view offsets for r600/r700.
077c448d18 missed this.

Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
2011-03-12 19:33:16 +01:00
Henri Verbeet
656c314573 r600g: Fix an unused variable warning. 2011-03-12 16:43:58 +01:00
Henri Verbeet
ab21147c89 u_blitter: Do blits in linear color space.
Blits between sRGB and linear formats should happen in linear color space.
This fixes piglit fbo/fbo-srgb-blit.
2011-03-12 16:43:58 +01:00
Marek Olšák
6da4866ffd r300/compiler: do not set TEX_IGNORE_UNCOVERED on r500
The docs say it can be set for direct texture lookups, but even that
causes problems.

This fixes the wireframe bug:
https://bugs.freedesktop.org/show_bug.cgi?id=32688

NOTE: This is a candidate for the 7.9 and 7.10 branches.
2011-03-12 11:54:23 +01:00
Marek Olšák
1e97b4dd10 r300/compiler: TEX instructions don't support negation on source arguments
This fixes piglit:
- glsl-fs-texture2d-dependent-4

NOTE: This is a candidate for the 7.9 and 7.10 branches.
2011-03-12 10:22:18 +01:00
Marek Olšák
589d835dfd r300/compiler: Abs doesn't cancel Negate (in the conversion to native swizzles)
NOTE: This is a candidate for the 7.9 and 7.10 branches.
2011-03-12 10:18:45 +01:00
Marek Olšák
d96305e4fc r300/compiler: fix translating the src negate bits in pair_translate
(1, -_, ...) was converted to (-1, ...) because of the negation
in the second component.
Masking out the unused bits fixes this.

Piglit:
- glsl-fs-texture2d-branching

NOTE: This is a candidate for the 7.9 and 7.10 branches.
2011-03-12 09:39:46 +01:00
Marek Olšák
1868d21c8e st/dri: fix warning: ‘bind’ may be used uninitialized in this function 2011-03-12 08:49:54 +01:00
Marek Olšák
f1e160f89b llvmpipe: fix warning: ‘t0’ may be used uninitialized in this function 2011-03-12 08:48:43 +01:00
Marek Olšák
4b92c688a4 r300g: implement fragment color clamping in the shader
This finishes the implementation of the fragment color clamp control
for ARB_color_buffer_float. I don't wanna keep this stuff in a branch...
2011-03-12 07:56:33 +01:00
Marek Olšák
e4707604ab r300/compiler: fix the saturate modifier when applied to TEX instructions
This bug can only be triggered if the source texture is either signed or float.
2011-03-12 07:54:23 +01:00
Adam Jackson
cbcb84fccf r600g: revert unintentional commit 2011-03-11 17:46:03 -05:00
Adam Jackson
02725bc8b0 nouveau: Build fix
nouveau_vieux_dri.so.tmp: undefined reference to `_mesa_need_secondary_color'
2011-03-11 17:37:21 -05:00
Adam Jackson
b5872cdda0 r600: Build fix
r600_dri.so.tmp: undefined reference to `_mesa_rgba_logicop_enabled'
2011-03-11 17:24:47 -05:00
Vinson Lee
4faa95e74d st/python: Remove flags from flush function. 2011-03-11 14:00:32 -08:00
Vinson Lee
9c366ceedb st/python: Remove the geom_flags param from is_format_supported. 2011-03-11 13:37:30 -08:00
Vinson Lee
d17ef8636d st/python: Clean up fence_finish. 2011-03-11 13:35:06 -08:00
Vinson Lee
dee6eafbd2 scons: Move texenvprogram.c to ff_fragment_shader.cpp. 2011-03-11 13:32:41 -08:00
Eric Anholt
81b34a4e3a i965: Use the fixed function GLSL program instead of the ARB program.
This gets one more piece of the pipeline onto the new codegen backend.
Once ARB_fragment_program can generate GLSL programs, we can nuke the
old backend.
2011-03-11 12:55:14 -08:00
Eric Anholt
b4452c3baa mesa: Track a computed _CurrentFragmentProgram for current gl_shader_program
This is like how we track FragmentProgram._Current for the computed
ARB fragment program for fixed function texenv, but this gives direct
access to the gl_shader_program for drivers to codegen from, skipping
ARB_fp.
2011-03-11 12:55:14 -08:00
Eric Anholt
7cb87dffce mesa: Convert fixed function fragment program generator to GLSL IR.
This is a step towards providing a direct route for drivers accepting
GLSL IR for codegen.  Perhaps more importantly, it runs the fixed
function fragment program through the GLSL IR optimization.  Having
seen how easy it is to make ugly fixed function texenv code that can
do unnecessary work, this may improve real applicatinos.
2011-03-11 12:55:14 -08:00
Eric Anholt
29e013e58b mesa: Add gl_MESAFogParamsOptimized for our special pre-computed fog params.
It would be nice if we handled optimized uniform math like this in
some generic way, since people often end up doing uniform expressions
in shaders, but for now keep this hard-coded like it was in the
texenvprogram code.
2011-03-11 12:55:14 -08:00
Eric Anholt
20f7a6f11a mesa: Add a builtin uniform for the ATI_envmap_bumpmap rotation matrix.
For fixed function fragment processing in GLSL IR, we want to be able
to reference this state value.  gl_* not explicitly permitted is
reserved, so using this variable name internally shouldn't be any
issue.
2011-03-11 12:55:14 -08:00
Eric Anholt
cdacca4868 mesa: Move texenvprogram.c to ff_fragment_shader.cpp.
This file is about to change to generating a shader program instead of
a fragment program.
2011-03-11 12:55:13 -08:00
Eric Anholt
e1cb12bfff prog_cache: Add some support for shader_programs in prog_cache.
This is used in the upcoming fixed function shader_program generation,
and shader_program and ARB programs are together in this code until
both fragment and vertex ff get converted.
2011-03-11 12:55:13 -08:00
Eric Anholt
9c7231c1d9 mesa: Don't try to remove an internal shader_program from the hash.
It fails on assertions if the key isn't actually present.
2011-03-11 12:55:13 -08:00
Eric Anholt
5ae1d19506 i965: Use ffs() on a 32-bit int value instad of ffsll(). 2011-03-11 12:55:13 -08:00
Marek Olšák
7e02303497 gallium: remove flags from the flush function
The drivers have been changed so that they behave as if all of the flags
were set. This is already implicit in most hardware drivers and required
for multiple contexts.

Some state trackers were also abusing the PIPE_FLUSH_RENDER_CACHE flag
to decide whether flush_frontbuffer should be called.
New flag ST_FLUSH_FRONT has been added to st_api.h as a replacement.
2011-03-11 21:39:31 +01:00
Marek Olšák
e968975cb5 gallium: remove the geom_flags param from is_format_supported 2011-03-11 21:39:30 +01:00
Marek Olšák
bfe88e6998 gallium: cleanup fence_signalled and fence_finish
So that they don't have the driver-specific param and return type.
2011-03-11 21:39:30 +01:00
Marek Olšák
25485f4b69 gallium: kill is_resource_referenced
Only st/xorg used it and even incorrectly with regards to pipelined transfers.
2011-03-11 21:39:30 +01:00
Adam Jackson
2b64886c81 swrastg: Add __DRI_TEX_BUFFER support
Without this, EXT_texture_from_pixmap is trivially broken.  With it,
it's merely subtly broken.

Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-03-11 14:49:28 -05:00
Brian Paul
d7db14ab7d mesa: test against MaxUniformComponents in check_resources()
Since we're compiling/linking GLSL shaders we should check against
the shader uniform limits, not the legacy vertex/fragment program
parameter limits which are usually lower.
2011-03-11 10:04:17 -07:00
Brian Paul
e0e94026a0 mesa: move location of some geometry program limits
The gl_program_constants struct is for limits that are applicable to
any/all shader stages.  Move the geometry shader-only fields into the
gl_constants struct.
Remove redundant MaxGeometryUniformComponents field too.
2011-03-11 09:25:22 -07:00
Brian Paul
8cc84b3e45 mesa: use check_resources() to check program against limits
Without these checks we could create shaders with more samplers,
constants than the driver could handle.  Fail linking rather than
dying later.
2011-03-11 09:25:22 -07:00
Brian Paul
decc6e2a32 mesa: replace NEED_SECONDARY_COLOR(), RGBA_LOGICOP_ENABLED() with inlines
and rename them.
2011-03-11 09:25:21 -07:00
Brian Paul
4293a12c7f mesa: call FLUSH_VERTICES() before deleting shaders, buffers, query objects
Need to flush rendering (or at least indicate that the rug might be getting
pulled out from underneath us) when a shader, buffer object or query object
is about to be deleted.

Also, this helps to tell the VBO module to unmap its current vertex buffer.
2011-03-11 09:25:21 -07:00
Brian Paul
a4a5d7e0dd vega: remove unused pipe var 2011-03-11 09:25:21 -07:00
José Fonseca
530ad1ff6f svga: Propagate discard/unsynchronized flags to the host when doing texture DMAs. 2011-03-11 15:03:21 +00:00
José Fonseca
f0ea6395b6 util: Fix typo in u_upload_flush().
upload->offset is how much we used. upload->size is the whole buffer size.
2011-03-11 11:54:26 +00:00
Nicolas Peninguy
b6c9c78bff r300g: fix alignement for NPOT values in hyperz setup
With 3 pipes cards we need to align with NPOT values. This fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=32945

Signed-off-by: Nicolas Peninguy <nico@lostgeeks.org>
2011-03-11 04:36:37 +01:00
Marek Olšák
8a01cb8793 draw: remove unnecessary flush 2011-03-11 02:02:16 +01:00
Marek Olšák
cb06f180e3 st/vega: remove unnecessary flushes
I don't see a reason we need them.
2011-03-11 02:02:16 +01:00
Marek Olšák
bdf1038940 st/mesa: remove unnecessary flushes
The framebuffer cache flush should be implicit when calling
set_framebuffer_state.

There is no need to flush the command stream either.
2011-03-11 02:02:16 +01:00
Thomas Hellstrom
ded1e315a4 Revert "gallium/svga: Only upload parts of vertexarrays that are actually used"
This reverts commit 6d4e337f38.

The commit is incorrect. I'll rework it. Revert for now.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2011-03-10 23:31:42 +01:00
Daniel Vetter
fb3b712b84 i915g: implement surface clear functions using hw-clear
Tested by temporarily using util_clear even when not using the blitter.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-03-10 23:04:20 +01:00
Daniel Vetter
6ad4a11b3e i915g: make set_framebuffer_state more robust
u_blitter is lazy and doesn't fully clear it's stack-allocated fb.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-03-10 23:04:19 +01:00
Daniel Vetter
6358e6371b i915g: implement hw clear
Benefits:
- spares us a relocation.
- needed for zone rendering (if that ever happens).
- just awesome.

v2: Rename the debug option. Completely disabling the blitter is
required for Y tiling to work, so this option will cover other
code paths in the future.

v3: Implement suggestions by Jakob Bornecrantz.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-03-10 23:04:10 +01:00
Daniel Vetter
8c420db1c4 i915g: blitter handles overlapping blits
No need to assert.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-03-10 22:47:50 +01:00
Daniel Vetter
55d2d7fb3a i915g: enable separate depth/stencil clears
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-03-10 22:47:49 +01:00
Daniel Vetter
9070879a79 i915g: streamline derived state updates of the driver pipeline
Flushing the batch/hw backend doesn't invalidate the derived state.
So kill the unnecessary function calls and add an assert in
emit_hardware_state for paranoia.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-03-10 22:47:48 +01:00
Daniel Vetter
b0dd74aaf7 i915g: don't validate a NULL vbo
With the new clear code this is possible (if the app call glClear
before drawing the first primitive).

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-03-10 22:47:47 +01:00
Brian Paul
7dcf019af2 gallium/util: new polygon stipple utility helper
The polygon stipple fallback does not have to be implemented in the
draw module (it doesn't need window coords, etc).  Drivers can use
this utility and avoid sw vertex fallbacks if pstipple is enabled.
Note: this is WIP and not used by any driver yet.
2011-03-10 09:44:32 -07:00
Brian Paul
0eab3a8a97 glsl: silence warning in printf() with a cast 2011-03-10 09:29:00 -07:00
Brian Paul
76a43c5fba glx: fix null pointer deref in __glXGenerateError()
The gc var would be NULL if called from line 238.  Instead, get
the opcode from __glXSetupForCommand(dpy) as done in other places.
And remove the unused gc parameter.

Fixes a bug reported by "John Doe" on 3/9/2011.

NOTE: This is a candidate for the 7.10 branch.
2011-03-10 08:50:52 -07:00
Thomas Hellstrom
6d4e337f38 gallium/svga: Only upload parts of vertexarrays that are actually used
Make sure we only upload parts of vertex arrays that are actually used
by a draw command.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2011-03-10 14:30:50 +01:00
Dave Airlie
9b7f377635 r600: don't close fd on failed load
This fd gets passed in from outside, closing it causes the X.org server
to crap out when the driver doesn't identify the chipset.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-03-10 12:01:43 +10:00
Eric Anholt
f6ca4a304b intel: Don't complain when getparam fails due to a missing param.
This is an expected behavior when we're testing for the presence of
new kernel features.
2011-03-09 12:54:47 -08:00
Chris Wilson
ea004a3aed i965: Pack the tracked state atoms into separate arrays for prepare/emit.
Improves performance of a hacked-up scissor-many (to reuse a small set
of scissors instead of blowing out the cache, and then to run 100x
more iterations so it actually took some time) by 3.6% +/- 1.2% (n=10)
2011-03-09 10:18:29 -08:00
Christoph Bumiller
caaa7fdd6f nv50: add back initialization of redefine_user_buffer
Got lost in f80c03e187.
2011-03-09 17:26:33 +01:00
Christian König
bb4f2a0f35 r600g: remove some now unneeded code from r600_bc_vtx_build 2011-03-09 14:49:03 +01:00
Christian König
2ed56d3170 r600g: R700+ can do more than 8 tex and vtx clause in one CF inst
Reviewed-by: Henri Verbeet <hverbeet@gmail.com>
2011-03-09 14:49:03 +01:00
Christian König
8dc1dfc9f0 r600g: split R600 and R700 CF generation for VTX and TEX
Reviewed-by: Henri Verbeet <hverbeet@gmail.com>
2011-03-09 14:49:03 +01:00
José Fonseca
8308272291 svga: Add a new winsys entry point to query the hw version. 2011-03-09 13:34:21 +00:00
José Fonseca
d5249b7d89 util: Use PIPE_TRANSFER_DISCARD_WHOLE_RESOURCE in pipe_buffer_write. 2011-03-09 11:17:45 +00:00
Keith Whitwell
05efcee46e util: add ensure_sanity checks, fix a bug
Add ensure_sanity checks.
Fix a bug which caused us to misplace entries adding to a full cache.
2011-03-09 11:17:14 +00:00
Keith Whitwell
20962bf547 util: improve cache collision behaviour
Add linear probing on collisions.

Expand entry array by a fixed scale (currently 2) to help avoid
collisions.

Use a LRU approach to ensure that the number of entries stored in the
cache doesn't exceed the requested size.
2011-03-09 11:16:53 +00:00
Alex Corscadden
d00cbf46cd util: Add remove to util_cache
I need to be able to remove entries from util_cache caches.  This change
enables that functionality.
2011-03-09 11:16:49 +00:00
Alex Corscadden
eb2e8167fa util: Allow util_draw_texquad to draw quads with non-integer coordinates. 2011-03-09 11:16:49 +00:00
José Fonseca
0ffd603e17 wgl: Force framebuffer validation on glViewport. 2011-03-09 09:58:35 +00:00
Thomas Hellstrom
52e598d200 gallium/svga: Don't replace user vertex buffer with uploaded copy
Do that later on when we set up the hwtnl state instead.
This addresses a problem when we drop the uploaded copy due to a vb
size change, it will remain referenced in svga->curr.vb[], and the
new contents of the vb will never be uploaded.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2011-03-09 08:49:33 +01:00
Vinson Lee
c0d3fb4b6c scons: Fix immediate Python exceptions with SCons on SunOS.
The build still fails.
2011-03-08 17:59:57 -08:00
Vinson Lee
67f61199c2 st/python: Add timeout parameter to fence_finish.
This is a follow-up to commit b39bccbd4e.

Fixes Linux SCons build.
2011-03-08 16:18:16 -08:00
Marek Olšák
ac8821ffe2 r300g: handle timeout parameter in fence_finish 2011-03-08 23:52:37 +01:00
Marek Olšák
b39bccbd4e gallium: add timeout parameter to fence_finish
This is a follow-up to the ARB_sync patch for st/mesa and completes
the ARB_sync implementation.
2011-03-08 23:52:37 +01:00
Marek Olšák
5257a6dbc6 st/mesa: implement ARB_sync
The ServerWaitSync implementation matches Intel's driver.

The extension is advertised when pipe_screen::fence_finish is set.
2011-03-08 23:52:37 +01:00
Marek Olšák
5ef807c036 r300g: add LATC support 2011-03-08 23:52:37 +01:00
Marek Olšák
b0ec461954 st/mesa: cleanup checking for signed compressed formats in generate_mipmaps 2011-03-08 23:52:37 +01:00
Marek Olšák
384845f335 st/mesa: add LATC and 3DC support
softpipe passes all tests.
2011-03-08 23:52:37 +01:00
Marek Olšák
23f92c20d7 gallium/util: add LATC support
Again, a lot of code is shared with RGTC.

The layout is UTIL_FORMAT_LAYOUT_RGTC, because LATC is just swizzled RGTC.
2011-03-08 23:52:37 +01:00
Marek Olšák
69f16accd0 mesa: add ATI_texture_compression_3dc
LUMINANCE_ALPHA_LATC2 = LUMINANCE_ALPHA_3DC, so this is easy.

Note that there is no specification for 3DC, just a few white papers
from ATI.
2011-03-08 23:52:37 +01:00
Marek Olšák
7d16e2c0cd mesa: add EXT_texture_compression_latc
The encoding/decoding algorithms are shared with RGTC.
Thanks to some magic with the base format, the RGTC texstore functions work
for LATC too.

swrast passes the related piglit tests besides two things:
- The alpha channel is wrong (it's always 1), however the incorrect alpha
  channel makes some other tests fail too, so I guess it's unrelated to LATC.
- Signed LATC fetches aren't correct yet (signed values are clamped to [0,1]),
  however RGTC has the same problem.

Further testing (with other of my patches) shows that hardware drivers
and softpipe work.

BTW, ETQW uses this extension.
2011-03-08 23:52:37 +01:00
Thomas Hellstrom
12fa91b675 st/mesa: Fix an incorrect user vertex buffer reference
st->user_vb[attr] was always pointing to the same user vb, regardless
of the value of attr. Together with reverting the temporary workaround
for bug 34378, and a fix in the svga driver, this fixes googleearth on svga.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2011-03-08 22:15:50 +01:00
Marek Olšák
ef58598c1c vbo: mark vertex arrays as dirty when re-binding
This fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=34378
2011-03-08 22:14:47 +01:00
Marek Olšák
ff8baec5bc r300/compiler: remove unused variables 2011-03-08 22:13:29 +01:00
Ian Romanick
bdb6a6ef83 glsl: Use insert_before for lists instead of open coding it 2011-03-08 11:47:25 -08:00
Ian Romanick
60f898a90e linker: Add imported functions to the linked IR
Fixes piglit test glsl-function-chain16 and bugzilla #34203.

NOTE: This is a candidate for stable release branches.
2011-03-08 11:47:25 -08:00
Ian Romanick
8bbfbb14ee glsl: Add several function / call related validations
The signature list in a function must contain only ir_function_signature nodes.

The target of an ir_call must be an ir_function_signature.

These were added while trying to debug Mesa bugzilla #34203.
2011-03-08 11:47:25 -08:00
Ian Romanick
2df56b002d glsl: Function signatures cannot have NULL return type
The return type can be void, and this is the case where a `_ret_val'
variable should not be declared.
2011-03-08 11:47:25 -08:00
Christian König
719f07e45a r600g: set start instance correctly 2011-03-08 16:57:47 +01:00
Brian Paul
4a802738b0 swrast: flip the conditionals in shadow_compare4() for readability 2011-03-08 08:31:43 -07:00
Philip Taylor
d9f584e663 swrast: add coord clamping, fix comparisons for shadow testing
This fixes https://bugs.freedesktop.org/show_bug.cgi?id=31159 for swrast
and piglit depth-tex-compare.

NOTE: This is a candidate for the 7.10 branch.

Signed-off-by: Brian Paul <brianp@vmware.com>
2011-03-08 08:31:43 -07:00
Brian Paul
9181a75c4d docs: added Depth format cube textures to GL3.txt list 2011-03-08 08:31:42 -07:00
Marek Olšák
5650a719f0 r300g: decide whether a flush should be asynchronous when calling it
Thread offloading is not sometimes desirable, e.g. when mapping a buffer.
2011-03-08 08:23:29 +01:00
Marek Olšák
6051f26b78 r300g: use pipelined transfers for RGTC textures 2011-03-08 08:17:12 +01:00
Marek Olšák
4dfcf3c4fe r300/compiler: fix equal and notequal shadow compare functions 2011-03-08 07:36:40 +01:00
Marek Olšák
94818d4c6a r300/compiler: detect constants harder 2011-03-08 06:54:14 +01:00
Marek Olšák
4f38261179 r300/compiler: improve the detection of constants for constant folding
Now the expression V==0 generates one instruction instead of two.
2011-03-08 06:37:50 +01:00
Marek Olšák
eb1acd1613 r300/compiler: saturate Z before the shadow comparison
This fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=31159

NOTE: This is a candidate for the 7.9 and 7.10 branches.
2011-03-08 05:13:45 +01:00
Brian Paul
2c1ef65a04 llvmpipe: clamp texcoords in lp_build_sample_compare()
See previous commit for more info.

NOTE: This is a candidate for the 7.10 branch.
2011-03-07 18:59:42 -07:00
Philip Taylor
0eef561a5b softpipe: clamp texcoords in sample_compare()
This fixes http://bugs.freedesktop.org/show_bug.cgi?id=31159 for softpipe
and fixes the piglit depth-tex-compare test.

NOTE: This is a candidate for the 7.10 branch.

Signed-off-by: Brian Paul <brianp@vmware.com>
2011-03-07 18:56:54 -07:00
Marek Olšák
a674ef7814 mesa: return after invalidating renderbuffer 2011-03-07 23:33:36 +01:00
Marek Olšák
fb5d9e1199 st/mesa: fail to alloc a renderbuffer if st_choose_renderbuffer_format fails
This fixes:
  state_tracker/st_format.c:401:st_pipe_format_to_mesa_format:
  Assertion `0' failed.
2011-03-07 23:27:35 +01:00
Marek Olšák
df818d572e mesa: invalidate framebuffer if internal format of renderbuffer is changed
RenderTexture doesn't have to be called in invalidate_rb, I guess.
2011-03-07 23:27:35 +01:00
Brian Paul
f4ca12c4f1 mesa: initialize DummyBufferObject's mutex
The mutex's fields were all zeros.  That's OK on Linux, but not Windows.

NOTE: This is a candidate for the 7.10 branch.
2011-03-07 14:58:39 -07:00
Brian Paul
ce6f16d382 st/mesa: fix incorrect version checking code 2011-03-07 14:58:39 -07:00
Brian Paul
8329f4db61 st/glx: whitespace, 80-column fixes 2011-03-07 14:58:39 -07:00
Brian Paul
51db2045b4 mesa: remove stray _mesa_finish() call in _mesa_CopyPixels()
Leftover debug code from 6364d75008.
2011-03-07 14:01:09 -07:00
Henri Verbeet
0e4750a84d r600g: Simplify some swizzle lookups. 2011-03-07 21:48:21 +01:00
Henri Verbeet
eac50295fc r600g: Constant buffers can contain up to 4096 constants. 2011-03-07 21:48:21 +01:00
Henri Verbeet
a8bde5c47e i915: Only invert wpos when rendering to the system framebuffer. 2011-03-07 21:48:21 +01:00
Henri Verbeet
a99b23752b i915: Derive the gl_fragment_program from i915_fragment_program.
Instead of using the current gl_fragment_program. These aren't necessarily
the same, for example when translate_program() is called by
i915ValidateFragmentProgram().
2011-03-07 21:48:21 +01:00
Henri Verbeet
c3c91a0fe5 glx: Take GLPROTO_CFLAGS into account. 2011-03-07 21:48:20 +01:00
Chris Wilson
6547253bd1 intel: check for miptree allocation failure
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-03-07 10:53:09 +00:00
Chris Wilson
de7678ef52 intel: Add some defense against buffer allocation failure for subimage blits
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-03-07 10:53:05 +00:00
Chris Wilson
f627d429bd intel: Add some defense against bo allocation failure
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-03-07 10:53:00 +00:00
Benjamin Franzke
4f6fbfa0ed egl_dri2: Add attribute map for __DRI_ATTRIB_FRAMEBUFFER_SRGB_CAPABLE
Broken since 6538b5824e.
Thanks to iskren on #wayland for helping on finding this.
2011-03-07 00:32:05 +01:00
Christian König
e0cf8471a1 r600g: use long long integers for instance addr calculation
Using a long for instance addr calculation isn't
big enough on 32bit systems, use a long long int instead.

Thanks to Rafael Monica for fixing this.
2011-03-06 23:37:47 +01:00
Dave Airlie
6538b5824e glx/dri: add initial dri interface for GLX_EXT_framebuffer_sRGB.
This realigns the name of the glx bit to align with the core mesa names.
2011-03-06 20:06:42 +10:00
Dave Airlie
b09b3e5c8f glx: add initial GLX_EXT_framebuffer_sRGB support.
this doesn't bind to drivers yet, just enough to in theory make indirect
work against other servers.

I'm really not sure what the rules for adding extensions to the known_gl_extensions list as it looks to be missing a few. are these GL extensions that have GLX
protocol??

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-03-06 19:56:22 +10:00
José Fonseca
7cb17862c6 pb: Add is_buffer_busy for malloc buffers. 2011-03-06 09:12:58 +00:00
José Fonseca
e1510d4816 st/wgl: No need to initialize OneTimeLock anymore. 2011-03-06 09:12:30 +00:00
José Fonseca
b531b01b70 mapi: _glthread_DECLARE_STATIC_MUTEX is not broken on Windows. 2011-03-06 09:11:59 +00:00
José Fonseca
e640eec9ba trace: Use pipe_static_mutex. 2011-03-06 09:11:13 +00:00
José Fonseca
db6d0d9ebf os: Fix pipe_static_mutex on Windows. 2011-03-06 09:10:38 +00:00
José Fonseca
5e1b31066b graw-gdi: Silence gcc missing initialization warning. 2011-03-06 09:10:03 +00:00
Daniel Vetter
f95892b46a i915g: update TODO
Comments about the deleted stuff:
- openaren hang: likely caused by the vertex corruptions, fixed by Jakob.
- tiling: Y-tiling works with my hw-clear branch. X-tiling works as
  merged to master a while ago (execbuf2 version).

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-03-06 00:39:18 +01:00
Marek Olšák
b6a9675b2f r300g/swtcl: advertise draw_instanced and primitive_restart 2011-03-05 17:41:12 +01:00
Marek Olšák
65482f2c2b r300g: implement instanced arrays 2011-03-05 17:41:11 +01:00
Marek Olšák
95c7881ac8 gallium: split CAP_INSTANCE_DRAWING into INSTANCEID and INSTANCE_DIVISOR
ARB_instanced_arrays is a subset of D3D9.
ARB_draw_instanced is a subset of D3D10.

The point of this change is to allow D3D9-level drivers to enable
ARB_instanced_arrays without ARB_draw_instanced.
2011-03-05 17:40:19 +01:00
Marek Olšák
307408a4f8 r300g: cleanup parameters of draw functions 2011-03-05 16:13:43 +01:00
Christoph Bumiller
533bf171d4 nv50: support the InstanceID system value 2011-03-05 14:53:23 +01:00
Christian König
17b9b757b7 r600g: simplify instance addr calculation
Use MULHI_UINT instead of the more complex
INT_TO_FLT->MUL->TRUNC->FLT_TO_INT
2011-03-05 13:42:51 +01:00
Vinson Lee
19355a461a nvc0: Update SConscript. 2011-03-04 17:15:21 -08:00
Vinson Lee
dbf4970b69 nv50: Update SConscript. 2011-03-04 17:11:35 -08:00
Christian König
fd2409ca27 r600g: fix fragment shader size calculation
bc.ndw is altered in r600_bc_build, respect that
in fragment shader size calculation.
2011-03-05 01:52:44 +01:00
Ian Romanick
09a4ba0fc3 glsl: Process redeclarations before initializers
If an array redeclaration includes an initializer, the initializer
would previously be dropped on the floor.  Instead, directly apply the
initializer to the correct ir_variable instance and append the
generated instructions.

Fixes bugzilla #34374 and piglit tests glsl-{vs,fs}-array-redeclaration.

NOTE: This is a candidate for stable release branches.  0292ffb8 and
8e6cb9fe are also necessary.
2011-03-04 16:33:31 -08:00
Ian Romanick
0292ffb85c glsl: Refactor AST-to-HIR code handling variable initializers 2011-03-04 16:32:37 -08:00
Ian Romanick
8e6cb9fe51 glsl: Refactor AST-to-HIR code handling variable redeclarations 2011-03-04 16:32:37 -08:00
Christoph Bumiller
b0698396dc nv50,nvc0: get format desc for TIC entry from sampler view format
Fixes piglit/tex-srgb.
2011-03-05 00:51:07 +01:00
Christoph Bumiller
1f5d6fc59b nv50,nvc0: share sampler state creation 2011-03-05 00:51:07 +01:00
Christoph Bumiller
e4c968cdbb nv50,nvc0: update the format tables
Removed sampler view support for USCALED/SSCALED, the texture unit
refuses to convert to non-normalized float. The enums are treated
like UNORM.

Removed duplicate format related headers.
2011-03-05 00:51:07 +01:00
Christoph Bumiller
f556b897eb nvc0: use m2mf for resource_copy_region if formats are equal
Which is always the case, but we'll keep the 2D engine blitter
nonetheless.
2011-03-05 00:51:07 +01:00
Christoph Bumiller
4fae7da9a3 nv50,nvc0: fix texture layer issues 2011-03-05 00:51:07 +01:00
Jakob Bornecrantz
9f0acfe138 i915g: Use tgsi_info from fragment shader instead 2011-03-05 00:23:27 +01:00
Daniel Vetter
98b418e56e i915g: use passthough shader for empty fragment programs
The hw doesn't like it - demos/shadowtex is broken. The emitted shader
isn't totally empty though, the depth write fixup gets emitted instead.
Maybe that one is somewhat fishy, too?

Idea for this patch from Jakob Bornecrantz.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-03-04 23:46:20 +01:00
Benjamin Franzke
22d9ae11bc egl_dri2: Fix incompatible vfunc-pointer warning 2011-03-04 16:36:37 -05:00
Benjamin Franzke
e71920929e egl/wayland: Move wayland-egl into a subdir
This hopefully fixes wayland-egl's dependency
resolution for autogenerated wayland-drm headers.
2011-03-04 16:36:37 -05:00
Eric Anholt
1a57717bbe i965: Apply a workaround for the Ironlake "vertex flashing".
This is an awful hack and will hurt performance on Ironlake, but we're
at a loss as to what's going wrong otherwise.  This is the only common
variable we've found that avoids the problem on 4 applications
(CelShading, gnome-shell, Pill Popper, and my GLSL demo), while other
variables we've tried appear to only be confounding.  Neither the
specifications nor the hardware team have been able to provide any
enlightenment, despite much searching.

https://bugs.freedesktop.org/show_bug.cgi?id=29172
Tested by:	Chris Lord <chris@linux.intel.com> (Pill Popper)
Tested by:	Ryan Lortie <desrt@desrt.ca> (gnome-shell)
2011-03-04 12:04:42 -08:00
Marek Olšák
bdb811772f r300g: preliminary implementation of clamping controls 2011-03-04 17:47:56 +01:00
Marek Olšák
10a893106b r300g: implement FP16 alpha test 2011-03-04 17:47:56 +01:00
Marek Olšák
910bac63df r300g: implement blending for some of non-RGBA8 formats
Blending is now fully supported with:
- R8_UNORM
- R8G8_UNORM
- B8G8R8A8_UNORM
- R16G16B16A16_FLOAT (r500-only)

Blending is partially supported (DST_ALPHA not working) with:
- L8A8_UNORM
- I8_UNORM
- B5G5R5A1_UNORM
- B10G10R10A2_UNORM

The other formats can't do blending.
2011-03-04 17:47:56 +01:00
José Fonseca
4a4f6a3901 draw: Silence tgsi_emit_sse2 failed messages. 2011-03-04 16:29:13 +00:00
José Fonseca
6838c9ce74 tgsi: Disable SSE2 code generation.
It's broken now that tgsi_exec_machine::Inputs/Ouputs are pointers.

Temporary if anybody still cares about tgsi_sse2.c. Permanent otherwise.
2011-03-04 14:54:24 +00:00
José Fonseca
c8e904e159 scons: Unbreak mingw cross compilation. 2011-03-04 14:44:39 +00:00
Marek Olšák
ba48811fa8 st/mesa: set PIPE_BIND_RENDER_TARGET for sRGB formats if UNORM is supported
Because the format can be changed to UNORM in a surface.

This fixes:
state_tracker/st_atom_framebuffer.c:163:update_framebuffer_state:
Assertion `framebuffer->cbufs[i]->texture->bind & (1 << 1)' failed.
2011-03-04 14:52:45 +01:00
José Fonseca
5378983417 scons: Get glsl2 and glcpp programs building correctly. 2011-03-04 13:11:49 +00:00
José Fonseca
12d17bcadf glsl/glcpp: Use stdio.h instead of unistd.h. 2011-03-04 12:53:14 +00:00
José Fonseca
f52660c3dc glsl: Define YY_NO_UNISTD_H on MSVC. 2011-03-04 12:49:55 +00:00
José Fonseca
d40b868db5 gallium: Define __func__ on MSVC. 2011-03-04 11:55:36 +00:00
Christoph Bumiller
cf143c1f4d Merge remote branch 'origin/nvc0' 2011-03-04 11:02:10 +01:00
Chris Wilson
9d31138f53 i965: Fix extending VB packets
Computation of the delta of this array from the last had a silly little
bug and ignored any initial delta==0 causing grief in Nexuiz and
friends.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-03-04 09:58:31 +00:00
Chris Wilson
18dd7932c7 i965: Handle URB_FENCE erratum for Broadwater
There is a silicon bug which causes unpredictable behaviour if the
URB_FENCE command should cross a cache-line boundary. Pad before the
command to avoid such occurrences. As this command only applies to
gen4/5, do the fixup unconditionally as the specs do not actually state
for which chip it was fixed (and the cost is negligible)...

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-03-04 09:58:31 +00:00
Chris Wilson
1546291e5b i965: Align index to type size and flush if the type changes
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-03-04 09:58:31 +00:00
Chris Wilson
1c0d09cd4e intel: Add couple of missing gen6 commands to decode
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-03-04 09:58:31 +00:00
Chris Wilson
b93684f5f3 i965: Prevent using a zero sized (or of unknown type) vertex array
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-03-04 09:58:30 +00:00
Dave Airlie
137d44e0f2 r600g: disable tiling by default again.
we still have a lot of corner cases that aren't working.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-03-04 08:47:10 +10:00
José Fonseca
9f3c59a350 tgsi: Update assert.
Elements(mach->Inputs) is wrong now that mach->Inputs is dynamically
allocated.
2011-03-03 19:23:04 +00:00
Kenneth Graunke
09e1bebc25 glcpp: Remove trailing contexts from #if rules.
These are now unnecessary.
2011-03-03 10:42:37 -08:00
Kenneth Graunke
f20656e944 glcpp: Rework lexer to use a SKIP state rather than REJECT.
Previously, the rule deleted by this commit was matched every single
time (being the longest match).  If not skipping, it used REJECT to
continue on to the actual correct rule.

The flex manual advises against using REJECT where possible, as it is
one of the most expensive lexer features.  So using it on every match
seems undesirable. Perhaps more importantly, it made it necessary for
the #if directive rules to contain a look-ahead pattern to make them
as long as the (now deleted) "skip the whole line" rule.

This patch introduces an exclusive start state, SKIP, to avoid REJECTs.
Each time the lexer is called, the code at the top of the rules section
will run, implicitly switching the state to the correct one.

Fixes piglit tests 16384-consecutive-chars.frag and
16385-consecutive-chars.frag.
2011-03-03 10:42:37 -08:00
Kenneth Graunke
b56f30c2b2 glcpp/tests: Update 063-comments.c.expected to match output.
The expected result has been out of sync with what glcpp produces for
some time; glcpp's actual result seems to be correct and is very close to
GCC's cpp.  Updating this will make it easier to catch regressions in
upcoming commits.
2011-03-03 10:42:37 -08:00
Jakob Bornecrantz
4bd27cfecc rbug: Fix depth stencil surface not being sent to the client 2011-03-03 18:29:17 +00:00
José Fonseca
5d0e8beaa2 scons: More tweaks to fix MinGW build. 2011-03-03 16:57:38 +00:00
José Fonseca
dbfbb8cf6d scons: Ensure generated headers are in the include path. 2011-03-03 15:43:18 +00:00
José Fonseca
54d8c5e3c2 scons: Add human friendlier build messages for lex/yacc. 2011-03-03 15:42:58 +00:00
José Fonseca
8987109c27 scons: Always load lex/yacc tool.
lex/yacc is not loaded by default when toolchain is not default either,
e.g., when toolchain=crossmingw.
2011-03-03 15:28:36 +00:00
Christoph Bumiller
3bf92a281b nv50: check grclass instead of chipset for 3D caps 2011-03-03 12:32:40 +01:00
Christoph Bumiller
7048ad62f8 nv50: increase size of shader code bo
512 KiB should be quite enough, but dynamic resize might be nicer.
2011-03-03 12:32:40 +01:00
Ben Skeggs
6b4e3e8941 nouveau: allow pipe driver to define which buffers should start in sysmem
PIPE_BIND_CONSTANT_BUFFER alone was OK for nv50/nvc0, but nv30 will need
to be able to set others on certain chipsets.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-03-03 15:56:20 +10:00
Zou Nan hai
118ecb1a22 i965: SNB GT1 has only 32k urb and max 128 urb entries.
Signed-off-by: Zou Nan hai <nanhai.zou@intel.com>
2011-03-03 10:30:06 +08:00
Kenneth Graunke
2e756f3d6f glsl: Remove unused glcpp/Makefile.am.
This is a remnant of when glsl2 lived in its own repository.
2011-03-02 15:25:49 -08:00
Kenneth Graunke
8be828c3b3 glsl: Remove 'tests' subfolder.
These have long since moved to piglit and aren't useful to have here.
2011-03-02 15:25:49 -08:00
Christian König
8d9ea4c4e7 r600g: correct mega_fetch_count in fetch shader 2011-03-03 00:23:15 +01:00
Zack Rusin
ff2a0faba0 tgsi: defer allocation of huge inputs/outputs until we have a gs 2011-03-02 17:45:22 -05:00
Ian Romanick
d569cc4d44 docs: added news item for 7.9.2 and 7.10.1 releases 2011-03-02 14:37:59 -08:00
Ian Romanick
910820daf4 docs: All links to 7.9.2 and 7.10.1 release notes 2011-03-02 14:37:59 -08:00
Ian Romanick
8010c35852 docs: Import 7.10.1 release notes from 7.10 branch 2011-03-02 14:37:59 -08:00
Ian Romanick
198e9bb5b0 docs: Import 7.9.2 release notes from 7.9 branch 2011-03-02 14:37:59 -08:00
Christoph Bumiller
0c0e996d59 nv50: fix IB index buffer path
Add missing VERTEX_END and treat unaligned offsets correctly.
2011-03-02 22:37:56 +01:00
Christoph Bumiller
fa94f8b209 nv50: fix POINT_COORD_REPLACE_MAP method size
Introduced in 223d98bb8d.
2011-03-02 21:07:33 +01:00
Christoph Bumiller
47a62b1ca1 nv50: primitive restart trick for vertex data through FIFO mode
Also, on nv50 the VERTEX_BEGIN method doesn't follow VERTEX_END,
which was erroneously taken over from nvc0 and is fixed now.
2011-03-02 20:59:54 +01:00
Christoph Bumiller
b8646bc2af nv50: fix depth clamp for disabled primitive clipping 2011-03-02 20:59:53 +01:00
Christoph Bumiller
ddcb90248f nv50: implement independent blend functions for nva3+ and fix cap 2011-03-02 20:59:53 +01:00
Christoph Bumiller
669de7016c nv50: fix tile size calculations 2011-03-02 20:59:53 +01:00
Christoph Bumiller
223d98bb8d nv50: fix point sprite state validation
Wasn't updated if the FP didn't change, and coordinate replacement
wasn't disabled anymore.
2011-03-02 20:59:53 +01:00
Christoph Bumiller
dbdbbce066 nv50: allow accidentally disabled IB index buffers again
Must have sneaked in from debugging.
2011-03-02 20:59:53 +01:00
Christoph Bumiller
908013b737 nv50: apply relocations to shader code
On nv50, branches are absolute, so we need to adjust them according
to the shader's position in the code buffer.
2011-03-02 20:59:53 +01:00
Christoph Bumiller
040ff18a21 nv50: fix wrong miptree tile flags taken over from nvc0 2011-03-02 20:59:53 +01:00
Benjamin Franzke
4ca075ac4f egl_dri2 x11: Workaround device_name xcb-dri2 bug
This commit is basically a copy-over of the fix
Chia-I Wu's commited to wayland:
   http://cgit.freedesktop.org/wayland/wayland-demos/commit/?id=1b6c0ed95
   "Workaround an xcb-dri2 bug.
    xcb_dri2_connect_device_name generated by xcb-proto 1.6 is broken.
    It only works when the length of the driver name is a multiple of 4."
2011-03-02 20:41:38 +01:00
Benjamin Franzke
648a16d079 egl/wayland: build subdirs (wayland-drm) before depend
Autogenerated files need to be generated first.
2011-03-02 20:17:26 +01:00
Marek Olšák
a6314eb47f r300g: require DRM 2.3.0 (kernel 2.6.34)
Running any older kernel is not recommended anyway.
2011-03-02 17:54:36 +01:00
Marek Olšák
f6dbcb92bf r300g: do not use ioctl thread offloading on single-core machines 2011-03-02 17:54:36 +01:00
Brian Paul
8ad821df0a mesa: added gl_program_constants::MaxAddressOffset
See https://bugs.freedesktop.org/show_bug.cgi?id=29418
2011-03-02 09:32:47 -07:00
Brian Paul
41208bf047 mesa: increase INST_INDEX_BITS to 12
For more info see fd.o bug 29418.
2011-03-02 09:20:59 -07:00
Brian Paul
5f4d0cc6bc Revert "mesa: reduce calls to _mesa_test_framebuffer_completeness()"
This reverts commit 1f9a0a4e6e.

This caused trouble with Lightsmark w/ i965 driver and fbo/fbo-blit-d24s8
(see bug 34894).  It's probably something simple but no time to debug now.
2011-03-02 09:11:43 -07:00
Brian Paul
69c6e21ceb vbo: fix error parameter
Spotted by Ian.
2011-03-02 09:10:49 -07:00
Vinson Lee
bbd9616838 r300g: Silence 'control reaches end of non-void function' warning.
Fixes this GCC warning.
r300_hyperz.c: In function 'r300_get_hiz_func':
r300_hyperz.c:65: warning: control reaches end of non-void function
2011-03-02 00:43:09 -08:00
Vinson Lee
0f29d394a4 gallium: Add u_format_rgtc.c to SConscript. 2011-03-01 23:02:50 -08:00
Zou Nan hai
f1824905fa i965: Maxinum the usage of urb space on SNB.
SNB has 64k urb space, we only use piece of them.
      The more urb space we alloc,
      the more concurrent vs threads we can run.
      push the urb space usage to the limit.

Signed-off-by: Zou Nan hai <nanhai.zou@intel.com>
2011-03-02 14:23:17 +08:00
Dave Airlie
e8d061fd74 mesa/st: fix softpipe npot compressed mipmaps.
this fixes fbo-generatemipmap-formats rgtc and s3tc in NPOT mode
with softpipe.

r600g fails to even get level 0 correct so have to look into that
a bit further.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-03-02 16:13:59 +10:00
Dave Airlie
e80bfc8515 softpipe: enable RGTC now that we have u_format support. 2011-03-02 15:30:17 +10:00
Dave Airlie
64f19b90d7 mesa/st: fix generate mipmap for signed compressed formats.
This was always converting to 8-bit per channel unsigned formats,
which isn't suitable for RGTC signed formats, this special cases
those two formats and converts to floats for those.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-03-02 15:30:17 +10:00
Dave Airlie
8d62b2aca9 gallium: add RGTC UNORM support to u_format.
SNORM needs a bit of work in the state tracker in order for mipmap
generation to work I believe.

I'm also not sure that having unorm fetches for an snorm format is
sane.
2011-03-02 15:30:16 +10:00
Dave Airlie
59cae3eee1 rgtc: remove GL types from this file.
I'd like to share this file with gallium u_format stuff.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-03-02 14:33:35 +10:00
Dave Airlie
531c336fa3 rgtc: move the texel fetch into common unsigned/signed code.
This function can be done in the include file also.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-03-02 14:16:39 +10:00
Dave Airlie
fb6ecca0a5 rgtc: fix issues with compressor and signed types.
With signed types we weren't hitting this test however the comment
stating this doesn't happen often doesn't apply when using signed
types since an all 0 block is quite common which isn't abs min or max.

this fixes the limits correctly again also.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-03-02 14:08:59 +10:00
Dave Airlie
521394a204 rgtc: don't try to access off the end of the block.
if the values are all in the last dword, the high bits can be 0,

This fixes a valgrind warning I saw when playing with mipmaps.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-03-02 13:14:34 +10:00
Dave Airlie
5f714c2aaf rgtc: move to using ubyte for fetch instead of chan + fix limit
My previous fix to the byte max was incorrect.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-03-02 13:02:20 +10:00
Marek Olšák
c37e283423 st/mesa: use RGTC for GL_COMPRESSED_RED/RG if possible
With proper fallback formats.
2011-03-02 03:46:27 +01:00
Brian Paul
e118fdc9e2 svga: reduce MAX_DMA_SIZE to 4MB 2011-03-01 17:40:27 -07:00
Brian Paul
8731f0363f vbo: add vbo_always_unmap_buffers()
Drivers can call this function as needed.  It tells the VBO module to
always unmap the current glBegin/glEnd VBO when we flush.  Otherwise
it's possible to be in a flushed state but still have the VBO mapped.
2011-03-01 17:16:53 -07:00
Brian Paul
a2924b488b vbo: generate GL_INVALID_VALUE for bad glVertexAttrib index 2011-03-01 17:16:02 -07:00
Brian Paul
1c9ca21adb i915g: remove extra semicolon 2011-03-01 17:09:15 -07:00
Ian Romanick
3ff4974f22 mesa: Revert most of 3158cc7d because it causes other breakage 2011-03-01 15:57:32 -08:00
Marek Olšák
30600e3dab r300g: accelerate resoure_copy_region for rgtc 2011-03-02 00:54:06 +01:00
Kenneth Graunke
8be58df67a scons: Use Flex and Bison to generate lexer/parser files.
This gets it building again here; I'll leave it up to the SCons
maintainers to make further improvements.
2011-03-01 15:49:29 -08:00
Kenneth Graunke
80ec97af79 glsl: Rename .lpp to .ll and .ypp to .yy.
SCons has built-in support for .ll and .yy, but not .lpp and .ypp. Since
there's no real benefit to using the old names, change them.
2011-03-01 15:49:29 -08:00
Dave Airlie
ff0f36f59d rgtc: fix fetch function limits for signed types 2011-03-02 09:52:53 +10:00
Dave Airlie
8eebd216dd rgtc: fixup mipmap generation
this allows swrast to pass mipmap generation for these formats.
2011-03-02 09:48:40 +10:00
Dave Airlie
01d5d1e80e swrast/rgtc: fix rendering issues introduced when fix constants
The max value was wrong and this showed up in the piglit tests.
2011-03-02 09:41:38 +10:00
Dave Airlie
c7d239c43b r600g: change the cross over point for 2d->1d
this fixes some rendering in the fbo-generatemipmap-formats test on
my rv610.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-03-02 09:30:24 +10:00
Ian Romanick
3158cc7df8 mesa: Fix build breakage caused by c73e6ce 2011-03-01 15:22:43 -08:00
Benjamin Franzke
6b369c4c7c egl: Add EGL_WL_bind_wayland_display 2011-03-01 17:23:50 -05:00
Ian Romanick
654adaabc9 Generate lexer and parser files for tarball creation process 2011-03-01 13:43:12 -08:00
Ian Romanick
6dd0a2ed40 Add generated parser / lexer files to gitignore lists 2011-03-01 13:43:12 -08:00
Ian Romanick
1034284596 mesa: Fix some quirkiness of make tarballs
Among other benefits, parallel makes now work.  Since many people have
parallel builds by default (via MAKEFLAGS environment variable), this
sames some irritation at release time...when there's usually not any
other irritation already.
2011-03-01 13:43:12 -08:00
Ian Romanick
8170684fbe mesa: Remove nonexistent files from distribution list 2011-03-01 13:43:12 -08:00
Ian Romanick
c73e6ce7e2 mesa: Remove files generated by flex and bison from GIT
These files were for the ARB_vertex_program / ARB_fragement_program assembler.
2011-03-01 13:43:12 -08:00
Ian Romanick
cb48207e4b glcpp: Remove files generated by flex and bison from GIT 2011-03-01 13:43:12 -08:00
Ian Romanick
8864b38783 glsl: Remove files generated by flex and bison from GIT 2011-03-01 13:43:12 -08:00
Daniel Vetter
8f9e546fde i915g: kill relocs accouting
No one ever cared. libdrm does dynamic resizing of its reloc-table,
anyway.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-03-01 22:18:11 +01:00
Daniel Vetter
ee7acf6493 i915g: switch to the exact batch space reservation code
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-03-01 22:18:10 +01:00
Daniel Vetter
179cb58795 i915g: split up hw state emission into small atoms
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-03-01 22:18:09 +01:00
Christian König
4c4ab5668c st/mesa: probably handle instanced drawing
Remove the previous workaround for instanced drawing and implement it correctly.
2011-03-01 21:42:16 +01:00
Daniel Vetter
583eb13948 i915g: fix i915_winsys_batchbuffer_write
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-03-01 20:57:57 +01:00
Kenneth Graunke
d1fc920f61 intel: Support glCopyTexImage() from ARGB8888 to XRGB8888.
Nexuiz was hitting a software fallback.
2011-03-01 11:21:48 -08:00
Chris Wilson
faf1ddacfb configure: Bump libdrm requirements
In my last commit I introduced a build dependency upon a new libdrm.
Add the associated autoconf checks. As the headers are part of the core
libdrm, we need to bump that version and so may as well bump the chipset
specific versions simultaneously.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-03-01 18:42:23 +00:00
Marek Olšák
952222e4bf r300g: initialize some r500 PS3 regs 2011-03-01 19:10:30 +01:00
Marek Olšák
a5ee80a264 r300g: document some more DRM 2.8.0 features 2011-03-01 19:10:30 +01:00
Chris Wilson
900a5c91ee i965: Use negative relocation deltas to minimse vertex uploads
With relaxed relocation checking in the kernel, we can specify a
negative delta (i.e. pointing outside of the target bo) in order to fake
a range in a large buffer. We only then need to upload the elements used
and adjust the buffer offset such that they correspond with the indices
used in the DrawArrays.

(Depends on libdrm 0209428b3918c4336018da9293cdcbf7f8fedfb6)

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-03-01 16:34:50 +00:00
Chris Wilson
9fa380ccdc i965: Undo 'continuation of vb packets'
This breaks nexuiz for unknown reason; disable until a true fix can be
found.
2011-03-01 16:33:49 +00:00
Chris Wilson
69b3f24658 i965: Fix uploading of shortened vertex packets
... handle all cases and not just the interleaved upload.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-03-01 16:33:40 +00:00
Chris Wilson
6ddfb322f5 i965: Upload all vertices used
... and take advantage of start_vertex_bias to trim to [min_index,
max_index] where possible (i.e. when we need to upload all arrays).

Fixes half_float_vertex(misc.fillmode.wireframe)

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=34595
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-03-01 09:42:52 +00:00
Thomas Hellstrom
8b145e2302 st/egl: Implement swapbuffer throttling
When doing copy swapbuffers using drm, throttle on outstanding copy operations.
Introduces a new environment variable, EGL_THROTTLE_FENCES that the
user can use to indicate the desired number of outstanding swapbuffers, or
disable throttling using EGL_THROTTLE_FENCES=0.

This can and perhaps should be extended to the pageflip case as well, since
with some hardware pageflips can be pipelined. In case the pageflip syncs, the
throttle operation will be a no-op anyway.

Update copyright notices.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2011-03-01 10:36:19 +01:00
Thomas Hellstrom
c9febff31f st/egl/drm: Rework swapbuffers
Use the pageflip ioctl when available.
Otherwise, or when the backbuffer contents need to be preserved,
fall back to a copy operation.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2011-03-01 10:36:19 +01:00
Thomas Hellstrom
2b079485f6 st/egl: Add a helper to perform a copy swap on a resource surface
The copy swap can be used when we need to preserve the contents of
the back buffer or when there is no way to do native page-flipping.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2011-03-01 10:36:19 +01:00
Thomas Hellstrom
d1e4117355 st/egl: Move the copy context to the native display structure
This makes it usable also for native helpers.
Also add inline functions to access the context and to
uninit the native display structure.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2011-03-01 10:36:18 +01:00
Kenneth Graunke
186d3bc7a3 Revert "i965/fs: Correctly set up gl_FragCoord.w on Sandybridge."
This reverts commit 4a3b28113c, as it
caused a regression on Ironlake (bug #34646).
2011-03-01 01:09:15 -08:00
Dave Airlie
b1ceda5cbd st/dri: one more missing array size
whats one more between friends.

again bnf on irc.
2011-03-01 18:32:33 +10:00
Dave Airlie
02448f2241 st/dri: fix missing array size init.
Init array size to 1,

reported by bnf on irc.
2011-03-01 18:29:24 +10:00
Dave Airlie
2d62e39c62 egl/st: add array size initialisor
reported by bnf on irc.
2011-03-01 18:24:15 +10:00
Ben Skeggs
450aa241bf nouveau: remove nouveau_stateobj.h
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-03-01 17:43:13 +10:00
Ben Skeggs
28eb7214db nvc0: fix a crash on context destruction
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-03-01 17:23:31 +10:00
Ben Skeggs
1ba8e95108 nouveau: ensure vbo_dirty is set when buffer write transfer complete
This introduces a shared nouveau_context struct to track such things.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-03-01 17:23:31 +10:00
Ben Skeggs
96d57722fd nouveau: fix leak of nouveau_mman structs
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-03-01 17:22:53 +10:00
Ben Skeggs
4826cd0f61 nvc0: port to common fence/mm/buffer code
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-03-01 17:22:49 +10:00
Dave Airlie
a44b65312e r600g: add NV_conditional_render support.
This is reliant on a drm patch that I posted on the list + a version bump.

These will appear in drm-next today.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-03-01 15:09:00 +10:00
Dave Airlie
929be6eb95 r600g: start using drm minor version to enable things.
If the drm minor version is > 9 (i.e. whats in drm-next),
we enable s3tc + texture tiling by default now.

this changes R600_FORCE_TILING to R600_TILING which can
be set to false to disable tiling on working drm.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-03-01 15:08:50 +10:00
Ben Skeggs
40d7a87a8e nv50: multiply polygon offset units by 2
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-03-01 14:44:43 +10:00
Ben Skeggs
be68782d9a nv50: sync textures with render targets ourselves
Port of the nvc0 commit doing the same.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-03-01 14:44:43 +10:00
Ben Skeggs
79079141fa nv50: move onto common linear buffer manager
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-03-01 14:44:43 +10:00
Ben Skeggs
5c1c4f8593 nouveau: common linear buffer manager, ported from nv50/nvc0 drivers
nv50_resource is being called nv04_resource now temporarily, to avoid
a naming conflict with nouveau_resource from libdrm.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-03-01 14:44:43 +10:00
Ben Skeggs
cd24fcedec nouveau: create linear gart/vram mman in common screen init
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-03-01 14:44:43 +10:00
Ben Skeggs
3a38a4b0a8 nouveau: fix fence_ref() where fence and *ref are the same fence
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-03-01 14:44:43 +10:00
Ben Skeggs
d6bdf1f6ae nouveau: fix compiler complaint
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-03-01 14:44:42 +10:00
Ben Skeggs
2f30a5bdaa nv50: make mm available as common code
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-03-01 14:44:42 +10:00
Ben Skeggs
7a8ee058a8 nv50: move onto shared fence code
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-03-01 14:44:42 +10:00
Ben Skeggs
5a0915870c nouveau: move nv50/nvc0 fencing to common location, and modify slightly
Modified from original to remove chipset-specific code, and to be decoupled
from the mm present in said drivers.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-03-01 14:44:42 +10:00
Ben Skeggs
48e191f90c nv50-nvc0: set cur_ctx during init if none currently bound
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-03-01 14:44:42 +10:00
Marek Olšák
ea4a19c392 r300g: fix RGTC2_SNORM
ATI engineers have probably chosen those sign bits by a dice roll.
2011-03-01 05:25:33 +01:00
Marek Olšák
66d5de74c4 r300g: reorder parts of translate_texformat 2011-03-01 05:25:33 +01:00
Alex Deucher
1dc204d145 r600g: truncate point sampled texture coordinates
By default the hardware rounds texcoords.  However,
for point sampled textures, the expected behavior is
to truncate.  When we have point sampled textures,
set the truncate bit in the sampler.

Should fix:
https://bugs.freedesktop.org/show_bug.cgi?id=25871

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-02-28 22:01:59 -05:00
Zou Nan hai
6c324777a6 i965: bump VS thread number to 60 on SNB
Signed-off-by: Zou Nan hai <nanhai.zou@intel.com>
2011-03-01 10:39:35 +08:00
Marek Olšák
7a61957424 r300g: fix RGTC1_UNORM and RGTC2_UNORM
Signs don't work the way I'd like...
2011-03-01 03:24:55 +01:00
Dave Airlie
9c16fcc617 rgtc: shared the compressor code between signed/unsigned
No idea why I didn't do it like this the first time, but share
the code like other portions of mesa do using _tmp.h suffix
and some #defines for the types.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-03-01 11:57:51 +10:00
Brian Paul
7b3bec87df vbo: silence unused var warning 2011-02-28 18:34:06 -07:00
Brian Paul
125b4ac7e6 softpipe: remove redundant draw_flush() call
We'll flush after the same-shader comparison.
2011-02-28 18:25:41 -07:00
Brian Paul
e6f3e24330 draw: setup pipe's draw pointer for the aapoint stage
The other draw stages like aaline and pstipple were already doing this.
If the driver used the aapoint stage but not the others it would crash
because of a null pipe->draw pointer.
2011-02-28 18:25:37 -07:00
Brian Paul
b70610b982 mesa: move PBO-related functions into a new file 2011-02-28 18:24:35 -07:00
Brian Paul
7d8db55148 mesa: always generate error in glColorTableParameter[fi]v()
These were only used by GL_SGI_texture_color_table, which is gone now.
2011-02-28 18:24:30 -07:00
Brian Paul
9d20849516 mesa: remove GL_SGI_texture_color_table support
It was only implemented in the swrast driver and probably not used by
any applications.  A modern app would use a dependent/chained texture
lookup in the fragment shader.
2011-02-28 18:24:30 -07:00
Brian Paul
7e161bcf11 svga: add assertions in svga_shader_type() 2011-02-28 18:24:30 -07:00
Brian Paul
c6991433ef mesa: consolidate framebuffer target lookup code 2011-02-28 18:24:25 -07:00
Brian Paul
fec26193fb mesa: remove some old do-nothing code 2011-02-28 18:24:25 -07:00
Brian Paul
1f9a0a4e6e mesa: reduce calls to _mesa_test_framebuffer_completeness()
when updating/validating framebuffer state.  The _Status field is set
to zero when we need to recompute _Status.  Otherwise, it's up to date.
2011-02-28 18:24:25 -07:00
Brian Paul
b0fceae22f mesa: reduce calls to _mesa_test_framebuffer_completeness()
when doing glCopyTex[Sub]Image() and checking the source buffer's
completeness.
We only need to determine FBO completeness when the status is indeterminate.
2011-02-28 18:24:20 -07:00
Brian Paul
ca1b551562 mesa: s/mesaFormat/attFormat/ 2011-02-28 18:23:23 -07:00
Marek Olšák
790c731409 r300g: set the correct HiZ clear value 2011-03-01 01:46:27 +01:00
Marek Olšák
4609be4410 r300g: update derived state before uploading vertex buffers
The function may invoke blitter, which invalidates vertex buffers.
2011-03-01 00:46:58 +01:00
Marek Olšák
fbedd9c73a u_vbuf_mgr: compute user buffer size for instance data from instance_count 2011-03-01 00:46:58 +01:00
Marek Olšák
2f665885cd r300g: fix printing whether Z compression is enabled 2011-03-01 00:46:58 +01:00
Marek Olšák
ebf69f2c50 r300g: disable HiZ permanently if the the depth function is inverted
Instead of temporarily.

The HiZ function (something like a depth function) is a property
of a HiZ buffer and can only be changed during HiZ clears.
2011-03-01 00:46:54 +01:00
Marek Olšák
d99ec708af r300g: fix HiZ memory size computation and deciding when to use HiZ
I removed the HiZ memory management, because the HiZ RAM is too small
and I also did it in hope that HiZ will be enabled more often.

This also sets aligned strides to HIZ_PITCH and ZMASK_PITCH.
2011-03-01 00:23:11 +01:00
Alex Deucher
5f44fab5a6 r600g: add missing evergreen INT_TO_FLT to r600_bc_get_num_operands
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-02-28 17:21:26 -05:00
Dave Airlie
3f600047d9 rgtc: fix void pointer arith.
should fix scons build.
2011-03-01 06:47:00 +10:00
Kenneth Graunke
0a163cf56d glsl: Enable GL_OES_texture_3D extension for ES2. 2011-02-28 10:35:57 -08:00
Kenneth Graunke
eb639349e2 glsl: Use reralloc instead of plain realloc.
Plugs a memory leak when compiling shaders with user defined structures.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
2011-02-28 10:35:40 -08:00
Jerome Glisse
c33e091d17 r600g: indentation fixes
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2011-02-28 13:33:13 -05:00
Marek Olšák
ab824a0722 r300g: initialize SC_SCREENDOOR 2011-02-28 12:43:26 +01:00
Christoph Bumiller
f80c03e187 nv50: replace most of it with nvc0 driver ported to nv50
We'll have to do some unification now to reduce code duplication.
2011-02-28 12:41:09 +01:00
Marek Olšák
d1dbbf7bf4 r300g: disable hyper-z on rs6xx+
It doesn't work.
2011-02-28 12:28:07 +01:00
Vinson Lee
93893139a4 mesa: Add texcompress_rgtc.c to SConscript. 2011-02-27 23:17:49 -08:00
Dave Airlie
e107a3aa08 rgtc: update docs 2011-02-28 13:43:32 +10:00
Dave Airlie
83ebc01c1d mesa/st: add RGTC format support.
this just adds a format check + format conversion.
2011-02-28 13:35:35 +10:00
Dave Airlie
903726d285 swrast: add RGTC support 2011-02-28 13:35:35 +10:00
Dave Airlie
8d47c91985 mesa: Add RGTC texture store/fetch support.
This adds support for the RGTC unsigned and signed
texture storage and fetch methods.

the code is a port of the DXT5 alpha compression code.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-02-28 13:35:34 +10:00
Dave Airlie
e792e79f5a mesa: make_float_temp_image non-static
We need this to do signed stuff for RGTC.
2011-02-28 13:34:25 +10:00
Dave Airlie
e3709c26a6 rgtc: llvmpipe/softpipe refuse RGTC until u_format has support.
So far I haven't implemented the u_format code for these.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-02-28 13:34:25 +10:00
Dave Airlie
0495425dc3 r300g: force swizzles for RGTC
still can't get signed to work
2011-02-28 13:21:44 +10:00
Christian König
96bbc627f3 r600g: implement instanced drawing support 2011-02-28 02:19:39 +01:00
Christian König
bce4f9ac39 st/mesa & v_bug_mgr: two small instanced drawing fixes 2011-02-28 02:19:39 +01:00
Dave Airlie
0a17444133 Revert "r600g: Don't negate result of ABS instruction"
This reverts commit b6d4021393.

This actually breaks gears here on my rv670.
2011-02-28 11:10:35 +10:00
Fabian Bieler
0ab7dcddb3 r600g: Process TRUNC with tgis_op2
TRUNC is neither a scalar instruction nor exclusive to the Trans unit.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-02-28 09:22:16 +10:00
Fabian Bieler
b6d4021393 r600g: Don't negate result of ABS instruction
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-02-28 09:21:41 +10:00
Daniel Vetter
d42c9433b0 i915g: implement cache flushing
With an extremely dumb strategy. But it's the same i915c employs.

Also improve the hw_atom code slightly by statically specifying the
required batch space. For extremely variably stuff (shaders, constants)
it would probably be better to add a new parameter to the hw_atom->validate
function.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-02-27 22:10:46 +01:00
Daniel Vetter
f90fa55347 i915g: buffer validation for blitter
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-02-27 22:03:51 +01:00
Daniel Vetter
342016010a i915g: buffer validation for render state
Also contains the first few bits for hw state atoms.

v2: Implement suggestion by Jakob Bornecrantz.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-02-27 21:57:31 +01:00
Daniel Vetter
3c59b3eb4b i915g/winsys: buffer validation support
v2: Add the batch bo to the libdrm validation lost, for otherwise
libdrm won't take previously used buffers into account.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-02-27 18:49:56 +01:00
Daniel Vetter
e20c3255e2 i915g: add raw batchbuffer dumping in drm winsys
These files can be decoded with intel_dump_decode from the intel-gpu-tools
available at:

http://cgit.freedesktop.org/xorg/app/intel-gpu-tools/

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-02-27 16:32:38 +01:00
Daniel Vetter
f58c11af72 i915g: cleanup static state calculation, part 2
Now also for the DRAW_RECT command

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-02-27 15:58:13 +01:00
Daniel Vetter
beaf039f97 i915g: cleanup static state calculation, part 1
Move it to i915_state_static.c This way i915_emit_state.c only emits
state and doesn't (re)calculate it.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-02-27 15:58:03 +01:00
Kenneth Graunke
a385ac6207 glsl/builtins: Fix return type for textureSize sampler2DArray variants.
A copy and paste error.
2011-02-27 00:44:47 -08:00
Eric Anholt
5f889c5bf5 glx: Adjust the MESA_multithread_makecurrent spec to match implementation.
This came out of discussion at the office today, and we agreed that
solving this for indirect wasn't really interesting, though the
server-side change would be of a similar level of difficulty.
2011-02-26 12:43:15 -08:00
Eric Anholt
dea5e57861 intel: Use the current context rather than last bound context for a drawable.
If another thread bound a context to the drawable then unbound it, the
driContextPriv would end up NULL.

With the previous two fixes, this fixes glx-multithread-makecurrent-2,
despite the issue not being about the multithreaded makecurrent.
2011-02-26 12:43:15 -08:00
Eric Anholt
74cde6505c dri2: Don't call the dri2 flush hook for swapbuffers unless we have a context.
The driver only has one reasonable place to look for its context to
flush anything, which is the current context.  Don't bother it with
having to check.
2011-02-26 12:43:15 -08:00
Eric Anholt
4d01bea808 glx: Don't do the implicit glFlush in SwapBuffers if it's the wrong drawable.
The GLX Spec says you only implicitly glFlush if the drawable being
swapped is the current context's drawable.
2011-02-26 12:43:15 -08:00
Eric Anholt
49d7e48b33 mesa: Add new MESA_multithread_makecurrent extension.
This extension allows a client to bind one context in multiple threads
simultaneously.  It is then up to the client to manage synchronization of
access to the GL, just as normal multithreaded GL from multiple contexts
requires synchronization management to shared objects.
2011-02-26 12:43:15 -08:00
Daniel Vetter
132dc0b6d2 i915g: make dynamic state emission actually lazy
Premature semicolon.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-02-26 21:20:03 +01:00
Jakob Bornecrantz
11f9ec5422 gallivm: Initialize stack values
valgrind gives me a warning with llvmpipe with profile builds but
not debug builds, this seems to fix the issue at least.
2011-02-26 20:13:08 +01:00
Arkadiusz Miskiewicz
99b9019716 glsl/Makefile: Remove builtin_function.cpp if generation fails.
Fixes bug #34346.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-02-26 10:28:00 -08:00
Jakob Bornecrantz
052122a8cd i915g: Handle null constants properly 2011-02-26 15:45:47 +01:00
Daniel Vetter
b8e44f648e i915g: fix null deref in draw_rect emission
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-02-26 15:35:24 +01:00
Daniel Vetter
1df1e0841d i915g: simplify math in constants emission
The old code even falls apart for nr == 0 (which is caught earlier, but)!

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-02-26 15:35:24 +01:00
Jakob Bornecrantz
acc290aff0 i915g: Use the same debug env vars in drm and sw winsys 2011-02-26 15:35:13 +01:00
Jakob Bornecrantz
9a371b938c i915g: Use unchecked writes in sw winsys batchbuffer 2011-02-26 15:29:21 +01:00
Alan Hourihane
53fe5b334e Check for out of memory when creating fence 2011-02-26 10:30:19 +00:00
Jakob Bornecrantz
ca8a91ff7e util: Don't destroy shaders null shaders
Fixes regression from a08e612fd8
2011-02-26 02:32:22 +01:00
Jakob Bornecrantz
a08e612fd8 util: Don't create array texture shaders if the driver doesn't support it 2011-02-26 00:50:52 +01:00
Kenneth Graunke
58f7c9c72e i965/fs: Initial plumbing to support TXD.
This adds the opcode and the code to convert ir_txd to OPCODE_TXD;
it doesn't actually add support yet.
2011-02-25 15:30:45 -08:00
Kenneth Graunke
2830b1ae90 i965/fs: Complete TXL support on gen5+.
Initial plumbing existed to turn the ir_txl into OPCODE_TXL, but it was
never handled.
2011-02-25 15:30:45 -08:00
Kenneth Graunke
4ddd11aad6 i965/fs: Complete TXL support on gen4.
Initial plumbing existed to turn the ir_txl into OPCODE_TXL, but it was
never handled.
2011-02-25 15:30:45 -08:00
Kenneth Graunke
e54d62b896 i965/fs: Use a properly named constant in TXB handling.
The old value, BRW_SAMPLER_MESSAGE_SIMD8_SAMPLE makes it sound like we're
doing a non-bias texture lookup.  It has the same value as the new constant
BRW_SAMPLER_MESSAGE_SIMD8_SAMPLE_BIAS_COMPARE, so there should be no
functional changes.
2011-02-25 15:30:45 -08:00
Kenneth Graunke
a3cd542894 i965: Add #defines for gen4 SIMD8 TXB/TXL with shadow comparison.
From volume 4, page 161 of the public i965 documentation.
2011-02-25 15:30:45 -08:00
Jerome Glisse
b0e8aec5ab gallium/tgsi: shuffle ureg_src structure to work around gcc4.6.0 issue
There is an issue with gcc 4.6.0 that leads to segfault/assert with mesa
due to ureg_src size, reshuffling the structure member to better better
alignment work around the issue.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47893

7.9 + 7.10 candidate

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2011-02-25 12:44:07 -05:00
Jerome Glisse
8e17adfdbd gallium/st: place value check before value is use
7.9 & 7.10 candidate

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2011-02-25 11:49:23 -05:00
Dave Airlie
179ff0551c gallium/util: add 1d/2d mipmap generation support
so far only hw mipmap generation is testing on softpipe,
passes test added to piglit.

this requires another patch to mesa to let array textures mipmaps
even start to happen.
2011-02-25 16:06:15 +10:00
Vinson Lee
eb17802386 scons: Reduce all Cygwin platform names to 'cygwin'.
platform.system in SCons on Cygwin includes the OS version number.
Windows XP - CYGWIN_NT-5.1
Windows Vista - CYGWIN_NT-6.0
Windows 7 - CYGWIN_NT-6.1

Reduce all Cygwin platform variants to just 'cygwin' so anything
downstream can simply use 'cygwin' instead of the different full
platform names.
2011-02-24 19:49:37 -08:00
Dave Airlie
b2413de916 r600g: explicity set sign bits for RGTC 2011-02-25 09:18:42 +10:00
Dave Airlie
c9bca01819 r600g: bc 4/5 or rgtc textures need to be tiled as well.
Make the s3tc upload code more generic.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-02-25 09:18:42 +10:00
Dave Airlie
79ad6f5375 r300g: explicit sign bits on RGTC textures 2011-02-25 09:18:41 +10:00
Kenneth Graunke
e6e5c1f46d i965: Increase Sandybridge point size clamp in the clip state.
255.875 matches the hardware documentation.  Presumably this was a typo.

NOTE: This is a candidate for the 7.10 branch, along with
      commit 2bfc23fb86.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-02-24 11:23:08 -08:00
Neil Roberts
c0ad70ae31 intel: Try using glCopyTexSubImage2D in _mesa_meta_BlitFramebuffer
In the case where glBlitFramebuffer is being used to copy to a texture
without scaling it is faster if we can use the hardware to do a blit
rather than having to do a texture render. In most of the drivers
glCopyTexSubImage2D will use a blit so this patch makes it check for
when glBlitFramebuffer is doing a simple copy and then divert to
glCopyTexSubImage2D.

This was originally proposed as an extension to the common meta-ops.
However, it was rejected as using the BLT is only advantageous for Intel
hardware.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=33934
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-24 16:43:39 +00:00
Christoph Bumiller
11b9f4439c nvc0: fix PointCoord enable in FP header 2011-02-24 17:35:36 +01:00
Christoph Bumiller
d0caaba370 nvc0: change TGSI CMP translation to use slct
Saves us the explicit compare instruction needed with selp.
2011-02-24 17:35:36 +01:00
Christoph Bumiller
b0bf4ee85f nvc0: sprite coord enable is per GENERIC, not overall index 2011-02-24 17:35:36 +01:00
Christoph Bumiller
9dd7d0803e nvc0: fix new_value calls using type instead of size 2011-02-24 17:35:36 +01:00
Christoph Bumiller
1a82971393 nvc0: set local memory usage info in shader header
Before this, l[] access was a no-op.
2011-02-24 17:35:36 +01:00
Christoph Bumiller
b5f04b2008 nvc0: don't fold loads from local memory 2011-02-24 17:35:36 +01:00
Christoph Bumiller
9612139907 nvc0: presin and preex2 can load from const space 2011-02-24 17:35:36 +01:00
Christoph Bumiller
f017483553 nvc0: kick out empty live ranges
They affect overlap tests even though they're actually empty.
2011-02-24 17:35:35 +01:00
Christoph Bumiller
cd47f10c90 nvc0: preemptively insert branch at ENDIF
Might be necessary if a block sneaks in somewhere, like a common
block for moves of phi sources after a loop break.

This is harmless and normally will be removed before emission.
2011-02-24 17:35:35 +01:00
Christoph Bumiller
4377657f8e nvc0: correct allocation of constrained registers
In linear scan we can't allocate multiple values with different
live ranges at the same time to assign them consecutive regs.

Maybe we should just switch to graph coloring for all values ...
2011-02-24 17:35:35 +01:00
Christoph Bumiller
67c7aefea3 nvc0: sync textures with render targets ourselves
Fixes for example piglit/fbo-flushing and nexuiz' bloom effect.
2011-02-24 17:35:35 +01:00
Christoph Bumiller
a6ea37da4b nvc0: improve userspace fencing
Before, there were situations in which we never checked the fences
for completion (some loading screens for example) and thus never
released memory.
2011-02-24 17:35:35 +01:00
Christoph Bumiller
410a13c5ce nvc0: values for undefined outputs must have file GPR 2011-02-24 17:35:35 +01:00
Christoph Bumiller
1579017b08 nvc0: multiply polygon offset units by 2
Wasn't sure if this still was necessary because the piglit test
started to fail at some point on nv50 where we already do this.
2011-02-24 17:35:35 +01:00
Christoph Bumiller
7d8ff54feb nvc0: fix SSG 2011-02-24 17:35:35 +01:00
Christoph Bumiller
88066d62ae nvc0: don't visit target blocks of a loop break multiple times 2011-02-24 17:35:35 +01:00
Christoph Bumiller
3d190e44de nvc0: don't overwrite phi sources at the end of a loop
Except the reference to its own result.
2011-02-24 17:35:35 +01:00
Fabian Bieler
728695b435 gallium/utils: Fix vertex element setup
Check if element was translated per element instead of per buffer.
2011-02-24 15:05:10 +01:00
José Fonseca
369ece1702 svga: Ensure rendertargets and textures are always rebound at every command buffer start.
The svga_update_state() mechanism is inadequate as it will always end up
flushing the primitives before processing the SVGA_NEW_COMMAND_BUFFER
dirty state flag.
2011-02-24 14:00:13 +00:00
Chris Wilson
f19439940c i965: Remember to pack the constant blend color as floats into the batch
Fixes regression from aac120977d.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=34597
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-24 12:59:52 +00:00
Chris Wilson
5ce0f7f109 intel: Reset the buffer offset after releasing reference to packed upload
Fixes oglc/vbo(basic.bufferdata)

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=34603
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-24 12:29:51 +00:00
Chris Wilson
135ccb2dae i965: Unmap the correct pointer after discontiguous upload
Fixes piglit/fbo-depth-sample-compare:

==14722== Invalid free() / delete / delete[]
==14722==    at 0x4C240FD: free (vg_replace_malloc.c:366)
==14722==    by 0x84FBBFD: intel_upload_unmap (intel_buffer_objects.c:695)
==14722==    by 0x85205BC: brw_prepare_vertices (brw_draw_upload.c:457)
==14722==    by 0x852F975: brw_validate_state (brw_state_upload.c:394)
==14722==    by 0x851FA24: brw_draw_prims (brw_draw.c:365)
==14722==    by 0x85F2221: vbo_exec_vtx_flush (vbo_exec_draw.c:389)
==14722==    by 0x85EF443: vbo_exec_FlushVertices_internal (vbo_exec_api.c:543)
==14722==    by 0x85EF49B: vbo_exec_FlushVertices (vbo_exec_api.c:973)
==14722==    by 0x86D6A16: _mesa_set_enable (enable.c:351)
==14722==    by 0x42CAD1: render_to_fbo (in /home/ickle/git/piglit/bin/fbo-depth-sample-compare)
==14722==    by 0x42CEE3: piglit_display (in /home/ickle/git/piglit/bin/fbo-depth-sample-compare)
==14722==    by 0x42F508: display (in /home/ickle/git/piglit/bin/fbo-depth-sample-compare)
==14722==  Address 0xc606310 is 0 bytes after a block of size 18,720 alloc'd
==14722==    at 0x4C244E8: malloc (vg_replace_malloc.c:236)
==14722==    by 0x85202AB: copy_array_to_vbo_array (brw_draw_upload.c:256)
==14722==    by 0x85205BC: brw_prepare_vertices (brw_draw_upload.c:457)
==14722==    by 0x852F975: brw_validate_state (brw_state_upload.c:394)
==14722==    by 0x851FA24: brw_draw_prims (brw_draw.c:365)
==14722==    by 0x85F2221: vbo_exec_vtx_flush (vbo_exec_draw.c:389)
==14722==    by 0x85EF443: vbo_exec_FlushVertices_internal (vbo_exec_api.c:543)
==14722==    by 0x85EF49B: vbo_exec_FlushVertices (vbo_exec_api.c:973)
==14722==    by 0x86D6A16: _mesa_set_enable (enable.c:351)
==14722==    by 0x42CAD1: render_to_fbo (in /home/ickle/git/piglit/bin/fbo-depth-sample-compare)
==14722==    by 0x42CEE3: piglit_display (in /home/ickle/git/piglit/bin/fbo-depth-sample-compare)
==14722==    by 0x42F508: display (in /home/ickle/git/piglit/bin/fbo-depth-sample-compare)

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=34604
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-24 10:58:22 +00:00
Chris Wilson
a2029a78c3 intel: Protect against waiting on a NULL render target bo
If we fall back to software rendering due to the render target being
absent (GPU hang or other error in creating the named target), then we
do not need to nor should we wait upon the results.

Reported-by: Magnus Kessler <Magnus.Kessler@gmx.net>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=34656
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-24 10:12:37 +00:00
Dave Airlie
69d969e8fa r600g: EXT_texture_array support.
This adds EXT_texture_array support to r600g, it passes the piglit
array-texture test but I suspect may not be complete.

It currently requires a kernel patch to fix the CS checker to allow
these, so you need to use R600_ARRAY_TEXTURE=true for now
to enable them.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-02-24 13:26:28 +10:00
Dave Airlie
13f5a4d316 st/mesa: treat 1D ARRAY upload like a depth or 2D array upload.
This is because the HW doesn't always store a 1D array like a
2D texture, it more likely stores it like 2D texture (i.e.
alignments etc).

This means we upload each slice separately and let the driver
work out where to put it.

this might break nvc0 as I can't test it, I have only nv50 here.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-02-24 13:26:16 +10:00
Vinson Lee
100cd214e3 scons: Fix Cygwin platform names.
Fixes immediate Python exceptions with SCons on Cygwin.
2011-02-23 18:21:14 -08:00
Jakob Bornecrantz
8fb0ecd0cf i915g: Lazy emit dynamic state 2011-02-24 00:26:02 +00:00
Jakob Bornecrantz
b9baad2aff i915g: Lazy emit immediate state 2011-02-24 00:26:02 +00:00
Jakob Bornecrantz
69cfc16cb6 i915g: Disable LIS7 state updates for now 2011-02-24 00:26:02 +00:00
Jakob Bornecrantz
42b8b2be85 i915g: Clean up in i915_state_immediate 2011-02-24 00:26:02 +00:00
Jakob Bornecrantz
481fad1552 i915g: Remove outdated comment 2011-02-24 00:26:02 +00:00
Jakob Bornecrantz
fbd681f1a0 i915g: Use dump function in sw winsys 2011-02-24 00:26:02 +00:00
Jakob Bornecrantz
fc77dee0bd i915g: Enable mirror repeat wrap mode 2011-02-24 00:26:02 +00:00
Jakob Bornecrantz
4407e5078f i915g: Always set vbo to flush on flushes
Reported-by Chris Wilson <chris@chris-wilson.co.uk>
2011-02-24 00:26:02 +00:00
Chris Wilson
671018aa99 intel: gen3 is particular sensitive to batch size
... and prefers a small batch whereas gen4+ prefer a large batch to
carry more state.

Tuning using openarena/padman indicate that a batch size of just 4096 is
best for those cases.

Bugzilla: https://bugs.freedesktop.org/process_bug.cgi
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-23 23:11:26 +00:00
Chris Wilson
19ac5fa50d i915: And remember assign the new value to the state reg...
Fixes regression from 298ebb78de.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=34589
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-23 22:10:43 +00:00
Tom Fogal
4484297505 Fix GLX_USE_TLS define.
It was only getting set in the case of DRI drivers.
2011-02-23 10:40:26 -07:00
Fabian Bieler
0ed5bf668d r600g: Request DWORD aligned vertex buffers.
The spec says that the offsets in the vertex-fetch instructions need to be byte-aligned and makes no specification with regard to the required alignment of the offset and stride in the vertex resource constant register.

However, testing indicates that all three values need to be DWORD aligned.
2011-02-23 11:42:32 -05:00
Wiktor Janas
b65e2195c4 st/mesa: fix computing the lowest address for interleaved attribs
Ptr can be very well NULL, so when there are two arrays, with one having
offset 0 (and thus NULL Ptr), and the other having a non-zero offset,
the non-zero value is taken as minimum (because of !low_addr ? start ...).
On 32-bit systems, this somehow works. On 64-bit systems, it leads to crashes.

Signed-off-by: Marek Olšák <maraeo@gmail.com>
2011-02-23 15:19:37 +01:00
Brian Paul
6d1f28d6c0 vbo: added vbo_check_buffers_are_unmapped() debug function 2011-02-22 14:32:37 -07:00
Brian Paul
bcd017f16f vbo: removed unused #defines, add comments 2011-02-22 14:23:50 -07:00
Brian Paul
eb24a5a9be mesa: move comment, change debug code 2011-02-22 13:37:30 -07:00
Brian Paul
d7fcb2ac81 vbo: simplify NeedFlush flag clearing 2011-02-22 13:31:09 -07:00
Brian Paul
d8aebc4e4b vbo: use ctx intstead of exec->ctx 2011-02-22 13:24:56 -07:00
Brian Paul
cbe47a2459 r300g: fix missing initializers warning 2011-02-22 12:47:18 -07:00
Brian Paul
7898d2ae16 i915g: remove extra semicolons 2011-02-22 12:47:18 -07:00
Andy Skinner
90e227f079 xlib: pass Display pointer to XMesaGarbageCollect()
Fixes an issue when different displays are used on different threads.

Signed-off-by: Brian Paul <brianp@vmware.com>
2011-02-22 12:47:17 -07:00
Kenneth Graunke
2bfc23fb86 i965: Increase Sandybridge point size clamp.
255.875 matches the hardware documentation.  Presumably this was a typo.

Found by inspection.  Not known to fix any issues.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-02-22 10:52:45 -08:00
Kenneth Graunke
4a3b28113c i965/fs: Correctly set up gl_FragCoord.w on Sandybridge.
pixel_w is the final result; wpos_w is used on gen4 to compute it.

NOTE: This is a candidate for the 7.10 branch.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-02-22 10:52:44 -08:00
Kenneth Graunke
df2aef0e19 i965/fs: Refactor control flow stack handling.
We can't safely use fixed size arrays since Gen6+ supports unlimited
nesting of control flow.

NOTE: This is a candidate for the 7.10 branch.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-02-22 10:52:44 -08:00
Kenneth Graunke
2c2686b912 i965/fs: Avoid register coalescing away gen6 MATH workarounds.
The code that generates MATH instructions attempts to work around
the hardware ignoring source modifiers (abs and negate) by emitting
moves into temporaries.  Unfortunately, this pass coalesced those
registers, restoring the original problem.  Avoid doing that.

Fixes several OpenGL ES2 conformance failures on Sandybridge.

NOTE: This is a candidate for the 7.10 branch.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-02-22 10:52:44 -08:00
Kenneth Graunke
72cd7e87d3 i965/fs: Apply source modifier workarounds to POW as well.
Single-operand math already had these workarounds, but POW (the only two
operand function) did not.  It needs them too - otherwise we can hit
assertion failures in brw_eu_emit.c when code is actually generated.

NOTE: This is a candidate for the 7.10 branch.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-02-22 10:52:44 -08:00
Kenneth Graunke
3e91070ea8 i965: Fix shaders that write to gl_PointSize on Sandybridge.
gl_PointSize (VERT_RESULT_PSIZ) doesn't take up a message register,
as it's part of the header.  Without this fix, writing to gl_PointSize
would cause the SF to read and use the wrong attributes, leading to all
kinds of random looking failure.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-02-22 10:52:44 -08:00
José Fonseca
c6cedd43fe mesa: Avoid undeclared ffs function warning on mingw. 2011-02-22 14:59:09 +00:00
José Fonseca
7aeb610fe1 gallium: s/PIPE_TRANSFER_CPU_READ/PIPE_TRANSFER_READ/ in comments. 2011-02-22 14:14:45 +00:00
José Fonseca
0562f44625 gallium/docs: Update PIPE_TRANSFER_xx docs. Reformat to use definitions. 2011-02-22 14:14:22 +00:00
Keith Whitwell
fad8497d3b gallium: new transfer flag: DISCARD_WHOLE_RESOURCE 2011-02-22 14:13:07 +00:00
Marek Olšák
695cdee678 st/mesa: fix crash when using both user and vbo buffers with the same stride
If two buffers had the same stride where one buffer is a user one and
the other is a vbo, it was considered to be one interleaved buffer,
resulting in incorrect rendering and crashes.

This patch makes sure that the interleaved buffer is either user or vbo,
not both.
2011-02-20 22:16:22 +01:00
Marek Olšák
7942e6a5ae st/mesa: fix crash when DrawBuffer->_ColorDrawBuffers[0] is NULL
This fixes the game Tiny and Big.
2011-02-20 22:16:22 +01:00
Chris Wilson
3adc108b4a i965: Trim the interleaved upload to the minimum number of vertices
... should have no impact on a properly formatted draw operation.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-22 11:24:47 +00:00
Chris Wilson
b4cbd2b312 i965: Reinstate max-index paranoia
Don't trust the applications not to reference beyond the end of the
vertex buffers.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-22 11:24:45 +00:00
Chris Wilson
3377faffcd i965: Zero the offset into the vbo when uploading non-interleaved
Fixes regression from 559435d915.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-22 11:24:34 +00:00
Jakob Bornecrantz
94ccc31ba4 st/dri: Track drawable context bindings
Needs to track this ourself since because we get into a race condition with
the dri_util.c code on make current when rendering to the front buffer.

This is what happens:
Old context is rendering to the front buffer.

App calls MakeCurrent with a new context. dri_util.c sets
drawable->driContextPriv to the new context and then calls the driver make
current. st/dri make current flushes the old context, which calls back into
st/dri via the flush frontbuffer hook. st/dri calls dri loader flush
frontbuffer, which calls invalidate buffer on the drawable into st/dri.

This is where things gets wrong. st/dri grabs the context from the dri
drawable (which now points to the new context) and calls invalidate
framebuffer to the new context which has not yet set the new drawable as its
framebuffers since we have not called make current yet, it asserts.
2011-02-20 16:31:48 +01:00
Eric Anholt
9e872a5865 i965: Fix VB packet reuse when offset for the new buffer isn't stride aligned.
Fixes regression in scissor-stencil-clear and 5 other tests.
2011-02-21 16:36:09 -08:00
Brian Paul
12f25eb6d5 Revert "mesa: convert macros to inline functions"
This reverts commit e9ff76aa81.

Need to use macros so __FUNCTION__ reports the caller.
2011-02-21 17:01:00 -07:00
Brian Paul
e2d108ec82 st/mesa: need to translate clear color according to surface's base format
When clearing a GL_LUMINANCE_ALPHA buffer, for example, we need to convert
the clear color (R,G,B,A) to (R,R,R,A).  We were doing this for texture border
colors but not renderbuffers.  Move the translation function to st_format.c
and share it.

This fixes the piglit fbo-clear-formats test.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
2011-02-21 16:58:42 -07:00
Brian Paul
c966c6980c st/mesa: fix the default case in st_format_datatype()
Part of the fix for piglit fbo-clear-formats

NOTE: This is a candidate for the 7.9 and 7.10 branches.
2011-02-21 16:58:42 -07:00
Daniel Vetter
55a3c35243 i915g: add some throttling
Intel classic drivers switched to this, too, so it must be good.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-02-21 23:42:54 +00:00
Daniel Vetter
1e966636d0 i915g: s/bool/boolean/ style-fixup in winsys
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-02-21 23:42:53 +00:00
Jakob Bornecrantz
593ba7b05b i915g: Fix warning 2011-02-21 23:42:53 +00:00
Jakob Bornecrantz
43e6fe5549 i915g: Add option to lie about caps 2011-02-21 23:42:53 +00:00
Jakob Bornecrantz
27b49e91c9 i915g: Move debug fields to screen 2011-02-21 23:42:53 +00:00
Jakob Bornecrantz
fe6800a1bb i915g: Use debug get once options 2011-02-21 23:42:53 +00:00
Jakob Bornecrantz
3c74ecf687 i915g: Rework texture tiling a bit 2011-02-21 23:42:53 +00:00
Jakob Bornecrantz
e7e1fd057e i915g: Anisotropic filtering works 2011-02-21 23:42:53 +00:00
Jakob Bornecrantz
a641766576 i915g: TODO about point sprites 2011-02-21 23:42:53 +00:00
Jakob Bornecrantz
e7cdcefbee i915g: TODO about untested code hidden behind caps
Should be fairly easy to test and fix since you can look at
the code in the classic driver.
2011-02-21 23:42:53 +00:00
Jakob Bornecrantz
e3c9bf1a67 i915g: Reorg caps 2011-02-21 23:42:53 +00:00
Brian Paul
7dbafea860 st/mesa: fix incorrect texture size allocation in st_finalize_texture()
If finalizing a non-POW mipmapped texture with an odd-sized base texture
image we were allocating the wrong size of gallium texture (off by one).
Need to be more careful about computing the base texture image size.

This fixes https://bugs.freedesktop.org/show_bug.cgi?id=34463
2011-02-21 15:15:53 -07:00
Brian Paul
4cdcec08d1 st/mesa: refactor guess_and_alloc_texture() code 2011-02-21 15:15:53 -07:00
Brian Paul
51f9713e39 st/mesa: fix mipmap generation for non-POW textures
This is part of the fix for https://bugs.freedesktop.org/show_bug.cgi?id=34463
2011-02-21 15:15:53 -07:00
Brian Paul
e9ff76aa81 mesa: convert macros to inline functions 2011-02-21 15:15:53 -07:00
Brian Paul
da9adb9613 vbo: more comments 2011-02-21 15:15:52 -07:00
Brian Paul
6f027ba20d vbo: make vbo_exec_FlushVertices_internal() static 2011-02-21 15:15:52 -07:00
Brian Paul
bbd756e824 vbo: remove old debug code, add comments 2011-02-21 15:15:52 -07:00
Brian Paul
7cba2df4a6 vbo: rename, document function params 2011-02-21 15:15:52 -07:00
Brian Paul
f0c8e7c327 vbo: comments 2011-02-21 15:15:52 -07:00
Brian Paul
0ba2810e47 vbo: replace assert(0) with proper assertions 2011-02-21 15:15:52 -07:00
Brian Paul
ae4b6e04cd vbo: rename some vars, add new comments, fix formatting, etc. 2011-02-21 15:15:52 -07:00
Brian Paul
8b2598d000 vbo: use ctx instead of exec->ctx 2011-02-21 15:15:52 -07:00
Brian Paul
f9e1542286 radeon: add default switch case to silence unhandled enum warning 2011-02-21 15:15:52 -07:00
Ian Romanick
497baf4e4a Use C-style system headers in C++ code to avoid issues with std:: namespace 2011-02-21 13:07:29 -08:00
Chris Wilson
5a1fbf0f70 intel: Fix insufficient integer width for upload buffer offset
I was being overly miserly and gave the offset of the buffer into the bo
insufficient bits, distracted by the adjacency of the buffer[4096].

Ref: https://bugs.freedesktop.org/show_bug.cgi?id=34541
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 20:58:09 +00:00
José Fonseca
dcb21d8b1c svga: Remove some remaining fake S3TC rendering support. 2011-02-21 18:36:51 +00:00
Chris Wilson
a43f20e069 i965: Remove spurious duplicate ADVANCE_BATCH
... a leftover from a bad merge.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 16:02:26 +00:00
Chris Wilson
2c6793fb6b i915: Emit a single relocation per vbo
Reducing the number of relocations has lots of nice knock-on effects,
not least including reducing batch buffer size, auxilliary array sizes
(vmalloced and copied into the kernel), processing of uncached
relocations etc.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 13:04:46 +00:00
Chris Wilson
298ebb78de i915: Suppress emission of redundant stencil updates
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 13:04:46 +00:00
Chris Wilson
7c97e288fb i915: Separate BLEND from general context state.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 13:04:46 +00:00
Chris Wilson
4f82585e27 i915: Only flag context changes if the actual state is changed
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 13:04:45 +00:00
Chris Wilson
0b0cad38c5 i915: suppress repeated sampler state emission
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 13:04:41 +00:00
Chris Wilson
87641cffd9 i915: Eliminate redundant CONSTANTS updates
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 12:59:37 +00:00
Chris Wilson
41260a9bf6 i965: Use compiler builtins when available
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 12:59:37 +00:00
Chris Wilson
8ea6e98c7b i965: Micro-optimise check_state
Replace the intermediate tests due to the logical or with the bitwise
or.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 12:59:37 +00:00
Chris Wilson
50ade6ea69 intel: use throttle ioctl for throttling
Rather than waiting on the first batch after the last swapbuffers to be
retired, call into the kernel to wait upon the retirement of any request
less than 20ms old. This has the twofold advantage of (a) not blocking
any other clients from utilizing the device whilst we wait and (b) we
attain higher throughput without overloading the system.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 12:59:37 +00:00
Chris Wilson
46131a824f i965: Remove unused 'next_free_page' member
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 12:59:36 +00:00
Chris Wilson
57ca0803b3 intel: Skip the flush before read-pixels via blit
As we will flush when reading the return values of the blit, we can forgo
the earlier flush.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 12:59:36 +00:00
Chris Wilson
c625aa19cb intel: extend current vertex buffers
If the next vertex arrays are a (discontiguous) continuation of the
current arrays, such that the new vertices are simply offset from the
start of the current vertex buffer definitions we can reuse those
defintions and avoid the overhead of relocations and invalidations.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 12:59:36 +00:00
Chris Wilson
a07e481179 intel: Use specified alignment for writes into the upload buffer
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 12:59:36 +00:00
Chris Wilson
d9e591391d i965: Clean up brw_prepare_vertices()
Use a temporary glarray variable to replace the numerous input->glarray.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 12:59:36 +00:00
Chris Wilson
3630d5b69a intel: combine short memcpy using a temporary allocated buffer
Using a temporary buffer for large discontiguous uploads into the common
buffer and a single buffered upload is faster than performing the
discontiguous copies through a mapping into the GTT.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 12:59:36 +00:00
Chris Wilson
dfc6c96e5c i965: upload normal arrays as interleaved
Upload the non-vbo arrays into a single interleaved buffer object, and
so need to just emit a single vertex buffer relocation.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 12:59:35 +00:00
Chris Wilson
94d73d700e i965: interleaved vbo
If the user passed in several arrays interleaved in the same vbo, only
emit a single vertex buffer and relocation.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 12:59:35 +00:00
Chris Wilson
559435d915 i965: emit one vb packet per vbo
Track reuse of the vertex buffer objects and so minimise the number of
vertex buffers used by the hardware (and their relocations).

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 12:59:35 +00:00
Chris Wilson
abb5109756 i965: upload transient indices into the same discontiguous buffer
As we now pack the indices into a common upload buffer, we can reuse a
single CMD_INDEX_BUFFER packet and translate each invocation with a
start vertex offset.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 12:59:35 +00:00
Chris Wilson
60bb3e5614 i965: suppress repeat-emission of identical vertex elements
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 12:59:35 +00:00
Chris Wilson
aac120977d i965: Move repeat-instruction-suppression to batchbuffer core
Move the tracking of the last emitted instructions into the core
batchbuffer routines and take advantage of the shadow batch copy to
avoid extra memory allocations and copies.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 12:59:35 +00:00
Chris Wilson
8d68a90e22 intel: use pwrite for batch
It's faster. Not only is the memcpy more efficiently performed in the
kernel (making up for the system call overhead), but by not using mmap
we remove the greater overhead of tracking the vma of every batch.

And it means we can read back from the batch buffer without incurring
the cost of a uncached read through the GTT.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 12:59:35 +00:00
Chris Wilson
3f55683927 i965: drop state_bo references to batch_bo
As we use state relocations and we know that all the state belongs to
the same bo, we can drop the multiple references to the same bo.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 12:59:34 +00:00
Chris Wilson
1be3764dbe i965: directly write wm state to batch
As we write directly into the batch in system memory, we do not need to
write first to the stack (as was to avoid read back through the GTT)

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 12:59:34 +00:00
Chris Wilson
df156549e7 i965: write cc straight to batch
As we write directly into the batch in system memory, we do not need to
write first to the stack (as was to avoid read back through the GTT)

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 12:59:34 +00:00
Chris Wilson
f29606598e i965: switch gen6 to use its own cc state bo
In preparation for a greater change, use the color_calc_state_bo already
provisioned for this purpose.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 12:59:34 +00:00
Chris Wilson
8a9e67b8df intel: Buffered upload
Rather than performing lots of little writes to update the common bo
upon each update, write those into a static buffer and flush that when
full (or at the end of the batch). Doing so gives a dramatic performance
improvement over and above using mmaped access.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 12:59:34 +00:00
Chris Wilson
40ee15407a intel: Replace the bo for a complete update
Rather than performing a blit to completely overwrite a busy bo, simply
discard it and create a new one with the fresh data.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 12:59:34 +00:00
Chris Wilson
abb37861d9 i965: Combine vb upload buffer with the general upload buffer
Reuse the new common upload buffer for uploading temporary indices and
rebuilt vertex arrays.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 12:59:34 +00:00
Chris Wilson
e476e12220 intel: Pack dynamic draws together
Dynamic arrays have the tendency to be small and so allocating a bo for
each one is overkill and we can exploit many efficiency gains by packing
them together.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 12:59:34 +00:00
Chris Wilson
d0809d7b15 intel: Use system memory for DYNAMIC_DRAW source objects
Dynamic draw buffers are used by clients for temporary arrays and for
uploading normal vertex arrays. By keeping the data in memory, we can
avoid reusing active buffer objects and reallocate them as they are
changed. This is important for Sandybridge which can not issue blits
within a batch and so ends up flushing the batch upon every update, that
is each batch only contains a single draw operation (if using dynamic
arrays or regular arrays from system memory).

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 12:59:34 +00:00
Chris Wilson
45ba7afbd1 i965: Trim the trailing NOOP from 3DSTATE_INDEX_BUFFER
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 12:59:33 +00:00
Chris Wilson
13bab58f04 i965: Fallback on encountering a NULL render buffer
Following a GPU hang, or other error, the render target is not likely to
have an allocated BO and so we must fallback to avoid using it.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=32534
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 12:59:33 +00:00
Vinson Lee
8033700814 i915g: s/__func__/__FUNCTION__/ 2011-02-20 21:23:45 -08:00
Daniel Vetter
c0122daf10 i915g: kill remnants of mmapped batchbuffer support
We're using bo_subdata.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-02-21 00:50:16 +01:00
Jakob Bornecrantz
fa186804a6 i915g: Add winsys/i915/sw to scons build 2011-02-21 00:50:16 +01:00
Jakob Bornecrantz
20ff6a2752 i915g: Fix void ptr arith 2011-02-21 00:50:16 +01:00
Jakob Bornecrantz
ec3c5ac592 i915g: Add dummy flush_frontbuffer 2011-02-21 00:50:16 +01:00
Jon TURNEY
aa6a5cf1d5 Fix --enable-shared-glapi configure option
Fix a typo which meant that --enable-shared-glapi didn't actually cause a shared glapi to be built

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2011-02-20 12:53:42 -07:00
Chia-I Wu
bf0c56522e egl_dri2: Return NULL when xcb_get_geometry_reply fails.
This should fix bug #33946.
2011-02-20 12:26:31 -07:00
José Fonseca
91ea60395e scons: Add aliases for the llvmpipe unit tests.
Now one can simply do

  scons lp_test_format
2011-02-19 10:56:05 +00:00
José Fonseca
57d4e922a6 gallivm: Use simple scaling plus casting in more unorm->float cases. 2011-02-19 10:56:05 +00:00
Kenneth Graunke
b1002e4aa5 glsl: Remove $(PWD) from Makefile in favor of .
Hopefully should fix bug #34468.
2011-02-19 00:06:00 -08:00
Marek Olšák
0b436cf511 r300g: fix a possible race when counting contexts
Atomics aren't sufficient here.
2011-02-19 00:17:27 +01:00
Marek Olšák
e9e5380f22 r300g: fix invalid dereference in winsys
radeon_bo_unref may destroy the buffer, so call it after p_atomic_dec, not before.
2011-02-19 00:06:52 +01:00
José Fonseca
e16e70610c svga: Fix NULL dereference.
Probably introduced with the surface view move from screen to context.
2011-02-18 19:03:43 +00:00
Brian Paul
7ea729a185 vbo: add debug code to verify that buffers are unmapped before drawing 2011-02-18 10:34:25 -07:00
Brian Paul
6364d75008 mesa: MESA_VERBOSE logging for glRead/Draw/CopyPixels, glBlitFramebuffer 2011-02-18 10:34:25 -07:00
Brian Paul
633c9fcf78 st/mesa: set renderbuffer _BaseFormat in a few places
NOTE: This is a candidate for the 7.9 and 7.10 branches
2011-02-18 10:28:27 -07:00
Brian Paul
09f14a6086 st/mesa: check buffer orientation in blit_copy_pixels()
Can't invert the region if copying between surfaces with different
orientations.
2011-02-18 10:24:41 -07:00
José Fonseca
0ced789a0b svga: Ensure pending drawing commands other surface operations are emitted before DMAs.
This behavior was last when moving the transfers to the contexts.

This fixes several piglit failures, which were reading the color renderbuffer
before the draw operations were emitted.
2011-02-18 16:43:59 +00:00
José Fonseca
f9b4867846 svga: Cannot use negate or abs on source to dsx/dsy instructions. 2011-02-18 16:43:44 +00:00
José Fonseca
0cb6329e89 svga: Ensure SWTNL is created after HWTNL.
Matches the internal driver layering, and prevents null svga->hwtnl
dereferencing from inside the swtnl.
2011-02-18 16:43:40 +00:00
José Fonseca
15c3e21097 svga: Ensure LRP's restrictions are observed in all uses.
The dst reg must be a temporary, and not be the same as src0 or src2.
2011-02-18 16:43:38 +00:00
José Fonseca
965ab5fed3 svga: Preserve src swizzles in submit_op2/3/4.
Several opcodes require scalar swizzle, and this requirement was
being was not being observed when creating temporaries for other reasons.
2011-02-18 16:43:36 +00:00
Marek Olšák
fd8d4b32ed r300g: remove tracking whether vertex buffers need to be validated
This was getting hard to maintain and didn't really bring any real benefits.
Instead, validate buffers when the vertex array state is dirty.
2011-02-18 16:15:03 +01:00
Marek Olšák
bb46eeade3 st/mesa: fix geometry corruption by always re-binding vertex arrays
This is a temporary workaround. It fixes sauerbrauten with shaders enabled.

I guess we might be changing vertex attribs somewhere and not updating
the appropriate dirty flags, therefore we can't rely on them for now.
Or maybe we need to make this state dependent on some other flags too.

More info:
https://bugs.freedesktop.org/show_bug.cgi?id=34378
2011-02-18 16:01:01 +01:00
Jakob Bornecrantz
e0481cac7d svga: Disable surface cache for textures
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
2011-02-18 14:46:48 +00:00
Jakob Bornecrantz
912ad88742 svga: Describe svga_sampler_views for refcnt debugging
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
2011-02-18 14:46:47 +00:00
Jakob Bornecrantz
99d955263b svga: Make sure that refcnt debugger gets the correct backtrace for create
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
2011-02-18 14:46:46 +00:00
Jakob Bornecrantz
52ad45677d util: Make refcnt and symbol debuggers work on windows
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
2011-02-18 14:46:23 +00:00
Cyril Brulebois
d252db7af1 Point to bugs.freedesktop.org rather than bugzilla.freedesktop.org
Suggested by a freedesktop.org admin.

Signed-off-by: Cyril Brulebois <kibi@debian.org>
2011-02-18 07:42:41 -07:00
Marek Olšák
449c4f3706 u_vbuf_mgr: initialize flag indicating that buffers have been updated
This fixes r300g errors:
r300: Cannot get a relocation in radeon_drm_cs_write_reloc.
2011-02-18 13:57:31 +01:00
Thomas Hellstrom
8cbd3b5ef1 gallium/svga: Fix unnecessary swtnl fallbacks
When we drop the in_swtnl_draw flag, we must force a rerun of
update_need_swtnl to reset the need_swtnl flag to its correct value outside
of a swtnl vbo draw.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2011-02-18 13:25:32 +01:00
Dave Airlie
dfa5928404 r600g: reorganise rgtc pieces.
when the cs checker fixes go upstream a lot of this can disappear
into a drm version check.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-02-18 16:00:49 +10:00
Brian Paul
b736b4a2b5 st/mesa: implement blit-based path for glCopyPixels
If doing a simple non-overlapping glCopyPixels with no per-fragment ops
we can use pipe_context::resource_copy_region().
2011-02-17 19:11:32 -07:00
Brian Paul
d44fbd3c9d mesa: fix comments for _mesa_clip_readpixels() 2011-02-17 19:11:32 -07:00
Brian Paul
de2f25de26 st/mesa: indentation fix 2011-02-17 19:11:32 -07:00
Fabian Bieler
8b5119aab3 r600g: Start a new TEX clause if the texture lookup address was fetched in the current clause
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-02-18 10:04:41 +10:00
Fabian Bieler
51cc14471c r600g: Add support to dump vertex- and texture-fetch clauses
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-02-18 10:04:34 +10:00
Dave Airlie
2a6cce09e3 r600g: add BC4/5 to RGTC conversion
this doesn't do anything much since the rest of mesa doesn't
support RGTC yet.
2011-02-18 09:39:23 +10:00
José Fonseca
262b785ccd util: Fix typo in last commit. 2011-02-17 17:15:57 +00:00
Brian Paul
d1becefb05 st/mesa: fix incorrect glCopyPixels position on fallback path
If we hit the pipe_get/put_tile() path for setting up the glCopyPixels
texture we were passing the wrong x/y position to pipe_get_tile().
The x/y position was already accounted for in the pipe_get_transfer()
call so we were effectively reading from 2*readX, 2*readY.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
2011-02-17 10:13:33 -07:00
Brian Paul
1fa97ddb25 draw: update comments, rename vars in pstipple code 2011-02-17 10:13:33 -07:00
José Fonseca
0adeaf00e6 svga: Don't use more than one constant per IFC instruction. 2011-02-17 15:29:32 +00:00
José Fonseca
8902c42db4 mesa: Do copy propagation across if-else-endif.
Addresses excessive TEMP allocation in vertex shaders where all CONSTs are
stored into TEMPS at the start, but copy propagation was failing due to
the presence of IFs.

We could do something about loops, but ifs are easy enough.
2011-02-17 15:29:30 +00:00
José Fonseca
6c1fcf8583 util: Cleanup symbol name resolution on Windows.
- Support symbol name resolution on MinGW.
- Use dbghelp.dll (which should allow 64bit support), but untested yet.
- Cleanup.
2011-02-17 15:26:53 +00:00
Brian Paul
1bf9954bb4 docs: updated environment variable list 2011-02-17 07:29:20 -07:00
Brian Paul
f9df46f873 st/mesa: remove unused screen variables 2011-02-17 07:28:58 -07:00
Brian Paul
30ed4ced11 mesa: remove the MESA_NO_DITHER env var
This was sometimes useful back when 16-bit framebuffers were prominent.
2011-02-17 07:28:58 -07:00
Brian Paul
b1d485712f softpipe: rename env vars to be consistent 2011-02-17 07:28:58 -07:00
Haitao Feng
f55d027ac2 egl_dri2: add swrast
This enables the egl_dri2 driver to load swrast driver
for software rendering. It could be used when hardware
dri2 drivers are not available, such as in VM.

Signed-off-by: Haitao Feng <haitao.feng@intel.com>
2011-02-16 23:06:36 -05:00
Dave Airlie
231bf886da r600g: get s3tc working on cards with crappy 64/128 bit types.
Some cards don't appear to work correctly with the UNORM type,
so switch to the integer type, however since gallium has no
integer types yet from what I can see we need to do a hack to
workaround it for the blitter.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-02-17 10:27:09 +10:00
Dave Airlie
5cc35124b3 r600g: add missing type to color buffer swap. 2011-02-17 10:27:09 +10:00
Brian Paul
5d236d71c8 gallium/util: init key with memset()
To silence missing initializers warning.
2011-02-16 17:10:36 -07:00
Brian Paul
c8f8d7d873 svga: flush when transitioning between HW and SW rendering paths
To avoid mixing HW and SW rendering with the same vertex buffer.
2011-02-16 17:07:02 -07:00
Brian Paul
b5df194923 rtasm: add dummy return statement to silence MSVC warning
And use assert(0) instead of abort() to be consistent with rest
of Gallium.
2011-02-16 17:07:02 -07:00
Brian Paul
2f5032ec1e svga: use TRUE/FALSE instead of 0/1
Some fields are booleans, others are bitmasks.  Use TRUE/FALSE to
clarify what's what.
2011-02-16 17:07:02 -07:00
Brian Paul
64762af008 svga: fix incorrect comment 2011-02-16 17:07:02 -07:00
Brian Paul
d432f462c2 svga: dimension the dirty[] array with SVGA_STATE_MAX 2011-02-16 17:07:02 -07:00
Brian Paul
e162f28228 mesa: make _mesa_write_renderbuffer_image() non-static 2011-02-16 17:07:02 -07:00
Brian Paul
4b6c9b799b svga: disable a debug_printf() call 2011-02-16 17:07:02 -07:00
Sam Hocevar
3e8fb54fb8 docs: add glsl info 2011-02-16 17:05:08 -07:00
Sam Hocevar
fde4943688 docs: fix glsl_compiler name 2011-02-16 17:05:08 -07:00
Brian Paul
aaceca16df mesa: 80-column wrap 2011-02-16 17:05:08 -07:00
José Fonseca
fa05ddca15 svga: Proper redefine_user_buffer implementation.
Unfortunately still not enough to make GoogleEarth happy.
2011-02-16 21:53:10 +00:00
Marek Olšák
fa3f1348e4 r300g: fix a race between CS and SET_TILING ioctls 2011-02-16 22:23:23 +01:00
Marek Olšák
2d1cc27729 r300g: fix blitting NPOT compressed textures 2011-02-16 21:40:54 +01:00
Marek Olšák
8513d3405b mesa: fix texture3D mipmap generation for UNSIGNED_BYTE_3_3_2 and 4_4
Oops, I copy-pasted a typo from 3_3_2.

The 3_3_2 part is a candidate for 7.9 and 7.10.
The 4_4 part isn't, because AL44 is in neither branches.
2011-02-16 20:44:46 +01:00
Marek Olšák
4d6994e40e mesa: fix mipmap generation for MESA_FORMAT_AL44
This was missed when implementing AL44.
2011-02-16 20:21:40 +01:00
José Fonseca
33d8ff9c31 scons: Recognize 'AMD64' processor as well. 2011-02-16 18:02:08 +00:00
José Fonseca
590c2ee568 scons: Don't get fooled by 32bit python on a 64bit windows. 2011-02-16 18:02:06 +00:00
José Fonseca
9f9d6481de scons: Avoid depending on scons 2.0 in general. 2011-02-16 18:02:01 +00:00
José Fonseca
2a2b156ea5 mesa: Remove the DXT compression via blit path.
No longer used.
2011-02-16 16:50:24 +00:00
José Fonseca
697a3eb832 svga: Don't fake DXT compression ability. 2011-02-16 16:50:24 +00:00
Christoph Bumiller
3903e25a2c nvc0: fix blend factor mapping 2011-02-16 15:45:31 +01:00
Christoph Bumiller
3f1361e060 nvc0: fix emit_dfdx,dfdy 2011-02-16 15:45:31 +01:00
Christoph Bumiller
bb2c8e7099 nvc0: don't swap sources if either value is not in a GPR
The memory / immediate source should already be in the only valid
position.
2011-02-16 15:45:31 +01:00
Christoph Bumiller
2fa35eedd9 nvc0: add missing break statements in constant_operand 2011-02-16 15:45:31 +01:00
Christoph Bumiller
e7845e3196 nvc0: fix clipping and use VIEWPORT instead of SCISSOR 2011-02-16 15:45:31 +01:00
Christoph Bumiller
19f2272e94 nvc0: demagic the clear flags and fix region clears
The CLIP_RECTs always affect dedicated clears, and it's nicer than
having to mark the viewport or scissor state dirty after it.
2011-02-16 15:45:31 +01:00
Christoph Bumiller
293a8d1b60 nvc0: front stencil mask and func mask methods are swapped 2011-02-16 15:45:31 +01:00
Christoph Bumiller
a24e9bd497 nvc0: clone memory values with multiple refs before modifying them 2011-02-16 15:45:30 +01:00
Christoph Bumiller
80a7ae3cc5 nvc0: disable early fragment tests if KIL is used
Early-Z pass raises the occlusion counter.
2011-02-16 15:45:30 +01:00
Christoph Bumiller
17d680cc53 nvc0: force vertex data through FIFO if we need to convert it
We may want to put the converted vertex buffer in persistent
storage instead, but these are rare corner cases.
2011-02-16 15:45:30 +01:00
Christoph Bumiller
bf1ce9c64b nvc0: use format from the template on surface creation
Fixes piglit/fbo-srgb.
2011-02-16 15:45:30 +01:00
Christoph Bumiller
1b4c0c8ea0 nvc0: update the set of formats supported by the 2D engine 2011-02-16 15:45:30 +01:00
Christoph Bumiller
a3c62afa7c nvc0: fix user vertex buffer updates 2011-02-16 15:45:30 +01:00
Brian Paul
fc5ab1b197 mesa: use gl_format type instead of GLuint 2011-02-16 07:08:58 -07:00
Dave Airlie
f53436d821 r600g: fix typo in previous s3tc commit
pointed out by Marek on irc.
2011-02-16 16:51:41 +10:00
Marek Olšák
9e725b9123 r300g: fix texture border color for float formats 2011-02-16 07:46:36 +01:00
Dave Airlie
4ffef88899 Revert "util: fix DXT1 RGBA texture compression if the source color is (0, 0, 0, 0)"
This reverts commit 6e7d782da5.

Oops, I just had this locally for testing and forgot to remove it before pushing.
2011-02-16 16:13:58 +10:00
Dave Airlie
04903d1f63 r600g: add L8A8 SRGB formats.
this fixes the piglit mipmap generation sRGB on my rv730.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-02-16 16:09:43 +10:00
Marek Olšák
6e7d782da5 util: fix DXT1 RGBA texture compression if the source color is (0, 0, 0, 0)
This is a workaround for a bug in libtxc_dxtn.

Fixes:
- piglit/GL_EXT_texture_compression_s3tc/fbo-generatemipmap-formats

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-02-16 16:04:14 +10:00
Dave Airlie
4016a1b4c6 r600g: add L4A4 support.
this fixes piglit fbo-generatemipmap-formats on my rv730.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-02-16 16:01:36 +10:00
Dave Airlie
0863eaf91c r600g: fix s3tc-texsubimage
we need to translate the destination box as well.

fixes piglit's s3tc-texsubimage test.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-02-16 15:56:11 +10:00
Ian Romanick
25b36e8ff8 linker: Fix off-by-one error implicit array sizing
Arrays are zero based.  If the highest element accessed is 6, the
array needs to have 7 elements.

Fixes piglit test glsl-fs-implicit-array-size-03 and bugzilla #34198.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
2011-02-15 18:22:33 -08:00
Vinson Lee
ae11707b83 st/python: add usage parameter to pipe_buffer_create
This is a follow-up to commit eafb7f234d.

Fixes Linux SCons build.
2011-02-15 17:29:43 -08:00
Marek Olšák
38104a767c r300g: disable linear filtering for float textures 2011-02-16 00:55:39 +01:00
Chad Versace
62c8c77333 glsl: Reinstate constant-folding for division by zero
Fixes regression: https://bugs.freedesktop.org/show_bug.cgi?id=34160

Commit e7c1f058d1 disabled constant-folding
when division-by-zero occured. This was a mistake, because the spec does
allow division by zero. (From section 5.9 of the GLSL 1.20 spec: Dividing
by zero does not cause an exception but does result in an unspecified
value.)

For floating-point division, the original pre-e7c1f05 behavior is
reinstated.

For integer division, constant-fold 1/0 to 0.
2011-02-15 15:46:12 -08:00
Chad Versace
f2e9981e43 Revert "glsl: Fix constant-folding for reciprocal expressions"
This reverts commit b3cf92aa91.

The reverted commit prevented constant-folding of reciprocal expressions
when the reciprocated expression was 0. However, since the spec allows
division by zero, constant-folding *is* permissible in this case.

From Section 5.9 of the GLSL 1.20 spec:
    Dividing by zero does not cause an exception but does result in an
    unspecified value.
2011-02-15 15:46:12 -08:00
Chad Versace
a231ac23f4 tnl: Add support for datatype GL_FIXED in vertex arrays
Before populating the vertex buffer attribute pointer (VB->AttribPtr[]),
convert vertex data in GL_FIXED format to GL_FLOAT.

Fixes bug: http://bugs.freedesktop.org/show_bug.cgi?id=34047

NOTE: This is a candidate for the 7.9 and 7.10 branches.
2011-02-15 15:39:22 -08:00
Dave Airlie
632918d3ec r600g: add srgb compressed formats to the list. 2011-02-16 08:54:14 +10:00
Marek Olšák
eafb7f234d gallium: add usage parameter to pipe_buffer_create
And set a reasonable buffer usage flag everywhere instead of
just PIPE_USAGE_DEFAULT.
2011-02-15 22:44:21 +01:00
Fabian Bieler
82a9794a35 r600g: Fix RGB10_A2 format handling 2011-02-15 12:31:30 -05:00
Dave Airlie
4b81c5f6e1 r600g: fix regression in r6/7xx since mipmap rework
I typod this when copy-pasting.
2011-02-15 18:43:56 +10:00
Vinson Lee
cd8af3b60b nvc0: Fix uninitialized variable warning.
Fixes this GCC warning.
nvc0_tgsi_to_nc.c: In function 'bld_tex':
nvc0_tgsi_to_nc.c:1392: warning: 'dim' may be used uninitialized in this function
2011-02-15 00:27:16 -08:00
Marek Olšák
b9e2cde600 r300g: offload the CS ioctl to another thread
This is a multi-threading optimization which hides the kernel overhead
behind a thread. It improves performance in CPU-limited apps by 2-15%.
Of course you must have at least 2 cores for it to make any difference.

It can be disabled with:

export RADEON_THREAD=0
2011-02-15 09:17:39 +01:00
Dave Airlie
8e0437914b r600g: add support for s3tc formats.
On r600, s3tc formats require a 1D tiled texture format,
so we have to do uploads using a blit, via the 64-bit and 128-bit formats

Based on the r600c code we use a 64 and 128-bit type to do the
blits.

Still requires R600_ENABLE_S3TC until the kernel fixes are in,
this has only been tested on evergreen where the kernel doesn't
yet get in the way.
2011-02-15 14:44:09 +10:00
Dave Airlie
a661dacf14 r600g: fix miptree calculations
the miptree setup and pitch storing didn't work so well for block
based things like compressed textures. The CB takes blocks, where
the texture sampler takes pixels, and transfers need bytes,

So now we store blocks/bytes and translate to pixels in the sampler.

This is necessary for s3tc to work properly.
2011-02-15 14:44:08 +10:00
Dave Airlie
ea7a548d07 r600g: drop tiled flag
we can work this out from the array_mode and it makes more sense
to do that.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-02-15 14:44:08 +10:00
Dave Airlie
fdb4373a20 st/mesa: fix compressed mipmap generation.
If the underlying transfer had a stride wider for hw alignment reasons,
the mipmap generation would generate badly strided images.

this fixes a few problems I found while testing r600g with s3tc

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-02-15 14:44:08 +10:00
Marek Olšák
dc578188fa st/mesa: fix GLES build
Broken since d5062fb3a3.

I wonder why this code is hidden behind #if by default.
2011-02-15 04:56:09 +01:00
Marek Olšák
333d3daf47 r300g: actually implement the is_buffer_busy hook the right way
Ooops.
2011-02-15 04:00:47 +01:00
Marek Olšák
45e1cd522b r300g: handle interaction between UNSYNCHRONIZED and DONTBLOCK flags in bo_map
The VBO module uses both, but they are somewhat opposite to each other.
In this case, we pick UNSYNCHRONIZED and ignore DONTBLOCK.
2011-02-15 04:00:47 +01:00
Marek Olšák
8decb0a96d r300g: fix a possible race condition when mapping a buffer
This is the last one I think.
2011-02-15 04:00:47 +01:00
Marek Olšák
18b4978ac8 r300g: implement fences using dummy relocations
So finally we have them.
2011-02-15 04:00:46 +01:00
Marek Olšák
4faf11ad6c r300g: fix SIGFPE on debug builds 2011-02-15 01:19:54 +01:00
Marek Olšák
56029ce52b r300g: inline some of the pipe_buffer_map/unmap calls 2011-02-15 01:19:54 +01:00
Marek Olšák
20112cca26 r300g: do not track whether occlusion queries have been flushed
The winsys takes care of flushing automatically.
2011-02-14 23:36:12 +01:00
Marek Olšák
89ee0d527c r300g: flush CS in bo_map even if we get USAGE_DONTBLOCK
Because an app may do something like this:

while (!(ptr = bo_map(..., DONT_BLOCK))) {
    /* Do some other work. */
}

And it would be looping endlessly if we didn't flush.
2011-02-14 23:34:45 +01:00
Vinson Lee
ec21eabe2a st/python: remove pipe_vertex_buffer::max_index
This is a follow-up to commit cdca3c58aa.
2011-02-14 14:10:05 -08:00
Vinson Lee
7582448016 graw: remove pipe_vertex_buffer::max_index
This is a follow-up to commit cdca3c58aa.
2011-02-14 13:53:09 -08:00
Fabian Bieler
a476ca1fd1 st/mesa: Use blend equation and function of first render target for all render targets if ARB_draw_buffers_blend is not supported
If EXT_draw_buffers2 is supported but ARB_draw_buffers_blend isn't
_mesa_BlendFuncSeparateEXT only sets up the blend equation and function for the
first render target. This patch makes sure that update_blend doesn't try to use
the data from other rendertargets in such cases.

Signed-off-by: Brian Paul <brianp@vmware.com>
2011-02-14 14:37:18 -07:00
Marek Olšák
a87730ff3f r300g: implement pb_manager::is_buffer_busy 2011-02-14 22:02:40 +01:00
Marek Olšák
49579a4df8 pb_bufmgr_cache: add is_buffer_busy hook and use it instead of non-blocking map
This is cleaner and implementing the hook is optional.
2011-02-14 21:51:01 +01:00
Marek Olšák
588fa884d2 gallium: notify drivers about possible changes in user buffer contents
Also implement the redefine_user_buffer hook in the drivers.
2011-02-14 21:50:08 +01:00
Marek Olšák
2a904fd6a0 st/mesa: set vertex arrays state only when necessary
The vertex arrays state should be set only when (_NEW_ARRAY | _NEW_PROGRAM)
is dirty. This assumes user buffer content is mutable, which will be
sorted out in the next commit. The following usage case should be much faster
now:

for (i = 0; i < 1000; i++) {
   glDrawElements(...);
}

Or even:

for (i = 0; i < 1000; i++) {
   glSomeStateChangeOtherThanArraysOrProgram(...);
   glDrawElements(...);
}

The performance increase from this may be significant in some apps and
negligible in others. It is especially noticable in the Torcs game (r300g):
    Before: 15.4 fps
    After: 20 fps

Also less looping over attribs in st_draw_vbo yields slight speed-up
in apps with lots of glDraw* calls.
2011-02-14 21:50:08 +01:00
Marek Olšák
cdca3c58aa gallium: remove pipe_vertex_buffer::max_index
This is redundant to pipe_draw_info::max_index and doesn't really fit
in the optimizations I plan.
2011-02-14 21:50:08 +01:00
Marek Olšák
d5062fb3a3 gallium: always save and restore vertex buffers using cso_cache 2011-02-14 21:50:07 +01:00
Marek Olšák
cfaf217135 vbo: bind arrays only when necessary
We don't need to call bind_arrays in the vbo module if the states
which the function depends on are not dirty.
2011-02-14 21:50:07 +01:00
Marek Olšák
5a01361cea vbo: notify a driver that we change buffer offsets, strides, etc. 2011-02-14 21:50:07 +01:00
Vinson Lee
d123959ff7 r300g: Remove redundant initialization.
Remove redundant initialization from commit
3b01b52bd7 noticed by tstellar.
2011-02-14 10:47:58 -08:00
Alex Deucher
9e96ea0652 r600g: add alignment cases for linear aligned
Matches the drm and ddx.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-02-14 13:07:29 -05:00
José Fonseca
07eb660fc9 draw: Don't define the last two mipmap levels in aa lines.
Some hardware needs to make a seperate copy of all levels to obey
max_lod, so simply do not define the last two levels instead of
clamping.
2011-02-14 10:56:48 +00:00
José Fonseca
9305e93114 svga: Set the appropriate flags when creating sampler/surface views. 2011-02-14 10:53:54 +00:00
Marek Olšák
a0c293ec11 r300g: put indices in CS if there's just a few of them and are in user memory 2011-02-14 11:43:14 +01:00
Marek Olšák
437583ea63 r300g: cleanup the draw functions 2011-02-14 11:43:14 +01:00
Marek Olšák
476cec37d6 r300g: do not create a user buffer struct for misaligned ushort indices fallback 2011-02-14 11:43:14 +01:00
Marek Olšák
d173f1ba8a r300g: fix fallback for misaligned ushort indices with num vertices >= 65535 2011-02-14 11:43:14 +01:00
Marek Olšák
3d5ac32f3b r300g: consolidate emission of common draw regs 2011-02-14 11:43:14 +01:00
Sedat Dilek
0f912534fd docs: Fix typo in GL3.txt 2011-02-14 00:45:44 -08:00
Vinson Lee
3b01b52bd7 r300g: Move declaration before code.
Fixes SCons build.
2011-02-14 00:07:07 -08:00
Marek Olšák
e9d993e9b9 r600g: do not destroy the original index buffer when translating indices
Because we only translate a subrange of the buffer.
2011-02-14 07:45:14 +01:00
Marek Olšák
5a6ba08c21 r300g: emit 3D_LOAD_VBPNTR only when necessary
I thought I couldn't skip emitting this packet in some cases.
Well it looks like I can.
2011-02-14 07:45:14 +01:00
Marek Olšák
004dd01583 r300g: fix reference counting when translating indices 2011-02-14 07:45:14 +01:00
Marek Olšák
9a90eeee67 u_index_modify: map buffers with PIPE_TRANSFER_UNSYNCHRONIZED 2011-02-14 07:45:14 +01:00
Marek Olšák
5197b09bee r300g: remove the relocation after AARESOLVE_PITCH 2011-02-14 07:45:14 +01:00
Dave Airlie
1f5b674168 egl_dri2: add nouveau support.
but really wtf? all these PCI IDs need to be ripped out of here, its totally
unscalable and the drivers already have this info so could export it some better way.

tested by Darxus on #wayland.
2011-02-14 07:54:28 +10:00
Marcin Slusarz
8fe5da89e3 nv50: fix query assertion 2011-02-13 22:05:28 +01:00
Marek Olšák
e6e4860555 r300g: correctly determine if a texture is blittable in texture_get_transfer 2011-02-13 08:49:15 +01:00
Marek Olšák
8ab1fcc66a r300g: fixup the handle_compare function
Accidentally negated in 685c3262b9.
2011-02-13 00:31:04 +01:00
Marek Olšák
1fd6bbc881 r300g: when printing shader linker errors to stderr, report it's not a bug 2011-02-12 23:38:00 +01:00
Marek Olšák
9ad9a6861a r300g: add debug options nozmask and nohiz which disable some hyper-z features 2011-02-12 23:37:14 +01:00
Marek Olšák
685c3262b9 r300g: typecast void* to unsigned correctly 2011-02-12 23:36:48 +01:00
Eric Anholt
04521c158f dri: Remove the old metaops code which has been superceded by ../common/ 2011-02-12 12:26:04 -08:00
Eric Anholt
211725eccd radeon: Remove setup of the old dri/ meta code, which is now unused. 2011-02-12 12:23:43 -08:00
Eric Anholt
47589c17b0 intel: Remove setup of the old dri/ meta code, which is now unused. 2011-02-12 12:23:20 -08:00
Dave Airlie
a6b7393eb8 update GL3.txt for GL_EXT_framebuffer_sRGB status 2011-02-12 18:08:04 +10:00
Tom Stellard
9106b98766 r300/compiler: Don't erase sources when converting RGB->Alpha
https://bugs.freedesktop.org/show_bug.cgi?id=34030

NOTE: This is a candidate for the 7.10 branch.
2011-02-11 19:42:35 -08:00
Christopher James Halse Rogers
d1e28b2267 mesa: Optionally build a dricore support library (v3)
This an adds --enable-shared-dricore option to configure.  When enabled,
DRI modules will link against a shared copy of the common mesa routines
rather than statically linking these.

This saves about 30MB on disc with a full complement of classic DRI
drivers.

v2: Only enable with a gcc-compatible compiler that handles rpath
    Handle DRI_CFLAGS without filter-out magic
    Build shared libraries with the full mklib voodoo
    Fix typos
v3: Resolve conflicts with talloc removal patches

Signed-off-by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
2011-02-11 18:31:05 -08:00
nobled
b5dc40710d glx: Put null check before use
'dpy' was being checked for null *after* it was already used once.

Also add a null check for psc, and drop gc's redundant initialization.
2011-02-11 18:19:10 -08:00
Marek Olšák
df54b53b7d r300g: improve function radeon_bo_is_referenced_by_cs
This should prevent calling into radeon_get_reloc when there's
only one context.
2011-02-12 03:08:39 +01:00
Marek Olšák
20a78b68a3 u_vbuf_mgr: fix segfault
max_index could have been less than min_index, which later caused integer
underflow followed by a segfault in memcpy.
2011-02-12 03:08:39 +01:00
Ian Romanick
3803295fc2 ir_to_mesa: Don't dereference a NULL pointer during copy propagation
The ACP may already be NULL, so don't try to make it NULL again.

This should fix bugzilla #34119.
2011-02-11 15:44:19 -08:00
Ian Romanick
a0120e6e0f glcpp: regerated files
These should have been committed right after fd1252ab, but they were
missed.  Soon, we'll never have to do this again...
2011-02-11 15:44:19 -08:00
Ian Romanick
afdceede55 glsl: Regenerate files modified by previous commits 2011-02-11 14:12:44 -08:00
Ian Romanick
8842158944 glsl: Finish out the reduce/reduce error fixes
Track variables, functions, and types during parsing.  Use this
information in the lexer to return the currect "type" for identifiers.

Change the handling of structure constructors.  They will now show up
in the AST as constructors (instead of plain function calls).

Fixes piglit tests constructor-18.vert, constructor-19.vert, and
constructor-20.vert.  Also fixes bugzilla #29926.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
2011-02-11 14:12:43 -08:00
Keith Packard
f4b812e1a6 glsl: Eliminate reduce/reduce conflicts in glsl grammar
This requires lexical disambiguation between variable and type
identifiers (as most C compilers do).

Signed-off-by: Keith Packard <keithp@keithp.com>

NOTE: This is a candidate for the 7.9 and 7.10 branches.
2011-02-11 14:12:43 -08:00
Benjamin Franzke
81affb8f4c st/mesa: Fix surfaceless opengl with non-dummy contexts
main/context.c:check_complatible() detecs an incomplete
framebuffer using its pointer, so do not copy it.

This should fix https://bugs.freedesktop.org/show_bug.cgi?id=34042
2011-02-11 16:54:04 -05:00
Brian Paul
6c3a82a1a3 svga: disable a debug_printf() call 2011-02-11 14:07:43 -07:00
Brian Paul
396da5df0e svga: comments and debug code 2011-02-11 14:02:30 -07:00
Brian Paul
f7d84c177f svga: more comments for need_pipeline field 2011-02-11 14:02:30 -07:00
José Fonseca
6826d58bbf scons: Need c99 also when cross compiling. 2011-02-11 20:09:26 +00:00
José Fonseca
982609f4cf scons: builtin_glsl_function on windows needs bundled getopt. 2011-02-11 20:09:26 +00:00
José Fonseca
ae760279f1 scons: Try to support building 64bit binaries on 32bit windows. 2011-02-11 20:09:26 +00:00
José Fonseca
051f8bbfee scons: Fix MSVC 64bit build. 2011-02-11 20:09:26 +00:00
Brian Paul
3ee97ead0b mesa: remove some unused gl_shader fields 2011-02-11 12:00:51 -07:00
Brian Paul
413511f796 draw: tweak AA line texture minimum alpha
AA lines drawn as textured quads look a little better with this change.
Conformance/piglit tests still pass.
2011-02-11 12:00:51 -07:00
Brian Paul
da2e541218 svga: add max DMA size check in svga_winsys_buffer_create()
This fixes a problem when trying to use large (2K x 2K) texture
images.  We'll DMA the image in chunks.

Patch written by Jose.
2011-02-11 11:56:45 -07:00
Brian Paul
8c61799051 svga: remove old comment, remove extra whitespace 2011-02-11 11:54:55 -07:00
Tobias Jakobi
11f35aa418 glsl: Fix parallel build.
Broken since e0c1fc3283.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-02-11 10:36:14 -08:00
José Fonseca
6ed0f2ac11 svga: Enable the draw pipeline for smooth lines.
Spotted by Brian Paul.
2011-02-11 11:24:55 +00:00
José Fonseca
57a3d36a68 svga: Don't use the draw pipeline for non-AA lines with a fractional width.
Spotted by Jakob Bornecrantz.
2011-02-11 11:24:55 +00:00
José Fonseca
4586e6c8cb draw: Don't use the pipeline when drawing lines with fractional widths.
Spotted by Jakob Bornecrantz.
2011-02-11 11:24:55 +00:00
José Fonseca
7ac2db893a llvmpipe: Use u_math's round. 2011-02-11 11:24:54 +00:00
José Fonseca
151faa2258 util: Define round and roundf on MSVC. 2011-02-11 11:11:33 +00:00
José Fonseca
f0ca9f7134 svga: Stippled lines can also be drawn with triangles. 2011-02-11 07:48:05 +00:00
Marek Olšák
de22d8f1ee r300g: remove unused function prototypes, update copyright 2011-02-11 06:07:23 +01:00
Haitao Feng
3104e5cb4f egl_dri2: rename loader_extension to dri2_loader_extension
Signed-off-by: Haitao Feng <haitao.feng@intel.com>
2011-02-10 23:41:21 -05:00
Benjamin Franzke
9f213f6a4a st/egl wayland: Sync front buffer release 2011-02-10 23:07:01 -05:00
Benjamin Franzke
51f2820922 egl_dri2 wayland: Sync front buffer release 2011-02-10 23:07:01 -05:00
Benjamin Franzke
4e8f95f64d egl_dri2: Always unbind old contexts
This fixes __DRIdrawable refcounting.
Binding a context increases their refcount,
so we need to decrease it.
2011-02-10 23:07:01 -05:00
Benjamin Franzke
87dde5b1cd egl_dri2: Use double buffering for window surfaces 2011-02-10 23:07:01 -05:00
Benjamin Franzke
71fa227029 st/dri: Set render_buffer in dri_fill_st_visual
st/mesa/st_managaer.c needs render_buffer in order
to determinde which buffer should be rendered to.
2011-02-10 23:07:01 -05:00
Benjamin Franzke
fa3283cca8 st/dri: img_from_renderbuf: Fix incorrect usage of dri_context() 2011-02-10 23:07:01 -05:00
Benjamin Franzke
0acb31be17 st/dri: Fix surfaceless gl using contexts with previous bound surfaces
ctx->dPriv might be != NULL then draw which is NULL is accessed:

struct dri_drawable *draw = dri_drawable(driDrawPriv);
[..]
if (ctx->dPriv != driDrawPriv) {
      ctx->dPriv = driDrawPriv;
      draw->texture_stamp = driDrawPriv->lastStamp - 1;
}
2011-02-10 23:07:01 -05:00
Benjamin Franzke
c79a5a7067 st/egl wayland: Set color_format according to wl_visual 2011-02-10 23:07:01 -05:00
Dave Airlie
596684eb93 r600g: get correct height alignment
useful for s3tc
2011-02-11 13:47:35 +10:00
Dave Airlie
9d85aba0e3 r600g: drop two unused | 0 that are actually in word4 anyways.
these were NOPs anyways.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-02-11 13:47:35 +10:00
Dave Airlie
0d851f6e9c r600g: handle 16/32 u/s norm formats properly
add support for the 32-bit types, also fixup the
export setting to handle types with channels > 11 bits properly

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-02-11 13:47:34 +10:00
Marek Olšák
9a1fe76a20 r300g: prevent NULL pointer dereference in r300_buffer_create
Should fix:
https://bugs.freedesktop.org/show_bug.cgi?id=33185
2011-02-11 03:18:05 +01:00
Kenneth Graunke
2e8726f5b1 mesa: Remove empty header file s_trispan.h. 2011-02-10 17:37:01 -08:00
Kenneth Graunke
e0c1fc3283 glsl/Makefile: glcpp doesn't need libglsl.a.
Also, add a 'glcpp' target so you can type 'make glcpp' instead of
'make glcpp/glcpp'.
2011-02-10 17:37:01 -08:00
Marek Olšák
032b162ce8 r300g: plug a memory leak in winsys 2011-02-11 02:34:15 +01:00
Marek Olšák
862ebb411b r300g: remove unneeded code in winsys
We don't need the read/write flags.
2011-02-11 01:32:44 +01:00
Marek Olšák
98f344c504 r300g: fix warning 2011-02-11 01:18:53 +01:00
Marek Olšák
7da5105fb3 configure.ac: remove libdrm_radeon dependency for r300g and r600g 2011-02-11 01:16:06 +01:00
Marek Olšák
6ccab620a0 r300g: import the last bits of libdrm and cleanup the whole thing
Based on Dave's branch.

The majority of this commit is a cleanup, mainly renaming things.
There wasn't much code to import, just ioctl calls.

Also done:
- implemented unsynchronized bo_map (important optimization!)
- radeon_bo_is_referenced_by_cs is no longer a refcount hack
- dropped the libdrm_radeon dependency

I'm surprised that this has resulted in less code in the end.
2011-02-11 01:07:25 +01:00
Marek Olšák
c0beaf6e6d st/mesa: allow rendering to sRGB textures if EXT_fb_srgb is unsupported
In this case, we always use the corresponding linear format in create_surface,
therefore we should check for linear format support as well.
2011-02-11 01:07:21 +01:00
Ian Romanick
4c1dc1c4d7 i915: Force lowering of all types of indirect array accesses in the FS
NOTE: This is a candidate for the 7.9 and 7.10 branches.
2011-02-10 13:26:49 -08:00
Ian Romanick
53b8b68843 i915: Calculate partial result to temp register first
Previously the SNE and SEQ instructions would calculate the partial
result to the destination register.  This would cause problems if the
destination register was also one of the source registers.

Fixes piglit tests glsl-fs-any, glsl-fs-struct-equal,
glsl-fs-struct-notequal, glsl-fs-vec4-operator-equal,
glsl-fs-vec4-operator-notequal.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
2011-02-10 13:26:49 -08:00
José Fonseca
05a16b8e1c u_upload_mgr: Use PIPE_TRANSFER_FLUSH_EXPLICIT.
This can avoid DMAing the whole buffer when just a fraction was changed.
2011-02-10 20:55:10 +00:00
José Fonseca
d60f07489e scons: Disable -mstackrealign on MinGW again.
It's still broken, however it doesn't show up on debug builds.
2011-02-10 16:29:10 +00:00
Kristian Høgsberg
1a8899d630 configure.ac: Fix typo 2011-02-10 10:45:27 -05:00
Marek Olšák
fea4ad8f66 r300g: implement accelerated copy_region for compressed formats 2011-02-10 11:27:35 +01:00
Marek Olšák
7c24a4c6a8 r300g: add a way to change texture properties arbitrarily
So that we can implement resource_copy on arbitrary data.
2011-02-10 11:27:35 +01:00
Marek Olšák
56ba7e913f r300g: consolidate buffers and textures to r300_resource
Transfers and create/destroy are still handled separately.
2011-02-10 11:27:35 +01:00
Marek Olšák
ce9c0d2801 r300g: simplify WRITE_RELOC API and cleanup 2011-02-10 11:27:35 +01:00
Marek Olšák
ac366af9fd u_blitter: let the driver check whether there's a recursion 2011-02-10 11:27:34 +01:00
Marek Olšák
fc9170d0cf r300g: use format from pipe_surface instead of pipe_resource 2011-02-10 02:11:38 +01:00
Marek Olšák
2314a2f45f Revert "r300g: support sRGB colorbuffers"
This partially reverts commit 91eba2567e.

Conflicts:

	src/gallium/drivers/r300/r300_blit.c
2011-02-10 01:43:27 +01:00
Dave Airlie
21b0996dfc mesa/st: enable GL_EXT_framebuffer_sRGB
If the formats don't match we need to update the surface with the new
format.

if we can render to SRGB formats, enable the extension

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-02-10 10:14:27 +10:00
José Fonseca
3b8bb7b449 scons: Restrict whole program optimization to release builds.
It just takes forever, so it is inadequate for continuous testings
(i.e., checked and profile build types).
2011-02-09 18:31:21 +00:00
José Fonseca
2d95885308 svga: Don't advertise pixel shader addr register support.
It's not fully supported.
2011-02-09 18:31:21 +00:00
Kristian Høgsberg
04c5cc5b8b eglplatform.h: Define Wayland native platform types
This is conditional on WL_EGL_PLATFORM being #defined, so application
must make sure to include wayland-egl.h before including any egl header.
2011-02-09 10:58:20 -05:00
Christoph Bumiller
b6e3130a3b nvc0: serialize on PIPE_FLUSH_RENDER_CACHE as well
Effects were easily visible in piglit/fbo-generatemipmap-formats.
2011-02-09 16:05:00 +01:00
Christoph Bumiller
fc798dc37d nvc0: fix stride of NVC0_3D_RT methods 2011-02-09 16:05:00 +01:00
Christoph Bumiller
95f0aa0e52 nvc0: correct storage type for 16 bit surface formats 2011-02-09 16:05:00 +01:00
Christoph Bumiller
0bd04cdd12 nvc0: make CSE work for ops with multiple results 2011-02-09 16:05:00 +01:00
Christoph Bumiller
0691530b7f nvc0: replace branching with predicated insns where feasible 2011-02-09 16:05:00 +01:00
Christoph Bumiller
0f776fea43 nvc0: implement local memory load and store ops 2011-02-09 16:05:00 +01:00
Christoph Bumiller
4124feabcb nvc0: make sure phi-ops really have one source per in-block 2011-02-09 16:05:00 +01:00
Christoph Bumiller
7401590ded nv50,nvc0: do not forget to apply sign mode to saved TGSI inputs 2011-02-09 16:05:00 +01:00
Christoph Bumiller
c485368efe nvc0: do not generate a backwards jump if a loop ends with BRK 2011-02-09 16:05:00 +01:00
Christoph Bumiller
8e240e6153 nvc0: store only one value per basic block for TGSI regs 2011-02-09 16:05:00 +01:00
Christoph Bumiller
d5263e4093 nv50,nvc0: fix condition code change when commuting SET sources 2011-02-09 16:04:59 +01:00
Christoph Bumiller
8f05134580 nvc0: set basic block on manual instruction insertion 2011-02-09 16:04:59 +01:00
Christoph Bumiller
92d8af582d nvc0: try to fix register conflicts for vector instructions
Vector here means using multiple 32 bit regs which are forced to be
consecutive in the register file.

This still isn't quite nice.
2011-02-09 16:04:59 +01:00
Christoph Bumiller
c62fc50c88 nvc0: reset texture base address after read transfer 2011-02-09 16:04:59 +01:00
Christoph Bumiller
d3ea15f5ca nvc0: don't combine memory loads across block boundaries 2011-02-09 16:04:59 +01:00
Christoph Bumiller
f0d7429623 nvc0: detect no-op MIN/MAX, do CSE earlier to succeed more often 2011-02-09 16:04:59 +01:00
Thomas Hellstrom
a7293cbe5c mesa/st: Clean up vertex buffer unreferencing
Avoid accessing draw module internal structures outside of the draw module.
Unreference vertex buffers in error path.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2011-02-09 09:45:34 +01:00
Marek Olšák
c264786809 gallium/docs: fix typo 2011-02-09 05:21:20 +01:00
Brian Paul
f70c98b6a6 r200: add cast to silence warning 2011-02-08 19:25:04 -07:00
Brian Paul
3b0c2eb07c mesa: remove unused BITFIELD64 macros 2011-02-08 19:25:04 -07:00
Brian Paul
6f2f449414 mesa: remove _mesa_create_context_for_api()
Just add the gl_api parameter to _mesa_create_context().
2011-02-08 19:25:04 -07:00
Brian Paul
5e4ca1ccc9 mesa: remove _mesa_initialize_context_for_api()
Just add the gl_api parameter to _mesa_initialize_context().
2011-02-08 19:25:04 -07:00
Brian Paul
2634e92dc0 mesa: add/update VERBOSE_API logging 2011-02-08 19:20:43 -07:00
Brian Paul
7230e1a228 st/mesa: fix shader deletion regression
Fixes a regression from commit 5cbff0932e.
The problem is *some* glDrawPixels fragment programs need to be deleted,
but not all.  Use an explicit flag to indicate whether or not the program
needs to be deleted.

This should fix http://bugs.freedesktop.org/show_bug.cgi?id=34049
2011-02-08 18:23:59 -07:00
Kenneth Graunke
f6f04ae29c i965: Add missing DEFINE_BITS for brw dirty bits.
These are only used for debugging, but should be there.
Found by inspection.
2011-02-08 16:56:18 -08:00
Kenneth Graunke
58b7e37722 i965: Separate the BRW_NEW_(VS|WM)_CONSTBUF dirty bits.
These were incorrectly defined to the same value - likely due to a cut
and paste error.  Found by inspection.
2011-02-08 16:55:20 -08:00
Kenneth Graunke
71acbb54f4 i965: Rename a few more commands to match the documentation. 2011-02-08 16:06:47 -08:00
Benjamin Franzke
15598fbf42 st/egl: Fix platform selection
A break for case _EGL_PLATFORM_X11 is missing.
introduced by: 381ea0d67a
2011-02-08 15:16:31 -05:00
Eric Anholt
df8ca3e0ec i965: Remove pointless keying of WM state on VUE size. 2011-02-08 11:42:44 -08:00
Eric Anholt
76857e8954 mesa: Fix the Mesa IR copy propagation to not read past writes to the reg.
Fixes glsl-vs-post-increment-01.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2011-02-08 11:42:35 -08:00
Eric Anholt
60aab5f335 glsl: Disable the new copy propagation pass until it gets fixed.
It apparently regressed a bunch of ES2 cases.
2011-02-08 11:41:05 -08:00
Chad Versace
82f994f386 glsl: Set operators '%' and '%=' to be reserved when GLSL < 1.30
From section 5.9 of the GLSL 1.20 spec:
   The operator modulus (%) is reserved for future use.

From section 5.8 of the GLSL 1.20 spec:
   The assignments modulus into (%=), left shift by (<<=), right shift by
   (>>=), inclusive or into ( |=), and exclusive or into ( ^=). These
   operators are reserved for future use.

The GLSL ES 1.00 spec and GLSL 1.10 spec have similiar language.

Fixes bug:
https://bugs.freedesktop.org//show_bug.cgi?id=33916

Fixes Piglit tests:
spec/glsl-1.00/compiler/arithmetic-operators/modulus-00.frag
spec/glsl-1.00/compiler/assignment-operators/modulus-assign-00.frag
spec/glsl-1.10/compiler/arithmetic-operators/modulus-00.frag
spec/glsl-1.10/compiler/assignment-operators/modulus-assign-00.frag
spec/glsl-1.20/compiler/arithmetic-operators/modulus-00.frag
spec/glsl-1.20/compiler/assignment-operators/modulus-assign-00.frag
2011-02-08 09:37:03 -08:00
Marek Olšák
69e5516308 r600g: fixup assertion 2011-02-08 18:18:13 +01:00
Marek Olšák
71df812146 r600g: add a faster implementation of transfer_inline_write
u_default_transfer_inline_write uses util_copy_rect, which is kinda slow.
2011-02-08 17:47:00 +01:00
Marek Olšák
f0b202ec73 r600g: slab-allocate buffer and transfer structures 2011-02-08 17:30:39 +01:00
Marek Olšák
b541a3c4c0 r300g: use the same upload buffer for vertices and indices 2011-02-08 16:35:02 +01:00
Marek Olšák
467023e808 r600g: use the same upload buffer for vertices, indices, and constants
This should reduce memory consumption.
2011-02-08 16:35:02 +01:00
Thomas Hellstrom
8042470057 mesa/st: Plug a fragment program variant parameter leak
Fixes a minor memory leak with the "engine" mesa demo.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-02-08 08:13:39 -07:00
Brian Paul
5cbff0932e st/mesa: free the temporary bitmap/drawpix shader code
Fixes a per-shader memory leak when drawing glBitmaps, glDrawPixels
or glCopyPixels.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
2011-02-08 08:10:22 -07:00
Marek Olšák
1ee71bdc8a u_vbuf_mgr: add a way to specify the BIND flag for the upload buffer 2011-02-08 15:20:11 +01:00
Marek Olšák
7628c4ecb6 u_vbuf_mgr: remove tabs 2011-02-08 15:18:46 +01:00
Marek Olšák
f53cbf8bb0 u_vbuf_mgr: make the uploader public 2011-02-08 15:08:04 +01:00
Marek Olšák
d8d5c2660f Revert "r600g: do not flush the uploader" (with comments)
This reverts commit 1c2a4f0820.
2011-02-08 14:48:12 +01:00
Brian Paterni
4d78dafc84 r600g: silence a few valgrind warnings 2011-02-08 12:48:44 +01:00
Thomas Hellstrom
bb1036aae5 mesa/st: Fix vertex buffer leak
Make sure we unreference the vertex buffer pointers in a local array.
This fixes huge vertex buffer / memory leaks in mesa demos "fire" and "engine".

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

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2011-02-08 11:01:21 +01:00
Kristian Høgsberg
1e1b89103e wayland-egl: Add struct wl_egl_display argument to +wl_egl_window_create() 2011-02-07 20:50:18 -05:00
Henri Verbeet
077c448d18 r600g: Add support for relative addressing on constant buffers.
Relative addressing of constant buffers can't work properly through the
kcache, since you can only address within the currently locked kcache window.
Instead, this patch binds the constant buffer as a shader resource, and then
explicitly fetches the constant using a vertex fetch with fetch type
VTX_FETCH_NO_INDEX_OFFSET from the shader. There's probably still some room
for improvement, doing the fetch right before the instruction that needs the
value may not be quite optimal for example.
2011-02-07 15:22:08 +01:00
Henri Verbeet
871460eb14 r600g: Set the fetch type in r600_bc_vtx_build(). 2011-02-07 15:22:08 +01:00
Henri Verbeet
4c30a80e38 r600g: Handle the ADD_INT instruction in r600_bc_get_num_operands(). 2011-02-07 15:22:07 +01:00
Henri Verbeet
5c59eebfae r600g: Generalize the pipe_add_vertex_attrib() functions.
This allows them to be used for VS or PS buffer resources as well.
2011-02-07 15:22:07 +01:00
Henri Verbeet
b9fd1a1e4b r600g: Remove vs_resource and ps_resource from the pipe context.
These are practically unused, only the vs_resource array is being abused for
fetch shader resources.
2011-02-07 15:22:07 +01:00
Henri Verbeet
7687eabaa0 r600g: Split constants in r600_shader_from_tgsi(). 2011-02-07 15:22:07 +01:00
Henri Verbeet
1fa95c7f9e r600g: Do the tgsi_full_src_register to r600_shader_src conversion in r600_shader_from_tgsi(). 2011-02-07 15:22:07 +01:00
Henri Verbeet
a77e813de3 r600g: Split r600_bc_alu_src.
The r600_bc_alu_src structure is used in two different ways, as a vector and
for the individual channels of that same vector. This is somewhat fragile,
and probably confusing.
2011-02-07 15:22:07 +01:00
Henri Verbeet
3b1c1f0253 r600g: Store literal values in the r600_bc_alu_src structure.
This is much easier to work with, and allows use to get rid of some of the
literal handling hacks.
2011-02-07 15:22:07 +01:00
Henri Verbeet
80235d92e6 r600g: tgsi_dst() can't fail. 2011-02-07 15:22:07 +01:00
Henri Verbeet
d0f2ffad76 r600g: tgsi_src() can't fail. 2011-02-07 15:22:07 +01:00
Kristian Høgsberg
56758c839f wayland-egl: Force roundtrips to get device name and authenticate correctly
If the client hasn't done the initial wl_display_iterate() at the time
we initialize the display, we have to do that in platform_wayland.c.
Make sure we detect that correctly instead of dup()ing fd=0, and use
the sync callback to make sure we don't wait forever for authorization that
won't happen.
2011-02-07 14:01:31 +01:00
Benjamin Franzke
93aea84f47 egl_dri2: Add wayland platform 2011-02-07 14:01:31 +01:00
Benjamin Franzke
9630437fc9 egl_dri2: Export dri2_get_driver_for_fd 2011-02-07 14:01:31 +01:00
Benjamin Franzke
a8128d7d4b egl_dri2: Enable pixmap bind_to_texture according to the extension 2011-02-07 14:01:30 +01:00
Benjamin Franzke
381ea0d67a st/egl: Add wayland platform 2011-02-07 14:01:16 +01:00
Benjamin Franzke
9b6dc9b7a4 st/egl: drm_image: Check for MESA_drm_image
MESA_drm_image isnt limited to drm platform,
others can enable the extension too.
2011-02-07 13:55:29 +01:00
Benjamin Franzke
464cb3a09e st/egl: native_helper: Add resource_surface_import_resource 2011-02-07 13:55:29 +01:00
Benjamin Franzke
214fc6e850 egl: Implement libwayland-egl
This library is required and defined by wayland for
EGL implementations supporting wayland.
2011-02-07 13:55:20 +01:00
Benjamin Franzke
e586c4b763 egl: Add wayland platform 2011-02-07 13:52:29 +01:00
Benjamin Franzke
2adfde3aae intel: Implement dri2::{Allocate,Release}Buffer 2011-02-07 13:52:28 +01:00
Benjamin Franzke
f8e939a3a7 st/dri: Implement dri2::{Allocate,Release}Buffer 2011-02-07 13:52:28 +01:00
Benjamin Franzke
1b8ef9416b Add dri2::{Allocate,Release}Buffer extension 2011-02-07 13:52:28 +01:00
Marek Olšák
a22bda9f80 r600g: correctly report supported vertex formats 2011-02-07 03:51:53 +01:00
Marek Olšák
c95bc1224a r300g: use the new vertex buffer manager 2011-02-07 02:46:23 +01:00
Marek Olšák
aa8a2224a3 r600g: use the new vertex buffer manager 2011-02-07 02:46:17 +01:00
Marek Olšák
975320ab76 util: import a new vertex buffer manager
This code has originally matured in r300g and was ported to r600g several
times. It was obvious it's a code duplication.

See also comments in the header file.
2011-02-07 02:23:46 +01:00
Marek Olšák
1c2a4f0820 r600g: do not flush the uploader 2011-02-06 21:13:58 +01:00
Marek Olšák
529d867207 r300g: do not flush the uploader
We don't have to unmap and recreate the upload buffer when a flush occurs.
This should also prevent buffer allocations from failing.
2011-02-06 21:12:51 +01:00
Marek Olšák
ec96b0ecdb configure.ac: correctly check for libdrm_radeon version 2011-02-06 15:47:00 +01:00
Marek Olšák
4ad3b27cee r300g: RS400 doesn't have ZMASK 2011-02-06 15:46:51 +01:00
Dave Airlie
780c183b8f r600g: use surface format not underlying texture format
This uses the surface format to set the CB up not the underlying texture
format, since these can and do differ.

Fixes piglit fbo-srgb.
2011-02-06 19:00:04 +10:00
Tom Stellard
68b701f5de r300/compiler: Disable register rename pass on r500
The scheduler and the register allocator are not good enough yet to deal
with the effects of the register rename pass.  This was causing a 50%
performance drop in Lightsmark.  The pass can be re-enabled once the
scheduler and the register allocator are more mature.  r300 and r400
still need this pass, because it prevents a lot of shaders from using
too many texture indirections.

NOTE: This is a candidate for the 7.10 branch.
2011-02-05 22:39:58 -08:00
Tom Stellard
19202284c0 r300/compiler: Don't count BEGIN_TEX instructions in the compiler stats 2011-02-05 00:27:24 -08:00
Dave Airlie
88ffa9ce5b mesa/965: add support for GL_EXT_framebuffer_sRGB (v2)
This adds i965 support for GL_EXT_framebuffer_sRGB, it introduces a new
constant to say that the driver can support sRGB enabled FBOs since enabling
the extension doesn't mean the driver can actually support sRGB.

Also adds the suggested state flush in the core code suggested by Brian.

fix the ARB_fbo color encoding.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-02-05 17:06:30 +10:00
Ian Romanick
5c3f1cdbbe mesa: Fix error checks in GetVertexAttrib functions
Querying index zero is not an error in OpenGL ES 2.0.

Querying an index larger than the value returned by
GL_MAX_VERTEX_ATTRIBS is an error in all APIs.

Fixes bugzilla #32375.
2011-02-04 12:10:05 -08:00
Ian Romanick
ce9171f9d8 linker: Generate link errors when ES shaders are missing stages
ES requires that a vertex shader and a fragment shader be present.

Fixes bugzilla #32214.
2011-02-04 12:10:04 -08:00
Vinson Lee
425ba19832 glsl: Add opt_copy_propagation_elements.cpp to SConscript.
Fixes SCons build.
2011-02-04 11:47:01 -08:00
Eric Anholt
1b80622c4e i965: Drop the dead tracking of color_regions[].
We pull the draw regions right out of the renderbuffers these days.
2011-02-04 12:18:38 -06:00
Eric Anholt
95cdce7f70 i965: Drop the INTEL_DEBUG=state spam about the cache size check.
There's way more interesting info in INTEL_DEBUG=state if you could find
it among the state size checks.
2011-02-04 12:18:38 -06:00
Eric Anholt
29a2e9133e glsl: Remove extra checks for constant true assignment conditions.
These are already stripped by opt_constant_folding.cpp.
2011-02-04 12:18:38 -06:00
Eric Anholt
b6d49ab843 glsl: Fix a comment typo in copy propagation. 2011-02-04 12:18:38 -06:00
Eric Anholt
e31266ed3e glsl: Add a new opt_copy_propagation variant that does it channel-wise.
This patch cleans up many of the extra copies in GLSL IR introduced by
i965's scalarizing passes.  It doesn't result in a statistically
significant performance difference on nexuiz high settings (n=3) or my
demo (n=10), due to brw_fs.cpp's register coalescing covering most of
those extra moves anyway.  However, it does make the debug of wine's
GLSL shaders much more tractable, and reduces instruction count of
glsl-fs-convolution-2 from 376 to 288.
2011-02-04 12:18:38 -06:00
Vinson Lee
cde443e0b9 ralloc: Add missing va_end following va_copy. 2011-02-03 22:10:16 -08:00
Dave Airlie
3188a7deb3 r600g: don't set tile_type on evergreen.
Since we never bind the actual DB to the CB/texture only the flushed one
we don't need to track the tile type at the moment.
2011-02-04 15:26:41 +10:00
Dave Airlie
fdd35dc912 r600g: fix evergreen sampler view + depth interaction 2011-02-04 15:26:09 +10:00
Vinson Lee
9ee765197c util: Change u_get_transfer_vtbl usage argument type to match prototype.
The type of u_get_transfer_vtbl of the usage argument in u_transfer.h is
unsigned and not enum pipe_transfer_usage. This patch changes the type
of usage to unsigned to match the prototype in the header file.
2011-02-03 20:15:25 -08:00
Vinson Lee
61c59234f9 glsl: Add using statements for standard library functions.
Standard library functions in C++ are in the std namespace. When using
C++-style header files for the standard library, some compilers, such as
Sun Studio, provide symbols only for the std namespace and not for the
global namespace.

This patch adds using statements for standard library functions. Another
option could have been to prepend standard library function calls with
'std::'.

This patch fixes several compilation errors with Sun Studio.
2011-02-03 19:19:12 -08:00
Dave Airlie
151a945d38 r600g: get offset for correct texture when setting up CB.
this fixes the mipmap tests with tiling forced on.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-02-04 09:38:01 +10:00
Dave Airlie
812c314e51 r600g: avoid trying to flush the flushing texture.
Since these textures still have the depth bit set.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-02-04 09:36:02 +10:00
Dave Airlie
8c643446f9 r600g: evergreen CB check for flushed texture 2011-02-04 09:34:32 +10:00
Dave Airlie
2271c793e8 r600g: flushing texture needs all levels.
For mipmap generation we need all levels in the flushing texture.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-02-04 09:09:45 +10:00
Dave Airlie
cd6864c079 r600g: remove unused variables 2011-02-04 09:09:45 +10:00
Dave Airlie
3e9bc43fba r600g: add a flag to just create flushed texture without flushing.
This just adds a flag to create the texture without doing any
flushing to it. Flushing occurs in the draw function. This avoids
unnecessary flushes when we end up rebinding a CB/DB/texture due
to the blitter just restoring state.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-02-04 09:09:45 +10:00
Dave Airlie
446bc12c17 r600g: also check CB bindings for textures to depth flush.
This checks the color buffer bindings to make sure there is something
to flush.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-02-04 09:09:44 +10:00
Dave Airlie
4b49fcbb9a r600g: flush depth texture before a blit from it.
If we are going to blit from a depth texture we need to flush
it before we blit from it.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-02-04 09:09:44 +10:00
Brian Paul
5026841d5e svga: rename a couple sampler, sampler view functions 2011-02-03 14:22:21 -07:00
Brian Paul
e40252d4d9 gallium/svga: added debug code for dumping framebuffer images (disabled) 2011-02-03 14:22:21 -07:00
Brian Paul
73e37d933d gallium/docs: more info about setting samplers and sampler views
Plus other assorted clarifications.
2011-02-03 13:47:12 -07:00
Brian Paul
c5fb2c60bf cso: don't tell drivers to bind null samplers, sampler views
Before, the set_sampler_views() and restore_sampler_views() functions
used MAX2(old,new) to tell the driver how many samplers or sampler
views to set.  This could result in cases such as:

pipe->set_fragment_sampler_views(pipe, 4, views={foo, bar, NULL, NULL})

Many/most gallium drivers would take this as-is and set
ctx->num_sampler_views=4 and ctx->sampler_views={foo, bar, NULL, NULL, ...}.
Later, loops over ctx->num_sampler_views would have to check for null
pointers.  Worse, the number of sampler views and number of sampler CSOs
could get out of sync:

ctx->num_samplers = 2
ctx->samplers = {foo, bar, ...}
ctx->num_sampler_views = 4
ctx->sampler_views={Foo, Bar, NULL, NULL, ...}

So loops over the num_samplers could run into null sampler_views pointers
or vice versa.

This fixes a failed assertion in the SVGA driver when running the Mesa
engine demo in AA line mode (and possibly other cases).

It looks like all gallium drivers are careful to unreference views
and null-out sampler CSO pointers for the units beyond what's set
with the pipe::bind_x_sampler_states() and pipe::set_x_sampler_views()
functions.

I'll update the gallium docs to explain this as well.
2011-02-03 13:47:11 -07:00
Henri Verbeet
a6a710cbe7 r600g: Make some more things static. 2011-02-03 21:13:12 +01:00
Henri Verbeet
d06b990096 r600g: Get rid of the unused r600_cf_vtx_tc() function. 2011-02-03 21:13:12 +01:00
Henri Verbeet
d17d03a8dc r300g: Make the buffer and texture vbtls static const. 2011-02-03 21:13:12 +01:00
Henri Verbeet
126e98966d r600g: Make the buffer and texture vbtls static const. 2011-02-03 21:13:12 +01:00
Alex Deucher
4668ad36f3 egl_dri2: Add new radeon pci ids
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-02-03 14:35:54 -05:00
Kristian Høgsberg
9dc5de5bb1 egl_dri2: Split out drm platform implementation to a separate file 2011-02-03 11:59:38 -05:00
Kristian Høgsberg
2889d9640f egl_dri2: Split out x11 platform code 2011-02-03 11:59:38 -05:00
Haitao Feng
b43a147128 swrast: add an interface createNewContextForAPI
This new interface could set up context for OpenGL,
OpenGL ES1 and OpenGL ES2. It will be used by egl_dri2
driver.

Signed-off-by: Haitao Feng <haitao.feng@intel.com>
2011-02-03 11:59:30 -05:00
José Fonseca
610c24b19d svga: Fix resource leak; undo temporary workaround.
Leak was introduced when fixing strict aliasing violation in this code:
the reference counting was preserved, but the destructor call on zero
reference count was not.
2011-02-03 16:14:02 +00:00
José Fonseca
0f3eeb45c7 svga: Temporarily disable buffer DMA upload coalescing.
See comment for more details.
2011-02-03 15:15:23 +00:00
José Fonseca
637ed52f59 svga/drm: Flushing preemptively on a 1/3 of the aperture.
Exactly one half would be the ideal, but this is a soft limit, and one
more byte over brings us to synchronous behavior.

Flushing when the referred GMR exceeds one third of the aperture gives us
statistically better performance.
2011-02-03 15:15:23 +00:00
José Fonseca
b6b6b8f8bb util: Prevent transfer dangling pointer on map failure. 2011-02-03 15:15:23 +00:00
José Fonseca
5c296a583d svga: Don't call swc->flush directly.
Only svga_context_flush should do it, to ensure upload commands are not
submitted to hardware in an inconsistent state.
2011-02-03 15:15:23 +00:00
José Fonseca
9d4488e4a8 svga: Add an assert to catch reentrancy. 2011-02-03 15:15:23 +00:00
José Fonseca
63c0a504a0 svga/drm: Update for pb_vtbl::map argument addition. 2011-02-03 15:15:23 +00:00
Michel Dänzer
7535f93e5a r300c: Unbreak after R4xx support was added to r300/compiler. 2011-02-03 13:25:16 +01:00
José Fonseca
82e79e93ac scons: Eliminate libgcc_s_sjlj-1.dll dependency
Certain mingw32 cross compilers (e.g. RedHat's) defaults to use DLL gcc
runtime.

Given the main deliverable from this project are self-contained drivers,
which are loaded by any application, this dependency can cause havoc.
2011-02-03 09:16:49 +00:00
Dave Airlie
aa31a5cbc7 r600g: flush differences back to DB copy. 2011-02-03 14:19:52 +10:00
Dave Airlie
417cfa60b2 r600g: fix depth hw resource copies.
With the previous fixes we can now enabled hw depth copies

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-02-03 14:19:37 +10:00
Dave Airlie
5730d56549 r600g: only set depth bit for hw accessible depth buffers.
If we get a sw accessible buffer like the S8 texture we end up
doing depth tracking on it when there is no need since we won't
ever bind it to the hardware. This leads to a sw fallback in the
transfer destruction which leads to and endless recusion loop
of fail in transfer destroy.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-02-03 14:18:01 +10:00
Dave Airlie
b13b7b86b2 r600g: rework dirty / depth texture tracking.
this adds a flag to keep track of whether the depth texture structure
is the flushed texture or not, so we can avoid doing flushes when
we do a hw rendering from one to the other.

it also renames flushed to dirty_db which tracks if the DB copy
has been dirtied by being bound to the hw.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-02-03 14:17:05 +10:00
Dave Airlie
d0293290ad r600g: set correct pitch/offset for depth textures in flushed state.
This fixes zreaddraw in tiling mode
2011-02-03 14:12:32 +10:00
Brian Paul
4629be0509 softpipe: rename sampler[] -> fragment_samplers[] 2011-02-02 20:43:56 -07:00
Brian Paul
843f206a34 softpipe: rename fragment sampler/view fields
To be consistant with vertex, geometry sampler fields.
2011-02-02 20:30:56 -07:00
Brian Paul
c06fa98c86 cso: refactor texture sampler and sampler view code
This consolidates the code duplicated between the fragment sampler
and vertex sampler functions.  Plus, it'll make adding support for
geometry shader samplers trivial.
2011-02-02 20:28:00 -07:00
Brian Paul
5f30e0b231 cso: rename fragment sampler-related fields
To better distinguish from vertex sampler fields.
2011-02-02 18:14:48 -07:00
Brian Paul
d087cfaabf cso: fix loop bound in cso_set_vertex_samplers()
Before we were looping to nr_samplers, which is the number of fragment
samplers, not vertex samplers.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
2011-02-02 18:11:30 -07:00
Chad Versace
fd1252ab67 glcpp: Raise error when modulus is zero
For example, this now raises an error:
   #define XXX 1 / 0

Fixes bug: https://bugs.freedesktop.org//show_bug.cgi?id=33507
Fixes Piglit test: spec/glsl-1.10/preprocessor/modulus-by-zero.vert

NOTE: This is a candidate for the 7.9 and 7.10 branches.
2011-02-02 10:19:51 -08:00
Chad Versace
e7c1f058d1 glsl: Avoid division-by-zero during constant-folding
Avoid division-by-zero when constant-folding the following expression
types:
    ir_unop_rsq
    ir_binop_div
    ir_binop_mod

Fixes bugs:
https://bugs.freedesktop.org//show_bug.cgi?id=33306
https://bugs.freedesktop.org//show_bug.cgi?id=33508

Fixes Piglit tests:
glslparsertest/glsl2/div-by-zero-01.frag
glslparsertest/glsl2/div-by-zero-02.frag
glslparsertest/glsl2/div-by-zero-03.frag
glslparsertest/glsl2/modulus-zero-01.frag
glslparsertest/glsl2/modulus-zero-02.frag

NOTE: This is a candidate for the 7.9 and 7.10 branches.
2011-02-02 09:55:35 -08:00
Chad Versace
b3cf92aa91 glsl: Fix constant-folding for reciprocal expressions
Do not constant-fold a reciprocal if any component of the reciprocated
expression is 0. For example, do not constant-fold `1 / vec4(0, 1, 2, 3)`.

Incorrect, previous behavior
----------------------------
Reciprocals were constant-folded even when some component of the
reciprocated expression was 0. The incorrectly applied arithmetic was:
   1 / 0 := 0
For example,
   1 / vec4(0, 1, 2, 3) = vec4(0, 1, 1/2, 1/3)

NOTE: This is a candidate for the 7.9 and 7.10 branches.
2011-02-02 09:54:52 -08:00
José Fonseca
50278c0901 svga: Flush upload buffers or we get asserts
Based on work from Jakob Bornecrantz, Michel Dänzer, and Brian Paul.
2011-02-02 11:28:41 +00:00
Kenneth Graunke
dfdb9fda82 glsl: Fix use of uninitialized values in _mesa_glsl_parse_state ctor.
This has probably existed since e5e34ab18e or so.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
2011-02-01 23:53:39 -08:00
Kenneth Graunke
cfd8d45ccd glsl: Fix invalid use of ralloc_asprintf in prototype_string.
This was my mistake when converting from talloc to ralloc.  I was
confused because the other calls in the function are to asprintf_append
and the original code used str as the context rather than NULL.

Fixes bug #33823.
2011-02-01 23:31:35 -08:00
Christian König
8ca3b140eb r600g: use burst exports in shaders
Join multiple exports into just one instruction
instead of exporting each register separately.
2011-02-02 01:33:03 +01:00
Alex Deucher
8503cffc4c r200: remove 0x4243 pci id
There's no such device.  0x4243 is a pci bridge id,
not a GPU.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-02-01 19:13:54 -05:00
Ian Romanick
a04582739e i915: Only mark a register as available if all components are written
Previously a register would be marked as available if any component
was written.  This caused shaders such as this:

  0: TEX TEMP[0].xyz, INPUT[14].xyyy, texture[0], 2D;
  1: MUL TEMP[1], UNIFORM[0], TEMP[0].xxxx;
  2: MAD TEMP[2], UNIFORM[1], TEMP[0].yyyy, TEMP[1];
  3: MAD TEMP[1], UNIFORM[2], TEMP[0].zzzz, TEMP[2];
  4: ADD TEMP[0].xyz, TEMP[1].xyzx, UNIFORM[3].xyzx;
  5: TEX TEMP[1].w, INPUT[14].xyyy, texture[0], 2D;
  6: MOV TEMP[0].w, TEMP[1].wwww;
  7: MOV OUTPUT[2], TEMP[0];
  8: END

to produce incorrect code such as this:

  BEGIN
  DCL S[0]
  DCL T_TEX0
  R[0] = MOV T_TEX0.xyyy
  U[0] = TEXLD S[0],R[0]
  R[0].xyz = MOV U[0]
  R[1] = MUL CONST[0], R[0].xxxx
  R[2] = MAD CONST[1], R[0].yyyy, R[1]
  R[1] = MAD CONST[2], R[0].zzzz, R[2]
  R[0].xyz = ADD R[1].xyzx, CONST[3].xyzx
  R[0] = MOV T_TEX0.xyyy
  U[0] = TEXLD S[0],R[0]
  R[1].w = MOV U[0]
  R[0].w = MOV R[1].wwww
  oC = MOV R[0]
  END

Note that T_TEX0 is copied to R[0], but the xyz components of R[0] are
still expected to hold a calculated value.

Fixes piglit tests draw-elements-vs-inputs, fp-kill, and
glsl-fs-color-matrix.  It also fixes Meego bugzilla #13005.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
2011-02-01 13:43:36 -08:00
Ian Romanick
20d278a7ff mesa: glGetUniform only returns a single element of an array
Also return it as the correct type.  Previously the whole array would
be returned and each element would be expanded to a vec4.

Fixes piglit test getuniform-01 and bugzilla #29823.
2011-02-01 09:48:41 -08:00
José Fonseca
3c701f1d61 glsl: Fix printf_length() on MSVC. 2011-02-01 10:41:46 +00:00
Kenneth Graunke
a7d350790b glsl: Fix memory error when creating the supported version string.
Passing ralloc_vasprintf_append a 0-byte allocation doesn't work.  If
passed a non-NULL argument, ralloc calls strlen to find the end of the
string.  Since there's no terminating '\0', it runs off the end.

Fixes a crash introduced in 14880a510a.
2011-02-01 00:20:01 -08:00
Dave Airlie
11bc8991e9 r600g: just change tile type when buffer is set to depth.
Not 100% sure on this one, but this is how it should work,
the question is whether it will uncover other bugs elsewhere.
2011-02-01 14:38:45 +10:00
Dave Airlie
a112cc283d r600g: align the tiling modes with what the DDX and kernel expects.
If we see a MACRO bit on r600g its 2D tiled,
if don't see a MACRO bit and we do see a MICRO bit then its 1D tiled.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-02-01 14:23:35 +10:00
Dave Airlie
8b5a50b31c r600g: fix evergreen for depth decompress test 2011-02-01 13:06:35 +10:00
Dave Airlie
aee5f1e40c r600: only decompress depth when its tile type is wrong.
If the tile type for the buffer is 1 then its been bound to the
DB at some point, we need to decompress it, otherwise its only
been bound as texture/cb so don't do anything.

This fixes 5 piglit tests here on r600g.
2011-02-01 13:02:56 +10:00
Kenneth Graunke
3ef397dafc texture_builtins.py: Fix a warning about mixed tabs/spaces. 2011-01-31 16:41:34 -08:00
Dave Airlie
42b5f68198 r600g: start looking at evergreen tiling.
this just adds the ioctl interface and sets the tile type
and array mode in the correct place.

This seems to bring eg 1D tiling to the same level, and issues
as on r600. No idea how to address 2D yet.
2011-02-01 10:36:57 +10:00
Henri Verbeet
d171ae086b r600g: Actually use the info from the flushed depth texture when creating a sampler view on a depth texture.
R600/R700 was using incorrect tiling information from the (compressed) depth
buffer. Evergreen worked anyway because tiling doesn't work.
2011-02-01 01:19:16 +01:00
Ian Romanick
5e19b5ad16 glsl: Refresh autogenerated lexer and parser files.
For the previous commit.
2011-01-31 15:32:56 -08:00
Ian Romanick
14880a510a glsl: Reject shader versions not supported by the implementation
Previously we'd happily compile GLSL 1.30 shaders on any driver.  We'd
also happily compile GLSL 1.10 and 1.20 shaders in an ES2 context.
This has been a long standing FINISHME in the compiler.

NOTE: This is a candidate for the 7.9 and 7.10 branches
2011-01-31 15:32:56 -08:00
Ian Romanick
e5e34ab18e glsl: Ensure that all GLSL versions are supported in the stand-alone compiler
NOTE: This is a candidate for the 7.9 and 7.10 branches
2011-01-31 15:32:56 -08:00
Ian Romanick
bf9850db22 glsl: Fix dependencies / linkage for glsl_compiler 2011-01-31 15:32:55 -08:00
Ian Romanick
09e15ac76a mesa: Initial size for secondary color array is 3
See table 6.7 on page 347 of the OpenGL 3.0 specification.
2011-01-31 15:32:55 -08:00
Christian König
7fb722c35c r600g: fix invalid ref count handling in r600_set_constant_buffer
Only decrement ref count if r600_upload_const_buffer
really changes the buffer.
2011-01-31 23:38:10 +01:00
Brian Paul
a8c144a388 llvmpipe: fix incorrect array index in image dump code 2011-01-31 14:09:24 -07:00
Brian Paul
a1f5c46d24 glsl: regerated files 2011-01-31 14:09:24 -07:00
Brian Paul
aacd07d623 glsl: make _token_list_is_empty_ignoring_space() static
To silence warning about missing prototype.
2011-01-31 14:09:24 -07:00
Brian Paul
3b8c7d70b3 scons/glsl: add top-level 'include' dir to CPPPATH
To avoid using the /usr/include/GL/gl.h file which may be lacking
some special #defines.
2011-01-31 14:09:24 -07:00
Brian Paul
59c957b688 glsl: add cast to silence signed/unsigned comparison warning 2011-01-31 14:09:24 -07:00
José Fonseca
3ae7aa3403 glsl: Define va_copy on MSVC. 2011-01-31 20:53:03 +00:00
Kenneth Graunke
0f7325b890 i965: Emit texel offsets in sampler messages. 2011-01-31 11:10:59 -08:00
Kenneth Graunke
ca418cbde6 glsl/builtins: Uncomment prototypes for texture*Offset functions. 2011-01-31 11:10:59 -08:00
Kenneth Graunke
ba3de801ec texture_builtins.py: Generate texture*Offset functions. 2011-01-31 11:10:59 -08:00
Kenneth Graunke
4c63f2de2f texture_builtins.py: Generalize the "use_proj" field to support offsets.
Rather than passing "True", pass a bitfield describing the particular
variant's features - either projection or offset.

This should make the code a bit more readable ("Proj" instead of "True")
and make it easier to support offsets in the future.
2011-01-31 11:10:59 -08:00
Kenneth Graunke
99f36486eb texture_builtins.py: Refactor coordinate dimension calculations.
For offsets, we'll want the straight sampler dimensionality, without the
+1 for array types.  Create a new function to do that; refactor.
2011-01-31 11:10:59 -08:00
Kenneth Graunke
819d57fce9 glsl: Introduce a new "const_in" variable mode.
This annotation is for an "in" function parameter for which it is only legal
to pass constant expressions.  The only known example of this, currently,
is the textureOffset functions.

This should never be used for globals.
2011-01-31 11:10:59 -08:00
Kenneth Graunke
c5a27b5939 glsl: Change texel offsets to a single vector rvalue.
Having these as actual integer values makes it difficult to implement
the texture*Offset built-in functions, since the offset is actually a
function parameter (which doesn't have a constant value).

The original rationale was that some hardware needs these offset baked
into the instruction opcode.  However, at least i965 should be able to
support non-constant offsets.  Others should be able to rely on inlining
and constant propagation.
2011-01-31 11:10:59 -08:00
Kenneth Graunke
60c8e91c79 glsl: Re-synchronize ir_variable_mode and the printer's string array.
Since the introduction of ir_var_system_value, system variables would be
printed as "temporary" and temporaries would result in out-of-bounds
array access, showing up as garbage in printed IR.
2011-01-31 11:04:37 -08:00
Vinson Lee
8c115aa247 scons: Gracefully handle pkg-config errors with libdrm_radeon.
Print warnings and continue build.
2011-01-31 10:50:06 -08:00
Kenneth Graunke
1568b19e3b Remove the talloc sources from the Mesa repository. 2011-01-31 10:17:10 -08:00
Kenneth Graunke
8aac5d123c Remove talloc from the SCons build system. 2011-01-31 10:17:10 -08:00
Kenneth Graunke
d1d8120545 Remove talloc from the make and automake build systems. 2011-01-31 10:17:09 -08:00
Kenneth Graunke
42fd9c2ebb ralloc: a new MIT-licensed recursive memory allocator. 2011-01-31 10:17:09 -08:00
Kenneth Graunke
d3073f58c1 Convert everything from the talloc API to the ralloc API. 2011-01-31 10:17:09 -08:00
Kenneth Graunke
dc55254f5b ralloc: Add a fake implementation of ralloc based on talloc. 2011-01-31 10:17:09 -08:00
Henri Verbeet
7d9e0ea739 glx: Properly check for a valid fd in dri2CreateScreen().
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-01-31 10:54:04 -07:00
Michel Dänzer
5a1ce49c82 svga: Fix translation of TGSI SSG opcode.
SVGA3D only supports SGN for vertex shaders, and this requires two additional
temporary registers for intermediate results.

For fragment shaders, lower to two CMPs and one ADD.
2011-01-31 17:47:57 +01:00
Michel Dänzer
11c11ee0bc svga: TEXLDL opcode dst/src register information is correct. 2011-01-31 17:47:14 +01:00
Michel Dänzer
a61b7aa90d svga: Print the number and mnemonic of the opcode we're missing information for.
Makes it easier to figure out which opcode it's about.
2011-01-31 17:45:07 +01:00
Henri Verbeet
0b47d59e5b glx: Fix leaks in DRISW screen creation error paths.
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-01-31 09:31:24 -07:00
Henri Verbeet
0e8e8ba29a glx: Fix leaks in DRI screen creation error paths.
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-01-31 09:31:21 -07:00
Henri Verbeet
bfc889517a glx: Fix leaks in DRI2 screen creation error paths.
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-01-31 09:29:54 -07:00
Julien Cristau
cbe9fc12a6 glx: fix length of GLXGetFBConfigsSGIX
The extra length is the size of the request *minus* the size of the
VendorPrivate header, not the addition.

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

Signed-off-by: Julien Cristau <jcristau@debian.org>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-01-31 09:28:55 -07:00
Julien Cristau
e27913f805 glx: fix GLXChangeDrawableAttributesSGIX request
xGLXChangeDrawableAttributesSGIXReq follows the GLXVendorPrivate header
with a drawable, number of attributes, and list of (type, value)
attribute pairs.  Don't forget to put the number of attributes in there.
I don't think this can ever have worked.

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

Signed-off-by: Julien Cristau <jcristau@debian.org>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-01-31 09:28:37 -07:00
Dave Airlie
ea5ede2178 r600g: fix eg OQ properly.
the context init is separate for these gpus.
2011-01-31 20:44:47 +10:00
Alex Deucher
26a4c1cb65 r600g: fix OQ on evergreen
6xx/7xx have a max of 4 DBs, evergreen have a max of 8.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-01-31 02:49:27 -05:00
Dave Airlie
df8089df90 r600g: fix occlusion query results.
Like on some r5xx, there are multiple DB backends on the r600,
we need to add up the query results from each of these to get the
final correct value.

So far I'm not 100% sure how to calculate the num_db, value
setting it to 4 should be harmless enough until we do.

This fixes occulsion_query piglit test on my rv740.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-01-31 16:14:03 +10:00
Alex Deucher
2f7c876ff5 r600g: remove some non-existent evergreen reg fields
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-01-30 22:41:59 -05:00
Dave Airlie
065c8696e7 r600g: fix regression in cubemap tests since eea1d8199b
Although CUBE is a reduction inst, it writes to more than just PV.X
so we need to keep the dst channel.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-01-31 13:06:17 +10:00
Dave Airlie
5555cd776b r600g: handle the write all cbufs property.
This only works on r600/r700 so far, evergreen doesn't appear
to have the multiwrite enable bit in the color control, so we
may have to actually do a shader rewrite on EG hardware.

remove some duplicate code reg defines also.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-01-31 10:01:06 +10:00
Henri Verbeet
f668b464c0 util: Call tables should be const. 2011-01-30 18:59:13 +01:00
Henri Verbeet
38b54158b6 r600g: Update the flushed depth texture after drawing to the corresponding texture.
I know Jerome will probably rewrite the way depth textures work sometime
soon. For the time being this should at least make common depth texture usage
for shadowing work properly though.
2011-01-30 18:59:13 +01:00
Chia-I Wu
3f0a966807 st/vega: Disable blending when the paint is opaque.
When the paint is opaque (currently, solid color with alpha 1.0f), no
blending is needed for VG_BLEND_SRC_OVER.  This eliminates the serious
performance hit introduced by 859106f196
for a common scenario.
2011-01-30 23:22:40 +08:00
Chia-I Wu
e919dee1ed st/vega: Remove an invalid sanity check.
Before create_handle returns, obj->handle is 0.  Calling
handle_to_object will fail.
2011-01-30 23:22:40 +08:00
Chia-I Wu
05e5b53128 st/vega: s/vg[A-Z]/vega[A-Z]/. 2011-01-30 23:22:40 +08:00
José Fonseca
11b15c4d25 scons: We have C++ in several libraries, so always link with the C++ compiler
Prevents missing symbols in libGL.so when LLVM is disabled.
2011-01-30 11:19:44 +00:00
Vinson Lee
cad0520179 r600g: Fix void pointer arithmetic.
Fixes SCons build.
2011-01-30 01:08:54 -08:00
Dave Airlie
71f610e26e r600g: fixes a segfault in the piglit fbo-genmipmap-formats test.
should be no need to unset this ptr here and if we don't end up using the
blitter we've just broken the state.
2011-01-30 18:09:25 +10:00
Tom Stellard
8f32c6cfc6 r300/compiler: Standardize the number of bits used by swizzle fields
Swizzles are now defined everywhere as a field with 12 bits that contains
4 channels worth of meaningful information.  Any channel that is unused is
set to RC_SWIZZLE_UNUSED.  This change is necessary because rgb instructions
and alpha instructions were initializing channels that would never be used
(channel 3 for rgb and channels 1-3 for alpha) with 0 (aka RC_SWIZZLE_X).
This made it impossible to use generic helper functions for swizzles,
because sometimes a channel value of 0 meant unused and other times it
meant RC_SWIZZLE_X.

All hacks that tried to guess how many channels were relevant have
also been removed.
2011-01-29 21:32:02 -08:00
Marek Olšák
debc45bca0 r300g: upload translated indices via the uploader 2011-01-30 03:29:49 +01:00
Marek Olšák
8d0a540020 r300g: rework vertex format fallback
1) Only translate the [min_index, max_index] range.
2) Upload translated vertices via the uploader.
3) Rename valid_vertex_buffer[] to real_vertex_buffer[]
2011-01-30 03:29:48 +01:00
Marek Olšák
77900843b4 r600g: upload translated indices via the uploader 2011-01-30 03:29:48 +01:00
Marek Olšák
73a40d1383 r600g: rework vertex format fallback
1) Only translate the [min_index, max_index] range.
2) Upload translated vertices via the uploader.
2011-01-30 03:29:48 +01:00
Marek Olšák
70e656b4eb r600g: fix vertex format fallback
This fixes:
- piglit/draw-vertices
- piglit/draw-vertices-half-float
2011-01-30 03:29:48 +01:00
Marek Olšák
8c631cfeae r600g: rework vertex buffer uploads
Only upload the [min_index, max_index] range instead of [0, userbuf_size].
This an important optimization.

Framerate in Lightsmark:
Before: 22 fps
After: 75 fps

The same optimization is already in r300g.
2011-01-30 03:29:48 +01:00
Marek Olšák
15730a8207 r600g: consolidate set_constant_buffer functions 2011-01-30 03:29:48 +01:00
Marek Olšák
73fb2b7c90 r600g: consolidate vertex_buffer_update functions 2011-01-30 03:29:48 +01:00
Marek Olšák
2d7738eb2b r600g: consolidate draw_vbo functions (v2)
Added a conditional to spi_update per Dave's comment.
2011-01-30 03:29:48 +01:00
Marek Olšák
5cefe1eddd r600g: make r600_drawl inherit pipe_draw_info 2011-01-30 03:29:48 +01:00
Marek Olšák
02f8f13464 r600g: add back u_upload_mgr integration
I can't see a performance difference with this code, which means all
the driver-specific code removed in this commit was unnecessary.

Now we use u_upload_mgr in a slightly different way than we did before it got
dropped. I am not restoring the original code "as is" due to latest
u_upload_mgr changes that r300g performance benefits from.

This also fixes:
- piglit/fp-kil
2011-01-30 03:29:48 +01:00
Christoph Bumiller
f8a7a0b6f3 nvc0: implement transform feedback state 2011-01-30 01:25:41 +01:00
Christoph Bumiller
7fd29468ec nvc0: enable PIPE_CAP_ARRAY_TEXTURES and fix them 2011-01-29 23:57:52 +01:00
Chia-I Wu
218381d927 egl_dri2: Export glapi symbols for DRI drivers.
When an app loads libEGL.so dynamically with RTLD_LOCAL, loading DRI
drivers would fail because of missing glapi symbols.  This commit makes
egl_dri2 load libglapi.so with RTLD_GLOBAL to export glapi symbols for
future symbol resolutions.

The same trick can be found in GLX.  However, egl_dri2 can only do so
when --enable-shared-glapi is given.  Because, otherwise, both libGL.so
and libglapi.so define glapi symbols and egl_dri2 cannot tell which
library to load.
2011-01-30 05:28:24 +08:00
Chia-I Wu
f36cba6cf3 egl: Make the transition to built-in drivers more smooth.
When the user sets EGL_DRIVER to egl_dri2 (or egl_glx), make sure the
built-in driver is used.  The user might leave the outdated egl_dri2.so
(or egl_glx.so) on the filesystem and we do not want to load it.
2011-01-30 04:55:08 +08:00
Chia-I Wu
b825e49552 mapi: Workaround a bug in makedepend.
makedepend would crash when a source includes a header indirectly, such
as

  #define HEADER "some-header.h"
  #include HEADER

Do not define HEADER (makedepend would detects this as an incomplete
include) and add the dependency manually in the Makefile.

This should hopefully fix bug #33374.
2011-01-29 19:22:54 +08:00
Marek Olšák
2a456dc123 u_blitter: use user buffers instead of real buffers
User buffers may be the fastest way to upload data.
2011-01-29 05:17:43 +01:00
Brian Paul
c5fb0518f4 gallium/docs: add info about transfer boxes and array textures 2011-01-28 20:25:27 -07:00
Brian Paul
f9a36a496f gallium: added comments to pipe_transfer 2011-01-28 20:25:27 -07:00
Brian Paul
1dd8e27578 st/mesa: fix texture array dimensions
For 1D/2D texture arrays use the pipe_resource::array_size field.
In OpenGL 1D arrays texture use the height dimension as the array
size and 2D array textures use the depth dimension as the array size.
Gallium uses a special array_size field instead.  When setting up
gallium textures or comparing Mesa textures to gallium textures we
need to be extra careful that we're comparing the right fields.

The new st_gl_texture_dims_to_pipe_dims() function maps OpenGL
texture dimensions to gallium texture dimensions and simplifies
this quite a bit.
2011-01-28 20:25:27 -07:00
Brian Paul
80777743b7 softpipe: fix array textures to use resource array_size
Don't use height for 1D array textures or depth for 2D array textures.
2011-01-28 20:25:27 -07:00
Brian Paul
b3cfcdf923 mesa: fix typo, wrap long line 2011-01-28 20:25:26 -07:00
Brian Paul
db3a8af7f9 st/mesa: pass layers param to st_texture_create() 2011-01-28 20:25:26 -07:00
Carl Worth
2a18d1950c Revert "glcpp: Demote "macro redefined" from an error to a warning"
This reverts commit d3df641f0a.

The original commit had sat unpushed on my machine for months. By the
time I found it again, I had forgotten that we had decided not to use
this change after all, (the relevant test was removed long ago).
2011-01-29 08:21:05 +10:00
Jakob Bornecrantz
3451ee056c util: Fix leak of transfers in upload manager 2011-01-28 22:10:53 +01:00
Brian Paul
e89fc33d7a docs: removed VC8 project files 2011-01-28 13:40:47 -07:00
Brian Paul
f247175e4a mesa: omit VC8 project files from tarball 2011-01-28 13:40:47 -07:00
Thierry Vignaud
d3d6beec96 Fix missing files in Mesa tarballs.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-01-28 12:31:04 -08:00
Chad Versace
c494763579 mesa: Fix available APIs for AMD_conservative_depth
Remove ES2, since AMD_conservative_depth is not listed in the OpenGL ES
extension registry.
2011-01-28 11:19:51 -08:00
Marek Olšák
c6ace30028 r300/compiler: print stats based on the initial number of instructions
The same number of shaders is now printed regardless of optimizations being
enabled or not, so that we can compare shader stats side by side easily.
2011-01-28 19:37:31 +01:00
Marek Olšák
0029979eee r300g: fix resource_copy_region for DXT SRGB formats 2011-01-28 17:15:22 +01:00
Carl Worth
d3df641f0a glcpp: Demote "macro redefined" from an error to a warning
The GLSL specification is vague here, (just says "as is standard for
C++"), though the C specifications seem quite clear that this should
be an error.

However, an existing piglit test (CorrectPreprocess11.frag) expects
this to be a warning, not an error, so we change this, and document in
README the deviation from the specification.
2011-01-28 15:16:36 +10:00
Dave Airlie
476db2bd3d dri: add a placeholder for the framebuffer sRGB capable bit.
This is needed to build the X server GLX_EXT_framebuffer_sRGB bits.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-01-28 11:45:44 +10:00
Dimitry Andric
cfb9aae3ec glapi: add @GOTPCREL relocation type
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=33440
This replaces commit 731ec60da3

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

Signed-off-by: Brian Paul <brianp@vmware.com>
2011-01-27 18:04:57 -07:00
Marek Olšák
6dc0a0e71f r600g: handle PIPE_CAP_ARRAY_TEXTURES 2011-01-28 01:58:30 +01:00
Marek Olšák
588c925224 r300g: handle PIPE_CAP_ARRAY_TEXTURES 2011-01-28 01:56:57 +01:00
Marek Olšák
baf2a795eb r300g: 8x8-compressed zbuffer can only be point-sampled 2011-01-28 01:16:27 +01:00
Marek Olšák
2050f2ab96 r300g: fix and re-enable 8x8 zbuffer compression mode
Also cleanup the whole thing.
2011-01-28 01:04:51 +01:00
Marek Olšák
82e60236a9 r300g: print driver info if RADEON_DEBUG=info 2011-01-27 23:17:41 +01:00
Marek Olšák
39f16e2aa7 r300g: add winsys flag CAN_AACOMPRESS 2011-01-27 23:13:28 +01:00
Marek Olšák
2e3ccada07 r300g: rename flag squaretiling -> drm_2_1_0 2011-01-27 23:06:15 +01:00
Marek Olšák
e0b98cde41 docs: update GL3 status 2011-01-27 21:17:25 +01:00
Marek Olšák
387fe8dd47 util: fix parsing debug options
So that 'foo' can be found in: OPTION=prefixfoosuffix,foo

Also allow that debug options can be separated by a non-alphanumeric characters
instead of just commas.
2011-01-27 20:32:03 +01:00
Marek Olšák
db299a9f82 r300g: fix some bugs with zbuffer compression (v4)
This drops the memblock manager for ZMASK. Instead, only one zbuffer can be
compressed at a time. Note that this does not necessarily have to be slower.
When there is a large number of zbuffers, compression might be used more often
than it was before. It's also easier to debug.

How it works:
1) 'clear' turns the compression on.
2) If some other zbuffer is set or the currently-bound zbuffer is used
   for texturing, the driver decompresses it and then turns the compression off.

Notes:
- The ZMASK clear has been refactored, so that only one packet3 is used to clear
  ZMASK.
- The 8x8 compression mode is disabled. I couldn't make it work without issues.
- Also removed driver-specific stuff from u_blitter.

Driver status:
- RV530 and R580 appear to just work (finally).
- RV570 should work, but there may be an issue that we don't correctly
  calculate the number of dwords to clear, resulting in a partially
  uninitialized zbuffer.
- RS690 misrenders as if no ZMASK clear happened. No idea what's going on.
- RV350 may even hardlock. This issue was already present and this patch doesn't
  fix it.

I think we are still missing some hardware info we need to make the zbuffer
compression work fully.

Note that there is also an issue with HiZ, resulting in a sort of blocky
zigzagged corruption around some objects.
2011-01-27 18:12:01 +01:00
Brian Paul
7a4345fd83 glsl: use 'this' pointer to be consistent 2011-01-26 21:16:41 -07:00
Brian Paul
2b7be12d54 glsl: remove needless conditional 2011-01-26 21:16:32 -07:00
Brian Paul
86471246f0 glsl: move ir_var_out code 2011-01-26 21:16:14 -07:00
Brian Paul
7baa498ae4 glsl: move ir_var_system_value code 2011-01-26 21:15:52 -07:00
Brian Paul
304b239869 glsl: use local var to simplify code a bit 2011-01-26 21:15:39 -07:00
Zack Rusin
59dbdbbb7d mesa: fix compilation
this isn't c++ please don't mix declerations with code
2011-01-26 21:20:53 -05:00
Chad Versace
67c67ee80f glsl: Refresh autogenerated lexer file
For previous commit.
2011-01-26 16:37:45 -08:00
Chad Versace
cc4a787044 glsl: Remove extraneously extraneous parens
I found this parenthetical usage of parentheses to be extraneously
extraneous:
   (yyextra->ARB_fragment_coord_conventions_enable)
2011-01-26 16:37:45 -08:00
Chad Versace
ad3dc370d8 mesa: Allow extensions in MESA_EXTENSION_OVERRIDE to be prefixed with '+'
If an extension is prefixed with '+', attempt to enable it.  This
introduces symmetry with the prefix '-', which is already allowed.
2011-01-26 16:37:45 -08:00
Chad Versace
7cbcf4c583 mesa: Simplify logic in get_extension_override()
* Reduce max indentation level from 7 to 3.
* Eliminate counter variables.
* Remove function append().
2011-01-26 16:37:45 -08:00
Chad Versace
8ba260e099 glsl: Enable AMD_conservative_depth in parser
All the necessary compiler infrastructure for AMD_conservative_depth is in
place, so it's safe to enable it in the parser.
2011-01-26 16:37:45 -08:00
Chad Versace
a1b83464ff mesa: Propagate gl_FragDepth layout from GLSL IR to Mesa IR 2011-01-26 16:37:45 -08:00
Chad Versace
addae33d6b glsl: Raise linking error if gl_FragDepth layout is inconsistent
From the AMD_conservative_depth spec:
   If gl_FragDepth is redeclared in any fragment shader in a program, it
   must be redeclared in all fragment shaders in that program that have
   static assignments to gl_FragDepth. All redeclarations of gl_FragDepth in
   all fragment shaders in a single program must have the same set of
   qualifiers.
2011-01-26 16:37:45 -08:00
Chad Versace
bc04d244f5 glsl: Propagate depth layout qualifier from AST to IR 2011-01-26 16:37:44 -08:00
Chad Versace
5fc57f471b glsl: Define enum ir_depth_layout 2011-01-26 16:37:44 -08:00
Chad Versace
39cad66a88 glsl: Refresh autogenerated parser files
For commits titled:
glcpp: Conditionally define macro GL_AMD_conservative_depth
glsl: Add support for AMD_conservative_depth to parser
2011-01-26 16:37:44 -08:00
Chad Versace
fb5db0570c glsl: Add support for AMD_conservative_depth to parser
When AMD_conservative_depth is enabled:
* Let 'layout' be a token.
* Extend the production rule of layout_qualifier_id to process the tokens:
   depth_any
   depth_greater
   depth_less
   depth_unchanged
2011-01-26 16:37:44 -08:00
Chad Versace
565a22090c glsl: Add depth layout qualifiers to ast_type_qualifier 2011-01-26 16:37:44 -08:00
Chad Versace
0423f24eb8 glcpp: Conditionally define macro GL_AMD_conservative_depth
Define macro GL_AMD_conservative_depth to 1 when its extension is
enabled.
2011-01-26 16:37:44 -08:00
Chad Versace
1aeecaa433 mesa: Add AMD_conservative_depth to extension list
The extension is off by default.

First in a patchset that implements support for AMD_conservative_depth in
the compiler.
2011-01-26 16:37:44 -08:00
Brian Paul
8697dbdfbc tgsi: add cases for array textures
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=33555
2011-01-26 16:22:32 -07:00
Kristian Høgsberg
3fe0185ba5 mesa: Support internalFormat=GL_BGRA for DRI drivers 2011-01-26 15:05:46 -05:00
Kristian Høgsberg
e28ecdee03 st/egl: Downgrade warning to debug when we can't create a drm screen
We try to load a DRI driver if this fails so don't confuse users.
2011-01-26 10:47:03 -05:00
Brian Paul
684c66bb8b mesa: fix MESA/EXT typo
Spotted by Bernd Buschinski.
2011-01-26 08:01:31 -07:00
Marek Olšák
c7c733545a util: require debug options to be separated by commas
Let's assume there are two options with names such that one is a substring
of another. Previously, if we only specified the longer one as a debug option,
the shorter one would be considered specified as well (because of strstr).
This commit fixes it by checking that each option is surrounded by commas.

(a regexp would be nicer, but this is not a performance critical code)
2011-01-26 10:48:21 +01:00
Zack Rusin
0657fc00dd gallium: add an interface for query predicates
as specified in the arb_occlusion_query2. just the interface.
2011-01-26 00:03:12 -05:00
Brian Paul
779e9cb658 softpipe: support for 1D/2D texture arrays 2011-01-25 20:27:10 -07:00
Brian Paul
9b56a2cb62 st/mesa: support for 1D/2D texture arrays 2011-01-25 20:26:22 -07:00
Brian Paul
c0d941877b tgsi: add support for 1D/2D texture arrays 2011-01-25 20:25:53 -07:00
Tormod Volden
903185bf3b configure.ac: define LIBDRM_INTEL_REQUIRED
To have the LIBDRM* requirements in one place

Signed-off-by: Tormod Volden <debian.tormod@gmail.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-01-25 18:53:00 -07:00
Brian Paul
0bfd174fb5 mesa: remove isProxy local var 2011-01-25 18:53:00 -07:00
Brian Paul
365f658602 mesa: use texFormat local var in more places 2011-01-25 18:53:00 -07:00
Brian Paul
f322400970 mesa: consolidate error handling code in _mesa_GetTexLevelParameteriv() 2011-01-25 18:53:00 -07:00
Brian Paul
0f6b8e29ab mesa: consolidate error handling in set_tex_parameteri() 2011-01-25 18:53:00 -07:00
Brian Paul
f2dd11817a mesa: add checks for GL_EXT_texture_array
In case the driver enables GL_MESA_texture_array but not the EXT version.
2011-01-25 18:53:00 -07:00
Ian Romanick
0f4b2a0a23 linker: Propagate max_array_access while linking functions
Update the max_array_access of a global as functions that use that
global are pulled into the linked shader.

Fixes piglit test glsl-fs-implicit-array-size-01 and bugzilla #33219.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
2011-01-25 13:41:26 -08:00
Ian Romanick
c87e9ef4d2 linker: Set sizes for non-global arrays as well
Previously only global arrays with implicit sizes would be patched.
This causes all arrays that are actually accessed to be sized.

Fixes piglit test glsl-fs-implicit-array-size-02.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
2011-01-25 13:41:26 -08:00
Ian Romanick
5c2cec8337 ir_to_mesa: Add several assertions about sizes of arrays
Both of these assertions are triggered by the test case in bugzilla
size of 0.
2011-01-25 13:41:26 -08:00
Brian Paul
9f2bf3d65c glsl: silence uninitialized var warning in read_texture()
And generate an error if the texture pattern is not matched.
2011-01-25 13:11:47 -07:00
Mathias Fröhlich
90c2fd8640 r600g: Implement timer queries. 2011-01-25 14:18:19 -05:00
Mathias Fröhlich
e7ec532735 r600g: Implement asyncronous query results. 2011-01-25 14:18:19 -05:00
Mathias Fröhlich
b55fd961e1 r600g: Fix meaning of num_results for queries. 2011-01-25 14:18:19 -05:00
Tim Wiederhake
4102c7c7e2 fix potential leak in r600_context_init 2011-01-25 14:18:19 -05:00
Tim Wiederhake
9d41e5ee46 silences some valgrind warnings
==5547== Conditional jump or move depends on uninitialised value(s)
==5547==    at 0x8FE745D: r600_drm_winsys_create (r600_drm.c:86)
2011-01-25 14:18:19 -05:00
Brian Paul
ba0953da5b Revert "glapi: adding missing @GOTPCREL qualifer in glapi_x86-64.S"
This reverts commit 731ec60da3.

This change causes crashes in the x86-64 dispatch code.
2011-01-25 12:12:34 -07:00
Brian Paul
40ac24e631 softpipe: fix off-by-one error in setup_fragcoord_coeff()
If we invert Y, need to subtract one from the surface height.

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=26795
for softpipe.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
2011-01-25 11:58:15 -07:00
Brian Paul
23490d7a8b st/mesa: add comments in emit_wpos() 2011-01-25 11:57:10 -07:00
Brian Paul
bb56631f0c st/mesa: fix incorrect fragcoord.x translation
emit_adjusted_wpos() needs separate x,y translation values.  If we
invert Y, we don't want to effect X.

Part of the fix for http://bugs.freedesktop.org/show_bug.cgi?id=26795

NOTE: This is a candidate for the 7.9 and 7.10 branches.
2011-01-25 11:54:07 -07:00
Dimitry Andric
37bffe8d12 glapi: adding @ char before type specifier in glapi_x86.S
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=33433
NOTE: This is a candidate for the 7.9 and 7.10 branches.

Signed-off-by: Brian Paul <brianp@vmware.com>
2011-01-25 09:23:46 -07:00
Dimitry Andric
731ec60da3 glapi: adding missing @GOTPCREL qualifer in glapi_x86-64.S
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=33440
NOTE: This is a candidate for the 7.9 and 7.10 branches

Signed-off-by: Brian Paul <brianp@vmware.com>
2011-01-25 09:22:14 -07:00
Roland Scheidegger
7acb98c67c svga: link libwsw for dri-vmwgfx target with make build system too 2011-01-25 16:32:32 +01:00
Marek Olšák
02d7d9ec36 u_blitter: remove bogus assertion
The module uses the 3D engine, so it can blit non-compatible formats.
2011-01-25 05:51:49 +01:00
Marek Olšák
9a3523e38b u_blitter: report recursion, update comments 2011-01-25 05:51:49 +01:00
Vinson Lee
db4f6c7eeb nvc0: Move declaration before code.
Fixes nvc0 SCons build.
2011-01-24 20:04:31 -08:00
Zack Rusin
3fa814d7f8 gallium/tgsi: update the docs for the new opcodes a bit 2011-01-24 21:46:03 -05:00
Brian Paul
d30156525f mesa: add red, red/green formats in _mesa_base_fbo_format() 2011-01-24 19:38:52 -07:00
Brian Paul
62c66b3430 mesa: plug in fallback function for ctx->Driver.ValidateFramebuffer()
The software renderer doesn't support GL_ALPHA, GL_LUMINANCE, etc
so we should report GL_FRAMEBUFFER_UNSUPPORTED during FBO validation.
2011-01-24 19:38:52 -07:00
Brian Paul
976ea9d76b mesa: new cases in _mesa_base_fbo_format()
The set of internalFormat parameters accepted by glRenderBufferStorage
depends on the EXT vs. ARB version of framebuffer_object.  The later
added support for GL_ALPHA, GL_LUMINANCE, etc. formats.  Note that
these formats might be legal but might not be supported.  That should
be checked with glCheckFramebufferStatus().
2011-01-24 19:38:52 -07:00
Brian Paul
f41bbc7c44 Revert "mesa: Simplify _mesa_base_fbo_format by making it exceptions to teximages."
This reverts commit 65c41d55a0.

There really are quite a few differences in the set of internal
formats allowed by glTexImage and glRenderbufferStorage.
2011-01-24 19:38:52 -07:00
Vinson Lee
e24f1ea594 scons: Add nvc0 to SConscript. 2011-01-24 17:48:24 -08:00
Brian Paul
99c67f27d3 vega: implement handler/pointer conversion using a hash table
Before, we were just casting between 32-bit VGHandles and 64-bit pointers.
2011-01-24 18:12:49 -07:00
Brian Paul
f3e6edc70b vega: remove redundant functions found elsewhere 2011-01-24 18:12:49 -07:00
Brian Paul
d41e694cf7 vega: replace casts with pointer/handle conversion functions
Per the spec, all OpenVG handles are 32-bit.  We can't just cast them
to/from integers on 64-bit systems.

Start fixing that mess by introducing a set of handle/pointer conversion
functions in handle.h.  The next step is to implement a handle/pointer
hash table...
2011-01-24 18:12:49 -07:00
Julien Cristau
4324d6fdfb glx: fix request lengths
We were sending too long requests for GLXChangeDrawableAttributes,
GLXGetDrawableAttributes, GLXDestroyPixmap and GLXDestroyWindow.

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

Signed-off-by: Julien Cristau <jcristau@debian.org>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-01-24 18:10:38 -07:00
Jakob Bornecrantz
c523f31f4a svga: Add more swrast debuging 2011-01-25 01:00:07 +01:00
Jakob Bornecrantz
daaf542220 svga: Use get once helpers for context debug envs 2011-01-25 00:58:46 +01:00
Jakob Bornecrantz
becb733dbc rbug: Fix surface reference leak 2011-01-25 00:58:46 +01:00
Jakob Bornecrantz
4fabdf72ea glsl: Fix mingw crosscompile 2011-01-25 00:58:46 +01:00
Henri Verbeet
1af59b28b5 r600g: FLT_TO_INT* are vector instructions on Evergreen.
FLT_TO_INT is a vector instruction, despite what the (current) documentation
says. FLT_TO_INT_FLOOR and FLT_TO_INT_RPI aren't explicitly mentioned in the
documentation, but those are vector instructions too.
2011-01-25 00:35:34 +01:00
Zack Rusin
3d9138781d graw: add a test showing the new sampling scheme in action 2011-01-24 17:53:29 -05:00
Zack Rusin
bdbe77f9c6 gallium: implement modern sampling scheme
largely a merge of the previously discussed origin/gallium-resource-sampling
but updated.
the idea is to allow arbitrary binding of resources, the way opencl, new gl
versions and dx10+ require, i.e.
    DCL RES[0], 2D, FLOAT

    LOAD DST[0], SRC[0], RES[0]
    SAMPLE DST[0], SRC[0], RES[0], SAMP[0]
2011-01-24 17:47:10 -05:00
Benjamin Franzke
b066983780 st/mesa: Enable EXT_texture_format_BGRA8888 for gles1/2 2011-01-24 16:41:29 -05:00
Benjamin Franzke
c5c1dc8b3f st/mesa: support internalFormat=GL_BGRA in TexImage2D 2011-01-24 16:41:29 -05:00
Benjamin Franzke
8bfbcba2b7 mesa/es: require internalFormat==format in TexImage2D 2011-01-24 16:41:29 -05:00
Benjamin Franzke
f1452844fe mesa: allow internalFormat=GL_BGRA_EXT in TexImage2D 2011-01-24 16:41:29 -05:00
Dimitry Andric
811ee32a9e mesa: s/movzxw/movzwl/ in read_rgba_span_x86.S
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=33386
NOTE: This is a candidate for the 7.9 and 7.10 branches

Signed-off-by: Brian Paul <brianp@vmware.com>
2011-01-24 14:37:52 -07:00
Dimitry Andric
3fda80246f mesa: s/movzx/movzbl/
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=33388
NOTE: This is a candidate for the 7.9 and 7.10 branches.

Signed-off-by: Brian Paul <brianp@vmware.com>
2011-01-24 14:34:28 -07:00
Kenneth Graunke
e0c4a59dc6 glsl: Remove long unused 'configure.ac' file.
This was from way back when glsl2 lived in its own repository.
2011-01-24 10:33:38 -08:00
José Fonseca
92badb4c8c draw: Do not use LLVM's opaque types.
Contrary what the name may suggest, LLVM's opaque types are used for
recursive types -- types whose definition refers itself -- so opaque
types correspond to pre-declaring a structure in C. E.g.:

   struct node;

   struct link {
      ....
      struct node *next;
   };

   struct node {
      struct link link;
   }

Void pointers are also disallowed by LLVM. So the suggested way of creating
what's commonly referred as "opaque pointers" is using byte pointer (i.e.,
uint8_t * ).
2011-01-24 17:27:14 +00:00
Tim Wiederhake
d14764815c add machine generated files to .gitignore
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-01-24 09:17:57 -07:00
Tim Wiederhake
c48dd8049c secure malloc in translate_cache_create
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-01-24 09:17:54 -07:00
Christopher James Halse Rogers
7d6abd254a osmesa: mklib requires arguments before objects
Fixes the build when selecting driver=osmesa and building static libraries.
Otherwise, mklib tries to add the ‘-ltalloc’ object to the archive, which
obviously fails.

Clients which statically link to osmesa will need to link to libtalloc also,
as specified in the Libs.private of osmesa.pc.

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=33360

NOTE: This is a candidate for the 7.10 branch.

Signed-off-by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-01-24 07:53:24 -07:00
Michel Dänzer
be0665b461 st/xorg: Fix build failure against xserver with XF86_CRTC_VERSION < 3.
Reported by Vinson Lee.
2011-01-24 15:48:13 +01:00
Marek Olšák
db234176b1 r300g: remove unused function 2011-01-24 13:37:23 +01:00
Marek Olšák
09109c11d9 r300g: remove any traces of depth_clamp
I couldn't make it work.

GB_TILE_CONFIG.Z_EXTENDED, which enables per-pixel Z clamping, and
VAP_CLIP_CNTL.CLIP_DISABLE, which disables clipping, do help, but they
also add regressions like random graphics corruptions in some games.
2011-01-24 13:32:52 +01:00
Marek Olšák
d78a984baa r300g: handle PIPE_CAP_INSTANCED_DRAWING in get_param 2011-01-24 11:40:26 +01:00
Andre Maasikas
92767e9052 r600c: only colors can be flat shaded
fixes stellarium text and menu display
2011-01-24 10:23:19 +02:00
Jakob Bornecrantz
b7d2919e8e util: Add function logger helpers 2011-01-24 03:37:57 +01:00
Jakob Bornecrantz
a82408c353 Revert "r300g/swtcl: re-enable LLVM"
This reverts commit 88550083b3.
2011-01-24 03:26:59 +01:00
Jakob Bornecrantz
4c73030d47 draw: Init llvm if not provided 2011-01-24 03:26:59 +01:00
Jakob Bornecrantz
832029e1c1 i915g: Remove draw_flushes and state that we don't need to track 2011-01-24 03:26:59 +01:00
Jakob Bornecrantz
9a9630dcf0 i915g: Improve constant handling 2011-01-24 03:26:59 +01:00
Tom Stellard
c40ec20c27 r300g: Increase fragment shader limits for r400 cards
r400 fragment shaders now support up to 64 temporary registers,
512 ALU instructions, and 512 TEX instructions.
2011-01-23 17:47:48 -08:00
Brian Paul
1bf3c75825 gldirect: remove _NEW_ACCUM 2011-01-23 14:06:21 -07:00
Brian Paul
c78b48d808 i965: remove _NEW_ACCUM 2011-01-23 14:06:21 -07:00
Christoph Bumiller
a287a758c6 nvc0: implement point coord replacement
But we have to cheat and peek at the GENERIC semantic indices the
state tracker uses for TEXn.
Only outputs from 0x300 to 0x37c can be replaced, and so we have to
know on shader compilation which ones to put there in order to keep
doing separate shader objects properly.

At some point I'll probably create a patch that makes gallium not
force us to discard the information about what is a TexCoord.
2011-01-23 21:35:27 +01:00
Marek Olšák
f154cd2315 mesa: add ARB_framebuffer_sRGB as alias of the EXT variant
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-01-23 20:59:46 +01:00
Marek Olšák
81ae8c6313 mesa: return GL_LINEAR for ..COLOR_ENCODING if framebuffer_sRGB is unsupported
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-01-23 20:59:46 +01:00
Brian Paul
2dac3f995b vega: sort filenames in Makefile, SConscript 2011-01-23 10:15:07 -07:00
Brian Paul
fb7efb1b19 mesa: get rid of _NEW_ACCUM, clean-up _NEW_* #defines
The _NEW_ACCUM flag was only set when changing the accumulation
buffer clear color and never used anywhere.  Reclaim that dirty bit.
Clean up the definitions of the other dirty bit flags.
2011-01-23 09:50:52 -07:00
Brian Paul
f4dc24a0b5 mesa: smarter glTexParameter state invalidation
Only a few texture object parameters can effect texture completeness:
min level, max level, minification filter.  Don't mark the texture
incomplete for other texture object state changes.
2011-01-23 09:50:52 -07:00
Marek Olšák
91eba2567e r300g: support sRGB colorbuffers
We are not required to do the linear->sRGB conversion if ARB_framebuffer_sRGB
is unsupported. However I think the conversion should work in hw except
for blending, which matches the D3D9 behavior.
2011-01-23 13:32:56 +01:00
Marek Olšák
ffcdd49c69 r300/compiler: remove any code related to relative addressing of temporaries
The hw can't do it and the code was useless anyway (it's lowered
in the GLSL compiler).
2011-01-23 13:32:56 +01:00
Christoph Bumiller
835c4ea105 nvc0: fix emit_cvt for ceil, floor and trunc 2011-01-23 13:09:10 +01:00
Christoph Bumiller
95eef7a705 nvc0: remove bad assert and emit TEMP movs instead 2011-01-23 13:07:30 +01:00
Christoph Bumiller
f9bb1c8b33 nvc0: fix address and value slot assignment in load combining 2011-01-23 13:05:44 +01:00
Christoph Bumiller
005d186d66 nvc0: don't omit highest bit of branch target
Fixes negative relative branch offsets.
2011-01-23 13:03:20 +01:00
Christoph Bumiller
419ff10b0e nvc0: recognize r63 as zero in constant folding 2011-01-23 13:03:15 +01:00
Christoph Bumiller
bf1df06773 nvc0: add MARK_RING where missing to avoid too many relocs errors 2011-01-23 13:03:10 +01:00
Christoph Bumiller
49f16c96f1 nvc0: don't apply base vertex to per-instance arrays 2011-01-23 13:03:00 +01:00
Christoph Bumiller
c18aa3c73f nvc0: commute sources of SET too if beneficial 2011-01-23 13:01:33 +01:00
Christoph Bumiller
8e572998fc nvc0: accept neg abs modifiers on lg2 2011-01-23 13:01:22 +01:00
Ian Romanick
2db46fe5f0 glsl: Don't assert when the value returned by a function has no rvalue
The rvalue of the returned value can be NULL if the shader says
'return foo();' and foo() is a function that returns void.

Existing GLSL specs do *NOT* say that this is an error.  The type of
the return value is void.  If the return type of the function is also
void, then this should compile without error.  I expect that future
versions of the GLSL spec will fix this (wink, wink, nudge, nudge).

Fixes piglit test glsl-1.10/compiler/expressions/return-01.vert and
bugzilla #33308.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
2011-01-22 18:04:40 -08:00
Brian Paul
9d380f487a st/mesa: ensure that all pixel paths operation on linear RGB data, not sRGB
Before, we were converting between linear/sRGB in glReadPixels,
glDrawPixels, glAccum, etc if the renderbuffer was an sRGB texture.
Those all need to operate on pixel values as-is without conversion.

Also, when setting up render-to-texture, if the texture is sRGB the
pipe_surface view must be linear RGB.  This will change when we
support GL_ARB_framebuffer_sRGB.

This fixes http://bugs.freedesktop.org/show_bug.cgi?id=33353
2011-01-22 18:33:35 -07:00
Brian Paul
4c9ad084c1 softpipe: pass surface format to get/put_tile functions
When we read/write image tiles we need to use the format specified
in the pipe_surface, not the pipe_transfer format (which comes from
the underlying texture/resource format).

This comes up when rendering to sRGB surfaces (via OpenGL render to
texture).  Ignoring the new GL_ARB/EXT_framebuffer_sRGB extension
for now, when we render to a sRGB surface we need to treat it like
a regular, linear colorspace RGB surface.  Before, when we read/wrote
tiles to sRGB surfaces we were inadvertantly doing the color space
conversion.
2011-01-22 18:33:35 -07:00
Brian Paul
e75844b4e0 gallium/util: added pipe_put_tile_rgba_format() 2011-01-22 18:33:35 -07:00
Brian Paul
3ce1ec853b gallium/util: simplify pipe_get_tile_rgba()
Implement it in terms of pipe_get_tile_rgba_format()
2011-01-22 18:33:35 -07:00
Brian Paul
90671fcdda gallium/softpipe: replace pipe_get_tile_swizzle()
The new function, pipe_get_tile_rgba_format(), no longer takes a
swizzle (we weren't actually using it anywhere).  Rename it to
indicate that the format is passed explicitly.
2011-01-22 18:33:35 -07:00
Brian Paul
4e2c077879 softpipe: use proper type for format field 2011-01-22 18:33:35 -07:00
Brian Paul
11fbdf726d gallium/util: added util_format_linear() 2011-01-22 18:33:35 -07:00
Brian Paul
4c251b8861 st/mesa: update comment, use st_fb_orientation() 2011-01-22 18:33:35 -07:00
Brian Paul
bd67962c5e st/mesa: comments in update_viewport() 2011-01-22 18:33:35 -07:00
Chia-I Wu
bb770af3a5 scons: Add support for GLES.
GLES can be enabled by running scons with

  $ scons gles=yes

When gles=yes is given, the build is changed in three ways.  First,
libmesa.a will be built with FEATURE_ES1 and FEATURE_ES2.  This makes
DRI drivers and libEGL support and advertise GLES support.  Second, GLES
libraries will be created.  They are libGLESv1_CM, libGLESv2, and
libglapi.  Last, libGL or opengl32 will link to libglapi.  This change
is required as _glapi_* will be declared as __declspec(dllimport) in
libmesa.a on windows.  libmesa.a expects those symbols to be defined in
another DLL.  Due to this change to GL, GLES support is marked
experimental.

Note that GLES requires libxml2-python to generate some of its sources.
2011-01-22 11:59:05 +08:00
Chia-I Wu
3f04314ae2 mapi: ENTRY_CURRENT_TABLE_GET should be stringified.
So that it can be renamed to _glapi_get_dispatch.
2011-01-22 11:58:38 +08:00
Kenneth Graunke
0db3161036 glcpp: Regenerate parser files. 2011-01-21 15:41:19 -08:00
Kenneth Graunke
6ecee54a9a glcpp: Remove use of talloc reference counting.
We almost always want to simply steal; we only need to copy when copying
a token list (in which case we're already cloning stuff anyway).
2011-01-21 15:41:19 -08:00
Kenneth Graunke
e256e4743c glsl, i965: Remove unnecessary talloc includes.
These are already picked up by ir.h or glsl_types.h.
2011-01-21 15:41:19 -08:00
Kenneth Graunke
819f92deaa ra: Use the same context when realloc'ing arrays.
The original allocations use regs->regs as the context, so talloc will
happily ignore the context given here.  Change it to match to clarify
that it isn't changing.
2011-01-21 15:39:57 -08:00
Chad Versace
b66be7518a glsl: Improve error message when read-only vars are written
Improves the cases when:
* an explicit assignment references the read-only variable
* an 'out' or 'inout' function parameter references the read-only variable
2011-01-21 14:06:28 -08:00
Chad Versace
01a584d093 glsl: Mark 'in' variables at global scope as read-only
Fixes Piglit tests:
spec/glsl-1.30/compiler/storage-qualifiers/static-write-centroid-in-01.frag
spec/glsl-1.30/compiler/storage-qualifiers/static-write-in-01.frag
spec/glsl-1.30/compiler/storage-qualifiers/static-write-in-02.frag
2011-01-21 14:06:28 -08:00
Chad Versace
f633b993b0 glsl: Remove unused class ast_declaration_statment 2011-01-21 14:06:25 -08:00
Jakob Bornecrantz
8af583f6e8 i915g: Don't (un)map vbuf on each (un)map call 2011-01-21 20:53:29 +01:00
Jakob Bornecrantz
0c3352b6df i915g: Don't do unnecessary copies of constants
Even tho st/mesa use user buffers for constants align buffers
other state trackers doesn't use user buffers.
2011-01-21 20:53:29 +01:00
Jakob Bornecrantz
2e60aa511d i915g: Don't emit FS constants when VS contants change 2011-01-21 20:53:29 +01:00
Jakob Bornecrantz
7287964f94 i915g: Use slab allocator for transfers
Also remove unused i915_transfer struct
2011-01-21 20:53:29 +01:00
Jakob Bornecrantz
484edfc815 st/dri: Fix warning 2011-01-21 20:53:29 +01:00
Christian König
a40305dcdb r600g: check if hardware blits are possible bevore enabling tilling 2011-01-21 19:47:24 +01:00
Alex Deucher
4b3789427f r600g: FLT_TO_INT_FLOOR is trans instruction
Add missing evergreen FLT_TO_INT_FLOOR instruction.
2011-01-21 12:41:23 -05:00
Dave Airlie
a637280e42 mesa: EXT_framebuffer_sRGB interface additions.
This adds the get/enable enums and internal gl_config storage
for this extension.

In theory this is all that is needed to enable this extension
from what I can see, since its not mandatory to implement the
features if you don't advertise the visuals or the fb configs.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-01-21 19:56:13 +10:00
Andre Maasikas
634e889bb5 r600c: get OQ results only for 4 DBs on r600 class
- since evergreen addition which increased this to 8 depth backends
  other bytes may contain garbage values
2011-01-21 11:48:03 +02:00
Brian Paul
af4e2f4665 docs: update README.WIN32 per Karl's request 2011-01-20 18:52:53 -07:00
Ian Romanick
2fb0aebd4a intel: Fix typeos from 3d028024 and 790ff232
...and remove egg from face.
2011-01-20 13:51:07 -08:00
Ian Romanick
790ff232e2 i915: Set correct values for range/precision of fragment shader types 2011-01-20 13:35:59 -08:00
Ian Romanick
3d028024e5 i965: Set correct values for range/precision of fragment shader types 2011-01-20 13:35:59 -08:00
Ian Romanick
04dca296e0 mesa: Set correct values for range/precision of shader integer types 2011-01-20 13:35:59 -08:00
Ian Romanick
dde3270c19 mesa: Connect glGetShaderPrecisionFormat into the dispatch table 2011-01-20 13:35:59 -08:00
Brian Paul
37233f1ee0 softpipe: check for null pointers during context create/destroy
See http://bugs.freedesktop.org/show_bug.cgi?id=32309
Apparently, malloc() is failing during context creation.  Not
checking for nulls here led to crashes elsewhere.
2011-01-20 13:46:57 -07:00
Brian Paul
4ef955a12a graw: fix logic error in pixel format selection
The loop to choose a pixel format for the window was incrementing
'i' after we succeeded in creating the window so if we chose format[0]
for graw_create_window_and_screen() we were putting format[1] in
the pipe_resource template for creating the render target.

This only worked because of the order of the elements in the formats[]
array.

The graw_xlib.c code now properly compares the requested gallium pixel
format against the visual's color layout.

Update all the graw demos to fix the off-by-one-i error.
2011-01-20 13:37:26 -07:00
Ian Romanick
22eeb1b331 Fix the build from 887d2b64
Thanks to all the include frobbing, GLuint is not known in some places
that included enums.h.
2011-01-20 11:30:14 -08:00
Brian Paul
887d2b647b mesa: clean-up _mesa_lookup_prim_by_nr()
Remove the redundant public _mesa_prim_name[] array.
2011-01-20 09:44:33 -07:00
Brian Paul
fe49dcb3b0 mesa: move extra prim mode #defines 2011-01-20 09:44:33 -07:00
Brian Paul
b62e78c783 vbo: added comment 2011-01-20 09:44:33 -07:00
Brian Paul
cfae745a8b mesa: minor formatting fixes 2011-01-20 09:10:03 -07:00
Brian Paul
7330f8b2bc st/mesa: clean up the sampler view format code 2011-01-20 08:56:36 -07:00
Brian Paul
751fe9058b mesa: document sRGBDecode field 2011-01-20 08:56:36 -07:00
Brian Paul
f579a05a9f st/mesa: formatting, whitespace fixes 2011-01-20 08:56:32 -07:00
Andre Maasikas
c20778e76f r600c: bump sq gpr resources if a shader needs more than default
ideally this should be set once in the beginning of CS but there's
no way to change values there while in the middle of rendering.
For now reemitting SQ setup seems to work probably due to
r700WaitForIdleClean after each render

currently does not to try to decrease values once increased

fixes hangs in glsl-vs-vec4-indexing-temp-src-in-nested-loop-combined
glsl-vs-vec4-indexing-temp-dst-in-nested-loop-combined for my rv740
maybe more for other chips
2011-01-20 13:11:56 +02:00
Chia-I Wu
e8c7d7598f glapi: Fix OpenGL and OpenGL ES interop.
When --enable-shared-glapi is specified, libGL will share libglapi with
OpenGL ES instead of defining its own copy of glapi.  This makes sure an
app will get only one copy of glapi in its address space.

The new option is disabled by default.  When enabled, libGL and libglapi
must be built from the same source tree and distributed together.  This
requirement comes from the fact that the dispatch offsets used by these
libraries are re-assigned whenever GLAPI XMLs are changed.

For GLX, indirect rendering for has_different_protocol() functions is
tricky.  A has_different_protocol() function is assigned only one
dispatch offset, yet each entry point needs a different protocol opcode.
It cannot be supported by the shared glapi.  The fix to this is to make
glXGetProcAddress handle such functions specially before calling
_glapi_get_proc_address.

Note that these files are automatically generated/re-generated

 src/glx/indirect.c
 src/glx/indirect.h
 src/mapi/glapi/glapi_mapi_tmp.h
2011-01-20 17:15:50 +08:00
Chia-I Wu
9767d3b5ad glapi: Fix OpenGL ES 1.1 and 2.0 interop.
Move _glapi_* symbols from libGLESv1_CM.so and libGLESv2.so to
libglapi.so.  This makes sure an app will get only one copy of glapi in
its address space.

Note that with this change, libGLES* and libglapi must be built from the
same source tree and distributed together.  This requirement comes from
the fact that the dispatch offsets used by these libraries are
re-assigned whenever GLAPI XMLs are changed.
2011-01-20 17:15:50 +08:00
Chia-I Wu
97185bf265 mapi: Add support for bridge mode.
In bridge mode, mapi no longer implements glapi.h.  It becomes a user of
glapi.h.  Imagine an app that uses both libGL.so and libGLESv2.so.
There will be two copies of glapi in the app's memory.  It is possible
that _glapi_get_dispatch does not return what _glapi_set_dispatch set,
if they access different copies of the global variables.  The solution
to this situation to build either one of the libraries as a bridge to
the other.  Or build both libraries as bridges to another shared
glapi library.
2011-01-20 17:15:50 +08:00
Chia-I Wu
96c52d16c1 mapi: u_current_table may be renamed.
When MAPI_MODE_GLAPI is defined, u_current_table is renamed to
_glapi_Dispatch or _glapi_tls_Dispatch.  The ASM dispatchers should not
use hardcoded name.
2011-01-20 17:15:50 +08:00
Chia-I Wu
6fc152f660 mapi: Add a new glapi.h implementation.
The new implementation is based on mapi.  No new script is needed.  As
noted in sources.mk, the way to use it is to compile MAPI_GLAPI_SOURCES
with MAPI_MODE_GLAPI defined.
2011-01-20 17:15:50 +08:00
Chia-I Wu
23a89f1872 mapi: Fix glapi printers for gl_and_es_API.xml.
Fix GLAPIPrinter, ES1APIPrinter, and ES2APIPrinter to output files that
are ready for compilation.  Since gl_and_es_API.xml is based on
gl_API.xml, the hidden and handcode attributes of entries have to be
overridden for ES1APIPrinter and ES2APIPrinter.
2011-01-20 17:15:50 +08:00
Chia-I Wu
7828f554ab mapi: Allow prefix to be macro.
Treat prefix as macro when it is all uppercase.  Generate PREFIX(name)
instead of PREFIXname when it is a macro.
2011-01-20 17:15:49 +08:00
Chia-I Wu
f71a9acf59 mapi: Add the ability to parse GLAPI XML.
A prerequisite if we want to convert vgapi.csv to vgapi.xml, or to use
mapi for glapi.
2011-01-20 17:15:49 +08:00
Chia-I Wu
323b5e323a glapi: Add gl_and_es_API.xml.
gl_and_es_API.xml defines OpenGL ES 1.1 and 2.0 API as well as OpenGL
API.  It consists of gl_API.xml and the newly added es_EXT.xml,
ARB_get_program_binary.xml, OES_single_precision.xml, and
OES_fixed_point.xml.
2011-01-20 17:15:49 +08:00
Kenneth Graunke
4fafde6a8c doxygen: Add glsl to the Makefile and .gitignore. 2011-01-19 23:49:54 -08:00
twied
aec19381ec Add machine generated files to .gitignore 2011-01-19 23:48:47 -08:00
Kenneth Graunke
21031b4e88 glsl: Don't bother unsetting a destructor that was never set.
This was totally copied and pasted from glsl_symbol_table.
2011-01-19 23:40:33 -08:00
Chia-I Wu
c116a0e2dc autoconf: Fail when --with-state-trackers is incomplete.
When --enable-openvg or --enable-gallium-egl is enabled,
--with-state-trackers must have vega or egl.
2011-01-20 15:04:34 +08:00
Henri Verbeet
21148e6a88 softpipe: Bind samplers to views instead of the underlying resource.
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-01-19 21:47:27 -07:00
Henri Verbeet
54fdc351dd softpipe: Get rid of the redundant resource parameter to get_sampler_variant().
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-01-19 21:47:27 -07:00
Dave Airlie
8c68362d7c r200: fix up some problems with TFP on r200 2011-01-20 14:35:09 +10:00
Brian Paul
7e86d9bd8c llvmpipe: implement TGSI_PROPERTY_FS_COLOR0_WRITES_ALL_CBUFS
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=33284
2011-01-19 18:46:59 -07:00
Eric Anholt
b41d323c90 i965/fs: Take the shared mathbox into account in instruction scheduling.
I don't have evidence for this amounting to any improvement,
but it does codify a bit more what we understand so far about
the pipeline.
2011-01-19 16:30:00 -08:00
Eric Anholt
382c2d99da i965/fs: Add a helper function for detecting math opcodes. 2011-01-19 16:29:14 -08:00
Eric Anholt
1991d92207 i965/fs: Assign URB/CURB register numbers after instruction scheduling.
This fixes a bunch of unnecessary barriers due to the scheduler not
knowing what that arbitrary register description refers to when trying
to reason about its dependencies.

The result is rescheduling in the convolution kernel shader in
Lightsmark, which results in avoiding register spilling and increasing
the performance of the first scene from 6-7 fps midway through the
panning to 11fps.  The register spilling was a regression from Mesa
7.9 to Mesa 7.10.
2011-01-19 16:29:14 -08:00
Eric Anholt
63879d90ac i965/fs: Add an instruction scheduler.
Improves performance of my GLSL demo by 5.1% (+/- 1.4%, n=7).  It also
reschedules the giant multiply tree at the end of
glsl-fs-convolution-1 so that we end up not spilling registers,
producing the expected level of performance.
2011-01-19 16:29:11 -08:00
Eric Anholt
3f2fe31eee i965/fs: Add a helper for detecting texturing opcodes. 2011-01-19 16:29:10 -08:00
Christian König
a124490262 r600g: fix segfault if texture operand is a literal
This fixes Bug 33262
2011-01-19 23:48:02 +01:00
Brian Paul
3ee60a3558 mesa: implement glGetShaderPrecisionFormat()
Drivers should override the default range/precision info as needed.
No drivers do this yet.
2011-01-19 07:41:55 -07:00
Brian Paul
34613c66ac gallium/docs: document result type for some types of queries 2011-01-19 07:41:55 -07:00
Dave Airlie
a5da4acb95 radeon: avoid segfault on 3D textures.
This is a candidate for 7.9 and 7.10
2011-01-19 16:27:13 +10:00
Dave Airlie
4832403c38 radeon: oops didn't need this logbase2 fn 2011-01-19 16:17:03 +10:00
Dave Airlie
c6fb88fc5a radeon: calculate complete texture state inside TFP function
(really not sure why I'm doing this).

This is a candidate for 7.9 and 7.10 branches.
2011-01-19 16:11:29 +10:00
Ben Skeggs
c73a1c18b2 dri/nouveau: allow multiple maps of surface buffers
Can happen during swrast fallbacks if a buffer is somehow bound as
a render target and a texture.

Fixes gnome-shell on nv20, and gets it mostly working on nv10.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-01-19 15:51:57 +10:00
Dave Airlie
f7bab47e6c radeon/r200: fix fbo-clearmipmap + gen-teximage
sw clears were being used and not getting the correct offsets in the span
code.

also not emitting correct offsets for CB draws to texture levels.

(I've no idea why I'm playing with r100).

This is a candidate for 7.9 and 7.10
2011-01-19 12:55:04 +10:00
Eric Anholt
568e008365 i965: Fix a comment typo. 2011-01-18 16:30:59 -08:00
Eric Anholt
8ce425f3e3 i965: Fix a bug in i965 compute-to-MRF.
Fixes piglit glsl-fs-texture2d-branching.  I couldn't come up with a
testcase that didn't involve dead code, but it's still worthwhile to
fix I think.
2011-01-18 16:30:59 -08:00
Christian König
ba700d2ead r600g: fix reserve_cfile for R700+
According to R700 ISA we have only two channels for cfile constants.
This patch makes piglit tests "glsl1-constant array with constant
indexing" happy on RV710.
2011-01-19 00:40:28 +01:00
Chad Versace
46f7105df4 glsl: Fix segfault due to missing printf argument
Fixes the following Piglit tests:
glslparsertest/shaders/array2.frag
glslparsertest/shaders/dataType6.frag

NOTE: This is a candidate for the 7.9 and 7.10 branches.
2011-01-18 15:23:18 -08:00
Chad Versace
45e8e6c6b1 glsl: Fix semantic checks on precision qualifiers
The check for
   Precision qualifiers only apply to floating point and integer types.
was incomplete. It rejected only type 'bool' and structures.
2011-01-18 14:43:49 -08:00
Brian Paul
42dbc2530b llvmpipe: make sure binning is active when we begin/end a query
This fixes a potential failure when a begin/end_query is the first
thing to happen after flushing the scene.

NOTE: This is a candidate for the 7.10 and 7.9 branches.
2011-01-18 14:02:01 -07:00
Brian Paul
fb7a8dedfa softpipe: rename some functions for consistency 2011-01-18 14:02:01 -07:00
Henri Verbeet
9e964baaf3 r600g: Kill trailing whitespace. 2011-01-18 20:57:04 +01:00
Henri Verbeet
7e2e8d09f7 r600g: Remove the unused eg_states_inc.h and r600_states_inc.h. 2011-01-18 20:57:04 +01:00
Henri Verbeet
495dec0a2b r600g: Simplify some r600_bc_add_alu_type() calls to r600_bc_add_alu(). 2011-01-18 20:57:04 +01:00
Brian Paul
90ff6178a2 vbo: initialize num_instances in a few places
This fixes https://bugs.freedesktop.org/show_bug.cgi?id=33247
There might still be some issues with drawing multiple instances
with VBO splitting to investigate someday.
2011-01-18 12:18:32 -07:00
Eric Anholt
d5a53ad271 ra: Take advantage of the adjacency list in finding a node to spill.
This revealed a bug in ra_get_spill_benefit where we only considered
the benefit of the first adjacency we were to remove, explaining some
of the ugly spilling I've seen in shaders.  Because of the reduced
spilling, it reduces the runtime of glsl-fs-convolution-1 36.9% +/-
0.9% (n=5).
2011-01-18 10:17:50 -08:00
Eric Anholt
ea8e21856e ra: Remove unused "name" field in regs. 2011-01-18 10:17:48 -08:00
Eric Anholt
604022abed ra: Take advantage of the adjacency list in ra_select() too.
Reduces runtime of glsl-fs-convolution-1 another 13.9% +/- 0.6% (n=5).
2011-01-18 10:17:44 -08:00
Eric Anholt
7cf648da63 ra: Add an adjacency list to trade space for time in ra_simplify().
This was recommended in the original paper, but I figued "make it run"
before "make it fast".  Now we make it fast.  Reduces the runtime of
glsl-fs-convolution-1 by 12.7% +/- 0.6% (n=5).
2011-01-18 10:17:40 -08:00
Eric Anholt
58c988ada5 glsl: Skip the rest of loop unrolling if no loops were found.
Shaves 1.6% (+/- 1.0%) off of ff_fragment_shader glean texCombine time
(n=5).
2011-01-18 10:17:37 -08:00
Eric Anholt
754b9c5363 ra: Trade off some space to get time efficiency in ra_set_finalize().
Our use of the register allocator in i965 is somewhat unusual.
Whereas most architectures would have a smaller set of registers with
fewer register classes and reuse that across compilation, we have 1,
2, and 4-register classes (usually) and a variable number up to 128
registers per compile depending on how many setup parameters and push
constants are present.  As a result, when compiling large numbers of
programs (as with glean texCombine going through ff_fragment_shader),
we spent much of our CPU time in computing the q[] array.  By keeping
a separate list of what the conflicts are for a particular reg, we
reduce glean texCombine time 17.0% +/- 2.3% (n=5).

We don't expect this optimization to be useful for 915, which will
have a constant register set, but it would be useful if we were switch
to this register allocator for Mesa IR.
2011-01-18 10:17:34 -08:00
Brian Paul
5b58b8c579 softpipe: added some null pointer checks
This shouldn't really be needed but it may help with
http://bugs.freedesktop.org/show_bug.cgi?id=32309
2011-01-18 09:59:28 -07:00
Brian Paul
c97e4532bb softpipe: s/tex_cache/fragment_tex_cache/
Just to be more consistant with the vertex and geometry tex cache fields.
2011-01-18 09:59:28 -07:00
José Fonseca
843f537cfb Remove executables from source tree. 2011-01-18 15:25:30 +00:00
Andre Maasikas
4ef3e261a4 r600c: preserve correct buffer when using fbo
Hopefully better than previous - this passes more mipgen tests
2011-01-18 16:25:19 +02:00
Andre Maasikas
0a85845c9e r600: set border color as RGBA
border color is RGBA for samples - this passes texenv tests
2011-01-18 16:21:14 +02:00
Andre Maasikas
52fbff2130 r600c: use STATE_FB_WPOS_Y_TRANSFORM variable to do wpos transform
use introduced STATE_FB_WPOS_Y_TRANSFORM variable (thanks Marek)
this gets coords also right when using fbo
2011-01-18 16:21:13 +02:00
Eric Anholt
e4be665bbd i965: Fix dead pointers to fp->Parameters->ParameterValues[] after realloc.
Fixes texrect-many regression with ff_fragment_shader -- as we added
refs to the subsequent texcoord scaling paramters, the array got
realloced to a new address while our params[] still pointed at the old
location.
2011-01-17 16:27:55 -08:00
Brian Paul
96a2e89dde llvmpipe: enable PIPE_CAP_INDEP_BLEND_FUNC
The driver was saying that independend blend functions was not supported,
but it really was.  The driver was using the per-target independend blend
factors but the state tracker was only setting the 0th one (per the
Gallium spec).

Fixes a piglit fbo-drawbuffers2-blend regression.
See https://bugs.freedesktop.org/show_bug.cgi?id=33215
2011-01-17 16:51:13 -07:00
Brian Paul
afeebecd95 st/mesa: move PIPE_CAP_INDEP_BLEND_FUNC code 2011-01-17 16:51:12 -07:00
Chad Versace
774750a32f doxygen: Add doxyfile for glsl module 2011-01-17 13:52:40 -08:00
Chad Versace
a54e2de4bb glsl: Refresh autogenerated parser files 2011-01-17 10:20:47 -08:00
Chad Versace
a9bf8c12ee glsl: Remove redundant semantic check in parser
The removed semantic check also exists in ast_type_specifier::hir(), which
is a more natural location for it.

The check verified that precision statements are applied only to types
float and int.
2011-01-17 10:20:47 -08:00
Chad Versace
08a286c9cc glsl: Add support for default precision statements
* Add new field ast_type_specifier::is_precision_statement.
* Add semantic checks in ast_type_specifier::hir().
* Alter parser rules accordingly.
2011-01-17 10:20:47 -08:00
Chad Versace
889e1a5b6c glsl: Add semantic checks for precision qualifiers
* Check that precision qualifiers only appear in language versions 1.00,
  1.30, and later.
* Check that precision qualifiers do not apply to bools and structs.

Fixes the following Piglit tests:
* spec/glsl-1.30/precision-qualifiers/precision-bool-01.frag
* spec/glsl-1.30/precision-qualifiers/precision-struct-01.frag
* spec/glsl-1.30/precision-qualifiers/precision-struct-02.frag
2011-01-17 09:41:25 -08:00
Chad Versace
33279cd2d3 glsl: Fix parser rule for type_specifier
Do not assign a value to ast_type_specifier::precision when no precision
qualifier is present.
2011-01-17 09:41:25 -08:00
Chad Versace
aaa31bf8f4 glsl: Change default value of ast_type_specifier::precision
Change default value to ast_precision_none, which denotes the absence of
a precision of a qualifier.

Previously, the default value was ast_precision_high. This made it
impossible to detect if a precision qualifier was present or not.
2011-01-17 09:41:25 -08:00
Chad Versace
1eb0f17fa4 glsl: Check that 'centroid in' does not occur in vertex shader
The check is performed only in GLSL versions >= 1.30.

From section 4.3.4 of the GLSL 1.30 spec:
   "It is an error to use centroid in in a vertex shader."

Fixes Piglit test
spec/glsl-1.30/compiler/storage-qualifiers/vs-centroid-in-01.vert
2011-01-17 09:41:25 -08:00
Chad Versace
8faaa4a672 glsl: Check that interpolation quals only apply to vertex ins and fragment outs
The check is performed only in GLSL versions >= 1.30.

Fixes the following Piglit tests:
* spec/glsl-1.30/compiler/interpolation-qualifiers/fs-smooth-02.frag
* spec/glsl-1.30/compiler/interpolation-qualifiers/vs-smooth-01.vert
2011-01-17 09:41:25 -08:00
Chad Versace
605aacc67d glsl: Check that interpolation qualifiers do not precede 'varying'
... and 'centroid varying'. The check is performed only in GLSL
versions >= 1.30.

From page 29 (page 35 of the PDF) of the GLSL 1.30 spec:
   "interpolation qualifiers may only precede the qualifiers in, centroid
    in, out, or centroid out in a declaration. They do not apply to the
    deprecated storage qualifiers varying or centroid varying."

Fixes Piglit test
spec/glsl-1.30/compiler/interpolation-qualifiers/smooth-varying-01.frag.
2011-01-17 09:41:24 -08:00
Chad Versace
0e2f8936c8 glsl: Add method ast_type_qualifier::interpolation_string()
If an interpolation qualifier is present, then the method returns that
qualifier's string representation. For example, if the noperspective bit
is set, then it returns "noperspective".
2011-01-17 09:41:24 -08:00
Brian Paul
5a64626ee5 vbo: init num_instances in split_prims()
Fixes a VTK regression after adding GL_ARB_draw_instanced.
2011-01-17 09:56:58 -07:00
Brian Paul
6179f7e38e tnl: assert that num_instances > 0 2011-01-17 09:40:16 -07:00
Brian Paul
72f2551017 mesa: s/primcount/numInstances/
primcount is also a parameter to glMultiDrawElements().  Use numInstances
to avoid confusion between these things.
2011-01-17 09:33:49 -07:00
Dave Airlie
2bf52e7c28 nouveau: fix build against out of tree libdrm
For doing builds against a separated libdrm these cflags are needed.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-01-17 15:42:34 +10:00
Christian König
ef3b8042e0 r600g: fix PIPE_CAP_INSTANCED_DRAWING warning 2011-01-16 23:52:53 +01:00
Christian König
b61afe13f1 r600g: fix alu inst group merging for relative adressing 2011-01-16 21:43:17 +01:00
Christoph Bumiller
a4742c6a07 nvc0: fix and enable instanced drawing and arrays 2011-01-16 14:10:46 +01:00
Chia-I Wu
326332a130 d3d1x: Fix broken build.
st/egl native.h changed its interface in
a22a332fc7.
2011-01-16 20:58:17 +08:00
Brian Paul
d136d1d2e1 mesa: minor tweaks in _mesa_set_fetch_functions() 2011-01-15 20:41:26 -07:00
Brian Paul
aad7219f80 mesa: add comment for _mesa_get_srgb_format_linear() 2011-01-15 20:41:06 -07:00
Brian Paul
bfad484505 mesa: move declarations before code 2011-01-15 20:37:57 -07:00
Dave Airlie
608ccfe316 docs: add GL_EXT_texture_sRGB_decode to relnotes 2011-01-16 12:54:57 +10:00
Dave Airlie
527bf67682 gallium: add EXT_texture_sRGB_decode.
This uses a sampler view to access the texture with the alternate format.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-01-16 12:54:07 +10:00
Dave Airlie
9b1a15e1cb i965: add support for EXT_texture_sRGB_decode
We just choose the texture format depending on the srgb decode bit
for the sRGB formats.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-01-16 12:54:06 +10:00
Dave Airlie
edc2dd8e47 mesa/swrast: implement EXT_texture_sRGB_decode
This implements the extension by choosing a different set of texture
fetch functions when the texture parameter changes.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-01-16 12:54:06 +10:00
Christian König
ac6334145e r600d: fix some bugs added reworking literal handling
If a literal slot isn't used it should be set
to 0 instead of an uninitialized value. Also the
channels for pre R700 trig functions were incorrect.
And most important literals were not counted against ndw,
resulting in an invalid force_add_cf detection.
2011-01-16 03:30:25 +01:00
Brian Paul
3bee900a72 docs: document GL_ARB_draw_buffers_blend 2011-01-15 18:38:46 -07:00
Brian Paul
b3ca110594 mesa: implement glGet queries for GL_ARB_draw_buffers_blend 2011-01-15 18:35:45 -07:00
Brian Paul
44c2122a73 mesa: display list support for GL_ARB_draw_buffers_blend functions 2011-01-15 18:35:45 -07:00
Brian Paul
7f48278edc mesa: plug in GL_ARB_draw_buffers_blend functions 2011-01-15 18:35:45 -07:00
Brian Paul
561307844f glapi: regenerated files 2011-01-15 18:35:45 -07:00
Brian Paul
1cf6ff3046 glapi: new entrypoint specs for GL_ARB_draw_buffers_blend 2011-01-15 18:35:45 -07:00
Brian Paul
74713e2d29 mesa: begin implementation of GL_ARB_draw_buffers_blend 2011-01-15 18:35:39 -07:00
Brian Paul
3dab2b1795 docs: update GL3.txt status 2011-01-15 17:41:43 -07:00
Brian Paul
9473ca356f docs: document GL_ARB_instanced_arrays 2011-01-15 17:40:56 -07:00
Brian Paul
a6860f0913 st/mesa: GL_ARB_instanced_arrays support 2011-01-15 17:37:41 -07:00
Brian Paul
1d1eb95787 mesa: support for GL_ARB_instanced_arrays 2011-01-15 17:37:41 -07:00
Brian Paul
1250e2330b glapi: regenerated files 2011-01-15 17:37:41 -07:00
Brian Paul
caee0d024f glapi: GL_ARB_instanced_arrays support 2011-01-15 17:37:40 -07:00
Brian Paul
5700bc6bac draw: add missing LP_CHECK_MEMBER_OFFSET() 2011-01-15 17:37:40 -07:00
Brian Paul
d1e284407c st/mesa: move/consolidate an assignment 2011-01-15 17:37:40 -07:00
Brian Paul
889f44bc90 docs: document GL_ARB_draw_instanced 2011-01-15 17:37:40 -07:00
Henri Verbeet
a25473b535 r600g: Remove the redundant radeon_new() prototype. 2011-01-15 19:48:43 +01:00
Henri Verbeet
5a2abf7a85 r600g: Fix some register value name typos.
SFR -> SRF.
2011-01-15 19:48:43 +01:00
Henri Verbeet
f6f7808028 r600g: Get rid of r600_translate_vertex_data_type().
This has been replaced with r600_vertex_data_type().
2011-01-15 19:48:43 +01:00
Brian Paul
652901e95b Merge branch 'draw-instanced'
Conflicts:
	src/gallium/auxiliary/draw/draw_llvm.c
	src/gallium/drivers/llvmpipe/lp_state_fs.c
	src/glsl/ir_set_program_inouts.cpp
	src/mesa/tnl/t_vb_program.c
2011-01-15 10:24:08 -07:00
Christoph Bumiller
21001d2ba7 nvc0: try to swap immediates to first source too 2011-01-15 14:14:55 +01:00
Christoph Bumiller
52474d4246 nvc0: make sure all sources of the BIND op are distinct
They're supposed to be assigned consecutive registers so they can't
contain the same SSA value more than once.
2011-01-15 14:14:50 +01:00
Christoph Bumiller
1ae982adfd nvc0: update user vbufs on each draw call
This is required in case set_vertex_buffers is not called again.
2011-01-15 12:18:52 +01:00
Christoph Bumiller
b50d02e2e0 nvc0: enable early fragment tests where possible 2011-01-15 12:17:57 +01:00
Christoph Bumiller
5ec66c6e70 nvc0: upload small buffers through the command buffer 2011-01-15 12:17:00 +01:00
Chia-I Wu
a4a5a9a5ce mesa: Add glDepthRangef and glClearDepthf to APIspec.xml.
Core mesa has gained support for GL_ARB_ES2_compatibility.  Make GLES
generated dispatch table use them.
2011-01-15 12:42:59 +08:00
Chia-I Wu
b70d0a6a51 targets/egl-static: Assorted cleanups and fixes.
Share more code between windows and non-windows platforms.  Check
env['x11'] for X11 and add env['X11_LIBS'] to LIBS.  Add ws_wrapper for
i965g.
2011-01-15 12:35:22 +08:00
Chia-I Wu
6f769a690b targets/egl: i965 needs libwsw.
Fix undefined symbol wrapper_sw_winsys_dewrap_pipe_screen.
2011-01-15 12:35:19 +08:00
Eric Anholt
4620de7eea mesa: Add getter for GL_SHADER_COMPILER with ARB_ES2_compatibility.
Fixes piglit arb_es2_compatibility-shadercompiler
2011-01-14 16:55:35 -08:00
Eric Anholt
8395f206a8 mesa: Add getters for ARB_ES2_compatibility MAX_*_VECTORS.
Fixes piglit arb_es2_compatibility-maxvectors.
2011-01-14 16:55:35 -08:00
Eric Anholt
e12c4faf7e mesa: Add support for glDepthRangef and glClearDepthf.
These are ARB_ES2_compatibility float variants of the core double
entrypoints.  Fixes arb_es2_compatibility-depthrangef.
2011-01-14 16:55:35 -08:00
Eric Anholt
25beab10cd ir_to_mesa: Fix segfaults on ir_to_mesa invocation after MSVC change. 2011-01-14 16:55:35 -08:00
Brian Paul
d42acef139 glsl: fix implicit int to bool warning
Maybe preprocess() should return a bool.
2011-01-14 17:46:47 -07:00
Brian Paul
7ff89b030f docs: skeleton file for 7.11 release notes, add missing links 2011-01-14 17:46:38 -07:00
Vinson Lee
7772a34f3a mesa: Dynamically allocate acp array in ir_to_mesa_visitor::copy_propagate.
Fixes these MSVC errors.
ir_to_mesa.cpp(2644) : error C2057: expected constant expression
ir_to_mesa.cpp(2644) : error C2466: cannot allocate an array of constant size 0
ir_to_mesa.cpp(2644) : error C2133: 'acp' : unknown size
ir_to_mesa.cpp(2646) : error C2070: 'ir_to_mesa_instruction *[]': illegal sizeof operand
ir_to_mesa.cpp(2709) : error C2070: 'ir_to_mesa_instruction *[]': illegal sizeof operand
ir_to_mesa.cpp(2718) : error C2070: 'ir_to_mesa_instruction *[]': illegal sizeof operand
2011-01-14 16:18:52 -08:00
Eric Anholt
7b987578a9 mesa: Add actual support for glReleaseShaderCompiler from ES2.
Fixes no-op dispatch warning in piglit
arb_es2_compatibility-releaseshadercompiler.c.
2011-01-14 15:30:04 -08:00
Eric Anholt
ed93f9f3a3 intel: Expose GL_ARB_ES2_compatibility.
We don't have all of the features of this extension hooked up yet, but
the consensus yesterday was that since those features are things that
we should also be supporting in our ES2 implementation, claiming ES2
here too doesn't make anything worse and will make incremental
improvement through piglit easier.
2011-01-14 15:30:01 -08:00
Eric Anholt
9c6954fc9d mesa: Add extension enable bit for GL_ARB_ES2_compatibility. 2011-01-14 15:28:50 -08:00
Eric Anholt
841ad6bfad glapi: Regenerate for GL_ARB_ES2_compatibility. 2011-01-14 15:28:01 -08:00
Eric Anholt
8560cb939b glapi: Add entrypoints and enums for GL_ARB_ES2_compatibility. 2011-01-14 15:28:00 -08:00
Alex Deucher
634dece281 r600g: compiler helper opcode fixes for evergreen
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-01-14 17:50:49 -05:00
Alex Deucher
9dfc68314d r600g: pass r600_bc to some addition compiler helper functions
needed for asic specific opcodes

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-01-14 17:50:29 -05:00
Vinson Lee
57ef69dd88 generate_builtins.py: Whitespace fixes.
Also removed unnecessary semicolons.
2011-01-14 14:19:02 -08:00
Vinson Lee
0de6d7e991 generate_builtins.py: Fix builds using Python 2.5. 2011-01-14 14:17:03 -08:00
Eric Anholt
a6e4614ca1 i965: Replace broken handling of dead code with an assert.
This code should never have been triggered, but I often did anyway
when I disabled optimization passes during debugging, then spent my
time debugging that this code doesn't work.
2011-01-14 13:57:15 -08:00
Eric Anholt
7c7df146b5 i965: Add an invalidation of live intervals after register splitting.
No effect, since it was called before live intervals were calculated.
2011-01-14 13:57:15 -08:00
Eric Anholt
65c41d55a0 mesa: Simplify _mesa_base_fbo_format by making it exceptions to teximages.
The comment of "this is just like teximages except for..." is a pretty
good clue that we're handling this wrong.  By just using the teximage
code, we catch a bunch of cases we'd missed, like GL_RED and GL_RG.
2011-01-14 13:57:15 -08:00
Eric Anholt
34a9da4eb4 mesa: Add channel-wise copy propagation to ir_to_mesa.
This catches more opportunities than the prog_optimize.c code on
openarena's fixed function shaders turned to GLSL, mostly due to
looking at multiple source instructions for copy propagation
opportunities.  It should also be much more CPU efficient than
prog_optimize.c's code.
2011-01-14 13:57:14 -08:00
Eric Anholt
d53c8380bf i915: Fix compiler warning from sw fallback removal change. 2011-01-14 13:57:14 -08:00
Vinson Lee
4c6d6dd8fc r600g: Disable V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_FLT_TO_INT_FLOOR case.
The usage of macro V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_FLT_TO_INT_FLOOR was
introduced by commit 323ef3a1f0 but the
macro is undefined. Disable this case to fix the build for now.
2011-01-14 13:47:37 -08:00
Kristian Høgsberg
6e9b0f6807 gles2: Also support GL_BGRA_EXT for glTexSubImage2d 2011-01-14 16:12:21 -05:00
Christian König
323ef3a1f0 r600g: add more missing instructions to r600_bc_get_num_operands 2011-01-14 18:46:52 +01:00
Chia-I Wu
e7d8f92570 egl: Fix EGL_VERSION string.
Fix a copy-and-paste error in a4a38dcf61.
2011-01-14 14:29:19 +08:00
Chia-I Wu
36a59b29ef egl: Fix an assertion in _eglUpdateAPIsString.
dpy->ClientAPIs was renamed in a4a38dcf61.
2011-01-14 14:12:42 +08:00
Dave Airlie
483de8ef2e i965: fix fbo-srgb on i965.
Until we get the EXT_framebuffer_sRGB extension we should bind the sRGB
formats for FBO as linear.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-01-14 14:58:47 +10:00
Dave Airlie
7f652fc523 srgb: fix fbo base format picking.
Pointed out by Brian.
2011-01-14 14:58:47 +10:00
Chad Versace
7b9dc40b0d i915: Disable extension OES_standard_derivatives
OES_standard_derivatives must be manually disabled for i915 because Mesa
enables it by default.
2011-01-13 17:26:28 -08:00
Chad Versace
78838b2d1b mesa: Change OES_standard_derivatives to be stand-alone extension
Add a bit in struct gl_extensions for OES_standard_derivatives, and enable
the bit by default. Advertise the extension only if the bit is enabled.

Previously, OES_standard_derivatives was advertised in GLES2 contexts
if ARB_framebuffer_object was enabled.
2011-01-13 17:26:28 -08:00
Vinson Lee
a2ab929ab2 r600g: Move declaration before code in r600_asm.c.
Fixes SCons build.
2011-01-13 14:17:01 -08:00
Christian König
96f8f8db7b r600g: rework literal handling 2011-01-13 23:01:35 +01:00
Christian König
d7342f6a81 r600g: merge alu groups 2011-01-13 23:01:35 +01:00
Christian König
eea1d8199b r600g: implement replacing gpr with pv and ps 2011-01-13 23:01:35 +01:00
Ian Romanick
4bcff0c190 glsl: Emit errors or warnings when 'layout' is used with 'attribute' or 'varying'
The specs that add 'layout' require the use of 'in' or 'out'.
However, a number of implementations, including Mesa, shipped several
of these extensions allowing the use of 'varying' and 'attribute'.
For these extensions only a warning is emitted.

This differs from the behavior of Mesa 7.10.  Mesa 7.10 would only
accept 'attribute' with 'layout(location)'.  This behavior was clearly
wrong.  Rather than carrying the broken behavior forward, we're just
doing the correct thing.

This is related to (piglit) bugzilla #31804.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
2011-01-13 13:38:50 -08:00
Ian Romanick
82c4b4f88a glsl: Allow 'in' and 'out' when 'layout' is also available
All of the extensions that add the 'layout' keyword also enable (and
required) the use of 'in' and 'out' with shader globals.

This is related to (piglit) bugzilla #31804.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
2011-01-13 13:35:50 -08:00
José Fonseca
e1bc68b014 scons: Fix cross-compilation.
Hairy stuff. Don't know how to do it better though.
2011-01-13 20:53:42 +00:00
Christian König
0448f73f06 r600g: add missing RECIPSQRT_CLAMPED to r600_bc_get_num_operands 2011-01-13 21:29:47 +01:00
Christian König
a25b91c2c2 r600g: rework bank swizzle code 2011-01-13 21:22:00 +01:00
Christian König
89275c0b36 r600g: fix alu slot assignment 2011-01-13 19:41:07 +01:00
Christian König
236e99fe05 r600g: optimize away CF ALU instructions even if type doesn't match 2011-01-13 19:41:07 +01:00
Christoph Bumiller
370ae0bd61 nvc0: identify POINT_RASTER_RULES, add POINT_SMOOTH state
Point smoothing requires rasterization rules to be set to OGL.

Sorry for the extra noise caused by the header update.
2011-01-13 19:36:25 +01:00
Chia-I Wu
abbb1c8f08 draw: Fix an off-by-one bug in a vsplit assertion.
When use_spoken is true, istart (the first vertex of this segment) is
replaced by i0 (the spoken vertex of the fan).  There are still icount
vertices.

Thanks to Brian Paul for spotting this.
2011-01-14 02:02:26 +08:00
Vinson Lee
1f66930332 i965: Remove unnecessary headers. 2011-01-13 09:28:47 -08:00
Vinson Lee
d599df8a8c targets/egl-static: Remove unnecessary header. 2011-01-13 09:16:25 -08:00
Vinson Lee
eb70e58caf r600g: Silence uninitialized variable warnings. 2011-01-13 09:07:19 -08:00
Vinson Lee
d76f1da7cb mesa: Add missing break statement in SARGB8 case. 2011-01-13 08:53:33 -08:00
Brian Paul
ca31c596e8 egl: need stdio.h for non-Windows build too to avoid compiler warning 2011-01-13 09:25:55 -07:00
Paulo Zanoni
dad914f6b2 dri_util: fail driCreateNewScreen if InitScreen is NULL
Without this, X doesn't start with UMS on r300g.

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

Signed-off-by: Paulo Zanoni <pzanoni@mandriva.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-01-13 07:44:33 -07:00
José Fonseca
9277a62aa3 scons: Ensure the OpenVG/EGL import libs are also prefixed with 'lib'. 2011-01-13 12:33:41 +00:00
José Fonseca
63528c4510 scons: Build libOpenVG.dll & libEGL.dll
But without creating liblibOpenVG or liblibEGL elsewhere.

Thanks Chia-I Wu for pointing this out.
2011-01-13 11:54:43 +00:00
José Fonseca
80f18876f6 util: Undo spurious changes in last commit. 2011-01-13 11:45:40 +00:00
José Fonseca
fe2cfd9b19 util: Don't limit debug_printf message length on unices. 2011-01-13 11:44:16 +00:00
Chia-I Wu
a22a332fc7 egl: Improve driver selection.
The idea is to be able to match a driver using the following order

  try egl_gallium with hw renderer
  try egl_dri2
  try egl_gallium with sw renderer
  try egl_glx

given the module list

  egl_gallium
  egl_dri2
  egl_glx

For that, UseFallback initialization option is added.  The module list
is matched twice: with the option unset and with the option set.  In the
first pass, egl_gallium skips its sw renderer and egl_glx rejects to
initialize since UseFallback is not set.  In the second pass,
egl_gallium skips its hw renderer and egl_dri2 rejects to initialize
since UseFallback is set.  The process stops at the first driver that
initializes the display.
2011-01-13 18:15:45 +08:00
Chia-I Wu
655e459892 egl: Simplify driver matching.
Add initialization options that drv->API.Initialize should support.
Replace drv->Probe by TestOnly initialization option and simplify
_eglMatchDriver.
2011-01-13 18:10:38 +08:00
Chia-I Wu
a4a38dcf61 egl: Cleanup _EGLDisplay initialization.
Reorder/rename and document the fields that should be set by the driver during
initialization.  Drop the major/minor arguments from drv->API.Initialize.
2011-01-13 17:57:38 +08:00
Kenneth Graunke
47b2af2c62 glsl/s_expression: Read and ignore Scheme-style comments.
A single-semicolon until the end of the line, i.e.
; this is a comment.
2011-01-12 23:55:34 -08:00
Kenneth Graunke
5bfb68cd0f glsl/builtins: Remove unnecessary (constant bool (1)) from assignments.
This isn't strictly necessary, but is definitely nicer.
2011-01-12 23:55:34 -08:00
Kenneth Graunke
bbafd2b849 ir_reader: Make assignment conditions optional.
You can now simply write (assign (xy) <lhs> <rhs>) instead of the
verbose (assign (constant bool (1)) (xy) <lhs> <rhs>).
2011-01-12 23:55:34 -08:00
Kenneth Graunke
b74ff382a4 ir_reader: Convert to a class.
This makes it unnecessary to pass _mesa_glsl_parse_state around
everywhere, making at least the prototypes a lot easier to read.

It's also more C++-ish than a pile of static C functions.
2011-01-12 23:55:34 -08:00
Kenneth Graunke
ec7e4f0ec5 ir_reader: Combine the three dereference reading functions into one.
These used to be more complicated, but now are so simple there's no real
point in keeping them separate.
2011-01-12 23:55:34 -08:00
Kenneth Graunke
e486fca2d3 ir_reader: Relax requirement that function arguments be s_lists.
All of these functions used to take s_list pointers so they wouldn't all
need SX_AS_LIST conversions and error checking.  However, the new
pattern matcher conveniently does this for us in one centralized place.

So there's no need to insist on s_list.  Switching to s_expression saves
a bit of code and is somewhat cleaner.
2011-01-12 23:55:33 -08:00
Kenneth Graunke
d798815272 ir_reader: Remove s_list::length() method.
Most code now relies on the pattern matcher rather than this function,
and for the only remaining case, not using this saves an iteration.
2011-01-12 23:55:33 -08:00
Kenneth Graunke
daeb0c646e ir_reader: Add a pattern matching system and use it everywhere.
Previously, the IR reader was riddled with code that:
1. Checked for the right number of list elements (via a linked list walk)
2. Retrieved references to each component (via ->next->next pointers)
3. Downcasted as necessary to make sure that each sub-component was the
   right type (i.e. symbol, int, list).
4. Checking that the tag (i.e. "declare") was correct.

This was all very ad-hoc and a bit ugly.  Error checking had to be done
at both steps 1, 3, and 4.  Most code didn't even check the tag, relying
on the caller to do so.  Not all callers did.

The new pattern matching module performs the whole process in a single
straightforward function call, resulting in shorter, more readable code.

Unfortunately, MSVC does not support C99-style anonymous arrays, so the
pattern must be declared outside of the match call.
2011-01-12 23:55:33 -08:00
Dave Airlie
407184fe08 mesa/srgb: handle SARGB8 case in the sw fbo renderer. 2011-01-13 16:51:30 +10:00
Fredrik Höglund
71b889f904 st/mesa: fix a regression from cae2bb76
stObj->pt is null when a TFP texture is passed to st_finalize_texture,
and with the changes introduced in the above commit this resulted in a
new texture being created and the existing image being copied into it.

NOTE: This is a candidate for the 7.10 branch.

Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
2011-01-13 01:22:20 -05:00
Ben Skeggs
bd2b72359e nvc0: disable calling of sw methods we don't implement
Left in the code as a marker of what NVIDIA do, just in case we need
to do this some day.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-01-13 15:26:31 +10:00
Dave Airlie
8c8e26d66a mesa/fbo: prevent assert trigger on i965 with piglit fbo-srgb test. 2011-01-13 15:17:34 +10:00
Ben Skeggs
0c1db2feb9 nvc0: fix mp_stack_bo relocation
Fixes a PT_NOT_PRESENT error cause by:
- allocating in VRAM
- emitting GART relocs to 0x17bc/0x17c0, moving the buffer
- telling the bufmgr that the buffer should be in VRAM when we use it,
  but not correcting the value sent to 0x17bc/0x17c0.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-01-13 13:31:29 +10:00
Vinson Lee
31b1051663 mesa: Move loop variable declarations outside for loop in extensions.c.
Fixes MSVC build.
2011-01-12 17:43:28 -08:00
Brian Paul
dd973cd9e8 mesa: check for dummy renderbuffer in _mesa_FramebufferRenderbufferEXT()
Fixes a failed assertion when a renderbuffer ID that was gen'd but not
previously bound was passed to glFramebufferRenderbuffer().  Generate
the same error that NVIDIA does.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
2011-01-12 18:14:18 -07:00
Brian Paul
67722ae403 mesa: don't assert in GetIntegerIndexed, etc
We were getting an assertion upon invalid pname.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
2011-01-12 18:13:18 -07:00
Brian Paul
2fa6012f6a mesa: fix num_draw_buffers==0 in fixed-function fragment program generation
This fixes a problem when glDrawBuffers(GL_NONE).  The fragment program
was writing to color output[0] but OutputsWritten was 0.  That led to a
failed assertion in the Mesa->TGSI translation code.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
2011-01-12 17:55:45 -07:00
Brian Paul
30616fdacf st/mesa: add st_BeginQuery() case for GL_ANY_SAMPLES_PASSED
Fixes piglit occlusion_query2 failure.
2011-01-12 17:55:44 -07:00
Brian Paul
1b173fb3ba glsl: remove trailing comma to silence warning 2011-01-12 17:55:44 -07:00
Brian Paul
4d96af9337 noop: change var type to silence warning 2011-01-12 17:55:44 -07:00
Kenneth Graunke
b076551e3b glsl/Makefile: Fix build with --as-needed. 2011-01-12 16:37:03 -08:00
Vinson Lee
356e2e962f mesa: Move declaration before code in extensions.c.
Fixes SCons build.
2011-01-12 16:23:11 -08:00
Chad Versace
a7b5664c05 mesa: Change OES_point_sprite to depend on ARB_point_sprite
The extension string in GLES1 contexts always advertised
GL_OES_point_sprite. Now advertisement depends on ARB_point_sprite being
enabled.

Reviewed-by: Ian Romanick <idr@freedesktop.org>
2011-01-12 15:45:03 -08:00
Chad Versace
039150169e mesa: Change dependencies of some OES extension strings
Change all OES extension strings that depend on ARB_framebuffer_object to
instead depend on EXT_framebuffer_object.

Reviewed-by: Ian Romanick <idr@freedesktop.org>
2011-01-12 15:45:03 -08:00
Chad Versace
19418e921a mesa: Add/remove extensions in extension string
Add GL_OES_stencil8 to ES2.

Remove the following:
   GL_OES_compressed_paletted_texture : ES1
   GL_OES_depth32                     : ES1, ES2
   GL_OES_stencil1                    : ES1, ES2
   GL_OES_stencil4                    : ES1, ES2
Mesa advertised these extensions, but did not actually support them.

Reviewed-by: Ian Romanick <idr@freedesktop.org>
2011-01-12 15:45:03 -08:00
Chad Versace
9b260c377f mesa: Refactor handling of extension strings
Place GL, GLES1, and GLES2 extensions in a unified extension table. This
allows one to enable, disable, and query the status of GLES1 and GLES2
extensions by name.

When tested on Intel Ironlake, this patch did not alter the extension
string [as given by glGetString(GL_EXTENSIONS)] for any API.

Reviewed-by: Ian Romanick <idr@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-01-12 15:45:03 -08:00
Ian Romanick
bd33055ef4 glsl: Track variable usage, use that to enforce semantics
In particular, variables cannot be redeclared invariant after being
used.

Fixes piglit test invariant-05.vert and bugzilla #29164.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
2011-01-12 14:30:31 -08:00
Eric Anholt
c3f000b392 i965/fs: Do flat shading when appropriate.
We were trying to interpolate, which would end up doing unnecessary
math, and doing so on undefined values.   Fixes glsl-fs-flat-color.
2011-01-12 13:51:01 -08:00
Christian König
6881262eff r600g: also look at tex inst when for maximum gpu count 2011-01-12 20:41:15 +01:00
Vinson Lee
a42906f862 generate_builtins.py: Add missing import.
Import sys for sys.exit.
2011-01-12 11:35:43 -08:00
Eric Anholt
e1fb511570 meta: Actually use mipmapping when generating mipmaps.
With the change to not reset baselevel, this GL_LINEAR filtering was
resulting in generating mipmaps off of the base level instead of the
next higher detail level.  Fixes fbo-generatemipmap-filtering.

Reported by: Neil Roberts <neil@linux.intel.com>
2011-01-12 11:08:07 -08:00
Eric Anholt
e880a57a71 i965: Clarify when we need to (re-)calculate live intervals.
The ad-hoc placement of recalculation somewhere between when they got
invalidated and when they were next needed was confusing.  This should
clarify what's going on here.
2011-01-12 11:08:07 -08:00
Christian König
c60cb25bfb r600g: implement output modifiers and use them to further optimize LRP 2011-01-12 19:44:49 +01:00
Christian König
7728bef290 r600g: use special constants for 0, 1, -1, 1.0f, 0.5f etc 2011-01-12 19:40:52 +01:00
Christian König
dffad730df r600g: optimize temp register handling for LRP 2011-01-12 19:36:55 +01:00
Christian König
8813842121 r600g: optimize away CF_INST_POP
If last instruction is an CF_INST_ALU we don't need to emit an
additional CF_INST_POP for stack clean up after an IF ELSE ENDIF.
2011-01-12 19:31:36 +01:00
Christian König
052b9e8fab r600g: make dumping of shaders an option 2011-01-12 19:17:49 +01:00
Christian König
95a2b265fa r600g: fix alu dumping 2011-01-12 19:17:49 +01:00
Christian König
47e7c6f571 r600g: improve r600_bc_dump 2011-01-12 19:17:49 +01:00
Eric Anholt
9351ef7a44 i965/vs: When MOVing to produce ABS, strip negate of the operand.
We were returning the negative absolute value, instead of the absolute
value.  Fixes glsl-vs-abs-neg.
2011-01-12 09:50:34 -08:00
Eric Anholt
ab56e3be9a i965/fs: When producing ir_unop_abs of an operand, strip negate.
We were returning the negative absolute value, instead of the absolute
value.  Fixes glsl-fs-abs-neg.
2011-01-12 09:50:10 -08:00
José Fonseca
416ca90138 glsl: Make builtin_compiler build on Windows with MSVC. 2011-01-12 16:58:37 +00:00
José Fonseca
0035d1d902 glsl: Make builtin_compiler portable for non-unices. 2011-01-12 16:54:25 +00:00
José Fonseca
f9bb5323eb getopt: Make code more portable. 2011-01-12 16:54:21 +00:00
José Fonseca
6d670f6c0f getopt: Import OpenBSD getopt implementation for MSVC. 2011-01-12 15:32:17 +00:00
José Fonseca
46662de68b scons: Update windows build for vgapi->openvg rename. 2011-01-12 15:13:57 +00:00
José Fonseca
b07ad1d6bd scons: Fix build on systems without libOpenVG.so 2011-01-12 15:06:57 +00:00
Chia-I Wu
1e4f412242 egl: When EGL_DRIVER is set, do not add other drivers.
Setting EGL_DRIVER forces the driver to be loaded, as documented.  There
should be no fallbacks.
2011-01-12 18:10:15 +08:00
Chia-I Wu
4924cb9036 egl: libEGL depends on LOCAL_LIBS.
So that libEGL is rebuilt whenever LOCAL_LIBS changes.
2011-01-12 18:10:15 +08:00
Chia-I Wu
39812c48df egl_dri2: Fix eglGetProcAddress.
The driver struct is zeroed after dri2_load.  Oops.
2011-01-12 18:10:15 +08:00
Chia-I Wu
a8b6b6555c scons: Updates for targets/egl-static.
Update SConscripts to re-enable or add support for EGL on windows and
x11 platforms respectively.  targets/egl-gdi is replaced by
targets/egl-static, where "-static" means pipe drivers and state
trackers are linked to statically by egl_gallium, and egl_gallium is a
built-in driver of libEGL.  There is no more egl_gallium.dll on Windows.
2011-01-12 17:40:01 +08:00
Chia-I Wu
49ed5bb28d targets/egl-static: New EGL target for scons.
This target is based on and replaces egl-gdi.  It is suitable for both
windows and x11.
2011-01-12 17:40:01 +08:00
Kenneth Graunke
1412dea949 glsl: Add type inference support for remaining expression opcodes. 2011-01-11 23:28:58 -08:00
Eric Anholt
4eb7284ef9 i965: Tighten up the check for flow control interfering with coalescing.
This greatly improves codegen for programs with flow control by
allowing coalescing for all instructions at the top level, not just
ones that follow the last flow control in the program.
2011-01-11 16:04:25 -08:00
Christian König
93a95ad8ff r600g: texture instructions also work fine with TGSI_FILE_INPUT 2011-01-12 00:44:30 +01:00
Christian König
a1146c1373 r600g: DP4 also supports writemasking 2011-01-12 00:41:49 +01:00
Christian König
7be5455796 r600g: Why all this fiddling with tgsi_helper_copy?
tgsi_helper_copy is used on several occasions to copy a temporary result
into the real destination register to emulate writemasks for OP3 and
reduction operations. According to R600 ISA that's unnecessary.

This patch fixes this use for MAD, CMP and DP4.
2011-01-12 00:40:55 +01:00
Christian König
cc0f604241 r600g: fix tex and vtx joining 2011-01-12 00:06:48 +01:00
Eric Anholt
c00bc13564 glsl: Fix the lowering of variable array indexing to not lose write_masks.
Fixes glsl-complex-subscript on 965.
2011-01-11 14:50:19 -08:00
Eric Anholt
5acf94e955 i965: Remove dead fallback for stencil _Enabled but no stencil buffer.
The _Enabled field is the thing that takes into account whether
there's a stencil buffer.  Tested with piglit glx-visuals-stencil.
2011-01-11 13:48:31 -08:00
Tilman Sauerbeck
242205404d r600g: Fixed SIN/COS/SCS for the case where the operand is a literal.
Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
2011-01-11 22:37:01 +01:00
Alberto Milone
ca8960234e r600c: add evergreen ARL support.
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
2011-01-11 14:48:44 -05:00
Jerome Glisse
0865af4b42 noop: remove dead dri target
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2011-01-11 14:46:09 -05:00
Jerome Glisse
63b9790a55 r600g: move user fence into base radeon structure
This avoid any issue when context is free and we still try to
access fence through radeon structure.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2011-01-11 14:34:25 -05:00
Brian Paul
483f566222 configure: bump libdrm version requirement to 2.4.23
NOTE: This is a candidate for the 7.10 (and 7.9?) branch.
2011-01-11 09:42:54 -07:00
Brian Paul
167db6d34f mesa: include teximage.h to silence warning 2011-01-11 09:37:35 -07:00
Brian Paul
d92e56460e mesa: do a debug check of _mesa_format_to_type_and_comps()
Make sure that all formats are handled in this function.  It's
easy to miss this function when adding new pixel formats.

See also http://bugs.freedesktop.org/show_bug.cgi?id=31544
2011-01-11 09:27:06 -07:00
Brian Paul
0073f50cd4 mesa: fix a few format table mistakes, assertions
The BaseFormat field was incorrect for a few R and RG formats.
Fix a couple assertions too.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
2011-01-11 09:27:06 -07:00
Kenneth Graunke
33d0c44910 glsl: Autogenerate builtin_functions.cpp as part of the build process.
Python is already necessary for other parts of Mesa, so there's no
reason we can't just generate it.  This patch updates both make and
SCons to do so.
2011-01-10 19:03:27 -08:00
Ian Romanick
469ea695bb glsl: Disallow 'in' and 'out' on globals in GLSL 1.20
Fixes piglit tests glsl-1.20/compiler/qualifiers/in-01.vert and
glsl-1.20/compiler/qualifiers/out-01.vert and bugzilla #32910.

NOTE: This is a candidate for the 7.9 and 7.10 branches.  This patch
also depends on the previous two commits.
2011-01-10 17:39:16 -08:00
Ian Romanick
a0c2ec8e2d glsl: Refresh autogenerated parser file.
For the previous commit.
2011-01-10 17:39:16 -08:00
Ian Romanick
eebdfdfbcf glsl: Add version_string containing properly formatted GLSL version 2011-01-10 17:39:16 -08:00
Ian Romanick
a302d740bd glcpp: Refresh autogenerated lexer and parser files.
For the previous commit.
2011-01-10 17:38:56 -08:00
Ian Romanick
9ca5300b6e glcpp: Generate an error for division by zero
When GCC encounters a division by zero in a preprocessor directive, it
generates an error.  Since the GLSL spec says that the GLSL
preprocessor behaves like the C preprocessor, we should generate that
same error.

It's worth noting that I cannot find any text in the C99 spec that
says this should be an error.  The only text that I can find is line 5
on page 82 (section 6.5.5 Multiplicative Opertors), which says,

    "The result of the / operator is the quotient from the division of
    the first operand by the second; the result of the % operator is
    the remainder. In both operations, if the value of the second
    operand is zero, the behavior is undefined."

Fixes 093-divide-by-zero.c test and bugzilla #32831.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
2011-01-10 17:37:51 -08:00
Chad Versace
4e09a786d2 glcpp: Regenerate glcpp-parse.c 2011-01-10 17:28:24 -08:00
Chad Versace
4fff52f1c9 glcpp: Fix segfault when validating macro redefinitions
In _token_list_equal_ignoring_space(token_list_t*, token_list_t*), add
a guard that prevents dereferncing a null token list.

This fixes test src/glsl/glcpp/tests/092-redefine-macro-error-2.c and
Bugzilla #32695.
2011-01-10 17:28:24 -08:00
Eric Anholt
c0cdae0368 i965: Use a new miptree to avoid software fallbacks due to drawing offset.
When attaching a small mipmap level to an FBO, the original gen4
didn't have the bits to support rendering to it.  Instead of falling
back, just blit it to a new little miptree just for it, and let it get
revalidated into the stack later just like any other new teximage.

Bug #30365.
2011-01-10 17:21:54 -08:00
Eric Anholt
6bdc319421 intel: Drop the speculatively-use-firstImage-mt in validation.
It's been replaced by just setting texObj->mt to image->mt at TexImage
time.
2011-01-10 17:21:11 -08:00
Eric Anholt
bdc6dc1d7e intel: Don't relayout the texture on maxlevel change.
This avoids relayouts in the common case of glGenerateMipmap() or
people doing similar things.

Bug #30366.
2011-01-10 17:21:11 -08:00
Eric Anholt
48024fb44c intel: When making a new teximage miptree, make a full one.
If we hit this path, we're level 1+ and the base level got allocated
as a single level instead of a full tree (so we don't match
intelObj->mt).  This tries to recover from that so that we end up with
2 allocations and 1 validation blit (old -> new) instead of
allocations equal to number of levels and levels - 1 blits.
2011-01-10 17:21:11 -08:00
Eric Anholt
bd4a2e9209 meta: Don't tweak BaseLevel when doing glGenerateMipmap().
We don't need to worry about levels other than MaxLevel because we're
minifying -- the lower levels (higher detail) won't contribute to the
result.  By changing BaseLevel, we forced hardware that doesn't
support BaseLevel != 0 to relayout the texture object.
2011-01-10 17:21:11 -08:00
Eric Anholt
5b3eb7538c Revert "intel: Always allocate miptrees from level 0, not tObj->BaseLevel."
This reverts commit 7ce6517f3a.
This reverts commit d60145d06d.

I was wrong about which generations supported baselevel adjustment --
it's just gen4, nothing earlier.  This meant that i915 would have
never used the mag filter when baselevel != 0.  Not a severe bug, but
not an intentional regression.  I think we can fix the performance
issue another way.
2011-01-10 17:21:10 -08:00
Kenneth Graunke
da0c0dbab0 i965: Add #defines for HiZ and separate stencil buffer commands. 2011-01-10 15:44:32 -08:00
Kenneth Graunke
4b929c75e2 i965: Add new HiZ related bits to WM_STATE. 2011-01-10 15:44:32 -08:00
Kenneth Graunke
1feee7b1b3 i965: Rename more #defines to 3DSTATE rather than CMD or CMD_3D.
Again, this makes it match the documentation.
2011-01-10 15:44:32 -08:00
Kenneth Graunke
6c5e6cd130 i965: Remove unused #defines which only contain the sub-opcode.
Most _3DSTATE defines contain the command type, sub-type, opcode, and
sub-opcode (i.e. 0x7905).  These, however, contain only the sub-opcode
(i.e. 0x05).  Since they are inconsistent with the rest of the code and
nothing uses them, simply delete them.

The _3DOP and _3DCONTROL defines seemed similar, and were also unused.
2011-01-10 15:44:32 -08:00
Chad Versace
61428dd2ab glsl: At link-time, check that globals have matching centroid qualifiers
Fixes bug 31923: http://bugs.freedesktop.org/show_bug.cgi?id=31923
2011-01-10 15:29:30 -08:00
Tom Fogal
0e3ff159f9 Add GLX_TLS setting to configs/default.
Should have gone in with 31351dc029,
thanks to Dan Nicholson for noticing.
2011-01-10 15:39:21 -07:00
Dave Airlie
a988ddf379 mesa/swrast: handle sRGB FBOs correctly (v2)
From reading EXT_texture_sRGB and EXT_framebuffer_sRGB and interactions
with FBO I've found that swrast is converting the sRGB values to linear for
blending when an sRGB texture is bound as an FBO. According to the spec
and further explained in the framebuffer_sRGB spec this behaviour is not
required unless the GL_FRAMEBUFFER_SRGB is enabled and the Visual/config
exposes GL_FRAMEBUFFER_SRGB_CAPABLE_EXT.

This patch fixes swrast to use a separate Fetch call for FBOs bound to
SRGB and avoid the conversions.

v2: export _mesa_get_texture_dimensions as per Brian's comments.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-01-11 08:32:33 +10:00
Tom Fogal
31351dc029 Export TLS support in gl.pc. 2011-01-10 12:34:02 -07:00
Marek Olšák
9d33e4e16c r300g: add debug option for buffer upload logging 2011-01-10 05:45:10 +01:00
Chia-I Wu
97e9a0e23f st/egl: Fix a void pointer arithmetic warning. 2011-01-10 11:51:13 +08:00
Chia-I Wu
12583174c5 mesa: Remove GLES overlay.
With core mesa doing runtime API checks, GLES overlay is no longer
needed.  Make --enable-gles-overlay equivalent to --enable-gles[12].
There may still be places where compile-time checks are done.  They
could be fixed case by case.
2011-01-10 11:50:35 +08:00
Chia-I Wu
c98ea26e16 egl: Make egl_dri2 and egl_glx built-in drivers.
These two drivers are small in size.  Making them built-in should
simplify packaging.
2011-01-10 11:50:34 +08:00
Chia-I Wu
15f0223931 egl_glx: Load libGL dynamically.
This is a step forward for compatibility with really old GLX.  But the
real reason for making this change now is so that we can make egl_glx a
built-in driver without having to link to libGL.
2011-01-10 11:25:31 +08:00
Chia-I Wu
fef5d14494 egl_dri2: Look up _glapi_get_proc_address dynamically.
In preparation for making egl_dri2 built-in.  It also handles

  symbol lookup error: /usr/local/lib/egl/egl_dri2.so: undefined symbol:
  _glapi_get_proc_address

more gracefully.
2011-01-10 11:23:24 +08:00
Vinson Lee
231ca0ec85 r600: Include mfeatures.h in files that perform feature tests. 2011-01-09 18:29:02 -08:00
Vinson Lee
c45814d6d3 r300: Include mfeatures.h in files that perform feature tests. 2011-01-09 18:25:36 -08:00
Vinson Lee
7a1cdef6c4 r200: Include mfeatures.h in files that perform feature tests. 2011-01-09 18:22:07 -08:00
Jerome Glisse
3349517351 noop: make noop useable like trace or rbug
If you want to enable noop set GALLIUM_NOOP=1 as an env variable.
You need first to enable noop wrapping for your driver see change
to src/gallium/targets/dri-r600/ in this commit as an example.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2011-01-09 21:04:41 -05:00
Marek Olšák
ac6306e9ca r300g: do not upload the same user buffer several times
Performance++.
2011-01-09 22:43:41 +01:00
Christoph Bumiller
b3d8e1fb3b nvc0: implement queries 2011-01-09 21:50:06 +01:00
Juan Zhao
e59fa4c46c dri2: release texture image.
Add release function for texture_from_pixmap extension.
Some platform need to release texture image for texture_from_pixmap
extension, add this interface for those platforms.
2011-01-09 14:55:16 -05:00
Vinson Lee
fb9c6e681f radeon: Include mfeatures.h in files that perform feature tests. 2011-01-09 01:45:04 -08:00
Vinson Lee
1933e97034 dri/nouveau: Include mfeatures.h in files that perform feature tests. 2011-01-09 01:33:14 -08:00
Vinson Lee
45a56e4730 intel: Include mfeatures.h in files that perform feature tests. 2011-01-09 01:25:54 -08:00
Vinson Lee
14b36cd568 vbo: Include mfeatures.h in files that perform feature tests. 2011-01-09 01:18:23 -08:00
Vinson Lee
edc09358f7 st/mesa: Include mfeatures.h in files that perform feature tests. 2011-01-09 01:04:19 -08:00
Vinson Lee
21750a2d9d mesa: Include mfeatures.h in program.c.
Include mfeatures.h for feature tests.
2011-01-09 00:47:33 -08:00
Dave Airlie
97195d04fd i965g: fix warnings 2011-01-09 17:25:12 +10:00
Dave Airlie
5e044e3900 i965g: update intel_decode from upstream. 2011-01-09 17:21:52 +10:00
Dave Airlie
3ee8d13c00 i965g: update disassembler code from classic.
still a bit of work to do, the winsys gen setting is a bit of a hack.
2011-01-09 17:21:10 +10:00
Dave Airlie
9562284114 i965g: update brw_defines.h from classic driver 2011-01-09 17:21:10 +10:00
Dave Airlie
571b317d02 i965g: update brw_structs.h from classic driver. 2011-01-09 17:21:10 +10:00
Dave Airlie
5826967d2e i965g: update to similiar gen stuff as i965 2011-01-09 17:21:10 +10:00
Marek Olšák
3332229b3b r300g: fix crash when flushing ZMASK
https://bugs.freedesktop.org/show_bug.cgi?id=32912

The fix is to call update_derived_state before user buffer uploads.
I've also moved some code around.

Unfortunately, there are still some ZMASK-related bugs which cause
misrendering, i.e. flushing doesn't always work and glean/fbo fails.
2011-01-09 06:14:23 +01:00
Marcin Slusarz
69191d4123 targets/egl: add libnvc0.a to nouveau libs 2011-01-09 00:46:35 +01:00
Christoph Bumiller
90e29afcb6 nvfx,nv50: pipe_reference the constant buffers 2011-01-08 15:40:14 +01:00
Christoph Bumiller
703f3597ad nvc0: fix primitive restart in immediate mode 2011-01-08 14:25:20 +01:00
Vinson Lee
d8cfe46442 mesa: Clean up header file inclusion in cpuinfo.c. 2011-01-08 03:03:17 -08:00
Marek Olšák
7c16a77b00 r300g: fix a surface leak when flushing ZMASK 2011-01-08 09:42:17 +01:00
Marek Olšák
1f0348c4a2 r300g: rework command submission and resource space checking
The motivation behind this rework is to get some speed by reducing
CPU overhead. The performance increase depends on many factors,
but it's measurable (I think it's about 10% increase in Torcs).

This commit replaces libdrm's radeon_cs_gem with our own implemention.
It's optimized specifically for r300g, but r600g could use it as well.
Reloc writes and space checking are faster and simpler than their
counterparts in libdrm (the time complexity of all the functions
is O(1) in nearly all scenarios, thanks to hashing).
(libdrm's radeon_bo_gem is still being used in the driver.)

It works like this:

cs_add_reloc(cs, buf, read_domain, write_domain) adds a new relocation and
also adds the size of 'buf' to the used_gart and used_vram winsys variables
based on the domains, which are simply or'd for the accounting purposes.
The adding is skipped if the reloc is already present in the list, but it
accounts any newly-referenced domains.

cs_validate is then called, which just checks:
    used_vram/gart < vram/gart_size * 0.8
The 0.8 number allows for some memory fragmentation. If the validation
fails, the pipe driver flushes CS and tries do the validation again,
i.e. it validates only that one operation. If it fails again, it drops
the operation on the floor and prints some nasty message to stderr.

cs_write_reloc(cs, buf) just writes a reloc that has been added using
cs_add_reloc. The read_domain and write_domain parameters have been removed,
because we already specify them in cs_add_reloc.

The space checking has been tested by putting small values in vram/gart_size
variables.
2011-01-08 07:05:42 +01:00
Eric Anholt
29c4f95cbc intel: Make renderbuffer tiling choice match texture tiling choice.
There really shouldn't be any difference between the two for us.
Fixes a bug where Z16 renderbuffers would be untiled on gen6, likely
leading to hangs.
2011-01-07 18:25:54 -08:00
Eric Anholt
8f593597fc intel: Use the _BaseFormat from MESA_FORMAT_* in renderbuffer setup. 2011-01-07 18:25:54 -08:00
Marek Olšák
aa6456dcd1 docs: fix messed up names with special characters in relnotes-7.9.1
(cherry picked from commit 67aeab0b77)
2011-01-08 03:10:18 +01:00
Marek Olšák
8d61a3f408 docs: fix messed up names with special characters in relnotes-7.10
(cherry picked from commit 36009724fd)
2011-01-08 03:09:47 +01:00
Eric Anholt
5df51c2bb0 i915: Drop old checks for the settexoffset hack. 2011-01-07 17:49:03 -08:00
Eric Anholt
372dc4cd6c i915: Don't claim to support AL1616 when neither 830 nor 915 does it.
Fixes an abort in fbo-generatemipmap-formats.
2011-01-07 17:49:03 -08:00
Eric Anholt
a7bf723056 intel: Add a vtbl hook for determining if a format is renderable.
By relying on just intel_span_supports_format, some formats that
aren't supported pre-gen4 were not reporting FBO incomplete.  And we
also complained in stderr when it happened on i915 because draw_region
gets called before framebuffer completeness validation.
2011-01-07 17:49:03 -08:00
Eric Anholt
f3240547f9 intel: expose ARB_framebuffer_object in the i915 driver.
ARB_fbo no longer disallows mismatched width/height on attachments
(shouldn't be any problem), mixed format color attachments (we only
support 1), and L/A/LA/I color attachments (we already reject them on
965 too).  It requires Gen'ed names (driver doesn't care), and adds
FramebufferTextureLayer (we don't do texture arrays).  So it looks
like we're already in the position we need to be for this extension.

Bug #27468, #32381.
2011-01-07 17:49:03 -08:00
Christoph Bumiller
8b2a46c0de nvc0: fix reloc domain conflict on buffer migration
Occurred because the code assumed that buf->domain would remain
equal to old_domain.
2011-01-08 02:14:00 +01:00
Christoph Bumiller
b2a79953a6 nvc0: upload user buffers only from draw info min to max index
There are actually applications that profit immensely from this.
2011-01-08 02:13:54 +01:00
Christoph Bumiller
64b639959f nvc0: fix emission of first 3 u8 indices to RING_NI 2011-01-08 02:13:10 +01:00
Christoph Bumiller
f5f086ca92 nvc0: reset mt transfer address after read loop over layers 2011-01-08 02:12:56 +01:00
Christoph Bumiller
bd301dfc12 nvc0: tie buffer memory release to the buffer fence
... instead of the next fence to be emitted. This way we have a
chance to reclaim the storage earlier.
2011-01-08 02:12:20 +01:00
Łukasz Krotowski
96d8a54716 r300g: Remove invalid assertion.
Invalid after be1af4394e (user buffer
creation with width0 == ~0).

Signed-off-by: Marek Olšák <maraeo@gmail.com>
2011-01-08 01:35:02 +01:00
Ian Romanick
1e1aef567f docs: Import 7.10 release notes from 7.10 branch 2011-01-07 14:38:23 -08:00
Eric Anholt
1d1ad6306d i965: Avoid double-negation of immediate values in the VS.
In general, we have to negate in immediate values we pass in because
the src1 negate field in the register description is in the bits3 slot
that the 32-bit value is loaded into, so it's ignored by the hardware.
However, the src0 negate field is in bits1, so after we'd negated the
immediate value loaded in, it would also get negated through the
register description.  This broke this VP instruction in the position
calculation in civ4:

MAD TEMP[1], TEMP[1], CONST[256].zzzz, CONST[256].-y-y-y-y;

Bug #30156
2011-01-07 14:35:42 -08:00
Ian Romanick
46a360b26a docs: Import 7.9.1 release notes from 7.9 branch 2011-01-07 13:39:40 -08:00
Henri Verbeet
82acc3b14c r600g: Also set const_offset if the buffer is not a user buffer in r600_upload_const_buffer(). 2011-01-07 18:21:12 +01:00
Henri Verbeet
f39dfa0ab0 r600g: Update some comments for Evergreen. 2011-01-07 18:21:12 +01:00
Henri Verbeet
97e2aa31c6 r600g: Split ALU clauses based on used constant cache lines. 2011-01-07 18:21:12 +01:00
Henri Verbeet
2a134534a6 r600g: Consistently use the copy of the alu instruction in r600_bc_add_alu_type(). 2011-01-07 18:21:12 +01:00
Henri Verbeet
8273921b7a r600g: Store kcache settings as an array. 2011-01-07 18:21:12 +01:00
Marek Olšák
be1af4394e r300g: derive user buffer sizes at draw time
This only uploads the [min_index, max_index] range instead of [0, userbuf size],
which greatly speeds up user buffer uploads.

This is also a prerequisite for atomizing vertex arrays in st/mesa.
2011-01-07 16:23:49 +01:00
Jian Zhao
2a7380e9c3 mesa: fix an error in uniform arrays in row calculating.
Fix the error in uniform row calculating, it may alloc one line
more which may cause out of range on memory usage, sometimes program
aborted when free the memory.

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

Signed-off-by: Brian Paul <brianp@vmware.com>
2011-01-07 07:22:18 -07:00
Vinson Lee
db61b9ce39 mesa: Directly include mfeatures.h in files that perform feature tests. 2011-01-07 00:13:00 -08:00
Alex Deucher
7c320a869b r600c: fix up SQ setup in blit code for Ontario/NI 2011-01-07 03:10:50 -05:00
Dave Airlie
6d9ca78ef7 r600g: allow constant buffers to be user buffers.
This provides an upload facility for the constant buffers since Marek's
constants in user buffers changes.

gears at least work on my evergreen now.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-01-07 10:35:41 +10:00
Alex Deucher
7b97bdba40 r600c: add support for NI asics 2011-01-06 18:40:17 -05:00
Alex Deucher
f54366bcf6 r600g: add support for NI (Northern Islands) GPUs
This adds support for Barts, Turks, and Caicos asics.
2011-01-06 18:05:16 -05:00
Kenneth Graunke
e31defc825 i965: Rename various gen6 #defines to match the documentation.
This should make it easier to cross-reference the code and hardware
documentation, as well as clear up any confusion on whether constants
like CMD_3D_WM_STATE mean WM_STATE (pre-gen6) or 3DSTATE_WM (gen6+).

This does not rename any pre-gen6 defines.
2011-01-06 13:56:26 -08:00
Jakob Bornecrantz
ff0f087513 svga: Ensure that the wrong vdecls don't get used in swtnl path
The draw module set new state that didn't require swtnl which caused need_swtnl to
be unset. This caused the call from to svga_update_state(svga, SVGA_STATE_SWTNL_DRAW)
from the vbuf backend to overwrite the vdecls we setup there to be overwritten with
the real buffers vdecls.
2011-01-06 20:09:07 +00:00
Ian Romanick
f2d0f776b1 glsl: Refresh autogenerated lexer and parser files.
For the previous commit.
2011-01-06 10:53:38 -08:00
Ian Romanick
86b4398cd1 glsl: Support the 'invariant(all)' pragma
Previously the 'STDGL invariant(all)' pragma added in GLSL 1.20 was
simply ignored by the compiler.  This adds support for setting all
variable invariant.

In GLSL 1.10 and GLSL ES 1.00 the pragma is ignored, per the specs,
but a warning is generated.

Fixes piglit test glsl-invariant-pragma and bugzilla #31925.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
2011-01-06 10:49:56 -08:00
Ian Romanick
e942f32836 glsl: Allow less restrictive uses of sampler array indexing in GLSL <= 1.20
GLSL 1.10 and 1.20 allow any sort of sampler array indexing.
Restrictions were added in GLSL 1.30.  Commit f0f2ec4d added support
for the 1.30 restrictions, but it broke some valid 1.10/1.20 shaders.
This changes the error to a warning in GLSL 1.10, GLSL 1.20, and GLSL
ES 1.00.

There are some spurious whitespace changes in this commit.  I changed
the layout (and wording) of the error message so that all three cases
would be similar.  The 1.10/1.20 and 1.30 text is the same.  The only
difference is that one is an error, and the other is a warning.  The
GLSL ES 1.00 wording is similar but not quite the same.

Fixes piglit test
spec/glsl-1.10/compiler/constant-expressions/sampler-array-index-02.frag
and bugzilla #32374.
2011-01-06 10:06:59 -08:00
Marek Olšák
c60f1d8b00 r300g: fix corruption when nr_cbufs==0 and multiwrites enabled
https://bugs.freedesktop.org/show_bug.cgi?id=32634
2011-01-06 19:05:31 +01:00
Marek Olšák
6125cbe983 r300g: remove the buffer range checking
It's no longer needed because the upload buffer remains mapped while the CS
is being filled (openarena, ut2004 and others that this code was for do not
use VBOs by default).
2011-01-06 16:59:32 +01:00
Marek Olšák
31afa7616e r300g: skip buffer validation of upload buffers when appropriate
because the upload buffers are reused for subsequent draw operations.
2011-01-06 16:51:54 +01:00
Marek Olšák
45b51a9e70 util: add comments to u_upload_mgr and u_inlines 2011-01-06 16:16:30 +01:00
Marek Olšák
984d64881f vbo: remove a redundant call to _ae_invalidate_state
It's called in vbo_exec_invalidate_state too.
2011-01-06 16:16:30 +01:00
Marek Olšák
009cecf246 st/mesa: remove unused members in st_context
What were these for?
2011-01-06 16:16:30 +01:00
Marek Olšák
92209314df tgsi: remove redundant name tables from tgsi_text, use those from tgsi_dump
I also specified the array sizes in the header so that one can use
the Elements macro on it.
2011-01-06 16:16:30 +01:00
Marek Olšák
3c9aa3a7b1 gallium: drivers should reference vertex buffers
So that a state tracker can unreference them after set_vertex_buffers.
2011-01-06 16:16:29 +01:00
Marek Olšák
58c5e782e3 st/mesa: optimize constant buffer uploads
The overhead of resource_create, transfer_inline_write, and resource_destroy
to upload constant data is very visible with some apps in sysprof, and
as such should be eliminated.

My approach uses a user buffer to pass a pointer to a driver. This gives
the driver the freedom it needs to take the fast path, which may differ
for each driver.

This commit addresses the same issue as Jakob's one that suballocates out
of a big constant buffer, but it also eliminates the copy to the buffer.
2011-01-06 16:16:29 +01:00
Marek Olšák
5adcd9c911 st/mesa: do sanity checks on states only in debug builds 2011-01-06 16:16:29 +01:00
Marek Olšák
06286110b4 u_upload_mgr: new features
- Added a parameter to specify a minimum offset that should be returned.
  r300g needs this to better implement user buffer uploads. This weird
  requirement comes from the fact that the Radeon DRM doesn't support negative
  offsets.

- Added a parameter to notify a driver that the upload flush occured.
  A driver may skip buffer validation if there was no flush, resulting
  in a better performance.

- Added a new upload function that returns a pointer to the upload buffer
  directly, so that the buffer can be filled e.g. by the translate module.
2011-01-06 16:16:29 +01:00
Marek Olšák
8b7bd3ce88 u_upload_mgr: keep the upload buffer mapped until it is flushed
The map/unmap overhead can be significant even though there is no waiting on busy
buffers. There is simply a huge number of uploads.

This is a performance optimization for Torcs, a car racing game.
2011-01-06 16:16:29 +01:00
Pierre Allegraud
8fd8de3995 mesa: fix build for NetBSD
See http://bugs.freedesktop.org/show_bug.cgi?id=32859

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

Signed-off-by: Brian Paul <brianp@vmware.com>
2011-01-06 08:00:01 -07:00
Brian Paul
1384aea50f glext: upgrade to version 67 2011-01-06 07:56:00 -07:00
Vinson Lee
ab564b516e mesa: Clean up header file inclusion in version.c.
Include imports.h directly instead of indirectly through context.h.
version.c does use any symbols that are added by context.h.
2011-01-06 00:45:08 -08:00
Vinson Lee
84ebd8e2d7 nvc0: Fix typo of nvc0_mm.c in SConscript. 2011-01-06 00:06:38 -08:00
Vinson Lee
becd98018b mesa: bump version to 7.11 2011-01-05 23:27:30 -08:00
Vinson Lee
0117da40cd mesa: Include mtypes.h in files that use gl_context struct.
Directly include mtypes.h if a file uses a gl_context struct. This
allows future removal of headers that are not strictly necessary but
indirectly include mtypes.h for a file.
2011-01-05 23:11:54 -08:00
Zou Nan hai
a728646fb5 i965: skip too small size mipmap
this fixes doom3 crash.
2011-01-06 11:36:23 +08:00
Eric Anholt
d60145d06d i915: Fix build for previous commit. 2011-01-05 18:28:13 -08:00
Eric Anholt
7ce6517f3a intel: Always allocate miptrees from level 0, not tObj->BaseLevel.
BaseLevel/MaxLevel are mostly used for two things: clamping texture
access for FBO rendering, and limiting the used mipmap levels when
incrementally loading textures.  By restricting our mipmap trees to
just the current BaseLevel/MaxLevel, we caused reallocation thrashing
in the common case, for a theoretical win if someone really did want
just levels 2..4 or whatever of their texture object.

Bug #30366
2011-01-05 18:23:54 -08:00
Eric Anholt
01b70c0628 intel: Drop unused first/lastlevel args to miptree_create_for_region.
We're always making a single-level, 0-baselevel miptree.
2011-01-05 18:11:31 -08:00
Vinson Lee
f84573d039 swrast: Include mtypes.h in s_triangle.c.
Include mtypes.h for gl_context symbol.
2011-01-05 17:46:39 -08:00
Vinson Lee
20d85865ec st/mesa: Include mtypes.h in st_cb_drawpixels.c.
Include mtypes.h for gl_context symbol.
2011-01-05 16:34:29 -08:00
Eric Anholt
1b18b45d79 intel: Clarify first_level/last_level vs baselevel/maxlevel by deletion.
This has always been ugly about our texture code -- object base/max
level vs intel object first/last level vs image level vs miptree
first/last level.  We now get rid of intelObj->first_level which is
just tObj->BaseLevel, and make intelObj->_MaxLevel clearly based off
of tObj->_MaxLevel instead of duplicating its code (incorrectly, as
image->MaxLog2 only considers width/height and not depth!)
2011-01-05 16:11:30 -08:00
Eric Anholt
9b7f57b18e mesa: Consider textures incomplete when maxlevel < baselevel.
See section 3.8.10 of the GL 2.1 specification.  There's no way to do
anything sane with that, and drivers would get all sorts of angry.
2011-01-05 15:51:37 -08:00
Eric Anholt
39cc0ee3ea i915: Enable LOD preclamping on 8xx like on 915/965.
Fixes lodclamp-between and lodclamp-between-max.
2011-01-05 14:50:27 -08:00
Eric Anholt
973e821a63 i915: Implement min/max lod clamping in hardware on 8xx.
This avoids 8xx-specific texture relayout for min/max lod changes.
One step closer to avoiding relayout for base/maxlevel changes!
2011-01-05 14:50:24 -08:00
Eric Anholt
6f31da584f intel: Drop TEXTURE_RECTANGLE check in miptree layout setup.
It's already handled by our non-mipmapped MinFilter, since
TEXTURE_RECTANGLE is always NEAREST or LINEAR.
2011-01-05 14:45:16 -08:00
Eric Anholt
8f0005bfd5 intel: Clean up redundant setup of firstLevel.
It's always BaseLevel (since TEXTURE_RECTANGLE's baselevel can't be
changed from 0), except for 8xx minlod hilarity.
2011-01-05 14:45:16 -08:00
Eric Anholt
e2ee0c55d3 intel: Drop a check for GL_TEXTURE_4D_SGIS.
The SGIS_texture4D extension was thankfully never completed, so we
couldn't implement it if we wanted to.
2011-01-05 14:45:16 -08:00
Vinson Lee
d5435b3f0c swrast: Remove unnecessary headers. 2011-01-05 13:47:02 -08:00
Eric Anholt
332a90e101 i965: Simplify the renderbuffer setup code.
It was quite a mess by trying to do NULL renderbuffers and real
renderbuffers in the same function.  This clarifies the common case of
real renderbuffers.
2011-01-05 10:28:10 -08:00
Michel Dänzer
c7c1e5338c st/xorg: Flesh out colour map support and support depth 8. 2011-01-05 11:41:56 +01:00
Xiang, Haihao
266d8eed69 i965: use BLT to clear buffer if possible on Sandybridge
This fixes https://bugs.freedesktop.org/show_bug.cgi?id=32713
2011-01-05 14:12:40 +08:00
Eric Anholt
06cb1a6a5b i965: Add support for SRGB DXT1 formats.
This makes
fbo-generatemipmap-formats GL_EXT_texture_sRGB-s3tc
match
fbo-generatemipmap-formats GL_EXT_texture_compression_s3tc

and swrast in bad DXT1_RGBA alpha=0 handling, but it means we won't
unpack and repack someone's textures into uncompressed SARGB8 format.
2011-01-04 16:43:35 -08:00
Vinson Lee
5a3f31575b glcpp: Add test for recursive #define. 2011-01-04 16:39:19 -08:00
Eric Anholt
3488b14a04 mesa: Fix the baseFormat for GL_COMPRESSED_SLUMINANCE_EXT.
It's just LUMINANCE, not LUMINANCE_ALPHA.  Fixes
fbo-generatemipmap-formats GL_EXT_texture_sRGB-s3tc assertion failure
when it tries to pack the L8 channels into LUMINANCE_ALPHA and wonders
why it's trying to do that.
2011-01-04 15:25:35 -08:00
Eric Anholt
5dbb856e96 intel: Merge our choosetexformat fallbacks into core.
We now share the type/format -> MESA_FORMAT_* mappings with software
mesa, and the core supports most of the fallbacks hardware drivers
will want.
2011-01-04 14:42:54 -08:00
Eric Anholt
001d944fd5 mesa: Make _mesa_choose_tex_format() choose formats out of a supported table.
Right now this is just tweaking the current code to look at the table.
Choosing actually supported formats will come later.
2011-01-04 14:14:17 -08:00
Vinson Lee
6530944b50 glcpp: Add division by zero test cases. 2011-01-04 13:18:19 -08:00
Marek Olšák
50630f9016 mesa: preserve 10 bits of precision in the texstore general path for ARGB2101010
Use make_temp_float_image instead of _make_temp_chan_image.
The latter converts the texture to 8 bits/component, losing 2 bits.
2011-01-04 21:59:56 +01:00
Marek Olšák
73e8a27387 st/mesa: advertise GL_ARB_half_float_pixel
This extension doesn't appear to need any driver-specific parts.
2011-01-04 21:59:56 +01:00
Marek Olšák
8543902bfb r300/compiler: disable the rename_regs pass for loops
This workaround fixes rendering of kwin thumbnails.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
2011-01-04 21:58:51 +01:00
Alex Deucher
f28bb6bdd1 r600g: support up to 64 shader constants
From the r600 ISA:
Each ALU clause can lock up to four sets of constants
into the constant cache.  Each set (one cache line) is
16 128-bit constants. These are split into two groups.
Each group can be from a different constant buffer
(out of 16 buffers). Each group of two constants consists
of either [Line] and [Line+1] or [line + loop_ctr]
and [line + loop_ctr +1].

For supporting more than 64 constants, we need to
break the code into multiple ALU clauses based
on what sets of constants are needed in that clause.

Note: This is a candidate for the 7.10 branch.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-01-04 15:37:12 -05:00
Tom Stellard
e96e86d07b r300/compiler: Fix black terrain in Civ4
rc_inst_can_use_presub() wasn't checking for too many RGB sources in
Alpha instructions or too many Alpha sources in RGB instructions.

Note: This is a candidate for the 7.10 branch.
2011-01-04 11:25:27 -08:00
Chad Versace
68d06b1454 glsl: Check that integer vertex outputs are qualified with flat
Perform this check in ast_declarator_list::hir().

From section 4.3.6 of the GLSL 1.30 spec:
   "If a vertex output is a signed or unsigned integer or integer
   vector, then it must be qualified with the interpolation
   qualifier
   flat."
2011-01-04 10:49:10 -08:00
Chad Versace
b84e3f570f glsl: Allow redeclaration of gl_Color and its variants in GLSL 1.30
Allow redeclaration of the following built-in variables with an
interpolation qualifier in language versions >= 1.30:
   * gl_FrontColor
   * gl_BackColor
   * gl_FrontSecondaryColor
   * gl_BackSecondaryColor
   * gl_Color
   * gl_SecondaryColor

See section 4.3.7 of the GLSL 1.30 spec.
2011-01-04 10:49:10 -08:00
Chad Versace
4a62a1c366 glsl: Comment ast_type_qualifier.flags 2011-01-04 10:49:10 -08:00
Eric Anholt
b7b2791c6b intel: When validating an FBO's combined depth/stencil, use the given FBO.
We were looking at the current draw buffer instead to see whether the
depth/stencil combination matched.  So you'd get told your framebuffer
was complete, until you bound it and went to draw and we decided that
it was incomplete.
2011-01-04 10:04:19 -08:00
Eric Anholt
0ea49380e2 intel: Fix segfaults from trying to use _ColorDrawBuffers in FBO validation.
The _ColorDrawBuffers is a piece of computed state that gets for the
current draw/read buffers at _mesa_update_state time.  However, this
function actually gets used for non-current draw/read buffers when
checking if an FBO is complete from the driver's perspective.  So,
instead of trying to just look at the attachment points that are
currently referenced by glDrawBuffers, look at all attachment points
to see if they're driver-supported formats.  This appears to actually
be more in line with the intent of the spec, too.

Fixes a segfault in my upcoming fbo-clear-formats piglit test, and
hopefully bug #30278
2011-01-04 10:04:15 -08:00
Christoph Bumiller
cd1cf78828 Merge remote branch 'origin/nvc0' 2011-01-04 18:20:05 +01:00
Brian Paul
c94996f057 st/mesa: skip glDrawPixels/glBitmap-related code for ES build
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=32560
2011-01-04 08:28:17 -07:00
Christoph Bumiller
4884ca5f67 nvc0: fix index size method value for u8 indices 2011-01-04 16:16:52 +01:00
Christoph Bumiller
2f08d872b2 nvc0: set the correct FP header bit for multiple colour outputs 2011-01-04 16:14:58 +01:00
Christoph Bumiller
6de94e1012 nvc0: delete memory caches and fence on screen destruction 2011-01-04 16:14:46 +01:00
Christoph Bumiller
471025929c nvc0: use mov instead of ld for scalar const loads 2011-01-04 16:14:42 +01:00
Christoph Bumiller
c024c1d75f nvc0: fix resource unmap after vertex push 2011-01-04 16:14:38 +01:00
Christoph Bumiller
e1e29395df nvc0: use the proper typed opcodes in constant folding 2011-01-04 16:14:33 +01:00
Christoph Bumiller
92caa65c24 nvc0: demagic GP invocation count bitfield 2011-01-04 16:14:26 +01:00
Christoph Bumiller
997f84ff4e nvc0: rewrite the 9097 GRAPH macros 2011-01-04 16:13:42 +01:00
Brian Paul
6a102074bb i965g: include brw_types.h instead of GL/gl.h
Alternately, some search&replace could be used to replace all
occurances of GLint with int, etc. in the driver.
2011-01-04 07:24:38 -07:00
Brian Paul
c8a6a8bf2c osmesa: pass context to _mesa_update_framebuffer_visual()
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=32814
2011-01-04 07:13:52 -07:00
Vinson Lee
90b7a4cc1a llvmpipe: Include p_compiler.h in lp_scene_queue.h.
Include p_compiler.h for boolean symbol.
2011-01-04 01:08:47 -08:00
Vinson Lee
f67dad7b82 llvmpipe: Include p_compiler.h in lp_perf.h.
Include p_compiler.h for int64_t symbol.
2011-01-04 01:01:18 -08:00
Vinson Lee
c72eb72ca6 llvmpipe: Include missing headers in lp_bld_depth.h
Include p_compiler.h for boolean symbol.
Include p_state.h for pipe_stencil_state symbol.
2011-01-04 00:54:14 -08:00
Vinson Lee
deb9a6ae79 llvmpipe: Include p_compiler.h in lp_bld_alpha.h.
Include p_compiler.h for boolean symbol.
Add forward declaration for gallivm_state struct.
2011-01-04 00:50:48 -08:00
Vinson Lee
7bfc54ea5d i965g: Include p_compiler.h in intel_decode.h.
Include p_compiler.h for uint32_t symbol.
2011-01-04 00:44:23 -08:00
Vinson Lee
cf15e9b343 i965g: Include gl.h in intel_structs.h.
Include gl.h for OpenGL symbols.
2011-01-04 00:41:10 -08:00
Zhenyu Wang
bea6539abf i965: Use last vertex convention for quad provoking vertex on sandybridge
Until we know how hw converts quads to polygon in beginning of
3D pipeline, for now unconditionally use last vertex convention.

Fix glean/clipFlat case.
2011-01-04 15:56:26 +08:00
Vinson Lee
9095947fa7 mesa: Include mtypes.h in renderbuffer.h.
Include mtypes.h for gl_buffer_index symbol.

This is a follow-up to commit 65da73c5f8.
2011-01-03 22:42:12 -08:00
Zhenyu Wang
1df795f958 i965: Correct comment for gen6 fb write control message setting
Remove incorrect headless comment for gen6 fb write message.
Note current SIMD16 mode has already done right for control message.
2011-01-04 13:57:16 +08:00
Zhenyu Wang
9977297ad9 i965: Fix provoking vertex select in clip state for sandybridge
Triangle fan provoking vertex for first convention should be
'vertex 1' in sandybridge clip state.

Partly fix glean/clipFlat case
2011-01-04 13:51:39 +08:00
Brian Paul
7bd2c5d1f9 mesa: fix AL44 texture fetch function nybble -> float conversion
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=32804
2011-01-03 17:16:48 -07:00
Eric Anholt
bd8e658884 intel: Bump libdrm configure.ac requirement for the gen6 BLT ring support. 2011-01-03 15:04:19 -08:00
Eric Anholt
30fef21aa3 intel: Use tri clears when we don't know how to blit clear the format.
Bug #32207.  Fixes ARB_texture_rg/fbo-clear-formats (see my
fbo-clear-formats piglit branch currently)
2011-01-03 13:28:26 -08:00
Eric Anholt
5f13c39484 mesa: Also report the number of renderbuffer alpha bits for GL_LUMINANCE_ALPHA.
Noticed by code inspection.
2011-01-03 13:28:26 -08:00
Eric Anholt
f45aea0ec9 mesa: Also report renderbuffer red/green size for GL_RED and GL_RG.
Noticed by code inspection.
2011-01-03 13:28:26 -08:00
Eric Anholt
059cca92a8 mesa: Use the common logic for "is this baseformat a color format?"
When figuring out whether a renderbuffer should be used to set the
visual bits of an FBO, we were missing important baseformats like
GL_RED, GL_RG, and GL_LUMINANCE.
2011-01-03 13:28:24 -08:00
Eric Anholt
beac6ee62a mesa: Allow color renderbuffers besides just RGB and RGBA.
We did so already for textures to do ARB_fbo's
GL_ALPHA/GL_LUMINANCE/etc. support and for ARB_texture_rg's GL_RED and
GL_RG, but this path was missed.
2011-01-03 13:22:38 -08:00
Eric Anholt
2d29349c00 mesa: Update comment about the list of BaseFormats for gl_formats. 2011-01-03 13:22:38 -08:00
Eric Anholt
94ed481131 intel: Handle forced swrast clears before other clear bits.
Fixes a potential segfault on a non-native depthbuffer, and possible
accidental swrast fallback on extra color buffers.
2011-01-03 13:22:38 -08:00
Brian Paul
efbd33aff9 st/mesa: fix renderbuffer pointer check in st_Clear()
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=30694

NOTE: This is a candidate for the 7.9 and 7.10 branches.
2011-01-03 14:01:41 -07:00
Brian Paul
65da73c5f8 mesa: s/GLuint/gl_buffer_index/ 2011-01-03 14:01:41 -07:00
Brian Paul
35266fbe4f st/mesa: 80-column wrapping 2011-01-03 14:01:41 -07:00
Brian Paul
337f6e7b0e st/mesa: 80-column wrapping 2011-01-03 14:01:41 -07:00
Chia-I Wu
ada9c78c29 autoconf: Fix --with-driver=xlib --enable-openvg.
st/egl should be enabled with --enable-openvg even the driver is xlib or
osmesa.  Also, GLX_DIRECT_RENDERING should not be defined because libdrm
is not checked.
2011-01-04 01:13:49 +08:00
Chia-I Wu
cba7786954 docs: Add an example for EGL_DRIVERS_PATH.
EGL_DRIVERS_PATH can be set to test EGL without installation.
2011-01-04 00:54:55 +08:00
Dave Airlie
fb03510738 radeon: fix build on non-KMS systems.
Reported on irc by adamk.
2011-01-03 06:03:44 +10:00
Kenneth Graunke
1d40cf57f8 glsl: Really remove unused "instructions" parameter.
I forgot about this file, and it didn't show up until I tried to do
"make builtins" from a clean build.
2011-01-01 12:29:24 -08:00
Kenneth Graunke
81168351a7 glsl: Remove unused "instructions" parameter.
I think was used long ago, when we actually read the builtins into the
shader's instruction stream directly, rather than creating a separate
shader and linking the two.  It doesn't seem to serve any purpose now.
2011-01-01 12:01:54 -08:00
Brian Paul
1eceb9d323 mapi: add missing newline in error message 2010-12-31 16:37:41 -07:00
Brian Paul
e227f4bf50 egl: add missing case in _eglError() 2010-12-31 09:14:25 -07:00
Henri Verbeet
59051ad443 st/mesa: Handle wrapped depth buffers in st_copy_texsubimage(). 2010-12-31 07:49:59 +01:00
Vinson Lee
8d79765feb util: Add forward declarations in u_index_modify.h. 2010-12-30 01:54:35 -08:00
Vinson Lee
8114cf9ad8 tgsi: Clean up header file inclusion in tgsi_text.h. 2010-12-30 01:51:27 -08:00
Vinson Lee
8bfb9061b7 graw: Include p_shader_tokens.h for tgsi_token struct. 2010-12-30 01:49:26 -08:00
Vinson Lee
20a0f34283 tgsi: Clean up header file inclusion in tgsi_sanity.h. 2010-12-30 01:40:53 -08:00
Vinson Lee
79fa5acf26 x86: Clean up header file inclusion in mmx.h. 2010-12-30 01:26:47 -08:00
Vinson Lee
a1cd093a72 tnl: Clean up header file inclusion in t_vertex.h. 2010-12-30 01:05:33 -08:00
Vinson Lee
43c291683c vbo: Clean up header file inclusion in vbo.h. 2010-12-30 00:57:03 -08:00
Vinson Lee
176a8359b9 tnl: Clean up header file inclusion in t_vp_build.h. 2010-12-30 00:50:56 -08:00
Vinson Lee
9db9761874 tnl: Clean up header file inclusion in tnl.h. 2010-12-30 00:46:13 -08:00
Ben Skeggs
5b0e5e7389 drm/nvc0: don't un-bind every subchannel on init
The initial values in the grctx are 0x0000 anyway, and re-binding them
all to 0x0000 destroys some init done by the nouveau drm.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-12-30 12:34:12 +10:00
Marek Olšák
76db330e2c util: add a way to store translated indices to a user memory in u_index_modify
I am about to use the upload buffer in r300g instead.
2010-12-29 18:32:41 +01:00
Marek Olšák
48ed458e87 r300g: support user buffers as constant buffers 2010-12-29 18:32:41 +01:00
Eric Anholt
df4d83dca4 i965: Do lowering of array indexing of a vector in the FS.
Fixes a regression in ember since switching to the native FS backend,
and the new piglit tests glsl-fs-vec4-indexing-{2,3} for catching this.
2010-12-28 17:32:20 -08:00
Eric Anholt
54df8e48bc i965: Fix regression in FS comparisons on original gen4 due to gen6 changes.
Fixes 26 piglit cases on my GM965.
2010-12-28 15:35:00 -08:00
Eric Anholt
74dffb39c3 i965: Factor out the ir comparision to BRW_CONDITIONAL_* code. 2010-12-28 14:23:52 -08:00
Vinson Lee
f3319561a4 glcpp: Add negative tests for redefintions with valueless macros. 2010-12-27 23:20:35 -08:00
Dave Airlie
17004b3954 tgsi_dump: fix assert due to missing property name. 2010-12-28 16:52:19 +10:00
Marek Olšák
33e0b726e8 r300g: rename aos to vertex arrays 2010-12-28 04:52:36 +01:00
Marek Olšák
d9b84017e0 r300g: mark vertex arrays as dirty after a buffer_offset change
We shouldn't hit this bug in theory.

NOTE: This is a candidate for the 7.10 branch.
2010-12-28 04:40:05 +01:00
Zhenyu Wang
689aca7822 i965: Fix occlusion query on sandybridge
Clear target query buffer fixed occlusion query on sandybridge.

https://bugs.freedesktop.org/show_bug.cgi?id=32167
2010-12-28 11:11:40 +08:00
Zhenyu Wang
59fa8600d8 Revert "i965: upload multisample state for fragment program change"
This reverts commit de6fd527a5.

Revert this workaround as it seems the real trouble is caused by
lineloop, which doesn't require GS convert on sandybridge actually.
2010-12-28 09:36:43 +08:00
Kenneth Graunke
6bb1e4541e i965: Internally enable GL_NV_blend_square on ES2.
Hopefully should fix bug #32520.
2010-12-27 15:44:52 -08:00
Christoph Bumiller
0cb6d1a4eb nvc0: reference the vertex buffers 2010-12-27 21:00:40 +01:00
Christoph Bumiller
4fa429c876 nvc0: reenable some shader optimizations
CSE and constants folding.
2010-12-27 20:59:53 +01:00
Christoph Bumiller
a10b1c1204 nvc0: use VTX_ATTR for stride 0 vertex attributes 2010-12-27 13:59:43 +01:00
Christoph Bumiller
e4349027f6 nvc0: implement VRAM buffer transfers with bounce buffers 2010-12-27 13:57:46 +01:00
Christoph Bumiller
abd08f4c01 nvc0: init miptree transfer layer stride 2010-12-27 13:29:10 +01:00
Xiang, Haihao
b832ae8a4a i965: don't spawn GS thread for LINELOOP on Sandybridge
LINELOOP is converted to LINESTRIP at the beginning of the 3D pipeline.
This fixes https://bugs.freedesktop.org/show_bug.cgi?id=32596
2010-12-27 17:05:58 +08:00
Kenneth Graunke
634a7dce9c i965: Flatten if-statements beyond depth 16 on pre-gen6.
Gen4 and Gen5 hardware can have a maximum supported nesting depth of 16.
Previously, shaders with control flow nested 17 levels deep would
cause a driver assertion or segmentation fault.

Gen6 (Sandybridge) hardware no longer has this restriction.

Fixes fd.o bug #31967.
2010-12-27 00:59:31 -08:00
Kenneth Graunke
9ac6a9b2fa glsl: Support if-flattening beyond a given maximum nesting depth.
This adds a new optional max_depth parameter (defaulting to 0) to
lower_if_to_cond_assign, and makes the pass only flatten if-statements
nested deeper than that.

By default, all if-statements will be flattened, just like before.

This patch also renames do_if_to_cond_assign to lower_if_to_cond_assign,
to match the new naming conventions.
2010-12-27 00:59:31 -08:00
Christoph Bumiller
780fbecc20 nvc0: respond please inline to PIPE_SHADER_CAP_SUBROUTINES 2010-12-23 15:22:00 +01:00
Christoph Bumiller
96def0c314 nvc0: fix layer stride state 2010-12-23 15:21:36 +01:00
Christoph Bumiller
2c20aae233 nvc0: use most defs/decls from nouveau_pushbuf.h 2010-12-23 15:19:22 +01:00
Ben Skeggs
82e0a38eed nvc0: remove unused 'buf' parameter in pipe_buffer_unmap 2010-12-21 06:41:09 +10:00
Ben Skeggs
317a1445c8 nvc0: BEGIN_RING->BEGIN_RING_NI in a couple of places 2010-12-21 06:33:17 +10:00
Ben Skeggs
e4e1a85bf8 nvc0: fence.bo is mappable, mark it as such 2010-12-21 06:32:13 +10:00
Ben Skeggs
e52ebd6e85 Merge remote branch 'origin/master' into nvc0-new
Conflicts:
	src/gallium/drivers/nouveau/nouveau_winsys.h
2010-12-21 06:30:39 +10:00
Ben Skeggs
5c102dd94f nouveau: fix includes for latest libdrm
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-12-21 06:28:08 +10:00
Tom Fogal
cd9ed3da68 Regenerate gl_mangle.h.
NOTE: This is a candidate for the 7.10 branch.
2010-12-20 19:29:48 -07:00
Jerome Glisse
abe9ffc25c r600g: properly unset vertex buffer
Fix bug http://bugs.freedesktop.org/show_bug.cgi?id=32455

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-12-20 15:33:28 -05:00
Vinson Lee
a14f79f801 st/python: remove unused 'buf' parameter in pipe_buffer_unmap
This is a follow-up to commit ec51092a72.

Fixes SCons build.
2010-12-20 11:40:54 -08:00
Marek Olšák
ec51092a72 gallium: remove unused 'buf' parameter in pipe_buffer_unmap 2010-12-20 17:42:55 +01:00
Vinson Lee
c451aade88 st/mesa: Remove comment cruft from st_context.h.
This was unintentionally added by commit
1525fb4afe.
2010-12-20 01:24:26 -08:00
Vinson Lee
2dd788663a st/mesa: Clean up header file inclusion in st_cb_texture.h. 2010-12-20 01:15:04 -08:00
Vinson Lee
10eb0c39d5 st/mesa: Clean up header file inclusion in st_cb_readpixels.h. 2010-12-20 01:00:26 -08:00
Christoph Bumiller
9f2cf89957 nvc0: s/INLIN_RING/IMMED_RING 2010-12-19 22:53:47 +01:00
Christoph Bumiller
608b3c4432 nvc0: improve shader support for texturing
Fixed shadow and cube texture fetches, add array texture fetches.
2010-12-19 21:49:32 +01:00
Christoph Bumiller
ca5deb0c35 nvc0: adapt to array textures interface change 2010-12-19 21:48:39 +01:00
Christoph Bumiller
0f68236a24 Merge remote branch 'origin/master' into nvc0-new 2010-12-19 21:46:33 +01:00
Christoph Bumiller
d047168d81 nvc0: fix clipping with scissors/viewport
Also setup optional path to use proper primitive clipping instead,
which is probably slower.
2010-12-19 21:42:00 +01:00
Christoph Bumiller
e9de2a31a5 nvc0: use BIND_RING to set subchannel classes 2010-12-19 21:40:24 +01:00
Christoph Bumiller
f0f1cce962 nvc0: switch to the proper constants upload path
Makes things suddenly go surprisingly fast.
2010-12-19 21:38:42 +01:00
Christoph Bumiller
99f9a9727c nvc0: add the index buffer offset where missing 2010-12-19 21:33:37 +01:00
Marek Olšák
237880463d r300g: optimize the fallback for misaligned ushort indices 2010-12-19 04:05:34 +01:00
Vinson Lee
c87f82bc40 st/mesa: Clean up header file inclusion in st_cb_program.h. 2010-12-18 01:44:52 -08:00
Vinson Lee
ac09685d2a st/mesa: Clean up header file inclusion in st_cb_accum.h. 2010-12-18 01:28:18 -08:00
Vinson Lee
488e994ba9 mesa: Clean up header file inclusion in prog_statevars.h. 2010-12-18 01:16:53 -08:00
Dave Airlie
aa4d311873 mesa: fix queryobj whitespace.
Had done this before pushing but forgot to amend, doh.
2010-12-18 17:48:21 +10:00
Dave Airlie
ff7aa554a1 mesa/swrast/st: add ARB_occlusion_query2 support.
This gets my vote for most pointless extension of all time, I'm guessing
some driver could possibly optimise for this instead of counting it might
just get a true/false, but I'm not really sure.

need this to eventually advertise 3.3 despite its total uselessness.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-12-18 17:33:25 +10:00
Chia-I Wu
7048095513 mapi: Clean up sources.mk.
Rename MAPI_GLAPI_SOURCES to MAPI_UTIL_SOURCES.  Rename macro
MAPI_GLAPI_CURRENT to MAPI_MODE_UTIL.  Update the comments to make it
clear that mapi may be used in two ways and how.
2010-12-18 15:05:58 +08:00
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
Chia-I Wu
65e8f81110 docs/egl: Update egl.html.
Various updates and a new section about packaging.
2010-12-25 02:53:49 +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
Brian Paul
b7c38734c9 mesa: enable GL_ARB_draw_instanced for software drivers 2010-12-10 09:29:41 -07:00
Brian Paul
a63486ac68 tnl: implement instanced drawing 2010-12-10 09:29:13 -07:00
Brian Paul
6a0d3b7696 mesa: implement system values in program interpreter 2010-12-10 09:29:00 -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
Brian Paul
dcb48e7eb4 llvmpipe: enable instanced drawing cap 2010-12-08 19:06:22 -07:00
Brian Paul
cf2184f057 softpipe: enable instanced drawing cap 2010-12-08 19:04:16 -07:00
Brian Paul
1d6f3543a0 gallivm/llvmpipe: implement system values and instanceID 2010-12-08 19:04:11 -07:00
Brian Paul
2b5e1e5287 st/mesa: translate shader system inputs 2010-12-08 19:01:15 -07:00
Brian Paul
2d62fb6c3f draw: setup instance ID for SSE generator 2010-12-08 19:00:44 -07:00
Brian Paul
0be042cb4d draw: setup instance ID for VS interpreter 2010-12-08 19:00:32 -07:00
Brian Paul
691048a22a mesa: ir_to_mesa support for system values 2010-12-08 18:25:58 -07:00
Brian Paul
7ce186358e glsl: add support for system values and GL_ARB_draw_instanced 2010-12-08 18:25:38 -07:00
Brian Paul
379332f629 mesa: program printing for PROGRAM_SYSTEM_VALUE 2010-12-08 18:24:48 -07:00
Brian Paul
c6d74bcbfc mesa: add PROGRAM_SYSTEM_VALUE and related tokens
System values are shader inputs which don't necessarily change from
vertex to vertex or fragment to fragment.  gl_InstanceID and
gl_FrontFacing are examples.
2010-12-08 18:21:20 -07:00
Brian Paul
975418a654 tgsi/ppc: add case for system values and assert 2010-12-08 18:20:44 -07:00
Brian Paul
e8154eeae5 tgsi/sse: add support for system values 2010-12-08 18:20:05 -07:00
Brian Paul
b550d8d76b tgsi: new tgsi_shader_info fields for system values 2010-12-08 18:19:47 -07:00
Brian Paul
859f45a921 tgsi: add support for system values to TGSI interpreter 2010-12-08 18:19:14 -07: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
7da704ee72 configure: use llvm-config --cppflags instead of --cflags 2010-12-08 06:45:00 -07: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
c1095f0b0c mesa/llvm: use llvm-config --cppflags
Use --cppflags instead of --cflags so that we get the -I and -D flags
we want, but not compiler options like -O3.

A similar change should probably be made for autoconf.
2010-12-06 10:11:00 -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
Brian Paul
9cd277684d st/mesa: GL_ARB_draw_instanced depends on PIPE_CAP_INSTANCED_DRAWING 2010-12-05 13:34:02 -07:00
Brian Paul
d87bc015dc gallium: added PIPE_CAP_INSTANCED_DRAWING 2010-12-05 13:32:59 -07: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
Chia-I Wu
3b4c888653 st/vega: Refactor blend shaders.
Add a helper function, blend_generic, that supports all blend modes and
per-channel alpha.  Make other blend generators a wrapper to it.

Both the old and new code expects premultiplied colors, yet the input is
non-premultiplied.  Per-channel alpha is also not used for stencil
image.  They still need to be fixed.
2010-12-04 13:20:32 +08:00
Chia-I Wu
a09baf1668 st/vega: Add some comments to pipeline shaders. 2010-12-04 13:19:29 +08:00
Brian Paul
6c33e820d5 st/mesa: new comment about updating state vars 2010-12-03 17:07:16 -07:00
Brian Paul
64244dfd39 mesa: update comments, remove dead code 2010-12-03 16:45:44 -07:00
Brian Paul
6f851e6642 mesa: remove unneeded cast 2010-12-03 16:40:36 -07:00
Brian Paul
503983b09e mesa: make glGet*(GL_NONE) generate GL_INVALID_ENUM
In find_value() check if we've hit the 0th/invalid entry before checking
if the pname matches.

Fixes http://bugs.freedesktop.org/show_bug.cgi?id=31987

NOTE: This is a candidate for the 7.9 branch.
2010-12-03 16:04:26 -07:00
Brian Paul
40ee69b4f3 swrast: restructure some glReadPixels() code 2010-12-03 15:26:31 -07:00
Brian Paul
5fc2548fae swrast: accept GL_RG in glReadPixels()
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=32088
2010-12-03 15:26:31 -07:00
Kenneth Graunke
b7acf538af ir_print_visitor: Print out constant structure values.
In the form (constant type ((field1 value) (field2 value) ...))
2010-12-03 13:59:21 -08:00
Brian Paul
8d6a0dc7f3 swrast: fix indentation 2010-12-03 14:49:19 -07:00
Brian Paul
75746e3779 swrast: allow GL_RG format in glDrawPixels()
Restructure the switch statement to avoid having to add additional
color formats in the future.

Fixes http://bugs.freedesktop.org/show_bug.cgi?id=32086
2010-12-03 14:48:03 -07:00
Brian Paul
b87369e863 mesa: consolidate some compiler -D flags
-D__STDC_CONSTANT_MACROS and -D__STDC_LIMIT_MACROS are only needed for
LLVM build.
2010-12-03 13:52:59 -07:00
Marek Olšák
9f7f093090 r300g: one more r500_index_bias_supported leftover 2010-12-03 20:59:55 +01:00
Marek Olšák
536d527020 r300g: add capability bit index_bias_supported
.. instead of calling r500_index_bias_supported(..) every draw call.
2010-12-03 20:34:56 +01:00
Jerome Glisse
edda44e0dc r600g: more indentation fix + warning silencing + dead code removal
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-12-03 13:06:53 -05:00
Jerome Glisse
119f00659c r600g: indentation fix
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-12-03 12:56:51 -05:00
Jerome Glisse
0b841b0349 r600g: update polygon offset only when rasterizer or zbuffer change
Aim is to build as little state as possible in draw functions.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-12-03 12:45:19 -05:00
Brian Paul
dbf996f308 llvmpipe: fix broken stencil writemask
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=32070
2010-12-03 09:44:30 -07:00
Fabian Bieler
cd431a12bf r600g: set address of pop instructions to next instruction 2010-12-03 11:35:44 -05:00
Jerome Glisse
833f3a488a r600g: dump raw shader output for debugging
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-12-03 11:35:36 -05:00
Brian Paul
6d13ec7dc0 mesa: return GL_FRAMEBUFFER_DEFAULT as FBO attachment type
If querying the default/window-system FBO's attachment type, return
GL_FRAMEBUFFER_DEFAULT (per the GL_ARB_framebuffer_object spec).

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

NOTE: This is a candidate for the 7.9 branch.
2010-12-03 08:32:29 -07:00
Brian Paul
20cf1851d8 mesa: fix GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME query
Return 0 instead of generating an error.

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

Note that piglit fbo-getframebufferattachmentparameter-01 still does
not pass.  But Mesa behaves the same as the NVIDIA driver in this case.
Perhaps the test is incorrect.

NOTE: This is a candidate for the 7.9 branch.
2010-12-03 08:24:51 -07:00
Brian Paul
14746b1d4f gallivm: fix null builder pointers 2010-12-03 07:38:02 -07:00
Chia-I Wu
5be631ce83 st/vega: Add a missing break. 2010-12-03 14:55:29 +08:00
Chia-I Wu
a84a1e344f st/vega: Move vertex transformation to shader.
It was done in path-to-polygon conversion.  That meant that the
results were invalidated when the transformation was modified, and CPU
had to recreate the vertex buffer with new vertices.  It could be a
performance hit for apps that animate.
2010-12-03 14:23:04 +08:00
Chia-I Wu
29bea39fde st/vega: Set pipe_resource::array_size to 1. 2010-12-03 14:22:32 +08:00
Chia-I Wu
9028f24b8a st/egl: Set pipe_resource::array_size to 1. 2010-12-03 14:22:32 +08:00
Marek Olšák
a60a5b850b r300g: do not remove unused constants if we are not near the limit 2010-12-03 06:32:10 +01:00
Marek Olšák
b088b255ec r300g: fix pointer arithmetic with void* in transfer_inline_write 2010-12-03 06:08:50 +01:00
Marek Olšák
d531f9c2f5 mesa, st/mesa: fix gl_FragCoord with FBOs in Gallium
gl_FragCoord.y needs to be flipped upside down if a FBO is bound.

This fixes:
- piglit/fbo-fragcoord
- https://bugs.freedesktop.org/show_bug.cgi?id=29420

Here I add a new program state STATE_FB_WPOS_Y_TRANSFORM, which is set based
on whether a FBO is bound. The state contains a pair of transformations.
It can be either (XY=identity, ZW=transformY) if a FBO is bound,
or (XY=transformY, ZW=identity) otherwise, where identity = (1, 0),
transformY = (-1, height-1).

A classic driver (or st/mesa) may, based on some other state, choose whether
to use XY or ZW, thus negate the conditional "if (is a FBO bound) ...".
The reason for this is that a Gallium driver is allowed to only support WPOS
relative to either the lower left or the upper left corner, so we must flip
the Y axis accordingly again. (the "invert" parameter in emit_wpos_inversion)

NOTE: This is a candidate for the 7.9 branch.

Signed-off-by: Marek Olšák <maraeo@gmail.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2010-12-03 05:56:40 +01:00
Marek Olšák
6a46fce14f r300g: implement simple transfer_inline_write for buffers
r600g might need something like that as well. This speeds up constant buffer
upload a bit.
2010-12-03 05:44:47 +01:00
Marek Olšák
3ba8843307 r300g: use internal BO handle for add_buffer and write_reloc
Small perf improvement in ipers.

radeon_drm_get_cs_handle is exactly what this commit tries to avoid
in every write_reloc.
2010-12-03 04:40:22 +01:00
Brian Paul
6299f241e9 gallivm/llvmpipe: remove lp_build_context::builder
The field was redundant.  Use the gallivm->builder value instead.
2010-12-02 18:11:16 -07:00
Brian Paul
36b09b5ded mesa: replace more MAX_WIDTH stack allocations with heap allocations 2010-12-02 18:07:03 -07:00
Marek Olšák
0c9a63db09 r300g: fix build 2010-12-03 00:54:41 +01:00
nobled
39c436a1a2 r300g: Drop unnecessary cast 2010-12-03 00:50:58 +01:00
nobled
7ed65f462a r300g: Abort if draw_create() fails
The other drivers need to be updated to do this, too.
2010-12-03 00:50:58 +01:00
nobled
d5bf231806 r300g: Abort if atom allocations fail 2010-12-03 00:50:58 +01:00
Ben Skeggs
a25cea19f2 nv50: silence some unknown get_param warnings
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-12-03 08:23:44 +10:00
Brian Paul
77ea102735 st/mesa: avoid large stack allocations in readpixels code 2010-12-02 14:29:07 -07:00
Brian Paul
aa28efe60d swrast: avoid large stack allocations in tex combine code 2010-12-02 14:29:07 -07:00
Brian Paul
25662f878e swrast: avoid large stack allocations in blend code 2010-12-02 14:29:07 -07:00
Brian Paul
2addcb7b50 mesa: replace large/MAX_WIDTH stack allocations with heap allocations 2010-12-02 14:29:01 -07:00
Brian Paul
896a08bde6 mesa: replace large/MAX_WIDTH stack allocations with heap allocations 2010-12-02 14:26:55 -07:00
Alex Deucher
fae7cb8ed8 r600g: bump texture/cb limits appropriately for evergreen 2010-12-02 16:11:08 -05:00
Alex Deucher
a3dc947057 r600c: bump texture limits to hw limits 2010-12-02 16:11:07 -05:00
Zack Rusin
e737b9294a gallium/util: add states relevant to geometry shaders 2010-12-02 15:50:15 -05:00
José Fonseca
64da9a1a04 mesa: Temporary hack to prevent stack overflow on windows
e.g. st_readpixels is trying to alloca() an huge ammount of memory from
the stack.
2010-12-02 20:30:59 +00:00
José Fonseca
63df5a464e wgl: Fix visual's buffer_mask configuration. 2010-12-02 20:21:39 +00:00
José Fonseca
43121f2086 mapi: Hack to avoid vgCreateFont being generated as vgCreateFontA.
Right fix is probably stop C-preprocessor abuse and stick 100% with
scripted code generation.
2010-12-02 19:39:55 +00:00
Eric Anholt
43491adc44 mesa: Add getters for ARB_copy_buffer's attachment points.
Fixes more complaints by oglconform.
2010-12-02 10:28:55 -08:00
Eric Anholt
7cba339375 mesa: Add getters for the rest of the supported draw buffers.
MAX_DRAW_BUFFERS is 8, so allow all 8 GL_DRAW_BUFFER# to be retrieved.
Fixes complaints by oglconform.
2010-12-02 10:28:52 -08:00
Eric Anholt
b381eff141 glsl: Fix flipped return of has_value() for array constants.
Fixes glsl-array-uniform.
2010-12-02 10:28:51 -08:00
José Fonseca
e3659329e0 WIN32_THREADS -> WIN32
Fixes nasty bug where some parts of the code didn't define WIN32_THREADS
and were using the integer mutex implementation, causing even confusion
to the debuggers.

And there is little interest of other thread implemenation on Win32
besides Win32 threads.
2010-12-02 17:35:03 +00:00
Brian Paul
af4f75c8fe softpipe: increase max texture size to 16K 2010-12-02 10:10:05 -07:00
Brian Paul
4b08f35487 mesa: raise max texture sizes to 16K
This allows 16K x 16K 2D textures, for example, but we don't want to
allow that for 3D textures.  The new gl_constants::MaxTextureMBytes
field is used to prevent allocating too large of texture image.
This allows a 16K x 32 x 32 3D texture, for example, but prevents 16K^3.
Drivers can override this limit.  The default is currently 1GB.

Apps should use the proxy texture mechanism to determine the actual
max texture size.
2010-12-02 10:09:03 -07:00
Marek Olšák
23390e2f5c r300/compiler: disable the swizzle lowering pass in vertex shaders
It was a no-op because all swizzles are native there.
2010-12-02 17:48:08 +01:00
José Fonseca
14e2dc9c66 wgl: Unreference the current framebuffer after the make_current call.
To prevent a dangling pointer dereference.
2010-12-02 16:28:36 +00:00
José Fonseca
63c05c96e7 util: Don't try to use imagehlp on mingw. 2010-12-02 15:14:58 +00:00
José Fonseca
50a52ba67e util: __builtin_frame_address() doesn't work on mingw. 2010-12-02 15:14:58 +00:00
José Fonseca
744ef8721b util: Plug leaks in util_destroy_gen_mipmap. 2010-12-02 15:14:58 +00:00
José Fonseca
e5ffa9aa47 wgl: Fix double free. Remove dead code. 2010-12-02 15:14:58 +00:00
Marek Olšák
f3021c688f r300g: fix up cubemap texture offset computation
Broken since 4c70014626.
2010-12-02 14:44:28 +01:00
José Fonseca
431c478df9 util: C++ safe. 2010-12-02 12:26:55 +00:00
José Fonseca
27ba2eb33b retrace: Some fixes. 2010-12-02 12:17:07 +00:00
Chia-I Wu
cb2791213a st/vega: polygon_array requires a deep free.
A polygon array is an array of pointers to polygons.  The polygons
should be freed with the array.
2010-12-02 17:54:23 +08:00
Chia-I Wu
b950d6fa5d st/vega: Destroy the pipe context with vg_context. 2010-12-02 17:27:38 +08:00
Chad Versace
7528f143df glsl: Fix linker bug in cross_validate_globals()
Cause linking to fail if a global has mismatching invariant qualifiers.

See https://bugs.freedesktop.org/show_bug.cgi?id=30261
2010-12-01 20:40:07 -08:00
Roland Scheidegger
4c70014626 gallium: support for array textures and related changes
resources have a array_size parameter now.
get_tex_surface and tex_surface_destroy have been renamed to create_surface
and surface_destroy and moved to context, similar to sampler views (and
create_surface now uses a template just like create_sampler_view). Surfaces
now really should only be used for rendering. In particular they shouldn't be
used as some kind of 2d abstraction for sharing a texture. offset/layout fields
don't make sense any longer and have been removed, width/height should go too.
surfaces and sampler views now specify a layer range (for texture resources),
layer is either array slice, depth slice or cube face.
pipe_subresource is gone array slices (or cube faces) are now treated the same
as depth slices in transfers etc. (that is, they use the z coord of the
respective functions).

Squashed commit of the following:

commit a45bd509014743d21a532194d7b658a1aeb00cb7
Merge: 1aeca28 32e1e59
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Thu Dec 2 04:32:06 2010 +0100

    Merge remote branch 'origin/master' into gallium-array-textures

    Conflicts:
    	src/gallium/drivers/i915/i915_resource_texture.c
    	src/gallium/drivers/i915/i915_state_emit.c
    	src/gallium/drivers/i915/i915_surface.c

commit 1aeca287a827f29206078fa1204715a477072c08
Merge: 912f042 6f7c8c3
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Thu Dec 2 00:37:11 2010 +0100

    Merge remote branch 'origin/master' into gallium-array-textures

    Conflicts:
    	src/gallium/state_trackers/vega/api_filters.c
    	src/gallium/state_trackers/vega/api_images.c
    	src/gallium/state_trackers/vega/mask.c
    	src/gallium/state_trackers/vega/paint.c
    	src/gallium/state_trackers/vega/renderer.c
    	src/gallium/state_trackers/vega/st_inlines.h
    	src/gallium/state_trackers/vega/vg_context.c
    	src/gallium/state_trackers/vega/vg_manager.c

commit 912f042e1d439de17b36be9a740358c876fcd144
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Wed Dec 1 03:01:55 2010 +0100

    gallium: even more compile fixes after merge

commit 6fc95a58866d2a291def333608ba9c10c3f07e82
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Wed Dec 1 00:22:26 2010 +0100

    gallium: some fixes after merge

commit a8d5ffaeb5397ffaa12fb422e4e7efdf0494c3e2
Merge: f7a202f 2da02e7
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Tue Nov 30 23:41:26 2010 +0100

    Merge remote branch 'origin/master' into gallium-array-textures

    Conflicts:
    	src/gallium/drivers/i915/i915_state_emit.c
    	src/gallium/state_trackers/vega/api_images.c
    	src/gallium/state_trackers/vega/vg_context.c

commit f7a202fde2aea2ec78ef58830f945a5e214e56ab
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Wed Nov 24 19:19:32 2010 +0100

    gallium: even more fixes/cleanups after merge

commit 6895a7f969ed7f9fa8ceb788810df8dbcf04c4c9
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Wed Nov 24 03:07:36 2010 +0100

    gallium: more compile fixes after merge

commit af0501a5103b9756bc4d79167bd81051ad6e8670
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Tue Nov 23 19:24:45 2010 +0100

    gallium: lots of compile fixes after merge

commit 0332003c2feb60f2a20e9a40368180c4ecd33e6b
Merge: 26c6346 b6b91fa
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Tue Nov 23 17:02:26 2010 +0100

    Merge remote branch 'origin/master' into gallium-array-textures

    Conflicts:
    	src/gallium/auxiliary/gallivm/lp_bld_sample.c
    	src/gallium/auxiliary/util/u_blit.c
    	src/gallium/auxiliary/util/u_blitter.c
    	src/gallium/auxiliary/util/u_inlines.h
    	src/gallium/auxiliary/util/u_surface.c
    	src/gallium/auxiliary/util/u_surfaces.c
    	src/gallium/docs/source/context.rst
    	src/gallium/drivers/llvmpipe/lp_rast.c
    	src/gallium/drivers/nv50/nv50_state_validate.c
    	src/gallium/drivers/nvfx/nv04_surface_2d.c
    	src/gallium/drivers/nvfx/nv04_surface_2d.h
    	src/gallium/drivers/nvfx/nvfx_buffer.c
    	src/gallium/drivers/nvfx/nvfx_miptree.c
    	src/gallium/drivers/nvfx/nvfx_resource.c
    	src/gallium/drivers/nvfx/nvfx_resource.h
    	src/gallium/drivers/nvfx/nvfx_state_fb.c
    	src/gallium/drivers/nvfx/nvfx_surface.c
    	src/gallium/drivers/nvfx/nvfx_transfer.c
    	src/gallium/drivers/r300/r300_state_derived.c
    	src/gallium/drivers/r300/r300_texture.c
    	src/gallium/drivers/r600/r600_blit.c
    	src/gallium/drivers/r600/r600_buffer.c
    	src/gallium/drivers/r600/r600_context.h
    	src/gallium/drivers/r600/r600_screen.c
    	src/gallium/drivers/r600/r600_screen.h
    	src/gallium/drivers/r600/r600_state.c
    	src/gallium/drivers/r600/r600_texture.c
    	src/gallium/include/pipe/p_defines.h
    	src/gallium/state_trackers/egl/common/egl_g3d_api.c
    	src/gallium/state_trackers/glx/xlib/xm_st.c
    	src/gallium/targets/libgl-gdi/gdi_softpipe_winsys.c
    	src/gallium/targets/libgl-gdi/libgl_gdi.c
    	src/gallium/tests/graw/tri.c
    	src/mesa/state_tracker/st_cb_blit.c
    	src/mesa/state_tracker/st_cb_readpixels.c

commit 26c6346b385929fba94775f33838d0cceaaf1127
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Mon Aug 2 19:37:21 2010 +0200

    fix more merge breakage

commit b30d87c6025eefe7f6979ffa8e369bbe755d5c1d
Merge: 9461bf3 1f1928d
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Mon Aug 2 19:15:38 2010 +0200

    Merge remote branch 'origin/master' into gallium-array-textures

    Conflicts:
    	src/gallium/drivers/llvmpipe/lp_rast.c
    	src/gallium/drivers/llvmpipe/lp_rast_priv.h
    	src/gallium/drivers/r300/r300_blit.c
    	src/gallium/drivers/r300/r300_screen_buffer.c
    	src/gallium/drivers/r300/r300_state_derived.c
    	src/gallium/drivers/r300/r300_texture.c
    	src/gallium/drivers/r300/r300_texture.h
    	src/gallium/drivers/r300/r300_transfer.c
    	src/gallium/drivers/r600/r600_screen.c
    	src/gallium/drivers/r600/r600_state.c
    	src/gallium/drivers/r600/r600_texture.c
    	src/gallium/drivers/r600/r600_texture.h
    	src/gallium/state_trackers/dri/common/dri1_helper.c
    	src/gallium/state_trackers/dri/sw/drisw.c
    	src/gallium/state_trackers/xorg/xorg_exa.c

commit 9461bf3cfb647d2301364ae29fc3084fff52862a
Merge: 17492d7 0eaccb3
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Thu Jul 15 20:13:45 2010 +0200

    Merge commit 'origin/master' into gallium-array-textures

    Conflicts:
    	src/gallium/auxiliary/util/u_blitter.c
    	src/gallium/drivers/llvmpipe/lp_rast.c
    	src/gallium/drivers/llvmpipe/lp_surface.c
    	src/gallium/drivers/r300/r300_render.c
    	src/gallium/drivers/r300/r300_state.c
    	src/gallium/drivers/r300/r300_texture.c
    	src/gallium/drivers/r300/r300_transfer.c
    	src/gallium/tests/trivial/quad-tex.c

commit 17492d705e7b7f607b71db045c3bf344cb6842b3
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Fri Jun 18 10:58:08 2010 +0100

    gallium: rename element_offset/width fields in views to first/last_element

    This is much more consistent with the other fields used there
    (first/last level, first/last layer).
    Actually thinking about removing the ugly union/structs again and
    rename first/last_layer to something even more generic which could also
    be used for buffers (like first/last_member) without inducing headaches.

commit 1b717a289299f942de834dcccafbab91361e20ab
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Thu Jun 17 14:46:09 2010 +0100

    gallium: remove PIPE_SURFACE_LAYOUT_LINEAR definition

    This was only used by the layout field of pipe_surface, but this
    driver internal stuff is gone so there's no need for this driver independent
    layout definition neither.

commit 10cb644b31b3ef47e6c7b55e514ad24bb891fac4
Merge: 5691db9 c85971d
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Thu Jun 17 12:20:41 2010 +0100

    Merge commit 'origin/master' into gallium-array-textures

    Conflicts:
    	src/gallium/docs/source/glossary.rst
    	src/gallium/tests/graw/fs-test.c
    	src/gallium/tests/graw/gs-test.c

commit 5691db960ca3d525ce7d6c32d9c7a28f5e907f3b
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Thu Jun 17 11:29:03 2010 +0100

    st/wgl: fix interface changes bugs

commit 2303ec32143d363b46e59e4b7c91b0ebd34a16b2
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Wed Jun 16 19:42:32 2010 +0100

    gallium: adapt code to interface changes...

commit dcae4f586f0d0885b72674a355e5d56d47afe77d
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Wed Jun 16 19:42:05 2010 +0100

    gallium: separate depth0 and array_size in the resource itself.

    These fields are still mutually exclusive (since no 3d array textures exist)
    but it ultimately seemed to error-prone to adapt all code accept the new
    meaning of depth0 (drivers stick that into hardware regs, calculate mipmap
    sizes etc.). And it isn't really cleaner anyway.
    So, array textures will have depth0 of 1, but instead use array_size,
    3D textures will continue to use depth0 (and have array_size of 1). Cube
    maps also will use array_size to indicate their 6 faces, but since all drivers
    should just be fine by inferring this themselves from the fact it's a cube map
    as they always used to nothing should break.

commit 621737a638d187d208712250fc19a91978fdea6b
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Wed Jun 16 17:47:38 2010 +0100

    gallium: adapt code to interface changes

    There are still usages of pipe_surface where pipe_resource should be used,
    which should eventually be fixed.

commit 2d17f5efe166b2c3d51957c76294165ab30b8ae2
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Wed Jun 16 17:46:14 2010 +0100

    gallium: more interface changes

    In particular to enable usage of buffers in views, and ability to use a
    different pipe_format in pipe_surface.
    Get rid of layout and offset parameter in pipe_surface - the former was
    not used in any (public) code anyway, and the latter should either be computed
    on-demand or driver can use subclass of pipe_surface.
    Also make create_surface() use a template to be more consistent with
    other functions.

commit 71f885ee16aa5cf2742c44bfaf0dc5b8734b9901
Merge: 3232d11 8ad410d
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Mon Jun 14 14:19:51 2010 +0100

    Merge commit 'origin/master' into gallium-array-textures

    Conflicts:
    	src/gallium/auxiliary/util/u_box.h
    	src/gallium/drivers/nv50/nv50_surface.c
    	src/gallium/drivers/nvfx/nvfx_surface.c
    	src/gallium/drivers/r300/r300_blit.c
    	src/gallium/drivers/r300/r300_texture.c
    	src/gallium/drivers/r300/r300_transfer.c
    	src/gallium/drivers/r600/r600_blit.c
    	src/gallium/drivers/r600/r600_screen.h
    	src/gallium/include/pipe/p_state.h

commit 3232d11fe3ebf7686286013c357b404714853984
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Mon Jun 14 11:40:04 2010 +0100

    mesa/st: adapt to interface changes

    still need to fix pipe_surface sharing
    (as that is now per-context).
    Also broken is depth0 handling - half the code assumes
    this is also used for array textures (and hence by extension
    of that cube maps would have depth 6), half the code does not...

commit f433b7f7f552720e5eade0b4078db94590ee85e1
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Mon Jun 14 11:35:52 2010 +0100

    gallium: fix a couple of bugs in interface chnage fixes

commit 818366b28ea18f514dc791646248ce6f08d9bbcf
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Sat Jun 12 02:42:11 2010 +0200

    targets: adapt to interface changes

    Yes even that needs adjustments...

commit 66c511ab1682c9918e0200902039247793acb41e
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Sat Jun 12 02:41:13 2010 +0200

    tests: adapt to interface changes

    Everything needs to be fixed :-(.

commit 6b494635d9dbdaa7605bc87b1ebf682b138c5808
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Sat Jun 12 02:39:50 2010 +0200

    st: adapt non-rendering state trackers to interface changes

    might not be quite right in all places, but they really don't want
    to use pipe_surface.

commit 00c4289a35d86e4fe85919ec32aa9f5ffe69d16d
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Sat Jun 12 02:38:48 2010 +0200

    winsys: adapt to interface changes

commit 39d858554dc9ed5dbc795626fec3ef9deae552a0
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Sat Jun 12 02:26:54 2010 +0200

    st/python: adapt to interface changes

    don't think that will work, sorry.

commit 6e9336bc49b32139cec4e683857d0958000e15e3
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Sat Jun 12 02:26:07 2010 +0200

    st/vega: adapt to interface changes

commit e07f2ae9aaf8842757d5d50865f76f8276245e11
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Sat Jun 12 02:25:56 2010 +0200

    st/xorg: adapt to interface changes

commit 05531c10a74a4358103e30d3b38a5eceb25c947f
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Sat Jun 12 02:24:53 2010 +0200

    nv50: adapt to interface changes

commit 97704f388d7042121c6d496ba8c003afa3ea2bf3
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Sat Jun 12 02:24:45 2010 +0200

    nvfx: adapt to interface changes

commit a8a9c93d703af6e8f5c12e1cea9ec665add1abe0
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Sat Jun 12 02:24:01 2010 +0200

    i965g: adapt to interface changes

commit 0dde209589872d20cc34ed0b237e3ed7ae0e2de3
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Sat Jun 12 02:22:38 2010 +0200

    i915g: adapt to interface changes

commit 5cac9beede69d12f5807ee1a247a4c864652799e
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Sat Jun 12 02:20:58 2010 +0200

    svga: adapt to interface changes

    resource_copy_region still looking fishy.
    Was not very suited to unified zslice/face approach...

commit 08b5a6af4b963a3e4c75fc336bf6c0772dce5150
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Sat Jun 12 02:20:01 2010 +0200

    rbug: adapt to interface changes

    Not sure if that won't need changes elsewhere?

commit c9fd24b1f586bcef2e0a6e76b68e40fca3408964
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Sat Jun 12 02:19:31 2010 +0200

    trace: adapt to interface changes

commit ed84e010afc5635a1a47390b32247a266f65b8d1
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Sat Jun 12 02:19:21 2010 +0200

    failover: adapt to interface changes

commit a1d4b4a293da933276908e3393435ec4b43cf201
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Sat Jun 12 02:19:12 2010 +0200

    identity: adapt to interface changes

commit a8dd73e2c56c7d95ffcf174408f38f4f35fd2f4c
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Sat Jun 12 02:18:55 2010 +0200

    softpipe: adapt to interface changes

commit a886085893e461e8473978e8206ec2312b7077ff
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Sat Jun 12 02:18:44 2010 +0200

    llvmpipe: adapt to interface changes

commit 70523f6d567d8b7cfda682157556370fd3c43460
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Sat Jun 12 02:18:14 2010 +0200

    r600g: adapt to interface changes

commit 3f4bc72bd80994865eb9f6b8dfd11e2b97060d19
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Sat Jun 12 02:18:05 2010 +0200

    r300g: adapt to interface changes

commit 5d353b55ee14db0ac0515b5a3cf9389430832c19
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Sat Jun 12 02:17:37 2010 +0200

    cell: adapt to interface changes

    not even compile tested

commit cf5d03601322c2dcb12d7a9c2f1745e2b2a35eb4
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Sat Jun 12 02:14:59 2010 +0200

    util: adapt to interface changes

    amazing how much code changes just due to some subtle interface changes?

commit dc98d713c6937c0e177fc2caf23020402cc7ea7b
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Sat Jun 12 02:12:40 2010 +0200

    gallium: more interface fail, docs

    this also changes flush_frontbuffer to use a pipe_resource instead of
    a pipe_surface - pipe_surface is not meant to be (or at least no longer)
    an abstraction for standalone 2d images which get passed around.
    (This has also implications for the non-rendering state-trackers.)

commit 08436d27ddd59857c22827c609b692aa0c407b7b
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Thu Jun 10 17:42:52 2010 +0200

    gallium: fix array texture interface changes bugs, docs

commit 4a4d927609b62b4d7fb9dffa35158afe282f277b
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Thu Jun 3 22:02:44 2010 +0200

    gallium: interface changes for array textures and related cleanups

    This patch introduces array textures to gallium (note they are not immediately
    usable without the associated changes to the shader side).
    Also, this abandons pipe_subresource in favor of using level and layer
    parameters since the distinction between several faces (which was part of
    pipe_subresource for cube textures) and several z slices (which were not part
    of pipe_subresource but instead part of pipe_box where appropriate for 3d
    textures) is gone at the resource level.
    Textures, be it array, cube, or 3d, now use a "unified" set of parameters,
    there is no distinction between array members, cube faces, or 3d zslices.
    This is unlike d3d10, whose subresource index includes layer information for
    array textures, but which considers all z slices of a 3d texture to be part
    of the same subresource.
    In contrast to d3d10, OpenGL though reuses old 2d and 3d function entry points
    for 1d and 2d array textures, respectively, which also implies that for instance
    it is possible to specify all layers of a 2d array texture at once (note that
    this is not possible for cube maps, which use the 2d entry points, although
    it is possible for cube map arrays, which aren't supported yet in gallium).
    This should possibly make drivers a bit simpler, and also get rid of mutually
    exclusive parameters in some functions (as z and face were exclusive), one
    potential downside would be that 3d array textures could not easily be supported
    without reverting this, but those are nowhere to be seen.

    Also along with adjusting to new parameters, rename get_tex_surface /
    tex_surface_destroy to create_surface / surface_destroy and move them from
    screen to context, which reflects much better what those do (they are analogous
    to create_sampler_view / sampler_view_destroy).

    PIPE_CAP_ARRAY_TEXTURES is used to indicate if a driver supports all of this
    functionality (that is, both sampling from array texture as well as use a range
    of layers as a render target, with selecting the layer from the geometry shader).
2010-12-02 04:33:43 +01:00
Xiang, Haihao
32e1e59146 i965: add support for polygon mode on Sandybridge.
This fixes some mesa demos such as fslight/engine in wireframe mode.
2010-12-02 09:54:35 +08:00
Jakob Bornecrantz
de3ff5af49 i915g: Make sure that new vbo gets updated
Malloc likes to reuse old address as soon as possible this would cause the
new vbo buffer to get the same address as the old. So make sure we set it to
NULL when we allocate a new one. This fixes ipers which will fill up a couple
of VBO buffers per frame.

Signed-off-by: Jakob Bornecrantz <wallbraker@gmail.com>
2010-12-02 01:34:14 +01:00
Jakob Bornecrantz
442e567aa0 i915g: Improve debug printing for textures
Signed-off-by: Jakob Bornecrantz <wallbraker@gmail.com>
2010-12-02 01:34:14 +01:00
Chris Wilson
f6476822a0 i915g: Fix closure of full batch buffers
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
[danvet: incorporate comments by Dr_Jakob]
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Jakob Bornecrantz <wallbraker@gmail.com>
Signed-off-by: Jakob Bornecrantz <wallbraker@gmail.com>
2010-12-02 01:34:14 +01:00
Daniel Vetter
600454084b i915g: track TODO items
Just as a reminder for all things currently broken with i915g.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Jakob Bornecrantz <wallbraker@gmail.com>
Signed-off-by: Jakob Bornecrantz <wallbraker@gmail.com>
2010-12-02 01:34:14 +01:00
Daniel Vetter
0246b2bf27 i915g: assert(depth_surface->offset == 0)
Shouldn't happen and not supported, anyway.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Jakob Bornecrantz <wallbraker@gmail.com>
Signed-off-by: Jakob Bornecrantz <wallbraker@gmail.com>
2010-12-02 01:34:14 +01:00
Daniel Vetter
1a47a25d2c i915g: enable x-tiling for render targets
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Jakob Bornecrantz <wallbraker@gmail.com>
Signed-off-by: Jakob Bornecrantz <wallbraker@gmail.com>
2010-12-02 01:34:13 +01:00
Daniel Vetter
8af684e37e i915g: switch rendering to mipmapped textures to (x,y) offsets
Byte offsets simply don't work with tiled render targets when using
tiling bits. Luckily we can cox the hw into doing the right thing
with the DRAWING_RECT command by disabling the drawing rect offset
for the depth buffer.

Minor fixes by Jakob Bornecrantz.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Jakob Bornecrantz <wallbraker@gmail.com>
Signed-off-by: Jakob Bornecrantz <wallbraker@gmail.com>
2010-12-02 01:34:13 +01:00
Daniel Vetter
9493fe85d1 i915g: enable X-tiling for textures
Tiling is rather fragile in general and results in pure blackness when
unlucky.  Hence add a new option to disable tiling.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Jakob Bornecrantz <wallbraker@gmail.com>
Signed-off-by: Jakob Bornecrantz <wallbraker@gmail.com>
2010-12-02 01:34:13 +01:00
Daniel Vetter
32345610cc i915g: don't pot-align stride for tiled buffers
libdrm will do this for us, if it's required (i.e. if tiling is
possible).

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Jakob Bornecrantz <wallbraker@gmail.com>
Signed-off-by: Jakob Bornecrantz <wallbraker@gmail.com>
2010-12-02 01:34:13 +01:00
Daniel Vetter
6ae6e0c6fe i915g: postpone mipmap/face offset calculation
libdrm-intel can refuse to tile buffers for various reasons. For
potentially tiled buffers the stride is therefore only known after
the iws->buffer_create_tiled call. Unconditionally rounding up to whatever
tiling requires wastes space, so rework the code to not use tex->stride
in the layout code.

Luckily only the mimap/face offset calculation uses it which can easily
be solved by storing an (x, y) coordinate pair. Furthermore this will
be usefull later for properly supporting rendering into the different
levels of tiled mipmap textures.

v2: switch to nblocks(x|y): More in line with gallium and better
suited for rendering into mipmap textures.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Jakob Bornecrantz <wallbraker@gmail.com>
Signed-off-by: Jakob Bornecrantz <wallbraker@gmail.com>
2010-12-02 01:34:13 +01:00
Daniel Vetter
f34fd58ec9 i915g: implement unfenced relocs for textures using tiling bits
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Jakob Bornecrantz <wallbraker@gmail.com>
Signed-off-by: Jakob Bornecrantz <wallbraker@gmail.com>
2010-12-02 01:34:13 +01:00
Daniel Vetter
a95e694eaf i915g: implement unfenced color&depth buffer using tiling bits
v2: Clarify tiling bit calculation as suggested by Chris Wilson.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Jakob Bornecrantz <wallbraker@gmail.com>
Signed-off-by: Jakob Bornecrantz <wallbraker@gmail.com>
2010-12-02 01:34:13 +01:00
Daniel Vetter
2ff0879a63 i915g: return tiling in iws->buffer_from_handle
This is needed to properly implement tiling flags. And the gem
implemention fo buffer_from_handle already calls get_tiling, so
it's for free.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Jakob Bornecrantz <wallbraker@gmail.com>
Signed-off-by: Jakob Bornecrantz <wallbraker@gmail.com>
2010-12-02 01:34:13 +01:00
Daniel Vetter
135b083461 i915g: prepare winsys/batchbuffer for execbuf2
Wire up a fenced parameter, switch all relocations to _FENCED

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Jakob Bornecrantz <wallbraker@gmail.com>
Signed-off-by: Jakob Bornecrantz <wallbraker@gmail.com>
2010-12-02 01:34:13 +01:00
Daniel Vetter
1c60840338 i915g: switch to tiled allocations, kill set_fence
This way relaxed fencing is handled by libdrm. And buffers _can't_
ever change their tiling.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Jakob Bornecrantz <wallbraker@gmail.com>
Signed-off-by: Jakob Bornecrantz <wallbraker@gmail.com>
2010-12-02 01:34:13 +01:00
Daniel Vetter
4a666488c4 i915g: add winsys function to create tiled buffers
Different kernels have different restrictions for tiled buffers.
Hence use the libdrm abstraction to calculate the necessary
stride and height alignment requirements.

Not yet used.

v2: Incorporate review comments from Jakob Bornecrantz

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Jakob Bornecrantz <wallbraker@gmail.com>
Signed-off-by: Jakob Bornecrantz <wallbraker@gmail.com>
2010-12-02 01:34:12 +01:00
Daniel Vetter
c62f5c7e7b i915g: drop alignment parameter from iws->buffer_create
It's unnecessary. The kernel gem ignores it totally and we can't
run on the old userspace fake bo manager due to lack of dri2.

Also drop the redundant name string from the sw winsys as suggested
by Jakob Bornecrantz

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Jakob Bornecrantz <wallbraker@gmail.com>
Signed-off-by: Jakob Bornecrantz <wallbraker@gmail.com>
2010-12-02 01:34:12 +01:00
Eric Anholt
b4f585665c glsl: Mark the array access for whole-array comparisons.
By not doing so, the uniform contents of
glsl-uniform-non-uniform-array-compare.shader_test was getting thrown
out since nobody was recorded as dereferencing the array.
2010-12-01 16:14:34 -08:00
Eric Anholt
f361f8a8a9 i965: Add support for loops in the VS.
This follows the changes done for the FS alongside the EU emit code.
2010-12-01 16:14:34 -08:00
Eric Anholt
251d15d888 i965: Enable IF statements in the VS.
While the actual IF instructions were fixed by Zhenyu, we were still
flattening them to conditional moves.
2010-12-01 16:14:34 -08:00
Eric Anholt
843a6a308e i965: Add support for gen6 CONTINUE instruction emit.
At this point, piglit tests for fragment shader loops are working.
2010-12-01 16:14:34 -08:00
Eric Anholt
00e5a743e2 i965: Add support for gen6 BREAK ISA emit.
There are now two targets: the hop-to-end-of-block target, and the
target for where to resume execution for active channels.
2010-12-01 16:14:33 -08:00
Eric Anholt
4890e0f09c i965: Add support for gen6 DO/WHILE ISA emit.
There's no more DO since there's no more mask stack, and WHILE has
been shuffled like IF was.
2010-12-01 16:14:31 -08:00
Eric Anholt
a9f62881a3 i965: Dump the WHILE jump distance on gen6. 2010-12-01 15:22:59 -08:00
Marek Olšák
fcf6b353bf r300g: disable ARB_texture_swizzle if S3TC is enabled on r3xx-only
r3xx cannot swizzle compressed textures. r4xx+ is unaffected.

NOTE: This is a candidate for the 7.9 branch.
2010-12-01 22:54:05 +01:00
Marek Olšák
6478a4de14 r300g: fix texture swizzling with compressed textures on r400-r500
This fixes all S3TC piglit/texwrap tests.

NOTE: This is a candidate for the 7.9 branch.
2010-12-01 22:29:09 +01:00
Ian Romanick
c92550be64 i915: Correctly generate unconditional KIL instructions
Fixes piglit test glsl-fs-discard-03.

NOTE: This is a candidate for the 7.9 branch.
2010-12-01 12:01:13 -08:00
Ian Romanick
b6dbc06742 i915: Request that POW instructions be lowered 2010-12-01 12:01:13 -08:00
Ian Romanick
c4285be9a5 glsl: Lower ir_binop_pow to a sequence of EXP2 and LOG2 2010-12-01 12:01:13 -08:00
Ian Romanick
da61afa738 glsl: Use M_LOG2E constant instead of calling log2 2010-12-01 12:01:12 -08:00
Kenneth Graunke
d2d7a273c5 glsl: Add comments to lower_jumps (from the commit message).
This is essentially Luca's commit message, but placed at the top of the
file.
2010-12-01 11:52:43 -08:00
Kenneth Graunke
1802cb9baf glsl: Remove "discard" support from lower_jumps.
The new lower_discard and opt_discard_simplification passes should
handle all the necessary transformations, so lower_jumps doesn't need to
support it.

Also, lower_jumps incorrectly handled conditional discards - it would
unconditionally truncate all code after the discard.  Rather than fixing
the bug, simply remove the code.

NOTE: This is a candidate for the 7.9 branch.
2010-12-01 11:52:43 -08:00
Kenneth Graunke
940df10100 glsl: Add a lowering pass to move discards out of if-statements.
This should allow lower_if_to_cond_assign to work in the presence of
discards, fixing bug #31690 and likely #31983.

NOTE: This is a candidate for the 7.9 branch.
2010-12-01 11:52:43 -08:00
Kenneth Graunke
9a1d063c6d glsl: Add an optimization pass to simplify discards.
NOTE: This is a candidate for the 7.9 branch.
2010-12-01 11:52:43 -08:00
Marek Olšák
ead2ea89f4 ir_to_mesa: Add support for conditional discards.
NOTE: This is a candidate for the 7.9 branch.

Signed-off-by: Marek Olšák <maraeo@gmail.com>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2010-12-01 11:52:36 -08:00
Alex Deucher
2ca9256911 r600c: fix some opcodes on evergreen
There were a few places where we were using the wrong opcodes
on evergreen.  arl still needs to be fixed on evergreen; see
r600g for reference.

NOTE: This is a candidate for the 7.9 branch.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2010-12-01 13:26:02 -05:00
Marek Olšák
e6d798948e r300/compiler: implement and lower OPCODE_CLAMP
Needed for st/vega.
2010-12-01 18:29:50 +01:00
José Fonseca
6f7c8c3cbf vega: Remove extraneous ; 2010-12-01 12:31:21 +00:00
José Fonseca
792caebced scons: Move MSVS_VERSION option to common module. 2010-12-01 12:23:12 +00:00
José Fonseca
2aa3203660 svga: Silence debug printf. 2010-12-01 12:23:12 +00:00
Chia-I Wu
0dadc0b808 st/vega: Avoid unnecessary constant bufer upload.
Remember the last uploaded data and avoid re-uploading.
2010-12-01 18:36:27 +08:00
Chia-I Wu
d7a6901cac st/vega: Initialize pipe states with renderer.
Initialize vertex elements, rasterizer, stencil ref, and vertex shader
with renderer_create.  Remove RASTERIZER_DIRTY and VS_DIRTY flags.
2010-12-01 18:07:00 +08:00
Chia-I Wu
c91c386012 st/vega: Create drawing surface mask as needed.
As the blend texture, a drawing surface mask is used when masking is
enabled.  It should be created as needed.

s/alpha_mask/surface_mask/ to follow OpenVG 1.1 naming.
2010-12-01 18:03:06 +08:00
Chia-I Wu
04f342b417 st/vega: Delay blend texture creation until needed.
It is used for more advanced blending or mask update.  It might not be
ever needed for some applications.
2010-12-01 17:46:34 +08:00
Chia-I Wu
f8e0dd246b st/vega: Remove st_inlines.h.
Per b0427bedde.
2010-12-01 17:00:22 +08:00
Chia-I Wu
2bb788ccc6 st/vega: Simplify radial gradient.
Eight less instructions with comments.
2010-12-01 16:46:01 +08:00
Chia-I Wu
d7aa03b4fe st/vega: Fix degenerate paints.
Fix the case that the two points of a linear gradient coincide, or the
case that the radius of a radial gradient is equal to or less than 0.
2010-12-01 16:46:01 +08:00
Zhenyu Wang
c530fd3f8a i965: also using align1 mode for math2 on sandybridge
Like Eric's workaround patch of commit 490c23ee6b.
This forces to align1 mode for math2 too.
2010-12-01 15:04:18 +08:00
Chia-I Wu
06e7a55028 st/vega: Fix negated logic in image_draw.
A typo from last commit.
2010-12-01 11:39:33 +08:00
Chia-I Wu
b06de80843 st/vega: Fix paint coordinates transformations.
Depending on whether vgDrawPath(mode), vgDrawImage, or vgDrawGlyph[s] is
called, different paint-to-user and user-to-surface matrices should be
used to derive the sample points for the paint.

This fixes "paint" demo.
2010-12-01 11:31:00 +08:00
Chia-I Wu
ca8bc9c05b st/vega: Bump version to 1.1. 2010-12-01 11:23:53 +08:00
Chia-I Wu
e360f91f15 st/vega: Add color transformation support.
Per OpenVG 1.1.  A new shader stage is added.  It uses the first two
constants of the fragment shader for color transformation parameters.
2010-12-01 11:23:52 +08:00
Chia-I Wu
213e288e78 st/vega: More flexible shader selection.
Divide bits of VegaShaderType into 6 groups: paint, image, mask, fill,
premultiply, and bw.  Each group represents a stage.  At most one shader
from each group will be selected when constructing the final fragment
shader.
2010-12-01 11:23:52 +08:00
Chia-I Wu
30cab4b6cb st/vega: Revive mask layer support. 2010-12-01 11:23:52 +08:00
Chia-I Wu
5d64a06a63 st/vega: Add primitive text support.
Optional features such as auth-hinting are not implemented.  There is no
anti-aliasing, and no effort is done to keep the glyph origin integral.
So the text quality is poor.
2010-12-01 11:23:52 +08:00
Chia-I Wu
34f466d4e6 st/vega: Make image_draw take a matrix. 2010-12-01 11:23:52 +08:00
Chia-I Wu
165cb19abc st/vega: Make path_render and path_stroke take a matrix. 2010-12-01 11:23:51 +08:00
Chia-I Wu
d873f1f5b6 st/vega: Fix image sampler views for alpha-only formats.
For alpha-only VG formats, R = G = B = 1.0.
2010-12-01 11:23:51 +08:00
Chia-I Wu
56f02cedfa st/vega: Update to latest headers. 2010-12-01 11:23:51 +08:00
Chia-I Wu
20ce148c30 st/vega: Get rid of renderer_copy_texture. 2010-12-01 11:23:51 +08:00
Chia-I Wu
33ca973e7a st/vega: vg_copy_texture and vg_copy_surface should share code. 2010-12-01 11:23:51 +08:00
Chia-I Wu
4690cdfe07 st/vega: Clean up renderer fields and functions. 2010-12-01 11:23:50 +08:00
Chia-I Wu
ace4539e88 st/vega: Clean up vg_context fields and functions. 2010-12-01 11:23:50 +08:00
Chia-I Wu
635fe3e192 st/vega: vg_manager should care about only the color buffer.
Move depth/stencil buffer, blend texture view, and alpha mask view
creation to vg_context.c.
2010-12-01 11:23:50 +08:00
Chia-I Wu
ee0f1ab923 st/vega: Make shader_bind call into the renderer.
With this commit, the pipe states are entirely managed by the renderer.
The rest of the code interfaces with the renderer instead of
manipulating the states directly.
2010-12-01 11:23:50 +08:00
Chia-I Wu
b730f0fc52 st/vega: Move g3d states to renderer.
Let vg_context focus on OpenVG states and renderer focus on gallium
states.
2010-12-01 11:23:50 +08:00
Chia-I Wu
96c6637a13 st/vega: Use st_framebuffer for fb width/height.
This allows us to eventually make g3d states opaque.
2010-12-01 11:23:50 +08:00
Chia-I Wu
438359597c st/vega: Delay fb state update to vg_validate_state.
vg_manager_validate_framebuffer should mark the fb dirty and have
vg_validate_state call cso_set_framebuffer.  Rename VIEWPORT_DIRTY to
FRAMEBUFFER_DIRTY.
2010-12-01 11:23:49 +08:00
Chia-I Wu
3b71cb6ad6 st/vega: Add POLYGON_STENCIL and POLYGON_FILL renderer state.
The states are designated for polygon filling.  Polygon filling is a
two-pass process utilizing the stencil buffer.  polygon_fill and
polygon_array_fill functions are updated to make use of the state.
2010-12-01 11:23:49 +08:00
Chia-I Wu
b23f732075 st/vega: Use the renderer for vgMask.
vgMask renders to the alpha mask with special fragment shaders.  The
operation can be supported by switching the renderer to FILTER state.
2010-12-01 11:23:49 +08:00
Chia-I Wu
e5968a5355 st/vega: Add FILTER renderer state for image filtering.
The state is designated to perform image filtering.  execute_filter is
updated to make use of the state.
2010-12-01 11:23:49 +08:00
Chia-I Wu
6b241f532a st/vega: Add CLEAR renderer state for vgClear.
This state provides the ability to clear rectangles of the framebuffer
to the specified color, honoring scissoring.  vegaClear is updated to
make use of the state.
2010-12-01 11:23:49 +08:00
Chia-I Wu
54cb382ea5 st/vega: Add SCISSOR renderer state.
The state can be used to set rectangles of the depth buffer to 0.0f.
update_clip_state is changed to use the state for scissor update.
2010-12-01 11:23:49 +08:00
Chia-I Wu
e31a04ea3b st/vega: Add DRAWTEX renderer state.
This state provides glDrawTex-like function.  It can be used for
vgSetPixels.

Rather than modifying every user of the renderer, this commit instead
modifies renderer_copy_surface to use DRAWTEX or COPY state internally
depending on whether the destination is the framebuffer.
2010-12-01 11:23:48 +08:00
Chia-I Wu
59309337e4 st/vega: Overhaul renderer with renderer states.
Renderer states are high-level states to perform specific tasks.  The
renderer is initially in INIT state.  In that state, the renderer is
used for OpenVG pipeline.

This commit adds a new COPY state to the renderer.  The state is used
for copying between two pipe resources using textured drawing.  It can
be used for vgCopyImage, for example.

Rather than modifying every user of the renderer, this commit instead
modifies renderer_copy_texture to use the COPY state internally.
2010-12-01 11:23:48 +08:00
Chia-I Wu
709e57ae4f llvmpipe: Fix build errors on x86.
The errors were introduced by
efc82aef35.
2010-12-01 11:23:48 +08:00
Kristian Høgsberg
7db49853f0 docs: Fix MESA_drm_image typo 2010-11-30 21:14:50 -05:00
Brian Paul
efc82aef35 gallivm/llvmpipe: squash merge of the llvm-context branch
This branch defines a gallivm_state structure which contains the
LLVMBuilderRef, LLVMContextRef, etc.  All data structures built with
this object can be periodically freed during a "garbage collection"
operation.

The gallivm_state object has to be passed to most of the builder
functions where LLVMBuilderRef used to be used.

Conflicts:
	src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c
	src/gallium/drivers/llvmpipe/lp_state_setup.c
2010-11-30 16:35:12 -07:00
Marek Olšák
1f1375d4d8 r300g: fix texture border color once again
I made the texwrap test be more thorough and realized that this driver code
had not been quite right. This commit fixes the border color for depth
textures, compressed textures, and 16-bits-per-channel textures
with up to 2 channels (R16, RG16).

NOTE: This is a candidate for the 7.9 branch.
2010-11-30 23:31:16 +01:00
Kenneth Graunke
2da02e75b1 glsl/linker: Free any IR discarded by optimization passes.
Previously, IR for a linked shader was allocated directly out of the
gl_shader object - meaning all of it lived as long as the shader.

Now, IR is allocated out of a temporary context, and any -live- IR is
reparented/stolen to (effectively) the gl_shader.  Any remaining IR can
be freed.

NOTE: This is a candidate for the 7.9 branch.
2010-11-30 13:48:28 -08:00
Kenneth Graunke
ff994eeff8 glsl: Remove anti-built-in hacks from the print visitor.
Now that we only import built-in signatures that are actually used,
printing them is reasonable.
2010-11-30 13:48:28 -08:00
Kenneth Graunke
f5692f452f glsl: Lazily import built-in function prototypes.
This makes a very simple 1.30 shader go from 196k of memory to 9k.

NOTE: This -may- be a candidate for the 7.9 branch, as the benefit is
substantial.  However, it's not a simple change, so it may be wiser to
wait for 7.10.
2010-11-30 13:48:28 -08:00
Kenneth Graunke
01a25bb64e glsl: Refactor out cloning of function prototypes.
This allows us to reuse some code and will be useful later.
2010-11-30 13:48:28 -08:00
Aras Pranckevicius
4ce084c707 glsl: fix matrix type check in ir_algebraic
Fixes glsl-mat-mul-1.
2010-11-30 13:32:00 -08:00
Eric Anholt
d56c97413e glsl: Quiet unreachable no-return-from-function warning. 2010-11-30 13:29:28 -08:00
Zack Rusin
b22d65e9fc scons: add alias for identity 2010-11-30 16:13:11 -05:00
Eric Anholt
ff79633d9f glsl: Fix structure and array comparisions.
We were trying to emit a single ir_expression to compare the whole
thing.  The backends (ir_to_mesa.cpp and brw_fs.cpp so far) expected
ir_binop_any_nequal or ir_binop_all_equal to apply to at most a vector
(with matrices broken down by the lowering pass).  Break them down to
a bunch of ORed or ANDed any_nequals/all_equals.

Fixes:
glsl-array-compare
glsl-array-compare-02
glsl-fs-struct-equal
glsl-fs-struct-notequal
Bug #31909
2010-11-30 11:42:42 -08:00
Eric Anholt
6b937465d4 glsl: Add a helper constructor for expressions that works out result type.
This doesn't cover all expressions or all operand types, but it will
complain if you overreach and it allows for much greater slack on the
programmer's part.
2010-11-30 11:23:24 -08:00
Keith Whitwell
68a4f63247 llvmpipe: shortcircuit some calls to set_scene_state 2010-11-30 12:01:29 +00:00
Keith Whitwell
d9169364d4 llvmpipe: remove misleading debug string 2010-11-30 12:01:29 +00:00
Keith Whitwell
2d31f048ce llvmpipe: raise dirty flag on transfers to bound constbuf
Need this to trigger the scene to update its shadow of the constant
state.
2010-11-30 12:01:29 +00:00
José Fonseca
31aeac5bf9 wgl: More complete WGL_ARB_pbuffer support. 2010-11-30 10:49:08 +00:00
José Fonseca
c4a43873c5 wgl: Stub WGL_ARB_pbuffer support.
See http://www.opengl.org/registry/specs/ARB/wgl_pbuffer.txt
2010-11-30 10:47:49 +00:00
José Fonseca
af6407a500 scons: Alias for svga 2010-11-30 10:47:26 +00:00
José Fonseca
7bbf675b88 svga: Use consistent hexadecimal representation on debug output. 2010-11-30 10:45:31 +00:00
Marek Olšák
80f24c1575 util: rename u_mempool -> u_slab 2010-11-30 10:12:26 +01:00
Zack Rusin
5572805423 gallivm: fix storing of the addr register
we store into the index specified by the register index, not an
indirect register.
2010-11-30 02:01:43 -05:00
Eric Anholt
001eee52d4 glsl: Make the symbol table's add_variable just use the variable's name. 2010-11-29 17:08:27 -08:00
Eric Anholt
e8f5ebf313 glsl: Make the symbol table's add_function just use the function's name. 2010-11-29 17:08:27 -08:00
Eric Anholt
2927b6c212 i965: Fix type of gl_FragData[] dereference for FB write.
Fixes glsl-fs-fragdata-1, and hopefully Eve Online where I noticed
this bug in the generated shader.  Bug #31952.
2010-11-29 17:08:26 -08:00
Adam Jackson
1ccef926be drivers/x11: unifdef XFree86Server
This code was for the old GLcore build of the software rasteriser.  The
X server switched to a DRI driver for software indirect GLX long ago.

Signed-off-by: Adam Jackson <ajax@redhat.com>
2010-11-29 17:37:54 -05:00
Marek Olšák
e5aa69f6a6 st/mesa: fix texture border color for RED and RG base formats
The spec says the border color should be consistent with the internal
format.

Signed-off-by: Brian Paul <brianp@vmware.com>
2010-11-29 17:26:40 +01:00
pontus lidman
b1097607db mesa: check for posix_memalign() errors
Signed-off-by: Brian Paul <brianp@vmware.com>
2010-11-29 09:20:41 -07:00
Dave Airlie
a7cb673aa1 r600g: it looks like r600 can handle dword offsets in the indices.
Tested with piglit + ut2004 still seems to render okay (and it
definitely does this)
2010-11-29 11:38:24 +10:00
Marek Olšák
5d4d8b6205 u_blitter: interpolate clear color using a GENERIC varying instead of COLOR
There are also some u_simple_shaders changes.

On r300, the TGSI_SEMANTIC_COLOR varying is a fixed-point number clamped
to the range [0,1] and limited to 12 bits of precision. Therefore we can't
use it for passing through a clear color in order to clear high precision
texture formats.

This also makes u_blitter use only one vertex shader instead of two.
2010-11-28 17:45:39 +01:00
Henri Verbeet
c6ea4c0e8a r600g: Fix the PIPE_FORMAT_A8_UNORM color swap for Evergreen as well. 2010-11-27 17:40:47 +01:00
Henri Verbeet
7a4599c6f5 r600g: Fix the PIPE_FORMAT_L8A8_UNORM color swaps. 2010-11-27 17:40:47 +01:00
Mathias Fröhlich
c3602ff5ed st/mesa: Set PIPE_TRANSFER_DISCARD for GL_MAP_INVALIDATE_RANGE/BUFFFER_BIT
Signed-off-by: Brian Paul <brianp@vmware.com>

Note: this is a candidate for the 7.9 branch.
2010-11-26 14:03:42 -07:00
Brian Paul
97ae4dad1c st/mesa: fix mapping of zero-sized buffer objects
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=31934
2010-11-26 13:48:49 -07:00
Thomas Hellstrom
5822484510 xorg/vmwgfx: Don't clip video to viewport
Since the viewport is not updated on RandR12 mode switches anymore,
clipping to viewport may incorrectly clip away the video.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2010-11-26 10:28:01 +01:00
Thomas Hellstrom
28ee7561f9 xorg/vmwgfx: Flush even if we don't autopaint the color key
This may help paint the colorkey before overlay updates in some
situations where the app paints the color key (mainly xine).

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2010-11-26 10:27:54 +01:00
Marek Olšák
e6e6fcd3a6 r300/compiler: move util functions to radeon_compiler_util
The compiler seriously needs a cleanup as far as the arrangement of functions
is concerned. It's hard to know whether some function was implemented or not
because there are so many places to search in and it can be anywhere and
named anyhow.
2010-11-26 02:23:13 +01:00
Marek Olšák
ea2f56b490 r300/compiler: add a function for swizzling a mask 2010-11-26 02:23:13 +01:00
Marek Olšák
7c29446232 r300/compiler: remove duplicate function rc_mask_to_swz 2010-11-26 02:23:13 +01:00
Marek Olšák
ae3e58d973 r300/compiler: fix rc_rewrite_depth_out for it to work with any instruction
It looks like the function was originally written for ARB_fragment_program.

NOTE: This is a candidate for the 7.9 branch.
2010-11-26 02:22:59 +01:00
Marek Olšák
2c1de07ddf u_blitter: use PIPE_TRANSFER_DISCARD to prevent cpu/gpu stall
But the driver must be smart here and follow PIPE_TRANSFER_DISCARD,
as it should.
2010-11-25 20:25:53 +01:00
Xavier Chantry
c14a261eb9 nvfx: reset nvfx->hw_zeta
If nvfx_framebuffer prepare and validate were called successively with
fb->zsbuf not NULL and then NULL, nvfx->hw_zeta would contain garbage and
this would cause failures in nvfx_framebuffer_relocate/OUT_RELOC(hw_zeta).

This was triggered by piglit/texwrap 2D GL_DEPTH_COMPONENT24 and caused
first a 'write to user buffer!!' error in libdrm and then worse things.

Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com>
Signed-off-by: Francisco Jerez <currojerez@riseup.net>
2010-11-25 17:04:29 +01:00
Xavier Chantry
049065cdfa nvfx: fb->nr_cbufs <= 1 on nv30
7e1bf94631 changed
PIPE_CAP_MAX_RENDER_TARGETS to 1 on nv30.

Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com>
Signed-off-by: Francisco Jerez <currojerez@riseup.net>
2010-11-25 17:04:02 +01:00
Kenneth Graunke
1eb7a81f2e glsl: Add a virtual as_discard() method.
NOTE: This is candidate for the 7.9 branch.
2010-11-25 03:26:55 -08:00
Kenneth Graunke
a82592de92 glsl: Use do_common_optimization in the standalone compiler.
NOTE: This is a candidate for the 7.9 branch.
2010-11-25 01:21:05 -08:00
Kenneth Graunke
e8a24c65bc glsl: Don't inline function prototypes.
Currently, the standalone compiler tries to do function inlining before
linking shaders (including linking against the built-in functions).
This resulted in the built-in function _prototypes_ being inlined rather
than the actual function definition.

This is only known to fix a bug in the standalone compiler; most
programs should be unaffected.  Still, it seems like a good idea.

NOTE: This is a candidate for the 7.9 branch.
2010-11-25 01:19:53 -08:00
Vinson Lee
2cc79acc1a r300/compiler: Move declaration before code.
Fixes this GCC warning with linux-x86 build.
radeon_pair_regalloc.c: In function ‘compute_live_intervals’:
radeon_pair_regalloc.c:222: warning: ISO C90 forbids mixed declarations and code
2010-11-24 23:03:26 -08:00
Vinson Lee
995de71550 r300/compiler: Move declaration before code.
Fixes this GCC warning with linux-x86 build.
radeon_pair_regalloc.c: In function ‘compute_live_intervals’:
radeon_pair_regalloc.c:221: warning: ISO C90 forbids mixed declarations and code
2010-11-24 23:00:03 -08:00
Chia-I Wu
ba1128db45 st/vega: Fix a typo in EXTENDED_BLENDER_OVER_FUNC.
The typo was introduced by commit
231d5457b2.
2010-11-25 13:34:24 +08:00
Chia-I Wu
c9fb8c3bcf st/vega: No flipping in vg_prepare_blend_surface.
The blend sampler view is addressed with unnormalized coordinates in the
fragment shader.  It should have the same orientation as the surface
does.
2010-11-25 13:33:59 +08:00
Chia-I Wu
37ec090ac9 st/vega: Masks and surfaces should share orientation.
The alpha mask is addressed with unnormalized coordinates in the
fragment shader.  It should have the same orientation as the surface
does.

This fixes "mask" OpenVG demo.
2010-11-25 13:33:59 +08:00
Chia-I Wu
9ea4936a36 st/vega: Fix a crash with empty paths. 2010-11-25 13:32:03 +08:00
Chia-I Wu
3965051dff auxiliary: util_blit_pixels_tex should restore the viewport.
Viewport state should be saved/restored.
2010-11-25 13:32:03 +08:00
Dave Airlie
3b5a3fd8d1 r300g/r600g: bump cache manager timeouts to 1s
On lightsmark on my r500 this drop the bufmgr allocations of the sysprof.
2010-11-25 09:18:19 +10:00
Kenneth Graunke
1197393faa mesa: Fix glGet of ES2's GL_MAX_*_VECTORS properties.
Previously, the get table listed all three as having custom locations,
yet find_custom_value did not have cases to handle them.

MAX_VARYING_VECTORS does not need a custom location since MaxVaryings is
already stored as float[4] (or vec4).  MaxUniformComponents is stored as
the number of floats, however, so a custom implementation that divides
by 4 is necessary.

Fixes bugs.freedesktop.org #31495.
2010-11-24 14:09:32 -08:00
Peter Clifton
ee88727df8 meta: Mask Stencil.Clear against stencilMax in _mesa_meta_Clear
This fixes incorrect behaviour when the stencil clear value exceeds
the size of the stencil buffer, for example, when set with:

glClearStencil (~1); /* Set a bit pattern of 111...11111110 */
glClear (GL_STENCIL_BUFFER_BIT);

The clear value needs to be masked by the value 2^m - 1, where m is the
number of bits in the stencil buffer. Previously, we passed the value
masked with 0x7fffffff to _mesa_StencilFuncSeparate which then clamps,
NOT masks the value to the range 0 to 2^m - 1.

The result would be clearing the stencil buffer to 0xff, rather than 0xfe.

Signed-off-by: Peter Clifton <pcjc2@cam.ac.uk>
Signed-off-by: Brian Paul <brianp@vmware.com>
2010-11-24 12:14:54 -07:00
Brian Paul
03a4f97a68 x11: remove test_proxy_teximage() function
This was really just for testing purposes.
2010-11-24 12:11:23 -07:00
Brian Paul
74c324fdba mesa: added _mesa_format_image_size64() 2010-11-24 12:11:23 -07:00
Brian Paul
7bfbd88d2c mesa: add assertion and update comment in _mesa_format_image_size() 2010-11-24 12:11:23 -07:00
Kristian Høgsberg
a889f9ee5c i965: Don't write mrf assignment for pointsize output
https://bugs.freedesktop.org/show_bug.cgi?id=31894
2010-11-24 11:27:43 -05:00
Thomas Hellstrom
f20a219e9e gallium/targets/xorg-vmwgfx: Xv fixes
Make sure regions are properly updated and that the colorkey painting is
flushed before we update the HW overlay.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2010-11-24 15:23:10 +01:00
Thomas Hellstrom
0b1c0460a0 st/xorg: Add a function to flush pending rendering and damage
This is needed to properly sync with host side rendering. For example,
make sure we flush colorkey painting before updating the overlay.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2010-11-24 15:23:10 +01:00
Chia-I Wu
1f4c55128b egl_dri2: Fix one context, multiple surfaces.
When a context was made current to another surface, the old code did
this

  dri2_dpy->core->bindContext(cctx, ddraw, rdraw);
  dri2_dpy->core->unbindContext(old_cctx);

and there will be no current context due to the second line.

unbindContext should be called only when bindContext is not.  This fixes
a regression since d19afc57.  Thanks to Neil Roberts for noticing the
issue and creating a test case.
2010-11-24 14:06:30 +08:00
Ian Romanick
78a340fd48 i915: Disallow alpha, red, RG, and sRGB as render targets
Fixes bugzilla #31832

NOTE: This is a candidate for the 7.9 branch.
2010-11-23 18:42:04 -08:00
Brian Paul
903ead0b26 glsl: start restoring some geometry shader code 2010-11-23 17:23:42 -07:00
Brian Paul
6162773ea4 glsl: better handling of linker failures
Upon link error, exit translation loop, free program instructions.
Check for null pointers in calling code.
2010-11-23 17:18:48 -07:00
Brian Paul
2900e56f9d mesa: use gl_shader_type enum 2010-11-23 17:00:08 -07:00
Brian Paul
c628fd743e mesa: replace #defines with new gl_shader_type enum 2010-11-23 15:52:43 -07:00
Brian Paul
512f840702 mesa: _mesa_valid_register_index() to validate register indexes 2010-11-23 15:52:43 -07:00
Brian Paul
b8dacaf174 mesa: rename, make _mesa_register_file_name() non-static
Plus remove unused parameter.
2010-11-23 15:52:42 -07:00
Brian Paul
caf974c525 glsl: use gl_register_file in a few places 2010-11-23 15:52:42 -07:00
Brian Paul
50fd99d172 glsl: fix off by one in register index assertion 2010-11-23 15:52:42 -07:00
Alex Deucher
ed8b5fb24e gallium/egl: fix r300 vs r600 loading
Should fix:
https://bugs.freedesktop.org/show_bug.cgi?id=31841
2010-11-23 15:18:31 -05:00
Eric Anholt
df24450bac i965: Use the new embedded compare in SEL on gen6 for VS MIN and MAX opcodes.
Cuts the extra CMP instruction that used to precede SEL.
2010-11-23 09:23:30 -08:00
Eric Anholt
8a7cf99457 i965: Don't upload line smooth params unless we're line smoothing. 2010-11-23 09:23:30 -08:00
Eric Anholt
008fd3779b i965: Don't upload line stipple pattern unless we're stippling. 2010-11-23 09:23:30 -08:00
Eric Anholt
e29e3c32d9 i965: Don't upload polygon stipple unless required. 2010-11-23 09:23:30 -08:00
Eric Anholt
7720bfffa3 i965: Move gen4 blend constant color to the gen4 blending file. 2010-11-23 09:23:29 -08:00
Tilman Sauerbeck
3688301c59 r600g: Removed duplicated call to tgsi_split_literal_constant().
Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
2010-11-23 09:20:54 +01:00
Tom Stellard
4265c2f819 r300/compiler: Don't allow presubtract sources to be remapped twice
https://bugs.freedesktop.org/show_bug.cgi?id=31193

NOTE: This is a candidate for the 7.9 branch.
2010-11-23 00:02:03 -08:00
Mathias Fröhlich
07e0424a17 r600g: Only compare active vertex elements
Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
2010-11-23 08:39:43 +01:00
Vinson Lee
f44d96e1af mesa: Clean up header file inclusion in syncobj.h. 2010-11-22 21:51:49 -08:00
Vinson Lee
37195b7f70 llvmpipe: Remove unnecessary headers. 2010-11-22 21:39:14 -08:00
Xiang, Haihao
93102b4cd8 mesa: fix regression from b4bb668020
Pending commands to the previous context aren't flushed since commit b4bb668

Reported-by: Oleksiy Krivoshey <oleksiyk@gmail.com>
Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
2010-11-23 08:59:44 +08:00
Alex Deucher
cb7a36b651 r600c: fix VC flush on cedar and palm 2010-11-22 19:27:58 -05:00
Alex Deucher
0e4c5f63b9 r600g: add support for ontario APUs
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2010-11-22 18:01:26 -05:00
Alex Deucher
072f2cbf29 r600c: add Ontario Fusion APU support
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2010-11-22 18:01:25 -05:00
Mathias Fröhlich
8d1ad3b21c r300g: Avoid returning values in a static array, fixing a potential race
(Marek: added the initializion of "vec" in the default statement)

NOTE: This is a candidate for the 7.9 branch.

Signed-off-by: Marek Olšák <maraeo@gmail.com>
2010-11-22 23:56:41 +01:00
Alex Deucher
271b7b5914 r600g: fix some winsys functions to deal properly with evergreen
Are these functions actually used anywhere?
2010-11-22 17:39:54 -05:00
Alex Deucher
bf9c80976f r600g: fix additional EVENT_WRITE packet
Add explicit EVENT_TYPE field
2010-11-22 17:39:16 -05:00
Marek Olšák
e7c74a7dfa st/mesa: set MaxUniformComponents
Signed-off-by: Brian Paul <brianp@vmware.com>
2010-11-22 21:44:35 +01:00
Brian Paul
6a0255122a swrast: init alpha value to 1.0 in opt_sample_rgb_2d() 2010-11-22 09:04:13 -07:00
Marek Olšák
9aa089eac0 gallium: add PIPE_SHADER_CAP_SUBROUTINES
This fixes piglit/glsl-vs-main-return and glsl-fs-main-return for the drivers
which don't support RET (i915g, r300g, r600g, svga).

ir_to_mesa does not currently generate subroutines, but it's a matter of time
till it's added. It would then break all the drivers which don't implement
them, so this CAP makes sense.

Signed-off-by: Marek Olšák <maraeo@gmail.com>
2010-11-22 12:41:22 +01:00
Keith Whitwell
b2ddb93ff3 Merge branch 'lp-offset-twoside' 2010-11-22 10:36:01 +00:00
Dave Airlie
d5aadf0d80 r600g: pick correct color swap for A8 fbos.
This fixes fdo bug 31810.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-11-22 16:05:44 +10:00
Tom Stellard
1b6ed80972 r300/compiler: Add a more efficient version of rc_find_free_temporary() 2010-11-21 18:48:31 -08:00
Tom Stellard
8833f53e65 r300/compiler: Enable rename_reg pass for r500 cards
In addition, the rename_reg pass has been rewritten to use
rc_get_readers().
2010-11-21 18:48:31 -08:00
Tom Stellard
bbe49bc585 r300/compiler: Use presubtract operations as much as possible
Previously, presubtract operations where only being used by instructions
with less than three source source registers.
2010-11-21 18:48:31 -08:00
Tom Stellard
ddceededf8 r300/compiler: Convert RGB to alpha in the scheduler 2010-11-21 18:48:31 -08:00
Tom Stellard
681f56af80 r300/compiler: Track readers through branches in rc_get_readers() 2010-11-21 18:48:31 -08:00
Tom Stellard
255860113f r300/compiler: Handle BREAK and CONTINUE in rc_get_readers() 2010-11-21 18:48:31 -08:00
Tom Stellard
96f9580160 r300/compiler: Add rc_get_readers() 2010-11-21 18:48:31 -08:00
Tom Stellard
23f577dbd4 r300/compiler: Ignore alpha dest register when replicating the result
When the result of the alpha instruction is being replicated to the RGB
destination register, we do not need to use alpha's destination register.
This fixes an invalid "Too many hardware temporaries used" error in
the case where a transcendent operation writes to a temporary register
greater than max_temp_regs.

NOTE: This is a candidate for the 7.9 branch.
2010-11-21 18:48:31 -08:00
Tom Stellard
d668659003 r300/compiler: Use zero as the register index for unused sources
This fixes an invalid "Too many hardware temporaries used" error in the
case where a source reads from a temporary register with an index greater
than max_temp_regs and then the source is marked as unused before the
register allocation pass.

NOTE: This is a candidate for the 7.9 branch.
2010-11-21 18:48:31 -08:00
Tom Stellard
3e5f9789d6 r300/compiler: Fix instruction scheduling within IF blocks
Reads of registers that where not written to within the same block were
not being tracked.  So in a situations like this:
0: IF
1: ADD t0, t1, t2
2: MOV t2, t1

Instruction 2 didn't know that instruction 1 read from t2, so
in some cases instruction 2 was being scheduled before instruction 1.

NOTE: This is a candidate for the 7.9 branch.
2010-11-21 18:48:31 -08:00
Tom Stellard
e2301b45c2 r300/compiler: Fix register allocator's handling of loops
NOTE: This is a candidate for the 7.9 branch.
2010-11-21 18:48:31 -08:00
Tom Stellard
412803b5cd r300/compiler: Make sure presubtract sources use supported swizzles
NOTE: This is a candidate for the 7.9 branch.
2010-11-21 18:48:31 -08:00
Vinson Lee
9d08902457 r600: Remove unnecessary header. 2010-11-21 15:03:27 -08:00
Marek Olšák
2892c8bdbc docs: add GL 4.1 status 2010-11-21 23:03:58 +01:00
Marek Olšák
e40a58b7f8 st/mesa: enable ARB_explicit_attrib_location and EXT_separate_shader_objects
Gallium drivers pass all piglit tests for the two (there are 12 tests
for separate_shader_objects and 5 tests for explicit_attrib_location),
and I was told the extensions don't need any driver-specific code.

I made them dependent on PIPE_CAP_GLSL.

Signed-off-by: Brian Paul <brianp@vmware.com>
2010-11-21 19:33:45 +01:00
Brian Paul
5e3733fadf mesa: fix get_texture_dimensions() for texture array targets
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=31779
2010-11-21 10:05:51 -07:00
Brian Paul
0ec0f1025d docs: update some GL 3.0 status 2010-11-21 09:40:28 -07:00
Brian Paul
5ed51e950f mesa: hook up GL 3.x entrypoints
Fix up some details in the xml files and regenerate dispatch files.
2010-11-21 09:20:44 -07:00
Brian Paul
81c347ef79 glapi: rename GL3.xml to GL3x.xml as it covers all GL 3.x versions 2010-11-21 09:20:43 -07:00
Brian Paul
197b1d7898 mesa: fix error msg typo 2010-11-21 09:20:43 -07:00
Daniel Vetter
c8fca58d9d i915g: kill idws->pool
The drm winsys only ever handles one gem memory manager. Rip out
the unnecessary complication.

Reviewed-by: Jakob Bornecrantz <wallbraker@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Jakob Bornecrantz <wallbraker@gmail.com>
2010-11-21 16:41:19 +01:00
Daniel Vetter
e182618853 i915g: kill buf->map_gtt
Not using the gtt is considered harmful for performance. And for
partial uploads there's always drm_intel_bo_subdata.

Reviewed-by: Jakob Bornecrantz <wallbraker@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Jakob Bornecrantz <wallbraker@gmail.com>
2010-11-21 16:41:19 +01:00
Daniel Vetter
d54d67499c i915g: kill RGBA/X formats
It's intel, so always little endian!

Reviewed-by: Jakob Bornecrantz <wallbraker@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Jakob Bornecrantz <wallbraker@gmail.com>
2010-11-21 16:41:19 +01:00
Daniel Vetter
8624fe7a49 i915g: add pineview pci ids
Reviewed-by: Jakob Bornecrantz <wallbraker@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Jakob Bornecrantz <wallbraker@gmail.com>
2010-11-21 16:41:19 +01:00
Daniel Vetter
aba728eb25 i915g: s/hw_tiled/tiling
More in line with other intel drivers.

Change to use enum by Jakob Bornecrantz.

Reviewed-by: Jakob Bornecrantz <wallbraker@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Jakob Bornecrantz <wallbraker@gmail.com>
2010-11-21 16:41:18 +01:00
Daniel Vetter
f77a2690b4 i915g: rip out ->sw_tiled
It looks like this was meant to facilitate unfenced access to textures/
color/renderbuffers. It's totally incomplete and fundamentally broken
on a few levels:
- broken: The kernel needs to about every tiled bo to fix up bit17
  swizzling on swap-in.
- unflexible: fenced/unfenced relocs from execbuffer2 do the same, much
  simpler.
- unneeded: with relaxed fencing tiled gem bos are as memory-efficient
  as this trick.

Hence kill it.

Reviewed-by: Jakob Bornecrantz <wallbraker@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Jakob Bornecrantz <wallbraker@gmail.com>
2010-11-21 16:41:18 +01:00
Joakim Sindholt
bf10055cff r300g: silence guard band cap errors
Somebody should find out what these are. It can be found on Windows
getting a D3DCAPS9 from IDirect3D9::GetCaps() and reading the
GuardBand* values.
2010-11-21 15:45:20 +01:00
Chia-I Wu
b8f6cb3809 st/vega: Fix vgReadPixels with a subrectangle.
Fix a crash when the subrectangle is not inside the fb.  Fix wrong
pipe transfer when sx > 0 or sy + height != fb->height.

This fixes "readpixels" demo.
2010-11-21 19:32:22 +08:00
Chia-I Wu
e8bbaff22e st/vega: Set wrap_r for mask and blend samplers.
These two samplers use non-normalized texture coordinates.  wrap_r
cannot be PIPE_TEX_WRAP_REPEAT (the default).

This fixes

  sp_tex_sample.c:1790:get_linear_unorm_wrap: Assertion `0' failed

assertion failure.
2010-11-21 19:32:10 +08:00
Chia-I Wu
daa265e53c st/vega: vegaLookupSingle should validate the state.
Fix "lookup" demo crash.
2010-11-21 19:26:33 +08:00
Chia-I Wu
f90524a01b tgsi: Add STENCIL to text parser.
Fix OpenVG "filter" demo

  Program received signal SIGSEGV, Segmentation fault.
  0xb7153dc9 in str_match_no_case (pcur=0xbfffe564, str=0x0) at
  tgsi/tgsi_text.c:86
  86         while (*str != '\0' && *str == uprcase( *cur )) {
2010-11-21 19:26:29 +08:00
Vinson Lee
8bea7776a3 mesa: Clean up header file inclusion in stencil.h. 2010-11-20 22:44:33 -08:00
Vinson Lee
9732a93f40 mesa: Clean up header file inclusion in shared.h. 2010-11-20 22:30:27 -08:00
Vinson Lee
20f041952c mesa: Clean up header file inclusion in shaderapi.h. 2010-11-20 22:17:28 -08:00
Vinson Lee
baa0471597 mesa: Clean up header file inclusion in scissor.h. 2010-11-20 22:01:30 -08:00
Vinson Lee
27e96655c7 mesa: Clean up header file inclusion in renderbuffer.h. 2010-11-20 21:32:07 -08:00
Vinson Lee
b6215d18b5 mesa: Clean up header file inclusion in readpix.h. 2010-11-20 21:23:35 -08:00
Vinson Lee
bab188d22f mesa: Clean up header file inclusion in rastpos.h. 2010-11-20 21:14:06 -08:00
Vinson Lee
9b66305b8d mesa: Clean up header file inclusion in polygon.h. 2010-11-20 21:06:09 -08:00
Vinson Lee
f5cbe04b69 intel: Remove unnecessary header. 2010-11-20 20:13:50 -08:00
Vinson Lee
84f5229119 r600: Remove unnecesary header. 2010-11-20 19:04:30 -08:00
Vinson Lee
b59f3dd8ca swrast: Remove unnecessary header. 2010-11-20 19:00:18 -08:00
Vinson Lee
1310806872 st/mesa: Remove unnecessary headers. 2010-11-20 18:48:09 -08:00
Chia-I Wu
bb045d339b scons: Define IN_DRI_DRIVER.
The define is required for DRI drivers.  It is not needed for
libgl-xlib, but the overhead it introduces should be minor.
2010-11-20 17:47:11 -08:00
Xavier Chantry
7e1bf94631 nvfx: only expose one rt on nv30
We do not know how to use more, GL_ARB_draw_buffers is not exposed on blob.
2010-11-20 23:29:12 +01:00
Owen W. Taylor
c63a86e1e5 r600g: Fix location for clip plane registers
The stride between the different clip plane registers was incorrect.

https://bugs.freedesktop.org/show_bug.cgi?id=31788

agd5f: fix evergreen as well.
2010-11-20 12:18:56 -05:00
Marek Olšák
ffb732d8bd r300g: fix rendering with no vertex elements
Fixes glsl-vs-point-size, although I meant to fix glsl-novertexdata.
Since swrast fails glsl-novertexdata too, I guess it's a core issue.
2010-11-20 16:20:48 +01:00
Eric Anholt
b6b91fa029 i965: Remove duplicate MRF writes in the FS backend.
This is quite common for multitexture sampling, and not only cuts down
on the second and later set of MOVs, but typically also allows
compute-to-MRF on the first set.

No statistically siginficant performance difference in nexuiz (n=3),
but it reduces instruction count in one of its shaders and seems like
a good idea.
2010-11-19 20:05:56 -08:00
Eric Anholt
47b1aac1cf i965: Improve compute-to-mrf.
We were skipping it if the instruction producing the value we were
going to compute-to-mrf used its result reg as a source reg.  This
meant that the typical "write interpolated color to fragment color" or
"texture from interpolated texcoord" shader didn't compute-to-MRF.
Just don't check for the interference cases until after we've checked
if this is the instruction we wanted to compute-to-MRF.

Improves nexuiz high-settings performance on my laptop 0.48% +- 0.08%
(n=3).
2010-11-19 19:54:11 -08:00
Eric Anholt
ac89a90401 ir_to_mesa: Detect and emit MOV_SATs for saturate constructs.
The goal here is to avoid regressing performance on ir_to_mesa drivers
for fixed function fragment shaders requiring saturates.
2010-11-19 19:09:32 -08:00
Eric Anholt
19631fab35 i965: Recognize saturates and turn them into a saturated mov.
On pre-gen6, this turns 4 instructions into 1.  We could still do
better by folding the saturate into the instruction generating the
value if nobody else uses it, but that should be a separate pass.
2010-11-19 19:09:31 -08:00
Eric Anholt
02939d643f glsl: Add a helper function for determining if an rvalue could be a saturate.
Hardware pretty commonly has saturate modifiers on instructions, and
this can be used in codegen to produce those, without everyone else
needing to understand clamping other than min and max.
2010-11-19 19:09:18 -08:00
Eric Anholt
602ae2441a i965: Fold constants into the second arg of BRW_SEL as well.
This hits a common case with min/max operations.
2010-11-19 17:42:07 -08:00
Eric Anholt
f9b420d3bd i965: Remove extra \n at the end of every instruction in INTEL_DEBUG=wm. 2010-11-19 17:42:07 -08:00
Eric Anholt
5944cda6ed i965: Just use memset() to clear most members in FS constructors.
This should make it a lot harder to forget to zero things.
2010-11-19 17:42:07 -08:00
Eric Anholt
61126278a3 i965: Fix compute_to_mrf to not move a MRF write up into another live range.
Fixes glsl-fs-copy-propagation-texcoords-1.
2010-11-19 17:42:06 -08:00
Eric Anholt
6b1d7dd781 mesa: Include C++ files in the makedepend of DRI drivers. 2010-11-19 17:42:06 -08:00
Vinson Lee
a172368ef1 glsl: Fix type of label 'default' in switch statement. 2010-11-19 17:28:22 -08:00
Vinson Lee
7aebe181f3 glsl: Add lower_vector.cpp to SConscript. 2010-11-19 17:23:07 -08:00
Ian Romanick
bb756bb0a6 glsl: Fix matrix constructors with vector parameters
When the semantics of write masks in assignments were changed, this
code was not correctly updated.

Fixes piglit test glsl-mat-from-vec-ctor-01.
2010-11-19 17:17:25 -08:00
Kenneth Graunke
63684a9ae7 glsl: Combine many instruction lowering passes into one.
This should save on the overhead of tree-walking and provide a
convenient place to add more instruction lowering in the future.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2010-11-19 15:56:28 -08:00
Kenneth Graunke
b943fb94bf glsl: Simplify a type check by using type->is_integer(). 2010-11-19 15:06:58 -08:00
Ian Romanick
11d6f1c698 glsl: Add ir_quadop_vector expression
The vector operator collects 2, 3, or 4 scalar components into a
vector.  Doing this has several advantages.  First, it will make
ud-chain tracking for components of vectors much easier.  Second, a
later optimization pass could collect scalars into vectors to allow
generation of SWZ instructions (or similar as operands to other
instructions on R200 and i915).  It also enables an easy way to
generate IR for SWZ instructions in the ARB_vertex_program assembler.
2010-11-19 15:00:26 -08:00
Ian Romanick
13f57d42b6 glsl: Add unary ir_expression constructor 2010-11-19 15:00:25 -08:00
Ian Romanick
8e498050dc glsl: Add ir_rvalue::is_negative_one predicate 2010-11-19 15:00:25 -08:00
Ian Romanick
fc92e87b97 glsl: Eliminate assumptions about size of ir_expression::operands
This may grow in the near future.
2010-11-19 15:00:25 -08:00
Ian Romanick
f2616e56de glsl: Add ir_unop_sin_reduced and ir_unop_cos_reduced
The operate just like ir_unop_sin and ir_unop_cos except that they
expect their inputs to be limited to the range [-pi, pi].  Several
GPUs require this limited range for their sine and cosine
instructions, so having these as operations (along with a to-be-written
lowering pass) helps this architectures.

These new operations also matche the semantics of the
GL_ARB_fragment_program SCS instruction.  Having these as operations
helps in generating GLSL IR directly from assembly fragment programs.
2010-11-19 15:00:25 -08:00
Alex Deucher
04ffbe1ac6 r600g: use full range of VS resources for vertex samplers
Now that we have fetch shaders, the full range of VS resources
can be used for sampling.
2010-11-19 15:51:24 -05:00
Alex Deucher
4afd068385 r600g: use meaningful defines for chiprev
Makes the code much clearer.
2010-11-19 15:32:02 -05:00
Alex Deucher
52c66120d8 r600g: translate ARR instruction for evergreen
evergreen variant of:
9f7ec103e2
2010-11-19 15:20:59 -05:00
Jerome Glisse
f609b2ab03 r600g: add fetch shader capabilities
Use fetch shader instead of having fetch instruction in the vertex
shader. Allow to restrict shader update to a smaller part when
vertex buffer input layout changes.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-11-19 13:40:55 -05:00
Alex Deucher
3e76ed4e25 r600g: All EVENT_WRITE packets need the EVENT_INDEX field
6xx-evergreen
2010-11-19 13:35:53 -05:00
Viktor Novotný
af17d89966 dri/nouveau: Clean up magic numbers in get_rt_format
Signed-off-by: Viktor Novotný <noviktor@seznam.cz>
Signed-off-by: Francisco Jerez <currojerez@riseup.net>
2010-11-19 19:04:50 +01:00
Jerome Glisse
fab804bdfe r600g: fix occlusion query on evergreen (avoid lockup)
Occlusion query on evergreen need the event index field to be
set otherwise we endup locking up the GPU.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-11-19 11:53:01 -05:00
Keith Whitwell
546c5ffa11 llvmpipe: twoside for specular color also 2010-11-19 16:17:36 +00:00
Keith Whitwell
081ce2680e llvmpipe: fix up twoside after recent changes
Fix my slot/attr confusion.
2010-11-19 16:16:30 +00:00
Hui Qi Tay
d4b5cf6c05 llvmpipe: fix such that offset/twoside function only does in-place modification 2010-11-19 15:12:19 +00:00
Ian Romanick
c05ccc1ebd ir_to_mesa: Generate smarter code for some conditional moves
Condiation moves with a condition of (a < 0), (a > 0), (a <= 0), or (a
>= 0) can be generated with "a" directly as an operand of the CMP
instruction.  This doesn't help much now, but it will help with
assembly shaders that use the CMP instruction.
2010-11-18 18:19:45 -08:00
Ian Romanick
ad87f2ddc7 glsl: Make is_zero and is_one virtual methods of ir_rvalue
This eliminates the need in some cames to validate that an rvalue is
an ir_constant before checking to see if it's 0 or 1.
2010-11-18 18:19:45 -08:00
Brian Paul
83e93b6008 mesa: pass gl_format to _mesa_init_teximage_fields()
This should prevent the field going unset in the future.  See bug
http://bugs.freedesktop.org/show_bug.cgi?id=31544 for background.

Also remove unneeded calls to clear_teximage_fields().

Finally, call _mesa_set_fetch_functions() from the
_mesa_init_teximage_fields() function so callers have one less
thing to worry about.
2010-11-18 16:15:38 -07:00
José Fonseca
3dcc3153b0 scons: Use inline wrap helpers more consistently. 2010-11-18 13:02:36 +00:00
Dave Airlie
185d862cd8 gallium/noop: report GL 2.1
this should at least make app use the same paths as they would for a real
driver.
2010-11-18 18:11:27 +10:00
Vinson Lee
855c66bde7 glsl: Fix 'control reaches end of non-void function' warning.
Fix this GCC warning.
ir.cpp: In static member function
'static unsigned int ir_expression::get_num_operands(ir_expression_operation)':
ir.cpp:199: warning: control reaches end of non-void function
2010-11-17 22:43:52 -08:00
Chia-I Wu
ca9f99d9c5 mesa: Clean up core.h.
Remove version.h and context.h from core.h.
2010-11-18 11:56:01 +08:00
Chia-I Wu
997a2547d1 st/glx: Replace MESA_VERSION_STRING by xmesa_get_name.
xmesa_get_name returns the name of the st_api, which is the same as
MESA_VERSION_STRING.
2010-11-18 11:56:01 +08:00
Chia-I Wu
db1689c236 st/wgl: Use st_context_iface::share for DrvShareLists. 2010-11-18 11:56:01 +08:00
Chia-I Wu
4f38dcd974 gallium: Add st_context_iface::share to st_api.
It will be used to implement wglShareLists.  Fill st_context_iface::copy
for glXCopyContext as well.
2010-11-18 11:56:00 +08:00
Chia-I Wu
28105471af gallium: Add st_api::name.
It is the name of the rendering API.  This field is informative.
2010-11-18 11:56:00 +08:00
Chia-I Wu
cc5c908d7d st/vega: Do not wait NULL fences. 2010-11-18 11:56:00 +08:00
Eric Anholt
50b4508319 i965: Eliminate dead code more aggressively.
If an instruction writes reg but nothing later uses it, then we don't
need to bother doing it.  Before, we were just killing code that was
never read after it was ever written.

This removes many interpolation instructions for attributes with only
a few comopnents used.  Improves nexuiz high-settings performance .46%
+/- .12% (n=3) on my Ironlake.
2010-11-18 11:16:14 +08:00
Brian Paul
48af60b465 mesa: upgrade to glext.h version 66
The type of the num/count parameter to glProgramParameters4[df]vNV()
changed so some API dispatch code needed updates too.
2010-11-17 20:04:45 -07:00
Alex Deucher
a23f25eba1 r600g: fix buffer alignment
This should fix the remaining buffer alignment issues in r600g.
2010-11-17 21:33:40 -05:00
Eric Anholt
da35388044 i965: Fail on loops on gen6 for now until we write the EU emit code for it. 2010-11-18 09:18:47 +08:00
Eric Anholt
3c8db58a17 i965: Add dumping of the sampler default color. 2010-11-18 09:18:47 +08:00
Eric Anholt
95addca019 i965: Add state dumping for sampler state. 2010-11-18 09:18:47 +08:00
Eric Anholt
03ff02d08b mesa: Don't spam the console in a debug build unless some spam is requested.
It's annoying to use test suites under a Mesa debug build because
pretty output is cluttered with stderr's continuous reports that
you're still using the debug driver.
2010-11-18 09:18:47 +08:00
Eric Anholt
d512cbf58f i965: Shut up spurious gcc warning about GLSL_TYPE enums. 2010-11-18 09:18:47 +08:00
Jakob Bornecrantz
e89e8a4347 gallium: Remove redundant sw and debug target helpers 2010-11-17 23:49:09 +00:00
Jakob Bornecrantz
b46340c740 graw: Use inline debug helper instead of non-inline version 2010-11-17 23:49:09 +00:00
Jakob Bornecrantz
c30656d8c2 libgl-xlib: Use inline debug helper instead of non-inline version 2010-11-17 23:49:08 +00:00
Chad Versace
7819435f2e glsl: Improve usage message for glsl_compiler
The new usage message lists possible command line options. (Newcomers to Mesa
currently have to trawl through the source to find the command line options,
and we should save them from that trouble.)

Example Output
--------------
usage: ./glsl_compiler [options] <file.vert | file.geom | file.frag>

Possible options are:
    --glsl-es
    --dump-ast
    --dump-hir
    --dump-lir
    --link
2010-11-17 15:44:41 -08:00
Kenneth Graunke
007f488150 glsl: Refactor get_num_operands.
This adds sentinel values to the ir_expression_operation enum type:
ir_last_unop, ir_last_binop, and ir_last_opcode.  They are set to the
previous one so they don't trigger "unhandled case in switch statement"
warnings, but should never be handled directly.

This allows us to remove the huge array of 1s and 2s in
ir_expression::get_num_operands().
2010-11-17 15:44:41 -08:00
Jerome Glisse
7ffd4e976f r600g: code cleanup (indent, trailing space, empty line ...)
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-11-17 17:22:08 -05:00
Kenneth Graunke
9935fe705d glsl: Remove the ir_binop_cross opcode. 2010-11-17 13:59:17 -08:00
Kenneth Graunke
af1cba2260 Refresh autogenerated file builtin_function.cpp. 2010-11-17 13:37:16 -08:00
Kenneth Graunke
671ccf593e glsl: Reimplement the "cross" built-in without ir_binop_cross.
We are not aware of any GPU that actually implements the cross product
as a single instruction.  Hence, there's no need for it to be an opcode.
Future commits will remove it entirely.
2010-11-17 13:20:30 -08:00
Kenneth Graunke
302fe4049c Regenerate glcpp parser. 2010-11-17 12:53:07 -08:00
Kenneth Graunke
d719bf8fb4 glsl: Unconditionally define GL_FRAGMENT_PRECISION_HIGH in ES2 shaders.
This is really supposed to be defined only if the driver supports highp
in the fragment shader - but all of our current ES2 implementations do.
So, just define it.  In the future, we'll need to add a flag to
gl_context and only define the macro if the flag is set.

"Fixes" freedesktop.org bug #31673.
2010-11-17 12:50:35 -08:00
Robert Hooker
778917069c egl_dri2: Add missing intel chip ids.
Signed-off-by: Robert Hooker <robert.hooker@canonical.com>
2010-11-17 12:10:53 -08:00
Chad Versace
df883eb157 glsl: Fix Doxygen tag \file in recently renamed files 2010-11-17 12:07:24 -08:00
Chad Versace
b4cdba687c glsl: Fix erroneous cast in ast_jump_statement::hir()
Return values were erroneously cast from (ir_rvalue*) to (ir_expression*).

NOTE: This is a candidate for the 7.9 branch.
2010-11-17 11:59:32 -08:00
Kenneth Graunke
e16c9d5d03 glsl: Fix constant expression handling for <, >, <=, >= on vectors.
ir_binop_less, ir_binop_greater, ir_binop_lequal, and ir_binop_gequal
are defined to work on vectors as well as scalars, as long as the two
operands have the same type.

This is evident from both ir_validate.cpp and our use of these opcodes
in the GLSL lessThan, greaterThan, lessThanEqual, greaterThanEqual
built-in functions.

Found by code inspection.  Not known to fix any bugs.  Presumably, our
tests for the built-in comparison functions must pass because C.E.
handling is done on the ir_call of "greaterThan" rather than the inlined
opcode.  The C.E. handling of the built-in function calls is correct.

NOTE: This is a candidate for the 7.9 branch.
2010-11-17 11:58:56 -08:00
Marek Olšák
fb7ae06f59 r300g: print FS inputs uninitialized due to hardware limits to stderr 2010-11-17 19:01:12 +01:00
Alex Deucher
75e52556a8 r600c/evergreen: texture align is group_bytes just like 6xx/7xx
Default group bytes to 512 on evergreen.  Don't query
tiling config yet for evergreen, the current info returned is not
adequate for evergreen (no way to get bank info).
2010-11-17 11:30:52 -05:00
Brian Paul
1d39df42c4 mesa: minor clean-ups in context code 2010-11-16 20:12:34 -07:00
Brian Paul
85288ad722 mesa: reorder texture_error_check() params
To better match other functions.
2010-11-16 20:12:34 -07:00
Brian Paul
3c59febf05 mesa: 80-column wrapping 2010-11-16 20:12:34 -07:00
Brian Paul
76114d23d1 mesa: whitespace cleanups 2010-11-16 20:12:34 -07:00
Brian Paul
78527154bd mesa: fix error messages and minor reindenting 2010-11-16 20:12:34 -07:00
Kenneth Graunke
bee901a1cf Refresh autogenerated glcpp parser. 2010-11-16 16:22:13 -08:00
Kenneth Graunke
3fb83038a0 glcpp: Define GL_FRAGMENT_PRECISION_HIGH if GLSL version >= 1.30.
Per section 4.5.4 of the GLSL 1.30 specification.
2010-11-16 16:22:12 -08:00
Henri Verbeet
6bbe637c13 r600g: Synchronize supported color formats between Evergreen and r600/r700. 2010-11-17 00:41:42 +01:00
Henri Verbeet
7d0f45563d r600g: Swizzle vertex data only once.
Vertex data swizzles are already done in the vertex shader. Doing them twice
breaks BGRA vertex arrays for example.
2010-11-17 00:41:42 +01:00
Marek Olšák
b6e2c32626 r300g: remove the hack with OPCODE_RET
RET was interpreted as END, which was wrong. Instead, if a shader contains RET
in the main function, it will fail to compile with an error message
from now on.

The hack is from early days.
2010-11-16 22:39:27 +01:00
Ian Romanick
2d2d6a80c1 glsl: Simplify generation of swizzle for vector constructors 2010-11-16 12:11:02 -08:00
Ian Romanick
38e55153af glsl: Refactor is_vec_{zero,one} to be methods of ir_constant
These predicates will be used in other places soon.
2010-11-16 12:11:02 -08:00
José Fonseca
4f84a3aa32 libgl-gdi: Allow to pick softpipe/llvmpipe on runtime. 2010-11-16 18:56:39 +00:00
Vinson Lee
063c6b8f74 mesa: Add definitions for inverse hyperbolic function on MSVC. 2010-11-15 22:00:32 -08:00
Vinson Lee
1935bdca44 glsl: Add ir_constant_expression.cpp to SConscript.
This was accidentally removed in commit 32aaf89823.

Fixes SCons builds.
2010-11-15 20:56:11 -08:00
Brian Paul
9b4b70e7e2 glsl: remove opt_constant_expression.cpp from SConscript
And alphabetize the opt_* files.
2010-11-15 18:59:45 -07:00
Brian Paul
c1928c7f10 mesa: add more work-arounds for acoshf(), asinhf(), atahf() 2010-11-15 18:50:58 -07:00
Brian Paul
88f482a839 glsl: fix assorted MSVC warnings 2010-11-15 18:48:43 -07:00
Brian Paul
20c2debce8 st/mesa: fix glDrawPixels(depth/stencil) bugs
When drawing GL_DEPTH_COMPONENT the usual fragment pipeline steps apply
so don't override the depth state.

When drawing GL_STENCIL_INDEX (or GL_DEPTH_STENCIL) the fragment pipeline
does not apply (only the stencil and Z writemasks apply) so disable writes
to the color buffers.

Fixes some regressions from commit ef8bb7ada9
2010-11-15 18:40:32 -07:00
Kenneth Graunke
32aaf89823 glsl: Rename various ir_* files to lower_* and opt_*.
This helps distinguish between lowering passes, optimization passes, and
other compiler code.
2010-11-15 16:34:20 -08:00
Kenneth Graunke
46b80d6469 glsl: Remove unused and out of date Makefile.am.
This was from when glsl2 lived in a separate repository and used
automake.
2010-11-15 14:47:15 -08:00
Kenneth Graunke
3108095198 glsl: Add constant expression handling for asinh, acosh, and atanh. 2010-11-15 14:08:58 -08:00
Kenneth Graunke
91181c7dd4 glsl: Refresh autogenerated file builtin_function.cpp. 2010-11-15 14:02:52 -08:00
Kenneth Graunke
db9b8c062f glsl: Implement the asinh, acosh, and atanh built-in functions. 2010-11-15 14:02:52 -08:00
Kenneth Graunke
096d36872f generate_builtins.py: Fix inconsistent use of tabs and spaces warning. 2010-11-15 14:02:52 -08:00
Kenneth Graunke
0d082c0e06 glsl: Refresh autogenerated lexer and parser files.
For the last three commits.
2010-11-15 13:33:58 -08:00
Kenneth Graunke
7279feeb19 glsl: Add support for the 'u' and 'U' unsigned integer suffixes. 2010-11-15 13:33:58 -08:00
Kenneth Graunke
2b6c1a0b7c glsl: Add new keywords and reserved words for GLSL 1.30. 2010-11-15 13:33:58 -08:00
Kenneth Graunke
285036fbb0 glsl: Rework reserved word/keyword handling in the lexer.
This consolidates the TOKEN_OR_IDENTIFIER and RESERVED_WORD macros into
a single KEYWORD macro.

The old TOKEN_OR_IDENTIFIER macros handled the case of a word going from
an identifier to a keyword; the RESERVED_WORD macro handled a word going
from a reserved word to a language keyword.  However, neither could
properly handle samplerBuffer (for example), which is an identifier in
1.10 and 1.20, a reserved word in 1.30, and a keyword in 1.40 and on.

Furthermore, the existing macros didn't properly handle reserved words
in GLSL ES 1.00.  The best they could do was return a token (rather than
an identifier), resulting in an obtuse parser error, rather than a
user-friendly "you used a reserved word" error message.
2010-11-15 13:33:57 -08:00
Kenneth Graunke
5dc74e9c77 glsl: Convert glsl_type::base_type from #define'd constants to an enum.
This is nice because printing type->base_type in GDB will now give you a
readable name instead of a number.
2010-11-15 13:33:57 -08:00
Kenneth Graunke
ee36f14fa5 glsl: Remove GLSL_TYPE_FUNCTION define.
Functions are not first class objects in GLSL, so there is never a value
of function type.  No code actually used this except for one function
which asserted it shouldn't occur.  One comment mentioned it, but was
incorrect.  So we may as well remove it entirely.
2010-11-15 13:33:57 -08:00
Henri Verbeet
62fe9c4efc r600g: Add PIPE_FORMAT_L8A8_UNORM for Evergreen as well. 2010-11-15 22:20:12 +01:00
Henri Verbeet
228d0d1153 r600: Evergreen has two extra frac_bits for the sampler LOD state.
Note: this is a candidate for the 7.9 branch.
2010-11-15 22:20:12 +01:00
Henri Verbeet
aa3113ae20 r600g: Evergreen has two extra frac_bits for the sampler LOD state.
The (piglit) mipmap_limits test shows the issue very clearly.
2010-11-15 22:20:12 +01:00
Henri Verbeet
da8c877733 r600g: Cleanup the fenced_bo list in r600_context_fini(). 2010-11-15 22:20:12 +01:00
Jerome Glisse
5da246944a gallium/noop: no operation gallium driver
This driver is a fake swdri driver that perform no operations
beside allocation gallium structure and buffer for upper layer
usage.

It's purpose is to help profiling core mesa/gallium without
having pipe driver overhead hidding hot spot of core code.

scons file are likely inadequate i am unfamiliar with this
build system.

To use it simply rename is to swrast_dri.so and properly set
LIBGL_DRIVERS_PATH env variable.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-11-15 14:56:40 -05:00
Hui Qi Tay
e3f106b5fe llvmpipe: clean up polygon offset function in lp setup code 2010-11-15 17:21:35 +00:00
Francisco Jerez
88850b3e4f dri/nouveau: Kill a bunch of ternary operators. 2010-11-15 17:42:08 +01:00
Francisco Jerez
aceb5b3277 dri/nouveau: Fix typo. 2010-11-15 17:42:08 +01:00
Viktor Novotný
8c94c7138e dri/nouveau: Remove nouveau_class.h, finishing switch to rules-ng-ng headers
Signed-off-by: Francisco Jerez <currojerez@riseup.net>
2010-11-15 17:42:07 +01:00
Viktor Novotný
69f54d2a7e dri/nouveau nv20: Use rules-ng-ng headers
Signed-off-by: Francisco Jerez <currojerez@riseup.net>
2010-11-15 17:42:07 +01:00
Viktor Novotný
f4efc256fd dri/nouveau: nv10: Use rules-ng-ng headers
Signed-off-by: Francisco Jerez <currojerez@riseup.net>
2010-11-15 17:42:07 +01:00
Viktor Novotný
8983855012 dri/nouveau: nv04: Use rules-ng-ng headers
Signed-off-by: Francisco Jerez <currojerez@riseup.net>
2010-11-15 17:42:06 +01:00
Viktor Novotný
dfc2bf818b dri/nouveau: Import headers from rules-ng-ng
Signed-off-by: Francisco Jerez <currojerez@riseup.net>
2010-11-15 17:42:06 +01:00
Brian Paul
3e910faed5 evergreen: set gl_texture_image::TexFormat field in evergreenSetTexBuffer()
See https://bugs.freedesktop.org/show_bug.cgi?id=31544

Note: this is a candidate for the 7.9 branch.
2010-11-15 09:31:33 -07:00
Brian Paul
f2f1c61950 r300: set gl_texture_image::TexFormat field in r300SetTexBuffer2()
See https://bugs.freedesktop.org/show_bug.cgi?id=31544

Note: this is a candidate for the 7.9 branch
2010-11-15 09:31:27 -07:00
Brian Paul
401f1efd3a r200: set gl_texture_image::TexFormat field in r200SetTexBuffer2()
See https://bugs.freedesktop.org/show_bug.cgi?id=31544

Note: this is a candidate for the 7.9 branch.
2010-11-15 09:31:21 -07:00
Brian Paul
0ef3b298e6 r600: set gl_texture_image::TexFormat field in r600SetTexBuffer2()
See https://bugs.freedesktop.org/show_bug.cgi?id=31544

Note: this is a candidate for the 7.9 branch.
2010-11-15 09:18:47 -07:00
Brian Paul
86abc1f104 radeon: set gl_texture_image::TexFormat field in radeonSetTexBuffer2()
See https://bugs.freedesktop.org/show_bug.cgi?id=31544

Note: this is a candidate for the 7.9 branch
2010-11-15 09:18:40 -07:00
Julien Cristau
e86b4c9194 Makefile: don't include the same files twice in the tarball
src/mesa/drivers/dri/*/*/*.[chS] is a superset of
src/mesa/drivers/dri/*/server/*.[ch] and
src/mesa/drivers/dri/common/xmlpool/*.[ch].
include/GL/internal/glcore.h is already in MAIN_FILES, no need for it in
DRI_FILES too.  src/glx/Makefile was listed twice.

Signed-off-by: Julien Cristau <jcristau@debian.org>
Signed-off-by: Brian Paul <brianp@vmware.com>
2010-11-15 08:46:22 -07:00
Daniel Lichtenberger
ef0720758e radeon: fix potential segfault in renderbuffer update
Fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=31617

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2010-11-15 01:32:42 -05:00
Marek Olšák
9cf25b3d1c r300g: return shader caps from Draw for SWTCL vertex shaders 2010-11-14 23:04:18 +01:00
Marek Olšák
ed7cb289b3 r300g: clean up redundancy in draw functions 2010-11-14 19:28:04 +01:00
Eric Anholt
3b337f5cd9 i965: Fix gl_FragCoord inversion when drawing to an FBO.
This showed up as cairo-gl gradients being inverted on everyone but
Intel, where I'd apparently tweaked the transformation to work around
the bug.  Fixes piglit fbo-fragcoord.
2010-11-14 22:35:17 +08:00
Vinson Lee
d11db2a857 i965: Silence uninitialized variable warning.
Silences this GCC warning.
brw_fs.cpp: In member function 'void fs_visitor::split_virtual_grfs()':
brw_fs.cpp:2516: warning: unused variable 'reg'
2010-11-13 21:19:59 -08:00
Marek Olšák
7e2256688a r300g: fix texture border color for all texture formats
This fixes 8 texwrap format tests.
The code should handle arbitrary formats now and is cleaner.

NOTE: This is a candidate for the 7.9 branch.
2010-11-13 16:43:20 +01:00
Vinson Lee
3f6b1756f8 mesa: Clean up header file inclusion in points.h. 2010-11-13 01:16:12 -08:00
Brian Paul
56b4819932 mesa: consolidate assertions in teximage code 2010-11-12 07:21:29 -07:00
Christoph Bumiller
4c22475383 nvc0: import nvc0 gallium driver 2010-11-12 15:17:40 +01:00
Marek Olšák
93edd15178 svga: fill out CAPs for indirect addressing
As per the ps_3_0 and vs_3_0 documentation.
The aL register in D3D9 is quite tricky to use, though.
2010-11-12 03:13:23 +01:00
Marek Olšák
5c7127c07c r600g: fill out CAPs for indirect addressing 2010-11-12 03:13:23 +01:00
Marek Olšák
d279902b40 r300g: fill out CAPs for indirect addressing
To match shader model 2.0 (it's impossible to fully implement ARL
with shader model 3.0 relative addressing).
2010-11-12 03:13:22 +01:00
Marek Olšák
abe2c0d3b0 nvfx: fill out CAPs for indirect addressing
To match shader model 2.0.
2010-11-12 03:13:22 +01:00
Marek Olšák
3c6309e2f7 nv50: fill out CAPs for indirect addressing 2010-11-12 03:13:22 +01:00
Marek Olšák
04bafb2b55 i965g: fill out CAPs for indirect addressing 2010-11-12 03:13:22 +01:00
Marek Olšák
5bf7d668ac i915g: fill out CAPs for indirect addressing 2010-11-12 03:13:22 +01:00
Marek Olšák
53b7ec91ca tgsi: fill out CAPs for indirect addressing 2010-11-12 03:13:22 +01:00
Marek Olšák
cbfdf262cc gallium: add CAPs for indirect addressing and lower it in st/mesa when needed
Required because ATI and NVIDIA DX9 GPUs do not support indirect addressing
of temps, inputs, outputs, and consts (FS-only) or the hw support is so
limited that we cannot use it.

This should make r300g and possibly nvfx more feature complete.

Signed-off-by: Marek Olšák <maraeo@gmail.com>
2010-11-12 03:13:22 +01:00
Brian Paul
d18df9e336 tdfx: s/Format/_BaseFormat/
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=31560
2010-11-11 16:56:45 -07:00
Eric Anholt
6929cdd14b glsl: Free the loop state context when we free the loop state.
Since this was talloced off of NULL instead of the compile state, it
was a real leak over the course of the program.  Noticed with
valgrind --leak-check=full --show-reachable=yes.  We should really
change these passes to generally get the compile context as an argument
so simple mistakes like this stop mattering.
2010-11-11 15:12:37 -08:00
Brian Paul
78587ea012 mesa: fix glDeleteBuffers() regression
This fixes a regression (failed assertion) from commit
c552f273f5 which was hit if glDeleteBuffers()
was called on a buffer that was never bound.

NOTE: this is a candidate for the 7.9 branch.
2010-11-11 15:31:36 -07:00
Brian Paul
c552f273f5 mesa: make glIsBuffer() return false for never bound buffers
Use a dummy buffer object as we do for frame/renderbuffer objects.
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=31514

Note: this is a candidate for the 7.9 branch.
2010-11-11 14:49:53 -07:00
Aras Pranckevicius
d67df5dd9d glsl: fix crash in loop analysis when some controls can't be determined
Fixes loop-07.frag.
2010-11-11 10:49:37 -08:00
Keith Whitwell
7fb16423cc r600g: enforce minimum stride on render target texture images
Fixes piglit/fbo_readpixels since staging upload changes.
2010-11-11 16:20:24 +00:00
Keith Whitwell
8a3c181e9c r600g: do not try to use staging resource for depth textures
Currently r600_resource_copy_region() will turn these copies into
transfers + memcpys, so to avoid recursion we must not turn those
transfers back into blits.
2010-11-11 15:43:31 +00:00
Brian Paul
b3b6476695 mesa: handle more pixel types in mipmap generation code
NOTE: This is a candidate for the 7.9 branch.
2010-11-11 08:33:42 -07:00
Brian Paul
79c65410c1 mesa: add missing formats in _mesa_format_to_type_and_comps()
NOTE: this is a candidate for the 7.9 branch
2010-11-11 08:31:21 -07:00
Brian Paul
c9126d66fa mesa: improve error message 2010-11-11 07:43:46 -07:00
Brian Paul
624661cae4 mesa: #include mfeatures.h in enums.h 2010-11-11 07:43:46 -07:00
Keith Whitwell
6baad55f15 r600g: guard experimental s3tc code with R600_ENABLE_S3TC 2010-11-11 14:30:09 +00:00
Lucas Stach
089056a5f3 nvfx: fill PIPE_CAP_PRIMITIVE_RESTART and PIPE_CAP_SHADER_STENCIL_EXPORT
Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Francisco Jerez <currojerez@riseup.net>
2010-11-11 14:55:46 +01:00
Francisco Jerez
cdb38b5d3d dri/nouveau: Split hardware/software TNL instantiation more cleanly. 2010-11-11 14:50:50 +01:00
Vinson Lee
dc524adee2 mesa: Fix printf format warnings. 2010-11-10 17:30:59 -08:00
Ian Romanick
bcef51c3b8 mesa: Allow query of MAX_SAMPLES with EXT_framebuffer_multisample
Previously queries of MAX_SAMPLES were only allowed with
ARB_framebuffer_object, but EXT_framebuffer_multisample also enables
this query.  This seems to only effect the i915.  All other drivers
support both extensions or neither extension.

This patch is based on a patch that Kenneth sent along with the report.

NOTE: this is a candidate for the 7.9 branch.

Reported-by: Kenneth Waters <kwaters@chromium.org>
2010-11-10 16:00:03 -08:00
Jakob Bornecrantz
0faa7ada84 libgl-xlib: Use sw helper instead of roll your own 2010-11-10 23:40:18 +00:00
Jakob Bornecrantz
89deebb1af graw: Use inline sw helper instead of roll your own loader 2010-11-10 23:05:17 +00:00
Jakob Bornecrantz
d4c60575f8 galahad: Correct the name of the scons library 2010-11-10 23:05:17 +00:00
Jerome Glisse
8e0230a85c r600g: allow driver to work without submitting cmd to GPU
For driver performance analysis it usefull to be able to
disable as much as possible the GPU interaction so that
one can profile the userspace only.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-11-10 16:49:50 -05:00
Robert Hooker
e8b2d36723 intel: Add a new B43 pci id.
Signed-off-by: Robert Hooker <robert.hooker@canonical.com>
2010-11-10 13:37:47 -08:00
Eric Anholt
9effc1adf1 i965: re-enable gen6 IF statements in the fragment shader.
IF statements were getting flattened while they were broken.  With
Zhenyu's last fix for ENDIF's type, everything appears to have lined
up to actually work.

This regresses two tests:
glsl1-! (not) operator (1, fail)
glsl1-! (not) operator (1, pass)

but fixes tests that couldn't work before because the IFs couldn't be
flattened:
glsl-fs-discard-01
occlusion-query-discard

(and, naturally, this should be a performance improvement for apps
that actually use IF statements to avoid executing a bunch of code).
2010-11-10 13:33:27 -08:00
Eric Anholt
490c23ee6b i965: Work around strangeness in swizzling/masking of gen6 math.
Sometimes we swizzled in a different channel it looked like, and
sometimes we swizzled in zero.  Or something.

Having looked at the output of another code generator for this chip,
this is approximately what they do, too: use align1 math on
temporaries, and then move the results into place.

Fixes:
glean/vp1-EX2 test
glean/vp1-EXP test
glean/vp1-LG2 test
glean/vp1-RCP test (reciprocal)
glean/vp1-RSQ test 1 (reciprocal square root)
shaders/glsl-cos
shaders/glsl-sin
shaders/glsl-vs-masked-cos
shaders/vpfp-generic/vp-exp-alias
2010-11-10 12:36:23 -08:00
Francisco Jerez
47c471f281 meta: Handle bitmaps with alpha test enabled.
Acked-by: Brian Paul <brianp@vmware.com>
2010-11-10 21:24:31 +01:00
Zack Rusin
f623d0c1c2 gallivm: implement indirect addressing over inputs
Instead of messing with the callers simply copy our inputs into a
alloca array at the beginning of the function and then use it.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2010-11-10 13:00:35 -05:00
Roland Scheidegger
aad65fa112 mesa: remove unneeded DD_POINT_SIZE and DD_LINE_WIDTH tricaps
DD_POINT_SIZE was broken for quite some time, and the only driver (r200) relying
on this no longer needs it.
Both DD_POINT_SIZE and DD_LINE_WIDTH have no users left outside of debugging
output, hence instead of fixing DD_POINT_SIZE setting just drop both of them -
there was a plan to remove tricaps flags entirely at some point.
2010-11-10 17:24:42 +01:00
Roland Scheidegger
c7192ab11f r200: fix r200 large points
DD_POINT_SIZE got never set for some time now (as it was set only in ifdefed
out code), which caused the r200 driver to use the point primitive mistakenly
in some cases which can only do size 1 instead of point sprite. Since the
logic to use point instead of point sprite prim is flaky at best anyway (can't
work correctly for per-vertex point size), just drop this and always emit point
sprites (except for AA points) - reasons why the driver tried to use points for
size 1.0 are unknown though it is possible they are faster or more conformant.
Note that we can't emit point sprites without point sprite cntl as that might
result in undefined point sizes, hence need drm version check (which was
unnecessary before as it should always have selected points). An
alternative would be to rely on the RE point size clamp controls which could
clamp the size to 1.0 min/max even if the SE point size is undefined, but currently
always use 0 for min clamp. (As a side note, this also means the driver does
not honor the gl spec which mandates points, but not point sprites, with zero size
to be rendered as size 1.)
This should fix recent reports of https://bugs.freedesktop.org/show_bug.cgi?id=702.
This is a candidate for the mesa 7.9 branch.
2010-11-10 17:24:41 +01:00
Chia-I Wu
aa139a14ba egl_dri2: Fix __DRI_DRI2 version 1 support.
Correctly set __DRI_API_OPENGL flag.
2010-11-10 23:57:50 +08:00
Marek Olšák
93c04749be r300g: turn magic numbers into names in the hyperz code 2010-11-10 15:14:25 +01:00
Marek Olšák
1d28936dea r300g: rename has_hyperz -> can_hyperz 2010-11-10 15:14:25 +01:00
Marek Olšák
88ddfc57e4 r300g: mention ATI in the renderer string 2010-11-10 15:14:25 +01:00
Keith Whitwell
9a04eca2f8 ws/r600: match bo_busy shared/fence logic in bo_wait
Fixes crash in piglit depthrange-clear.
2010-11-10 11:04:38 +00:00
Vinson Lee
5b8ed2f6d2 mesa: Clean up header file inclusion in pixelstore.h. 2010-11-10 00:49:53 -08:00
Vinson Lee
700add5707 mesa: Clean up header file inclusion in pixel.h. 2010-11-10 00:46:27 -08:00
Zhenyu Wang
65972f992f Revert "i965: VS use SPF mode on sandybridge for now"
This reverts commit 9c39a9fcb2.

Remove VS SPF mode, conditional instruction works for VS now.
2010-11-10 08:17:45 -05:00
Zhenyu Wang
9249af17b8 i965: fix dest type of 'endif' on sandybridge
That should also be immediate value for type W.
2010-11-10 08:17:29 -05:00
Eric Anholt
f289dcd849 i965: Add support for math on constants in gen6 brw_wm_glsl.c path.
Fixes 10 piglit cases that were assertion failing.
2010-11-09 20:20:00 -08:00
Ian Romanick
ad8cb131d8 ir_to_mesa: Refactor code for emitting DP instructions 2010-11-09 18:09:41 -08:00
Eric Anholt
f00929cbdd i965: Allow OPCODE_SWZ to put immediates in the first arg.
Fixes assertion failure with texture swizzling in the GLSL path when
it's triggered (such as gen6 FF or ARB_fp shadow comparisons).

Fixes:
texdepth
texSwizzle
fp1-DST test
fp1-LIT test 3
2010-11-09 17:18:52 -08:00
Kenneth Graunke
afb6fb9a92 glsl: Remove unnecessary "unused variable" warning suppression.
The "instructions" variable -is- used, so the cast to void can go away.
2010-11-09 15:55:40 -08:00
Peter Clifton
efb0417040 intel: Add assert check for blitting alignment.
Also fixup code comment to reflect that the GPU requires DWORD
alignment, but in this case does not actually pass the value "in
DWORDs" as I previously stated.
2010-11-09 14:35:28 -08:00
Eric Anholt
00391c7941 Revert "intel: Fix the client-side swapbuffers throttling."
This reverts commit 76360d6abc.  On
second thought, it turned out that sync objects also used the
wait_rendering API like this, and would need the same treatment, and
so wait_rendering itself is fixed in libdrm now.
2010-11-09 14:03:04 -08:00
Eric Anholt
76360d6abc intel: Fix the client-side swapbuffers throttling.
We were asking for a wait to GTT read (all GPU rendering to it
complete), instead of asking for all GPU reading from it to be
complete.  Prevents swapbuffers-based apps from running away with
rendering, and produces a better input experience.
2010-11-09 13:30:27 -08:00
Ian Romanick
956ae44dcf glsl: Fix incorrect gl_type of sampler2DArray and sampler1DArrayShadow
NOTE: this is a candidate for the 7.9 branch.
2010-11-09 13:05:07 -08:00
José Fonseca
10740acf46 gallivm: Allocate TEMP/OUT arrays only once. 2010-11-09 20:36:28 +00:00
Zack Rusin
528c3cd241 gallivm: implement indirect addressing of the output registers 2010-11-09 20:36:28 +00:00
Vinson Lee
520140a6c9 winsys/xlib: Add cygwin to SConscript.
Fixes SCons NameError exception on Cygwin.
2010-11-09 12:31:11 -08:00
Keith Whitwell
63c3e3a3dc r600: fix my pessimism about PIPE_TRANSFER_x flags
For some reason I though we needed the _DISCARD flag to avoid
readbacks, which isn't true at all.  Now write operations should
pipeline properly, gives a good speedup to demos/tunnel.
2010-11-09 20:12:46 +00:00
Keith Whitwell
9f7ec103e2 r600g: translate ARR instruction 2010-11-09 20:12:46 +00:00
Keith Whitwell
c2c55547dc r600g: attempt to turn on DXTn formats
Seems to sort-of work for non-mipmapped textures.  Better than just
black anyway.
2010-11-09 20:12:46 +00:00
Keith Whitwell
e3ea4aec03 r600g: avoid recursion with staged uploads
Don't use an intermediate for formats which don't support hardware
blits under u_blitter.c, as these will recursively attempt to create a
transfer.
2010-11-09 20:12:46 +00:00
Brian Paul
6e2e136428 mesa: no-op glBufferSubData() on size==0
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=31439

NOTE: this is a candidate for the 7.9 branch
2010-11-09 12:24:51 -07:00
Brian Paul
61ea76c8da softpipe: can't no-op depth test stage when occlusion query is enabled
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=31479
2010-11-09 11:44:34 -07:00
Chia-I Wu
5b6ec5a553 st/dri: Add support for surfaceless current contexts.
Tested with Wayland.
2010-11-10 02:01:04 +08:00
Chia-I Wu
3418f74a94 docs: Update egl docs. 2010-11-10 01:31:38 +08:00
Chia-I Wu
dbacbb8219 autoconf: Add --enable-gallium-egl.
This option comes handy when we want to build gallium DRI drivers but
not st/egl.
2010-11-10 00:57:49 +08:00
Vinson Lee
3e6a05b1aa mesa: Clean up header file inclusion in nvprogram.h. 2010-11-09 06:22:25 -08:00
Vinson Lee
0c123679fc mesa: Clean up header file inclusion in multisample.h. 2010-11-09 06:08:29 -08:00
Vinson Lee
c509bf91ec mesa: Clean up header file inclusion in matrix.h. 2010-11-09 06:00:01 -08:00
Vinson Lee
e09800432b mesa: Clean up header file inclusion in lines.h. 2010-11-09 05:47:17 -08:00
Vinson Lee
a20e440c65 mesa: Clean up header file inclusion in light.h. 2010-11-09 05:35:24 -08:00
Vinson Lee
934fc80b06 mesa: Add missing header and forward declarations in dd.h. 2010-11-09 05:13:48 -08:00
Vinson Lee
90394b2d96 mesa: Clean up header file inclusion in image.h. 2010-11-09 05:00:44 -08:00
Thomas Hellstrom
24c6c41bd0 gallium/targets: Trivial crosscompiling fix
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2010-11-09 12:50:12 +01:00
Thomas Hellstrom
0d5b4b320c svga/drm: Optionally resolve calls to powf during link-time
When linked with certain builds of libstdc++, it appears like powf is resolved
by a symbol in that library. Other builds of libstdc++ doesn't contain that
symbol resulting in a linker / loader error. Optionally
resolve that symbol and replace it with calls to logf and expf.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2010-11-09 12:31:25 +01:00
Thomas Hellstrom
8e630fad72 st/egl: Fix build for include files in nonstandard places
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2010-11-09 12:31:24 +01:00
Thomas Hellstrom
6af2a7fe2c mesa: Add talloc includes for gles
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2010-11-09 12:31:24 +01:00
Thomas Hellstrom
675aec8178 egl: Add an include for size_t
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2010-11-09 12:31:24 +01:00
Zack Rusin
9d9df964c4 scons: build the xorg state trackers only when env includes drm 2010-11-09 10:41:59 +00:00
Vinson Lee
d79d942b2e mesa: Clean up header file inclusion in histogram.h. 2010-11-09 01:14:55 -08:00
Vinson Lee
5b3d6bd39e mesa: Clean up header file inclusion in hint.h. 2010-11-09 01:12:34 -08:00
Vinson Lee
63f1740a5d mesa: Clean up header file inclusion in framebuffer.h. 2010-11-09 01:04:22 -08:00
Vinson Lee
b35d3b33e7 mesa: Clean up header file inclusion in fog.h. 2010-11-09 00:58:46 -08:00
Vinson Lee
08354667a3 mesa: Clean up header file inclusion in ffvertex_prog.h. 2010-11-09 00:56:02 -08:00
Vinson Lee
6121730e74 mesa: Clean up header file inclusion in fbobject.h. 2010-11-09 00:52:49 -08:00
Chad Versace
b62c1c4595 glsl: Fix ir_expression::constant_expression_value()
When the type of the ir_expression is error_type, return NULL.
This fixes bug 31371.
2010-11-09 00:50:54 -08:00
Johann Rudloff
d7855ee332 radeon: Implement GL_OES_EGL_image
agd5f: add support to radeon/r200/r300 as well
2010-11-08 19:59:53 -05:00
Johann Rudloff
b42e562a11 radeon: Implement __DRI_IMAGE and EGL_MESA_image_drm 2010-11-08 19:59:53 -05:00
Alex Deucher
4990b771de egl_dri2: Add radeon chip ids 2010-11-08 19:59:53 -05:00
Johann Rudloff
f9b5201dbd radeon: Implement EGL_MESA_no_surface_extension 2010-11-08 19:59:53 -05:00
Kenneth Graunke
a457ca7844 ir_dead_functions: Actually free dead functions and signatures.
This makes linked shaders use around 36k less memory since the
built-in prototypes are now freed.
2010-11-08 16:22:15 -08:00
Vinson Lee
ef6967ddc2 graw: Add struct pipe_surface forward declaration.
Fixes this GCC warning.
graw.h:93: warning: 'struct pipe_surface' declared inside parameter list
graw.h:93: warning: its scope is only this definition or declaration,
which is probably not what you want
2010-11-08 11:55:30 -08:00
Mario Kleiner
d8eef5196f mesa/r300classic: Fix dri2Invalidate/radeon_prepare_render for page flipping.
A call to radeon_prepare_render() at the beginning of draw
operations was placed too deep in the call chain,
inside r300RunRenderPrimitive(), instead of
r300DrawPrims() where it belongs. This leads to
emission of stale target color renderbuffer into the cs if
bufferswaps via page-flipping are used, and thereby causes
massive rendering corruption due to unsynchronized
rendering into the active frontbuffer.

This patch fixes such problems for use with the
upcoming radeon page-flipping patches.

Signed-off-by: Mario Kleiner <mario.kleiner@tuebingen.mpg.de>
2010-11-08 13:53:23 -05:00
Benjamin Franzke
46c1970067 r600g: implement texture_get_handle (needed for eglExportDRMImageMESA) 2010-11-08 13:44:54 -05:00
Peter Clifton
10b9e018ca intel: Fix emit_linear_blit to use DWORD aligned width blits
The width of the 2D blits used to copy the data is defined as a 16-bit
signed integer, but the pitch must be DWORD aligned. Limit to an integral
number of DWORDs, (1 << 15 - 4) rather than (1 << 15 -1).

Fixes corruption to data uploaded with glBufferSubData.

Signed-off-by: Peter Clifton <pcjc2@cam.ac.uk>
2010-11-08 10:14:17 -08:00
Alex Deucher
5b15b5f4a8 r600c: properly align mipmaps to group size
fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=31400
2010-11-08 12:06:15 -05:00
Michal Krol
136ff67ce8 graw: Export graw_save_surface_to_file().
Allows applications to dump surfaces to file without
referencing gallium/auxiliary entry points statically.

Existing test apps have been modified such that
they save the contents of the fronbuffer only
when the `-o' option's specified.
2010-11-08 17:24:11 +01:00
Michal Krol
9e7132b52d os: Open file streams in binary mode.
Otherwise we'll get garbled data on Windows.
2010-11-08 17:24:11 +01:00
Vinson Lee
962967d080 mesa: Clean up header file inclusion in extensions.h. 2010-11-07 21:15:45 -08:00
Vinson Lee
0be44c9406 mesa: Clean up header file inclusion in enable.h. 2010-11-07 21:09:32 -08:00
Vinson Lee
82cc8261d3 mesa: Clean up header file inclusion in drawtex.h. 2010-11-07 21:05:01 -08:00
Vinson Lee
5c2558884f mesa: Clean up header file inclusion in drawpix.h. 2010-11-07 21:02:31 -08:00
Vinson Lee
5953eac7ac mesa: Clean up header file inclusion in depthstencil.h. 2010-11-07 20:57:32 -08:00
Vinson Lee
e0bbb8e5a4 mesa: Clean up header file inclusion in depth.h. 2010-11-07 20:54:33 -08:00
Vinson Lee
76a5fed501 mesa: Clean up header file inclusion in debug.h. 2010-11-07 20:47:10 -08:00
Vinson Lee
a408dbeb37 mesa: Clean up header file inclusion in convolve.h. 2010-11-07 20:39:54 -08:00
Vinson Lee
cc0c45e7c5 mesa: Clean up header file inclusion in colortab.h. 2010-11-07 20:23:15 -08:00
Vinson Lee
fdf3174007 mesa: Clean up header file inclusion in buffers.h. 2010-11-07 20:00:32 -08:00
Vinson Lee
f26565f221 mesa: Clean up header file inclusion in blend.h. 2010-11-07 19:54:00 -08:00
Vinson Lee
42a8af9239 mesa: Clean up header file inclusion in attrib.h. 2010-11-07 19:49:12 -08:00
Vinson Lee
908272b183 mesa: Clean up header file inclusion in atifragshader.h. 2010-11-07 19:41:42 -08:00
Brian Paul
11dd228415 mesa: make fixed-pt and byte-valued arrays a runtime feature
These ES1 features were only tested for in the vertex array code.
Checking the ctx->API field at runtime is cleaner than the #ifdef
stuff and supports choosing the API at runtime.
2010-11-07 18:35:35 -07:00
Brian Paul
802bd6b705 mesa: remove stray GL_FLOAT case in _mesa_is_legal_format_and_type() 2010-11-07 18:33:53 -07:00
Brian Paul
dd28b4c1fc mesa: implement uint texstore code
We used float temporary images before which could lose precision for
uint-valued texture images.
2010-11-07 18:33:42 -07:00
Brian Paul
90c52c26d8 mesa: rename vars in pixel pack/unpack code 2010-11-07 18:33:20 -07:00
Brian Paul
e54d5a9d68 mesa: consolidate pixel packing/unpacking code 2010-11-07 18:33:07 -07:00
Vinson Lee
3a223c3098 mesa: Clean up header file inclusion in arrayobj.h. 2010-11-07 14:29:21 -08:00
Henri Verbeet
9f06411645 r600g: Mention AMD in the renderer string. 2010-11-07 18:40:12 +01:00
Vinson Lee
6bf0ac0916 mesa: Include mfeatures.h in api_validate.c for FEATURE_* symbols. 2010-11-06 21:13:40 -07:00
Vinson Lee
d421149cc8 mesa: Include mfeatures.h in api_loopback for FEATURE_beginend. 2010-11-06 21:05:16 -07:00
Vinson Lee
fb83400f6b mesa: Clean up header file inclusion in api_validate.h. 2010-11-06 20:56:15 -07:00
Vinson Lee
af12de279e mesa: Clean up header file inclusion in api_loopback.h. 2010-11-06 20:50:13 -07:00
Vinson Lee
31bdc53057 mesa: Clean up header file inclusion in version.h. 2010-11-06 20:40:13 -07:00
Vinson Lee
7a33b1c0a9 mesa: Clean up header file inclusion in accum.h. 2010-11-06 20:27:45 -07:00
Eric Anholt
d348b0c72d mesa: Fix delayed state flagging for EXT_sso-related program changes.
Flushing the vertices after having already updated the state doesn't
do any good.  Fixes useshaderprogram-flushverts-1.  As a side effect,
by moving it to the right place we end up skipping no-op state changes
for traditional glUseProgram.
2010-11-06 11:44:32 -07:00
Francisco Jerez
8eaa97592a meta: Don't try to disable cube maps if the driver doesn't expose the extension.
Signed-off-by: Brian Paul <brianp@vmware.com>
2010-11-06 02:40:21 +01:00
Francisco Jerez
2e64c2209e vbo: Avoid unnecessary copy to/from current in vertex format upgrade.
Rebuilding the vertex format from scratch every time we see a new
vertex attribute is rather costly, new attributes can be appended at
the end avoiding a copy to current and then back again, and the full
attr pointer recalculation.

In the not so likely case of an already existing attribute having its
size increased the old behavior is preserved, this could be optimized
more, not sure if it's worth it.

It's a modest improvement in FlightGear (that game punishes the VBO
module pretty hard in general, framerate goes from some 46 FPS to 50
FPS with the nouveau classic driver).

Signed-off-by: Brian Paul <brianp@vmware.com>
2010-11-06 01:59:59 +01:00
Jakob Bornecrantz
f1600d3a97 scons: Unify state tracker SConscripts 2010-11-05 20:58:49 +00:00
Jakob Bornecrantz
7e9f5eab4e scons: Move dependancy checks to the main gallium scons file 2010-11-05 20:58:49 +00:00
Jakob Bornecrantz
c0db7854d5 scons: Check for libdrm_[intel|radeon] as well
And run SConscripts if they are present.
Also make dri depend on both drm and x11.
2010-11-05 20:58:49 +00:00
Jakob Bornecrantz
98d6ed8742 scons: Check for pkg-config before trying to use it
Silences warning about missing packages
2010-11-05 20:58:49 +00:00
Jakob Bornecrantz
b4ac0adb75 scons: Detabify
Drivers scons files for a later time
2010-11-05 20:58:49 +00:00
Jakob Bornecrantz
834cde5844 scons: Remove old pipebuffer SConscript 2010-11-05 20:58:49 +00:00
Brian Paul
e82fddfcd3 softpipe: disable vertex texturing with draw/llvm
This is a temporary work around to prevent crashes with glean/glsl1
(for example) which try to do vertex shader texturing.
2010-11-05 14:41:40 -06:00
Brian Paul
55c5408ad0 gallivm: add const qualifiers, fix comment string 2010-11-05 08:51:53 -06:00
Brian Paul
e8d6b2793f gallivm: alloca() was called too often for temporary arrays
Need to increment the array index to point to the last value.
Before, we were calling lp_build_array_alloca() over and over for
no reason.
2010-11-05 08:49:57 -06:00
Vinson Lee
3168c6ff1a i965: Silence uninitialized variable warning.
Silences this GCC warning.
brw_wm_fp.c: In function 'brw_wm_pass_fp':
brw_wm_fp.c:966: warning: 'last_inst' may be used uninitialized in this function
brw_wm_fp.c:966: note: 'last_inst' was declared here
2010-11-04 17:42:00 -07:00
Vinson Lee
03577f8250 i965: Silence uninitialized variable warning.
Silences this GCC warning.
brw_wm_fp.c: In function 'precalc_tex':
brw_wm_fp.c:666: warning: 'tmpcoord.Index' may be used uninitialized in this function
2010-11-04 17:39:17 -07:00
Vinson Lee
eba2ad6de2 r300/compiler: Move declaration before code.
Fixes this GCC warning with linux-x86 build.
radeon_dataflow.c: In function 'get_readers_normal_read_callback':
radeon_dataflow.c:472: warning: ISO C90 forbids mixed declarations and code
2010-11-04 17:25:16 -07:00
Brian Paul
c8f1687ce7 llvmpipe: added some debug assertions, but disabled 2010-11-04 18:21:45 -06:00
Vinson Lee
86559ce2d8 r300/compiler: Move declaration before code.
Fixes this GCC warning with linux-x86 build.
radeon_pair_schedule.c: In function 'merge_presub_sources':
radeon_pair_schedule.c:312: warning: ISO C90 forbids mixed declarations and code
2010-11-04 17:18:46 -07:00
Francisco Jerez
7831994868 meta: Fix incorrect rendering of the bitmap alpha component.
Signed-off-by: Brian Paul <brianp@vmware.com>
2010-11-04 13:58:54 -06:00
Francisco Jerez
d846362389 meta: Don't leak alpha function/reference value changes.
Signed-off-by: Brian Paul <brianp@vmware.com>
2010-11-04 13:58:02 -06:00
Brian Paul
ef6b7e0a30 tgsi: remove unused function 2010-11-04 13:35:20 -06:00
Tilman Sauerbeck
646a8b7e1d st/mesa: Reset the constant buffers before destroying the pipe context.
Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
2010-11-04 20:01:25 +01:00
Brian Paul
e7f5d19a11 gallivm: implement execution mask for scatter stores 2010-11-04 10:01:28 -06:00
Brian Paul
fb94747b66 gallivm: added lp_elem_type() 2010-11-04 10:00:58 -06:00
Brian Paul
ede232e989 gallivm: add pixel offsets in scatter stores
We want to do the scatter store to sequential locations in memory
for the vector of pixels we're processing in SOA format.
2010-11-04 09:31:59 -06:00
Brian Paul
5b294a5d17 gallivm: added debug code to dump temp registers 2010-11-04 09:28:06 -06:00
Michal Krol
5d28d2f9d4 graw/gdi: Fix window dimensions.
The requested window size is of the client area,
so account for surrounding borders and bars when
creating the window.
2010-11-04 15:12:47 +01:00
Michal Krol
c69979f243 scons: Hook-up graw-gdi target. 2010-11-04 14:34:27 +01:00
Michal Krol
29beaed6dc graw/gdi: Initial commit. 2010-11-04 14:34:27 +01:00
Guillermo S. Romero
560ad7e599 r300g: Do not use buf param before checking for NULL.
Commit 8dfafbf086 forgot to update r300g.
There is a buf == NULL check, but buf is used before for var init.

Tested-by: Guillermo S. Romero <gsromero@infernal-iceberg.com>
2010-11-04 13:26:24 +00:00
Hui Qi Tay
315f8daab1 llvmpipe: added llvm offset setup code 2010-11-04 12:57:30 +00:00
Michal Krol
420400f67f tgsi/build: Reduce interface clutter.
Make private those functions that are used internally only.
2010-11-04 12:20:14 +01:00
Michal Krol
f93d6f929f tgsi/exec: Get rid of obsolete condition codes. 2010-11-04 11:51:10 +01:00
Michal Krol
ee9366ab36 tgsi/exec: Cleanup the remaining arithmetic instructions.
As a result remove some nasty macros.
2010-11-04 11:37:24 +01:00
Vinson Lee
d3fcadf840 dri/nouveau: Silence uninitialized variable warning.
Fixes this GCC warning.
nouveau_vbo_t.c: In function 'nv10_vbo_render_prims':
nouveau_render_t.c:161: warning: 'max_out' may be used uninitialized in this function
nouveau_render_t.c:161: note: 'max_out' was declared here
2010-11-03 18:20:22 -07:00
Brian Paul
3ded3e98ff gallivm: add some LLVM var labels 2010-11-03 17:34:07 -06:00
Brian Paul
2fefbc79ac gallivm: implement scatter stores into temp register file
Something is not quite right, however.  The piglit tests mentioned in
fd.o bug 31226 still don't pass.
2010-11-03 17:34:07 -06:00
Kenneth Graunke
c180e95d26 ir_reader: Fix some potential NULL pointer dereferences.
Found by inspection.
2010-11-03 13:39:42 -07:00
Kenneth Graunke
e751ce39bf ir_reader: Remove useless error check.
It's already been determined that length == 3, so clearly swiz->next is
a valid S-Expression.
2010-11-03 13:39:42 -07:00
Kenneth Graunke
0fd665ca63 ir_reader: Return a specific ir_dereference variant.
There's really no reason to return the base class when we have more
specific information about what type it is.
2010-11-03 13:39:42 -07:00
Kenneth Graunke
d2c23ac82a glsl: Don't print a useless space at the end of an S-Expression list.
We really only want to print spaces -between- elements, not after each
element.  This cleans up error messages from IR reader, making them
(mildly) easier to read.
2010-11-03 13:39:41 -07:00
Kenneth Graunke
6c4a83ca3e Refresh autogenerated file builtin_function.cpp. 2010-11-03 13:39:41 -07:00
Kenneth Graunke
91b72864b0 glsl/builtins: Clean up some ugly autogenerated code in atan.
In particular, calling the abs function is silly, since there's already
an expression opcode for that.  Also, assigning to temporaries then
assigning those to the final location is rather redundant.
2010-11-03 13:39:41 -07:00
Kenneth Graunke
84566c770a glsl/builtins: Rename 'x' to 'y_over_x' in atan(float) implementation.
For consistency with the vec2/vec3/vec4 variants.
2010-11-03 13:39:41 -07:00
José Fonseca
01b39b053b r600g: Swap the util_blitter_destroy call order.
Trivial change that avoids a segmentation fault when the blitter state
happens to be bound when the context is destroyed.

The free calls should probably removed altogether in the future -- the
responsibility to destroy the state atoms lies with whoever created it,
and the safest thing for the pipe driver is to not touch any bound state
in its destructor.
2010-11-03 20:25:13 +00:00
Brian Paul
b29ca2a561 mesa: code to unpack RGBA as uints 2010-11-03 11:18:52 -06:00
José Fonseca
54f2116877 xorg/vmwgfx: Link libkms when available. 2010-11-03 15:41:06 +00:00
José Fonseca
d49dfe66cf st/xorg: Detect libkms with scons too. 2010-11-03 15:21:51 +00:00
José Fonseca
12376d8ea3 st/xorg: Add missing \n to error message. 2010-11-03 15:14:29 +00:00
José Fonseca
ab2305b586 xorg/vmwgfx: Add missing source file to SConscript. 2010-11-03 14:02:40 +00:00
Eric Anholt
2aa738bf26 intel: Remove leftover dri1 locking fields in the context. 2010-11-03 06:08:27 -07:00
Eric Anholt
5716ad2425 intel: Remove duplicated teximage miptree to object miptree promotion.
intel_finalize_mipmap_tree() does this optimization too, just more
aggressively.
2010-11-03 06:08:27 -07:00
Eric Anholt
0300c9ab54 intel: Avoid taking logbase2 of several things that we max.
logbase2(max(width, height, depth)) ==
max(logbase2(width), logbase2(height), logbase2(depth)), but in 60
bytes less code.
2010-11-03 06:08:27 -07:00
Eric Anholt
e42ce160b1 i965: Remove dead intel_structs.h file. 2010-11-03 06:08:27 -07:00
Eric Anholt
6ad0283f48 intel: Remove the magic unaligned memcpy code.
In testing on Ironlake, the histogram of clocks/pixel results for the
system memcpy and magic unaligned memcpy show no noticeable difference
(and no statistically significant difference with the 5510 samples
taken, though the stddev is large due to what looks like the cache
effects from the different texture sizes used).
2010-11-03 06:08:27 -07:00
Eric Anholt
bb15408350 intel: Annotate debug printout checks with unlikely().
This provides the optimizer with hints about code hotness, which we're
quite certain about for debug printouts (or, rather, while we
developers often hit the checks for debug printouts, we don't care
about performance while doing so).
2010-11-03 06:08:27 -07:00
Brian Paul
b19b858060 egl/gdi: fix typo: xsurf->gsurf 2010-11-03 07:04:42 -06:00
Keith Whitwell
32bb65217e evergreeng: set hardware pixelcenters according to gl_rasterization_rules 2010-11-03 11:16:04 +00:00
Keith Whitwell
d6b6a0bc17 evergreeng: respect linewidth state, use integer widths only
Discard fractional bits from linewidth.  This matches the nvidia
closed drivers, my reading of the OpenGL SI and current llvmpipe
behaviour.

It looks a lot nicer & avoids ugliness where lines alternate between n
and n+1 pixels in width along their length.

Also fix up r600g to match.
2010-11-03 10:55:22 +00:00
Keith Whitwell
ee07e0e39a r600g: don't call debug_get_bool_option for tiling more than once 2010-11-03 10:55:22 +00:00
Keith Whitwell
b3462601cb evergreeng: protect against null constant buffers
Should do better than this and actually unbind the buffer, but haven't
yet gotten it to work.
2010-11-03 10:55:22 +00:00
Chia-I Wu
3f7876d76f st/egl: Use native_display_buffer for EGL_MESA_drm_image.
native_display_buffer is just a wrapper to resource_{from,get}_handle
for drm backend.
2010-11-03 17:50:25 +08:00
Chia-I Wu
af977b5382 st/egl: Add native_display_buffer interface.
The interface is a wrapper to pipe_screen::resource_from_handle and
pipe_screen::resource_get_handle.  A winsys handle is
platform-dependent.
2010-11-03 17:47:08 +08:00
Chia-I Wu
a5f4338fc4 st/egl: Add extern "C" wrapper to native.h.
This allows a backend to be written in C++.
2010-11-03 17:47:08 +08:00
Keith Whitwell
c3974dc837 r600g: set hardware pixel centers according to gl_rasterization_rules
These were previously being left in the default (D3D) mode.  This mean
that triangles were drawn slightly incorrectly, but also because this
state is relied on by the u_blitter code, all blits were half a pixel
off.
2010-11-03 09:36:01 +00:00
Keith Whitwell
7b120ceac8 r600g: remove unused flink, domain fields from r600_resource
These were being set but not used anywhere.
2010-11-03 09:36:01 +00:00
Keith Whitwell
d4fab99c1c r600g: use a buffer in GTT as intermediate on texture up and downloads
Generalize the existing tiled_buffer path in texture transfers for use
in some non-tiled up and downloads.

Use a staging buffer, which the winsys will restrict to GTT memory.

GTT buffers have the major advantage when they are mapped, they are
cachable, which is a very nice property for downloads, usually the CPU
will want to do look at the data it downloaded.
2010-11-03 09:36:01 +00:00
Keith Whitwell
29c4a15bf6 r600g: propogate resource usage flags to winsys, use to choose bo domains
This opens the question of what interface the winsys layer should
really have for talking about these concepts.

For now I'm using the existing gallium resource usage concept, but
there is no reason not use terms closer to what the hardware
understands - eg. the domains themselves.
2010-11-03 09:36:01 +00:00
Keith Whitwell
14c0bbf469 r600g: propagate usage flags in texture transfers 2010-11-03 09:36:01 +00:00
Chia-I Wu
04ae53ca8a st/egl: Add support for EGL_MATCH_NATIVE_PIXMAP.
Added for completeness.  It makes sense to have such mechanism, but I am
not aware of any user of that..
2010-11-03 17:17:29 +08:00
Chia-I Wu
b8cb14209a st/egl: Add support for swap interval and swap behavior.
The value of EGL_MAX_SWAP_INTERVAL and whether
EGL_SWAP_BEHAVIOR_PRESERVED_BIT is set will depend on the native
backend used.
2010-11-03 16:26:57 +08:00
Chia-I Wu
828d944fd6 st/egl: Remove flush_frontbuffer and swap_buffers.
They are deprecated by native_surface::present and there is no user of
them.
2010-11-03 16:08:47 +08:00
Chia-I Wu
250d81da25 d3d1x: Use native_surface::present.
Replace native_surface::flush_frontbuffer and
native_surface::swap_buffers calls by native_surface::present calls.
2010-11-03 16:08:44 +08:00
Chia-I Wu
0ae4b23c53 st/egl: Use native_surface::present callback.
Replace native_surface::flush_frontbuffer and
native_surface::swap_buffers calls by native_surface::present calls.
2010-11-03 16:08:23 +08:00
Chia-I Wu
94bf657b23 st/egl: Add native_surface::present callback.
The callback presents the given attachment to the native engine.  It
allows the swap behavior and interval to be controlled.  It will replace
native_surface::flush_frontbuffer and native_surface::swap_buffers
shortly.
2010-11-03 16:04:59 +08:00
Chia-I Wu
c9186bd588 egl: Set up the pthread key even TLS is used.
We have to rely on the pthread key destructor to free the current thread
info when a thread exits.
2010-11-03 13:34:17 +08:00
Vinson Lee
93a7e6d94e st/vega: Remove unnecessary headers. 2010-11-02 17:13:44 -07:00
Brian Paul
61f25216e3 mesa: silence new warnings in texobj.c
Silences warning such as:
main/texobj.c:442:40: warning: ISO C99 requires rest arguments to be used
main/texobj.c:498:58: warning: ISO C99 requires rest arguments to be used
2010-11-02 17:41:00 -06:00
Vinson Lee
6f90a7cbff savage: Remove unnecessary header. 2010-11-02 16:23:30 -07:00
Eric Anholt
689def8bbc intel: For batch, use GTT mapping instead of writing to a malloc and copying.
No measurable performance difference on cairo-perf-trace, but
simplifies the code and should have cache benefit in general.
2010-11-02 14:24:42 -07:00
Eric Anholt
1210aa7551 mesa: Don't compute an unused texture completeness debug string.
This showed up at about 1% on cairo-gl firefox-talos-gfx, where
glClear() is called while a texture is incomplete.
2010-11-02 14:24:42 -07:00
Tilman Sauerbeck
965c8a3f1d st/mesa: Reset the index buffer before destroying the pipe context.
Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
2010-11-02 21:52:40 +01:00
Tilman Sauerbeck
52ba68d0b0 r600g: Destroy the winsys in r600_destroy_screen().
Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
2010-11-02 21:52:39 +01:00
Tilman Sauerbeck
907efeea18 r600g: Fixed two memory leaks in winsys.
Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
2010-11-02 21:52:39 +01:00
Tilman Sauerbeck
ecb1b8b98f r600g: Delete custom_dsa_flush on shutdown.
Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
2010-11-02 21:52:39 +01:00
Tilman Sauerbeck
c49dcaef65 r600g: We don't support PIPE_CAP_PRIMITIVE_RESTART.
Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
2010-11-02 21:52:39 +01:00
Tilman Sauerbeck
86778dadc5 r600g: Made radeon_bo::map_count signed.
That way assert(map_count >= 0) can actually fail when we screwed up.

Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
2010-11-02 21:52:39 +01:00
Tilman Sauerbeck
34e75b0ca8 r600g: Fixed unmap condition in radeon_bo_pb_destroy().
Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
2010-11-02 21:52:38 +01:00
Tilman Sauerbeck
b675266f0e r600g: Made radeon_bo_pb_map_internal() actually call radeon_bo_map().
This ensures that we increase bo->map_count when radeon_bo_map_internal()
returns successfully, which in turn makes sure we don't decrement
bo->map_count below zero later.

Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
2010-11-02 21:52:38 +01:00
Tilman Sauerbeck
4e34393162 r600g: Removed unused 'ptr' argument from radeon_bo().
Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
2010-11-02 21:52:38 +01:00
Jakob Bornecrantz
1318b0ef9e graw: Tidy graw xlib scons file a bit 2010-11-02 18:20:30 +00:00
Brian Paul
2996ce72b1 llvmpipe: add a cast 2010-11-02 11:53:14 -06:00
Brian Paul
9fbf744389 llvmpipe: assign context's frag shader pointer before using it
The call to draw_bind_fragment_shader() was using the old fragment
shader.  This bug would have really only effected the draw module's
use of the fragment shader in the wide point stage.
2010-11-02 11:50:37 -06:00
Chad Versace
223568fbcd mesa: Fix C++ includes in sampler.cpp
Some C++ header files were included in an extern "C" block. When building with
Clang, this caused the build to fail due to namespace errors. (GCC did not
report any errors.)

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2010-11-02 10:36:20 -07:00
Keith Whitwell
8dfafbf086 st/mesa: unbind constant buffer when not in use
Important as more constant buffers per shader start to get used.

Fix up r600 (tested) and nv50 (untested) to cope with this.  Drivers
previously didn't see unbinds of constant buffers often or ever, so
this isn't always dealt with cleanly.

For r600 just return and keep the reference.  Will try to do better in
a followup change.
2010-11-02 16:57:24 +00:00
Keith Whitwell
debcb43489 llvmpipe: guard against NULL task->query pointer
This doesn't seem like it should be possible, but some test suites
manage to hit this case.  Avoid crashing release builds under those
circumstances.
2010-11-02 16:48:10 +00:00
Keith Whitwell
98445b4307 llvmpipe: avoid generating tri_16 for tris which extend past tile bounds
Don't trim triangle bounding box to scissor/draw-region until after
the logic for emitting tri_16.  Don't generate tri_16 commands for
triangles with untrimmed bounding boxes outside the current tile.

This is important as the tri-16 itself can extend past tile bounds and
we don't want to add code to it to check against tile bounds (slow) or
restrict it to locations within a tile (pessimistic).
2010-11-02 16:48:10 +00:00
Brian Paul
fc70c05dbd mesa: fix aux/accum comment and error message mixups 2010-11-02 09:56:04 -06:00
Brian Paul
4a9ce9b299 mesa: remove always-false conditional in check_compatible()
The two gl_config pointers can never be equal.
2010-11-02 09:40:57 -06:00
Brian Paul
670207e6d0 dri/util: add a bunch of comments 2010-11-02 09:33:23 -06:00
Brian Paul
0fefafb2e4 mesa: move the gl_config struct declaration
It was in the middle of the lighting-related structures before.
Also add some info about field sizes in this structure.
2010-11-02 09:33:17 -06:00
Brian Paul
ee1f047c81 mesa: use GLubyte for edge flag arrays
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=31310
2010-11-02 08:23:24 -06:00
José Fonseca
265b53983e scons: Propagate installation targets.
Fixes libgl-xlib target.
2010-11-02 14:20:12 +00:00
José Fonseca
45f4b85d58 scons: i915 can't build on MSVC either.
I thought I had singled it out before, but apparently not.
2010-11-02 13:49:35 +00:00
José Fonseca
3ae04dd910 scons: Add aliases for several pipe drivers. 2010-11-02 12:35:52 +00:00
José Fonseca
4f8dbd2f5e r600g: List recently added files in SConscript. 2010-11-02 12:35:52 +00:00
Zhenyu Wang
aedc270966 i965: refresh wm push constant also for BRW_NEW_FRAMENT_PROGRAM on gen6
Fix compiz crash.

https://bugs.freedesktop.org/show_bug.cgi?id=31124
2010-11-02 16:06:13 +08:00
Chia-I Wu
16ee7a55ae mesa: Allow contexts of different APIs to coexist.
This effectively redoes 1741ddb747 in a
way that allows contexts of different APIs to coexist.

First, the changes to the remap table are reverted.  The remap table
(driDispatchRemapTable) is always initialized in the same way regardless
of the context API.

es_generator.py is updated to use a local remap table, whose sole
purpose is to help initialize its dispatch table.  The local remap table
and the global one are always different, as they use different
glapidispatch.h.  But the dispatch tables initialized by both remap
tables are always compatible with glapi (libGL.so).

Finally, the semantics of one_time_init are changed to per-api one-time
initialization.
2010-11-02 14:43:35 +08:00
Chia-I Wu
fdede1efaa mesa: Select FEATURE_remap_table when multiple APIs are enabled.
Core mesa should query glapi for the positions of the functions in
_glapi_table when multiple APIs are supported.  It does not know which
glapitable.h glapi used.
2010-11-02 14:17:56 +08:00
Tom Stellard
6b999c89ce r300/compiler: Don't track readers into an IF block.
This makes rc_get_readers_normal() more conservative than it needs to be,
but it fixes some incorrect behavior in the optimization passes.
2010-11-01 22:06:20 -07:00
Chia-I Wu
ad00a92ee7 egl: Rework _eglGetSearchPath.
So that the directory part of EGL_DRIVER, if exists, is prepended to the
search path.  This commit also adds a sanity check to _eglLog.
2010-11-02 01:37:16 +08:00
José Fonseca
583e41855b scons: Disable python state tracker when swig is not present. 2010-11-01 15:27:34 +00:00
José Fonseca
0fd41d236f scons: Restore x11 tool behavior for backwards compatability. 2010-11-01 14:37:18 +00:00
José Fonseca
ab9ca6caa8 scons: Some pipe drivers are not portable for MSVC 2010-11-01 14:24:08 +00:00
Hui Qi Tay
7f0dc5ea1b llvmpipe: Moved draw pipeline twoside function to llvm setup code 2010-11-01 14:14:55 +00:00
José Fonseca
f9156ebcc4 scons: Fix MinGW cross-compilation. 2010-11-01 13:56:16 +00:00
José Fonseca
601498ae73 scons: Revamp how to specify targets to build.
Use scons target and dependency system instead of ad-hoc options.

Now is simply a matter of naming what to build. For example:

  scons libgl-xlib

  scons libgl-gdi

  scons graw-progs

  scons llvmpipe

and so on. And there is also the possibility of scepcified subdirs, e.g.

  scons src/gallium/drivers

If nothing is specified then everything will be build.

There might be some rough corners over the next days. Please bare with me.
2010-11-01 13:30:22 +00:00
Francisco Jerez
a84bd587c6 dri/nouveau: Re-emit the BO state when coming back from a software fallback. 2010-10-31 22:07:38 +01:00
Francisco Jerez
4a282629c2 dri/nouveau: Validate the framebuffer state on read buffer changes. 2010-10-31 22:07:26 +01:00
Francisco Jerez
453b718552 dri/nouveau: Fix type promotion issue on 32bit platforms.
Fixes some VTX protection errors introduced by e89af20926.
2010-10-31 22:07:10 +01:00
Benjamin Franzke
6102683b19 st/egl image: multiply drm buf-stride with blocksize
[olv: formatted for 80-column wrapping]
2010-11-01 01:03:53 +08:00
Chia-I Wu
52ef148923 targets/egl: Fix a warning with --disable-opengl build.
API_DEFINES is the defines for libmesagallium.a.  Append it to
egl_CPPFLAGS only when st_GL.so, which uses libmesagallium.a, is built.
2010-10-31 21:22:26 +08:00
Chia-I Wu
1230050363 autoconf: Tidy configure output for EGL.
Prefix EGL driver names by "egl_".  Make it clear that EGL_CLIENT_APIS
is only used by egl_gallium.
2010-10-31 21:22:26 +08:00
Tom Stellard
a15cf3cd0b r300/compiler: Don't clobber presubtract sources during optimizations
https://bugs.freedesktop.org/show_bug.cgi?id=28294
2010-10-30 22:26:19 -07:00
Francisco Jerez
088145f950 dri/nouveau: Pipeline glTexSubImage texture transfers. 2010-10-31 02:02:33 +01:00
Francisco Jerez
f67fa52293 dri/nouveau: Keep small DYNAMIC_DRAW vertex buffers in system ram. 2010-10-31 02:01:24 +01:00
Francisco Jerez
e89af20926 dri/nouveau: Optimize VBO binding re-emission. 2010-10-31 02:50:44 +02:00
Francisco Jerez
57382e71ef dri/nouveau: Split out array handling to its own file. 2010-10-31 02:50:04 +02:00
Francisco Jerez
9d1f1fcf13 dri/nouveau: Use a macro to iterate over the bound vertex attributes. 2010-10-31 02:45:38 +02:00
Francisco Jerez
dbe1eae785 dri/nouveau: Avoid recursion in nouveau_bo_context_reset(). 2010-10-31 02:45:31 +02:00
Francisco Jerez
f2098e0fef dri/nouveau: Split out the scratch helpers to a separate file. 2010-10-31 02:44:45 +02:00
Francisco Jerez
6daaf45359 dri/nouveau: Tell the vbo module we want real hardware BOs. 2010-10-31 02:44:35 +02:00
Francisco Jerez
6ee9cd482a dri/nouveau: Honor the access flags in nouveau_bufferobj_map_range. 2010-10-31 02:43:14 +02:00
Francisco Jerez
f102c5220c dri/nouveau: Call _mesa_update_state() after framebuffer invalidation.
Previously nouveau_state_emit() was being called directly, sometimes
that doesn't work because it doesn't update the derived GL context.
2010-10-30 19:25:33 +02:00
Francisco Jerez
e3c0b7ba41 dri/nv25: Bind a hierarchical depth buffer. 2010-10-30 19:25:32 +02:00
Francisco Jerez
c5ca972c07 dri/nouveau: Don't assert(0) on compressed internal formats. 2010-10-30 19:25:32 +02:00
Francisco Jerez
920481d387 dri/nv20: Clear with the 3D engine. 2010-10-30 19:25:31 +02:00
Chia-I Wu
cfc81d93f7 st/mesa: Unreference the sampler view in st_bind_surface.
Without this, update_textures may not pick up the new pipe_resource.

It is actually update_textures that should check
stObj->sampler_view->texture != stObj->pt, but let's follow st_TexImage
and others for now.
2010-10-31 01:18:59 +08:00
Brian Paul
9c2b4814d0 osmesa: fix renderbuffer memleak in OSMesaMakeCurrent()
Fixes fd.o bug 31128.
2010-10-30 10:11:37 -06:00
Chia-I Wu
156e955c25 autoconf: st/vega requires --enable-openvg.
Make it a warning for now to smooth the transition.
2010-10-30 14:41:17 +08:00
Kenneth Graunke
cff1aeea10 glsl: Remove unused ARRAY_SIZE macro.
It's also equivalent to Elements(...) which is already used elsewhere.
2010-10-29 11:43:30 -07:00
Eric Anholt
a974949f3b mesa: Make metaops use program refcounts instead of names.
Fixes failure on restoring state when the program was active but
deleted, and the name no longer exists.

Bug #31194
2010-10-29 11:28:38 -07:00
Brian Paul
34e8801b9c mesa: remove dead code 2010-10-29 08:13:31 -06:00
José Fonseca
d070edd4f0 mesa: Fix windows build (uint -> GLuint). 2010-10-29 13:05:31 +01:00
Chia-I Wu
bdd8838631 targets: Add missing quotes to Makefile.xorg.
Fix

  $ make CC="ccache gcc"
2010-10-29 13:00:12 +08:00
Chia-I Wu
9de5c6a1cb Merge branch 'glapi-reorg'
Conflicts:
	src/mapi/glapi/glapi_sparc.S
	src/mapi/glapi/glapi_x86.S
	src/mapi/glapi/glapidispatch.h
	src/mapi/glapi/glapioffsets.h
	src/mapi/glapi/glprocs.h
2010-10-29 12:46:59 +08:00
Chia-I Wu
815faa448c autoconf: Update configuration info.
Output API info first.  Move GLU/GLw/GLUT and EGL near driver info.
2010-10-29 12:42:24 +08:00
Chia-I Wu
c6320c5eb2 docs: Update egl and openvg docs. 2010-10-29 12:11:49 +08:00
Chia-I Wu
be5f34a053 autoconf: Better client API selection.
Make autoconf decide the client APIs enabled first.  Then when OpenGL
and OpenGL ES are disabled, there is no need to build src/mesa/;  when
OpenGL is disabled, no $mesa_driver should be built.  Finally, add
--enable-openvg to enable OpenVG.

With these changes, an OpenVG only build can be configured with

  $ ./configure --disable-opengl --enable-openvg

src/mesa, src/glsl, and src/glx will be skipped, which saves a great
deal of compilation time.

And an OpenGL ES only build can be configured with

  $ ./configure --disable-opengl --enable-gles-overlay
2010-10-29 12:10:46 +08:00
Brian Paul
bdba4608df mesa: pixel transfer ops do not apply to integer-valued textures 2010-10-28 21:17:42 -06:00
Brian Paul
0a3566cec0 mesa: additional integer formats in _mesa_bytes_per_pixel() 2010-10-28 21:17:42 -06:00
Brian Paul
7faf521fad mesa: add const qualifier to _mesa_is_legal_format_and_type() 2010-10-28 21:17:42 -06:00
Brian Paul
113c1832b1 mesa: fix integer cases in _mesa_is_legal_format_and_type()
Some integer formats work with some packed datatypes.
2010-10-28 21:17:42 -06:00
Brian Paul
9fc7fa0a4c mesa: fix incorrect type in _mesa_texstore_rgba_int16() 2010-10-28 21:17:42 -06:00
Brian Paul
b44f9c7e0a mesa: remove obsolete comment 2010-10-28 21:17:42 -06:00
Brian Paul
22c7a69d7b mesa: add extension table entry for GL_EXT_gpu_shader4 2010-10-28 21:17:42 -06:00
Brian Paul
55dc971ded mesa: clean-up array element code
Remove unnecessary GLAPIENTRY keywords, update comments, re-indent.
2010-10-28 21:17:42 -06:00
Brian Paul
d916d81582 mesa: glArrayElement support for integer-valued arrays 2010-10-28 21:17:42 -06:00
Brian Paul
3b82ceec67 mesa: state/queries for GL_MIN/MAX_PROGRAM_TEXEL_OFFSET_EXT 2010-10-28 21:17:42 -06:00
Brian Paul
433e5e6def mesa: consolidate glVertex/Color/etcPointer() code
This removes a bunch of similar error checking code in all the vertex
pointer functions and puts nearly all the error checking in update_array().
2010-10-28 21:17:42 -06:00
Brian Paul
d1184d26bb mesa: add gl_client_array::Integer field and related vertex array state code 2010-10-28 21:17:41 -06:00
Brian Paul
ca2618f4b6 mesa: implement integer-valued vertex attribute functions
The integers still get converted to floats.  That'll have to change someday.
2010-10-28 21:17:41 -06:00
Brian Paul
e2b8c65723 mesa: add new GLvertexformat entries for integer-valued attributes 2010-10-28 21:17:41 -06:00
Brian Paul
ba9995953c mesa: plug in more GL_EXT_gpu_shader4 functions 2010-10-28 21:17:41 -06:00
Brian Paul
9c61ca90ea mesa: add glGetUniformuiv(), plug in uint glUniform funcs 2010-10-28 21:17:41 -06:00
Brian Paul
53eca8d216 mesa: plug in stubs for glBindFragDataLocation(), glGetFragDataLocation() 2010-10-28 21:17:41 -06:00
Brian Paul
a6fb2acfdb glapi: regenerated API files 2010-10-28 21:17:41 -06:00
Brian Paul
20371d40b8 glapi: include EXT_gpu_shader4.xml 2010-10-28 21:17:41 -06:00
Brian Paul
a52dbaa99a glapi: xml spec file for GL_EXT_gpu_shader4 2010-10-28 21:17:41 -06:00
Brian Paul
beea704be2 vbo: re-indent file 2010-10-28 21:17:41 -06:00
Brian Paul
25efd558a3 mesa: remove 'normalized' parameter from _mesa_VertexAttribIPointer() 2010-10-28 21:17:41 -06:00
Eric Anholt
9d45c7d1ce i965: Update the gen6 stencil ref state when stencil state changes.
Fixes 6 piglit tests about stencil operations.
2010-10-28 16:28:42 -07:00
Eric Anholt
b271445e37 i965: Upload required gen6 VS push constants even when using pull constants.
Matches pre-gen6, and fixes glsl-vs-large-uniform-array.
2010-10-28 15:38:38 -07:00
Eric Anholt
c5114c7eab i965: Update gen6 SF state when point state (sprite or attenuation) changes. 2010-10-28 15:38:38 -07:00
Eric Anholt
e30a3e7aa0 i965: Add user clip planes support to gen6.
Fixes piglit user-clip, and compiz desktop switching when dragging a
window and using just 2 desktops.  Bug #30446.
2010-10-28 14:45:11 -07:00
José Fonseca
85a08f8fc7 gallivm: Remove the EMMS opcodes.
Unnecessary now that lp_set_target_options() successful disables MMX code
emission.
2010-10-28 20:42:02 +01:00
José Fonseca
8d364221e9 gallivm: always enable LLVMAddInstructionCombiningPass() 2010-10-28 20:40:34 +01:00
José Fonseca
5479fa34d9 gallium: Avoid using __doc__ in python scripts. 2010-10-28 17:38:18 +01:00
Vinson Lee
a54ab4960b st/mesa: Silence uninitialized variable warning.
Fixes this GCC warning.
state_tracker/st_program.c: In function 'st_print_shaders':
state_tracker/st_program.c:735: warning: 'sh' may be used uninitialized in this function
2010-10-28 06:08:19 -07:00
Tom Stellard
aa43176ebd r300/compiler: Use rc_get_readers_normal() for presubtract optimizations 2010-10-27 22:49:50 -07:00
Kenneth Graunke
cbc966b57b i965: Add bit operation support to the fragment shader backend. 2010-10-27 13:55:30 -07:00
Eric Anholt
9e3641bd0d i965: Make FS uniforms be the actual type of the uniform at upload time.
This fixes some insanity that would otherwise be required for GLSL
1.30 bit ops or gen6 integer uniform operations in general, at the
cost of upload-time pain.  Given that we only have that pain because
mesa's mangling our integer uniforms to be floats, this something that
should be fixed outside of the shader codegen.
2010-10-27 13:54:35 -07:00
Ian Romanick
502943049a docs: add GL_EXT_separate_shader_objects to release notes 2010-10-27 13:45:29 -07:00
Ian Romanick
817ed68710 intel: Enable GL_EXT_separate_shader_objects in Intel drivers 2010-10-27 13:35:53 -07:00
Ian Romanick
f48915ec52 swrast: Enable GL_EXT_separate_shader_objects in software paths 2010-10-27 13:35:53 -07:00
Ian Romanick
84eba3ef71 Track separate programs for each stage
The assumption is that all stages are the same program or that
varyings are passed between stages using built-in varyings.
2010-10-27 13:35:53 -07:00
Ian Romanick
75c6f47288 mesa: Track an ActiveProgram distinct from CurrentProgram
ActiveProgram is the GL_EXT_separate_shader_objects state variable
used for glUniform calls.  glUseProgram also sets this.
2010-10-27 13:35:53 -07:00
Ian Romanick
01abcf3b79 mesa: Add display list support for GL_EXT_separate_shader_objects functions 2010-10-27 13:35:53 -07:00
Ian Romanick
c72aa7fa58 mesa: Skeletal support for GL_EXT_separate_shader_objects
Really just filling in the entry points.  None of them do anything
other than validate their inputs.
2010-10-27 13:35:53 -07:00
Ian Romanick
b97794c041 mesa: Add infrastructure to track GL_EXT_separate_shader_objects 2010-10-27 13:35:53 -07:00
Ian Romanick
44f6e17ebb glapi: Commit files changed by previous commit 2010-10-27 13:35:53 -07:00
Ian Romanick
206e904f3c glapi: Add GL_EXT_separate_shader_objects 2010-10-27 13:35:52 -07:00
Kenneth Graunke
3acc826520 Fix build on systems where "python" is python 3.
First, it changes autoconf to use a "python2" binary when available,
rather than plain "python" (which is ambiguous).  Secondly, it changes
the Makefiles to use $(PYTHON) $(PYTHON_FLAGS) rather than calling
python directly.

Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com>
Signed-off-by: Matthew William Cox <matt@mattcox.ca>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2010-10-27 12:49:53 -07:00
Marek Olšák
676c3f08bd r300g: add a default channel ordering of texture border for unhandled formats
It should fix the texture border for compressed textures.
Broken since 8449a4772a.
2010-10-27 21:21:23 +02:00
Alex Deucher
8ff7885e8f r600c: add missing radeon_prepare_render() call on evergreen 2010-10-27 14:30:50 -04:00
Alex Deucher
b194b9b238 r100: revalidate after radeon_update_renderbuffers
This is a port of 603741a86d
to r100.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2010-10-27 13:53:29 -04:00
Vinson Lee
80adc8ac3b swrast: Print out format on unexpected failure in _swrast_ReadPixels. 2010-10-27 10:16:18 -07:00
Vinson Lee
1b92eb1a4b egl: Remove unnecessary headers. 2010-10-27 09:51:11 -07:00
Vinson Lee
e7343cd704 mesa: Remove unnecessary header. 2010-10-27 09:38:33 -07:00
Vinson Lee
21ce44374a st/mesa: Remove unnecessary header. 2010-10-27 09:33:13 -07:00
Vinson Lee
d674ee2a4d r600g: Silence uninitialized variable warnings. 2010-10-27 09:26:27 -07:00
Vinson Lee
d4cdd2fab0 mesa: Remove unnecessary headers. 2010-10-27 09:09:47 -07:00
Vinson Lee
3c8106402f r300g: Silence uninitialized variable warning.
Fixes this GCC warning.
r300_state_derived.c: In function 'r300_update_derived_state':
r300_state_derived.c:593: warning: 'r' may be used uninitialized in this function
r300_state_derived.c:593: note: 'r' was declared here
2010-10-27 09:02:00 -07:00
Tilman Sauerbeck
8ad9d83fdf r600g: Destroy the blitter.
This fix got lost in the state rework merge.

Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
2010-10-27 08:44:47 +02:00
Tilman Sauerbeck
c6b10cd986 r600g: In radeon_bo(), call LIST_INITHEAD early.
radeon_bo_destroy() will want to read the list field. Without this patch,
we'd end up evaluating the list pointers before they have been properly
set up when we destroyed the newly created bo if it cannot be mapped.

Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
2010-10-27 08:44:35 +02:00
Chia-I Wu
b762db62c2 mesa: Remove unnecessary glapitable.h includes.
With 07b85457d9, glapitable.h is included
by core mesa only to know the size of _glapi_table.  It is not necessary
as the same info is given by _gloffset_COUNT.

This change makes _glapi_table opaque to core mesa.  All operations on
it are supposed to go through one of the SET/GET/CALL macros.
2010-10-27 11:11:11 +08:00
Chia-I Wu
aefd4f76ea vbo: Use CALL_* macros.
Use macros to access _glapi_table consistently.  There is no functional
change.
2010-10-27 11:09:40 +08:00
Chia-I Wu
07b85457d9 glapi: Merge glapioffsets.h into glapidispath.h.
Move defines in glapioffsets.h to glapidispatch.h.  Rename
_gloffset_FIRST_DYNAMIC to _gloffset_COUNT, which is equal to the number
of entries in _glapi_table.

Consistently use SET_by_offset, GET_by_offset, CALL_by_offset, and
_gloffset_* to recursively define all SET/GET/CALL macros.
2010-10-27 11:07:29 +08:00
Chia-I Wu
e4dbfa44ed glapi: Do not use glapioffsets.h.
glapioffsets.h exists for the same reason as glapidispatch.h does.  It
is of no use to glapi.  This commit also drops the use of glapioffsets.h
in glx as glx is considered an extension to glapi when it comes to
defining public GL entries.
2010-10-27 10:49:33 +08:00
Brian Paul
412b960883 mesa: rename function to _mesa_is_format_integer_color()
Be a bit more clear about its operation.
2010-10-26 20:30:42 -06:00
Brian Paul
ab50148fda mesa: fix bug in _mesa_is_format_integer()
We only want to return true if it's an integer _color_ format, not a
depth and/or stencil format.
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=31143
2010-10-26 20:25:23 -06:00
Chia-I Wu
e213968f2b glapi: Move glapidispatch.h to core mesa.
It is a core mesa header, not a glapi header.
2010-10-27 10:08:27 +08:00
Chia-I Wu
b5022ad035 glapi: Do not use glapidispatch.h.
glapidispatch.h exists so that core mesa (libmesa.a) can be built for
DRI drivers or for non-DRI drivers as a compile time decision (whether
IN_DRI_DRIVER is defined).  It is of no use to glapi.  This commit also
drops the use of glapidispatch.h in glx and libgl-xlib as they are
considered extensions to glapi when it comes to defining public GL
entries.
2010-10-27 10:06:25 +08:00
Brian Paul
9b3c4d3e67 mesa: remove the unused _mesa_is_fragment_shader_active() function
This reverts commit 013d5ffeec.
2010-10-26 18:05:37 -06:00
Brian Paul
ccef2110ed mesa: call _mesa_valid_to_render() in glDrawPixels, glCopyPixels, glBitmap
This lets us simplify and consolidate some state checking code.

This implements the GL_INVALID_OPERATION check for all drawing commands
required by GL_EXT_texture_integer.
2010-10-26 18:05:37 -06:00
Brian Paul
705978e283 mesa: do integer FB / shader validation check in _mesa_valid_to_render() 2010-10-26 18:05:37 -06:00
Eric Anholt
bb4f12f538 i965: Disable register spilling on gen6 until it's fixed.
Avoids GPU hang on glsl-fs-convolution-1.
2010-10-26 15:07:25 -07:00
Eric Anholt
00bfdac5b8 i965: Fix VS URB entry sizing.
I'm trying to clamp to a minimum of 1 URB row, not a maximum of 1.

Fixes:
glsl-kwin-blur
glsl-max-varying
glsl-routing
2010-10-26 15:07:10 -07:00
Eric Anholt
88087ba1bf i965: Drop the eot argument to read messages, which can never be set. 2010-10-26 13:46:09 -07:00
Eric Anholt
3ee5d68075 i965: Add support for constant buffer loads on gen6.
Fixes glsl-fs-uniform-array-5.
2010-10-26 13:17:54 -07:00
Eric Anholt
519835de04 i965: Set up the constant buffer on gen6 when it's needed.
This was slightly confused because gen6_wm_constants does the push
constant buffer, while brw_wm_constants does pull constants.
2010-10-26 13:15:01 -07:00
Eric Anholt
6488cf46f5 i965: Fix typo in comment about state flags. 2010-10-26 12:19:46 -07:00
Eric Anholt
33c4b2370f i965: Handle new ir_unop_round_even in channel expression splitting. 2010-10-26 11:23:27 -07:00
Eric Anholt
62452e7d94 i965: Add support for discard instructions on gen6.
It's a little more painful than before because we don't have the handy
mask register any more, and have to make do with cooking up a value
out of the flag register.
2010-10-26 11:21:44 -07:00
Eric Anholt
9b1d26f78f i965: Add disasm for the flag register. 2010-10-26 11:21:44 -07:00
Eric Anholt
0e8c834ffa i965: Clear some undefined fields of g0 when using them for gen6 FB writes.
This doesn't appear to help any testcases I'm looking at, but it looks
like it's required.
2010-10-26 10:34:14 -07:00
Eric Anholt
1732a8bc72 i965: Use SENDC on the first render target write on gen6.
This is apparently required, as the thread will be initiated while it
still has dependencies, and this is what waits for those to be
resolved before writing color.
2010-10-26 10:34:10 -07:00
Eric Anholt
748f3744be i965: Clarify an XXX comment in FB writes with real info. 2010-10-26 10:34:10 -07:00
Eric Anholt
3789d5025a i965: Add EU code for dword scattered reads (constant buffer array indexing). 2010-10-26 10:34:10 -07:00
Chia-I Wu
547e7619aa egl_dri2: Fix a typo that make glFlush be called at wrong time.
We want to call glFlush when there is a current context.  That is,
old_ctx.  This is a regression introduced by
d19afc57fe.
2010-10-26 15:04:28 +08:00
Dave Airlie
d1acb92016 r600g: add assembler support for all the kcache fields. 2010-10-26 12:08:00 +10:00
Brian Paul
326b981d3f mesa: additional teximage error checks for GL_EXT_texture_integer 2010-10-25 19:21:55 -06:00
Brian Paul
862bb1b0ff mesa: additional switch cases for GL_EXT_texture_integer 2010-10-25 19:21:55 -06:00
Brian Paul
751e10fc01 mesa: additional glReadPixels error checks for GL_EXT_texture_integer 2010-10-25 19:21:55 -06:00
Dave Airlie
2d2bafdb30 r600g: fix magic 0x1 ->flat shade ena 2010-10-26 09:47:02 +10:00
Kenneth Graunke
ba2382f50d glsl: Fix constant component count in vector constructor emitting.
Fixes freedesktop.org bug #31101 as well as piglit test cases
assignment-type-mismatch.vert and constructor-28.vert.
2010-10-25 12:56:47 -07:00
Chad Versace
6e00627384 glsl: Fix ast-to-hir for ARB_fragment_coord_conventions
Function ast_declarator_list::hir(), when processing keywords added by
extension ARB_fragment_coord_conventions, made the mistake of checking only if
the extension was __supported by the driver__. The correct behavior is to check
if the extensi0n is __enabled in the parse state__.

NOTE: this is a candidate for the 7.9 branch.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2010-10-25 10:10:58 -07:00
Brian Paul
af03c14d4c translate: remove unused prototypes 2010-10-25 10:34:44 -06:00
Brian Paul
81d5afbbec translate: use function typedefs, casts to silence warnings 2010-10-25 10:31:56 -06:00
Marek Olšák
64276cffcb st/mesa: support RGBA16 and use it for RGBA12 as well
Tested with r300g.

Signed-off-by: Marek Olšák <maraeo@gmail.com>
2010-10-25 18:21:12 +02:00
Brian Paul
1686db70d6 rtasm: use pointer_to_func() to silence warning 2010-10-25 09:18:07 -06:00
Brian Paul
e1e7843d03 util: use pointer_to_func() to silence warning 2010-10-25 09:17:40 -06:00
Brian Paul
da580dbbe8 xlib: silence unused var warning 2010-10-25 09:17:09 -06:00
Brian Paul
2701eb342b mesa: fix uninitialized var warning
http://bugs.freedesktop.org/show_bug.cgi?id=31067
2010-10-25 09:11:26 -06:00
Brian Paul
f72e4b306b mesa: silence enum comparison warning
http://bugs.freedesktop.org/show_bug.cgi?id=31069
2010-10-25 09:10:36 -06:00
Marek Olšák
8449a4772a r300g: fix texture border for 16-bits-per-channel formats
This is kinda hacky, but it's hard to come up with a generic solution for
all formats when only a few are used in practice (I mostly get B8G8R8*8).
2010-10-24 23:43:13 +02:00
Marek Olšák
6e61853590 mesa: allow FBO attachments of formats LUMINANCE, LUMINANCE_ALPHA, and INTENSITY
As per the GL_ARB_framebuffer_object specification.

Signed-off-by: Marek Olšák <maraeo@gmail.com>
2010-10-24 23:14:01 +02:00
Jon TURNEY
70f60c9c89 Ensure -L$(TOP)/$(LIB_DIR) appears in link line before any -L in $LDFLAGS
Ensure -L$(TOP)/$(LIB_DIR) (the staging dir for build products), appears
in the link line before any -L in $LDFLAGS, so that we link driver we are
building with libEGL we have just built, and not an installed version

[olv: make a similar change to targets/egl]

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2010-10-24 23:13:49 +08:00
Dave Airlie
a20c2347a0 r600g: drop more common state handling code 2010-10-24 13:04:44 +10:00
Tilman Sauerbeck
f4a2c62af5 r600g: Also clear bc data when we're destroying a shader.
[airlied: remove unused vars]

Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-10-24 12:56:35 +10:00
Tilman Sauerbeck
ccb9be1056 r600g: Added r600_pipe_shader_destroy().
Not yet complete.

Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-10-24 12:55:18 +10:00
Dave Airlie
9612b482e2 r600g: merge more of the common r600/evergreen state handling 2010-10-24 12:53:50 +10:00
Tilman Sauerbeck
9f9d24c89a r600g: Fixed r600_vertex_element leak.
Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-10-24 12:44:56 +10:00
Brian Paul
d8740b77ac softpipe: remove >32bpp color restriction
The comment was out of date.  The tile cache does handle >32-bit colors.
2010-10-23 10:27:21 -06:00
Brian Paul
e6ac8d5353 st/mesa: be smarter choosing texture format for glDrawPixels()
This lets us get an integer texture format for integer pixel formats.
2010-10-23 10:23:08 -06:00
Brian Paul
efd9e24312 mesa: display list support for GL_EXT_texture_integer 2010-10-23 10:19:31 -06:00
Brian Paul
98bb70ac84 mesa: plug in GL_EXT_texture_integer functions 2010-10-23 10:19:31 -06:00
Brian Paul
01e13a7d75 mesa: regenerated API files for GL_EXT_texture_integer 2010-10-23 10:19:31 -06:00
Brian Paul
fd6f17c21a glapi: include/build EXT_texture_integer.xml 2010-10-23 10:19:31 -06:00
Brian Paul
9d73c4a9d5 glapi: GL_EXT_texture_integer API 2010-10-23 10:19:31 -06:00
Brian Paul
646afcc340 mesa: simplify target_can_be_compressed() function 2010-10-23 10:19:31 -06:00
Brian Paul
77ca2044a0 st/mesa: add format selection for signed/unsigned integer formats 2010-10-23 10:19:30 -06:00
Brian Paul
d72bf5e79d mesa: added cases for GL_EXT_texture_integer 2010-10-23 10:19:30 -06:00
Brian Paul
7a60512f84 mesa: added cases for GL_EXT_texture_integer formats 2010-10-23 10:19:30 -06:00
Brian Paul
c7d18374dd mesa: compute _IntegerColor field in _mesa_test_framebuffer_completeness() 2010-10-23 10:19:30 -06:00
Brian Paul
9968a3960f mesa: added glGet query for GL_RGBA_INTEGER_MODE_EXT 2010-10-23 10:19:30 -06:00
Brian Paul
f681ea4741 mesa: added new gl_framebuffer::_IntegerColor field 2010-10-23 10:19:30 -06:00
Brian Paul
9ee07a0a27 mesa: added new gl_extensions::EXT_gpu_shader4 field 2010-10-23 10:19:30 -06:00
Brian Paul
4250882ccf softpipe: added some texture sample debug code (disabled) 2010-10-23 10:19:30 -06:00
Brian Paul
2502ee6738 mesa: new glDrawPixels error check for integer formats 2010-10-23 10:19:30 -06:00
Brian Paul
013d5ffeec mesa: added _mesa_is_fragment_shader_active() helper 2010-10-23 10:19:30 -06:00
Brian Paul
f1e97dc264 mesa: minor reformatting, clean-ups 2010-10-23 10:19:30 -06:00
Brian Paul
f5ed39e7e6 mesa: _mesa_is_format_integer() function 2010-10-23 10:19:29 -06:00
Brian Paul
a0bc8eeb32 mesa: _mesa_ClearColorIuiEXT() and _mesa_ClearColorIiEXT()
For GL_EXT_texture_integer.
2010-10-23 10:19:29 -06:00
Brian Paul
f6dbb693d2 mesa: add pixel packing for unscaled integer types
And add some missing GL_RG cases.
2010-10-23 10:19:29 -06:00
Brian Paul
1c131752c3 mesa: split up the image.c file
New files:
pack.c - image/row packing/unpacking functions
pixeltransfer.c - pixel scale/bias/lookup functions
2010-10-23 10:19:29 -06:00
Brian Paul
e67f6ee96e mesa: simplify fbo format checking code 2010-10-23 10:19:29 -06:00
Brian Paul
f9288540ec mesa: 80-column wrapping 2010-10-23 10:19:29 -06:00
Brian Paul
b4c013307b docs: updated GL3 status for primitive restart 2010-10-23 10:19:29 -06:00
Chia-I Wu
6c13fdf60e st/egl: Use resource reference count for egl_g3d_sync. 2010-10-23 17:28:56 +08:00
Chia-I Wu
0d43cbed2f egl: Fix a false negative check in _eglCheckMakeCurrent.
This call sequence

  eglMakeCurrent(dpy, surf, surf, ctx1);
  eglMakeCurrent(dpy, surf, surf, ctx2);

should be valid if ctx1 and ctx2 have the same client API and are not
current in another thread.
2010-10-23 16:58:38 +08:00
Chia-I Wu
d19afc57fe egl: Use reference counting to replace IsLinked or IsBound.
Remove all _egl<Res>IsLinked and _egl<Res>IsBound.  Update
_eglBindContext and drivers to do reference counting.
2010-10-23 15:26:28 +08:00
Chia-I Wu
dc4f845c37 egl: Add reference count for resources.
This is a really simple mechanism.  There is no atomicity and the caller
is expected to hold the display lock.
2010-10-23 15:19:34 +08:00
Chia-I Wu
662e098b56 st/egl: Fix native_mode refresh mode.
Define the unit to match _EGLMode's.
2010-10-23 11:32:06 +08:00
Chia-I Wu
e32ac5b8a9 egl: Fix _eglModeLookup.
Internally a mode belongs to a screen.  But functions like
eglGetModeAttribMESA treat a mode as a display resource: a mode can be
looked up without a screen.  Considering how KMS works, it is better to
stick to the current implementation.

To properly support looking up a mode without a screen, this commit
assigns each mode (of all screens) a unique ID.
2010-10-23 11:20:41 +08:00
Chia-I Wu
37213ceacc egl: Minor changes to the _EGLScreen interface.
Make _eglInitScreen take a display and rename _eglAddScreen to
_eglLinkScreen.  Remove unused functions.
2010-10-23 11:20:41 +08:00
Chia-I Wu
8a6bdf3979 egl: Minor changes to the _EGLConfig interface.
Mainly to rename _eglAddConfig to _eglLinkConfig, along with a few clean
ups.
2010-10-23 11:20:40 +08:00
Chia-I Wu
4ce33ec606 egl: Drop dpy argument from the link functions.
All display resources are already initialized with a display.  Linking
simply links a resource to its display.
2010-10-23 11:20:40 +08:00
Eric Anholt
07cd8f46ac i965: Add support for pull constants to the new FS backend.
Fixes glsl-fs-uniform-array-5, but not 6 which fails in ir_to_mesa.
2010-10-22 14:53:21 -07:00
Eric Anholt
ff622d5528 i965: Move the FS disasm/annotation printout to codegen time.
This makes it a lot easier to track down where we failed when some
code emit triggers an assert.  Plus, less memory allocation for
codegen.
2010-10-22 14:53:21 -07:00
Dave Airlie
39c742fe2a r600g: not fatal if we can't get tiling info from kernel 2010-10-23 07:45:59 +10:00
Marek Olšák
469907d597 r300g: say no to PIPE_CAP_STREAM_OUTPUT and PIPE_CAP_PRIMITIVE_RESTART 2010-10-22 20:34:28 +02:00
Marek Olšák
1d96ad67bc r300g: do not print get_param errors in non-debug build 2010-10-22 20:34:27 +02:00
Keith Whitwell
a1ca5ac7c2 llvmpipe: turn off draw offset/twoside when we can handle it 2010-10-22 18:58:36 +01:00
Brian Paul
dd2499b484 mesa: move declaration before code 2010-10-22 08:59:06 -06:00
Brian Paul
67f6a4a8c4 galahad: silence warnings 2010-10-22 08:58:35 -06:00
Francisco Jerez
a00eec5295 dri/nouveau: Force a "slow" Z clear if we're getting a new depth buffer. 2010-10-22 13:43:57 +02:00
Chia-I Wu
25328509c9 egl: Move fallback routines to eglfallbacks.c.
We do not want them to be all over the places.
2010-10-22 18:38:30 +08:00
Chia-I Wu
5664a98386 egl: Parse image attributes with _eglParseImageAttribList.
Avoid code duplications.
2010-10-22 18:35:09 +08:00
Chia-I Wu
713c8734f4 egl: Move attributes in _EGLImage to _EGLImageAttribs.
The opaque nature of EGLImage implies that extensions almost always
define their own attributes.  Move attributes in _EGLImage to
_EGLImageAttribs and add a helper function to parse attribute lists.
2010-10-22 17:15:45 +08:00
Chia-I Wu
ecca5571b6 egl_glx: Fix borken driver.
The driver was broken since 6eda3f311b.
All configs fail to pass _eglValidateConfig.
2010-10-22 16:26:25 +08:00
Chia-I Wu
0ed96efc1b egl_glx: Drop the use of [SG]ET_CONFIG_ATTRIB.
_EGLConfig can be directly dereferenced now.  Since egl_glx is the last
user of the macros, drop the macros too.
2010-10-22 16:26:25 +08:00
Chia-I Wu
b67f7295b7 egl_dri2: Drop the use of _egl[SG]etConfigKey.
_EGLConfig can be directly dereferenced now.
2010-10-22 16:26:25 +08:00
Brian Paul
aa86c7657c winsys/xlib: rename xm->xlib
Move away from the old Mesa-oriented names.
2010-10-21 19:55:03 -06:00
Brian Paul
3bc6fe371c winsys/xlib: fix up allocation/dealloction of XImage
Fixes a crash upon exit when using remote display.
2010-10-21 19:49:34 -06:00
Brian Paul
4d24f01cb3 winsys/xlib: use Bool type for shm field 2010-10-21 19:37:11 -06:00
Brian Paul
e3298eaf52 winsys/xlib: formatting fixes 2010-10-21 19:17:44 -06:00
Brian Paul
69a07be3e5 Merge branch 'primitive-restart-cleanup'
Conflicts:
	docs/relnotes-7.10.html

This branch is a re-do of the primitive-restart branch with all
the intermediate/temporary stuff cleaned out.
2010-10-21 19:05:47 -06:00
Brian Paul
b2d4dfe5cc docs: added GL_NV_primitive_restart extension 2010-10-21 19:03:39 -06:00
Brian Paul
6692ed6f03 llvmpipe: enable primitive restart 2010-10-21 19:03:38 -06:00
Brian Paul
27d3bab055 softpipe: enable primitive restart 2010-10-21 19:03:38 -06:00
Brian Paul
0eaaceb218 draw: implement primitive splitting for primitive restart 2010-10-21 19:03:38 -06:00
Brian Paul
053875a8b1 st/mesa: support for primitive restart 2010-10-21 19:03:38 -06:00
Brian Paul
adf35e80d3 gallium: new CAP, state for primitive restart 2010-10-21 19:03:38 -06:00
Brian Paul
be45255ab1 vbo: support for primitive restart
We handle splitting of glDrawArrays() calls into two primitives here
so that drivers don't have to worry about it.
2010-10-21 19:03:38 -06:00
Brian Paul
b3de6e703d mesa: plug in primitive restart function 2010-10-21 19:03:38 -06:00
Brian Paul
4f495ec20e mesa: regenerated files with primitive restart 2010-10-21 19:03:38 -06:00
Brian Paul
1cae8b5448 mesa: API spec for primitive restart 2010-10-21 19:03:38 -06:00
Brian Paul
7f26ad80ba mesa: set/get primitive restart state 2010-10-21 19:03:38 -06:00
Brian Paul
a80afbd99e mesa: driver hook for primitive restart 2010-10-21 19:03:38 -06:00
Eric Anholt
1d91f8d916 i965: Be more aggressive in tracking live/dead intervals within loops.
Fixes glsl-fs-convolution-2, which was blowing up due to the array
access insanity getting at the uniform values within the loop.  Each
temporary was considered live across the whole loop.
2010-10-21 16:55:26 -07:00
Brian Paul
13cd611f56 docs: add GL_ARB_texture_rg to release notes 2010-10-21 17:05:36 -06:00
Brian Paul
9ad4589e7e docs: update texture red/green support in GL3.txt 2010-10-21 17:05:35 -06:00
Brian Paul
b66a92de8c st/mesa: added cases for GL_COMPRESSED_RED/RG in st_choose_format() 2010-10-21 17:05:35 -06:00
Brian Paul
d4a296caaa mesa: add missing cases for packing red/green images 2010-10-21 17:05:35 -06:00
Brian Paul
d4c1bcce44 mesa: add GL_RG case to _mesa_source_buffer_exists()
Fixes failure with glReadPixels(format=GL_RG)
2010-10-21 17:05:35 -06:00
Brian Paul
154d91cad9 draw: fix typo in comment 2010-10-21 17:05:35 -06:00
Eric Anholt
4e72525109 i965: Correct scratch space allocation.
One, it was allocating increments of 1kb, but per thread scratch space
is a power of two.  Two, the new FS wasn't getting total_scratch set
at all, so everyone thought they had 1kb and writes beyond 1kb would
go stomping on a neighbor thread.

With this plus the previous register spilling for the new FS,
glsl-fs-convolution-1 passes.
2010-10-21 15:21:28 -07:00
Eric Anholt
0b77d57394 i965: Don't emit register spill offsets directly into g0.
g0 is used by others, and is expected to be left exactly as it was
dispatched to us.  So manually move g0 into our message reg when
spilling/unspilling and update the offset in the MRF.  Fixes failures
in texture sampling after having spilled a register.
2010-10-21 15:21:28 -07:00
Eric Anholt
99b2c8570e i965: Add support for register spilling.
It can be tested with if (0) replaced with if (1) to force spilling for all
virtual GRFs.  Some simple tests work, but large texturing tests fail.
2010-10-21 15:21:01 -07:00
Eric Anholt
7a3f113e79 i965: Fix gl_FrontFacing emit on pre-gen6.
It's amazing this code worked.  Basically, we would get lucky in
register allocation and the tests using frontfacing would happen to
allocate gl_FrontFacing storage and the instructions generating
gl_FrontFacing but pointing at another register to the same hardware
register.  Noticed during register spilling debug, when suddenly they
didn't get allocatd the same storage.
2010-10-21 15:20:01 -07:00
Eric Anholt
5ac6c4ecfe i965: Split register allocation out of the ever-growing brw_fs.cpp. 2010-10-21 15:20:01 -07:00
Kenneth Graunke
3f5fde5c45 Refresh autogenerated file builtin_function.cpp.
Since this is just generated by python, it's questionable whether this
should continue to live in the repository - Mesa already has other
things generated from python as part of the build process.
2010-10-21 11:46:08 -07:00
Kenneth Graunke
2cacaf6e7b generate_builtins.py: Output large strings as arrays of characters.
This works around MSVC's 65535 byte limit, unfortunately at the expense
of any semblance of readability and much larger file size.  Hopefully I
can implement a better solution later, but for now this fixes the build.
2010-10-21 11:45:38 -07:00
Vinson Lee
50095ac87c gallivm: Silence uninitialized variable warning.
Fixes this GCC warning.
gallivm/lp_bld_tgsi_aos.c: In function 'lp_build_tgsi_aos':
gallivm/lp_bld_tgsi_aos.c:516: warning: 'dst0' may be used uninitialized in this function
gallivm/lp_bld_tgsi_aos.c:516: note: 'dst0' was declared here
2010-10-21 11:27:35 -07:00
Vinson Lee
fc59790b87 gallivm: Silence uninitialized variable warnings.
Fixes these GCC warnings.
gallivm/lp_bld_sample_aos.c: In function 'lp_build_sample_image_nearest':
gallivm/lp_bld_sample_aos.c:271: warning: 't_ipart' may be used uninitialized in this function
gallivm/lp_bld_sample_aos.c:271: warning: 'r_ipart' may be used uninitialized in this function
2010-10-21 11:21:03 -07:00
Vinson Lee
0a5666148b gallivm: Silence uninitialized variable warnings.
Fixes these GCC warnings.
gallivm/lp_bld_sample_aos.c: In function 'lp_build_sample_image_linear':
gallivm/lp_bld_sample_aos.c:439: warning: 'r_ipart' may be used uninitialized in this function
gallivm/lp_bld_sample_aos.c:438: warning: 't_ipart' may be used uninitialized in this function
gallivm/lp_bld_sample_aos.c:438: warning: 't_fpart' may be used uninitialized in this function
gallivm/lp_bld_sample_aos.c:439: warning: 'r_fpart' may be used uninitialized in this function
gallivm/lp_bld_sample_aos.c:438: warning: 't_fpart_hi' may be used uninitialized in this function
gallivm/lp_bld_sample_aos.c:438: warning: 't_fpart_lo' may be used uninitialized in this function
gallivm/lp_bld_sample_aos.c:439: warning: 'r_fpart_hi' may be used uninitialized in this function
gallivm/lp_bld_sample_aos.c:439: warning: 'r_fpart_lo' may be used uninitialized in this function
2010-10-21 11:10:15 -07:00
Chia-I Wu
16333e1fc4 mesa: Remove unused vtxfmt_tmp.h.
It was used by the "neutral" tnl module that was dropped in
81ccb3e2ce.
2010-10-21 22:03:34 +08:00
Dave Airlie
f39e6c9c81 r600g: start splitting out common code from eg/r600.
no point duplicating code that doesn't touch hw, also make it easier
to spot mistakes
2010-10-21 19:58:09 +10:00
Dave Airlie
e68c83a5a0 r600g: initial translate state support 2010-10-21 19:58:08 +10:00
Vinson Lee
3a54195679 draw: Remove unnecessary header. 2010-10-21 01:47:52 -07:00
Vinson Lee
abc5435f22 llvmpipe: Remove unnecessary header. 2010-10-21 01:44:48 -07:00
Kenneth Graunke
cc04347b8d glsl: Refresh autogenerated file builtin_function.cpp. 2010-10-21 00:14:38 -07:00
Kenneth Graunke
574c53f551 glsl: Add support for GLSL 1.30's modf built-in. 2010-10-21 00:14:37 -07:00
Kenneth Graunke
94a36faed7 glcpp: Refresh autogenerated lexer file. 2010-10-21 00:13:33 -07:00
Kenneth Graunke
bd55ba568b glcpp: Return NEWLINE token for newlines inside multi-line comments.
This is necessary for the main compiler to get correct line numbers.
2010-10-21 00:13:33 -07:00
Dave Airlie
089aa0ba24 r600g: add texture tiling enable under a debug option.
At the moment you need kernel patches to have texture tiling work
with the kernel CS checker, so once they are upstream and the drm version
is bumped we can make this enable flip the other way most likely.
2010-10-21 13:40:45 +10:00
Dave Airlie
cdd14668b6 r600g: add texture tiling alignment support.
this sets things up to align stride/height with tile sizes,
it also adds support for the 2D/1D array mode cross over point.
2010-10-21 13:37:54 +10:00
Dave Airlie
92ed84d115 r600g: introduce a per-driver resource flag for transfers.
this is to be used to decide not to tile a surface being used for transfers.
2010-10-21 13:36:01 +10:00
Dave Airlie
91e513044d r600g: add r600 surface to store the aligned height.
we need to know the aligned height when binding the surface to cb/zb,
not the gallium surface height.
2010-10-21 13:33:00 +10:00
Dave Airlie
388ce31baa r600g: start adding hooks for aligning width/height for tiles. 2010-10-21 13:32:08 +10:00
Dave Airlie
ea5aab85fd r600g: move to per-miplevel array mode.
Since the hw transitions from 2D->1D sampling below the 2D macrotile
size we need to keep track of the array mode per level so we can
render to it using the CB.
2010-10-21 13:32:08 +10:00
Dave Airlie
206fbd9640 r600g: all non-0 mipmap levels need to be w/h aligned to POT.
this adds a new minify function to the driver to ensure this.
2010-10-21 13:20:14 +10:00
Vinson Lee
2e5764ccf4 swrast: Print out format on unexpected failure in _swrast_DrawPixels. 2010-10-20 15:27:48 -07:00
Kenneth Graunke
b970da4d24 mesa: Remove FEATURE_ARB_shading_language_120 macro.
Everything should be able to support 1.20 at this point.
2010-10-20 15:07:47 -07:00
Kenneth Graunke
a75da2c0e8 glsl: Remove useless ir_shader enumeration value. 2010-10-20 15:07:47 -07:00
Vinson Lee
460da0db4a glsl: Add assert for unhandled ir_shader case.
Silences this GCC warning.
ast_to_hir.cpp: In function 'void apply_type_qualifier_to_variable(const
ast_type_qualifier*, ir_variable*, _mesa_glsl_parse_state*, YYLTYPE*)'
ast_to_hir.cpp:1768: warning: enumeration value 'ir_shader' not handled
in switch
2010-10-20 14:10:26 -07:00
Brian Paul
c492066071 draw: use float version of LLVM Mul/Add instructions
LLVM 2.8 is pickier about int vs float instructions and operands.
2010-10-20 14:56:42 -06:00
Brian Paul
f36346c116 llvmpipe/draw: always enable LLVMAddInstructionCombiningPass()
We were working around an LLVM 2.5 bug but we're using LLVM 2.6 or later now.
This basically reverts commit baddcbc522.
This fixes the piglit bug/tri-tex-crash.c failure.
2010-10-20 14:49:07 -06:00
Orion Poplawski
5a3ac74ad5 osmesa: link against libtalloc
Otherwise consumers have to, and that's lame.

Signed-off-by: Adam Jackson <ajax@redhat.com>
2010-10-20 15:54:57 -04:00
Vinson Lee
89c26866f0 r600g: Ensure r600_src is initialized in tgsi_exp function.
Silences these GCC warnings.
r600_shader.c: In function 'tgsi_exp':
r600_shader.c:2339: warning: 'r600_src[0].rel' is used uninitialized in this function
r600_shader.c:2339: warning: 'r600_src[0].abs' is used uninitialized in this function
r600_shader.c:2339: warning: 'r600_src[0].neg' is used uninitialized in this function
r600_shader.c:2339: warning: 'r600_src[0].chan' is used uninitialized in this function
r600_shader.c:2339: warning: 'r600_src[0].sel' is used uninitialized in this function
2010-10-20 12:44:08 -07:00
Vinson Lee
289900439f draw: Move loop variable declaration outside for loop.
Fixes MSVC build.
2010-10-19 23:48:59 -07:00
Keith Whitwell
05921fd4e5 draw: make sure viewport gets updated in draw llvm shader
The viewport state was being baked in at compile time (oops...)
2010-10-19 22:11:49 -07:00
Keith Whitwell
cd6a31cd4a Merge branch 'llvm-cliptest-viewport' 2010-10-19 21:41:28 -07:00
Hui Qi Tay
ab2e1edd1f draw: corrections to allow for different cliptest cases 2010-10-19 21:34:42 -07:00
Eric Anholt
ae5698e604 i965: Use the new style of IF statement with embedded comparison on gen6.
"Everyone else" does it this way, so follow suit.  It's fewer
instructions, anyway.
2010-10-19 21:17:55 -07:00
Eric Anholt
6ea108e7db i965: Set the source operand types for gen6 if/else/endif to integer.
I don't think this should matter, but I'm not sure, and it's
recommended by a kernel checker in fulsim.
2010-10-19 21:17:55 -07:00
Eric Anholt
d0c87b90a8 i965: Add EU emit support for gen6's new IF instruction with comparison. 2010-10-19 21:17:55 -07:00
Ian Romanick
cc90e62d70 linker: Improve handling of unread/unwritten shader inputs/outputs
Previously some shader input or outputs that hadn't received location
assignments could slip through.  This could happen when a shader
contained user-defined varyings and was used with either
fixed-function or assembly shaders.

See the piglit tests glsl-[fv]s-user-varying-ff and
sso-user-varying-0[12].

NOTE: this is a candidate for the 7.9 branch.
2010-10-19 18:12:32 -07:00
Chad Versace
974fb466f2 glsl: Commit generated file glsl_lexer.cpp
Changes are due to commit "glsl: Fix lexer rule for ^=".
2010-10-19 13:17:33 -07:00
Chad Versace
cba9062d58 glsl: Fix lexer rule for ^=
The caret is a special character, and needs to be quoted or escaped.
2010-10-19 13:17:33 -07:00
Chad Versace
d03ac0f8d8 glsl: Implement ast-to-hir for bit-logic ops
Implement by adding to ast_expression::hir() the following cases:
    - ast_and_assign
    - ast_or_assign
    - ast_xor_assign
2010-10-19 13:17:33 -07:00
Chad Versace
cfdbf8bc84 glsl: Define bit_logic_result_type() in ast_to_hir.cpp
This function type checks the operands of and returns the result type of
bit-logic operations.  It replaces the type checking performed in the
following cases of ast_expression::hir() :
    - ast_bit_and
    - ast_bit_or
    - ast_bit_xor
2010-10-19 13:17:33 -07:00
Chad Versace
338ed6ec29 glsl: Implement ast-to-hir for bit-shift-assignment
Implement by adding to ast_expression::hir() these cases:
    - ast_ls_assign
    - ast_rs_assign
2010-10-19 13:17:33 -07:00
Chad Versace
c0197ab0af glsl: Define shift_result_type() in ast_to_hir.cpp
This function type checks the operands of and returns the result type of
bit-shift operations. It replaces the type checking performed in the following
cases of ast_expression::hir() :
    - ast_lshift
    - ast_rshift
2010-10-19 13:17:33 -07:00
Eric Anholt
f30de69640 i965: Disable thread dispatch when the FS doesn't do any work.
This should reduce the cost of generating shadow maps, for example.
No performance difference measured in nexuiz, though it does trigger
this path.
2010-10-19 10:49:20 -07:00
Eric Anholt
2595589f1d i965: Remove the gen6 emit_mi_flushes I sprinkled around the driver.
These were for debugging in bringup.  Now that relatively complicated
apps are working, they haven't helped debug anything in quite a while.
2010-10-19 10:49:19 -07:00
Eric Anholt
32573792de i965: Tell the shader compiler when we expect depth writes for gen6.
This fixes hangs in some Z-writes-in-shaders tests, though other
pieces don't come out correctly.

Bug #30392: hang in fbo-fblit-d24s8. (still fails with bad color drawn
to some targets)
2010-10-19 10:48:56 -07:00
Vinson Lee
36dde032a4 llvmpipe: Initialize variable. 2010-10-19 10:14:11 -07:00
Vinson Lee
22725eb3e8 llvmpipe: Initialize state variable in debug_bin function. 2010-10-19 10:02:28 -07:00
Vinson Lee
a143b6d5d8 st/xorg: Fix memory leak on error path. 2010-10-19 09:49:15 -07:00
Brian Paul
ec2824cd86 gallivm: fix incorrect type for zero vector in emit_kilp()
http://bugs.freedesktop.org/show_bug.cgi?id=30974
2010-10-19 09:14:19 -06:00
Brian Paul
988b246c47 mesa: fix mesa version string construction
Now that MESA_MINOR=10, we no longer need the extra '0' in the
version string.
2010-10-19 08:59:27 -06:00
Thomas Hellstrom
f82d984352 mesa: Make sure we have the talloc cflags when using the talloc headers
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2010-10-19 14:18:20 +02:00
Thomas Hellstrom
9e96b695b0 st/xorg: Fix compilation for Xservers >= 1.10
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2010-10-19 12:08:06 +02:00
Thomas Hellstrom
543136d5bd xorg/vmwgfx: Don't use deprecated x*alloc / xfree functions
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2010-10-19 11:28:24 +02:00
Thomas Hellstrom
2ab7a8a3eb st/xorg: Don't use deprecated x*alloc / xfree functions
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2010-10-19 11:28:18 +02:00
Thomas Hellstrom
0301c9ac62 st/xorg: Fix compilation errors for Xservers compiled without Composite
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2010-10-19 11:28:08 +02:00
Thomas Hellstrom
0d0a6e9096 st/xorg, xorg/vmwgfx: Be a bit more frendly towards cross-compiling environments
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2010-10-19 11:27:54 +02:00
Vinson Lee
f36a642030 r300/compiler: Remove unused variable. 2010-10-19 00:07:22 -07:00
Tom Stellard
f822cc22f2 r300g: Add new debug option for logging vertex/fragment program stats 2010-10-18 20:51:05 -07:00
Tom Stellard
9d2ab6cb00 r300/compiler: Add a new function for more efficient dataflow analysis
rc_get_readers_normal() supplies a list of readers for a given
instruction.  This function is now being used by the copy propagate
optimization and will eventually be used by most other optimization
passes as well.
2010-10-18 20:51:05 -07:00
Tom Stellard
3cdff41d92 r300/compiler: Clear empty registers after constant folding 2010-10-18 20:51:05 -07:00
Tom Stellard
75734d0a37 r300/compiler: Fix incorrect assumption
It is possible for a single pair instruction arg to select from both an
RGB and an Alpha source.
2010-10-18 20:51:05 -07:00
Tom Stellard
ad683577b2 r300/compiler: Create a helper function for merging presubtract sources 2010-10-18 20:51:05 -07:00
Kenneth Graunke
80c9f756b2 i965: Remove unused variable. 2010-10-18 18:44:19 -07:00
Kenneth Graunke
9c80fa824c glsl: Regenerate parser files. 2010-10-18 17:40:09 -07:00
Kenneth Graunke
0eb0b44647 glsl: Fix copy and paste error in ast_bit_and node creation.
All & operations were incorrectly being generated as ast_bit_or.
2010-10-18 17:40:09 -07:00
Eric Anholt
4af2937416 i965: Avoid blits in BufferCopySubdata on gen6.
Fixes glean/bufferObject.
2010-10-18 14:14:06 -07:00
Eric Anholt
641028debf i965: Fix scissor-offscreen on gen6 like we did pre-gen6. 2010-10-18 13:11:29 -07:00
Eric Anholt
022531209d i965: Assert out on gen6 VS constant buffer reads that hang the GPU for now. 2010-10-18 12:56:44 -07:00
Eric Anholt
66800a04e5 i965: Fix assertion failure on gen6 BufferSubData to busy BO.
Fixes fbo-blit and probably several other tests.
2010-10-18 12:56:44 -07:00
Eric Anholt
746e68c50b i965: Fix a weirdness in NOT handling.
XOR makes much more sense.  Note that the previous code would have
failed for not(not(x)), but that gets optimized out.
2010-10-18 12:56:44 -07:00
Eric Anholt
ea213417f1 i965: Disable the debug printf I added for FS disasm. 2010-10-18 12:56:44 -07:00
Kenneth Graunke
65d4234c23 i965: Add missing "break" statement.
Otherwise, it would try to handle arrays as structures, use
uninitialized memory, and crash.
2010-10-18 12:21:20 -07:00
José Fonseca
f37b114dc3 llvmpipe: Don't test rounding of x.5 numbers.
SSE4.1 has different rules, and so far this doesn't seem to cause any
problems with conformance test suites.
2010-10-18 09:35:21 -07:00
José Fonseca
ac17c62ece gallivm: Add a note about SSE4.1's nearest mode rounding. 2010-10-18 09:32:35 -07:00
Brian Rogers
746b602fbd mesa: Add missing else in do_row_3D
This fixes erroneous "bad format in do_row()" messages

Signed-off-by: Brian Paul <brianp@vmware.com>
2010-10-18 08:11:04 -06:00
Brian Paul
01e0aaefcc llvmpipe: remove lp_setup_coef*.c files from Makefile 2010-10-18 07:59:02 -06:00
Victor Tseng
e19187e1be egl/i965: include inline_wrapper_sw_helper.h
Signed-off-by: Brian Paul <brianp@vmware.com>
2010-10-18 07:55:52 -06:00
Kenneth Graunke
b8276e46f5 glsl: Don't return NULL IR for erroneous bit-shift operators.
Existing code relies on IR being generated (possibly with error type)
rather than returning NULL.  So, don't break - go ahead and generate the
operation.  As long as an error is flagged, things will work out.

Fixes fd.o bug #30914.
2010-10-18 00:26:14 -07:00
Dave Airlie
8a74f7422b r600g: retrieve tiling info from kernel for shared buffers.
we need to know if the back is tiled so we can blit from it properly.
2010-10-18 13:46:42 +10:00
Dave Airlie
375613afe3 r600g: fix transfer function for tiling.
this makes readback with tiled back work better.
2010-10-18 13:46:42 +10:00
Dave Airlie
c61b97d504 r600g: attempt to cleanup depth blit
cleanup what I'm nearly sure is unnecessary work in the depth blit code.
2010-10-18 13:46:25 +10:00
Dave Airlie
21c6459dfb r600g: depth needs to bound to ds 2010-10-18 13:39:55 +10:00
Dave Airlie
69f8eebe72 r600g: fix typo in tiling setup cb code. 2010-10-18 13:39:55 +10:00
Dave Airlie
a1b7333c07 r600g: do proper tracking of views/samplers.
we need to do pretty much what r300g does in for this, this fixes some
issues seen while working on tiling.
2010-10-18 13:39:54 +10:00
Keith Whitwell
9da17fed2e llvmpipe: remove unused arg from jit_setup_tri function 2010-10-17 19:23:40 -07:00
Keith Whitwell
75799b8d02 llvmpipe: remove unused file 2010-10-17 19:11:47 -07:00
Keith Whitwell
0072acd447 Merge remote branch 'origin/master' into lp-setup-llvm
Conflicts:
	src/gallium/drivers/llvmpipe/lp_setup_coef.c
	src/gallium/drivers/llvmpipe/lp_setup_coef.h
	src/gallium/drivers/llvmpipe/lp_setup_coef_intrin.c
	src/gallium/drivers/llvmpipe/lp_setup_point.c
	src/gallium/drivers/llvmpipe/lp_setup_tri.c
	src/gallium/drivers/llvmpipe/lp_state_derived.c
	src/gallium/drivers/llvmpipe/lp_state_fs.h
2010-10-17 19:09:42 -07:00
Keith Whitwell
ca2b2ac131 llvmpipe: fail cleanly on malloc failure in lp_setup_alloc_triangle 2010-10-17 18:48:11 -07:00
Keith Whitwell
543fb77dde llvmpipe: remove setup fallback path 2010-10-17 18:29:28 -07:00
José Fonseca
4dfb43c6a6 gallivm: Comment lp_build_insert_new_block(). 2010-10-17 18:23:18 -07:00
Keith Whitwell
b5236f3da4 llvmpipe: clean up fields in draw_llvm_variant_key 2010-10-17 17:53:29 -07:00
Dave Airlie
5b966f58e3 r600g: set tiling bits in hw state 2010-10-18 09:25:22 +10:00
Dave Airlie
7b3fa03883 r600g: get tiling info from kernel 2010-10-18 09:25:22 +10:00
Dave Airlie
e8e20313af r600g: add defines for tiling 2010-10-18 09:25:22 +10:00
Dave Airlie
82114ac02a r600g: switch to a common formats.h file since they are in different regs 2010-10-18 09:13:46 +10:00
Vinson Lee
c9d297162a llvmpipe: Return non-zero exit code for lp_test_round failures. 2010-10-17 14:09:53 -07:00
Hui Qi Tay
c1d6b31866 draw: corrections for w coordinate 2010-10-17 10:57:43 -07:00
José Fonseca
4afad7d3ed llvmpipe: Initialize bld ctx via lp_build_context_init instead of ad-hoc and broken code. 2010-10-17 10:15:15 -07:00
José Fonseca
a0add0446c llvmpipe: Fix bad refactoring.
'i' and 'chan' have random values here, which could cause a buffer
overflow in debug builds, if chan > 4.
2010-10-17 09:58:04 -07:00
José Fonseca
dc5bdbe0f9 gallivm: Fix SoA cubemap derivative computation.
Derivatives are now scalar.

Broken since 17dbd41cf2.
2010-10-17 09:43:18 -07:00
José Fonseca
709699d2e2 llvmpipe: Ensure z_shift and z_width is initialized. 2010-10-17 07:45:08 -07:00
José Fonseca
914b0d34e8 llvmpipe: Fix depth-stencil regression.
If stencil is enabled then we need to load the z_dst, even if depth
testing is disabled.

This fixes reflect mesa demo.
2010-10-17 07:22:34 -07:00
Dave Airlie
98b3f27439 r600g: add evergreen ARL support.
Thanks to Alex Deucher for pointing out the FLT to int conversion is necessary
and writing an initial patch, this brings about 20 piglits, and I think this
is the last piece to make evergreen and r600 equal in terms of features.
2010-10-17 16:48:30 +10:00
Brian Paul
46c2ee4fad gallivm: use util_snprintf() 2010-10-15 17:32:23 -06:00
Brian Paul
81c27dbfb9 st/mesa: update function name, comments 2010-10-15 17:24:43 -06:00
Brian Paul
fa5309f0b0 st/mesa: use GLuint to avoid problem w/ uint not defined on mingw32 2010-10-15 17:18:39 -06:00
Brian Paul
cba65f7e0e st/mesa: reformatting in st_cb_drawpixels.c 2010-10-15 17:01:56 -06:00
Brian Paul
61a467e515 st/mesa: fix regressions in glDrawPixels(GL_STENCIL_INDEX)
We need to keep track of three different fragment shaders: Z-only, stencil-
only, and Z+stencil.  Before, we were only keeping track of the first one
we encountered.
2010-10-15 16:54:03 -06:00
Brian Paul
b2578ef873 glsl: add ir_unop_round_even case to silence unhandled enum warning 2010-10-15 15:44:01 -06:00
Brian Paul
fb8f3d7711 gallivm: added lp_build_load_volatile()
There's no LLVM C LLVMBuildLoadVolatile() function so roll our own.
Not used anywhere at this time but can come in handy during debugging.
2010-10-15 15:40:33 -06:00
Brian Paul
991f0c2763 gallivm: added lp_build_print_vec4() 2010-10-15 15:40:33 -06:00
Eric Anholt
81d0a1fb3f i965: Set the type of the null register to fix gen6 FS comparisons.
We often use reg_null as the destination when setting up the flag
regs.  However, on gen6 there aren't general implicit conversions to
destination types from src types, so the comparison to produce the
flag regs would be done on the integer result interpreted as a float.
Hilarity ensued.

Fixes 20 piglit cases.
2010-10-15 13:13:56 -07:00
Ian Romanick
20b39c7760 i965: Fix indentation after commit 3322fbaf 2010-10-15 12:11:03 -07:00
Ian Romanick
f29ff6efa6 linker: Trivial indention fix 2010-10-15 12:11:03 -07:00
Jakob Bornecrantz
eb7cf3d2a6 target-helpers: Remove per target software wrapper check
Instead of having a NAME_SOFTWARE check just use the GALLIUM_DRIVER
instead but set the default to native which is the same as not wrapped.
2010-10-15 19:13:00 +01:00
Jakob Bornecrantz
af729571eb egl: Remove unnecessary headers 2010-10-15 19:13:00 +01:00
Jakob Bornecrantz
44207ff71b wrapper: Add a way to dewrap a pipe screen without destroying it 2010-10-15 19:13:00 +01:00
Jakob Bornecrantz
f8f3baa43a wrapper: Fix spelling 2010-10-15 19:13:00 +01:00
Jakob Bornecrantz
992e7c7279 llvmpipe: Move makefile include to before targets
Or plain make inside of the directory wont build libllvmpipe.a
2010-10-15 19:13:00 +01:00
Xavier Chantry
9c439e3c7a nv50: apply layout_mask to tile_flags
The tile_flags now store more than just nv50 page table entry bits.
2010-10-15 15:54:02 +02:00
Keith Whitwell
ac98519c4e llvmpipe: validate color outputs against key->nr_cbufs 2010-10-15 14:49:13 +01:00
Keith Whitwell
ffab84c9a2 llvmpipe: check shader outputs are non-null before using 2010-10-15 14:49:13 +01:00
Vinson Lee
a14376218e mesa: Add missing header to shaderobj.h.
Include compiler.h for ASSERT symbol.
2010-10-15 06:13:18 -07:00
Keith Whitwell
39185efd3a llvmpipe: fix non-sse build after recent changes 2010-10-15 14:11:22 +01:00
Keith Whitwell
392b0954c2 llvmpipe: use aligned loads/stores for plane values 2010-10-15 13:52:00 +01:00
Keith Whitwell
9f9a17eba8 llvmpipe: do plane calculations with intrinsics
This is a step towards moving this code into the rasterizer.
2010-10-15 13:38:06 +01:00
Keith Whitwell
15f4e3a8b9 gallium: move some intrinsics helpers to u_sse.h 2010-10-15 13:29:56 +01:00
Keith Whitwell
8965f042b3 llvmpipe: don't store plane.ei value in binned data
Further reduce the size of a binned triangle.
2010-10-15 13:27:47 +01:00
Keith Whitwell
9bf8a55c4b llvmpipe: slightly shrink the size of a binned triangle 2010-10-15 13:27:47 +01:00
Keith Whitwell
0a1c900103 llvmpipe: don't pass frontfacing as a float 2010-10-15 13:27:47 +01:00
Keith Whitwell
4195febeec llvmpipe: reintroduce SET_STATE binner command
But bin lazily only into bins which are receiving geometry.
2010-10-15 13:27:47 +01:00
Chad Versace
e2c1fe3eb0 glsl: Fix ir validation for bit logic ops
In ir_validate::visit_leave(), the cases for
    - ir_binop_bit_and
    - ir_binop_bit_xor
    - ir_binop_bit_or
were incorrect. It was incorrectly asserted that both operands must be the
same type, when in fact one may be scalar and the other a vector. It was also
incorrectly asserted that the resultant type was the type of the left operand,
which in fact does not hold when the left operand is a scalar and the right
operand is a vector.
2010-10-15 00:20:18 -07:00
Chad Versace
4761d0d22b glsl: Implement constant expr evaluation for bitwise logic ops
Implement by adding the following cases to
ir_exporession::constant_expression_value():
    - ir_binop_bit_and
    - ir_binop_bit_or
    - ir_binop_bit_xor
2010-10-15 00:20:18 -07:00
Chad Versace
adea8150a7 glsl: Implement constant expr evaluation for bit-shift ops
Implement by adding the following cases to
ir_expression::constant_expression_value():
    - ir_binop_lshfit
    - ir_binop_rshfit
2010-10-15 00:20:18 -07:00
Chad Versace
90a8b792c0 glsl: Implement constant expr evaluation for bitwise-not
Implement by adding a case to ir_expression::constant_expression_value()
for ir_unop_bit_not.
2010-10-15 00:20:18 -07:00
Chad Versace
5c4c36f7f3 glsl: Implement ast-to-hir for binary shifts in GLSL 1.30
Implement by adding the following cases to ast_expression::hir():
    - ast_lshift
    - ast_rshift
Also, implement ir validation for the new operators by adding the following
cases to ir_validate::visit_leave():
    - ir_binop_lshift
    - ir_binop_rshift
2010-10-15 00:20:18 -07:00
Chad Versace
f88b4eaa8f glsl: Change generated file glsl_lexer.cpp 2010-10-15 00:20:18 -07:00
Chad Versace
7abdc71afa glsl: Add lexer rules for << and >> in GLSL 1.30
Commit for generated file glsl_lexer.cpp follows this commit.
2010-10-15 00:20:18 -07:00
Dave Airlie
fc6caef4cb r600g: evergreen interpolation support.
On evergreen, interpolation has moved into the fragment shader,
with the interpolation parmaters being passed via GPRs and LDS entries.

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

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

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

As a side effect _NumLinkedShaders is removed.

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

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

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

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

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

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

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

Fixes glsl-fs-vec4-indexing-temp-dst-in-nested-loop-combined (register
allocation no longer fails for the conditional generation
proliferation)
2010-10-14 12:02:54 -07:00
Eric Anholt
d5599c0b6a i965: Add a function for handling the move of boolean values to flag regs.
This will be a place to peephole comparisions directly to the flag
regs, and for now avoids using MOV with conditional mod on gen6, which
is now illegal.
2010-10-14 12:02:54 -07:00
Kristian Høgsberg
1d33e940d2 Only install vtxfmt tables for OpenGL
GLES1 and GLES2 install their own exec pointers and don't need the
Save table.  Also, the SET_* macros use different indices for the different
APIs so the offsets used in vtxfmt.c are actually wrong for the ES APIs.
2010-10-14 15:00:22 -04:00
Eric Anholt
4f88550ba0 i965: Add a pass to the FS to split virtual GRFs to float channels.
Improves nexuiz performance 0.91% (+/- 0.54%, n=8)
2010-10-14 10:42:55 -07:00
Eric Anholt
b8613d70da i965: Update the live interval when coalescing regs. 2010-10-14 10:42:55 -07:00
Eric Anholt
0c6752026c i965: Set class_sizes[] for the aligned reg pair class.
So far, I've only seen this be a valgrind warning and not a real failure.
2010-10-14 10:42:55 -07:00
Keith Whitwell
f0bd76f28d llvmpipe: don't try to emit non-existent color outputs 2010-10-14 14:08:20 +01:00
Kristian Høgsberg
81ccb3e2ce Drop the "neutral" tnl module
Just always check for FLUSH_UPDATE_CURRENT and call Driver.BeginVertices
when necessary.  By using the unlikely() macros, this ends up as
a 10% performance improvement (for isosurf, anyway) over the old,
complicated function pointer swapping.
2010-10-14 08:53:59 -04:00
Chia-I Wu
d6de1f44a0 st/egl: Do not finish a fence that is NULL.
i915g would dereference the NULL pointer.
2010-10-14 17:16:14 +08:00
Chia-I Wu
c97c77d869 st/egl: Access _EGLConfig directly.
Drop the use of SET_CONFIG_ATTRIB.  Fix the value of EGL_SAMPLE_BUFFERS
along the way.
2010-10-14 17:16:14 +08:00
Chia-I Wu
3fa21881b1 egl: Access config attributes directly.
Replace SET_CONFIG_ATTRIB/GET_CONFIG_ATTRIB by direct dereferences.
2010-10-14 17:16:14 +08:00
Chia-I Wu
282e514240 egl: Use attribute names as the _EGLConfig member names.
This makes _EGLConfig more accessible and scales better when new
attributes are added.
2010-10-14 17:14:44 +08:00
Dave Airlie
68014c8d19 r600g: select linear interpolate if tgsi input requests it 2010-10-14 14:27:34 +10:00
Dave Airlie
0637044add r600g: fixup typo in macro name 2010-10-14 14:19:37 +10:00
Dave Airlie
1e82c28fcf r600g: fixup pos/face ena/address properly 2010-10-14 14:15:15 +10:00
Dave Airlie
8a9f02c5d5 r600g: only pick centroid coordinate when asked.
TGSI tells us when to use this, its not hooked up from GLSL to MESA to TGSI yet though.
2010-10-14 14:15:15 +10:00
Zhenyu Wang
338b3f0b90 Revert "i965: fallback lineloop on sandybridge for now"
This reverts commit 73dab75b41.
2010-10-14 11:24:49 +08:00
Zhenyu Wang
e8e79c1d7e i965: Fix GS hang on Sandybridge
Don't use r0 for FF_SYNC dest reg on Sandybridge, which would
smash FFID field in GS payload, that cause later URB write fail.
Also not use r0 in any URB write requiring allocate.
2010-10-14 11:24:42 +08:00
Eric Anholt
a57ef244fc i965: Add support for rescaling GL_TEXTURE_RECTANGLE coords to new FS. 2010-10-13 17:07:43 -07:00
Fredrik Höglund
a21a2748be r600g: Fix texture sampling with swizzled coords
Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-10-14 09:25:29 +10:00
Dave Airlie
26dacce2c0 r600g: drop unused context members 2010-10-14 09:10:16 +10:00
Ian Romanick
7d8ba5f78f mesa: Clean up various 'unused parameter' warnings in shaderapi 2010-10-13 15:35:23 -07:00
Ian Romanick
ccc1c4c6d9 mesa: Clean up two 'comparison between signed and unsigned' warnings 2010-10-13 15:35:23 -07:00
Ian Romanick
5cb24c4a75 mesa: Refactor validation of shader targets
Actually validate that the implementation supports the particular
shader target as well.  Previously if a driver only supported vertex
shaders, for example, glCreateShaderObjectARB would gladly create a
fragment shader.

NOTE: this is a candidate for the 7.9 branch.
2010-10-13 15:35:18 -07:00
Ian Romanick
babe20b9d1 mesa: Silence unused variable warning 2010-10-13 15:30:20 -07:00
Ian Romanick
4a45595cf3 linker: Reject shaders that have unresolved function calls
This really amounts to just using the return value from
link_function_calls.  All the work was being done, but the result was
being ignored.

Fixes piglit test link-unresolved-funciton.

NOTE: this is a candidate for the 7.9 branch.
2010-10-13 15:30:19 -07:00
Vinson Lee
720bdfbceb glsl: Initialize variable in ir_derefence_array::constant_expression_value
Completely initialize data passed to ir_constant constructor.

Fixes piglit glsl-mat-from-int-ctor-03 valgrind uninitialized value
error on softpipe.
2010-10-13 14:21:08 -07:00
José Fonseca
ae00e34e4b llvmpipe: Generalize the x8z24 fast path to all depth formats.
Together with the previous commit, this generalize the benefits of
d2cf757f44 to all depth formats, in
particular:
- simpler float -> 24unorm conversion
- avoid unsigned comparisons (not directly supported on SSE) by aligning
to the least significant bit
- avoid unecessary/repeated mask ANDing

Verified with trivial/tri-z that the exact same assembly is produced for
X8Z24.
2010-10-13 20:25:57 +01:00
José Fonseca
60c5d4735d gallivm: More accurate float -> 24bit & 32bit unorm conversion. 2010-10-13 20:25:57 +01:00
Brian Paul
e487b665aa gallivm: work-around trilinear mipmap filtering regression with LLVM 2.8
The bug only happens on the AOS / fixed-pt path.
2010-10-13 12:37:42 -06:00
Vinson Lee
bee22ed6b9 gallivm: Remove unnecessary header. 2010-10-13 11:18:40 -07:00
Brian Paul
c3ed27ec76 x11: fix breakage from gl_config::visualType removal 2010-10-13 08:32:08 -06:00
José Fonseca
95c18abb03 llvmpipe: Unbreak Z32_FLOAT.
Z32_FLOAT uses <4 x float> as intermediate/destination type,
instead of <4 x i32>.

The necessary bitcasts got removed with commit
5b7eb868fd

Also use depth/stencil type and build contexts consistently, and
make the depth pointer argument a ordinary <i8 *>, to catch this
sort of issues in the future (and also to pave way for Z16 and
Z32_FLOAT_S8_X24 support).
2010-10-13 15:25:15 +01:00
Kristian Høgsberg
f9995b3075 Drop GLcontext typedef and use struct gl_context instead 2010-10-13 09:43:25 -04:00
Kristian Høgsberg
31aca27c08 Drop GLframebuffer typedef and just use struct gl_framebuffer 2010-10-13 09:43:24 -04:00
Kristian Høgsberg
d3491e775f Rename GLvisual and __GLcontextModes to struct gl_config 2010-10-13 09:43:24 -04:00
Kristian Høgsberg
705e142dda gl: Remove unused GLcontextModes fields 2010-10-13 09:43:24 -04:00
Kristian Høgsberg
e3c1c5377c Get rid of GL/internal/glcore.h
__GLcontextModes is always only used as an implementation internal struct
at this point and we shouldn't install glcore.h anymore.  Anything that
needs __GLcontextModes should just include the struct in its headers files
directly.
2010-10-13 09:43:24 -04:00
Roland Scheidegger
d838e4f66d gallivm: only use lp_build_conv 4x4f -> 1x16 ub fastpath with sse2
This is relying on lp_build_pack2 using the sse2 pack intrinsics which
handle clamping.
(Alternatively could have make it use lp_build_packs2 but it might
not even produce more efficient code than not using the fastpath
in the first place.)
2010-10-13 15:26:37 +02:00
Dave Airlie
ff4b397517 r600g: fix stencil export for evergreen harder 2010-10-13 18:50:37 +10:00
Stephan Schmid
40cc5bfcd7 r600g: fix relative addressing when splitting constant accesses
Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-10-13 18:49:27 +10:00
Dave Airlie
6da8129b3c r600g: add missing eg reg definition 2010-10-13 17:45:10 +10:00
Dave Airlie
92e729bba5 r600g: evergreen add stencil export bit 2010-10-13 17:40:32 +10:00
Dave Airlie
88c1b32c62 r600g: use blitter for hw copy region
at the moment depth copies are failing (piglit depth-level-clamp)
so use the fallback for now until get some time to investigate.
2010-10-13 15:55:49 +10:00
Dave Airlie
f8778eeb40 r600g: drop all use of unsigned long
this changes size on 32/64 bit so is definitely no what you want to use here.
2010-10-13 15:55:48 +10:00
Dave Airlie
e9acf9a3bb r600g: fix transfer stride.
fixes segfaults
2010-10-13 15:55:48 +10:00
Dave Airlie
e3b089126c r600g: remove bpt and start using pitch_in_bytes/pixels.
this mirror changes in r300g, bpt is kinda useless when it comes to some
of the non-simple texture formats.
2010-10-13 15:55:48 +10:00
Dave Airlie
fa797f12b3 r600g: rename pitch in texture to pitch_in_bytes 2010-10-13 15:55:47 +10:00
Dave Airlie
6a0066a69f r600g: use common texture object create function 2010-10-13 15:55:47 +10:00
Dave Airlie
771dd89881 r600g: split out miptree setup like r300g
just a cleanup step towards tiling
2010-10-13 15:55:47 +10:00
Dave Airlie
9979d60c0e r600g: add copy into tiled texture 2010-10-13 15:55:46 +10:00
Dave Airlie
5604276670 r600g: the vs/ps const arrays weren't actually being used.
completely removed them.
2010-10-13 15:56:12 +10:00
Dave Airlie
d59498b780 r600g: reduce size of context structure.
this thing will be in the cache a lot, so having massive big struct
arrays inside it won't be helping anyone.
2010-10-13 15:25:00 +10:00
Vinson Lee
8c107e6ca6 tdfx: Silence unused variable warning on non-debug builds.
Fixes this GCC warning.
tdfx_texman.c: In function 'tdfxTMMoveOutTM_NoLock':
tdfx_texman.c:897: warning: unused variable 'shared'
2010-10-12 22:23:21 -07:00
Dave Airlie
c8d4108fbe r600g: store samplers/views across blit when we need to modify them
also fixup framebuffer state copies to avoid bad state.
2010-10-13 15:11:30 +10:00
Dave Airlie
a8d1d7253e r600g: fix scissor/cliprect confusion
gallium calls them scissors, but r600 hw like r300 is better off using
cliprects to implement them as we can turn them on/off a lot easier.
2010-10-13 15:11:30 +10:00
Dave Airlie
833b4fc11e r600g: fix depth0 setting 2010-10-13 15:11:30 +10:00
Vinson Lee
71fa3f8fe2 r300: Silence uninitialized variable warning.
Fixes this GCC warning.
r300_state.c: In function 'r300InvalidateState':
r300_state.c:2247: warning: 'hw_format' may be used uninitialized in this function
r300_state.c:2247: note: 'hw_format' was declared here
2010-10-12 22:02:27 -07:00
Brian Paul
39de9251c4 mesa: reformatting, comments, code movement 2010-10-12 19:04:05 -06:00
Brian Paul
048a90c1cb draw/llvmpipe: replace DRAW_MAX_TEXTURE_LEVELS with PIPE_MAX_TEXTURE_LEVELS
There's no apparent reason for the former to exist.  And they didn't
even have the same value.
2010-10-12 19:04:05 -06:00
Brian Paul
50f221a01b gallivm: remove newlines 2010-10-12 19:04:05 -06:00
Roland Scheidegger
c1549729ce gallivm: fix different handling of [non]normalized coords in linear soa path
There seems to be no reason for it, so do same math for both
(except the scale mul, of course).
2010-10-13 02:35:05 +02:00
Brian Paul
1ca5f7cc31 mesa: remove assertion w/ undeclared variable texelBytes 2010-10-12 18:32:06 -06:00
Dave Airlie
5f612f5c00 st/mesa: enable stencil shader export extension if supported 2010-10-13 09:30:05 +10:00
Dave Airlie
d9671863ea glsl: add support for shader stencil export
This adds proper support for the GL_ARB_shader_stencil_export extension
to the GLSL compiler. Thanks to Ian for pointing out where I need to add things.
2010-10-13 09:30:05 +10:00
Dave Airlie
39d1feb51e r600g: add shader stencil export support. 2010-10-13 09:30:05 +10:00
Dave Airlie
40acb109de r600g: add support for S8, X24S8 and S8X24 sampler formats. 2010-10-13 09:30:04 +10:00
Dave Airlie
ef8bb7ada9 st/mesa: use shader stencil export to accelerate shader drawpixels.
If the pipe driver has shader stencil export we can accelerate DrawPixels
using it. It tries to pick an S8 texture and works its way to X24S8 and S8X24
if that isn't supported.
2010-10-13 09:30:04 +10:00
Dave Airlie
06642c6175 st/mesa: add option to choose a texture format that we won't render to.
We need a texture to put the drawpixels stuff into, an S8 texture is less
memory/bandwidth than the 32-bit X24S8, but we might not be able to render
directly to an S8, so this lets us specify we won't be rendering to this
texture.
2010-10-13 09:30:04 +10:00
Dave Airlie
d8f6ef4565 softpipe: add support for shader stencil export capability
this allows softpipe to be used to test shader stencil ref exporting.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-10-13 09:30:04 +10:00
Dave Airlie
c79e681a68 mesa: improve texstore for 8/24 formats and add texstore for S8.
this improves mesa texstore for 8/24 so it can create S24X8/X24S8 variants
by keeping the depth bits static.

it also adds a texstore for S8 so we can write out an S8 texture to use
in the sampler for accel draw pixels to save memory bw.

The logic seems sound here, I've worked it out a few times on paper, though
it would be good to have some review.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-10-13 09:30:04 +10:00
Dave Airlie
bec341d00c mesa: add support for FRAG_RESULT_STENCIL.
this is needed to add support for stencil shader export.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-10-13 09:30:03 +10:00
Dave Airlie
d02993c9dc gallium/util: add S8 tile sampling support. 2010-10-13 09:30:03 +10:00
Dave Airlie
67e71429f1 gallium/format: add X32_S8X24_USCALED format.
Has similiar use cases to the S8X24 and X24S8 formats.
2010-10-13 09:30:03 +10:00
Dave Airlie
66a0d1e4b9 gallium/format: add support for X24S8 and S8X24 formats.
these formats are needed for hw that can sample and write stencil values.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-10-13 09:30:03 +10:00
Dave Airlie
4ecb2c105d gallium/tgsi: add support for stencil writes.
this adds the capability + a stencil semantic id, + tgsi scan support.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-10-13 09:30:02 +10:00
Eric Anholt
43873b53c4 i965: Don't rebase the index buffer to min 0 if any arrays are in VBOs.
There was a check to only do the rebase if we didn't have everything
in VBOs, but nexuiz apparently hands us a mix of VBOs and arrays,
resulting in blocking on the GPU to do a rebase.

Improves nexuiz 800x600, high-settings performance on my Ironlake 41%
(+/- 1.3%), from 14.0fps to 19.7fps.
2010-10-12 15:17:35 -07:00
Eric Anholt
3316a54205 intel: Allow CopyTexSubImage to InternalFormat 3/4 textures, like RGB/RGBA.
The format selection of the CopyTexSubImage is pretty bogus still, but
this at least avoids software fallbacks in nexuiz, bringing
performance from 7.5fps to 12.8fps on my machine.
2010-10-12 14:08:00 -07:00
Eric Anholt
080e7aface i965: Fix missing "break;" in i2b/f2b, and missing AND of CMP result.
Fixes glsl-fs-i2b.
2010-10-12 13:07:40 -07:00
Ian Romanick
9fea9e5e21 glsl: Fix incorrect assertion
This assertion was added in commit f1c1ee11, but it did not notice
that the array is accessed with 'size-1' instead of 'size'.  As a
result, the assertion was off by one.  This caused failures in at
least glsl-orangebook-ch06-bump.
2010-10-12 12:50:29 -07:00
Ian Romanick
b2b9b22c10 mesa: Validate assembly shaders when GLSL shaders are used
If an GLSL shader is used that does not provide all stages and
assembly shaders are provided for the missing stages, validate the
assembly shaders.

Fixes bugzilla #30787 and piglit tests glsl-invalid-asm0[12].

NOTE: this is a candidate for the 7.9 branch.
2010-10-12 10:54:28 -07:00
Keith Whitwell
7533c37457 llvmpipe: make sure intrinsics code is guarded with PIPE_ARCH_SSE 2010-10-12 18:28:12 +01:00
Thomas Hellstrom
893620e52e st/xorg: Fix typo
Pointed out by Jakob Bornecrantz.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2010-10-12 18:26:05 +02:00
Brian Paul
f1c1ee11d3 ir_to_mesa: assorted clean-ups, const qualifiers, new comments 2010-10-12 09:26:54 -06:00
José Fonseca
6fbd4faf97 gallivm: Name anonymous union. 2010-10-12 16:08:09 +01:00
Brian Paul
0ad9d8b538 st/xlib: add some comments 2010-10-12 08:54:54 -06:00
Brian Paul
3633e1f538 glsl2: fix signed/unsigned comparison warning 2010-10-12 08:54:16 -06:00
José Fonseca
e3ec0fdd54 llmvpipe: improve mm_mullo_epi32
Apply Jose's suggestions for a small but measurable improvement in
isosurf.
2010-10-12 14:17:21 +01:00
Thomas Hellstrom
b6b7ce84e5 st/xorg: Don't try to remove invalid fbs
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2010-10-12 15:09:05 +02:00
Thomas Hellstrom
201c3d3669 xorg/vmwgfx: Don't hide HW cursors when updating them
Gets rid of annoying cursor flicker

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2010-10-12 15:09:05 +02:00
Thomas Hellstrom
bfd065c71e st/xorg: Add a customizer option to get rid of annoying cursor update flicker
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2010-10-12 15:09:05 +02:00
Thomas Hellstrom
f0bbf130f9 xorg/vmwgfx: Make vmwarectrl work also on 64-bit servers
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2010-10-12 15:09:04 +02:00
Thomas Hellstrom
ec08047a80 st/xorg: Don't try to use option values before processing options
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2010-10-12 15:09:04 +02:00
Keith Whitwell
0ca0382d1b Revert "llvmpipe: try to keep plane c values small"
This reverts commit 9773722c2b.

Looks like there are some floor/rounding issues here that need
to be better understood.
2010-10-12 13:20:39 +01:00
Keith Whitwell
22ec25e2bf gallivm: don't branch on KILLs near end of shader 2010-10-12 13:14:51 +01:00
Keith Whitwell
d0eb854f58 r600g: add missing file to sconscript 2010-10-12 13:08:34 +01:00
Keith Whitwell
1a574afabc gallium: move sse intrinsics debug helpers to u_sse.h 2010-10-12 13:02:28 +01:00
José Fonseca
39331be44e llvmpipe: Fix MSVC build.
MSVC doesn't accept more than 3 __m128i arguments.
2010-10-12 12:27:55 +01:00
Keith Whitwell
b4277bc584 llvmpipe: fix typo in last commit 2010-10-12 11:52:39 +01:00
Keith Whitwell
9773722c2b llvmpipe: try to keep plane c values small
Avoid accumulating more and more fixed point bits.
2010-10-12 11:50:14 +01:00
Keith Whitwell
9d59e148f8 llvmpipe: add debug helpers for epi32 etc 2010-10-12 11:50:13 +01:00
Keith Whitwell
2cf98d5a6d llvmpipe: try to do more of rast_tri_3_16 with intrinsics
There was actually a large quantity of scalar code in these functions
previously.  This tries to move more into intrinsics.

Introduce an sse2 mm_mullo_epi32 replacement to avoid sse4 dependency
in the new rasterization code.
2010-10-12 11:50:07 +01:00
José Fonseca
4cb3b4ced8 llvmpipe: Do not dispose the execution engine.
The engine is a global owned by gallivm module.
2010-10-12 08:36:51 +01:00
Francisco Jerez
c25fcf5aa5 nouveau: Get larger push buffers.
Useful to amortize the command submission/reloc overhead (e.g. etracer
goes from 72 to 109 FPS on nv4b).
2010-10-12 04:13:22 +02:00
Francisco Jerez
70828aa246 dri/nouveau: Initialize tile_flags when allocating a render target. 2010-10-12 04:12:56 +02:00
Dave Airlie
965f69cb0c r600g: fix typo in vertex sampling on r600
fixes https://bugs.freedesktop.org/show_bug.cgi?id=30771

Reported-by: Kevin DeKorte
2010-10-12 09:45:22 +10:00
Eric Anholt
bcec03d527 i965: Always use the new FS backend on gen6.
It's now much more correct for gen6 than the old backend, with just 2
regressions I've found (one of which is common with pre-gen6 and will
be fixed by an array splitting IR pass).

This does leave the old Mesa IR backend getting used still when we
don't have GLSL IR, but the plan is to get GLSL IR input to the driver
for the ARB programs and fixed function by the next release.
2010-10-11 15:32:41 -07:00
Eric Anholt
0cadd32b6d i965: Fix gen6 pixel_[xy] setup to avoid mixing int and float src operands.
Pre-gen6, you could mix int and float just fine.  Now, you get goofy
results.

Fixes:
glsl-arb-fragment-coord-conventions
glsl-fs-fragcoord
glsl-fs-if-greater
glsl-fs-if-greater-equal
glsl-fs-if-less
glsl-fs-if-less-equal
2010-10-11 15:26:59 -07:00
Eric Anholt
17306c60ad i965: Don't compute-to-MRF in gen6 VS math.
There was code to do this for pre-gen6 already, this just enables it
for gen6 as well.
2010-10-11 15:26:59 -07:00
Eric Anholt
720ed3c906 i965: Expand uniform args to gen6 math to full registers to get hstride == 1.
This is a hw requirement in math args.  This also is inefficient, as
we're calculating the same result 8 times, but then we've been doing
that on pre-gen6 as well.  If we're doing math on uniforms, though,
we'd probably be better served by having some sort of mechanism for
precalculating those results into another uniform value to use.

Fixes 7 piglit math tests.
2010-10-11 15:26:58 -07:00
Eric Anholt
317dbf4613 i965: Don't compute-to-MRF in gen6 math instructions. 2010-10-11 15:26:58 -07:00
Eric Anholt
7b5bc38c44 i965: Add a couple of checks for gen6 math instruction limits. 2010-10-11 15:26:58 -07:00
Eric Anholt
25cf241540 i965: Don't consider gen6 math instructions to write to MRFs.
This was leftover from the pre-gen6 cleanups.  One tests regresses
where compute-to-MRF now occurs.
2010-10-11 15:26:58 -07:00
Chad Versace
41c2079855 glsl: Changes in generated file glsl_lexer.cpp
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2010-10-11 14:25:53 -07:00
Chad Versace
0c9fef6111 glsl: Add lexer rules for uint and uvecN (N=2..4)
Commit for generated file glsl_lexer.cpp follows this commit.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2010-10-11 14:25:48 -07:00
Chad Versace
fc99a3beb9 glsl: Add glsl_type::uvecN_type for N=2,3
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2010-10-11 14:25:44 -07:00
Chad Versace
a34817917b intel_extensions: Add ability to set GLSL version via environment
Add ability to set the GLSL version used by the GLcontext by setting the
environment variable INTEL_GLSL_VERSION. For example,
    env INTEL_GLSL_VERSION=130 prog args
If the environment variable is missing, the GLSL versions defaults to 120.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2010-10-11 14:25:30 -07:00
Daniel Vetter
603741a86d r200: revalidate after radeon_update_renderbuffers
By calling radeon_draw_buffers (which sets the necessary flags
in radeon->NewGLState) and revalidating if NewGLState is non-zero
in r200TclPrimitive. This fixes an assert in libdrm (the color-/
depthbuffer was changed but not yet validated) and and stops the
kernel cs checker from complaining about them (when they're too
small).

Thanks to Mario Kleiner for the hint to call radeon_draw_buffer
(instead of my half-broken hack).

v2: Also fix the swtcl r200 path.

Cc: Mario Kleiner <mario.kleiner@tuebingen.mpg.de>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2010-10-11 15:16:44 -04:00
Eric Anholt
c6dbf253d2 i965: Compute to MRF in the new FS backend.
This didn't produce a statistically significant performance difference
in my demo (n=4) or nexuiz (n=3), but it still seems like a good idea
and is recommended by the HW team.
2010-10-11 12:08:13 -07:00
Eric Anholt
06fd639c51 i965: Give the FB write and texture opcodes the info on base MRF, like math. 2010-10-11 12:07:33 -07:00
Eric Anholt
0cd6cea8a3 i965: Give the math opcodes information on base mrf/mrf len.
This is progress towards enabling a compute-to-MRF pass.
2010-10-11 12:03:34 -07:00
Eric Anholt
37758fb1cb i965: Move FS backend structures to a header.
It's time to start splitting some of this up.
2010-10-11 11:52:02 -07:00
Eric Anholt
251fe27854 i965: Reduce register interference checks for changed FS_OPCODE_DISCARD.
While I don't know of any performance changes from this (once extra
reg available out of 128), it makes the generated asm a lot cleaner
looking.
2010-10-11 11:52:01 -07:00
Eric Anholt
90c4022040 i965: Split FS_OPCODE_DISCARD into two steps.
Having the single opcode write then read the reg meant that single
instruction opcodes had to consider their source regs to interfere
with their dest regs.
2010-10-11 11:52:01 -07:00
José Fonseca
986cb9d5cf llvmpipe: Use lp_tgsi_info. 2010-10-11 13:06:25 +01:00
José Fonseca
7c1b5772a8 gallivm: More detailed analysis of tgsi shaders.
To allow more optimizations, in particular for direct textures.
2010-10-11 13:05:32 +01:00
José Fonseca
11dad21718 tgsi: Export some names for some tgsi enums.
Useful to give human legible names in other cases.
2010-10-11 13:05:31 +01:00
José Fonseca
6c1aa4fd49 gallium: Define C99 restrict keyword where absent. 2010-10-11 13:05:31 +01:00
José Fonseca
e1003336f0 gallivm: Eliminate unsigned integer arithmetic from texture coordinates.
SSE support for 32bit and 16bit unsigned arithmetic is not complete, and
can easily result in inefficient code.

In most cases signed/unsigned doesn't make a difference, such as for
integer texture coordinates.

So remove uint_coord_type and uint_coord_bld to avoid inefficient
operations to sneak in the future.
2010-10-11 08:14:09 +01:00
José Fonseca
b18fecbd0e llvmpipe: Remove outdated comment about stencil testing. 2010-10-11 08:14:09 +01:00
Dave Airlie
3322416de4 r600g: don't run with scissors.
This could probably be done much nicer, I've spent a day chasing
a coherency problem in the kernel, that turned out to be incorrect
scissor setup.
2010-10-11 16:23:23 +10:00
Dave Airlie
ef2702fb20 r600g: add TXL opcode support.
fixes glsl1-2D Texture lookup with explicit lod (Vertex shader)
2010-10-11 12:18:05 +10:00
Dave Airlie
ea1d818b58 r600g: enable vertex samplers.
We need to move the texture sampler resources out of the range of the vertex attribs.

We could probably improve this using an allocator but this is the simple answer for now.

makes mesa-demos/src/glsl/vert-tex work.
2010-10-11 11:59:53 +10:00
Dave Airlie
2c47f302af r600g: evergreen has no request size bit in texture word4 2010-10-11 11:59:53 +10:00
Dave Airlie
bd89da79a1 r600g: fix input/output Z export mixup for evergreen. 2010-10-11 11:59:53 +10:00
José Fonseca
17dbd41cf2 gallivm: Pass texture coords derivates as scalars.
We end up treating them as scalars in the end, and it saves some
instructions.
2010-10-10 19:51:35 +01:00
José Fonseca
693667bf88 gallivm: Use variables instead of Phis in loops.
With this commit all explicit Phi emission is now gone.
2010-10-10 19:05:05 +01:00
José Fonseca
48003f3567 gallivm: Allow to disable bri-linear filtering with GALLIVM_DEBUG=no_brilinear runtime option 2010-10-10 18:48:02 +01:00
José Fonseca
124adf253c gallivm: Fix a long standing bug with nested if-then-else emission.
We can't patch true-block at end-if time, as there is no guarantee that
the block at the beginning of the true stanza is the same at the end of
the true stanza -- other control flow elements may have been emitted half
way the true stanza.

Although this bug surfaced recently with the commit to skip mip filtering
when lod is an integer the bug was always there, although probably it
was avoided until now: e.g., cubemap selection nests if-then-else on the
else stanza, which does not suffer from the same problem.
2010-10-10 18:48:02 +01:00
delphi
08f890d4c3 draw: some changes to allow for runtime changes to userclip planes 2010-10-10 08:40:11 +01:00
Francisco Jerez
e2acc7be26 dri/nv10: Fake fast Z clears for pre-nv17 cards. 2010-10-10 04:14:34 +02:00
Francisco Jerez
35a1893fd1 dri/nouveau: Minor cleanup. 2010-10-10 01:48:01 +02:00
José Fonseca
307df6a858 gallivm: Cleanup the rest of the flow module. 2010-10-09 21:39:14 +01:00
José Fonseca
d0ea464159 gallivm: Simplify if/then/else implementation.
No need for for a flow stack anymore.
2010-10-09 21:14:05 +01:00
José Fonseca
1949f8c315 gallivm: Factor out the SI->FP texture size conversion for SoA path too 2010-10-09 20:26:11 +01:00
José Fonseca
d45c379027 gallivm: Remove support for Phi generation.
Simply rely on mem2reg pass. It's easier and more reliable.
2010-10-09 20:14:03 +01:00
José Fonseca
ea7b49028b gallivm: Use varilables instead of Phis for cubemap selection. 2010-10-09 19:53:21 +01:00
José Fonseca
cc40abad51 gallivm: Don't generate Phis for execution mask. 2010-10-09 12:55:31 +01:00
José Fonseca
679dd26623 gallivm: Special bri-linear computation path for unmodified rho. 2010-10-09 12:13:00 +01:00
José Fonseca
81a09c8a97 gallivm: Less code duplication in log computation. 2010-10-09 12:12:59 +01:00
José Fonseca
52427f0ba7 util: Defined M_SQRT2 when not available. 2010-10-09 12:12:59 +01:00
José Fonseca
53d7f5e107 gallivm: Handle code have ret correctly.
Stop disassembling on unconditional backwards jumps.
2010-10-09 12:12:59 +01:00
José Fonseca
edba53024f llvmpipe: Fix MSVC build. Enable the new SSE2 code on non SSE3 systems. 2010-10-09 12:12:58 +01:00
Keith Whitwell
2de720dc8f llvmpipe: simplified SSE2 swz/unswz routines
We've been using these in the linear path for a while now.  Based on
Chris's SSSE3 code, but using only sse2 opcodes.  Speed seems to be
identical, but code is simpler & removes dependency on SSE3.

Should be easier to extend to other rgba8 formats.
2010-10-09 12:12:58 +01:00
Keith Whitwell
5b7eb868fd llvmpipe: clean up shader pre/postamble, try to catch more early-z
Specifically, can do early-depth-test even when alpahtest or
kill-pixel are active, providing we defer the actual z write until the
final mask is avaialable.

Improves demos/fire.c especially in the case where you get close to
the trees.
2010-10-09 11:44:45 +01:00
Keith Whitwell
aa4cb5e2d8 llvmpipe: try to be sensible about whether to branch after mask updates
Don't branch more than once in quick succession.  Don't branch at the
end of the shader.
2010-10-09 11:44:45 +01:00
Keith Whitwell
2ef6f75ab4 gallivm: simpler uint8->float conversions
LLVM seems to finds it easier to reason about these than our
mantissa-manipulation code.
2010-10-09 11:44:45 +01:00
Keith Whitwell
c79f162367 gallivm: prefer blendvb for integer arguments 2010-10-09 11:44:45 +01:00
Keith Whitwell
d2cf757f44 gallivm: specialized x8z24 depthtest path
Avoid unnecessary masking of non-existant stencil component.
2010-10-09 11:44:09 +01:00
Keith Whitwell
954965366f llvmpipe: dump fragment shader ir and asm when LP_DEBUG=fs
Better than GALLIVM_DEBUG if you're only interested in fragment shaders.
2010-10-09 11:43:23 +01:00
Keith Whitwell
6da29f3611 llvmpipe: store zero into all alloca'd values
Fixes slowdown in isosurf with earlier versions of llvm.
2010-10-09 11:43:23 +01:00
Keith Whitwell
40d7be5261 llvmpipe: use alloca for fs color outputs
Don't try to emit our own phi's, let llvm mem2reg do it for us.
2010-10-09 11:43:23 +01:00
Keith Whitwell
8009886b00 llvmpipe: defer attribute interpolation until after mask and ztest
Don't calculate 1/w for quads which aren't visible...
2010-10-09 11:42:48 +01:00
José Fonseca
d0bfb3c514 llvmpipe: Prevent z > 1.0
The current interpolation schemes causes precision loss.

Changing the operation order helps, but does not completely avoid the
problem.

The only short term solution is to clamp z to 1.0.

This is unfortunate, but probably unavoidable until interpolation is
improved.
2010-10-09 09:35:41 +01:00
José Fonseca
34c11c87e4 gallivm: Do size computations simultanously for all dimensions (AoS).
Operate simultanouesly on <width, height, depth> vector as much as possible,
instead of doing the operations on vectors with broadcasted scalars.

Also do the 24.8 fixed point scalar with integer shift of the texture size,
for unnormalized coordinates.

AoS path only for now -- the same thing can be done for SoA.
2010-10-09 09:34:31 +01:00
Zack Rusin
6316d54056 llvmpipe: fix rasterization of vertical lines on pixel boundaries 2010-10-09 08:19:21 +01:00
Vinson Lee
e7843363a5 i965: Initialize member variables.
Fixes these GCC warnings.
brw_wm_fp.c: In function 'search_or_add_const4f':
brw_wm_fp.c:92: warning: 'reg.Index2' is used uninitialized in this function
brw_wm_fp.c:84: note: 'reg.Index2' was declared here
brw_wm_fp.c:92: warning: 'reg.RelAddr2' is used uninitialized in this function
brw_wm_fp.c:84: note: 'reg.RelAddr2' was declared here
2010-10-08 16:40:29 -07:00
Vinson Lee
5abd498c47 i965: Silence unused variable warning on non-debug builds.
Fixes this GCC warning.
brw_vs.c: In function 'do_vs_prog':
brw_vs.c:46: warning: unused variable 'ctx'
2010-10-08 16:30:59 -07:00
Vinson Lee
978ffa1d61 i965: Silence unused variable warning on non-debug builds.
Fixes this GCC warning.
brw_eu_emit.c: In function 'brw_math2':
brw_eu_emit.c:1189: warning: unused variable 'intel'
2010-10-08 16:02:59 -07:00
Vinson Lee
220c0834a4 i915: Silence unused variable warning in non-debug builds.
Fixes this GCC warning.
i915_vtbl.c: In function 'i915_assert_not_dirty':
i915_vtbl.c:670: warning: unused variable 'dirty'
2010-10-08 15:49:02 -07:00
Roland Scheidegger
ff72c79924 gallivm: make use of new iround code in lp_bld_conv.
Only requires sse2 now.
2010-10-09 00:36:38 +02:00
Roland Scheidegger
175cdfd491 gallivm: optimize soa linear clamp to edge wrap mode a bit
Clamp against 0 instead of -0.5, which simplifies things.
The former version would have resulted in both int coords being zero
(in case of coord being smaller than 0) and some "unused" weight value,
whereas now the int coords will be 0 and 1, but weight will be 0, hence the
lerp should produce the same value.
Still not happy about differences between normalized and non-normalized...
2010-10-09 00:36:38 +02:00
Roland Scheidegger
2cc6da85d6 gallivm: avoid unnecessary URem in linear wrap repeat case
Haven't looked at what code this exactly generates but URem can't be fast.
Instead of using two URem only use one and replace the second one with
select/add (this is what the corresponding aos code already does).
2010-10-09 00:36:38 +02:00
Roland Scheidegger
318bb080b0 gallivm: more linear tex wrap mode calculation simplification
Rearrange order of operations a bit to make some clamps easier.
All calculations should be equivalent.
Note there seems to be some inconsistency in the clamp to edge case
wrt normalized/non-normalized coords, could potentially simplify this too.
2010-10-09 00:36:38 +02:00
Roland Scheidegger
99ade19e6e gallivm: optimize some tex wrap mode calculations a bit
Sometimes coords are clamped to positive numbers before doing conversion
to int, or clamped to 0 afterwards, in this case can use itrunc
instead of ifloor which is easier. This is only the case for nearest
calculations unfortunately, except linear MIRROR_CLAMP_TO_EDGE which
for the same reason can use a unsigned float build context so the
ifloor_fract helper can reduce this to itrunc in the ifloor helper itself.
2010-10-09 00:36:38 +02:00
Roland Scheidegger
1e17e0c4ff gallivm: replace sub/floor/ifloor combo with ifloor_fract 2010-10-09 00:36:37 +02:00
Roland Scheidegger
cb3af2b434 gallivm: faster iround implementation for sse2
sse2 supports round to nearest directly (or rather, assuming default nearest
rounding mode in MXCSR). Use intrinsic to use this rather than round (sse41)
or bit manipulation whenever possible.
2010-10-09 00:36:37 +02:00
Roland Scheidegger
0ed8c56bfe gallivm: fix trunc/itrunc comment
trunc of -1.5 is -1.0 not 1.0...
2010-10-09 00:36:37 +02:00
Vinson Lee
0f4984a0fb i915: Silence unused variable warning in non-debug builds.
Fixes this GCC warning.
i830_vtbl.c: In function 'i830_assert_not_dirty':
i830_vtbl.c:704: warning: unused variable 'i830'
2010-10-08 15:35:35 -07:00
Ian Romanick
48156b87bc docs: Update status of GL 3.x related extensions 2010-10-08 14:55:27 -07:00
Ian Romanick
1d3027b507 docs: skeleton for 7.10 release notes 2010-10-08 14:50:34 -07:00
Ian Romanick
0ea8b99332 glsl: Remove const decoration from inlined function parameters
The constness of the function parameter gets inlined with the rest of
the function.  However, there is also an assignment to the parameter.
If this occurs inside a loop the loop analysis code will get confused
by the assignment to a read-only variable.

Fixes bugzilla #30552.

NOTE: this is a candidate for the 7.9 branch.
2010-10-08 14:29:11 -07:00
Ian Romanick
dc459f8756 intel: Enable GL_ARB_explicit_attrib_location 2010-10-08 14:21:23 -07:00
Ian Romanick
dbc6c9672d main: Enable GL_ARB_explicit_attrib_location for swrast 2010-10-08 14:21:23 -07:00
Ian Romanick
68a4fc9d5a glsl: Add linker support for explicit attribute locations 2010-10-08 14:21:23 -07:00
Ian Romanick
eee68d3631 glsl: Track explicit location in AST to IR translation 2010-10-08 14:21:23 -07:00
Ian Romanick
2b45ba8bce glsl: Regenerate files changes by previous commit 2010-10-08 14:21:23 -07:00
Ian Romanick
7f68cbdc4d glsl: Add parser support for GL_ARB_explicit_attrib_location layouts
Only layout(location=#) is supported.  Setting the index requires GLSL
1.30 and GL_ARB_blend_func_extended.
2010-10-08 14:21:22 -07:00
Ian Romanick
eafebed5bd glcpp: Regenerate files changes by previous commit 2010-10-08 14:21:22 -07:00
Ian Romanick
e0c9f67be5 glcpp: Add the define for ARB_explicit_attrib_location when present 2010-10-08 14:21:22 -07:00
Ian Romanick
5ed6610d11 glsl: Regenerate files modified by previous commits 2010-10-08 14:21:22 -07:00
Ian Romanick
e24d35a5b5 glsl: Wrap ast_type_qualifier contents in a struct in a union
This will ease adding non-bit fields in the near future.
2010-10-08 14:21:22 -07:00
Ian Romanick
5ff4cfb788 glsl: Clear type_qualifier using memset 2010-10-08 14:21:22 -07:00
Ian Romanick
fd2aa7d313 glsl: Slight refactor of error / warning checking for ARB_fcc layout 2010-10-08 14:21:22 -07:00
Ian Romanick
dd93035a4d glsl: Refactor 'layout' grammar to match GLSL 1.60 spec grammar 2010-10-08 14:21:22 -07:00
Ian Romanick
4b5489dd6f glsl: Fail linking if assign_attribute_locations fails 2010-10-08 14:21:22 -07:00
Vinson Lee
3b16c591a4 r600g: Silence uninitialized variable warning. 2010-10-08 14:17:14 -07:00
Vinson Lee
36b65a373a r600g: Silence uninitialized variable warning. 2010-10-08 14:14:16 -07:00
Vinson Lee
131485efae r600g: Silence uninitialized variable warning. 2010-10-08 14:08:50 -07:00
Vinson Lee
5e90971475 gallivm: Remove unnecessary header. 2010-10-08 14:03:10 -07:00
Eric Anholt
c52a0b5c7d i965: Add register coalescing to the new FS backend.
Improves performance of my GLSL demo 14.3% (+/- 4%, n=4) by
eliminating the moves used in ir_assignment and ir_swizzle handling.
Still 16.5% to go to catch up to the Mesa IR backend, presumably
because instructions are almost perfectly mis-scheduled now.
2010-10-08 13:22:27 -07:00
Eric Anholt
80c0077a6f i965: Enable attribute swizzling (repositioning) in the gen6 SF.
We were trying to remap a fully-filled array down to only handing the
WM the components it uses.  This is called attribute swizzling, and if
you don't enable it you just get 1:1 mappings of inputs to outputs.

This almost fixes glsl-routing, except for the highest gl_TexCoord[]
indices.
2010-10-08 12:00:04 -07:00
Eric Anholt
cac04a9397 i965: Fix new FS gen6 interpolation for sparsely-populated arrays.
We'd overwrite the same element twice.
2010-10-08 11:59:19 -07:00
Eric Anholt
624ce6f61b i965: Fix gen6 WM push constants updates.
We would compute a new buffer, but never point the hardware at the new
buffer.  This partially fixes glsl-routing, as now it get the updated
uniform for which attribute to draw.
2010-10-08 11:59:19 -07:00
José Fonseca
3fde8167a5 gallivm: Help for combined extraction and broadcasting.
Doesn't change generated code quality, but saves some typing.
2010-10-08 19:48:16 +01:00
José Fonseca
438390418d llvmpipe: First minify the texture size, then broadcast. 2010-10-08 19:11:52 +01:00
José Fonseca
f5b5fb32d3 gallivm: Move into the as much of the second level code as possible.
Also, pass more stuff trhough the sample build context, instead of
arguments.
2010-10-08 19:11:52 +01:00
Eric Anholt
5b24d69fcd i965: Handle swizzles in the addition of YUV texture constants.
If someone happened to land a set in a different swizzle order, we
would have assertion failed.
2010-10-08 10:24:30 -07:00
Eric Anholt
0534e958c9 i965: Drop the check for YUV constants in the param list.
_mesa_add_unnamed_constant() already does that.
2010-10-08 10:24:29 -07:00
Eric Anholt
fa8aba9da4 i965: Drop the check for duplicate _mesa_add_state_reference.
_mesa_add_state_reference does that check for us anyway.
2010-10-08 10:24:29 -07:00
Eric Anholt
e310c22bb7 mesa: Simplify a bit of _mesa_add_state_reference using memcmp. 2010-10-08 10:24:29 -07:00
José Fonseca
6b0c79e058 gallivm: Warn when doing inefficient integer comparisons. 2010-10-08 17:43:15 +01:00
José Fonseca
d5ef59d8b0 gallivm: Avoid control flow for two-sided stencil test. 2010-10-08 17:43:15 +01:00
Keith Whitwell
ef3407672e llvmpipe: fix off-by-one in tri_16 2010-10-08 17:30:08 +01:00
Keith Whitwell
0ff132e5a6 llvmpipe: add rast_tri_4_16 for small lines and points 2010-10-08 17:30:08 +01:00
Keith Whitwell
eeb13e2352 llvmpipe: clean up setup_tri a little 2010-10-08 17:30:08 +01:00
Keith Whitwell
e191bf4a85 gallivm: round rather than truncate in new 4x4f->1x16ub conversion path 2010-10-08 17:30:08 +01:00
José Fonseca
f91b4266c6 gallivm: Use the wrappers for SSE pack intrinsics.
Fixes assertion failures on LLVM 2.6.
2010-10-08 17:30:08 +01:00
Keith Whitwell
607e3c542c gallivm: special case conversion 4x4f to 1x16ub
Nice reduction in the number of operations required for final color
output in many shaders.
2010-10-08 17:30:08 +01:00
Keith Whitwell
29d6a1483d llvmpipe: avoid overflow in triangle culling
Avoid multiplying fixed-point values.  Calculate triangle area in
floating point use that for culling.

Lift area calculations up a level as we are already doing this in the
triangle_both() case.

Would like to share the calculated area with attribute interpolation,
but the way the code is structured makes this difficult.
2010-10-08 17:30:08 +01:00
Keith Whitwell
ad6730fadb llvmpipe: fail gracefully on oom in scene creation 2010-10-08 17:26:29 +01:00
José Fonseca
eb605701aa gallivm: Implement brilinear filtering. 2010-10-08 15:50:28 +01:00
José Fonseca
c8179ef5e8 gallivm: Fix copy'n'paste typo in previous commit. 2010-10-08 14:09:22 +01:00
José Fonseca
df7a2451b1 gallivm: Clamp mipmap level and zero mip weight simultaneously. 2010-10-08 14:06:38 +01:00
José Fonseca
0d84b64a4f gallivm: Use lp_build_ifloor_fract for lod computation.
Forgot this one before.
2010-10-08 14:06:38 +01:00
José Fonseca
4f2e2ca4e3 gallivm: Don't compute the second mipmap level when frac(lod) == 0 2010-10-08 14:06:37 +01:00
José Fonseca
05fe33b71c gallivm: Simplify lp_build_mipmap_level_sizes' interface. 2010-10-08 14:06:37 +01:00
José Fonseca
4eb222a3e6 gallivm: Do not do mipfiltering when magnifying.
If lod < 0, then invariably follows that ilevel0 == ilevel1 == 0.
2010-10-08 14:06:37 +01:00
Vinson Lee
1f01f5cfcf r600g: Remove unnecessary header. 2010-10-08 04:56:49 -07:00
Dave Airlie
8d6a38d7b3 r600g: drop width/height per level storage.
these aren't used anywhere, so just waste memory.
2010-10-08 19:55:05 +10:00
Eric Anholt
bbb840049e i965: Normalize cubemap coordinates like is done in the Mesa IR path.
Fixes glsl-fs-texturecube-2-*
2010-10-07 16:41:13 -07:00
Eric Anholt
4d202da7a4 i965: Disable emitting if () statements on gen6 until we really fix them. 2010-10-07 16:41:13 -07:00
Dave Airlie
1ae5cc2e67 r600g: add some RG texture format support. 2010-10-08 09:37:02 +10:00
Kristian Høgsberg
1d595c7cd4 gles2: Add GL_EXT_texture_format_BGRA8888 support 2010-10-07 17:08:50 -04:00
José Fonseca
321ec1a224 gallivm: Vectorize the rho computation. 2010-10-07 22:08:42 +01:00
Dave Airlie
51f9cc4759 r600g: fix Z export enable bits.
we should be checking output array not input to decide.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-10-07 15:32:05 +10:00
Dave Airlie
97eea87bde r600g: use format from the sampler view not from the texture.
we want to use the format from the sampler view which isn't always the
same as the texture format when creating sampler views.
2010-10-07 15:17:28 +10:00
Andre Maasikas
84457701b0 r600g: fix evergreen interpolation setup
interp data is stored in gpr0 so first interp overwrote it
and subsequent ones got wrong values

reserve register 0 so it's not used for attribs.
alternative is to interpolate attrib0 last (reverse, as r600c does)
2010-10-07 07:51:32 +03:00
Chia-I Wu
b2c0ef8b51 st/vega: Fix version check in context creation.
This fixes a regression since 4531356817.
2010-10-07 12:15:31 +08:00
Chia-I Wu
da495ee870 targets/egl: Fix linking with libdrm. 2010-10-07 12:06:59 +08:00
Eric Anholt
d3163912c1 i965: Fix gen6 pointsize handling to match pre-gen6.
Fixes point-line-no-cull.
Bug #30532
2010-10-06 17:29:29 -07:00
Eric Anholt
b380531fd4 i965: Don't assume that WPOS is always provided on gen6 in the new FS.
We sensibly only provide it if the FS asks for it.  We could actually
skip WPOS unless the FS needed WPOS.zw, but that's something for
later.

Fixes: glsl-texture2d and probably many others.
2010-10-06 12:13:08 -07:00
Eric Anholt
1fdc8c007e i965: Add support for gl_FrontFacing on gen6.
Fixes glsl1-gl_FrontFacing var (2) with new FS.
2010-10-06 12:13:08 -07:00
Eric Anholt
a760b5b509 i965: Refactor gl_FrontFacing setup out of general variable setup. 2010-10-06 12:13:08 -07:00
Eric Anholt
75270f705f i965: Gen6's sampler messages are the same as Ironlake.
This should fix texturing in the new FS backend.
2010-10-06 12:13:08 -07:00
Eric Anholt
fe6efc25ed i965: Don't do 1/w multiplication in new FS for gen6
Not needed now that we're doing barycentric.
2010-10-06 12:13:08 -07:00
Eric Anholt
5d99b01501 i965: Add some clarification of the WECtrl field. 2010-10-06 12:13:08 -07:00
Eric Anholt
5eeaf3671e i965: Fix botch in the header_present case in the new FS.
I only set it on the color_regions == 0 case, missing the important
case, causing GPU hangs on pre-gen6.
2010-10-06 12:13:08 -07:00
José Fonseca
9fe510ef35 llvmpipe: Cleanup depth-stencil clears.
Only cosmetic changes. No actual practical difference.
2010-10-06 19:08:21 +01:00
José Fonseca
33f88b3492 util: Cleanup util_pack_z_stencil and friends.
- Handle PIPE_FORMAT_Z32_FLOAT packing correctly.

- In the integer version z shouldn't be passed as as double.

- Make it clear that the integer versions should only be used for masks.

- Make integer type sizes explicit (uint32_t for now, although
  uint64_t will be necessary later to encode f32_s8_x24).
2010-10-06 19:08:18 +01:00
José Fonseca
87dd859b34 gallivm: Compute lod as integer whenever possible.
More accurate/faster results for PIPE_TEX_MIPFILTER_NEAREST. Less
FP <-> SI conversion overall.
2010-10-06 18:51:25 +01:00
José Fonseca
1c32583581 gallivm: Only apply min/max_lod when necessary. 2010-10-06 18:50:57 +01:00
Keith Whitwell
5849a6ab64 gallivm: don't apply zero lod_bias 2010-10-06 18:49:32 +01:00
José Fonseca
af05f61576 gallivm: Combined ifloor & fract helper.
The only way to ensure we don't do redundant FP <-> SI conversions.
2010-10-06 18:47:01 +01:00
José Fonseca
012d57737b gallivm: Fast implementation of iround(log2(x))
Not tested yet, but should be correct.
2010-10-06 18:46:59 +01:00
José Fonseca
4648846bd6 gallivm: Use a faster (and less accurate) log2 in lod computation. 2010-10-06 18:46:29 +01:00
José Fonseca
df3505b193 gallivm: Take the type signedness in consideration in round/ceil/floor. 2010-10-06 18:46:08 +01:00
Eric Anholt
feca660939 i965: Fix up IF/ELSE/ENDIF for gen6.
The jump delta is now in the part of the instruction where the
destination fields used to be, and the src args are ignored (or not,
for the new non-predicated IF that we don't use yet).
2010-10-06 10:09:45 -07:00
Eric Anholt
f7cb28fad9 i965: Gen6 no longer has the IFF instruction; always use IF. 2010-10-06 10:09:45 -07:00
Eric Anholt
3c97c00e38 i965: Add back gen6 headerless FB writes to the new FS backend.
It's not that hard to detect when we need the header.
2010-10-06 10:09:44 -07:00
Jerome Glisse
3fabd218a0 r600g: fix dirty state handling
Avoid having object ending up in dead list of dirty object.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-10-06 13:01:31 -04:00
Eric Anholt
634abbf7b2 i965: Also do constant propagation for the second operand of CMP.
We could do the first operand as well by flipping the comparison, but
this covered several CMPs in code I was looking at.
2010-10-06 09:33:26 -07:00
Eric Anholt
dcd0261aff i965: Enable the constant propagation code.
A debug disable had slipped in.
2010-10-06 09:33:26 -07:00
Jerome Glisse
1644bb0f40 r600g: avoid segfault due to unintialized list pointer
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-10-06 09:41:19 -04:00
José Fonseca
06472ad7e8 llvmpipe: Fix sprite coord perspective interpolation of Q.
Q coordinate's coefficients also need to be multiplied by w, otherwise
it will have 1/w, causing problems with TXP.
2010-10-06 11:46:41 +01:00
José Fonseca
e74955eba3 llvmpipe: Fix perspective interpolation for point sprites.
Once a fragment is generated with LP_INTERP_PERSPECTIVE set for an input,
it will do a divide by w for that input. Therefore it's not OK to treat LP_INTERP_PERSPECTIVE as
LP_INTERP_LINEAR or vice-versa, even if the attribute is known to not
vary.

A better strategy would be to take the primitive in consideration when
generating the fragment shader key, and therefore avoid the per-fragment
perspective divide.
2010-10-06 11:44:59 +01:00
José Fonseca
446dbb9217 llvmpipe: Dump a few missing shader key flags. 2010-10-06 11:41:08 +01:00
Keith Whitwell
591e1bc34f llvmpipe: make debug_fs_variant respect variant->nr_samplers 2010-10-06 11:40:30 +01:00
José Fonseca
5661e51c01 retrace: Handle clear_render_target and clear_depth_stencil. 2010-10-06 11:37:49 +01:00
Dave Airlie
9528fc2107 r600g: add evergreen stencil support.
this sets the stencil up for evergreen properly.
2010-10-06 09:21:16 +10:00
Jerome Glisse
ea5a74fb58 r600g: userspace fence to avoid kernel call for testing bo busy status
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-10-05 17:04:25 -04:00
Brian Paul
3d6eec0a87 st/mesa: replace assertion w/ conditional in framebuffer invalidation
https://bugs.freedesktop.org/show_bug.cgi?id=30632

NOTE: this is a candidate for the 7.9 branch.
2010-10-05 14:33:17 -06:00
Jerome Glisse
2cf3199ee3 r600g: simplify block relocation
Since flush rework there could be only one relocation per
register in a block.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-10-05 15:23:07 -04:00
Bas Nieuwenhuizen
ac8a1ebe55 r600g: use dirty list to track dirty blocks
Got a speed up by tracking the dirty blocks in a seperate list instead of looping through all blocks. This version should work with block that get their dirty state disabled again and I added a dirty check during the flush as some blocks were already dirty.
2010-10-05 15:16:06 -04:00
Ian Romanick
b2e52cdf83 docs: added news item for 7.9 release
Also fix link to release notes in 7.9-rc1 news item.
2010-10-05 10:07:16 -07:00
Ian Romanick
cdf29c44ed docs: Import news updates from 7.9 branch
Partially cherry-picked from commit 61653b488d
2010-10-05 10:05:04 -07:00
Ian Romanick
8f32c64bd1 docs: Update mailing lines from sf.net to freedesktop.org
(cherry picked from commit c19bc5de96)
2010-10-05 10:02:30 -07:00
Ian Romanick
13a90e8900 docs: download.html does not need to be updated for each release
(cherry picked from commit 41e371e351)
2010-10-05 10:02:10 -07:00
Ian Romanick
d0981675cc docs: Import 7.8.x release notes from 7.8 branch. 2010-10-05 10:01:34 -07:00
Ian Romanick
792b0308fc docs: Import 7.9 release notes from 7.9 branch. 2010-10-05 09:54:41 -07:00
Nicolas Kaiser
71fd35d1ad nv50: fix always true conditional in shader optimization 2010-10-05 18:53:15 +02:00
Jerome Glisse
585e4098aa r600g: improve bo flushing
Flush read cache before writting register. Track flushing inside
of a same cs and avoid reflushing same bo if not necessary. Allmost
properly force flush if bo rendered too and then use as a texture
in same cs (missing pipeline flush dunno if it's needed or not).

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-10-05 10:43:23 -04:00
Jerome Glisse
12d16e5f14 r600g: store reloc information in bo structure
Allow fast lookup of relocation information & id which
was a CPU time consumming operation.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-10-05 10:42:56 -04:00
Dave Airlie
bf21b7006c pb: fix numDelayed accounting
we weren't decreasing when removing from the list.
2010-10-05 19:08:41 +10:00
Dave Airlie
12be1568d0 r600g: avoid unneeded bo wait
if we know the bo has gone not busy, no need to add another bo wait

thanks to Andre (taiu) on irc for pointing this out.
2010-10-05 16:00:48 +10:00
Dave Airlie
d2c06b5037 r600g: drop use_mem_constant.
since we plan on using dx10 constant buffers everywhere.
2010-10-05 16:00:23 +10:00
Dave Airlie
46997d4fc2 r600g: drop mman allocator
we don't use this since constant buffers are now being used on all gpus.
2010-10-05 15:57:57 +10:00
Dave Airlie
05813ad5f4 r600g: add bo busy backoff.
When we go to do a lot of bos in one draw like constant bufs we need
to avoid bouncing off the busy ioctl, this mitigates by backing off
on busy bos for a short amount of times.
2010-10-05 15:51:38 +10:00
Dave Airlie
49866c8f34 pb: don't keep checking buffers after first busy
If we assume busy buffers are added to the list in order its unlikely
we'd fine one after the first busy one that isn't busy.
2010-10-05 15:50:58 +10:00
Dave Airlie
3c38e4f138 r600g: add bo fenced list.
this just keeps a list of bos submitted together, and uses them to decide
bo busy state for the whole group.
2010-10-05 15:35:52 +10:00
Brian Paul
fb5e6f88fc swrast: fix choose_depth_texture_level() to respect mipmap filtering state
NOTE: this is a candidate for the 7.9 branch.
2010-10-04 19:59:46 -06:00
Marek Olšák
d0408cf55d r300g: fix microtiling for 16-bits-per-channel formats
These texture formats (like R16G16B16A16_UNORM) were untested until now
because st/mesa doesn't use them. I am testing this with a hacked st/mesa
here.
2010-10-05 02:57:00 +02:00
Marek Olšák
57b7300804 update release notes for Gallium
I am trying to be exhaustive, but still I might have missed tons of other
changes to Gallium.
(cherry picked from commit 968a9ec76e)

Conflicts:

	docs/relnotes-7.9.html
2010-10-05 02:56:59 +02:00
Ian Romanick
4d435c400d docs: Add list of bugs fixed in 7.9 2010-10-04 17:39:48 -07:00
Eric Anholt
ea909be58d i965: Add support for gen6 FB writes to the new FS.
This uses message headers for now, since we'll need it for MRT.  We
can cut out the header later.
2010-10-04 16:08:17 -07:00
Eric Anholt
739aec39bd i965: In disasm, gen6 fb writes don't put msg reg # in destreg_conditionalmod.
It instead sensibly appears in the src0 slot.
2010-10-04 16:08:17 -07:00
Eric Anholt
3bf8774e9c i965: Add initial folding of constants into operand immediate slots.
We could try to detect this in expression handling and do it
proactively there, but it seems like less logic to do it in one
optional pass at the end.
2010-10-04 16:08:17 -07:00
Eric Anholt
e27c88d8e6 i965: Add trivial dead code elimination in the new FS backend.
The glsl core should be handling most dead code issues for us, but we
generate some things in codegen that may not get used, like the 1/w
value or pixel deltas.  It seems a lot easier this way than trying to
work out up front whether we're going to use those values or not.
2010-10-04 16:08:17 -07:00
Eric Anholt
9faf64bc32 i965: Be more conservative on live interval calculation.
This also means that our intervals now highlight dead code.
2010-10-04 16:08:17 -07:00
Vinson Lee
a0a8e24385 r600g: Fix SCons build. 2010-10-04 15:56:55 -07:00
Jerome Glisse
b25c52201b r600g: remove dead label & fix indentation
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-10-04 17:25:19 -04:00
Jerome Glisse
243d6ea609 r600g: rename radeon_ws_bo to r600_bo
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-10-04 17:25:19 -04:00
Jerome Glisse
674452faf9 r600g: use r600_bo for relocation argument, simplify code
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-10-04 17:25:19 -04:00
Jerome Glisse
d22a1247d8 r600g: allow r600_bo to be a sub allocation of a big bo
Add bo offset everywhere needed if r600_bo is ever a sub bo
of a bigger bo.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-10-04 17:25:19 -04:00
Jerome Glisse
294c9fce1b r600g: rename radeon_ws_bo to r600_bo
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-10-04 17:25:19 -04:00
delphi
25bb05fef0 draw: added userclip planes and updated variant_key 2010-10-04 22:08:16 +01:00
Krzysztof Smiechowicz
68c7994ab5 nvfx: Pair os_malloc_aligned() with os_free_aligned().
From AROS.
2010-10-04 11:43:29 -07:00
Dave Airlie
3d45d57044 r600g: TODO domain management
no wonder it was slow, the code is deliberately forcing stuff into GTT,
we used to have domain management but it seems to have disappeared.
2010-10-04 16:41:49 +10:00
Dave Airlie
1c2b3cb1e9 r600g: fix wwarning in bo_map function 2010-10-04 16:26:46 +10:00
Dave Airlie
6dc051557d r600g: the code to check whether a new vertex shader is needed was wrong
this code was memcmp'ing two structs, but refcounting one of them afterwards,
so any subsequent memcmp was never going to work.

again this stops unnecessary uploads of vertex program,
2010-10-04 16:24:59 +10:00
Dave Airlie
92aba9c1f5 r600g: break out of search for reloc bo after finding it.
this function was taking quite a lot of pointless CPU.
2010-10-04 15:58:39 +10:00
Eric Anholt
14bf92ba19 i965: Fix glean/texSwizzle regression in previous commit.
Easy enough patch, who needs a full test run.  Oh, that's right.  Me.
2010-10-03 00:24:09 -07:00
Eric Anholt
a7fa00dfc5 i965: Set up swizzling of shadow compare results for GL_DEPTH_TEXTURE_MODE.
The brw_wm_surface_state.c handling of GL_DEPTH_TEXTURE_MODE doesn't
apply to shadow compares, which always return an intensity value.  The
texture swizzles can do the job for us.

Fixes:
glsl1-shadow2D(): 1
glsl1-shadow2D(): 3
2010-10-02 23:48:14 -07:00
Eric Anholt
4fb0c92c69 i965: Add support for EXT_texture_swizzle to the new FS backend. 2010-10-02 23:44:44 -07:00
Marek Olšák
8f7177e0de r300g: add support for L8A8 colorbuffers
Blending with DST_ALPHA is undefined. SRC_ALPHA works, though.
I bet some other formats have similar limitations too.
2010-10-02 23:19:38 +02:00
Marek Olšák
e75bce026c r300g: add support for R8G8 colorbuffers
The hw swizzles have been obtained by a brute force approach,
and only C0 and C2 are stored in UV88, the other channels are
ignored.

R16G16 is going to be a lot trickier.
2010-10-02 21:42:22 +02:00
Dave Airlie
71a079fb4e mesa/st: initial attempt at RG support for gallium drivers
passes all piglit RG tests with softpipe.
2010-10-02 17:03:15 +10:00
Kenneth Graunke
f317713432 i965: Fix incorrect batchbuffer size in gen6 clip state command.
FORCE_ZERO_RTAINDEX should be in the fourth (and final) dword.
2010-10-01 21:53:28 -07:00
Eric Anholt
64a9fc3fc1 i965: Don't try to emit code if we failed register allocation. 2010-10-01 17:19:04 -07:00
Eric Anholt
6397addd61 i965: Fix off-by-ones in handling the last members of register classes.
Luckily, one of them would result in failing out register allocation
when the other bugs were encountered.  Applies to
glsl-fs-vec4-indexing-temp-dst-in-nested-loop-combined, which still
fails register allocation, but now legitimately.
2010-10-01 17:19:04 -07:00
Eric Anholt
afb64311e3 i965: Add a sanity check for register allocation sizes. 2010-10-01 17:19:03 -07:00
Eric Anholt
5ee0941316 i965: When producing a single channel swizzle, don't make a temporary.
This quickly cuts 8% of the instructions in my glsl demo.
2010-10-01 17:19:03 -07:00
Eric Anholt
a0799725f5 i965: Restore the forcing of aligned pairs for delta_xy on chips with PLN.
By doing so using the register allocator now, we avoid wasting a
register to make the alignment happen.
2010-10-01 17:19:03 -07:00
Alex Deucher
fb0eed84ca r600c: fix segfault in evergreen stencil code
Fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=30551
2010-10-01 20:14:25 -04:00
Vinson Lee
7af2a22d1f r600g: Remove unnecessary headers. 2010-10-01 17:06:33 -07:00
Vinson Lee
20846a8ce1 r600g: Remove unused variable.
Fixes this GCC warning.
r600_shader.c: In function 'tgsi_split_literal_constant':
r600_shader.c:818: warning: unused variable 'index'
2010-10-01 17:02:01 -07:00
Ian Romanick
1ca6cbec1b rgtc: Detect RGTC formats as color formats and as compressed formats 2010-10-01 16:55:35 -07:00
Ian Romanick
5ebbabc5cc mesa: Trivial correction to comment 2010-10-01 16:55:35 -07:00
Ian Romanick
69c78bf2c2 mesa: Fix misplaced #endif
If FEATURE_texture_s3tc is not defined, FXT1 formats would erroneously
fall through to the MESA_FORMAT_RGBA_FLOAT32 case.
2010-10-01 16:55:35 -07:00
Ian Romanick
7c6147014a ARB_texture_rg: Add GL_COMPRESSED_{RED,RG} cases in _mesa_is_color_format 2010-10-01 16:55:35 -07:00
Ian Romanick
e2a054b70c mesa: Add ARB_texture_compression_rgtc as an alias for EXT_texture_compression_rgtc
Change the name in the extension tracking structure to ARB (from EXT).
2010-10-01 16:55:35 -07:00
Vinson Lee
e5fd15199d savage: Remove unnecessary header. 2010-10-01 16:57:19 -07:00
Vinson Lee
841503fddf glsl: Remove unnecessary header. 2010-10-01 16:27:58 -07:00
Ian Romanick
c77cd9ec10 i965: Enable GL_ARB_texture_rg 2010-10-01 15:49:13 -07:00
Ian Romanick
9ef390dc14 mesa: Enable GL_ARB_texture_rg in software paths 2010-10-01 15:49:13 -07:00
Ian Romanick
421f4d8dc1 ARB_texture_rg: Allow RED and RG textures as FBO color buffer attachments 2010-10-01 15:49:13 -07:00
Ian Romanick
5d1387b2da ARB_texture_rg: Add R8, R16, RG88, and RG1616 internal formats 2010-10-01 15:49:13 -07:00
Ian Romanick
214a33f610 ARB_texture_rg: Handle RED and RG the same as RGB for tex env 2010-10-01 15:49:13 -07:00
Ian Romanick
cd5dea6401 ARB_texture_rg: Add GL_RED as a valid GL_DEPTH_TEXTURE_MODE 2010-10-01 15:49:13 -07:00
Ian Romanick
cc6f13def5 ARB_texture_rg: Add GL_TEXTURE_{RED,GREEN}_SIZE query support 2010-10-01 15:49:12 -07:00
Ian Romanick
3ebbc176f9 ARB_texture_rg: Correct some errors in RED / RG internal format handling
Fixes several problems:

The half-float, float, and integer internal formats depend on
ARB_texture_rg and other extensions.

RG_INTEGER is not a valid internal format.

Generic compressed formats depend on ARB_texture_rg, not
EXT_texture_compression_rgtc.

Use GL_RED instead of GL_R.
2010-10-01 15:49:12 -07:00
Ian Romanick
bb45ab0a96 ARB_texture_rg: Add GLX protocol support 2010-10-01 15:49:12 -07:00
Nicolas Kaiser
96efa8a923 i965g: use Elements macro instead of manual sizeofs
Signed-off-by: Nicolas Kaiser <nikai@nikai.net>
Signed-off-by: Brian Paul <brianp@vmware.com>
2010-10-01 16:41:13 -06:00
Eric Anholt
e9bcc83289 i965: Fix up copy'n'pasteo from moving coordinate setup around for gen4. 2010-10-01 14:09:00 -07:00
Eric Anholt
bfd9715c3c i965: Add real support for pre-gen5 texture sampling to the new FS.
Fixes 36 testcases, including glsl-fs-shadow2d*-bias which fail on the
Mesa IR backend.
2010-10-01 14:02:48 -07:00
richard
92eb07a281 evergreen : fix z format setting, enable stencil. 2010-10-01 16:10:02 -04:00
Eric Anholt
8f63a44636 i965: Pre-gen6, map VS outputs (not FS inputs) to URB setup in the new FS.
We should fix the SF to actually give us just the data we need, but
this fixes regressions in the new FS until then.

Fixes:
glsl-kwin-blur
glsl-routing
2010-10-01 12:21:51 -07:00
Eric Anholt
ff5ce9289b i965: Also increment attribute location when skipping unused slots.
Fixes glsl1-texcoord varying.
2010-10-01 12:19:21 -07:00
Eric Anholt
354c40a624 i965: Fix the gen6 jump size for BREAK/CONT in new FS.
Since gen5, jumps are in increments of 64 bits instead of increments
of 128-bit instructions.
2010-10-01 12:19:21 -07:00
Eric Anholt
efc4a6f790 i965: Add gen6 attribute interpolation to new FS backend.
Untested, since my hardware is not booting at the moment.
2010-10-01 12:19:21 -07:00
Jerome Glisse
29b491bd03 r600g: indentation fixes
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-10-01 10:26:58 -04:00
Dave Airlie
738aa29289 r600g: setup basic loop consts on r600 + evergreen.
this sets up a single loop constant like r600c does.
2010-10-01 16:06:31 +10:00
Dave Airlie
7777c997e0 r600g: only set the Z export if shader exports it. 2010-10-01 16:06:30 +10:00
Alex Deucher
0c39a53aa6 r600c: pull over 6xx/7xx vertex fixes for evergreen 2010-10-01 00:51:37 -04:00
Dave Airlie
539a2978ed r600g: flush SH cache on constant change on evergreen 2010-10-01 14:43:02 +10:00
Dave Airlie
b67aa5311f r600g: fix evergreen draw-buffers
just a typo in the register headers.
2010-10-01 14:24:14 +10:00
Dave Airlie
14c95bb4ee r600g: add cb flushing for extra buffers + depth buffer on r600/evergreen 2010-10-01 14:05:02 +10:00
Dave Airlie
ac225c76a6 r600g: sync vertex/texture cache on resources on evergreen
this gets rid of lots of the instability on evergreen,
which isn't surprising since it really broken not to flush caches.
2010-10-01 14:04:32 +10:00
Dave Airlie
d662195f00 r600g: fixup vertex format picking.
there are some vertex formats defined in r600c not in the docs.
2010-10-01 13:36:56 +10:00
Dave Airlie
e973221538 r600g: add assembler support for other vtx fetch fields.
this shouldn't change behaviour, just push the choice of what
to do out to the shader.
2010-10-01 13:36:56 +10:00
Eric Anholt
1d073cb2d9 i965: Split the gen4 and gen5 sampler handling apart.
Trying to track the insanity of the different argument layouts for
normal/shadow crossed with normal/lod/bias one generation at a time is
enough.

Fixes: glsl1-texture2D() with bias.
(first test passing in this code that doesn't pass without it!)
2010-09-30 20:23:40 -07:00
Eric Anholt
5f237a1ccb i965: Use the lowering pass for texture projection.
We should end up with the same code, but anyone else with this issue
could share the handling (which I got wrong for shadow comparisons in
the driver before).
2010-09-30 20:23:40 -07:00
Eric Anholt
aae338104f glsl: Add a lowering pass for texture projection. 2010-09-30 20:23:36 -07:00
Dave Airlie
35cfe286d6 r600g: realign evergreen code with r600 code.
fixes segfault in depth-tex-modes-glsl and OA startup.
2010-10-01 11:15:13 +10:00
Alex Deucher
a3e9998614 r600c: add reloc for CB_COLOR0_ATTRIB
We'll need a reloc for tiling eventually,
so add it now.
2010-09-30 20:55:54 -04:00
Dave Airlie
5eccdc62b9 r600g: add reloc for evergreen color attrib
we'll need this for color tiling on evergreen.
2010-10-01 10:52:09 +10:00
Dave Airlie
40ccb235d6 r600g: drop depth quirk on evergreen
none of the EG cards need the quirk.
2010-10-01 10:30:17 +10:00
Dave Airlie
05d1d86907 r600g: add winsys support for CTL constants.
These need to be emitted, we also need them to do proper vtx start,
instead of abusing index offset.
2010-10-01 10:30:16 +10:00
Dave Airlie
084c29baed r600g: fix evergreen depth flushing.
although evergreen can apparantly sample direct from 24-bit,
just make it work with the current method for now.
2010-10-01 10:17:20 +10:00
Dave Airlie
7ae4da8056 r600g: use Elements macro instead of manual sizeofs 2010-10-01 10:17:20 +10:00
Brian Paul
66992463ac draw: check for null sampler pointers
http://bugs.freedesktop.org/show_bug.cgi?id=30516
2010-09-30 16:42:17 -06:00
Brian Paul
542d6cb1b8 gallivm: added some comments 2010-09-30 16:42:17 -06:00
John Doe
40181aef60 r600g: keep a mapping around for each bo
Save a lot of call into the kernel and thus improve performances.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-30 17:53:36 -04:00
John Doe
dde1391cc9 r600g: don't double count dirty block
This avoid to overcount the number of dwords we need and
thus avoid maximazation of cs buffer use.

Signed-off-by: Jerome Glisse <jglisse@redhat.com
2010-09-30 17:38:18 -04:00
Jerome Glisse
113f1cdfce evergreeng: avoid overlapping border color btw VS & PS
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-30 17:07:28 -04:00
Eric Anholt
c6960e4471 i965: Fix new FS handling of builtin uniforms with packed scalars in structs.
We were pointing each element at the .x channel of the
ParameterValues.

Fixes glsl1-linear fog.
2010-09-30 13:45:42 -07:00
Eric Anholt
a7cddd7de3 mesa: Don't reference a W component in setting up a vec3 uniform component.
The 965 driver would try to set up storage for the W component, and
the offsets would get mixed up.
2010-09-30 13:45:42 -07:00
Eric Anholt
6f6542a483 i965: Fix whole-structure/array assignment in new FS.
We need to walk the type tree to get the right register types for
structure components.  Fixes glsl-fs-statevar-call.
2010-09-30 13:45:42 -07:00
Tom Fogal
3661f757ee Revert "Prefer intrinsics to handrolled atomic ops."
This reverts commit 5f66b340aa, quickly
fixing 30514.
2010-09-30 14:41:53 -06:00
Jerome Glisse
9d4ae914e2 r600g: fix constant & literal src splitting, also fix mplayer gl2 shader
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-30 16:33:12 -04:00
Tom Fogal
5f66b340aa Prefer intrinsics to handrolled atomic ops. 2010-09-30 13:20:57 -06:00
Tom Fogal
76a60faf52 Implement x86_64 atomics for compilers w/o intrinsics.
Really old gcc's (3.3, at least) don't have support for the
intrinsics we need.  This implements a fallback for that case.
2010-09-30 13:20:51 -06:00
Adam Jackson
0c86e1f294 i965: Update renderer strings for sandybridge
Signed-off-by: Adam Jackson <ajax@redhat.com>
2010-09-30 14:08:35 -04:00
Jerome Glisse
153105cfbf r600g: use constant buffer instead of register for constant
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-30 13:47:29 -04:00
Brian Paul
874f3a57ce gallivm: check for level=0 case in lp_build_minify()
This lets us avoid the shift and max() operations.
2010-09-30 10:53:30 -06:00
José Fonseca
4e6f5e8d43 gallivm: More comprehensive border usage logic. 2010-09-30 17:42:01 +01:00
Chia-I Wu
e2b51b7c5b st/egl: Drop context argument from egl_g3d_get_egl_image.
Fix a regression since 17eace581d.
2010-09-30 23:45:27 +08:00
Nicolas Kaiser
4160d947d2 st: remove duplicated include
Remove duplicated include.

Signed-off-by: Brian Paul <brianp@vmware.com>
2010-09-30 09:36:31 -06:00
Nicolas Kaiser
bad10b961a math: remove duplicated includes
Remove duplicated includes.

Signed-off-by: Brian Paul <brianp@vmware.com>
2010-09-30 09:36:31 -06:00
Nicolas Kaiser
9674929bce main: remove duplicated includes
Remove duplicated includes.

Signed-off-by: Brian Paul <brianp@vmware.com>
2010-09-30 09:36:31 -06:00
Nicolas Kaiser
8c92a80b62 dri/savage: remove duplicated include
Remove duplicated include.

Signed-off-by: Brian Paul <brianp@vmware.com>
2010-09-30 09:36:30 -06:00
Nicolas Kaiser
1663e6da2f dri/radeon: remove duplicated includes
Remove duplicated includes.

Signed-off-by: Brian Paul <brianp@vmware.com>
2010-09-30 09:36:30 -06:00
Nicolas Kaiser
a7670be8a1 dri/r600: remove duplicated include
Remove duplicated include.

Signed-off-by: Brian Paul <brianp@vmware.com>
2010-09-30 09:36:30 -06:00
Nicolas Kaiser
223c4b4188 dri/r300: remove duplicated include
Remove duplicated include.

Signed-off-by: Brian Paul <brianp@vmware.com>
2010-09-30 09:36:30 -06:00
Nicolas Kaiser
705d98deb8 dri/r128: remove duplicated include
Remove duplicated include.

Signed-off-by: Brian Paul <brianp@vmware.com>
2010-09-30 09:36:29 -06:00
Nicolas Kaiser
f094b35207 dri/mga: remove duplicated include
Remove duplicated include.

Signed-off-by: Brian Paul <brianp@vmware.com>
2010-09-30 09:36:29 -06:00
Nicolas Kaiser
1a98a46304 dri/intel: remove duplicated include
Remove duplicated include.

Signed-off-by: Brian Paul <brianp@vmware.com>
2010-09-30 09:36:29 -06:00
Nicolas Kaiser
c24144f41f dri/i965: remove duplicated include
Remove duplicated include.

Signed-off-by: Brian Paul <brianp@vmware.com>
2010-09-30 09:36:24 -06:00
Nicolas Kaiser
f831212eab dri/i915: remove duplicated include
Remove duplicated include.

Signed-off-by: Brian Paul <brianp@vmware.com>
2010-09-30 09:36:24 -06:00
Nicolas Kaiser
b958dabe16 dri/i810: remove duplicated include
Remove duplicated include.

Signed-off-by: Brian Paul <brianp@vmware.com>
2010-09-30 09:36:24 -06:00
Nicolas Kaiser
c24e062fdb dri/common: remove duplicated include
Remove duplicated include.

Signed-off-by: Brian Paul <brianp@vmware.com>
2010-09-30 09:36:24 -06:00
Nicolas Kaiser
7eed3dba58 glx: remove duplicated include
Remove duplicated include.

Signed-off-by: Brian Paul <brianp@vmware.com>
2010-09-30 09:36:23 -06:00
Nicolas Kaiser
3f28dbd9bb gallium/winsys: remove duplicated include
Remove duplicated include.

Signed-off-by: Brian Paul <brianp@vmware.com>
2010-09-30 09:36:23 -06:00
Nicolas Kaiser
218d973786 gallium/st: remove duplicated includes
Remove duplicated includes.

Signed-off-by: Brian Paul <brianp@vmware.com>
2010-09-30 09:36:23 -06:00
Nicolas Kaiser
6f136094f4 gallium/softpipe: remove duplicated include
Remove duplicated include.

Signed-off-by: Brian Paul <brianp@vmware.com>
2010-09-30 09:36:23 -06:00
Nicolas Kaiser
d2149f6f22 gallium/llvmpipe: remove duplicated include
Remove duplicated include.

Signed-off-by: Brian Paul <brianp@vmware.com>
2010-09-30 09:36:23 -06:00
Nicolas Kaiser
3e472bee2d gallium/i915: remove duplicated include
Remove duplicated include.

Signed-off-by: Brian Paul <brianp@vmware.com>
2010-09-30 09:36:22 -06:00
Nicolas Kaiser
b719c91c82 gallium/util: remove duplicated include
Remove duplicated include.

Signed-off-by: Brian Paul <brianp@vmware.com>
2010-09-30 09:36:21 -06:00
Nicolas Kaiser
237fa8a81c gallium/rtasm: remove duplicated include
Remove duplicated include.

Signed-off-by: Brian Paul <brianp@vmware.com>
2010-09-30 09:36:21 -06:00
Nicolas Kaiser
3b7b1db661 egl: remove duplicated include
Remove duplicated include.

Signed-off-by: Brian Paul <brianp@vmware.com>
2010-09-30 09:36:21 -06:00
Nicolas Kaiser
7d0b89fda0 swrast: remove duplicated include
Remove duplicated include.

Signed-off-by: Brian Paul <brianp@vmware.com>
2010-09-30 09:36:20 -06:00
Francisco Jerez
065163bcd2 dri/nv10: Use fast Z clears. 2010-09-30 16:48:28 +02:00
Francisco Jerez
bdd19da218 dri/nouveau: Remove unnecessary flush. 2010-09-30 16:48:20 +02:00
Francisco Jerez
6f39280ba9 dri/nouveau: Have a smaller amount of larger scratch buffers.
Larger VBOs avoid many kernel trips to get them in sync with the GPU.
2010-09-30 16:46:46 +02:00
Chia-I Wu
ebeb4a7e8a mapi: Fix compiler warnings.
Do not use "void *" in arithmetics.
2010-09-30 17:09:59 +08:00
Chia-I Wu
d63b2622f1 st/egl: Skip single-buffered configs in EGL.
Let DRI2 report single-buffered configs and skip them in EGL.  This is
based on the patch by Luca Barbieri.
2010-09-30 17:04:56 +08:00
Chia-I Wu
6b2f1561ad egl: Check extensions.
Do not call into the driver if the extension for the called function is
not enabled.
2010-09-30 16:55:07 +08:00
Zhenyu Wang
72b368ae69 i965: always set tiling for fbo depth buffer on sandybridge
Sandybridge requires depth buffer must be tiling.

Fix 'fbo_firecube' demo.
2010-09-30 10:51:26 +08:00
Marek Olšák
83278d384e r300g: fix conditional rendering in non-wait path
NOTE: This is a candidate for the 7.9 branch.
2010-09-30 02:44:30 +02:00
Eric Anholt
ad1506c5ac i965: Remove my "safety counter" code from loops.
I've screwed this up enough times that I don't think it's worth it.
This time, it was that I was doing it once per top-level body
instruction instead of just once at the end of the loop body.
2010-09-29 16:40:31 -07:00
Eric Anholt
b90c7d1713 i965: Add live interval analysis and hook it up to the register allocator.
Fixes 13 piglit cases that failed at register allocation before.
2010-09-29 16:40:31 -07:00
Eric Anholt
e1261d3c49 i965: First cut at register allocation using graph coloring.
The interference is totally bogus (maximal), so this is equivalent to
our trivial register assignment before.  As in, passes the same set of
piglit tests.
2010-09-29 16:40:31 -07:00
Eric Anholt
9ff90b7230 ra: First cut at a graph-coloring register allocator for mesa.
Notably missing is choice of registers to spill.
2010-09-29 16:40:31 -07:00
Eric Anholt
21148e1c0a i965: Clean up the virtual GRF handling.
Now, virtual GRFs are consecutive integers, rather than offsetting the
next one by the size.  We need the size information to still be around
for real register allocation, anyway.
2010-09-29 16:40:31 -07:00
Dave Airlie
4378c17c88 r600g: return string for chip family
use same strings as r600c.
2010-09-30 09:17:20 +10:00
Dave Airlie
dbcd652602 r600g: clean up some code from move to new paths.
mainly remove 2 suffix from function names
2010-09-30 09:12:57 +10:00
Dave Airlie
2bc9d3f498 r600g: add L8A8 unorm.
fixes texEnv warnings.
2010-09-30 09:04:50 +10:00
Dave Airlie
534f7d5749 r600g: port r300g fix for X* formats in texformat code 2010-09-30 09:04:50 +10:00
Eric Anholt
0efea25c4b i956: Make new FS discard do its work in a temp, not the null reg!
Fixes:
glsl-fs-discard-02 (GPU hang)
glsl1-discard statement (2)
2010-09-29 15:52:36 -07:00
Eric Anholt
3da98c1ca5 i965: Fix use of undefined mem_ctx in vector splitting. 2010-09-29 15:51:05 -07:00
José Fonseca
e3ccfd4e03 gallivm: Use SSE4.1's ROUNDSS/ROUNDSD for scalar rounding. 2010-09-29 22:29:23 +01:00
José Fonseca
21f392c971 python/retrace: Handle set_index_buffer and draw_vbo. 2010-09-29 22:29:22 +01:00
José Fonseca
c7f33624f9 trace: Fix set_index_buffer and draw_vbo tracing. 2010-09-29 22:29:22 +01:00
Vinson Lee
02b8fb3ed5 r300/compiler: Move declaration before code.
Fixes this GCC warning on linux-x86 build.
r3xx_vertprog.c: In function ‘ei_if’:
r3xx_vertprog.c:396: warning: ISO C90 forbids mixed declarations and code
2010-09-29 14:22:20 -07:00
Vinson Lee
7c7fdef3b1 r300/compiler: Move declaration before code.
Fixes these GCC warnings on linux-x86 build.
r500_fragprog_emit.c: In function ‘emit_paired’:
r500_fragprog_emit.c:237: warning: ISO C90 forbids mixed declarations and code
r500_fragprog_emit.c: In function ‘emit_tex’:
r500_fragprog_emit.c:367: warning: ISO C90 forbids mixed declarations and code
r500_fragprog_emit.c: In function ‘emit_flowcontrol’:
r500_fragprog_emit.c:415: warning: ISO C90 forbids mixed declarations and code
r500_fragprog_emit.c: In function ‘r500BuildFragmentProgramHwCode’:
r500_fragprog_emit.c:633: warning: ISO C90 forbids mixed declarations and code
2010-09-29 14:13:49 -07:00
Vinson Lee
ae664daa25 r300/compiler: Move declaration before code.
Fixes these GCC warnings on linux-x86 build.
r500_fragprog.c: In function ‘r500_transform_IF’:
r500_fragprog.c:45: warning: ISO C90 forbids mixed declarations and code
r500_fragprog.c: In function ‘r500FragmentProgramDump’:
r500_fragprog.c:256: warning: ISO C90 forbids mixed declarations and code
2010-09-29 14:04:06 -07:00
Vinson Lee
a4f296d618 r300/compiler: Move declaration before code.
Fixes these GCC warnings on linux-x86 build.
r300_fragprog_emit.c: In function ‘emit_alu’:
r300_fragprog_emit.c:143: warning: ISO C90 forbids mixed declarations and code
r300_fragprog_emit.c:156: warning: ISO C90 forbids mixed declarations and code
r300_fragprog_emit.c: In function ‘finish_node’:
r300_fragprog_emit.c:271: warning: ISO C90 forbids mixed declarations and code
r300_fragprog_emit.c: In function ‘emit_tex’:
r300_fragprog_emit.c:344: warning: ISO C90 forbids mixed declarations and code
2010-09-29 13:56:27 -07:00
Vinson Lee
b96a391d14 r300/compiler: Remove declaration before code.
Fixes these GCC warnings on linux-x86 build.
r300_fragprog_swizzle.c: In function ‘r300_swizzle_is_native’:
r300_fragprog_swizzle.c:120: warning: ISO C90 forbids mixed declarations and code
r300_fragprog_swizzle.c: In function ‘r300_swizzle_split’:
r300_fragprog_swizzle.c:159: warning: ISO C90 forbids mixed declarations and code
2010-09-29 13:44:10 -07:00
Vinson Lee
dafbf480db r300/compiler: Move declaration before code.
Fixes this GCC warning on linux-x86 build.
radeon_rename_regs.c: In function ‘rc_rename_regs’:
radeon_rename_regs.c:112: warning: ISO C90 forbids mixed declarations and code
2010-09-29 13:40:45 -07:00
Vinson Lee
0d0273142a r300/compiler: Move declaration before code.
Fixes this GCC warning on linux-x86 build.
radeon_remove_constants.c: In function ‘rc_remove_unused_constants’:
radeon_remove_constants.c💯 warning: ISO C90 forbids mixed declarations and code
2010-09-29 13:34:56 -07:00
Vinson Lee
4cd4fd37aa r300/compiler: Move declaration before code.
Fixes these GCC warning on linux-x86 build.
radeon_optimize.c: In function ‘constant_folding’:
radeon_optimize.c:419: warning: ISO C90 forbids mixed declarations and code
radeon_optimize.c:425: warning: ISO C90 forbids mixed declarations and code
radeon_optimize.c:432: warning: ISO C90 forbids mixed declarations and code
2010-09-29 13:30:34 -07:00
Vinson Lee
38c31de445 r600g: Fix SCons build. 2010-09-29 13:14:34 -07:00
Vinson Lee
07a38505c6 r300/compiler: Move declaration before code.
Fixes these GCC warnings on linux-x86 build.
radeon_dataflow_deadcode.c: In function ‘push_branch’:
radeon_dataflow_deadcode.c:112: warning: ISO C90 forbids mixed declarations and code
radeon_dataflow_deadcode.c: In function ‘update_instruction’:
radeon_dataflow_deadcode.c:183: warning: ISO C90 forbids mixed declarations and code
radeon_dataflow_deadcode.c: In function ‘rc_dataflow_deadcode’:
radeon_dataflow_deadcode.c:352: warning: ISO C90 forbids mixed declarations and code
radeon_dataflow_deadcode.c:379: warning: ISO C90 forbids mixed declarations and code
2010-09-29 13:13:09 -07:00
Jerome Glisse
6abd7771c6 r600g: more cleanup
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-29 15:40:32 -04:00
Vinson Lee
7e536371f9 r600g: Update SConscript.
Fixes SCons build.
2010-09-29 12:16:39 -07:00
Vinson Lee
a9d5808232 r300/compiler: Move declaration before code.
Fixes this GCC warning on linux-x86 build.
radeon_pair_regalloc.c: In function ‘rc_pair_regalloc_inputs_only’:
radeon_pair_regalloc.c:330: warning: ISO C90 forbids mixed declarations and code
2010-09-29 12:15:14 -07:00
Vinson Lee
22c06a08e7 r600g: Update SConscript.
Fixes SCons build.
2010-09-29 12:09:21 -07:00
Vinson Lee
4f80a2d170 r300/compiler: Move declaration before code.
Fixes these GCC warnings on linux-x86 build.
radeon_pair_schedule.c: In function ‘emit_all_tex’:
radeon_pair_schedule.c:244: warning: ISO C90 forbids mixed declarations and code
radeon_pair_schedule.c: In function ‘destructive_merge_instructions’:
radeon_pair_schedule.c:291: warning: ISO C90 forbids mixed declarations and code
radeon_pair_schedule.c:438: warning: ISO C90 forbids mixed declarations and code
radeon_pair_schedule.c: In function ‘scan_read’:
radeon_pair_schedule.c:619: warning: ISO C90 forbids mixed declarations and code
radeon_pair_schedule.c: In function ‘scan_write’:
radeon_pair_schedule.c:645: warning: ISO C90 forbids mixed declarations and code
radeon_pair_schedule.c: In function ‘schedule_block’:
radeon_pair_schedule.c:673: warning: ISO C90 forbids mixed declarations and code
radeon_pair_schedule.c: In function ‘rc_pair_schedule’:
radeon_pair_schedule.c:730: warning: ISO C90 forbids mixed declarations and code
2010-09-29 12:02:02 -07:00
Jerome Glisse
1235becaa1 r600g: cleanup
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-29 15:06:04 -04:00
Vinson Lee
845bda34d0 r600g: Update SConscript.
This is a follow-up to commit 9c284b5cae.

Fixes SCons build.
2010-09-29 11:52:55 -07:00
Marek Olšák
94e9ab975c r300g: add support for formats beginning with X, like X8R8G8B8
This is actually a format translator fix.
2010-09-29 20:43:44 +02:00
Vinson Lee
4e07aadabb r300/compiler: Move declaration before code.
Fixes these GCC warnings on linux-x86 build.
radeon_pair_translate.c: In function ‘set_pair_instruction’:
radeon_pair_translate.c:153: warning: ISO C90 forbids mixed declarations and code
radeon_pair_translate.c:170: warning: ISO C90 forbids mixed declarations and code
radeon_pair_translate.c: In function ‘rc_pair_translate’:
radeon_pair_translate.c:336: warning: ISO C90 forbids mixed declarations and code
radeon_pair_translate.c:341: warning: ISO C90 forbids mixed declarations and code
2010-09-29 11:41:14 -07:00
Vinson Lee
45d22a9b20 r300/compiler: Move declaration before code.
Fixes these GCC warnings on linux-x86 build.
radeon_program_alu.c: In function ‘r300_transform_trig_simple’:
radeon_program_alu.c:882: warning: ISO C90 forbids mixed declarations and code
radeon_program_alu.c:932: warning: ISO C90 forbids mixed declarations and code
radeon_program_alu.c: In function ‘radeonTransformTrigScale’:
radeon_program_alu.c:996: warning: ISO C90 forbids mixed declarations and code
radeon_program_alu.c: In function ‘r300_transform_trig_scale_vertex’:
radeon_program_alu.c:1033: warning: ISO C90 forbids mixed declarations and code
2010-09-29 11:32:11 -07:00
Jerome Glisse
9c284b5cae r600g: delete old path
Lot of clean can now happen.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-29 14:28:48 -04:00
Vinson Lee
483971e649 r300/compiler: Move declaration before code.
Fixes this GCC warning on linux-x86 build.
radeon_emulate_loops.c: In function ‘rc_emulate_loops’:
radeon_emulate_loops.c:517: warning: ISO C90 forbids mixed declarations and code
2010-09-29 11:19:55 -07:00
Vinson Lee
760d7c5d7d r300/compiler: Move declaration before code.
Fixes these GCC warnings with linux-x86 build.
radeon_emulate_branches.c: In function ‘handle_if’:
radeon_emulate_branches.c:65: warning: ISO C90 forbids mixed declarations and code
radeon_emulate_branches.c:71: warning: ISO C90 forbids mixed declarations and code
radeon_emulate_branches.c: In function ‘handle_else’:
radeon_emulate_branches.c:94: warning: ISO C90 forbids mixed declarations and code
radeon_emulate_branches.c: In function ‘handle_endif’:
radeon_emulate_branches.c:201: warning: ISO C90 forbids mixed declarations and code
radeon_emulate_branches.c: In function ‘fix_output_writes’:
radeon_emulate_branches.c:267: warning: ISO C90 forbids mixed declarations and code
radeon_emulate_branches.c:284: warning: ISO C90 forbids mixed declarations and code
radeon_emulate_branches.c: In function ‘rc_emulate_branches’:
radeon_emulate_branches.c:307: warning: ISO C90 forbids mixed declarations and code
2010-09-29 11:10:08 -07:00
Vinson Lee
aa62416ae1 mesa: Fix printf format warning.
Fixes this GCC warning.
math/m_debug_xform.c: In function '_math_test_all_transform_functions':
math/m_debug_xform.c:320: warning: format not a string literal and no format arguments
2010-09-29 10:46:46 -07:00
Vinson Lee
9c841abebc mesa: Fix printf format warning.
Fixes this GCC warning.
math/m_debug_norm.c: In function '_math_test_all_normal_transform_functions':
math/m_debug_norm.c:365: warning: format not a string literal and no format arguments
2010-09-29 10:44:17 -07:00
Vinson Lee
ae0cd81189 mesa: Fix printf format warning.
Fixes this GCC warning.
math/m_debug_clip.c: In function '_math_test_all_cliptest_functions':
math/m_debug_clip.c:363: warning: format not a string literal and no format arguments
2010-09-29 10:30:04 -07:00
Jerome Glisse
5646964b13 r600g: use a hash table instead of group
Instead of creating group of register use a hash table
to lookup into which block each register belongs. This
simplify code a bit.

Signed-off-by: Jerome Glisse <jglisse@redhat.com
2010-09-29 12:44:32 -04:00
Brian Paul
0cb545a7f2 draw: pass sampler state down to llvm jit state
Fixes a regression caused from the change to make min/max lod dynamic
state.

https://bugs.freedesktop.org/show_bug.cgi?id=30437
2010-09-29 10:34:43 -06:00
Marek Olšák
698893889a Makefile: ensure Gallium's Makefile.xorg and SConscript.dri are in the tarball
Signed-off-by: Brian Paul <brianp@vmware.com>
2010-09-29 09:51:55 -06:00
José Fonseca
e3a3a5378e scons: New build= option, with support for checked builds.
Where checked build is compiler optimizations plus debugging checks --
ideal for testing CPU bound loads and running test automation loads.
2010-09-29 14:24:52 +01:00
José Fonseca
67450f0644 scons: New build= option, with support for checked builds.
Where checked build is compiler optimizations plus debugging checks --
ideal for testing CPU bound loads and running test automation loads.
2010-09-29 14:17:26 +01:00
José Fonseca
fdcc168a16 llvmpipe: Decouple sampler view and sampler state updates.
Fixes glean pbo crash.

It would be possible to avoid crashing without decoupling, but given
that state trackers give no guarantee that number of views is consistent,
that would likely cause too many state updates (or miss some).
2010-09-29 14:16:35 +01:00
Kristian Høgsberg
4b70fe8421 glx: Only remove drawables from the hash when we actually delete them
https://bugs.freedesktop.org/show_bug.cgi?id=30457
2010-09-29 08:32:29 -04:00
Dave Airlie
08839c4055 Revert "r600g: add initial vertex translate support."
This reverts commit 914b669b08.

I didn't mean to commit this yet, will redo in new state system once
we clean it up.
2010-09-29 20:04:00 +10:00
Hui Qi Tay
3744d1c7d3 draw: added viewport and cliptest flags
Corrections in store_clip to store clip coordinates in AoS form.
Viewport & cliptest flag options based on variant key.
Put back draw_pt_post_vs and now 2 paths based on whether clipping
occurs or not.
2010-09-29 10:11:59 +01:00
Hui Qi Tay
94f65d095a draw: cliptest and viewport done in a single loop in vertex shader
Cliptesting now done at the end of vs in draw_llvm instead of
draw_pt_post_vs.

Added viewport mapping transformation and further cliptesting to
vertex shader in draw_llvm.c

Alternative path where vertex header setup, clip coordinates store,
cliptesting and viewport mapping are done earlier in the vertex
shader.

Still need to hook this up properly according to the return value of
"draw_llvm_shader" function.
2010-09-29 10:10:09 +01:00
Zhenyu Wang
d4da253b29 Revert "i965: Always set tiling for depth buffer on sandybridge"
This reverts commit 0a1910c267.

oops, shouldn't apply tiling depth buffer for other chips as well.
2010-09-29 15:18:37 +08:00
Tom Stellard
b27a809266 r300/compiler: Don't merge instructions that write output regs and ALU result
https://bugs.freedesktop.org/show_bug.cgi?id=30415

NOTE: This is a candidate for the 7.9 branch.
2010-09-28 23:52:41 -07:00
Tom Stellard
1b76dde0cd r300/compiler: Don't use rc_error() unless the error is unrecoverable
https://bugs.freedesktop.org/show_bug.cgi?id=30416

NOTE: This is a candidate for the 7.9 branch.
2010-09-28 23:52:41 -07:00
Tom Stellard
d40ff5510c r300/compiler: Fix segfault in error path
https://bugs.freedesktop.org/show_bug.cgi?id=30415

NOTE: This is a candidate for the 7.9 branch.
2010-09-28 23:52:41 -07:00
Zhenyu Wang
73dab75b41 i965: fallback lineloop on sandybridge for now
Until we fixed GS hang issue.
2010-09-29 14:35:19 +08:00
Zhenyu Wang
0a1910c267 i965: Always set tiling for depth buffer on sandybridge
Sandybridge only support tiling depth buffer, always set tiling bit.

Fix 'fbo_firecube' demo.
2010-09-29 14:02:37 +08:00
Dave Airlie
28b57c56e2 r600g: remove old assert from new codepath
this fixes draw-elements-base-vertex
2010-09-29 14:52:39 +10:00
Dave Airlie
914b669b08 r600g: add initial vertex translate support. 2010-09-29 14:41:16 +10:00
Kenneth Graunke
565ff67688 glsl: "Copyright", not "Constantright"
Clearly this started out as ir_copy_propagation.cpp, but the search and
replace was a bit overzealous.
2010-09-28 21:17:33 -07:00
Eric Anholt
1747aa6755 i965: Add support for builtin uniforms to the new FS backend.
Fixes 8 piglit tests.
2010-09-28 16:31:10 -07:00
Eric Anholt
daacaac3c8 mesa: Move the list of builtin uniform info from ir_to_mesa to shared code.
I'm still not pleased with how builtin uniforms are handled, but as
long as we're relying on the prog_statevar stuff this seems about as
good as it'll get.
2010-09-28 16:26:58 -07:00
Eric Anholt
9ac910cfcd i965: Clean up obsolete FINISHME comment. 2010-09-28 16:26:58 -07:00
Eric Anholt
ff0eb45f47 i965: Fix array indexing of arrays of matrices.
The deleted code was meant to be handling indexing of a matrix, which
would have been a noop if it had been correct.
2010-09-28 16:26:49 -07:00
Dave Airlie
301ab49605 r600g: move radeon.h members around to add back map flushing. 2010-09-29 09:19:22 +10:00
Dave Airlie
53b3933ce6 r600g: add evergreen texture border support to new path 2010-09-29 09:19:22 +10:00
Dave Airlie
23be883c9b r600g: add back evergreen name. 2010-09-29 09:19:22 +10:00
Eric Anholt
17f3b8097d i965: Don't try to emit interpolation for unused varying slots.
Fixes:
glsl-fs-varying-array
glsl-texcoord-array
glsl-texcoord-array-2
glsl-vs-varying-array
2010-09-28 14:53:36 -07:00
Eric Anholt
5272c6a7a2 i965: Do interpolation for varying matrices and arrays in the FS backend.
Fixes:
glsl-array-varying-01
glsl-vs-mat-add-1
glsl-vs-mat-div-1
glsl-vs-mat-div-2
glsl-vs-mat-mul-2
glsl-vs-mat-mul-3
2010-09-28 14:50:59 -07:00
Eric Anholt
586b4b500f glsl: Also update implicit sizes of varyings at link time.
Otherwise, we'll often end up with gl_TexCoord being 0 length, for
example.  With ir_to_mesa, things ended up working out anyway, as long
as multiple implicitly-sized arrays weren't involved.
2010-09-28 14:37:26 -07:00
Eric Anholt
b9a59f0358 i965: Add support for ARB_fragment_coord_conventions to the new FS backend.
Fixes:
glsl-arb-frag-coord-conventions
glsl-fs-fragcoord
2010-09-28 13:42:52 -07:00
Eric Anholt
701c5f11c9 i965: Add support for ir_loop counters to the new FS backend.
Fixes:
glsl1-discard statement in for loop
glsl-fs-loop-two-counter-02
glsl-fs-loop-two-counter-04
2010-09-28 13:31:01 -07:00
Tilman Sauerbeck
35f94b1942 r600g: Cleaned up index buffer reference handling in the draw module.
This fixes a buffer leak.

Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
2010-09-28 22:12:23 +02:00
Eric Anholt
89f6783d17 i965: Add support for MRT to the new FS backend.
Fixes these tests using gl_FragData or just gl_FragDepth:
glsl1-Preprocessor test (extension test 1)
glsl1-Preprocessor test (extension test 2)
glsl-bug-22603
2010-09-28 12:37:21 -07:00
Eric Anholt
86fd11262c i965: Add support for non-color render target write data to new FS backend.
This is the first time these payload bits have made sense to me,
outside of brw_wm_pass* structure.

Fixes: glsl1-gl_FragDepth writing
2010-09-28 12:37:21 -07:00
Vinson Lee
f46a61554f scons: Add program/sampler.cpp to SCons build.
This is a follow-up to commit a32893221c.

Fixes MinGW SCons build.
2010-09-28 12:03:45 -07:00
Eric Anholt
2999a44968 i965: Set up sampler numbers in the FS backend.
+10 piglits
2010-09-28 11:37:08 -07:00
Eric Anholt
a32893221c mesa: Pull ir_to_mesa's sampler number fetcher out to shared code. 2010-09-28 11:37:08 -07:00
Jerome Glisse
723a655ed3 r600g: avoid rebuilding the vertex shader if no change to input format
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-28 14:34:25 -04:00
Jerome Glisse
fe790a3c34 r600g: suspend/resume occlusion query around clear/copy
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-28 14:24:18 -04:00
Marek Olšák
11eb422a16 configure.ac: do not build xorg-r300g by default
NOTE: This is a candidate for the 7.9 branch.
2010-09-28 19:38:40 +02:00
Marek Olšák
a1aec2e2be configure.ac: look for libdrm_radeon before building gallium/r300,r600
NOTE: This is a candidate for the 7.9 branch.
2010-09-28 19:38:39 +02:00
Eric Anholt
9e96c737f8 i965: Subtract instead of adding when computing y delta in new FS backend.
Fixes 7 piglit cases.
2010-09-28 10:19:54 -07:00
Eric Anholt
5f7bd68149 i965: Add support for gl_FrontFacing to the new FS backend.
Fixes:
glsl1-gl_FrontFacing var (1)
glsl1-gl_FrontFacing var (2)
2010-09-28 10:10:44 -07:00
Eric Anholt
ef8e002c75 i965: Fix up part of my Sandybridge attributes support patch.
I confused the array sizing for number of files for the number of regs
in a file.
2010-09-28 10:10:42 -07:00
Eric Anholt
f1dba03056 i965: Fix all non-snb regression in the snb attribute interpolation commit.
This apparently had never been tested elsewhere before being merged to
master.
2010-09-28 10:10:42 -07:00
Eric Anholt
6bf12c8b73 i965: Add support for struct, array, and matrix uniforms to FS backend.
Fixes 16 piglit cases.
2010-09-28 09:33:31 -07:00
Eric Anholt
ba481f2046 i965: Add support for dereferencing structs to the new FS backend.
Fixes: glsl1-struct(2)
2010-09-28 09:33:31 -07:00
Eric Anholt
07fc8eed8f i965: Set the variable type when dereferencing an array.
We don't set the type on the array virtual reg as a whole, so here's
the right place.

Fixes:
glsl1-GLSL 1.20 arrays
glsl1-temp array with constant indexing, fragment shader
glsl1-temp array with swizzled variable indexing
2010-09-28 09:33:31 -07:00
Eric Anholt
719f84d9ab i965: Fix up the FS backend for the variable array indexing pass.
We need to re-run channel expressions afterwards as it generates new
vector expressions, and we need to successfully support conditional
assignment (brw_CMP takes 2 operands, not 1).
2010-09-28 09:33:30 -07:00
Eric Anholt
57edd7c5c1 i965: Fix valgrind complaint about base_ir for new FS debugging. 2010-09-28 09:33:30 -07:00
Eric Anholt
1723fdb3f0 i965: Apply the same set of lowering passes to new FS as to Mesa IR.
While much of this we will want to support natively, this should make
the task of reaching the Mesa IR backend's quality easier.

Fixes:
glsl-fs-main-return.
2010-09-28 09:33:30 -07:00
Eric Anholt
e10508812a i965: Actually track the "if" depth in loop in the new FS backend.
Fixes:
glsl-fs-if-nested-loop.
2010-09-28 09:33:30 -07:00
Eric Anholt
fceb78e3cc i965: Fix negation in the new FS backend.
Fixes:
glsl1-Negation
glsl1-Negation2
2010-09-28 09:33:30 -07:00
Jerome Glisse
7ee8fa0421 r600g: switch to new design
New design seems to be on parity according to piglit,
make it default to get more exposure and see if there
is any show stopper in the coming days.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-28 11:37:30 -04:00
Jerome Glisse
b534eb16a2 r600g: fix remaining piglit issue in new design
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-28 11:12:03 -04:00
Jerome Glisse
5a38cec7c8 r600g: use ptr for blit depth uncompress function
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-28 09:51:08 -04:00
Christoph Bumiller
e0b93c5beb nv50: fix GP state bind and validate 2010-09-28 11:22:59 +02:00
Dave Airlie
175261a1f1 r600g: on evergreen the centroid isn't set in this register. 2010-09-28 19:02:46 +10:00
Zhenyu Wang
45b37c4b12 i965: fallback bitmap operation on sandybridge
Need to bring back correct fb write with header to set pixel
write mask. Fallback for now.
2010-09-28 15:58:21 +08:00
Zhenyu Wang
3074b61f64 i965: fix occlusion query on sandybridge
Fix pipe control command for depth stall and PS_DEPTH_COUNT write.
2010-09-28 15:58:21 +08:00
Zhenyu Wang
ec99833e92 i965: fix point sprite on sandybridge
Need to set point sprite function in fixed SF state now on sandybridge.
2010-09-28 15:58:21 +08:00
Zhenyu Wang
4b6b0bf24a i965: fix scissor state on sandybridge
Fix incorrect scissor rect struct and missed scissor state pointer
setting for sandybridge.
2010-09-28 15:58:21 +08:00
Zhenyu Wang
3f3059fcc0 i965: enable polygon offset on sandybridge
Depth offset function is moved to SF stage on sandybridge.
2010-09-28 15:58:21 +08:00
Zhenyu Wang
15a8e7ec90 i965: fix pixel w interpolation on sandybridge 2010-09-28 15:58:21 +08:00
Zhenyu Wang
85fa900b93 i965: don't do calculation for delta_xy on sandybridge
Sandybridge doesn't have Xstart/Ystart in payload header.
2010-09-28 15:58:21 +08:00
Zhenyu Wang
c58bf2cee5 i965: only allow SIMD8 kernel on sandybridge now
Until we fixed SIMD16 kernel, force to SIMD8 on sandybridge now.
2010-09-28 15:58:21 +08:00
Zhenyu Wang
18c3b754f9 i965: sandybridge pipe control workaround before write cache flush
Must issue a pipe control with any non-zero post sync op before
write cache flush = 1 pipe control.
2010-09-28 15:58:21 +08:00
Zhenyu Wang
c8033f1b1e i965: Add all device ids for sandybridge 2010-09-28 15:58:20 +08:00
Zhenyu Wang
81aae67e58 i965: fix const register count for sandybridge
Sandybridge's PS constant buffer payload size is decided from
push const buffer command, incorrect size would cause wrong data
in payload for position and vertex attributes. This fixes coefficients
for tex2d/tex3d.
2010-09-28 15:58:20 +08:00
Zhenyu Wang
956f866030 i965: Fix sampler on sandybridge
Sandybridge has not much change on texture sampler with Ironlake.
2010-09-28 15:58:20 +08:00
Zhenyu Wang
c5a3b25bb9 i965: fix jump count on sandybridge
Jump count is for 64bit long each, so one instruction requires 2
like on Ironlake.
2010-09-28 15:58:20 +08:00
Zhenyu Wang
9c39a9fcb2 i965: VS use SPF mode on sandybridge for now
Until conditional instructions were fixed, use SPF mode instead for now.
2010-09-28 15:58:20 +08:00
Zhenyu Wang
7401a98e29 i965: add sandybridge viewport state bo into validation list 2010-09-28 15:58:20 +08:00
Zhenyu Wang
a0b1d7b2b8 i965: ignore quads for GS kernel on sandybridge
Sandybridge's VF would convert quads to polygon which not required
for GS then. Current GS state still would cause hang on lineloop.
2010-09-28 15:58:20 +08:00
Zhenyu Wang
67dafa4b56 i965: ff sync message change for sandybridge 2010-09-28 15:58:20 +08:00
Zhenyu Wang
fa589770e8 i965: fix point size setting in header on sandybridge 2010-09-28 15:58:20 +08:00
Zhenyu Wang
03218a0093 i965: force zero in clipper to ignore RTAIndex on sandybridge 2010-09-28 15:58:20 +08:00
Zhenyu Wang
41c31c2ebd i965: Fix color interpolation on sandybridge
Don't double store position in vertex attribute. This makes color
interpolation right by using barycentric coordinates.
2010-09-28 15:58:20 +08:00
Zhenyu Wang
8c31a4c3cf i965: enable accumulator update in PS kernel too on sandybridge
Accumulator update flag must be set for implicit update on sandybridge.
2010-09-28 15:58:19 +08:00
Zhenyu Wang
b016a78b98 i965: new state dump for sandybridge
Dump new state object on sandybridge for cc viewport, clip viewport,
depth stencil, cc and blend state.
2010-09-28 15:58:19 +08:00
Zhenyu Wang
bf60f35934 i965: disasm quarter and write enable instruction control on sandybridge 2010-09-28 15:58:19 +08:00
Eric Anholt
fe2d4a5ea0 i965: Add support for POW in gen6 FS.
Fixes glsl-algebraic-pow-2 in brw_wm_glsl.c mode.
2010-09-28 15:58:19 +08:00
Eric Anholt
2f914053bc i965: Set up inputs to the fragment shader according to FP InputsRead.
Sending down data that doesn't get read doesn't make any sense, and
would make handling things like gl_FrontFacing and gl_PointCoord
harder.
2010-09-28 15:58:19 +08:00
Eric Anholt
a66e9a4d86 i965: Add support for attribute interpolation on Sandybridge.
Things are simpler these days thanks to barycentric interpolation
parameters being handed in in the payload.
2010-09-28 15:58:19 +08:00
Vinson Lee
79d5657770 dri: Add GET_PROGRAM_NAME definition for Mac OS X. 2010-09-28 00:27:31 -07:00
Tom Stellard
b3e95dc45c r300/compiler: Use rc_for_all_reads_src() in "dead constants" pass 2010-09-27 23:17:11 -07:00
Tom Stellard
40d256295c r300/compiler: radeon_remove_constants.c: fix indentation 2010-09-27 23:17:11 -07:00
Tom Stellard
a716952184 r300/compiler: Print immediate values after "dead constants" pass 2010-09-27 23:17:11 -07:00
Tom Stellard
798355d429 r300/compiler: Add more helper functions for iterating through sources
rc_for_all_reads_src() and rc_pair_for_all_reads_arg() pass references to
instruction sources to the callback so they can be modified directly.
2010-09-27 23:17:11 -07:00
Dave Airlie
34dba5f05a r600g: fix db flush breaking config state 2010-09-28 14:32:13 +10:00
Marek Olšák
e4fd65e9d7 r300g: fix swizzling of texture border color
NOTE: This is a candidate for the 7.9 branch.
2010-09-28 05:34:51 +02:00
Marek Olšák
13359e6a4b r300g: add support for 3D NPOT textures without mipmapping
The driver actually creates a 3D texture aligned to POT and does all
the magic with texture coordinates in the fragment shader. It first
emulates REPEAT and MIRRORED wrap modes in the fragment shader to get
the coordinates into the range [0, 1]. (already done for 2D NPOT)
Then it scales them to get the coordinates of the NPOT subtexture.

NPOT textures are now less of a lie and we can at least display
something meaningful even for the 3D ones.

Supported wrap modes:
- REPEAT
- MIRRORED_REPEAT
- CLAMP_TO_EDGE (NEAREST filtering only)
- MIRROR_CLAMP_TO_EDGE (NEAREST filtering only)
- The behavior of other CLAMP modes is undefined on borders, but they usually
  give results very close to CLAMP_TO_EDGE with mirroring working perfectly.

This fixes:
- piglit/fbo-3d
- piglit/tex3d-npot
2010-09-28 05:34:51 +02:00
Marek Olšák
7128e1625b r300/compiler: fix shadow sampling with swizzled coords
Taking the W component from coords directly ignores swizzling. Instead,
take the component which is mapped to W in the TEX instruction parameter.
The same for Z.

NOTE: This is a candidate for the 7.9 branch.
2010-09-28 05:34:51 +02:00
Marek Olšák
c2ea7ffb0a r300/compiler: do not use copy propagation if SaturateMode is used
NOTE: This is a candidate for the 7.9 branch.
2010-09-28 05:34:51 +02:00
Marek Olšák
6f747567ec r300/compiler: fix projective mapping of 2D NPOT textures
NOTE: This is a candidate for the 7.9 branch.
2010-09-28 05:34:51 +02:00
Marek Olšák
82f8e43bfa r300g: code cleanups
Some random stuff I had here.

1) Fixed some misleading comments.
2) Removed fake_npot, since it's redundant.
3) lower_texture_rect -> scale_texcoords
4) Reordered and reindented some TEX transform code.
2010-09-28 05:34:51 +02:00
Eric Anholt
94d44c33c0 i965: Add support for dFdx()/dFdy() to the FS backend.
Fixes:
glsl-fwidth
glsl-derivs-swizzle
2010-09-27 18:31:53 -07:00
Eric Anholt
3610e0c1a0 i965: Fix vector splitting RHS channel selection with sparse writemasks.
Fixes:
glsl-fs-all-02
glsl-fs-dot-vec2
2010-09-27 18:29:15 -07:00
Eric Anholt
169ff0cc9d i965: Handle all_equal/any_nequal in the new FS.
These are generated for scalar operands instead of plain equal/nequal.
But for scalars, they're the same anyway.  +30 piglits.
2010-09-27 16:12:18 -07:00
Eric Anholt
a5c6c8a31b i965: Remove swizzling of assignment to vector-splitting single-channel LHS.
We'd end up reading some non-x component of the float RHS.  +53 piglits.
2010-09-27 16:09:50 -07:00
Eric Anholt
11ba8bafdb i965: Fix up writemasked assignments in the new FS.
Not sure how I managed to get tests to succeed without this.  +54 piglits.
2010-09-27 16:07:42 -07:00
Eric Anholt
5e8ed7a79b glsl: Add validation that a swizzle only references valid channels.
Caught the bug in the previous commit.
2010-09-27 15:52:56 -07:00
Eric Anholt
668cdbe129 glsl: Fix broadcast_index of lower_variable_index_to_cond_assign.
It's trying to get an int smeared across all channels, not trying to
get a 1:1 mapping of a subset of a vector's channels.  This usually
ended up not mattering with ir_to_mesa, since it just smears floats
into every chan of a vec4.

Fixes:
glsl1-temp array with swizzled variable indexing
2010-09-27 15:52:56 -07:00
Ian Romanick
8b2d5f431f Remove unnescessary initializations of UpdateTexturePalette
This is already NULL'ed in _mesa_init_driver_functions.
2010-09-27 15:23:14 -07:00
Ian Romanick
78db8c8b66 Regenerate files changed by previous commit 2010-09-27 15:23:14 -07:00
Ian Romanick
02984e3536 Remove GL_EXT_cull_vertex
This is only used in the i915 driver where it provides little benefit
for very few applications that use it with fixed function TNL.
2010-09-27 15:23:14 -07:00
Ian Romanick
4b1f98241f Remove GL_MESA_packed_depth_stencil
This extension was never enabled in any driver.
2010-09-27 15:23:14 -07:00
Ian Romanick
7f11d471e6 mesa: Force GL_SGIS_generate_mipmap to always be enabled
As per discussions at XDS.
2010-09-27 15:23:13 -07:00
Ian Romanick
4da5f1b7c5 mesa: Force GL_ARB_copy_buffer to always be enabled
As per discussions at XDS.
2010-09-27 15:23:13 -07:00
Luca Barbieri
a73c6ce67b d3d1x: work around crash in widl 2010-09-28 00:18:25 +02:00
Luca Barbieri
9126826594 d3d11: fix reference counting so devices get freed 2010-09-27 23:43:53 +02:00
Ian Romanick
923c3334fb dri: Ensure that DRI driver cpp files are in tarballs 2010-09-27 14:16:16 -07:00
Brian Paul
de2dfce0d9 softpipe: fix swizzling of texture border color
We ask the texture tile cache to swizzle the color for us since that's
where the view/swizzling info is available.
2010-09-27 15:06:23 -06:00
Brian Paul
3446af0179 llvmpipe: fix swizzling of texture border color
The pipe_sampler_view's swizzle terms also apply to the texture border
color.  Simply move the apply_sampler_swizzle() call after we fetch
the border color.

Fixes many piglit texwrap failures.
2010-09-27 15:06:23 -06:00
Jerome Glisse
0282682e98 r600g: fix occlusion query after change to block structure
block->reg point to register value not block->pm4 which point
to packet.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-27 17:00:07 -04:00
Brian Paul
029c099b54 softpipe: allocate tile data on demand
Changes in v2:
- Invalidate last_tile_addr on any change, fixing regressions
- Correct coding style

Currently softpipe ends up allocating more than 200 MB of memory
for each context due to the tile caches.

Even worse, this memory is all explicitly cleared, which means that the
kernel must actually back it with physical RAM right away.

This change allocates tile memory on demand.

Signed-off-by: Brian Paul <brianp@vmware.com>
2010-09-27 14:32:05 -06:00
Luca Barbieri
a359eb80c5 d3d1x: fix Map 2010-09-27 22:20:53 +02:00
Luca Barbieri
f976cd0c9e d3d1x: rework DXGI for occlusion testing and default width/height 2010-09-27 22:20:53 +02:00
Luca Barbieri
e01e2e1883 d3d1x: put proper calling convention in headers, fixes 64-bit builds 2010-09-27 22:20:53 +02:00
Luca Barbieri
b821fdd563 d3d1x: properly support specifying MipLevels as 0 2010-09-27 22:20:53 +02:00
Luca Barbieri
db6f1d0436 d3d1x: support centroid interpolation 2010-09-27 22:20:53 +02:00
Luca Barbieri
ff531c5b05 ureg: support centroid interpolation 2010-09-27 22:20:52 +02:00
Luca Barbieri
94c2be73f4 d3d1x: link to libdrm for X11 platform too
Thanks to Xavier Chantry.
2010-09-27 22:20:52 +02:00
Luca Barbieri
f1afa8794e d3d11: ignore StructureByteStride
D3D11 applications are allowed to pass a random value if the buffer
is not structured
2010-09-27 22:20:52 +02:00
Luca Barbieri
dfc546c047 d3d11: advertise IDXGIDevice1, not just IDXGIDevice
Fixes failure to create device in DirectX SDK samples.
2010-09-27 22:20:52 +02:00
Vinson Lee
a6e642be5c scons: Add MinGW-w64 prefixes for MinGW build. 2010-09-27 13:13:25 -07:00
Hui Qi Tay
75d22e71a8 llvmpipe: minor changes in llvm coefficient calcs 2010-09-27 20:46:46 +01:00
Jerome Glisse
5e07483ed9 r600g: fix routing btw vertex & pixel shader
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-27 15:13:14 -04:00
Jerome Glisse
1617daaf49 r600g: fix pointsprite & resource unbinding
When asking to bind NULL resource assume it's unbinding
so free resource and unreference assoicated buffer.
Also fix pointsprite parameter.

Fix glsl-fs-pointcoord & fp-fragment-position

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-27 15:00:17 -04:00
Jerome Glisse
99c422ef5a r600g: build packet header once
Build packet header once and allow to add fake register support so
we can handle things like indexed set of register (evergreen sampler
border registers for instance.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-27 11:53:34 -04:00
Jerome Glisse
58a31758e3 r600g: fix index buffer drawing
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-27 09:59:52 -04:00
Luca Barbieri
99486bfc5b d3d1x: link progs with CXXFLAGS 2010-09-27 14:26:12 +02:00
Luca Barbieri
31d8f64f3f d3d1x: fix progs linking if not all EGL platforms are enabled 2010-09-27 14:24:33 +02:00
Luca Barbieri
9ba4b30eae d3d1x: add private gitignore file 2010-09-27 14:24:33 +02:00
Luca Barbieri
8d0ed47d94 d3d1x: fix parallel build 2010-09-27 14:11:12 +02:00
Luca Barbieri
e507e4ec05 gallium: add $(PROGS_DEPS) as dependencies for $(PROGS)
Commit 80ee3a440c added a PROGS_DEPS
definition, but no uses, even though it seems clearly intended
to be a set of additional dependencies for $(PROGS).

Correct this.
2010-09-27 14:11:12 +02:00
Luca Barbieri
f762f7b85d mesa: make makedepend an hard requirement
Currently makedepend is used by the Mesa Makefile-based build system,
but not required.

Unfortunately, not having it makes dependency resolution non-existent,
which is a source of subtle bugs, and is a rarely tested
configuration, since all Mesa developers likely have it installed.

Furthermore some idioms require dependency resolution to work at all,
such as making headers depend on generated files.
2010-09-27 14:10:18 +02:00
Tilman Sauerbeck
4c6344f569 r600g: Fixed two texture surface leaks in r600_blit_uncompress_depth().
Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
2010-09-27 08:37:12 +02:00
Dave Airlie
7eab5ef425 r600g: add evergreen texture resource properly.
adding sampler border looks impossible with current design, another day, another corner case not worked out.
2010-09-27 14:35:41 +10:00
Vinson Lee
84b2773f00 r600g: Silence uninitialized variable warnings.
Fixes these GCC warnings.
r600_shader.c: In function 'tgsi_tex':
r600_shader.c:1611: warning: 'src2_chan' may be used uninitialized in this function
r600_shader.c:1611: warning: 'src_chan' may be used uninitialized in this function
2010-09-26 14:34:05 -07:00
Marek Olšák
311ab3d468 r300g: fix macrotiling on R350
MACRO_SWITCH on R350 appears to use the RV350 mode by default. Who knew?

NOTE: This is a candidate for the 7.9 branch.
2010-09-26 22:38:52 +02:00
Jerome Glisse
d2f24c4d75 r600g: use depth decompression in new path
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-26 16:29:33 -04:00
Jerome Glisse
4ca1a92b7f r600g: move around variables to share depth uncompression code
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-26 16:29:33 -04:00
Joakim Sindholt
16baa465a2 radeong: fix leaks 2010-09-26 19:39:05 +02:00
Joakim Sindholt
b51f6e7c23 util/u_blitter: fix leak 2010-09-26 19:03:02 +02:00
Bas Nieuwenhuizen
bc8b8d06b6 r600g: set ENABLE_KILL on evergreen too 2010-09-26 12:23:41 -04:00
Bas Nieuwenhuizen
c622174f73 r600g: set ENABLE_KILL in the shader state in the new design 2010-09-26 12:21:02 -04:00
Jerome Glisse
a852615946 r600g: disable early cull optimization when occlusion query running
When occlusion query are running we want to have accurate
fragment count thus disable any early culling optimization
GPU has.

Based on work from Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-26 12:06:46 -04:00
Vinson Lee
6f16e497af r600g: Include p_compiler.h instead of malloc.h. 2010-09-26 03:23:31 -07:00
Vinson Lee
15f16328be r600g: Remove unused variables.
Fixes these GCC warnings.
radeon.c: In function 'radeon_new':
radeon.c:59: warning: unused variable 'k'
radeon.c:59: warning: unused variable 'j'
radeon.c:59: warning: unused variable 'id'
radeon.c:59: warning: unused variable 'i'
2010-09-26 03:18:12 -07:00
Vinson Lee
51bfd4e34a r600g: Don't return a value in function returning void.
Fixes this GCC warning.
radeon_state.c: In function 'radeon_state_fini':
radeon_state.c:140: warning: 'return' with a value, in function returning void
2010-09-26 03:10:58 -07:00
Vinson Lee
4743c7fbe7 r300g: Remove unused variable.
Fixes this GCC warning.
r300_state.c: In function 'r300_create_rs_state':
r300_state.c:925: warning: unused variable 'i'
2010-09-26 03:08:14 -07:00
Dave Airlie
81b7de5bf0 r300g: fix glsl-fs-pointcoord
Move GB_ENABLE to derived rs state, and find sprite coord for the correct
generic and enable the tex coord for that generic.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-09-26 18:07:07 +10:00
Vinson Lee
048bda175b r600g: Remove unused variable.
Fixes this GCC warning.
radeon_bo_pb.c: In function 'radeon_bo_pb_create_buffer':
radeon_bo_pb.c:178: warning: unused variable 'domain'
2010-09-25 15:19:29 -07:00
Tom Stellard
522e994a22 r300/compiler: Fix two mistakes in the presubtract optimization pass.
1. We can't turn an instruction into a presubtract operation if it
writes to one of the registers it reads from.
2. If we turn an instruction into a presubtract operation, we can't
remove that intruction unless all readers can use the presubtract
operation.

This fixes fdo bug 30337.
This is a candidate for the 7.9 branch.
2010-09-25 14:53:25 -07:00
Brian Paul
1e35f6472d softpipe: minor asst. clean-ups 2010-09-25 14:25:40 -06:00
Brian Paul
63a5b7d7cc softpipe: make clip state functions static 2010-09-25 14:25:40 -06:00
Brian Paul
5b2406c0b9 softpipe: make stream out state functions static 2010-09-25 14:25:40 -06:00
Brian Paul
bd13a0d282 softpipe: make rasterizer state functions static 2010-09-25 14:25:40 -06:00
Brian Paul
eed4509b08 softpipe: make vertex state functions static 2010-09-25 14:25:40 -06:00
Brian Paul
c5dd2e40e2 softpipe: make sampler state functions static 2010-09-25 14:25:40 -06:00
Brian Paul
2739692a6e softpipe: make blend/stencil/depth functions static 2010-09-25 14:25:40 -06:00
Brian Paul
279b368dc3 softpipe: make shader-related functions static 2010-09-25 14:25:40 -06:00
Brian Paul
72c6d16f8f softpipe: rename sp_state_fs.c -> sp_state_shader.c 2010-09-25 14:25:40 -06:00
Vinson Lee
f8ee415e3c st/dri: Remove unnecessary header. 2010-09-25 12:39:08 -07:00
Brian Paul
5ba62cd413 swrast: update comments for REMAINDER() macro 2010-09-25 13:37:05 -06:00
Brian Paul
4e2f53bacb gallivm: fix repeat() function for NPOT textures
The trick of casting the coord to an unsigned value only works for POT
textures.  Add a bias instead.  This fixes a few piglit texwrap failures.
2010-09-25 13:37:05 -06:00
Brian Paul
e31f0f9965 softpipe: fix repeat() function for NPOT textures
The trick of casting the coord to an unsigned value only works for POT
textures.  Add a bias instead.  This fixes a few piglit texwrap failures.
2010-09-25 13:37:05 -06:00
Vinson Lee
f3e6a0faa9 intel: Remove unnecessary header. 2010-09-25 12:33:28 -07:00
Vinson Lee
1fa50412f1 r600g: Disable unused variables.
The variables are used only in currently disabled code.

Fixes this GCC warning.
r600_context.c: In function 'r600_flush':
r600_context.c:76: warning: unused variable 'dname'
r600_context.c:75: warning: unused variable 'dc'
2010-09-25 12:28:47 -07:00
Vinson Lee
d7065908e4 r600g: Remove unused variable.
Fixes this GCC warning.
r600_draw.c: In function 'r600_draw_common':
r600_draw.c:71: warning: unused variable 'format'
2010-09-25 12:25:44 -07:00
Vinson Lee
60ec71e8b9 r600g: Remove unused variable.
Fixes this GCC warning.
r600_screen.c: In function 'r600_screen_create':
r600_screen.c:239: warning: unused variable 'family'
2010-09-25 12:21:10 -07:00
Christoph Bumiller
86cddfb110 nv50: fix/handle a few more PIPE_CAPs 2010-09-25 19:37:09 +02:00
Christoph Bumiller
2ef1d759b3 nv50: use CLEAR_BUFFERS for surface fills
The 2D engine's fill doesn't seem suited for RGBA32F or ZS buffers.
2010-09-25 19:37:09 +02:00
Christoph Bumiller
583bbfb3ae nv50: use formats table in nv50_surface.c 2010-09-25 19:37:09 +02:00
Jerome Glisse
58c243905b r600g: fix vertex resource & polygon offset
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-25 09:26:01 -04:00
Dave Airlie
b6469a8dc7 r600g: add eg db count control register. 2010-09-25 22:14:08 +10:00
Dave Airlie
ebca23149a r600g: make index bias fix for evergreen 2010-09-25 22:14:08 +10:00
José Fonseca
a69a96d85e gallivm: Remove dead experimental code. 2010-09-25 12:40:01 +01:00
Keith Whitwell
7225838778 llvmpipe: handle up to 8 planes in triangle binner 2010-09-25 12:22:09 +01:00
Keith Whitwell
60a45b03c3 llvmpipe: handle FACING interpolants in line and point setup 2010-09-25 12:21:55 +01:00
José Fonseca
2a8d1fd3ce gallivm: Fetch the lod from the dynamic state when min_lod == max_lod. 2010-09-25 12:21:19 +01:00
José Fonseca
998cf11e13 draw: Fullfil the new min_lod/max_lod/lod_bias/border_color dynamic state 2010-09-25 12:21:16 +01:00
Roland Scheidegger
049a8cce76 gallivm: optimize yuv decoding
this is more a proof to show vector shifts on x86 with per-element shift count
are evil. Since we can avoid the shift with a single compare/select, use that
instead. Replaces more than 20 instructions (and slow ones at that) with about 3,
and cuts compiled shader size with mesa's yuvsqure demo by over 10%
(no performance measurements done - but selection is blazing fast).
Might want to revisit that for future cpus - unfortunately AVX won't have vector
shifts neither, but AMD's XOP will, but even in that case using selection here
is probably not slower.
2010-09-25 12:19:31 +01:00
Roland Scheidegger
46d05d4ef9 gallivm: don't use URem/UDiv when calculating offsets for blocks
While it's true that llvm can and will indeed replace this with bit
arithmetic (since block height/width is POT), it does so (llvm 2.7) by element
and hence extracts/shifts/reinserts each element individually.
This costs about 16 instructions (and extract is not really fast) vs. 1...
2010-09-25 12:19:31 +01:00
Roland Scheidegger
26dc60d0a3 gallivm: fix copy&paste bug
looks like pot_depth should be used, not pot_height
(found by accident, not verified)
2010-09-25 12:19:31 +01:00
Dave Airlie
16a457bba6 r600g: add eg poly mode code. 2010-09-25 19:16:36 +10:00
Dave Airlie
865cf77503 mesa/mipmap: fix warning since 1acadebd62
1acadebd62 fixed the pointer but not the cast.
2010-09-25 18:51:24 +10:00
Vinson Lee
53e6eb8dbe r600g: Silence 'control reaches end of non-void function' warning.
Fixes this GCC warning.
r600_hw_states.c: In function 'r600_translate_fill':
r600_state_inlines.h:136: warning: control reaches end of non-void function
2010-09-24 23:48:05 -07:00
Vinson Lee
95cb6d30ae r600g: Remove unused variable.
Fixes this GCC warning.
eg_hw_states.c: In function 'eg_resource':
eg_hw_states.c:525: warning: unused variable 'r'
2010-09-24 23:17:55 -07:00
Vinson Lee
68fdd5f0d9 r600g: Disable unused variables.
The variables are only used in currently disabled code.

Fixes this GCC warning.
r600_state2.c: In function 'r600_flush2':
r600_state2.c:613: warning: unused variable 'dname'
r600_state2.c:612: warning: unused variable 'dc'
2010-09-24 23:08:08 -07:00
Vinson Lee
207481fa53 r600g: Remove unused variable.
Fixes this GCC warning.
r600_buffer.c: In function 'r600_buffer_transfer_map':
r600_buffer.c:141: warning: unused variable 'rctx'
2010-09-24 22:59:46 -07:00
Vinson Lee
365da88a71 intel: Remove unnecessary headers. 2010-09-24 22:55:04 -07:00
Vinson Lee
f07ac801b9 unichrome: Remove unnecessary header. 2010-09-24 22:53:40 -07:00
Vinson Lee
80ac94af72 r600g: Remove unnecessary header. 2010-09-24 22:48:46 -07:00
Vinson Lee
c510f8eeb4 mesa: Remove unnecessary headers. 2010-09-24 22:46:14 -07:00
Vinson Lee
ef1e1261df intel: Fix implicit declaration of function '_mesa_meta_Bitmap' warning.
Fix this GCC warning.
intel_pixel_bitmap.c: In function 'intelBitmap':
intel_pixel_bitmap.c:343: warning: implicit declaration of function '_mesa_meta_Bitmap'
2010-09-24 22:20:43 -07:00
Vinson Lee
5c77b75316 r300g: Silence uninitialized variable warning.
Silence this GCC warning.
r300_state_derived.c: In function 'r300_update_derived_state':
r300_state_derived.c:578: warning: 'r' may be used uninitialized in this function
r300_state_derived.c:578: note: 'r' was declared here
2010-09-24 19:33:43 -07:00
Eric Anholt
1acadebd62 mesa: Fix type typo in glGenerateMipmap handling of GL_UNSIGNED_INT data.
Fixes ARB_depth_texture/fbo-generatemipmap-formats.
2010-09-24 18:40:24 -07:00
Eric Anholt
b917691bc0 intel: Improve some of the miptree debugging. 2010-09-24 18:25:42 -07:00
Eric Anholt
86ad797be4 intel: More reverting of the sw fallback for depth texture border color.
The rest was done with 9aec1288ee
2010-09-24 18:19:08 -07:00
Eric Anholt
2e3d22b074 intel: Add fallback debug to glGenerateMipmap. 2010-09-24 18:03:28 -07:00
Eric Anholt
934fde4f5a intel: Fix segfault on INTEL_DEBUG=fbo with unsupported framebuffers. 2010-09-24 18:03:28 -07:00
Marek Olšák
8619495790 util: fix util_pack_color for B4G4R4A4
NOTE: This is a candidate for the 7.9 branch.
2010-09-25 01:52:33 +02:00
Eric Anholt
1946b81e70 i965: Add support for rendering to SARGB8 FBOs.
Tested with fbo-generatemipmap-formats GL_EXT_texture_srgb.  The test
still fails on SLA8, though.
2010-09-24 16:12:50 -07:00
Eric Anholt
836803df79 intel: Corresponding FinishRenderTexture debug to BeginRenderTexture. 2010-09-24 16:12:50 -07:00
Jerome Glisse
6613605d79 r600g: bring over fix from old path to new path
Up to 2010-09-19:
r600g: fix tiling support for ddx supplied buffers
9b146eae25

user buffer seems to be broken... new to fix that.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-24 17:33:30 -04:00
Jerome Glisse
3ad4486bfe r600g: fix evergreen new path
glxgears seems to work, had somelockup but now they seems to have vanish.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-24 16:17:28 -04:00
Jerome Glisse
49111213e4 r600g: fix reg definition
Doesn't bother fixing old path code, just disable that reg.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-24 16:09:05 -04:00
Jerome Glisse
ba7e6ccc95 r600g: fix evergreen new path
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-24 15:02:33 -04:00
Jerome Glisse
b43480fabb r600g: fixup some evergreen register definitions
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-24 15:02:33 -04:00
Ian Romanick
e4bd50c232 egl: Fix several 'comparison between signed and unsigned integer' warnings
I hate GCC for requiring the (int) cast on sizeof.
2010-09-24 10:55:38 -07:00
Ian Romanick
66c9ac76ad egl_glx: Silence piles of 'unused variable' warnings 2010-09-24 10:55:38 -07:00
Eric Anholt
e7c8832c7f intel: Dead comment removal. 2010-09-24 10:32:57 -07:00
Alex Deucher
15861e0074 r600c: fix mipmap stride on evergreen
taken from Dave's r600g fix
2010-09-24 13:20:58 -04:00
Ian Romanick
137fce247f EGL DRI2: Silence 'missing initializer' warnings 2010-09-24 09:40:06 -07:00
Ian Romanick
eade946cbf EGL DRI2: Silence piles of 'unused variable' warnings 2010-09-24 09:40:06 -07:00
Brian Paul
d1a4dd4217 llvmpipe: make texture border_color dynamic state 2010-09-24 09:48:32 -06:00
Brian Paul
61b7da074e llvmpipe: make min/max lod and lod bias dynamic state
Before, changing any of these sampler values triggered generation
of new JIT code.  Added a new flag for the special case of
min_lod == max_lod which is hit during auto mipmap generation.
2010-09-24 09:47:37 -06:00
Jerome Glisse
7967b46e65 r600g: fix compilation after change to evergreend.h
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-24 10:43:57 -04:00
Jerome Glisse
eff1af65af r600g: evergreen fix for new design
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-24 10:41:01 -04:00
Jerome Glisse
cb3aed80db r600g: move use_mem_constants flags for new designs structure alignment
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-24 10:41:01 -04:00
Jerome Glisse
3672bc14af r600g: fix typo in evergreen define (resource are in [0x30000;0x34000] range)
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-24 10:41:01 -04:00
Brian Paul
f5c810c42f st/mesa: use the wrapped renderbuffer in CopyPixels()
Fixes assertion failures when copying stencil pixels.

NOTE: this is a candidate for the 7.9 branch.
2010-09-24 08:27:06 -06:00
Brian Paul
10dcc989ab st/mesa: add missing MESA_FORMAT_S8 case in st_mesa_format_to_pipe_format()
NOTE: this is a candidate for the 7.9 branch.
2010-09-24 08:24:43 -06:00
Brian Paul
9f7c8053e0 mesa: fix assertions to handle srgb formats
http://bugs.freedesktop.org/show_bug.cgi?id=30333

NOTE: This is a candidate for the 7.9 branch.
2010-09-24 07:55:49 -06:00
Luca Barbieri
1154765429 d3d1x: CRLF -> LF in progs 2010-09-24 15:12:20 +02:00
Luca Barbieri
7e81c67c8b d3d1x: stop using GLX in demos, just use the default visual 2010-09-24 15:12:19 +02:00
Luca Barbieri
db1fbb1efc d3d1x: assert if X visual is not among enumerated visuals 2010-09-24 15:12:19 +02:00
Luca Barbieri
f1063cfee2 d3d1x: don't crash on drivers not supporting vertex or geometry sampling 2010-09-24 15:12:19 +02:00
Luca Barbieri
b632d9fce3 nvfx: add RGB framebuffer format support in addition to BGR 2010-09-24 15:12:19 +02:00
Luca Barbieri
d0ee833dee nvfx: allow setting NULL constant buffers 2010-09-24 15:12:19 +02:00
Andre Maasikas
8b63ed4e6c r600g: break alu clause earlier
we still have constants to add and next int may need also 6 slots
2010-09-24 13:26:19 +03:00
Luca Barbieri
c7a064b4d5 d3d1x: fix linking of dxbc2tgsi 2010-09-24 09:51:15 +02:00
Luca Barbieri
54ee7721a1 d3d1x: draw to the correct buffer 2010-09-24 09:15:49 +02:00
Luca Barbieri
0f4ec3f72c d3d1x: fix CheckMultisampleQualityLevels 2010-09-24 09:15:49 +02:00
Luca Barbieri
0e40b41cee d3d1x: don't assert on unsupported resource types 2010-09-24 09:15:49 +02:00
Luca Barbieri
4babdc7844 d3d1x: add untested support for geometry shader translation 2010-09-24 09:15:49 +02:00
Luca Barbieri
f71f8c7d18 d3d1x: add shader dumping 2010-09-24 09:15:49 +02:00
Dave Airlie
11cd1612a1 r600g: fix polygon mode
this fixes glean'pointSprite test.
2010-09-24 18:58:16 +10:00
Dave Airlie
efa111a6cb r600g: fixup sprite coord enable.
this fixes piglit glsl-fs-pointcoord
2010-09-24 16:36:54 +10:00
Dave Airlie
428b101af9 r600g: fix typo in r700 alu emit 2010-09-24 16:12:02 +10:00
Dave Airlie
59276b8541 r600g: fixup VP->FP output->input routing.
We need to map the TGSI semantics to each other using the hw semantic ids.

this fixes glsl-kwin-blur and glsl-routing.
2010-09-24 14:59:19 +10:00
Dave Airlie
e74d26d82a r600g: fixup tex wrapping.
the clamp edge/clamp cases were reversed.
2010-09-24 13:51:54 +10:00
Dave Airlie
4e27e935ca r600g: drop index_offset parameter to index buffer translate.
r600 doesn't need this as we always have working index bias
2010-09-24 12:38:14 +10:00
Dave Airlie
cf0162be13 r600g: fix draw-elements and draw-elements-base-vertex 2010-09-24 12:34:43 +10:00
Dave Airlie
95e04c3d74 r600g: some more vertex formats 2010-09-24 12:34:43 +10:00
Dave Airlie
b7ab9ee84e r600g: add some more vertex format support.
adds the sscaled formats, this passes some more of the draw-vertices tests.
2010-09-24 12:34:43 +10:00
Dave Airlie
4388087f19 r600g: add vert support for 16/16 and 16/16/16 floats.
makes draw-vertices-half-float pass
2010-09-24 12:34:43 +10:00
Marek Olšák
85a45dcd5d Build r300g by default
NOTE: This will go to 7.9 as well.
2010-09-24 02:58:50 +02:00
Marek Olšák
9f35dcd24c r300g: fix the border color for every format other than PIPE_FORMAT_B8G8R8A8
TX_BORDER_COLOR should be formatted according to the texture format.
Also the interaction with ARB_texture_swizzle should be fixed too.

NOTE: This is a candidate for the 7.9 branch.
2010-09-24 02:57:36 +02:00
Marek Olšák
7d28ec8500 r300g: fix a copy-paste typo for logging 2010-09-24 02:33:34 +02:00
Marek Olšák
a333485386 r300g: make accessing map_list and buffer_handles thread-safe
NOTE: This is a candidate for the 7.9 branch.
2010-09-24 02:29:05 +02:00
Marek Olšák
206d92912c r300g: fixup long-lived BO maps being incorrectly unmapped when flushing
Based on commit 3ddc714b20 by Dave Airlie.

NOTE: This is a candidate for the 7.9 branch.
2010-09-24 02:29:04 +02:00
Marek Olšák
68afbe89c7 util: make calling remove_from_list multiple times in a row safe
This commit fixes an infinite loop in foreach_s if remove_from_list is used
more than once on the same item with other list operations in between.

NOTE: This is a candidate for the 7.9 branch because the commit
"r300g: fixup long-lived BO maps being incorrectly unmapped when flushing"
depends on it.
2010-09-24 02:29:04 +02:00
Eric Anholt
f46523e0bc i915: Remove a dead if (0) block. 2010-09-23 16:34:10 -07:00
Eric Anholt
64ff468d6f intel: Remove dead intelIsTextureResident().
It always returned 1 (GL_TRUE), which is the same thing that happens when
the driver hook isn't present.
2010-09-23 16:30:58 -07:00
Eric Anholt
f9e6f401e1 unichrome: Mostly revert my convolution removal changes.
For this driver, the minimum pitch alignment stuff does appear to be
necessary, so leave the separate munged width/height variable in
place.
2010-09-23 16:20:33 -07:00
Eric Anholt
1c0646a826 radeon: Remove copied minimum pitch alignment code.
This is already covered by radeon_mipmap_tree.c, and my convolution
cleanups broke in the presence of this code.  Thanks to Marek Olšák
for tracking down the relevant miptree code for me.
2010-09-23 16:20:25 -07:00
Eric Anholt
fae1855946 intel: Replace my intel_texture_bitmap code with _mesa_meta_Bitmap.
The meta code is more general than mine, and appears to pass the same
sets of tests (piglit + some oglconform).
2010-09-23 16:04:55 -07:00
Eric Anholt
2337f364b1 intel: Remove unnecessary minimum pitch alignment to 32 bytes.
This broke with the cleanup I did in convolution removal.  It's
unnecessary anyway since region_alloc_tiled adjusts pitches for us (64
byte alignment)
2010-09-23 16:04:55 -07:00
Tom Stellard
92762842a0 r300g: Always try to build libr300compiler.a
Make libr300compiler.a a PHONY target so that this library will always be
built.  This fixes the problem of libr300compiler.a not being updated
when r300g is being built and r300c is not.

This is a candidate for the Mesa 7.9 branch.
2010-09-23 15:04:35 -07:00
Eric Anholt
d26211e499 intel: Remove disabled stencil drawpixels acceleration.
We still retain the fallback override for GL_STENCIL_INDEX, because
the metaops version fails at oglconform.
2010-09-23 14:58:37 -07:00
Dave Airlie
c0c0c4b96b r300g: fix point sprite coord.
handled elsewhere now.

thanks to Droste on irc for pointing out the fix
2010-09-24 07:46:59 +10:00
Jerome Glisse
b360c050b6 r600g: initial evergreen support in new path
This doesn't work yet.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-23 17:10:28 -04:00
Tilman Sauerbeck
ce8c71817b r600g: Destroy the blitter.
Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
2010-09-23 22:36:00 +02:00
Eric Anholt
a62efdf82c mesa: Remove EXT_convolution.
More optional code.
2010-09-23 13:25:45 -07:00
Eric Anholt
73578ba9c4 mesa: Remove SGI_color_matrix.
Another optional ARB_imaging subset extension.
2010-09-23 13:25:45 -07:00
Eric Anholt
6c227e57e6 mesa: Remove SGI_color_table.
Another optional ARB_imaging subset extension.
2010-09-23 13:25:45 -07:00
Eric Anholt
7126e38d90 mesa: Remove EXT_histogram.
This has always been optional, and not useful.
2010-09-23 13:25:45 -07:00
Eric Anholt
907a6734fc mesa: Remove the non-required ARB_imaging extension.
Many of the EXT_ extensions in the subset have significant code
overhead with no users.  It is not a required part of GL -- though
text describing the extension is part of the core spec since 1.2, it
is always conditional on the ARB_imaging extension.
2010-09-23 13:25:45 -07:00
Luca Barbieri
96da9b28c8 d3d1x: obliterate IDL parameter names from d3d10.idl from Wine too 2010-09-23 16:29:29 +02:00
Luca Barbieri
bccd4eb824 d3d1x: add autogenerated files as prerequisites, so make builds them 2010-09-23 16:21:14 +02:00
Luca Barbieri
36a64bfe54 d3d1x: fix build without system EGL/egl.h 2010-09-23 16:18:52 +02:00
Luca Barbieri
eaf8fe8461 d3d1x: add missing guid.cpp 2010-09-23 16:17:36 +02:00
Luca Barbieri
1734a78538 d3d1x: flush properly 2010-09-23 16:08:37 +02:00
Luca Barbieri
206c4cc878 d3d1x: remove another include specstrings.h 2010-09-23 16:07:33 +02:00
Luca Barbieri
681f87e09b d3d1x: flush the pipe context when presenting 2010-09-23 16:06:03 +02:00
Luca Barbieri
9a97b9af68 d3d1x: remove specstrings.h include 2010-09-23 16:06:03 +02:00
Luca Barbieri
b6b3fbcdb1 d3d11: obliterate IDL parameter names 2010-09-23 16:06:03 +02:00
Luca Barbieri
0525384c11 d3d1x: rename parameters in dxgi 2010-09-23 16:06:03 +02:00
Luca Barbieri
9cd0e624b4 d3d1x: rename params in misc and objects 2010-09-23 16:06:03 +02:00
Luca Barbieri
4f700d23fd d3d11: rename screen params 2010-09-23 16:06:03 +02:00
Luca Barbieri
3e0f57b640 d3d1x: rename context params 2010-09-23 16:06:03 +02:00
Luca Barbieri
6b485d8518 d3d1x: minifix 2010-09-23 16:06:02 +02:00
Luca Barbieri
8224256946 d3d1x: remove specstrings 2010-09-23 16:06:02 +02:00
Luca Barbieri
6c598c78bd d3d1x: normalize whitespace 2010-09-23 16:06:02 +02:00
Luca Barbieri
e5ae4588d1 d3d1x: s/tpf/sm4/g 2010-09-23 16:06:02 +02:00
Luca Barbieri
75c29fe1c8 d3d1x: autogenerate shader enums and text from def files
This avoids the duplication in tpf.h and tpf_text.cpp
2010-09-23 16:06:02 +02:00
Luca Barbieri
22762012d1 d3d1x: initialize the mutex 2010-09-23 16:06:02 +02:00
José Fonseca
440129521c draw: Prevent clipped vertices overflow.
Some pathological triangles cause a theoritically impossible number of
clipped vertices.

The clipper will still assert, but at least release builds will not
crash, while this problem is further investigated.
2010-09-23 16:47:36 +01:00
Keith Whitwell
8b597b4ea4 draw: don't apply flatshading to clipped tris with <3 verts
If a triangle was completely culled by clipping, we would still try to
fix up its provoking vertex.
2010-09-23 16:11:17 +01:00
Luca Barbieri
1b15a3cafd d3d1x: bind NULL CSOs before destroying default CSOs on context dtor
Otherwise softpipe and llvmpipe assert.
2010-09-23 11:23:08 +02:00
Luca Barbieri
17ad9972f4 d3d1x: fix deadlocks on non-recursive mutex 2010-09-23 11:23:08 +02:00
Dave Airlie
ada1d91c15 egl: fix build since 17eace581d
looks like mesa st didn't get updated.
2010-09-23 16:12:23 +10:00
Dave Airlie
6547a82df1 r600g: fix warnings since last commit. 2010-09-23 16:02:54 +10:00
Dave Airlie
2f8453eea3 r600g: use blitter to do db->cb flushing.
use the blitter + custom stage to avoid doing a whole lot of state
setup by hand. This makes life a lot easier for doing this on evergreen
it also keeps all the state setup in one place.

We setup a custom context state at the start with a flag to denote
its for the flush, when it gets generated we generate the correct state
for the flush and no longer have to do it all by hand.

this should also make adding texture *to* depth easier.
2010-09-23 16:00:16 +10:00
Dave Airlie
c262c4a2ff u_blitter: add a custom blitter call passing a dsa cso
reimplement the flush stage added for r300 to allow a custom DSA stage
to be used in the pipeline, this allows for r600 hw DB->CB flushes.
2010-09-23 16:00:16 +10:00
Luca Barbieri
881c05aa1e d3d1x: properly reference count the backend 2010-09-23 03:13:52 +02:00
Kristian Høgsberg
17eace581d dri: Pass the __DRIscreen and the __DRIscreen private back to image lookup
We will typically have a current context when we need to lookup the image,
but the lookup implementation don't need it so drop it.
2010-09-22 22:02:05 -04:00
Zack Rusin
1c2423999e rbug: fix rbug when contexts are being destroyed 2010-09-22 20:41:23 -04:00
Dave Airlie
fa11c400d0 r600g: fix typo in evergreen register list
pointed out by glisse on irc.
2010-09-23 10:30:35 +10:00
Dave Airlie
8078e58795 r600g: fix depth readback on rv610 and other quirky variants.
at least zreaddraw works for me here now on my rv610
2010-09-23 10:20:56 +10:00
Dave Airlie
fb5ef05dc5 r600g: use floats instead of hex for blit vbo
once I go past 0x3f80000, I can't translate hex to float in-brain anymore.
2010-09-23 10:01:48 +10:00
Eric Anholt
03923ff95e i965: Warning fix for vector result any_nequal/all_equal change. 2010-09-22 14:58:29 -07:00
Eric Anholt
bb70bd5559 i965: Update expression splitting for the vector-result change to compares.
Fixes:
glsl1-precision exp2
glsl1-precision log2
2010-09-22 14:55:58 -07:00
Eric Anholt
ac3d5beb0b i965: When splitting vector variable assignment, ignore unset channels.
The new checks for sanity in ir_assignment creation got angry about
this write_mask == 0.  Fixes:
glsl-fs-dot-vec2.
glsl-fs-atan-2
glsl-fs-dot-vec2
2010-09-22 14:55:58 -07:00
Kristian Høgsberg
86a1938aa5 glx: Invalidate buffers after binding a drawable
If the server doesn't send invalidate events, we may miss a
resize before the rendering starts.  Invalidate the buffers now
so the driver will recheck before rendering starts.

https://bugs.freedesktop.org/show_bug.cgi?id=29984
https://bugs.freedesktop.org/show_bug.cgi?id=30155
2010-09-22 17:36:19 -04:00
Eric Anholt
d74bab1fb6 i965: Fix the vector/expression splitting for the write_mask change.
+113 piglits.
2010-09-22 14:15:27 -07:00
Jakob Bornecrantz
4bb42a4f7e tgsi: Fix missing test before check
As introduced with commit d21301675c

NOTE: This is a candidate for the 7.9 branch.
2010-09-22 22:56:54 +02:00
Eric Anholt
eaa6bf59db ir_to_mesa: Only compare vector_elements present for any_nequal/all_equal
Fixes: glsl-mat-from-int-ctor-03
2010-09-22 13:09:51 -07:00
Eric Anholt
3ffab36768 glsl: Fix copy'n'wasted ir_noop_swizzle conditions.
It considered .xyyy a noop for vec4 instead of .xyzw, and similar for vec3.
2010-09-22 13:09:51 -07:00
Eric Anholt
b39e6f33b6 glsl: Rework assignments with write_masks to have LHS chan count match RHS.
It turns out that most people new to this IR are surprised when an
assignment to (say) 3 components on the LHS takes 4 components on the
RHS.  It also makes for quite strange IR output:

(assign (constant bool (1)) (x) (var_ref color) (swiz x (var_ref v) ))
(assign (constant bool (1)) (y) (var_ref color) (swiz yy (var_ref v) ))
(assign (constant bool (1)) (z) (var_ref color) (swiz zzz (var_ref v) ))

But even worse, even we get it wrong, as shown by this line of our
current step(float, vec4):

(assign (constant bool (1)) (w)
	(var_ref t)
	(expression float b2f (expression bool >=
		    (swiz w (var_ref x))(var_ref edge))))

where we try to assign a float to the writemasked-out x channel and
don't supply anything for the actual w channel we're writing.  Drivers
right now just get lucky since ir_to_mesa spams the float value across
all the source channels of a vec4.

Instead, the RHS will now have a number of components equal to the
number of components actually being written.  Hopefully this confuses
everyone less, and it also makes codegen for a scalar target simpler.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2010-09-22 13:09:51 -07:00
Luca Barbieri
38da5c9cb6 d3d1x: add Wine dlls (tri, tex working, but no other testing) 2010-09-22 19:59:14 +02:00
Luca Barbieri
ab5e9a726d d3d1x: define GUIDs in the normal way 2010-09-22 19:44:58 +02:00
Luca Barbieri
3d4a15dfab d3d1x: fix API name 2010-09-22 19:44:57 +02:00
Luca Barbieri
e7624e23a3 d3d1x: redesign the HWND resolver interface
This one should be powerful enough to hook up Wine.
2010-09-22 19:44:57 +02:00
Luca Barbieri
4f8e38dab8 d3d1x: fix GUID declarations 2010-09-22 19:36:27 +02:00
Luca Barbieri
6ce098631a d3d1x: destroy native_display on adapter destruction 2010-09-22 19:36:27 +02:00
Kristian Høgsberg
9ec0b2a45e dri2: Make createImageFromName() take a __DRIscreen instead of __DRIcontext
We can't expect to have a context when this is called, and we don't need one
so just require a __DRIscreen instead.

Reported by Yu Dai <yu.dai@intel.com>
2010-09-22 15:08:22 -04:00
Jerome Glisse
f060ae9ab6 r600g: fix multiple occlusion query on same id
When calling query begin using same query id we need to discard
previous query results.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-22 14:59:09 -04:00
Jerome Glisse
b8835a3992 r600g: disable shader rebuild optimization & account cb flush packet
Shader rebuild should be more clever, we should store along each
shader all the value that change shader program rather than using
flags in context (ie change sequence like : change vs buffer, draw,
change vs buffer, switch shader will trigger useless shader rebuild).

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-22 14:19:05 -04:00
Brian Paul
516ac2bd50 llvmpipe: fix sprite texcoord setup for non-projective texturing
Normally the Mesa state tracker uses TXP instructions for texturing.
But if a fragment shader uses texture2D() that's a TEX instruction.
In that case we were incorrectly computing the texcoord coefficients
in the point sprite setup code.  Some new comments in the code explain
things.
2010-09-22 11:25:18 -06:00
Brian Paul
bd6b8107ad configs: remove egl-swrast target from linux-dri config 2010-09-22 09:30:16 -06:00
Kristian Høgsberg
b91dba49e0 intel: Fix GL_ARB_shading_language_120 commit
Fix commit e7087175f8.  Move the reference to
GL_VERSION_2_1_functions to intel_extensions.c where it's available,
don't try to enable a non-existing extension and advertise 1.20 for all
intel chipsets, not just GEN4 and up.
2010-09-22 11:01:45 -04:00
Jerome Glisse
1abe48afbe r600g: flush color buffer after draw command
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-22 10:35:14 -04:00
José Fonseca
87267c71f6 llvmpipe: Make rgb/alpha bland func/factors match, when there is no alpha.
Makes AoS blending easier, and state more canonical.
2010-09-22 15:02:39 +01:00
José Fonseca
9a8e9f4595 llvmpipe: Special case complementary and identify blend factors in SoA.
One multiplication instead of two.

Also fix floating point random number generation and verification.

TODO: Do the same for AoS blending.
2010-09-22 15:02:39 +01:00
José Fonseca
162b0efff6 gallivm: Add unorm support to lp_build_lerp()
Unfortunately this can cause segfault with LLVM 2.6, if x is a constant.
2010-09-22 15:02:39 +01:00
José Fonseca
256b9d99fb util: Flush stdout on util_format. 2010-09-22 15:02:39 +01:00
Luca Barbieri
cac1565b98 d3d1x: fix segfault when hashing 2010-09-22 13:54:07 +02:00
Luca Barbieri
d83b7a69a0 d3d1x: fix warning 2010-09-22 13:25:45 +02:00
Luca Barbieri
1aed6f42e9 d3d1x: fix cf analysis 2010-09-22 13:24:55 +02:00
Luca Barbieri
12044e4c99 d3d1x: link with CXXFLAGS
Otherwise, -m32 doesn't make it there.
2010-09-22 13:22:00 +02:00
Luca Barbieri
d092c0c60d d3d1x: add missing memory barrier 2010-09-22 13:21:13 +02:00
Luca Barbieri
6d0c39ce36 d3d1x: don't build progs automatically
progs requires winsys, which hasn't yet been built by the time we
go into state_trackers.

It may be a good idea to also move it into tests.

After a normal build, run make in src/gallium/state_trackers/d3d1x/progs
to build them.
2010-09-22 11:36:35 +02:00
Luca Barbieri
feb9c8c510 winsys: automatically build sw winsys needed by EGL and d3d1x
A cleaner solution would be preferable, but this does no harm and works.
2010-09-22 09:37:23 +02:00
Luca Barbieri
a0e5103200 glx: decouple dri2.c and GLX, fixing Gallium EGL and d3d1x build
The Gallium EGL state tracker reuses dri2.c but not the GLX code.

Currently there is a bit of code in dri2.c that is incorrectly tied
to GLX: instead, make it call an helper that both GLX and Gallium EGL
implement, like dri2InvalidateBuffers.

This avoids a link error complaining that dri2GetGlxDrawableFromXDrawableId
is undefined.

Note that we might want to move the whole event translation elsewhere,
and probably stop using non-XCB DRI2 altogether, but this seems to be
the minimal fix.
2010-09-22 08:01:49 +02:00
Luca Barbieri
e1e7c8df7f nvfx: remove gl_PointCoord hack
Now Gallium has the proper fix, thanks to Brian Paul.
2010-09-22 08:00:20 +02:00
Luca Barbieri
86bb64f889 d3d1x: attempt to fix/workaround bug #30322
This may just be hiding some other bug though, since the types are supposed
to be the same (and it compiles for me).

Anyway, this interface will likely need to changed, since it seems Wine needs
a more powerful one capable of expressing window subregions and called at
every Present.
2010-09-22 08:00:19 +02:00
Dave Airlie
2b1ea90342 r600g: disable dirty handling on texture from depth code.
nothing was every dirtying the object again, the mesa-demos
reflect test was just stalling.

this fixes glean readPixSanity.
2010-09-22 14:27:58 +10:00
Dave Airlie
d18f3accb0 r600g: make stencil readback work
need to write two components to get stencil components as well
2010-09-22 14:19:16 +10:00
Dave Airlie
41ef78c5af r600g: cleanup some of the DB blit code
add cb/db flush states to the blit code.
add support for the rv6xx that need special treatment.
according to R6xx_7xx_3D.pdf

set r700 CB_SHADER_CONTROL reg in blit code
docs say dual export should be disabled for DB->CB
2010-09-22 13:33:57 +10:00
Dave Airlie
6e901e330a r600g: fix typo in struct member name 2010-09-22 12:57:08 +10:00
Jerome Glisse
ca35292a44 r600g: occlusion query for new design
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-21 20:25:39 -04:00
Brian Paul
e7087175f8 mesa: don't advertise bogus GL_ARB_shading_language_120 extension
Instead of using the invalid GL_ARB_shading_language_120 extension to
determine the GLSL version, use a new ctx->Const.GLSLVersion field.
Updated the intel and r600 drivers, but untested.

See fd.o bug 29910

NOTE: This is a candidate for the 7.9 branch (but let's wait and see if
there's any regressions).
2010-09-21 18:13:04 -06:00
Vinson Lee
3642ca2f66 glut: Define eventParser for non-Windows only.
Fixes this GCC warning on MinGW build.
glut_input.c:295: warning: 'eventParser' defined but not used
2010-09-21 15:17:52 -07:00
Vinson Lee
13cd131b0f glut: Define markWindowHidden for non-Windows only.
Fixes this GCC warning on MinGW build.
glut_event.c:255: warning: 'markWindowHidden' defined but not used
2010-09-21 15:11:00 -07:00
Brian Paul
9e8d9f456f softpipe: add missing calls to set draw vertex samplers/views
Part of the fix for running softpipe w/ LLVM-enabled draw module.
2010-09-21 15:31:33 -06:00
Brian Paul
ffa2d203fb gallivm: fix lp_build_sample_compare()
The old code didn't really make sense.  We only need to compare the
X channel of the texture (depth) against the texcoord.

For (bi)linear sampling we should move the calls to this function
and compute the final result as (s1+s2+s3+s4) * 0.25.  Someday.

This fixes the glean glsl1 shadow2D() tests.  See fd.o bug 29307.
2010-09-21 15:31:32 -06:00
Luca Barbieri
83ea4878db d3d1x: ignore errors while building docs
Some versions of dot apparently lack pdf output.
2010-09-21 23:26:47 +02:00
Jerome Glisse
45d10c7d59 r600g: fix multi buffer rendering
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-21 16:57:55 -04:00
Brian Paul
2b95525429 glsl2: fix typo in error msg 2010-09-21 14:57:10 -06:00
Luca Barbieri
c02bf81629 d3d1x: fix GCC 4.1/4.2 build 2010-09-21 22:47:09 +02:00
Luca Barbieri
b4b2091655 d3d1x: add template parameters to base class ctor calls for GCC 4.4
GCC 4.5 is fine without them, but GCC 4.4 requires them.
Should fully fix the build on GCC 4.4
2010-09-21 22:35:01 +02:00
Luca Barbieri
82c346673a d3d1x: fix build with compilers other than GCC 4.5
There was some libstdc++-specific code that would only build with GCC 4.5
Now it should be much more compatible, at the price of reimplementing
the generic hash function.
2010-09-21 22:16:52 +02:00
Tilman Sauerbeck
1bcdc504d1 gallium/docs: The RET opcode may appear anywhere in a subroutine.
Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
2010-09-21 21:59:57 +02:00
Eric Anholt
dd9a88f4dd i965: Track the windowizer's dispatch for kill pixel, promoted, and OQ
Looks like the problem was we weren't passing the depth to the render
target as expected, so the chip would wedge.  Fixes GPU hang in
occlusion-query-discard.

Bug #30097
2010-09-21 12:29:57 -07:00
Eric Anholt
4a0bc4716d i965: Also enable CC statistics when doing OQs.
This is required by the spec, so respect that.
2010-09-21 12:29:57 -07:00
Eric Anholt
23c507f135 i965: Share the KIL_NV implementation between glsl and non-glsl. 2010-09-21 12:29:57 -07:00
Jerome Glisse
6048be8969 r600g: directly allocate bo for user buffer
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-21 14:37:38 -04:00
Eric Anholt
b5bb215629 glsl: Add definition of gl_TextureMatrix inverse/transpose builtins.
Fixes glsl2/builtin-texturematrix.
Bug #30196.
2010-09-21 10:09:46 -07:00
José Fonseca
b556bb7c44 llvmpipe: When failing free fs shader too. 2010-09-21 17:51:29 +01:00
José Fonseca
388c94195a llvmpipe: Describe how to profile llvmpipe. 2010-09-21 17:51:29 +01:00
Brian Paul
b3a647276e draw: new draw_fs.[ch] files 2010-09-21 10:07:52 -06:00
Brian Paul
d49f153ab3 Merge branch 'sprite-coord' 2010-09-21 09:57:25 -06:00
Kristian Høgsberg
441344ba7e glx: Hold on to drawables if we're just switching to another context
https://bugs.freedesktop.org/show_bug.cgi?id=30234
2010-09-21 10:20:23 -04:00
Luca Barbieri
bb26272bea d3d1x: actually enable and fix blob apis 2010-09-21 16:01:26 +02:00
Luca Barbieri
f815b57b88 d3d1x: add missing file 2010-09-21 15:51:02 +02:00
Luca Barbieri
cb7cc36fff d3d1x: fix compilation with recent Wine versions installed
Recent Wine versions provide a d3d11shader.h, which is however empty
and was getting used instead of our non-empty one.

Correct the include path order to fix this.
2010-09-21 15:44:41 +02:00
Luca Barbieri
70fed0b0ec d3d1x: add blob and signature extraction APIs
NOTE: untested, needs a testing tool!
2010-09-21 15:44:41 +02:00
Keith Whitwell
2ec86793bd llvmpipe: fix flatshading in new line code
Calculate interpolants before rearranging the vertices.
2010-09-21 14:36:55 +01:00
Luca Barbieri
92617aeac1 d3d1x: add new Direct3D 10/11 COM state tracker for Gallium
This is a new implementation of the Direct3D 11 COM API for Gallium.

Direct3D 10 and 10.1 implementations are also provided, which are
automatically generated with s/D3D11/D3D10/g plus a bunch of #ifs.

While this is an initial version, most of the code is there (limited
to what Gallium can express), and tri, gears and texturing demos
are working.

The primary goal is to realize Gallium's promise of multiple API
support, and provide an API that can be easily implemented with just
a very thin wrapper over Gallium, instead of the enormous amount of
complex code needed for OpenGL.

The secondary goal is to run Windows Direct3D 10/11 games on Linux
using Wine.
Wine dlls are currently not provided, but adding them should be
quite easy.

Fglrx and nvidia drivers can also be supported by writing a Gallium
driver that talks to them using OpenGL, which is a relatively easy
task.
Thanks to the great design of Direct3D 10/11 and closeness to Gallium,
this approach should not result in detectable overhead, and is the
most maintainable way to do it, providing a path to switch to the
open Gallium drivers once they are on par with the proprietary ones.

Currently Wine has a very limited Direct3D 10 implementation, and
completely lacks a Direct3D 11 implementation.

Note that Direct3D 10/11 are completely different from Direct3D 9
and earlier, and thus warrant a fully separate implementation.

The third goal is to provide a superior alternative to OpenGL for
graphics programming on non-Windows systems, particularly Linux
and other free and open systems.

Thanks to a very clean and well-though design done from scratch,
the Direct3D 10/11 APIs are vastly better than OpenGL and can be
supported with orders of magnitude less code and development time,
as you can see by comparing the lines of code of this commit and
those in the existing Mesa OpenGL implementation.

This would have been true for the Longs Peak proposal as well, but
unfortunately it was abandoned by Khronos, leaving the OpenGL
ecosystem without a graphics API with a modern design.

A binding of Direct3D 10/11 to EGL would solve this issue in the
most economical way possible, and this would be great to provide
in Mesa, since DXGI, the API used to bind Direct3D 10/11 to Windows,
is a bit suboptimal, especially on non-Windows platforms.

Finally, a mature Direct3D 10/11 implementation is intrinsically going
to be faster and more reliable than an OpenGL implementation, thanks
to the dramatically smaller API and the segregation of all nontrivial
work to object creation that the application must perform ahead of
time.

Currently, this commit contains:
- Independently created headers for Direct3D 10, 10.1, 11 and DXGI 1.1,
  partially based on the existing Wine headers for D3D10 and DXGI 1.0
- A parser for Direct3D 10/11 DXBC and TokenizedProgramFormat (TPF)
- A shader translator from TokenizedProgramFormat to TGSI
- Implementation of the Direct3D 11 core interfaces
- Automatically generated implementation of Direct3D 10 and 10.1
- Implementation of DXGI using the "native" framework of the EGL st
- Demos, usable either on Windows or on this implementation
  - d3d11tri, a clone of tri
  - d3d11tex, a (multi)texturing demo
  - d3d11gears, an improved version of glxgears
  - d3d11spikysphere, a D3D11 tessellation demo (currently Windows-only)
- A downloader for the Microsoft HLSL compiler, needed to recompile
  the shaders (compiled shader bytecode is also included)

To compile this, configure at least with these options:
--with-state-trackers=egl,d3d1x --with-egl-platforms=x11
plus some gallium drivers (such as softpipe with --enable-gallium-swrast)

The Wine headers (usually from a wine-dev or wine-devel package) must
be installed.
Only x86-32 has been tested.

You may need to run "make" in the subdirectories of src/gallium/winsys/sw
and you may need to manually run "sudo make install" in
src/gallium/targets/egl

To test it, run the demos in the "progs" directory.
Windows binaries are included to find out how demos should work, and to
test Wine integration when it will be done.

Enjoy, and let me know if you manage to compile and run this, or
which issues you are facing if not.

Using softpipe is recommended for now, and your mileage with hardware
drivers may vary.
However, getting this to work on hardware drivers is also obviously very
important.

Note that currently llvmpipe is buggy and causes all 3 gears to be
drawn with the same color.
Use export GALLIUM_DRIVER=softpipe to avoid this.

Thanks to all the Gallium contributors and especially the VMware
team, whose work made it possible to implement Direct3D 10/11 much
more easily than it would have been otherwise.
2010-09-21 10:58:17 +02:00
Tilman Sauerbeck
894a307a91 r600g: Removed debug code.
Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
2010-09-21 08:13:35 +02:00
Dave Airlie
8893427377 r600g: fix eg texture borders.
texture border regs are indexed on evergreen.
2010-09-21 20:53:09 +10:00
Dave Airlie
b6ced8ee7b r600g: fixup evergreen miptree setup.
eg seems to have a higher pitch aligmment requirement and uses r700 cube setup

this fixes a couple of piglit tests here.
2010-09-21 20:53:09 +10:00
Tom Stellard
610aed81db r300/compiler: Refactor the pair instruction data structures
Use rc_pair_ prefix for all pair instruction structs

Create a named struct for pair instruction args

Replace structs radeon_pair_instruction_{rgb,alpha} with struct
radeon_pair_sub_instruction.  These two structs were nearly identical
and were creating a lot of cut and paste code.  These changes are the
first step towards removing some of that code.
2010-09-20 18:48:47 -07:00
Dave Airlie
84997cd566 r600g: set back to correct codepaths.
Jerome please use git diff and git show before pushing.
2010-09-21 11:32:15 +10:00
Dave Airlie
8e8b60588b r600g: deal with overflow of VTX/TEX CF clauses.
running piglit's texrect-many caused the vtx to overflow.
2010-09-21 11:26:01 +10:00
Vinson Lee
2491258436 tgsi: Remove duplicate case value. 2010-09-20 18:20:04 -07:00
Francisco Jerez
bf8f24c1c8 dri/nouveau: Fix software mipmap generation on 1x1 textures. 2010-09-21 03:04:04 +02:00
Francisco Jerez
98add55fff dri/nv10-nv20: Fix texturing in some cases after a base level change. 2010-09-21 03:03:39 +02:00
Francisco Jerez
22c83ac47a dri/nouveau: Cleanup more references to old FBOs and VBOs. 2010-09-21 03:03:01 +02:00
Francisco Jerez
13c246bcea dri/nouveau: Remove unnecessary assertion. 2010-09-21 02:43:12 +02:00
Francisco Jerez
72e5fd5c02 dri/nv04: Use nvgl_wrap_mode(). 2010-09-21 02:43:11 +02:00
Jakob Bornecrantz
d21301675c tgsi: Actually care what check_soa_dependencies says
Thanks to José for the more complete list of supported opcodes.

NOTE: This is a candidate for the 7.9 branch.
2010-09-21 02:19:09 +02:00
José Fonseca
c66f0c4629 tgsi: Don't ignore indirect registers in tgsi_check_soa_dependencies
NOTE: This is a candidate for the 7.9 branch.
2010-09-21 02:18:43 +02:00
Timo Wiren
99907303f6 Fix typos in comments and debug output strings.
Bug #30208.
2010-09-20 15:28:32 -07:00
Brian Paul
77af109554 draw: check bitshift against PIPE_MAX_SHADER_OUTPUS 2010-09-20 15:34:02 -06:00
Brian Paul
1662c31703 llvmpipe: check bitshift against PIPE_MAX_SHADER_OUTPUTS 2010-09-20 15:33:49 -06:00
Jerome Glisse
4fc5050f82 r600g: add back reference check when mapping buffer
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-20 17:21:37 -04:00
Brian Paul
a7ea4d11fb draw: fix test for using the wide-point stage
As it was, we weren't obeying the draw->pipeline.point_sprite state.
Fixes point sprites in llvmpipe driver.
2010-09-20 14:07:41 -06:00
Jerome Glisse
0f099f2906 r600g: use pipe context for flushing inside map
This allow to share code path btw old & new, also
remove check on reference this might make things
a little slower but new design doesn't use reference
stuff.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-20 16:02:13 -04:00
Brian Paul
61fcd9aaa2 llvmpipe: implement sprite coord origin modes 2010-09-20 13:48:02 -06:00
Tilman Sauerbeck
021e68b2cd python/tests: Fixed tri.py for API and TGSI syntax changes.
Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
2010-09-20 21:43:01 +02:00
Brian Paul
c3982c6bcd llvmpipe: rename sprite field, add sprite_coord_origin 2010-09-20 13:37:39 -06:00
Tilman Sauerbeck
ef419599d9 r600g: Implemented the Z and W component write for the SCS opcode.
Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
2010-09-20 21:27:59 +02:00
Brian Paul
b7a5eac1f3 llvmpipe: clean-up, comments in setup_point_coefficient() 2010-09-20 13:26:27 -06:00
Tilman Sauerbeck
57bf96b43b r600g: Honour destination operand's writemask in the SCS implementation.
If we are not going to write to the X or Y components of the destination
vector we also don't need to prepare to compute SIN or COS.

Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
2010-09-20 21:22:48 +02:00
Brian Paul
924c18da95 llvmpipe: reformatting, remove trailing whitespace, etc 2010-09-20 13:18:41 -06:00
Brian Paul
ebba92875a llvmpipe: indentation fix 2010-09-20 13:18:41 -06:00
Brian Paul
955d76c3d2 llvmpipe: maintain fragment shader state for draw module 2010-09-20 12:52:16 -06:00
Luca Barbieri
86d5ec70d1 softpipe: fix whitespace 2010-09-20 20:49:48 +02:00
Luca Barbieri
de71e7a4c9 tgsi: add switch/case opcodes to tgsi_opcode_tmp.h 2010-09-20 20:23:35 +02:00
Luca Barbieri
2e7d1c2c86 softpipe: make z/s test always pass if no zsbuf, instead of crashing
D3D10 specifies this.
2010-09-20 20:23:35 +02:00
Luca Barbieri
6d0b695fa7 gallium: avoid the C++ keyword "template" in sw_winsys.h 2010-09-20 20:23:34 +02:00
Brian Paul
b2ad8b5c22 gallivm: remove debug code 2010-09-20 11:21:44 -06:00
Brian Paul
7888a2f822 llvmpipe: fix query bug when no there's no scene 2010-09-20 10:50:35 -06:00
Marek Olšák
168554904b st/mesa: fix assertion failure in GetTexImage for cubemaps
Can be reproduced with mesa/demos/src/tests/blitfb.

NOTE: This is a candidate for the 7.9 branch.
2010-09-20 18:14:23 +02:00
Jerome Glisse
363dfb83f1 r600g: move chip class to radeon common structure
So texture code can be shared btw new state design
& old one.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-20 11:59:20 -04:00
Kenneth Graunke
6ea16b6c51 glsl: Fix broken handling of ir_binop_equal and ir_binop_nequal.
When ir_binop_all_equal and ir_binop_any_nequal were introduced, the
meaning of these two opcodes changed to return vectors rather than a
single scalar, but the constant expression handling code was incorrectly
written and only worked for scalars.  As a result, only the first
component of the returned vector would be properly initialized.
2010-09-20 17:33:13 +02:00
Kenneth Graunke
14eea26828 glsl: Add comments to clarify the types of comparison binops. 2010-09-20 17:31:16 +02:00
Brian Paul
0bc3e1f4f4 docs: mark as obsolete, remove dead links 2010-09-20 08:59:04 -06:00
Brian Paul
a8fde1ba4d docs: remove old broken link 2010-09-20 08:59:01 -06:00
Brian Paul
1739124159 glsl2: silence compiler warnings in printf() calls
Such as: "ir_validate.cpp:143: warning: format ‘%p’ expects type ‘void*’,
but argument 2 has type ‘ir_variable*’"
2010-09-20 08:22:54 -06:00
Brian Paul
5522887842 mesa: don't call valid_texture_object() in non-debug builds
This reverts commit c32bac57ed
and silences the warning differently.

The _mesa_reference_texobj() function is called quite a bit and
we don't want to call valid_texture_object() all the time in non-
debug builds.
2010-09-20 08:21:00 -06:00
Ian Romanick
e053d62aa5 glsl: Add doxygen comments 2010-09-20 07:09:03 -07:00
Jakob Bornecrantz
208f1f3810 i915g: Link with wrapper sw winsys with scons 2010-09-20 15:33:20 +02:00
Michal Krol
279492386f svga: Integer constant register file has a separate namespace.
Count int and float constants independently. Since there are only
few i# constants available and hundreds of c# constants, it would
be too easy to end up with an i# declaration out of its range.
2010-09-20 09:26:49 +01:00
Michal Krol
0742e0b376 svga: Fix relative addressing translation for pixel shaders.
Pixel shaders do not have address registers a#, only one
loop register aL. Our only hope is to assume the address
register is in fact a loop counter and replace it with aL.

Do not translate ARL instruction for pixel shaders -- MOVA
instruction is only valid for vertex saders.

Make it more explicit relative addressing of inputs is only valid
for pixel shaders and constants for vertex shaders.
2010-09-20 09:26:17 +01:00
Corbin Simpson
0d53dfa3c5 r600g: Cleanup viewport floats. 2010-09-19 23:05:02 -07:00
Corbin Simpson
e98062673e r600g: Clean up PS setup.
I didn't do r600d according to the docs; I split EXPORT_MODE to be a bit more
useful and obvious. Hope this is okay.
2010-09-19 23:05:02 -07:00
Dave Airlie
f4020c66fd r600g: only flush for the correct colorbuffer, not all of them. 2010-09-20 15:39:03 +10:00
Dave Airlie
7e5173d065 r600g: add missing BC_INST wrapper for evergreen 2010-09-20 15:38:40 +10:00
Dave Airlie
b110ddd9a9 r600g: fixup r700 CB_SHADER_CONTROL register.
r600c emits this with a mask of each written output.
2010-09-20 15:36:52 +10:00
Dave Airlie
d172ef3138 r600g: fix r700 cube map sizing.
this fixes fbo-cubemap on r700.
2010-09-20 15:30:52 +10:00
Dave Airlie
3a1defa5e8 r600g: add color/texture support for more depth formats. 2010-09-20 12:21:35 +10:00
Dave Airlie
2cabbb290f r600g: add z16 to color setup 2010-09-20 12:04:52 +10:00
Dave Airlie
9b146eae25 r600g: fix tiling support for ddx supplied buffers
needed to emit some more relocs to the kernel.
2010-09-20 11:40:33 +10:00
Corbin Simpson
c2ba729321 r600g: "tmp" is such a bad name for a texture. 2010-09-19 18:25:02 -07:00
Corbin Simpson
07b9e22a1f r600g: Fix false and true. 2010-09-19 18:25:02 -07:00
Corbin Simpson
eb347c7ef0 r600g: Clean up some indentation and |= vs. | usage. 2010-09-19 18:25:01 -07:00
Corbin Simpson
7ee9b0b951 r600g: Deobfuscate and comment a few more functions in r600_hw_states. 2010-09-19 18:25:01 -07:00
Corbin Simpson
f76b81423e r600g: Trivially deobfuscate r600_hw_states. 2010-09-19 18:25:01 -07:00
Corbin Simpson
5f5bf25af5 r600g: Use align() instead of handrolled code. 2010-09-19 18:25:01 -07:00
Dave Airlie
8d1ec80319 r600g: drop debugging that snuck in 2010-09-20 10:45:18 +10:00
Dave Airlie
040411de26 r600g: clean up valgrind issues on maxtargets test. 2010-09-20 10:44:44 +10:00
Dave Airlie
4af55364cc r600g: fix fbo-drawbuffers-maxtargets
we were leaking buffers since the flush code was added, it wasn't dropping references.
move setting up flush to the set_framebuffer_state.
clean up the flush state object.
make more space in the BOs array for flushing.
2010-09-20 10:35:38 +10:00
Dave Airlie
3d12c207d7 r600g: send correct surface base update for multi-cbufs 2010-09-20 10:15:26 +10:00
Dave Airlie
f59fe9671f r600g: modify index buffers for sizes the hw can't deal with.
this just uses the common code from r300g now in util to do translations on r600g.
2010-09-20 09:57:47 +10:00
Dave Airlie
91b70d8408 util/r300g: split the r300 index buffer modifier functions out to util
These can be used by other drivers, like r600g.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-09-20 09:38:18 +10:00
Henri Verbeet
f1cf04dbc0 r600g: fix exports_ps to export a number not a mask. 2010-09-20 09:30:21 +10:00
Jakob Bornecrantz
b83156d42f scons: Link against talloc in the Gallium DRI drivers 2010-09-20 00:03:58 +02:00
Jakob Bornecrantz
00272e9e09 rbug: Add function to get opcode name string 2010-09-20 00:03:58 +02:00
Jakob Bornecrantz
7faa37adf8 rbug: Cast opcode to corrent int size 2010-09-20 00:03:58 +02:00
Henri Verbeet
1934ade183 Revert "r600g: Flush upload buffers before draws instead of before flushes."
This reverts commit a1d9a58b82.
Flushing the upload buffers on draw is wrong, uploads aren't supposed to
cause flushes in the first place. The real issue was
radeon_bo_pb_map_internal() not respecting PB_USAGE_UNSYNCHRONIZED.
2010-09-19 23:03:03 +02:00
Henri Verbeet
0f9181811f r600g: Respect PB_USAGE_UNSYNCHRONIZED in radeon_bo_pb_map_internal(). 2010-09-19 23:03:03 +02:00
Tilman Sauerbeck
d323118c3e gallium/docs: Fixed a typo in the SCS opcode description.
Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
2010-09-19 22:13:42 +02:00
Luca Barbieri
a01578c84f auxiliary: fix depth-only and stencil-only clears
Depth-only and stencil-only clears should mask out depth/stencil from the
output, mask out stencil/input from input, and OR or ADD them together.

However, due to a typo they were being ANDed, resulting in zeroing the buffer.
2010-09-19 21:52:02 +02:00
Henri Verbeet
affd46cc2b r600g: Buffer object maps imply a wait.
Unless e.g. PB_USAGE_DONTBLOCK or PB_USAGE_UNSYNCHRONIZED would be specified.
2010-09-19 19:43:05 +02:00
Henri Verbeet
de9c8015eb r600g: Remove a redundant flush in r600_texture_transfer_map().
radeon_ws_bo_map() will already take care of that if needed.
2010-09-19 19:43:05 +02:00
Henri Verbeet
b68030e9f8 r600g: Check for other references before checking for existing mappings in radeon_bo_pb_map_internal().
Having a non-NULL data pointer doesn't imply it's safe to reuse that mapping,
it may have been unmapped but not flushed yet.
2010-09-19 19:43:05 +02:00
Henri Verbeet
a1d9a58b82 r600g: Flush upload buffers before draws instead of before flushes.
If a upload buffer is used by a previous draw that's still in the CS,
accessing it would need a context flush. However, doing a context flush when
mapping the upload buffer would then flush/destroy the same buffer we're trying
to map there. Flushing the upload buffers before a draw avoids both the CS
flush and the upload buffer going away while it's being used. Note that
u_upload_data() could e.g. use a pool of buffers instead of allocating new
ones all the time if that turns out to be a significant issue.
2010-09-19 19:43:05 +02:00
Chia-I Wu
2a910b3396 egl: Enable drm platform by default.
This enables EGL_MESA_drm_display for st/egl in the default setup.
2010-09-19 17:35:04 +08:00
Chia-I Wu
e4513e7fb9 st/egl: s/kms/drm/ on the drm backend.
s/kms/drm/, s/kdpy/drmdpy/, and so forth.
2010-09-19 17:19:40 +08:00
Chia-I Wu
e7424d7240 st/egl: Rename kms backend to drm.
The main use of the backend is to support EGL_MESA_drm_display.  drm
should be a better name.
2010-09-19 17:19:03 +08:00
Chia-I Wu
c7c2e7d0ce st/egl: Split modeset code support to modeset.c.
The modeset code supports now obsolete EGL_MESA_screen_surface.  Move it
to a file of its own.
2010-09-19 16:37:48 +08:00
Dave Airlie
ed4f740127 r600g: only emit uses waterfall on r6xx hw. 2010-09-19 17:25:50 +10:00
Dave Airlie
c5edfcc410 r600g; add uses waterfall to asm cf for r6xx.
On r6xx if an MOVA instruction is emitted we should set this bit.
2010-09-19 17:20:15 +10:00
Tilman Sauerbeck
8861727c91 r600g: Added support for TGSI_SEMANTIC_FACE.
This makes the 'glsl1-gl_FrontFacing var (1)' piglit test pass.

Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
2010-09-19 09:21:41 +02:00
Vinson Lee
fa10561908 nv50: Remove dead initialization. 2010-09-18 23:07:41 -07:00
Vinson Lee
03cf572598 nv50: Remove dead initialization. 2010-09-18 23:06:29 -07:00
Vinson Lee
ef715b866b nv50: Silence missing initializer warning.
Fixes this GCC warning.
nv50_state_validate.c:336: warning: missing initializer
nv50_state_validate.c:336: error: (near initialization for 'validate_list[20].func')
2010-09-18 15:59:00 -07:00
Christoph Bumiller
613c3901c3 nv50: fix typo in fifo packet length limit 2010-09-18 20:53:53 +02:00
Kenneth Graunke
dbd2480507 glsl/builtins: Switch comparison functions to just return an expression. 2010-09-18 16:23:48 +02:00
Kenneth Graunke
52f9156e88 glsl/builtins: Fix equal and notEqual builtins.
Commit 309cd4115b incorrectly converted
these to all_equal and any_nequal, which is the wrong operation.
2010-09-18 16:23:48 +02:00
Christoph Bumiller
4c1e7d931d nv50: emit constbuf relocs before uploading constants 2010-09-18 15:22:05 +02:00
Christoph Bumiller
275a81af13 nv50: add relocs for stack and local mem buffers 2010-09-18 15:21:59 +02:00
Kenneth Graunke
ca92ae2699 glsl: Properly handle nested structure types.
Fixes piglit test CorrectFull.frag.
2010-09-18 11:21:34 +02:00
Keith Whitwell
7ef3d171a0 graw: add frag-face shader 2010-09-18 09:15:14 +01:00
Vinson Lee
cef42f925c r600g: Remove unused variable. 2010-09-18 00:59:16 -07:00
Vinson Lee
b1a5c63467 nvfx: Silence uninitialized variable warnings. 2010-09-18 00:51:07 -07:00
Vinson Lee
013e4cca9f nvfx: Remove const qualifer from nvfx_vertprog_translate.
Silences this GCC warning.
nvfx_vertprog.c: In function 'nvfx_vertprog_translate':
nvfx_vertprog.c:998: warning: assignment discards qualifiers from pointer target type
2010-09-18 00:47:36 -07:00
Keith Whitwell
5b4c43d985 llvmpipe: use llvm for attribute interpolant calculation
Basically no change relative to hard-coded version, but this will
be useful for other changes later.
2010-09-18 08:40:17 +01:00
Tilman Sauerbeck
3894fddccc glsl2: Fixed cloning of ir_call error instructions.
Those have the callee field set to the null pointer, so
calling the public constructor will segfault.

Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
2010-09-18 09:19:57 +02:00
Vinson Lee
a822ae3f1a glsl: Fix 'control reaches end of non-void function' warning.
Fixes this GCC warning.

lower_variable_index_to_cond_assign.cpp:
In member function
'bool variable_index_to_cond_assign_visitor::needs_lowering(ir_dereference_array*) const':

lower_variable_index_to_cond_assign.cpp:261:
warning: control reaches end of non-void function
2010-09-18 00:14:20 -07:00
Vinson Lee
9ea2a3af9c x86: Silence unused variable warning on Mac OS X.
Silences the following GCC warning on Mac OS X.
x86/common_x86.c:58: warning: 'detection_debug' defined but not used
2010-09-17 23:59:23 -07:00
Vinson Lee
c32bac57ed mesa: Silence "'valid_texture_object' defined but not used" warning. 2010-09-17 23:43:38 -07:00
Vinson Lee
ff78d6dcc0 ir_to_mesa: Remove unused member array_indexed from struct statevar_element.
Fixes this GCC warning.
warning: missing initializer for member 'statevar_element::array_indexed'
2010-09-17 23:35:09 -07:00
Vinson Lee
3c9653c3a0 mesa: bump version to 7.10 2010-09-17 17:52:13 -07:00
Brian Paul
f964f92bcc gallium/docs: added new pipeline.txt diagram
This diagram shows the rendering pipeline with an emphasis on
the inputs/outputs for each stage.  Some stages emit new vertex
attributes and others consume some attributes.
2010-09-17 18:50:47 -06:00
Brian Paul
e22e3927b0 gallium: rework handling of sprite_coord_enable state
Implement the pipe_rasterizer_state::sprite_coord_enable field
in the draw module (and softpipe) according to what's specified
in the documentation.

The draw module can now add any number of extra vertex attributes
to a post-transformed vertex and generate texcoords for those
attributes per sprite_coord_enable.  Auto-generated texcoords
for sprites only worked for one texcoord unit before.

The frag shader gl_PointCoord input is now implemented like any
other generic/texcoord attribute.

The draw module now needs to be informed about fragment shaders
since we need to look at the fragment shader's inputs to know
which ones need auto-generated texcoords.

Only softpipe has been updated so far.
2010-09-17 18:45:13 -06:00
Brian Paul
49cb978aa4 gallium: better docs for pipe_rasterizer_state::sprite_coord_enable 2010-09-17 18:41:05 -06:00
Tilman Sauerbeck
19f8f32a96 glsl2: Empty functions can be inlined.
Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2010-09-18 01:28:47 +02:00
Vinson Lee
da3db66c08 r600g: Silence unused variable warnings.
The variables are used in code that is currently ifdef'ed out.
2010-09-17 14:27:39 -07:00
Vinson Lee
d74a8da2cb r600g: Silence uninitialized variable warning. 2010-09-17 14:21:32 -07:00
Vinson Lee
2da4694955 r600g: Fix memory leak on error path. 2010-09-17 14:17:26 -07:00
Vinson Lee
d56e46577e r600g: Fix implicit declaration warning.
Fixes this GCC warning.
r600_state2.c: In function 'r600_context_flush':
r600_state2.c:946: error: implicit declaration of function 'drmCommandWriteRead'
2010-09-17 14:06:23 -07:00
Vinson Lee
36033a6446 r600g: Remove unnecessary headers. 2010-09-17 12:40:54 -07:00
Vinson Lee
694b1883ee r600g: Remove unnecessary header. 2010-09-17 12:38:29 -07:00
José Fonseca
65822eba94 llvmpipe: Default to no threading on single processor systems. 2010-09-17 19:18:43 +01:00
José Fonseca
903a66abaf util: linearized sRGB values don't fit into 8bits
Fixes glean texture_srgb test.
2010-09-17 19:18:42 +01:00
Brian Paul
c70d539e24 gallivm: added missing case for PIPE_TEXTURE_RECT
Fixes fd.o bug 30245
2010-09-17 12:16:45 -06:00
Jerome Glisse
fd266ec62c r600g: alternative command stream building from context
Winsys context build a list of register block a register block is
a set of consecutive register that will be emited together in the
same pm4 packet (the various r600_block* are there to provide basic
grouping that try to take advantage of states that are linked together)
Some consecutive register are emited each in a different block,
for instance the various cb[0-7]_base. At winsys context creation,
the list of block is created & an index into the list of block. So
to find into which block a register is in you simply use the register
offset and lookup the block index. Block are grouped together into
group which are the various pkt3 group of config, context, resource,

Pipe state build a list of register each state want to modify,
beside register value it also give a register mask so only subpart
of a register can be updated by a given pipe state (the oring is
in the winsys) There is no prebuild register list or define for
each pipe state. Once pipe state are built they are bound to
the winsys context.

Each of this functions will go through the list of register and
will find into which block each reg falls and will update the
value of the block with proper masking (vs/ps resource/constant
are specialized variant with somewhat limited capabilities).

Each block modified by r600_context_pipe_state_set* is marked as
dirty and we update a count of dwords needed to emit all dirty
state so far.

r600_context_pipe_state_set* should be call only when pipe context
change some of the state (thus when pipe bind state or set state)

Then to draw primitive you make a call to r600_context_draw
void r600_context_draw(struct r600_context *ctx, struct r600_draw *draw)
It will check if there is enough dwords in current cs buffer and
if not will flush. Once there is enough room it will copy packet
from dirty block and then add the draw packet3 to initiate the draw.

The flush will send the current cs, reset the count of dwords to
0 and remark all states that are enabled as dirty and recompute
the number of dwords needed to send the current context.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-17 10:49:05 -04:00
Tilman Sauerbeck
d80bed1566 r600g: Fixed the shift in S_02880C_KILL_ENABLE.
Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
2010-09-17 14:08:54 +02:00
Tilman Sauerbeck
54d688f148 r600g: Enable PIPE_SHADER_CAP_TGSI_CONT_SUPPORTED.
Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
2010-09-17 12:49:51 +02:00
Tilman Sauerbeck
70a85c39a9 r600g: Only set PA_SC_EDGERULE on rv770 and greater.
This is what xf86-video-ati and r600c do.

Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
2010-09-17 12:17:48 +02:00
Tilman Sauerbeck
5f97d0a218 r600g: Added DB_SHADER_CONTROL defines.
Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
2010-09-17 12:06:07 +02:00
Tilman Sauerbeck
5edb778c1b r600g: Formatting fixes.
Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
2010-09-17 12:06:07 +02:00
Ian Romanick
a6ecd1c372 glsl2: Add flags to enable variable index lowering 2010-09-17 11:00:24 +02:00
Ian Romanick
6e4fe39da2 glsl2: Refactor testing for whether a deref is of a matrix or array 2010-09-17 11:00:24 +02:00
Luca Barbieri
a47539c7a1 glsl: add pass to lower variable array indexing to conditional assignments
Currenly GLSL happily generates indirect addressing of any kind of
arrays.

Unfortunately DirectX 9 GPUs are not guaranteed to support any of them in
general.

This pass fixes that by lowering such constructs to a binary search on the
values, followed at the end by vectorized generation of equality masks, and
4 conditional assignments for each mask generation.

Note that this requires the ir_binop_equal change so that we can emit SEQ
to generate the boolean masks.

Unfortunately, ir_structure_splitting is too dumb to turn the resulting
constant array references to individual variables, so this will need to
be added too before this pass can actually be effective for temps.

Several patches in the glsl2-lower-variable-indexing were squashed
into this commit.  These patches fix bugs in Luca's original
implementation, and the individual patches can be seen in that branch.
This was done to aid bisecting in the future.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2010-09-17 10:58:58 +02:00
Dave Airlie
dab2a7660a r600g: oops got the use_mem_constant the wrong way around.
this fixes evergreen gears again.
2010-09-18 00:28:06 +10:00
Dave Airlie
d0502297e0 r600g: use calloc for ctx bo allocations
since the reference code relies on these being NULL.
2010-09-17 15:29:32 +10:00
Dave Airlie
3ddc714b20 r600g: fixup map flushing.
long lived maps were getting removed when they shouldn't this
tries to avoid that problem by only adding to the flush list
on unmap.
2010-09-17 15:29:32 +10:00
Dave Airlie
0d76bb5d4c r600g: add upload manager support.
this add support for the upload manager for uploading user vbo/index buffers.

this provides a considerable speedup in q3 type games.
2010-09-17 15:29:31 +10:00
Dave Airlie
a927d0477a r600g: add winsys bo caching.
this adds the bo caching layer and uses it for vertex/index/constant bos.

ctx needs to take references on hw bos so the flushing works okay, also
needs to flush the maps.
2010-09-17 15:29:31 +10:00
Dave Airlie
da96313afe r600g: add support for kernel bo
this moves to using a pb bufmgr instead of kernel bos directly.
2010-09-17 15:29:31 +10:00
Dave Airlie
189a597513 r600g: use malloc bufmgr for constant buffers 2010-09-17 15:29:31 +10:00
Dave Airlie
7c1fcc41be r600g: move constant buffer creation behind winsys abstraction.
this paves the way for moving to pb bufmgrs now.
2010-09-17 15:29:31 +10:00
Chia-I Wu
0dbcf3b014 libgl-xlib: Remove unused st_api_create_OpenGL.
st/egl no longer relies on libGL for OpenGL support.
2010-09-17 12:54:26 +08:00
Chia-I Wu
cadc4ad963 targets/egl: Use C++ compiler to link GL/ES state trackers.
Otherwise, applications compiled with C compiler might have trouble
using them.
2010-09-17 12:54:03 +08:00
Francisco Jerez
82c4af33b0 dri/nv10: Fix the CLAMP texture wrap mode. 2010-09-17 05:34:32 +02:00
Brian Paul
4b27c614cf tgsi/sse: fix aos_to_soa() loop to handle num_inputs==0
Basically, change the loop from:
  do {...} while (--num_inputs != 0)
into:
  while (num_inputs != 0) { ... --num_inputs; }

Fixes fd.o bug 29987.
2010-09-16 19:05:09 -06:00
Dave Airlie
f70f79f6f6 r600g: attempt to abstract kernel bos from pipe driver.
introduce an abstraction layer between kernel bos and the winsys BOs.

this is to allow plugging in pb manager with minimal disruption to pipe driver.
2010-09-17 10:57:49 +10:00
Dave Airlie
ec9d838aa5 r600g: hide radeon_ctx inside winsys.
no need for this info to be exported to pipe driver.
2010-09-17 10:57:44 +10:00
Vinson Lee
b54d10b62e gallivm: Remove unnecessary header. 2010-09-16 15:34:24 -07:00
Brian Paul
7aadd5ecb5 gallivm: fix wrong return value in bitwise functions 2010-09-16 20:20:49 +01:00
José Fonseca
6d173da5c8 gallivm: Clamp indirect register indices to file_max.
Prevents crashes with bogus data, or bad shader translation.
2010-09-16 20:20:49 +01:00
José Fonseca
795eb3d64a gallivm: Start collecting bitwise arithmetic helpers in a new module. 2010-09-16 20:20:49 +01:00
José Fonseca
3d5b9c1f2d gallivm: Fix address register swizzle.
We're actually doing a double swizzling:

  indirect_reg->Swizzle[indirect_reg->SwizzleX]

instead of simply

  indirect_reg->SwizzleX
2010-09-16 20:20:49 +01:00
Francisco Jerez
50ac56bf98 meta: Don't bind the created texture object in init_temp_texture().
This function is executed outside _mesa_meta_begin/end(), that means
that e.g. _mesa_meta_Bitmap() clobbers the texturing state because it
changes the currently active texture object.

There's no need to bind the new texture when it's created, it's done
again later anyway (from setup_drawpix/copypix_texture()).

Signed-off-by: Brian Paul <brianp@vmware.com>
2010-09-16 13:00:57 -06:00
Brian Paul
3a6f9d0f47 mesa: include mfeatures.h in formats.c
Otherwise, FEATURE_EXT_texture_sRGB was undefined.
This is (part of?) the fix for fd.o bug 30177.
2010-09-16 12:41:51 -06:00
Marek Olšák
d4b2de13bc r300g/swtcl: fix CS overrun
https://bugs.freedesktop.org/show_bug.cgi?id=29901
2010-09-16 20:33:43 +02:00
Francisco Jerez
db94a2a5be dri/nouveau: Cleanup references to the old FBOs on glMakeCurrent(). 2010-09-16 19:44:22 +02:00
Francisco Jerez
d4d81ed02e dri/nouveau: Don't reemit the BO state in nouveau_state_emit(). 2010-09-16 19:44:22 +02:00
Francisco Jerez
bfc7518ab9 dri/nouveau: Don't request a fake front unnecessarily. 2010-09-16 19:44:22 +02:00
Francisco Jerez
39658f32ea dri/nouveau: Fix glRenderbufferStorage with DEPTH_COMPONENT as internal format. 2010-09-16 19:44:22 +02:00
Francisco Jerez
cbe0dd0f5a dri/nouveau: Add some more extensions. 2010-09-16 19:44:22 +02:00
Francisco Jerez
aad06c8524 dri/nouveau: Update nouveau_class.h. 2010-09-16 19:44:21 +02:00
Francisco Jerez
8f1051dca2 dri/nv04: Fix provoking vertex. 2010-09-16 19:44:21 +02:00
Francisco Jerez
286d8f2877 dri/nv04: Fix maximum texture size. 2010-09-16 19:44:21 +02:00
Francisco Jerez
7b06fdbd33 dri/nv04: Fix up color mask. 2010-09-16 19:44:21 +02:00
Francisco Jerez
0a6cfa1668 dri/nv04: Align SIFM transfer dimensions. 2010-09-16 19:44:21 +02:00
Francisco Jerez
bec626ff63 dri/nv04: Mipmapping fixes. 2010-09-16 19:44:21 +02:00
Francisco Jerez
aa317a40ce dri/nv04: Fix PGRAPH_ERRORs when running OA. 2010-09-16 19:44:21 +02:00
Andrew Randrianasulu
c344f27539 dri/nv04: Enable eng3dm for A8/L8 textures.
Signed-off-by: Francisco Jerez <currojerez@riseup.net>
2010-09-16 19:44:20 +02:00
Andrew Randrianasulu
a27bfb991c dri/nv04: Don't expose ARB_texture_env_combine/dot3.
Signed-off-by: Francisco Jerez <currojerez@riseup.net>
2010-09-16 19:44:20 +02:00
Keith Whitwell
0986355425 llvmpipe: add DEBUG_FS to dump variant information 2010-09-16 17:34:58 +01:00
Keith Whitwell
5f00819cb3 llvmpipe: add LP_PERF flag to disable various aspects of rasterization
Allows disabling various operations (mainly texture-related, but
will grow) to try & identify bottlenecks.

Unlike LP_DEBUG, this is active even in release builds - which is
necessary for performance investigation.
2010-09-16 17:34:19 +01:00
Keith Whitwell
045ee46011 gallivm: make lp_build_sample_nop public 2010-09-16 17:04:01 +01:00
Brian Paul
7640151c3d gallivm: move i32_vec_type inside the #ifdef 2010-09-16 09:00:54 -06:00
Brian Paul
3c9f4c7b75 gallivm: fix incorrect vector shuffle datatype
The permutation vector must always be a vector of int32 values.
2010-09-16 08:56:34 -06:00
Christoph Bumiller
3a62365f40 nv50: get shader fixups/relocations into working state 2010-09-16 14:49:23 +02:00
Christoph Bumiller
e0aa7e0438 nv50: don't segfault on shaders with 0 instructions 2010-09-16 14:49:20 +02:00
Kenneth Graunke
8fbe968a62 glsl: Don't print blank (function ...) headers for built-ins.
Fixes a regression caused when I added my GLSL ES support.
2010-09-16 03:09:25 -07:00
Kenneth Graunke
81f0339398 glsl: Change from has_builtin_signature to has_user_signature.
The print visitor needs this, and the only existing user can work with
has_user_signature just as well.
2010-09-16 02:52:25 -07:00
Tilman Sauerbeck
df62338c49 r600g: Use clamped math for RCP and RSQ.
This is likely only correct for OpenGL and not other state trackers.

Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
2010-09-16 11:08:00 +02:00
Tilman Sauerbeck
2108caac25 r600g: Fixed a bo leak in r600_blit_state_ps_shader().
We would leak the newly created bo if it cannot be mapped.

Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
2010-09-16 11:07:32 +02:00
Chia-I Wu
03224f492d st/xlib: Notify the context when the front/back buffers are swapped.
The current context should be notified when the the front/back buffers
of the current drawable are swapped.  The notification was skipped when
xmesa_strict_invalidate is false (the default).

This fixes fdo bug #29774.
2010-09-16 13:09:48 +08:00
Chia-I Wu
9ca59b2427 mesa: Update ES APIspec.xml.
Enable some extensions now that the needed tokens are defined in
GLES/glext.h and GLES2/glext.h.  Update the prototype of MultiDrawArrays
now that the prototype of _mesa_MultiDrawArraysEXT has been updated.
2010-09-16 13:09:01 +08:00
Dave Airlie
ef2808f56f r600g: fix texture bos and avoid doing depth blit on evergreen
since the depth blit code is hardcoded hex yay \o/
2010-09-16 21:48:02 +10:00
Dave Airlie
9a589961a2 r600g: fixup texture state on evergreen.
This whole set of state just seems wrong, another cut-n-paste nightmare.
2010-09-16 21:29:08 +10:00
Vinson Lee
9f7f7b3ff8 mesa/st: Silence uninitialized variable warning. 2010-09-15 18:47:17 -07:00
Vinson Lee
0d2561a562 nv50: Fix 'control reaches end of non-void function' warning. 2010-09-15 18:26:06 -07:00
Vinson Lee
b09af4c391 nv50: Silence uninitialized variable warnings. 2010-09-15 18:24:28 -07:00
Vinson Lee
00118c4077 draw: Remove unnecessary header. 2010-09-15 18:17:51 -07:00
Vinson Lee
d94c7841b2 gallivm: Remove unnecessary headers. 2010-09-15 18:14:18 -07:00
Vinson Lee
84e41b738b nv50: Silence uninitialized variable warning. 2010-09-15 17:27:50 -07:00
Vinson Lee
b533bb7d86 nv50: Silence uninitialized variable warning. 2010-09-15 17:24:50 -07:00
Vinson Lee
cbc6748795 nv50: Silence uninitialized variable warning. 2010-09-15 17:09:59 -07:00
Vinson Lee
4d4278675e nv50: Remove unnecessary headers. 2010-09-15 16:51:39 -07:00
Vinson Lee
a64e3d2e6c nv50: Update files in SConscript to match Makefile. 2010-09-15 16:46:04 -07:00
Dave Airlie
1a20aae581 r600g: add vgt dma src defines 2010-09-16 09:41:43 +10:00
Dave Airlie
3ead528bbb r600g: use index min/max + index buffer offset.
more prep work for fixing up buffer handling
2010-09-16 09:40:42 +10:00
Dave Airlie
05433f20b6 r600g: pull r600_draw struct out into header
we need this for future buffer rework, it also makes the vtbl easier
2010-09-16 09:40:42 +10:00
Brian Paul
0a7824862e gallivm: expand AoS sampling to cover all filtering modes
...and all texture targets (1D/2D/3D/CUBE).
2010-09-15 17:04:31 -06:00
Brian Paul
95254bbd2d tgsi: fix incorrect usage_mask for shadow tex instructions
The shadow versions of the texture targets use an extra component
(Z) to express distance from light source to the fragment.
Fixes the shadowtex demo with llvmpipe.
2010-09-15 13:56:02 -06:00
Brian Paul
68cfc8e996 nv50: use unsigned int for bitfields to silence warnings 2010-09-15 12:51:09 -06:00
Brian Paul
3085efabb1 llvmpipe: s/boolean/unsigned/ in bitfield to silence warning
Using non-int types for bitfields is a gcc extension.
The size of the struct is not effected by this change.
2010-09-15 12:49:13 -06:00
Brian Paul
29289b43b7 llvmpipe: cast to silence warning 2010-09-15 12:48:29 -06:00
Brian Paul
7545514fb6 glsl2: fix signed/unsigned comparison warning 2010-09-15 12:47:32 -06:00
John Doe
e0b6df4fcc r600g: misc cleanup
Avoid using r600_screen structure to get ptr to radeon
winsys structure.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-15 11:48:34 -04:00
Christoph Bumiller
26fe16a99b Merge remote branch 'origin/nv50-compiler'
Conflicts:
	src/gallium/drivers/nouveau/nouveau_class.h
	src/gallium/drivers/nv50/nv50_screen.c
2010-09-15 17:34:40 +02:00
Keith Whitwell
59ca1ae84b llvmpipe: return zero from floor_pot(zero) 2010-09-15 16:28:49 +01:00
Christoph Bumiller
84d170bbce nv50: put low limit on REG_ALLOC_TEMP and FP_RESULT_COUNT 2010-09-15 15:35:14 +02:00
Christoph Bumiller
c46e7a05e5 nv50: improve and fix modifier folding optimization
Execute before folding loads, because we don't check if it's legal
in lower_mods.
Ensure that a value's insn pointer is updated when transferring it
to a different instruction.
2010-09-15 15:35:14 +02:00
Christoph Bumiller
16d8f5fee5 nv50: consider address register in reload elimination 2010-09-15 15:35:14 +02:00
Keith Whitwell
be2fb11f10 llvmpipe: remove duplicate code
Bad rebase presumably.
2010-09-15 14:30:01 +01:00
Keith Whitwell
cc2ed02c0a llvmpipe: brackets around macro arg 2010-09-15 14:30:01 +01:00
Chia-I Wu
e3c46cf586 glapi: Fix ES build errors again.
This fixes an error in GLAPI ES.  My build is ok with or without this
patch, and the error affects others' setups.

[Patch from Francesco Marella]
2010-09-15 21:19:44 +08:00
Vinson Lee
efab1c8642 r600g: Silence unused variable warning.
The code that uses dname is currently ifdef'ed out.
2010-09-15 06:14:02 -07:00
Vinson Lee
1ce4f86803 r600g: Silence uninitialized variable warning. 2010-09-15 06:09:28 -07:00
Vinson Lee
a712e193a3 r600g: Silence uninitialized variable warning. 2010-09-15 05:52:16 -07:00
Vinson Lee
76c0576101 r600g: Silence uninitialized variable warning. 2010-09-15 05:46:34 -07:00
Vinson Lee
66a146dd05 nvfx: Silence uninitialized variable warnings. 2010-09-15 05:43:50 -07:00
Vinson Lee
9aee4be5e0 r600g: Silence uninitialized variable warning. 2010-09-15 05:34:29 -07:00
Vinson Lee
7290c5982c r600g: Silence uninitialized variable warning. 2010-09-15 05:31:31 -07:00
Vinson Lee
f20f2cc330 glsl: Fix 'format not a string literal and no format arguments' warning.
Fix the following GCC warning.
loop_controls.cpp: In function 'int calculate_iterations(ir_rvalue*, ir_rvalue*, ir_rvalue*, ir_expression_operation)':
loop_controls.cpp:88: warning: format not a string literal and no format arguments
2010-09-15 05:17:57 -07:00
Dave Airlie
09ef8e9283 r300g: fix buffer reuse issue caused by previous commit
caused by 0b9eb5c9bb

test run glxgears, resize.
2010-09-15 13:26:04 +02:00
Chia-I Wu
cad87ebc3a glapi: Fix build errors for ES.
The latest glext.h defines GL_FIXED.  Test GL_OES_fixed_point instead to
decide whether to define GLfixed and GLclampx.

This fixes fdo bug #30205.
2010-09-15 17:45:26 +08:00
Andre Maasikas
84f7b5d974 r600c: fix buffer height setting in dri2 case
fbHeight is 0 in this case

uncovered by changes in b0bc026c and should fix kernel rejecting command
streams after that commit
2010-09-15 11:32:18 +03:00
Marek Olšák
0b9eb5c9bb r300g: prevent creating multiple winsys BOs for the same handle
This fixes a DRM deadlock in the cubestorm xscreensaver, because somehow
there must not be 2 different BOs relocated in one CS if both BOs back
the same handle. I was told it is impossible to happen, but apparently
it is not, or there is something else wrong.
2010-09-15 04:29:18 +02:00
Vinson Lee
fd7f70af48 mesa: Include missing header in program.h.
Include compiler.h for ASSERT symbol.
2010-09-14 17:54:46 -07:00
Vinson Lee
6a8a506158 r600g: Remove unnecessary headers. 2010-09-14 17:42:47 -07:00
Luca Barbieri
ccb5e65bc9 auxiliary: fix unintended fallthrough 2010-09-14 21:45:01 +02:00
Vinson Lee
cdf74a1ab9 llvmpipe: Remove unnecessary header. 2010-09-14 14:23:17 -07:00
Brian Paul
4cd751bcc4 glx: add const qualifiers to __indirect_glMultiDrawArraysEXT() 2010-09-14 11:01:03 -06:00
Andre Maasikas
b0bc026c12 r600c: fix setting negative values to bitfields
when setting negative integers to bitfields we could overwrite
other parts of it. So mask the value to be written correctly.
This is used quite often in the driver - hope it doesnt affect
performace or uncover behaviour relied before...

fixes strange effects when setting negative lodbias on evergreen
2010-09-14 19:00:35 +03:00
Brian Paul
79ab394cd2 mesa: upgrade wglext.h to version 22 2010-09-14 09:40:23 -06:00
Brian Paul
b106e6261a mesa: upgrade glxext.h to version 32 2010-09-14 09:39:44 -06:00
Brian Paul
7993832c12 mesa: update to version 64 of GL/glext.h
A number of other files had to be updated as well because const
qualifiers were added to the glMultiDrawArrays() function.
Also, GL_FIXED is now defined in glext.h.
2010-09-14 09:37:37 -06:00
Brian Paul
83f5f50f2f mesa: move, redefine MESA_GEOMETRY_PROGRAM 2010-09-14 09:16:40 -06:00
Brian Paul
1c0644e9da glsl2: add case for ir_unop_noise
Silences a compiler warning.  Still need to add some assertions
for this case.
2010-09-14 09:15:20 -06:00
Brian Paul
2b04ead569 glsl2: fix comments 2010-09-14 09:05:46 -06:00
Chia-I Wu
9476efe77f mesa: Remove unnecessary FEATURE tests.
Remove all FEATURE tests in mesa/drivers/common/.  They are not needed
and the code looks better without them.
2010-09-14 15:49:58 +08:00
Chia-I Wu
10ff2646a4 mesa: Less FEATURE_ARB_sync tests.
Add dummy static inline definitions to syncobj.h when FEATURE_ARB_sync
is 0, and remove most FEATURE_ARB_sync tests.
2010-09-14 15:49:47 +08:00
Chia-I Wu
db6273e0dd mesa: Remove unused _MESA_INIT_*_FUNCTIONS.
They were intended to be used to build OpenGL ES only DRI drivers, but
that never happened.
2010-09-14 15:49:43 +08:00
Vinson Lee
1c6992b873 gallivm: Remove unnecessary header. 2010-09-14 00:42:20 -07:00
Vinson Lee
aeb83928fd llvmpipe: Initialize variable for potentially unhandled switch case. 2010-09-14 00:17:13 -07:00
Vinson Lee
45ee8463a2 i965g: Fix 'control reaches end of non-void function' warning.
Fixes the following GCC warning.
brw_screen.c: In function 'brw_get_shader_param':
brw_screen.c:241: warning: control reaches end of non-void function
2010-09-14 00:08:45 -07:00
Vinson Lee
706380cf7d i915g: Fix 'control reaches end of non-void function' warning.
Fixes the following GCC warning.
i915_screen.c: In function 'i915_get_shader_param':
i915_screen.c:184: warning: control reaches end of non-void function
2010-09-13 23:58:42 -07:00
Vinson Lee
d4d48c0579 i915: Fix "implicit declaration of function 'draw_get_shader_param'" warning.
Fixes the following GCC warning.
i915_screen.c: In function 'i915_get_shader_param':
i915_screen.c:147: warning: implicit declaration of function 'draw_get_shader_param'
2010-09-13 23:42:35 -07:00
Vinson Lee
c5867acb0d identity: Fix 'assignment from incompatible pointer type' warning.
This is a follow-up to commit a508d2dddc.

Fixes the following GCC warning.
id_screen.c: In function 'identity_screen_create':
id_screen.c:317: warning: assignment from incompatible pointer type
2010-09-13 23:23:34 -07:00
Vinson Lee
4f2f02b7d6 rbug: Fix 'assignment from incompatible pointer type' warning.
This is a follow-up to commit a508d2dddc.

Fixes the following GCC warning.
rbug_screen.c: In function 'rbug_screen_create':
rbug_screen.c:331: warning: assignment from incompatible pointer type
2010-09-13 23:02:37 -07:00
Luca Barbieri
fbc7c9b7a9 mesa/st: ask GLSL to not emit noise since we have a dummy implementation
Note, BTW, that the Gallium implementation returns 0.5, which seems
to violate the GLSL spec, where it should return 0.0 instead.

Not sure whether changing it to 0 is correct or not.
2010-09-14 06:08:03 +02:00
Luca Barbieri
b37459388b mesa/st: set compiler options based on Gallium shader caps
This turns on if conversion and unlimited loop unrolling if control
flow is not supported.

NOTE: this will change the behavior of r300g and any other driver
that doesn't advertise control flow
2010-09-14 06:08:03 +02:00
Luca Barbieri
a508d2dddc gallium: introduce get_shader_param (ALL DRIVERS CHANGED) (v3)
Changes in v3:
- Also change trace, which I forgot about

Changes in v2:
- No longer adds tessellation shaders

Currently each shader cap has FS and VS versions.

However, we want a version of them for geometry, tessellation control,
and tessellation evaluation shaders, and want to be able to easily
query a given cap type for a given shader stage.

Since having 5 duplicates of each shader cap is unmanageable, add
a new get_shader_param function that takes both a shader cap from a
new enum and a shader stage.

Drivers with non-unified shaders will first switch on the shader
and, within each case, switch on the cap.

Drivers with unified shaders instead first check whether the shader
is supported, and then switch on the cap.

MAX_CONST_BUFFERS is now per-stage.
The geometry shader cap is removed in favor of checking whether the
limit of geometry shader instructions is greater than 0, which is also
used for tessellation shaders.

WARNING: all drivers changed and compiled but only nvfx tested
2010-09-14 06:07:41 +02:00
Ian Romanick
309cd4115b glsl2: Port equal() and notEqual() to ir_unop_all_equal and ir_unop_any_nequal 2010-09-13 17:53:32 -07:00
Luca Barbieri
4dfb89904c glsl: introduce ir_binop_all_equal and ir_binop_any_equal, allow vector cmps
Currently GLSL IR forbids any vector comparisons, and defines "ir_binop_equal"
and "ir_binop_nequal" to compare all elements and give a single bool.

This is highly unintuitive and prevents generation of optimal Mesa IR.

Hence, first rename "ir_binop_equal" to "ir_binop_all_equal" and
"ir_binop_nequal" to "ir_binop_any_nequal".

Second, readd "ir_binop_equal" and "ir_binop_nequal" with the same semantics
as less, lequal, etc.

Third, allow all comparisons to acts on vectors.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2010-09-13 17:53:04 -07:00
Luca Barbieri
2cdbced10d loop_unroll: unroll loops with (lowered) breaks
If the loop ends with an if with one break or in a single break unroll
it.  Loops that end with a continue will have that continue removed by
the redundant jump optimizer.  Likewise loops that end with an
if-statement with a break at the end of both branches will have the
break pulled out after the if-statement.

Loops of the form

   for (...) {
      do_something1();
      if (cond) {
	 do_something2();
	 break;
      } else {
	 do_something3();
      }
   }

will be unrolled as

   do_something1();
   if (cond) {
      do_something2();
   } else {
      do_something3();
      do_something1();
      if (cond) {
	 do_something2();
      } else {
	 do_something3();
	 /* Repeat inserting iterations here.*/
      }
   }

ir_lower_jumps can guarantee that all loops are put in this form
and thus all loops are now potentially unrollable if an upper bound
on the number of iterations can be found.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2010-09-13 16:20:40 -07:00
Ian Romanick
8f2214f489 glsl2: Add pass to remove redundant jumps 2010-09-13 14:25:26 -07:00
Ian Romanick
e79a1bb02a glsl: Explain file naming convention 2010-09-13 14:06:32 -07:00
Luca Barbieri
710d41131b loop_controls: fix analysis of already analyzed loops
The loop_controls pass didn't look at the counter values it put in ir_loop
on previous iterations, so while the first iteration worked, subsequent
ones couldn't determine max_iterations.
2010-09-13 13:03:10 -07:00
Ian Romanick
4de7a3b76a i965: Request that returns be lowered in shader main
Fixes piglit tests glsl-vs-main-return and glsl-fs-main-return.
2010-09-13 13:03:10 -07:00
Luca Barbieri
87708e8c90 glsl: call ir_lower_jumps according to compiler options 2010-09-13 13:03:09 -07:00
Luca Barbieri
3361cbac2a glsl: add continue/break/return unification/elimination pass (v2)
Changes in v2:
- Base class renamed to ir_control_flow_visitor
- Tried to comply with coding style

This is a new pass that supersedes ir_if_return and "lowers" jumps
to if/else structures.

Currently it causes no regressions on softpipe and nv40, but I'm not sure
whether the piglit glsl tests are thorough enough, so consider this
experimental.

It can be asked to:
1. Pull jumps out of ifs where possible
2. Remove all "continue"s, replacing them with an "execute flag"
3. Replace all "break" with a single conditional one at the end of the loop
4. Replace all "return"s with a single return at the end of the function,
   for the main function and/or other functions

This gives several great benefits:
1. All functions can be inlined after this pass
2. nv40 and other pre-DX10 chips without "continue" can be supported
3. nv30 and other pre-DX10 chips with no control flow at all are better supported

Note that for full effect we should also teach the unroller to unroll
loops with a fixed maximum number of iterations but with the canonical
conditional "break" that this pass will insert if asked to.

Continues are lowered by adding a per-loop "execute flag", initialized to
TRUE, that when cleared inhibits all execution until the end of the loop.

Breaks are lowered to continues, plus setting a "break flag" that is checked
at the end of the loop, and trigger the unique "break".

Returns are lowered to breaks/continues, plus adding a "return flag" that
causes loops to break again out of their enclosing loops until all the
loops are exited: then the "execute flag" logic will ignore everything
until the end of the function.

Note that "continue" and "return" can also be implemented by adding
a dummy loop and using break.
However, this is bad for hardware with limited nesting depth, and
prevents further optimization, and thus is not currently performed.
2010-09-13 13:03:09 -07:00
Luca Barbieri
55adbebc62 glsl: add ir_control_flow_visitor
This is just a subclass of ir_visitor with empty implementations of all
the visit methods for non-control flow nodes.

Used to avoid duplicating that in ir_visitor subclasses.

ir_hierarchical_visitor is another way to solve this, but is less natural
for some applications.
2010-09-13 13:03:09 -07:00
José Fonseca
6b5575baaa llvmpipe: Fix non SSE2 builds.
Should fix fdo 30168.
2010-09-13 20:43:36 +01:00
Marek Olšák
428dc6d7d2 r300g/swtcl: unlock VBO after draw_flush
https://bugs.freedesktop.org/show_bug.cgi?id=29901
https://bugs.freedesktop.org/show_bug.cgi?id=30132
2010-09-13 21:12:07 +02:00
Witold Baryluk
c40858fa0d llvmpipe: Change asm to __asm__.
According to gcc documentation both are equivalent,
second are prefered as first can make conflict with existing symbols.

Signed-off-by: José Fonseca <jfonseca@vmware.com>
2010-09-13 18:58:50 +01:00
Jesse Barnes
e7eff0cfce EGL DRI2: 0xa011 is Pineview not Ironlake
Point about needing a better way to do this validated.
2010-09-13 10:55:56 -07:00
Alex Deucher
9532eea509 r600c: const buffer sizes must be a multiple of 16 consts
This applies to r6xx/r7xx/evergreen
2010-09-13 13:41:46 -04:00
Jesse Barnes
c121608b6e EGL DRI2: add PCI ID for Ironlake mobile
Allows KMS EGL driver to load.  We need a better way of doing this.
2010-09-13 10:36:46 -07:00
Alex Deucher
6f839eb631 r600c/eg: remove obselete comment 2010-09-13 12:16:00 -04:00
Alex Deucher
2ef5bc3976 r600c/eg: remove unused emit timestamp function 2010-09-13 12:14:24 -04:00
Alex Deucher
07d95cdbfb r600c/eg: emit CB_BLEND_ALPHA with the other blend values
saves a few dwords
2010-09-13 12:11:29 -04:00
Alex Deucher
105ef5eb5e r600c: remove redundant state emit on evergreen
r700start3d already emits the context control packets
2010-09-13 12:06:34 -04:00
Christoph Bumiller
60f34e9f60 nv50: fix TXP depth comparison value 2010-09-13 17:26:41 +02:00
Christoph Bumiller
0b8170103c nv50: fix indirect CONST access with large or negative offsets 2010-09-13 17:26:41 +02:00
Christoph Bumiller
3b3c20744f nv50: MOV TEMP[0], -CONST[0] must be float32 negation 2010-09-13 17:26:41 +02:00
Christoph Bumiller
1f1411f2cc nv50: interp cannot write flags reg 2010-09-13 17:26:41 +02:00
Christoph Bumiller
cca3906a9b nv50: check for immediates when turning MUL ADD into MAD 2010-09-13 17:26:41 +02:00
Christoph Bumiller
98c87c382d nv50: handle TGSI EXP and LOG again 2010-09-13 17:26:41 +02:00
Kristian Høgsberg
7dcb305000 mesa: Revert accidentally committed vertex code chunk 2010-09-13 10:32:15 -04:00
Andre Maasikas
cdfe02d3fc r600c: eg: fix typo
probably copy/paste error
2010-09-13 16:55:58 +03:00
Andre Maasikas
629842b44c r600c: eg: 256 float4 constants may need more than 256 bytes 2010-09-13 16:29:44 +03:00
Andre Maasikas
c82beb436b r600c: eg - fix uninitialized variable 2010-09-13 16:19:18 +03:00
Kristian Høgsberg
4ebf07a426 glx: Don't destroy DRI2 drawables for legacy glx drawables
For GLX 1.3 drawables, we can destroy the DRI2 drawable when the GLX
drawable is destroyed.  However, for legacy drawables, there os no
good way of knowing when the application is done with it, so we just
let the DRI2 drawable linger on the server.  The server will destroy
the DRI2 drawable when it destroys the X drawable or the client exits
anyway.

https://bugs.freedesktop.org/show_bug.cgi?id=30109
2010-09-13 08:42:22 -04:00
Marek Olšák
0392e48867 r300g: fix SWTCL
https://bugs.freedesktop.org/show_bug.cgi?id=29901
2010-09-13 13:26:35 +02:00
José Fonseca
501d43028e llvmpipe: Unbreak rasterization on 64bit. 2010-09-13 12:03:35 +01:00
José Fonseca
91a9325761 gallium: Change the resource_copy_region semantics to allow copies between different yet compatible formats 2010-09-13 11:33:44 +01:00
Dave Airlie
61c2861b4e r600g: evergreen fixup dsa state for running query.
evergreen is always the same as r700 here.
2010-09-13 19:57:29 +10:00
Andre Maasikas
2471d0d6c5 r600c: remove stray unmap call
no idea how/why it got there
2010-09-13 12:42:25 +03:00
José Fonseca
b97c75e6a3 llvmpipe: use gcc asm only with gcc 2010-09-13 09:24:09 +01:00
Marek Olšák
6990148b12 r300g: print unassigned FS inputs for DBG_RS 2010-09-13 09:55:14 +02:00
Marek Olšák
ae1aa14965 r300g: fix map_buffer
https://bugs.freedesktop.org/show_bug.cgi?id=30145
2010-09-13 07:52:13 +02:00
Marek Olšák
185434fbe8 r300/compiler: fix warnings 2010-09-13 07:52:13 +02:00
Marek Olšák
ab7cc44580 r300g: add new debug options for dumping scissor regs and disabling CBZB clear 2010-09-13 07:49:43 +02:00
Marek Olšák
c3c5646b93 r300g: skip rendering if CS space validation fails
radeon_cs_space_check flushes the pipe context on failure, retries
the validation, and returns -1 if it fails again. At that point, there is
nothing we can do, so let's skip draw operations instead of getting stuck
in an infinite loop.

This code path ideally should never be hit.
2010-09-13 07:49:43 +02:00
Marek Olšák
317680c6fb r300g: remove u_upload_flush from r300_draw_arrays
This a leftover probably and is unnecessary, since we flush u_upload_mgr
in r300_flush.
2010-09-13 07:49:43 +02:00
Vinson Lee
b4f7f059c7 nvfx: Remove unused variables. 2010-09-12 21:48:40 -07:00
Vinson Lee
89e138b1c4 nvfx: Move declaration before code.
Fixes SCons build.
2010-09-12 21:39:21 -07:00
Keith Whitwell
c4046d4fda llvmpipe: introduce tri_3_4 for tiny triangles 2010-09-12 15:03:50 +01:00
Keith Whitwell
4b56e86e67 llvmpipe: allow tri_3_16 at any 4-aligned location within a tile
Doesn't require 16-alignment, so catch more cases.
2010-09-12 15:03:49 +01:00
Keith Whitwell
26b663c2aa llvmpipe: refactor tri_3_16
Keep step array as a set of four m128i's and reuse throughout the
rasterization.
2010-09-12 15:03:49 +01:00
Keith Whitwell
67b957781d llvmpipe: pass linear masks to fragment shader
Fragment shader can extract the correct bits for each quad.
2010-09-12 15:03:49 +01:00
Keith Whitwell
4b99b9f5ff llvmpipe: fix warnings on both 32 and 64 bit builds 2010-09-12 15:01:41 +01:00
Keith Whitwell
51b1d4f03c llvmpipe: fix wierd performance regression in isosurf
I really don't understand the mechanism behind this, but it
seems like the way data blocks for a scene are malloced, and in
particular whether we treat them as stack or a queue, and whether
we retain the most recently allocated or least recently allocated
has a real affect (~5%) on isosurf framerates...

This is probably specific to my distro or even just my machine,
but none the less, it's nicer not to see the framerates go in the
wrong direction.
2010-09-12 14:58:43 +01:00
Christoph Bumiller
1fa812d84a nv50: match TEMP limit with nv50 ir builder
Mesa doesn't respect it anyway, but this makes it assert rather
than threads access areas of l[] that don't belong to them.
2010-09-12 11:41:57 +02:00
Christoph Bumiller
fdb00ac1ef nv50: newlines in shader bincode printing 2010-09-12 11:41:57 +02:00
Christoph Bumiller
d4fd11a628 nv50: cannot move from local mem to output reg directly 2010-09-12 11:41:57 +02:00
José Fonseca
67763488b1 pb: Fix the build, and add notes. 2010-09-12 10:37:06 +01:00
José Fonseca
853953dc3c llvmpipe: Only generate the whole shader specialization for opaque shaders.
If not opaque, then the color buffer will have to be read any way,
therefore the specialization is pointless.
2010-09-12 10:15:48 +01:00
Dave Airlie
b5fcf0c8e0 pb: add void * for flush ctx to mapping functions
If the buffer we are attempting to map is referenced by the unsubmitted
command stream for this context, we need to flush the command stream,
however to do that we need to be able to access the context at the lowest
level map function, currently we set the buffer in the toplevel map, but this
racy between context. (we probably have a lot more issues than that.)

I'll look into a proper solution as suggested by jrfonseca when I get some time.
2010-09-12 13:32:43 +10:00
Xavier Chantry
9b39fb1b61 nv50: fix size of outputs_written array 2010-09-12 00:59:50 +02:00
Christoph Bumiller
fc31a25afa nv50: minor compiler fixes and cleanups 2010-09-12 00:59:49 +02:00
Christoph Bumiller
7a4a537be1 nv50: reduce bb_reachable_by runtime from pot to linear
As a by-product, remove the memory leak of nv_basic_blocks.
2010-09-12 00:59:49 +02:00
Luca Barbieri
95555ed03e nv30: fix breakage due to 10 texcoord support on nv40 2010-09-11 21:11:03 +02:00
Chia-I Wu
c34225974b Add missing files to the tarball file lists. 2010-09-12 02:31:33 +08:00
Chia-I Wu
19b2cfd6f6 mesa: Fix depend.es[12] generation when LLVM is enabled.
"llvm-config --cflags" outputs -f options, which conflict makedepend.
Clean up compiler flags and append LLVM_CFLAGS to the new xxx_CFLAGS
instead of xxx_CPPFLAGS, where xxx may be MESA, ES1, or ES2.
2010-09-12 02:31:33 +08:00
Tilman Sauerbeck
33b1d14913 r600g: Undo bo placement change.
This reverts a part of e795ca8f31
that causes artefacts and a performance drop.

Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
2010-09-11 18:40:45 +02:00
José Fonseca
3ad3cbfb12 llvmpipe: Silence some warnings. 2010-09-11 13:47:58 +01:00
José Fonseca
552e2b5065 gallivm: nr_channels is only valid for formats with plain layout.
This is erroneously throwing non plain formats out of the faster
AoS sampling path.

Doing 8bit interpolation for single channels such as L8 should be no
worse than with floating point. But this may need more investigation.
2010-09-11 13:34:54 +01:00
José Fonseca
74f6edaee4 gallivm: Use const keyword on swizzles. 2010-09-11 13:31:35 +01:00
José Fonseca
697fdf3fff gallivm: Allow to TGSI AoS translation to happen in BGRA ordering.
Or any ordering.
2010-09-11 13:31:17 +01:00
José Fonseca
277d768d10 llvmpipe: Don't store display the alpha ref value in the key.
It's never used.
2010-09-11 13:30:14 +01:00
José Fonseca
dcc5d7f672 gallivm: Add a new debug flag to warn about performance issues. 2010-09-11 13:29:29 +01:00
José Fonseca
c0d41d0404 gallivm: Helper functions for pointer indirection. 2010-09-11 13:27:38 +01:00
José Fonseca
225530f1f2 gallivm: Cleanup the TGSI <-> sampler interface. 2010-09-11 13:27:27 +01:00
José Fonseca
775edbfaa1 gallivm: Add some utility functions to set/get array elements too. 2010-09-11 13:27:22 +01:00
José Fonseca
93158622e2 gallivm: Basic AoS TGSI -> LLVM IR.
Essentially a variation of the SoA version.
2010-09-11 13:25:49 +01:00
José Fonseca
58daea741f gallivm: Move the texture modifiers to the header.
Useful to pass these around.
2010-09-11 13:25:46 +01:00
José Fonseca
34ea50f672 gallivm: s/lp_build_broadcast_aos/lp_build_swizzle_scalar_aos/
More accurate description of this function purpose.
2010-09-11 13:01:31 +01:00
Alex Corscadden
96c6e7e73e Add a test for the KIL opcode
This is a simple test for the KIL opcode.  It should render a 6 sided figure
with a colored interior.
2010-09-11 13:01:20 +01:00
Keith Whitwell
afd328afa8 llvmpipe: restore larger command blocks 2010-09-11 10:04:53 +01:00
Keith Whitwell
10d0a835bc llvmpipe: move some debug to DEBUG_SCENE 2010-09-11 10:04:53 +01:00
Keith Whitwell
bc759cd37e llvmpipe: add DEBUG_MEM option 2010-09-11 10:04:53 +01:00
Keith Whitwell
b7a54b3dc6 llvmpipe: allow bigger scenes 2010-09-11 10:04:52 +01:00
Tom Stellard
4749429a4a r300/compiler: Reorganize presub_helper() 2010-09-10 18:18:10 -07:00
Tom Stellard
3fffcb317c r300/compiler: Don't use presubtract in TEX instructions 2010-09-10 18:18:10 -07:00
Tom Stellard
8b67159e9a r300/compiler: Print the presub subtract operation in the correct order 2010-09-10 18:18:10 -07:00
Tom Stellard
e3fc210a4f r300/compiler: Fix dataflow bug in presub_helper() 2010-09-10 18:18:09 -07:00
Tom Stellard
d442c7f172 r300/compiler: Replace asserts with error messages 2010-09-10 18:18:09 -07:00
Tom Stellard
66b1e716fb r300/compiler: Fix copy propigation for some presub instructions 2010-09-10 18:18:09 -07:00
Tom Stellard
564653b9f1 r300/compiler: Add peephole optimization for the 'sub' presubtract operation 2010-09-10 18:18:09 -07:00
Tom Stellard
a64b4a05af r300/compiler: Add peephole optimization for the 'add' presubtract operation 2010-09-10 18:18:09 -07:00
Tom Stellard
598e220f95 r300/compiler: Clean up rc_pair_alloc_source() 2010-09-10 18:18:09 -07:00
Tom Stellard
63432ecfce r300/compiler: Enable presubtract sources
The r300 compiler can now emit instructions that select from the presubtract
source.  A peephole optimization has been added to convert instructions like:
ADD Temp[0].x, none.1, -Temp[1].x into the INV (1 - src0) presubtract
operation.
2010-09-10 18:18:08 -07:00
Ian Romanick
d8a3662008 mesa: Remove unused Emit flags from gl_shader_compiler_options 2010-09-10 13:10:26 -07:00
Ian Romanick
55aaee6020 intel: Remove noise opcode support from i915 and i965 drivers
With recent changes to the GLSL compiler, these opcode should never be
seen in these drivers.
2010-09-10 12:33:15 -07:00
Alex Deucher
58eaade662 r600c: add missing header 2010-09-10 14:14:12 -04:00
Alex Deucher
9cced19125 r600c: add OQ support for evergreen 2010-09-10 13:26:10 -04:00
Alex Deucher
7ffc5d7c2e r600c: oq updates 2010-09-10 13:13:08 -04:00
Alex Deucher
4e53d6e6c9 r600c: add blit support for evergreen
driver was previously calling the r600 blit code
which won't work on evergreen.
2010-09-10 13:01:23 -04:00
Alex Deucher
886c6c09ea r600c: emit start3d packet on evergreen 2010-09-10 13:01:23 -04:00
Alex Deucher
f35b728acc r600c: fix some typos 2010-09-10 13:01:23 -04:00
Alex Deucher
a712db73ce r600c: fix type in cb setup on evergreen 2010-09-10 13:01:23 -04:00
Alex Deucher
c7843280f0 r600c: add support for more rendering formats on evergreen 2010-09-10 13:01:22 -04:00
Andre Maasikas
78109952d4 r600: set correct initial point_minmax values 2010-09-10 14:55:10 +03:00
Tilman Sauerbeck
ec2e0fd1e9 r600g: Fixed a bo reference leak in the draw module.
Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
2010-09-10 13:09:33 +02:00
Tilman Sauerbeck
0b4c529da5 r600g: Only increase a bo's map_count if radeon_bo_map() succeeded.
Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
2010-09-10 13:09:33 +02:00
Tilman Sauerbeck
56a80535b6 r600g: Fixed a bo leak in the error path of radeon_ctx_set_bo_new().
Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
2010-09-10 13:09:33 +02:00
Tilman Sauerbeck
ac2bddb9f2 r600g: Fixed a bo leak in r600_texture_from_handle().
We would leak bo if the argument check failed.

Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
2010-09-10 13:09:33 +02:00
Tilman Sauerbeck
ae23d425c2 r600g: Don't leave stale references in query_list when we cannot create bo.
Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
2010-09-10 13:09:33 +02:00
Tilman Sauerbeck
96a4edb8cc r600g: Implemented the y component write for the LOG opcode.
This makes the 'vp1-LOG test' piglit test work.

Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
2010-09-10 13:09:32 +02:00
Chia-I Wu
ea9e5dbbc2 egl: Simplify _eglBindContext.
Remove the hard-to-get-right _eglBindContextToSurfaces.  As well as fix
an assertion failure from b90a3e7d8b when
such call sequence is hit

  eglMakeCurrent(dpy, surf1, surf1, ctx1);
  eglMakeCurrent(dpy, surf2, surf2, ctx2);
  eglMakeCurrent(dpy, surf1, surf1, ctx1);
2010-09-10 18:41:14 +08:00
Andre Maasikas
67270e1fd6 r600: dont bswap rgba FLOAT formats
fixes at least some readback tests in piglit
2010-09-10 12:14:26 +03:00
Chia-I Wu
67660ccee9 targets/egl: Fix crashes from loading invalid modules.
Be defensive.
2010-09-10 16:03:04 +08:00
Chia-I Wu
5ea092117f gallium: Remove ST_API_OPENGL_ES1 and ST_API_OPENGL_ES2.
They are no longer used.
2010-09-10 15:44:19 +08:00
Chia-I Wu
948e3fa27c st/egl: Use profiles to create OpenGL ES contexts.
Replace all uses of ST_API_OPENGL_ES{1,2} by profiles.  Having 3
st_api's to provide OpenGL, OpenGL ES 1.1, and OpenGL ES 2.0 is not a
sane abstraction, since all of them share glapi for current
context/dispatch management.
2010-09-10 15:44:11 +08:00
Chia-I Wu
0cd480f076 st/dri: Use profiles to create OpenGL ES contexts.
Having 3 st_api's to provide OpenGL, OpenGL ES 1.1, and OpenGL ES 2.0 is
not a sane abstraction, since all of them share glapi for current
context/dispatch management.
2010-09-10 15:43:34 +08:00
Chia-I Wu
4531356817 gallium: Add context profile support to st_api.
Add struct st_context_attribs to describe context profiles and
attributes.  Modify st_api::create_context to take the new struct
instead of an st_visual.

st_context_attribs can be used to support GLX_ARB_create_context_profile
and GLX_EXT_create_context_es2_profile in the future.  But the
motivation for doing it now is to be able to replace ST_API_OPENGL_ES1
and ST_API_OPENGL_ES2 by profiles.

Having 3 st_api's to provide OpenGL, OpenGL ES 1.1, and OpenGL ES 2.0 is
not a sane abstraction, since all of them share glapi for current
context/dispatch management.
2010-09-10 15:37:43 +08:00
Dave Airlie
fcae8ca575 r600g: fixup state calculations for picking states.
for evergreen I ended up using a non-contig array of states, but
this code needs a bit of fixing up to deal with that.
2010-09-10 22:41:00 +10:00
Dave Airlie
f61b241eba r600g: fixup CB state numbering header 2010-09-10 21:59:06 +10:00
Dave Airlie
cc1b3b1013 r600g: fix warning in r600 pipe driver 2010-09-10 14:07:49 +10:00
Dave Airlie
ad5ada4372 r600g: evergreen CBs are more sane to support with a single state 2010-09-10 13:52:02 +10:00
Dave Airlie
7d564fdddd r600g: add multi-buffer flush support properly. 2010-09-10 13:52:02 +10:00
Dave Airlie
ab686d340a r600g: fix regression in multi-buffer tests since CB flush merge 2010-09-10 13:52:02 +10:00
Eric Anholt
6ef5f21234 i965: Add switch cases for ir_unop_noise, which should have been lowered.
Fixes compiler warnings.
2010-09-09 19:49:58 -07:00
Dave Airlie
50526e094f r600g: add initial evergreen support
adds shader opcodes + assembler support (except ARL)
uses constant buffers
add interp instructions in fragment shader
adds all evergreen hw states
adds evergreen pm4 support.

this runs gears for me on my evergreen
2010-09-10 19:41:18 +10:00
Dave Airlie
42da027433 r600g: align flushing of cb/db with DDX/r600c.
the DDX and r600c both flush cb/db after the draw is emitted,
as long as they do that, r600g can't be different, as it races.

We end up with r600g flush, set CB, DDX set CB, flush. This
was causing misrendering on my evergreen, where sometimes the drawing
would go to an old CB.
2010-09-10 11:29:23 +10:00
Dave Airlie
e795ca8f31 r600g: don't need 3 bos here.
the code should reloc correctly a single BO 3 times.
2010-09-10 11:29:23 +10:00
Brian Paul
48fda8c446 graw: added test for finding shader mem leaks 2010-09-09 19:19:28 -06:00
Brian Paul
451dfe5413 draw: minor reformatting 2010-09-09 19:19:28 -06:00
Brian Paul
821e390018 graw: emit warnings when context/surface creation failes 2010-09-09 19:19:28 -06:00
Brian Paul
5c3f678790 winsys: emit warning in null_sw_displaytarget_create() 2010-09-09 19:19:28 -06:00
Brian Paul
d851dae919 graw: fix array size, indentation, 2010-09-09 19:19:28 -06:00
Jakob Bornecrantz
379e2e77ba glsl2: Fix scons build for all platforms 2010-09-10 01:17:56 +02:00
Kristian Høgsberg
042a333028 Revert "glapi: Implement optional dispatch logging"
This reverts commit b9abc6139a and the
follow on fixes (7aae704 and 6fe1b47).  It's changing the glapi/driver
ABI and causes a number of problems for debug/non-debug builds.
2010-09-09 19:02:55 -04:00
Ian Romanick
1f3c7d968c glsl2: Implement noise[1234] built-in functions using ir_unop_noise 2010-09-09 15:39:52 -07:00
Ian Romanick
2b70dbfe09 glsl2: Add EmitNoNoise flag, use it to remove noise opcodes 2010-09-09 15:39:52 -07:00
Ian Romanick
547131ac87 glsl2: Add lowering pass to remove noise opcodes 2010-09-09 15:39:51 -07:00
Ian Romanick
3a5ce85cfa glsl2: Add ir_unop_noise 2010-09-09 15:39:51 -07:00
Kenneth Graunke
6dcca5a308 glsl/builtins: normalize of a negative scalar should be -1.0. 2010-09-09 15:23:12 -07:00
Kristian Høgsberg
6fe1b479ca mesa: Only reference logging symbols in debug builds 2010-09-09 18:00:44 -04:00
Kristian Høgsberg
144356f992 mesa: Don't reuse DummyFramebuffer as the incomplete framebuffer
Binding framebuffer 0 on a context that doesn't have a winsys drawable
will try to bind the incomplete framebuffer.  That fails when that's
also the dummy framebuffer.
2010-09-09 17:08:12 -04:00
Jakob Bornecrantz
7aae70406b glapi: Fix non-debug builds 2010-09-09 22:47:42 +02:00
ben
1d61793824 st/dri: support EGL_MESA_image_drm: queryImage
Signed-off-by: Jakob Bornecrantz <wallbraker@gmail.com>
2010-09-09 22:47:38 +02:00
ben
a572e3198d st/dri: support EGL_MESA_image_drm: createImage
Signed-off-by: Jakob Bornecrantz <wallbraker@gmail.com>
2010-09-09 22:47:31 +02:00
Kristian Høgsberg
6eda3f311b eglglx: Convert glx visuals/fbconfigs straight to EGL configs
In other words, skip the __GLcontextModes middle man.
2010-09-09 15:00:18 -04:00
Kristian Høgsberg
01a7eebc4c egl: Remove old egldri driver
This driver doesn't work with any of the DRI drivers in the source tree.
2010-09-09 14:05:30 -04:00
Christoph Bumiller
6997da9f3c nv50: fix can_load check for 3rd source 2010-09-09 19:21:35 +02:00
Christoph Bumiller
6b14a3eb19 nv50: address regs are 16 bit 2010-09-09 19:21:34 +02:00
Christoph Bumiller
246ebd7df1 nv50: duplicate interps in load_proj_tex_coords
Otherwise we might clobber the origin interpolation result or
use the result of the RCP before its definition.
2010-09-09 19:21:34 +02:00
Christoph Bumiller
9cc80e25db nv50: create value references with the right type
Since atm our OPs aren't typed but instead values are, we need to
take care if they're used as different types (e.g. a load makes a
value u32 by default).

Maybe this should be changed (also to match TGSI), but it should
work as well if done properly.
2010-09-09 19:21:34 +02:00
Christoph Bumiller
f30810cb68 nv50: use actual loads/stores if TEMPs are accessed indirectly 2010-09-09 19:21:34 +02:00
Christoph Bumiller
d8dcff7970 nv50: don't parse again in tgsi_2_nc 2010-09-09 19:21:34 +02:00
Christoph Bumiller
d91b8865ec nv50: prepare for having multiple functions
At some point we'll want to support real subroutines instead of
just inlining them into the main shader.

Since recursive calls are forbidden, we can just save all used
registers to a fixed local memory region and restore them on a
return, no need for a stack pointer.
2010-09-09 19:21:34 +02:00
Christoph Bumiller
217542a061 nv50: save tgsi instructions 2010-09-09 19:21:34 +02:00
Kristian Høgsberg
b9abc6139a glapi: Implement optional dispatch logging
There's a useful feature buried in glapi to log all API calls to stderr.
Unfortunately it requires editing the code and then it's enabled
unconditionally for that build.  This patch builds in API logging for
debug builds and makes it run-time switchable by setting MESA_DEBUG=dispatch.
2010-09-09 13:21:15 -04:00
Kristian Høgsberg
94118fe2d4 glx: Optimize out no-op make current calls
This make a lot more sense now that we might have to recreate the
glx drawables for legacy code paths.
2010-09-09 13:18:43 -04:00
Chia-I Wu
916c8ed2c8 egl: Use _EGL_CHECK_DISPLAY in eglCreateContext.
_EGL_CHECK_DISPLAY checks the display and returns from eglCreateContext
on error.
2010-09-10 00:18:23 +08:00
Chia-I Wu
08a482e7a9 egl: Display may be NULL in _eglLookup*.
This fixes several NULL dereferences.
2010-09-10 00:18:14 +08:00
Brian Paul
3ec296390c llvmpipe: remove redundant tgsi_dup_tokens() call
We were calling this twice so the first allocation was orphaned/leaked.
2010-09-09 10:04:39 -06:00
Francisco Jerez
cdd5f21eac dri/nouveau: Expose EXT_texture_env_combine. 2010-09-09 14:19:36 +02:00
Francisco Jerez
3bbad7f108 dri/nv10-nv20: Add support for NV_texture_env_combine4. 2010-09-09 14:19:35 +02:00
Francisco Jerez
699749cfee dri/nv04: Add support for NV_texture_env_combine4. 2010-09-09 14:19:35 +02:00
Francisco Jerez
a76f6dc849 dri/nouveau: Minor cleanup. 2010-09-09 14:19:35 +02:00
Kristian Høgsberg
80e48ddcf6 glx: Fix another use-after-free problem 2010-09-09 08:06:51 -04:00
Andre Maasikas
777f352e60 r600: add TXL instruction and note about TXB 2010-09-09 11:08:11 +03:00
Andre Maasikas
1f12945d2f r600: remove depth exports move, just set to output x <- z in the export intruction 2010-09-09 11:08:11 +03:00
Andre Maasikas
7753416c5b r600: protect cleanup instructions from double free
We might get the cleanup when we have not translated the shader yet
e.g 2 programstringnotifys in a row
2010-09-09 11:08:11 +03:00
Andre Maasikas
5697bf1660 r600: remove mask from output intructions
in case of relative addressing we never get to know which comps
were really written.
2010-09-09 11:08:11 +03:00
Andre Maasikas
ae21956be2 r600: allow relative addressing of temps, inputs, outputs 2010-09-09 11:08:10 +03:00
Andre Maasikas
515d6eed0b r600: handle LIT writemask 2010-09-09 11:08:10 +03:00
Andre Maasikas
9d0d78ad3f r600: fix rsq from negative input
arbfp specifies rsq of abs value
2010-09-09 11:08:10 +03:00
Chia-I Wu
68071822f7 docs: Update egl.html.
Mention that EGL_DRIVERS_PATH should be specified for uninstalled build.
Update TODOs.
2010-09-09 13:53:13 +08:00
Luca Barbieri
e591c4625c glsl: add several EmitNo* options, and MaxUnrollIterations
This increases the chance that GLSL programs will actually work.

Note that continues and returns are not yet lowered, so linking
will just fail if not supported.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2010-09-08 20:36:37 -07:00
Luca Barbieri
6d3a2c97f4 glsl: make compiler options per-target
This allows us to specify different options, especially useful for chips
without unified shaders.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2010-09-08 20:36:37 -07:00
Luca Barbieri
ede4205b24 mesa: add PIPE_SHADER_* like constants and conversions to/from enums (v2)
Changes in v2:
- No longer adds tessellation enums
2010-09-08 20:36:37 -07:00
Eric Anholt
5ecd9c70ce glsl: Add info about talloc and optimization passes to the README. 2010-09-08 18:09:05 -07:00
Eric Anholt
e04f90712d glsl: Update README talking about multi-instruction operations.
The previous thing taking multiple instructions ended up being handled
at the IR level, as we suggested would be the common result.  Pick a
new one.
2010-09-08 18:05:22 -07:00
Kristian Høgsberg
d8ab9aac54 glx: Destroy pixmap after destroying glx and dri drawables
Now that we suppress BadDrawable from DRI2DestroyDrawable, this doesn't
matter, but we would get that error before when destroying pbuffers.
2010-09-08 20:55:24 -04:00
Kristian Høgsberg
7b34fcc487 configure: Enable -fvisibility=hidden for g++ as well 2010-09-08 20:45:07 -04:00
Kenneth Graunke
7fc882643c glsl/builtins: Set the API in the fake context.
Otherwise it gets used uninitialized.
2010-09-08 17:38:42 -07:00
Ian Romanick
f69a6647fb glsl2: Clear out profile pointers in _mesa_glsl_release_functions
Otherwise builtin_profiles contains dangling pointers the next time
_mesa_read_profile is called.  I suspect this may fix bugzilla #29847,
but I was never able to reproduce it.
2010-09-08 17:16:49 -07:00
Ian Romanick
de1ffd2f62 mesa: Refactor parameter processing in set_combiner_(operand|source)
The enum values were chosen to have sequential values for a reason.
Use that to compact and simplify the code.
2010-09-08 16:26:15 -07:00
Ian Romanick
1a2d498b41 mesa: Fix handling of texenv operands for EXT vs ARB version
GL_EXT_texture_env_combine has slightly more restrictive limits on the
valid sources for some operands.  This wasn't caught before because
almost every driver in Mesa that supports the EXT version also
supports the ARB version.

Inspired by a patch posted the the mesa-dev mailing list by Andrew
Randrianasulu.
2010-09-08 16:26:07 -07:00
Kristian Høgsberg
f24ec6367b glx: Ignore DRI2 event for drawables we've destroyed
Since we now actually destroy GLX drawables, we get into situations where
we get events for drawables that no longer exist.  Just ignore the
event in that case.
2010-09-08 18:54:48 -04:00
Kristian Høgsberg
659dab6be6 glx: Fix use after free problem 2010-09-08 18:54:48 -04:00
Kenneth Graunke
fc1daab2a2 glsl: Fix for scalar float built-in definitions.
These need abs, and we need more tests.
2010-09-08 15:38:09 -07:00
Eric Anholt
c3db43df04 glsl: regenerate builtins 2010-09-08 15:01:02 -07:00
Eric Anholt
aa973d3533 glsl: Fix typo in builtin step() using a wrong channel. 2010-09-08 14:54:08 -07:00
Kenneth Graunke
368dc76f04 ir_validate: Ensure ir_binop_dot is only used on vector types. 2010-09-08 12:09:42 -07:00
Kenneth Graunke
4b2ffa0a42 glsl: Refresh automatically generated file builtin_function.cpp. 2010-09-08 12:09:42 -07:00
Kenneth Graunke
1f7e6e1e72 glsl/builtins: Don't use ir_binop_dot on floating point values.
ir_binop_dot is only defined for vector types.  Use ir_binop_mul.
2010-09-08 12:09:41 -07:00
Kenneth Graunke
84160a0454 glsl/builtins: Simplify degenerate scalar float cases.
The code being generated was just stupid, considering that:
- normalize(x) = 1.0
- length(x) = x
- distance(x, y) = x - y
2010-09-08 12:09:41 -07:00
Ian Romanick
961f42c9bd glsl2: Make sure _mesa_glsl_parse_state constructor gets a context
Fix an major regression in dc754586.  Too bad that change was
obviously never tested.
2010-09-08 11:34:22 -07:00
Kristian Høgsberg
16887d042a glx: Drop broken drawable garbage collection
Doesn't work for pixmaps, was looking up the GLX XID and was never thread
safe.  Instead, just destroy the client side structures when the
drawable is no long current for a context.
2010-09-08 09:20:42 -04:00
Kristian Høgsberg
b4bb668020 dri: Unset current context and dispatch table when unbinding
Otherwise, when we switch to an indirect glx context and then back, it looks
like we're still current.

https://bugs.freedesktop.org/show_bug.cgi?id=29977#c7
Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
2010-09-08 09:01:43 -04:00
Chia-I Wu
1a5b32ca01 glsl: Support GLSL ES in the standalone compile.
GLSL ES mode is enabled when --glsl-es is passed to glsl_compiler.
2010-09-08 04:08:29 -07:00
Chia-I Wu
dc754586ca glsl: Require a context in _mesa_glsl_parse_state.
Create a dummy context in the standalone compiler and pass it to
_mesa_glsl_parse_state.
2010-09-08 04:08:24 -07:00
Chia-I Wu
7e03e2b2c7 st/dri: Call dri_init_extensions only for API_OPENGL.
libmesagallium.a that this state tracker will be linked to expects
OpenGL's _glapi_table.  That is, it expects libGL.so instead of
libGLESv1_CM.so or libGLESv2.so.  As there is no clean way to know the
shared library the app links to, use the api as a simple check.  It
might be as well to simply remove this function call though.
2010-09-08 18:21:19 +08:00
Chia-I Wu
444d8408e7 st/dri: Use enum st_api_type internally. 2010-09-08 18:20:44 +08:00
nobled
8e3b658b7f st/dri: Add multi-api support
Make st/dri screens capable of creating OpenGL ES and
OpenGL ES2 contexts.

TODO: Figure out the "get_current" problem with multiple
st_api's for real.

(s/API_OPENGLES1/API_OPENGLES/ by Chia-I Wu)
2010-09-08 17:25:01 +08:00
nobled
ecd7ec9d62 st/dri: Make clear which API's are supported
If the caller requests a GLES context, don't silently create
a desktop GL context in its place.
2010-09-08 12:55:26 +08:00
Dave Airlie
bf346f065c r600g: add initial bank swizzle support.
this is ported from r600c mostly, bank swizzling is real messy and I don't think
I got enough sleep last night to fully understand it.
2010-09-08 14:12:21 +10:00
Kenneth Graunke
48e789d71e glcpp: Fix build on non-GCC compilers. 2010-09-07 18:01:33 -07:00
Kenneth Graunke
10eaa8bcbc ast_to_hir: Mark arrays as lvalues in GLSL ES, but prohibit assignment.
This allows them to be passed as out/inout parameters, but still
prevents them from being used as the target of an assignment.  This is
per section 5.8 of the GLSL ES 1.00 specification.
2010-09-07 17:30:39 -07:00
Kenneth Graunke
a98d5a5ac8 glsl: Allow overloading of built-ins without hiding in GLSL ES.
The rules are explicitly different from desktop GLSL.
2010-09-07 17:30:39 -07:00
Kenneth Graunke
f412fac5b4 glsl: Move is_builtin flag back to ir_function_signature.
This effectively reverts b6f15869b3.

In desktop GLSL, defining a function with the same name as a built-in
hides that built-in function completely, so there would never be
built-in and user function signatures in the same ir_function.

However, in GLSL ES, overloading built-ins is allowed, and does not
hide the built-in signatures - so we're back to needing this.
2010-09-07 17:30:38 -07:00
Kenneth Graunke
c98deb18d5 ast_to_hir: Reject embedded structure definitions in GLSL ES 1.00. 2010-09-07 17:30:38 -07:00
Kenneth Graunke
d8e34e29eb ast_to_hir: Reject unsized array declarations in GLSL ES 1.00. 2010-09-07 17:30:38 -07:00
Kenneth Graunke
b4ec3f268c ast_to_hir: Allow matrix-from-matrix constructors in GLSL ES.
Everything but 1.10 supports this, so just change the check to ==.
2010-09-07 17:30:38 -07:00
Kenneth Graunke
883ac22810 i965: Enable EXT_framebuffer_blit internally.
Otherwise, ES2's BindFramebuffer entrypoint hits this assertion:
main/fbobject.c:1323: _mesa_BindFramebufferEXT: Assertion
`ctx->Extensions.EXT_framebuffer_blit' failed.
2010-09-07 17:30:38 -07:00
Kenneth Graunke
67da41c10c mesa: Enable GL_MAX_VERTEX_ATTRIBS in ES2.
Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2010-09-07 17:30:38 -07:00
Kenneth Graunke
5a81d057db linker: Fix assertion and cross-version checks for version 100.
Fixes an assert (min_version >= 110) which was no longer correct, and
also prohibits linking ES2 shaders with non-ES2 shaders.  I'm not
positive this is correct, but the specification doesn't seem to say.
2010-09-07 17:30:38 -07:00
Kenneth Graunke
116dc670e9 glsl: Add built-in function profiles for GLSL ES 1.00. 2010-09-07 17:30:38 -07:00
Kenneth Graunke
b4fe4d52b6 glsl: Add built-in variables for GLSL ES 1.00. 2010-09-07 17:30:38 -07:00
Kenneth Graunke
76deef138e glsl: Split out types that are in 1.10 but not GLSL ES 1.00. 2010-09-07 17:30:37 -07:00
Kenneth Graunke
c5e74871d9 glsl: Recognize GLSL ES 1.00 keywords. 2010-09-07 17:30:37 -07:00
Kenneth Graunke
7dcfc44b72 glsl: Define GL_ES preprocessor macro if API is OpenGL ES 2.0.
Also define it if #version 100 is encountered.
2010-09-07 17:30:37 -07:00
Kenneth Graunke
719caa403e glsl: Accept language version 100 and make it the default on ES2. 2010-09-07 17:30:37 -07:00
Kenneth Graunke
814c89abdb glsl: Set default language version in mesa_glsl_parse_state constructor.
This should make it easier to change the default version based on the
API (say, version 1.00 for OpenGL ES).

Also, synchronize the symbol table's version with the parse state's
version just before doing AST-to-HIR.  This way, it will be set when
it matters, but the main initialization code doesn't have to care about
the symbol table.
2010-09-07 17:30:37 -07:00
Eric Anholt
4a867be143 ir_to_mesa: Add support for gl_NormalScale.
Bug #30040.
2010-09-07 16:43:35 -07:00
Kenneth Graunke
a09a8ec12d glsl: Make sure shader source isn't NULL.
This should only occur if glCompileShader is called without a prior call
to glShaderSource.  An empty source program should be the empty string.
2010-09-07 16:25:53 -07:00
Tilman Sauerbeck
1e28dd4ebe r600g: Added missing r600_bc_add_literal() calls to XPD implementation.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-09-08 09:10:46 +10:00
Tilman Sauerbeck
460c5304ab r600g: Added preliminary support for the LOG opcode.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-09-08 09:10:07 +10:00
Tilman Sauerbeck
42c966bc49 r600g: Added missing abs-ification to RSQ.
This makes the 'fp1-RSQ test 2' piglit test work.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-09-08 09:07:02 +10:00
Dave Airlie
a3a94554f5 r600g: split opcodes out and add wrapper around usage.
This splits the r600 opcodes out of the sq file and adds a wrapper
so we can convert to evergreen opcodes later without touching these functions
too much.
2010-09-08 08:49:00 +10:00
Dave Airlie
d42efb9e8d r600g: add support for constants in memory buffers.
DX9 constants were in the constant file, and evergreen no longer support
cfile. r600/700 can also use constants in memory buffers, so add the code
(disabled for now) to enable that as precursor for evergreen.
2010-09-08 08:41:57 +10:00
Dave Airlie
9ef1c51be1 r600g: abstract the hw states out behind a vtbl.
this is step one towards evergreen support, it lets us plug in whole
new hw level states.
2010-09-08 08:30:59 +10:00
Ian Romanick
f09fabc448 glsl2: Forbid array-types in ?: operator in GLSL 1.10
Fixes bugzilla #30039.
2010-09-07 14:33:29 -07:00
Eric Anholt
50a3349bee mesa: Set the base format of GL_ALPHA FBOs and teach swrast about it.
Fixes assertion failures in fbo-alpha with a debug build of Mesa.
Bug #29781.
2010-09-07 14:34:23 -07:00
Eric Anholt
acd7c21541 ir_to_mesa: Fix warning in last commit.
I swear there was some git option for "don't push things when you've
got uncommitted changes", but I can't find it now.
2010-09-07 14:26:53 -07:00
Eric Anholt
6c0ba32fd1 ir_to_mesa: Move the STATE_VAR elements of a builtin uniform to a temp (v2).
Like the constant handling and the handling of other uniforms, we add
the whole thing to the Parameters, avoiding messy, incomplete logic
for adding just the elements of a builting uniform that get used.
This means that a driver that relies only on ParameterValues[] for its
parameters will have an increased parameter load, but drivers
generally don't do that (since they have other params they need to
handle, too).

Fixes glsl-fs-statevar-call (testcase for Ember).  Bug #29687.

v2: Continue referencing the STATE_VAR[] file directly when the
uniform will land in STATE_VAR[] formatted exactly as we'd put into a
temporary.  When there's array dereferencing, we don't copy-propagate
in Mesa IR (not knowing where the array is in register space), so
smarts here are required or we'll massively increase the temp count.
2010-09-07 13:59:29 -07:00
Ian Romanick
956f049fd2 glsl2: Early return with visit_continue in loop_analysis::visit(ir_dereference_variable *)
Returning early with visit_continue_with_parent prevented the
then-statements and else-statements of if-statements such as the
following from being processed:

	  if (some_var) { ... } else { ... }

Fixes piglit test case glsl-fs-loop-nested-if and bugzilla #30030.
2010-09-07 13:36:32 -07:00
Kenneth Graunke
0427228bbc glsl: Change grammar rules for selection statements to match the spec.
Fixes piglit test case loop-06.vert.

Unfortunately, causes 1 shift/reduce conflict.
2010-09-07 13:17:05 -07:00
Eric Anholt
24c12e6c7f i965: Store the byte address in the VS constant buffer as an integer.
We carefully multiplied our two ints (since we want to be precise
after all) then stored them in a float, which is not specced to really
work, in addition to wasting precision.  Fixes
vp-arl-constant-array-huge-* things since the assertions were added.
2010-09-07 13:00:22 -07:00
Eric Anholt
32b84ef4ca i965: Make pixel_xy results UW.
There is a restriction on the destination of an operation involving a
vector immediate being 128-bit aligned and the destination horizontal
stride being equivalent to 2 bytes.  Fixes bad pixel_x results from
gl_FragCoord, where each pair had the same value.
2010-09-07 13:00:22 -07:00
Török Edvin
c47b289972 glsl2: check for _NumLinkedShaders being 0
Otherwise spring 0.82+.4.0 crashes when starting a game
because prog->_LinkedShaders[0] is NULL.

This also fixes piglit test cases glsl-link-empty-prog-0[12].
2010-09-07 12:27:07 -07:00
Kristian Høgsberg
3ea3f5e0a5 glx: Set an all NULL vtable for dummyContext
This reverts 6a6e6d7b0a and initializes
dummyContext with an all NULL vtable.  The context vtable pointer is
supposed to always be non-NULL, but the vtable entries can be NULL.
2010-09-07 14:32:28 -04:00
Kristian Høgsberg
57d3f71132 glx: Fix compilation with out xf86vidmode 2010-09-07 14:24:25 -04:00
Kristian Høgsberg
f84d8fab99 glx: Use GLX_BufferSwapComplete unconditionally, we require glproto 1.4.11 2010-09-07 14:24:25 -04:00
Michel Dänzer
6a6e6d7b0a Fix crashes when some GLX API entrypoints are called with no current context.
I was hitting this with gliv.

The GLX spec explicitly mentions that glXWaitX, glXWaitGL and glXUseXFont calls
are ignored when there's no current context. Not sure what if anything the
GLX_EXT_texture_from_pixmap spec says about this, but I think ignoring the
calls makes more sense than crashing there as well. :)
2010-09-07 19:54:16 +02:00
Eric Anholt
5afdfa222f i965: Don't bother with RNDZ for f2i.
The default type conversion for MOV should be fine, and RNDZ actually
requires two instructions.
2010-09-07 10:34:10 -07:00
Eric Anholt
a560a509fa i965: Add some validation on BRW_OPCODE_MUL and ADD's arguments.
Now that we're playing with other types in brw_fs.cpp, it's easy to
trip over issues like these.
2010-09-07 10:34:10 -07:00
Eric Anholt
0002069fd5 i965: Add assertion for another requirement about types.
This catches a failure in the FS backend.
2010-09-07 10:34:09 -07:00
Eric Anholt
3fb5377ba5 i965: Align the start of attribute interp coefficients in FS to use PLN. 2010-09-07 10:34:09 -07:00
Eric Anholt
3dbc9ea0a3 i965: Just assert when we flagged a compile error in the FS for now.
Dumping back to potentially 16-wide dispatch doesn't really work out
at the moment, and hopefully I'll just be able to resolve all the
failures so we never have to do this at all.
2010-09-07 10:34:09 -07:00
Eric Anholt
42fc60cadc i965: Clean up fs_reg setup by using a helper for constructors. 2010-09-07 10:34:09 -07:00
Eric Anholt
b157113e73 i965: When using the new FS backend, don't validate the Mesa IR version. 2010-09-07 10:34:09 -07:00
Eric Anholt
5c77792859 i965: Add a bit of validation for some ISA restrictions in the docs. 2010-09-07 10:34:09 -07:00
Eric Anholt
e432fe09dd i965: set the source width/stride when handling reladdr dests in the VS.
This is a requirement specified in the docs.  No behavior change in
glsl-vs-varying-array.shader_test that violated these requirements.
2010-09-07 10:34:09 -07:00
Jon TURNEY
2b9dac397b Make XF86VIDMODE extension optional
Code in glx/glxcmds.c which uses the XF86VIDMODE extension is already guarded.  Also use
that guard to control inclusion of the xf86vmode.h header, and only enable that guard if the
XF86VIDMODE extension is found by pkgconfig.

This changes the behaviour on platforms which XF86VIDMODE exists, in that XF86VIDMODE used to
be mandatory, but is now optional.

Presumably other build systems are already arranging for -DXF86VIDMODE to be supplied to the
complier when glxcmds.c is compiled, so are not affected by this change

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2010-09-07 13:30:19 -04:00
Kristian Høgsberg
dd2658d0ac glx: Drop unused dri2proto.h include 2010-09-07 13:30:12 -04:00
Kristian Høgsberg
60fce15447 glx: Move dpy and scr fields out of direct rendering conditional
Nothing direct rendering specific about these fields.  Moving them out
makes no-direct-rendering compilation work again.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
2010-09-07 12:41:09 -04:00
Jon TURNEY
ae9487c299 Some fixes for GLX_INDIRECT_RENDERING only build
This fixes some of the build issues with GLX_INDIRECT_RENDERING but !GLX_DIRECT_RENDERING due to recent changes.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
2010-09-07 12:33:11 -04:00
nobled
6561a64a69 dri: Make it a little clearer that we're not dereferencing a NULL pointer 2010-09-07 12:26:33 -04:00
nobled
1b8c9fef11 dri: Use the right type for the API token
Pass mesa_api to CreateContext, and abort early
if the requested API isn't recognized.
2010-09-07 12:26:33 -04:00
Chia-I Wu
28c790ab31 libgl-xlib: Fix --enable-gallium-llvm build.
Check MESA_LLVM and link to LLVM as other targets do.
2010-09-07 23:54:25 +08:00
Chia-I Wu
d5c5a5aea0 llvmpipe: Add lp_rast_debug.c to Makefile. 2010-09-07 23:04:43 +08:00
Jon TURNEY
23e2dec1a1 glx: Only clear the stored context tag when the context has been unbound
The calling order of ->bind and ->unbind changed and then ->unbind would
clear the currentContextTag of the old context before ->bind could reuse
it in the make current request, in the indirect case.

Instead, clear the old currentContextTag if and only if we send a request
to the server to actually unbind it or reassign it to another context.

https://bugs.freedesktop.org/show_bug.cgi?id=29977

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
2010-09-07 09:07:23 -04:00
José Fonseca
a7c4541d27 llvmpipe: Refactor lp_scene_add_resource_reference
Less goto spaghetti.
2010-09-07 14:02:29 +01:00
José Fonseca
9cd45b8edf llvmpipe: Fix negated logic in lp_scene_add_resource_reference().
Fixes performance regression.
2010-09-07 14:02:29 +01:00
Keith Whitwell
9df8a7565d llvmpipe: move more coef setup into lp_setup_coef.c 2010-09-07 14:02:29 +01:00
Keith Whitwell
afba373cb1 llvmpipe: declare fence handle struct 2010-09-07 14:02:29 +01:00
Keith Whitwell
f25836d7b2 llvmpipe: rasterization debugging helpers 2010-09-07 14:02:29 +01:00
Keith Whitwell
9f6e8e1d6b llvmpipe: use opcodes instead of function pointers in bins
Also, move some state from rasterizer struct to the scene.
2010-09-07 14:02:15 +01:00
Keith Whitwell
040e59851a llvmpipe: rearrange queries 2010-09-07 14:01:50 +01:00
Keith Whitwell
6419ecd02c llvmpipe: enforce fixed memory limit on scenes 2010-09-07 14:01:43 +01:00
Keith Whitwell
c512ba88a7 llvmpipe: clean up deferred zstencil clears 2010-09-07 13:22:55 +01:00
Keith Whitwell
18452c1e87 llvmpipe: rework fences and queries 2010-09-07 13:22:55 +01:00
Keith Whitwell
5024d9b90e llvmpipe: move whole-tile emit into a function 2010-09-07 13:22:55 +01:00
Keith Whitwell
71e27ef21c llvmpipe: put fs variant dumping in a function 2010-09-07 13:22:54 +01:00
Tilman Sauerbeck
98e277111b Replace reference to tgsi-instruction-set.txt.
That file has been replaced by tgsi.rst.

Signed-off-by: José Fonseca <jfonseca@vmware.com>
2010-09-07 09:48:22 +01:00
Luca Barbieri
4a730b773f nouveau: restore nouveau_class.h for nv04-nv20
Sorry, I deleted the Gallium copy without realizing that the DRI
one was just a symlink to it.
2010-09-07 08:22:43 +02:00
Luca Barbieri
09782c727d nvfx: fix return in vp main 2010-09-06 18:08:36 +02:00
José Fonseca
079c884060 mesa: Define C99's __func__ macro on MSVC. 2010-09-06 13:57:44 +01:00
Dave Airlie
35e01b79cb r600g: add error print for no literals for r700s as well 2010-09-06 10:38:29 +10:00
Dave Airlie
2caf6f5e84 r600g: fixup r700 assembler for clamp/relative addressing 2010-09-06 10:35:51 +10:00
Dave Airlie
48cdad70d9 r600g: add script to generate header file with offsets into state objects.
This was inherently fragile as any changes to r600_states.h would also
need manual updating of all of the bits in radeon.h. Just add a simple
python script to do the conversion, its not hooked up to make at all.

This also will make adding evergreen a bit easier.
2010-09-06 10:28:08 +10:00
Dave Airlie
5b82777311 r600g: fix up surface references
We end up referencing the new surf and derefing the old surface which
is a copy of the pointer to the new surf. So just bump the ref count directly.
2010-09-06 09:15:42 +10:00
Dave Airlie
3a672785df r600g: search for sampler views in context on removal.
Need to remove from context as well.
2010-09-06 09:15:42 +10:00
Dave Airlie
6ec0fff822 r600g: add missing printf operand 2010-09-06 09:15:41 +10:00
Luca Barbieri
357a7e90df nvfx: support nv30 simulation on nv40 2010-09-05 23:41:33 +02:00
Henri Verbeet
d8bba2ef69 radeon: Add radeon_buffer_objects.c. 2010-09-05 22:42:12 +02:00
Henri Verbeet
7d4f352586 r200: Add radeon_buffer_objects.c. 2010-09-05 21:58:20 +02:00
Henri Verbeet
50b9c54ef6 radeon: Make do_blit_readpixels() into a PBO work. 2010-09-05 20:26:14 +02:00
Luca Barbieri
029c181571 mesa: don't smash the stack in _mesa_find_used_registers
At some point this actually triggered, not sure if it still does.

Give a meaningful assert and refuse to smash the stack anyway.
2010-09-05 17:57:12 +02:00
Luca Barbieri
9a77d0471a mesa: don't expose unsupported GL_ARB_geometry_shader4 for now
The new GLSL compiler doesn't support it.

Advertising it prevents Unigine Heaven from working, since it attempts to
use it.
2010-09-05 17:53:16 +02:00
Luca Barbieri
beb3d030a1 nouveau: delete nouveau_class.h, move nv50 regs to nv50_reg.h
nv50 should switch to rules-ng-ng too at some point.

The classic Mesa Nouveau driver also includes a copy of nouveau_class.h,
and should convert to rules-ng-ng too and remove it.
2010-09-05 17:52:26 +02:00
Luca Barbieri
7d53a3b7a4 nvfx: move nv04_2d to rules-ng-ng 2010-09-05 17:52:26 +02:00
Luca Barbieri
d46c5ce7b6 nvfx: switch to rules-ng-ng register headers
This is the new register generation toolkit in use by nouveau.

As far as I know, this is the best register description toolkit in
existence, and you should use it too for your hardware :)

Thanks to Marcin Kościelnicki for inventing it and performing
invaluable reverse engineering work of nVidia chips.
2010-09-05 17:52:26 +02:00
Luca Barbieri
3bca263a92 nvfx: remove remaining BEGIN_RING/eng3d uses 2010-09-05 17:52:26 +02:00
Luca Barbieri
49b493ddd0 nvfx: pause occlusion queries during blitter usage
Thanks for Dave Airlie and Jerome Glisse for their code which made
me realize I need this too.
2010-09-05 17:52:26 +02:00
Luca Barbieri
14d5805235 nvfx: properly return fogcoord.w == 1
Hardware sets it to 0, so we add an ADD to put an 1 there if the
application really wants the alpha channel.
2010-09-05 17:52:25 +02:00
Luca Barbieri
76f696b1f6 nvfx: support saturate in vp
Completely untested, since Mesa apparently never uses this currently.

In particular, it might not work with scalar slot op.
2010-09-05 17:52:25 +02:00
Luca Barbieri
8e2badfc26 nvfx: add rewritten swtnl support
The old swtnl code was broken by the new shader linkage support for
GLSL.

This is a rewrite of swtnl support, which should instead work properly,
be faster and more closer to the much more tested hardware pipeline.
2010-09-05 17:52:25 +02:00
Luca Barbieri
43cfc1ed8e nvfx: use a piglit-ignored format for unknown cap message 2010-09-05 17:52:25 +02:00
José Fonseca
7d45bf8762 llvmpipe: Remove some broken MinGW hacks in the sin/cos reference code. 2010-09-05 10:40:38 +01:00
José Fonseca
1c009f970e glsl: Add new files to sconscript. 2010-09-05 10:17:51 +01:00
José Fonseca
d278ddc009 llvmpipe: Fix perspective divide interpolation.
Intuition != mathematics, so this time I actually worked out the right
formula for first order approximation of perspective interpolation.

Ironically, per quad divide actually makes things slower when compared
with per pixel divide -- probably because the divide hardware unit is
rarely used, whereas the multiply unit is typically already saturated
and the first order approximation imply more multiplications.
2010-09-05 10:17:51 +01:00
José Fonseca
b8684b2458 util: Helper function to determined whether two formats can be memcpy'ed.
These are the non-trivial conversions that this function recognizes,
which was produced by u_format_compatible_test.c:

  b8g8r8a8_unorm -> b8g8r8x8_unorm
  a8r8g8b8_unorm -> x8r8g8b8_unorm
  b5g5r5a1_unorm -> b5g5r5x1_unorm
  b4g4r4a4_unorm -> b4g4r4x4_unorm
  l8_unorm -> r8_unorm
  i8_unorm -> l8_unorm
  i8_unorm -> a8_unorm
  i8_unorm -> r8_unorm
  l16_unorm -> r16_unorm
  z24_unorm_s8_uscaled -> z24x8_unorm
  s8_uscaled_z24_unorm -> x8z24_unorm
  r8g8b8a8_unorm -> r8g8b8x8_unorm
  a8b8g8r8_srgb -> x8b8g8r8_srgb
  b8g8r8a8_srgb -> b8g8r8x8_srgb
  a8r8g8b8_srgb -> x8r8g8b8_srgb
  a8b8g8r8_unorm -> x8b8g8r8_unorm
  r10g10b10a2_uscaled -> r10g10b10x2_uscaled
  r10sg10sb10sa2u_norm -> r10g10b10x2_snorm

State trackers and pipe drivers should be updated to take advantage of
this knowledge, e.g., in surface_copy.
2010-09-05 10:17:51 +01:00
José Fonseca
00989d5bfc llvmpipe: Relax the colormask constraint on opaque.
Also, include the color buffer in the key. Not having it there
causes a tight knots in the logic to determine when it is OK or not
to discard previous color buffer contents.
2010-09-05 10:17:51 +01:00
José Fonseca
f25b6e546e util: Utility function to determine the channels that can be written in a color format. 2010-09-05 10:17:51 +01:00
José Fonseca
30c5d5d9d8 scons: Re-enable SSE on MinGW.
It seems to be working correctly with gcc 4.4, and enabling it allows to
test some of the llvmpipe instrinsics on Windows.
2010-09-05 10:17:51 +01:00
José Fonseca
6ed726b8fc gallivm: Pass condition masks as an unsigned bitmask.
Much more convenient than boolean arrays.
2010-09-05 10:17:51 +01:00
José Fonseca
079763f746 gallivm: Cope with tgsi instruction reallocation failure. 2010-09-05 10:17:51 +01:00
Kenneth Graunke
9a3df46fbc ir_reader: Only validate IR when a global 'debug' flag is set.
This extra validation is very useful when working on the built-ins, but
in general overkill - the results should stay the same unless the
built-ins or ir_validate have changed.

Also, validating all the built-in functions in every test case makes
piglit run unacceptably slow.
2010-09-05 01:57:37 -07:00
Marek Olšák
ece8490bb5 r300g,r300c: memset the compiler struct to zeros
This should fix bogus reports "Too many temporaries." and maybe some others.
2010-09-05 05:09:25 +02:00
Tom Stellard
7a212525a2 r300/compiler: Remove stray break statement
This fixes glsl-fs-loop-nested.
2010-09-04 17:27:55 -07:00
Luca Barbieri
c50b7e04eb nvfx: support unlimited constants and immediates in fp 2010-09-05 02:01:02 +02:00
Luca Barbieri
9fc50968ad nvfx: support using blitter to copy depth/stencil resources, fix Heaven
We might want to copy them as color ones though.

Also works around crash in Unigine Heaven due to failing to allocate
a 64 MB temporary in GART for a CPU copy.

Unigine Heaven now works on nv40, albeit with very heavy glitches (with
the floating branch with render_hdr 0).
2010-09-05 02:01:02 +02:00
Marek Olšák
6dc71d6aa5 r300/compiler: fix the instruction limit in vertex shaders
Broken with commit d774b0c710.

Reported by Chris Rankin.
2010-09-05 00:44:52 +02:00
Luca Barbieri
20bf5037d6 nvfx: support rendering to more formats 2010-09-04 22:45:21 +02:00
Luca Barbieri
25ecc9521d nvfx: move 2D format selection logic to 2D code 2010-09-04 22:45:21 +02:00
Luca Barbieri
5bd0e0adb1 nvfx: fix swizzling of high bpp surfaces 2010-09-04 22:45:21 +02:00
Luca Barbieri
2e6c65722a nvfx: fix some subrectangle copies
Actually, we may want to get rid of the x/y coordinates for linear
surfaces, and realign the origin from scratch if necessary, instead
of doing this "on-demand realignment".
2010-09-04 22:45:21 +02:00
Luca Barbieri
90d3291595 nvfx: fix inlinining in nv04_2d.c 2010-09-04 22:45:21 +02:00
Luca Barbieri
11d29739e1 nvfx: fix the temporary copying logic and add asserts 2010-09-04 22:45:21 +02:00
Luca Barbieri
f7392eb23a nvfx: prevent swizzled rendering into formats where it's not supported 2010-09-04 22:45:21 +02:00
Marek Olšák
280665be70 Revert "ir_to_mesa: Load all the STATE_VAR elements of a builtin uniform to a temp."
This reverts commit 5ad74779ce.

Sorry, but I had to revert this.

Any commit which needlessly increases the number of temporaries is wrong.
More temporaries mean less shader performance because of reduced parallelism
and therefore less efficient latency hiding. In this case, there is possible
performance degradation of every shader which uses GL state variables.
I cannot accept this.
2010-09-04 19:06:47 +02:00
Marek Olšák
cbf7e82786 Revert "r300g: refuse to create a texture with size 0"
This reverts commit 5cdedaaf29.

https://bugs.freedesktop.org/show_bug.cgi?id=30002

Conflicts:

	src/gallium/drivers/r300/r300_texture.c
2010-09-04 19:06:47 +02:00
Marek Olšák
6e64096190 r300g: remove unnecessary assignments 2010-09-04 19:06:47 +02:00
Marek Olšák
58471c801a r300/compiler: indent printed instructions according to the branch depth 2010-09-04 18:56:22 +02:00
Marek Olšák
d3ca8a4edd r300g: skip draw calls with no vertex elements, fixing hardlocks 2010-09-04 18:56:22 +02:00
Marek Olšák
d774b0c710 r300/compiler: use limits from the compiler input instead of inline constants 2010-09-04 18:56:22 +02:00
Marek Olšák
63943c8fcd r300/compiler: improve register allocation with indexable temporaries for VS
Register allocation can now reallocate temporaries right after the last indexed
source operand, instead of being disabled for the whole shader.
2010-09-04 18:56:22 +02:00
Marek Olšák
33360a707e r300/compiler: fix handling of indexed temporaries in peephole 2010-09-04 18:56:22 +02:00
Marek Olšák
aa554d508b r300/compiler: disable deadcode elimination for indexed dst operands 2010-09-04 18:56:22 +02:00
Marek Olšák
f90c870304 r300/compiler: allocate at least FS inputs if register allocation is disabled 2010-09-04 18:56:22 +02:00
Marek Olšák
cfc461fca6 r300g: add a new debug option which disables compiler optimizations
Those are:
- dead-code elimination
- constant folding
- peephole (mainly copy propagation)
- register allocation

There are some bugs which I need to track down.

Also fix up the descriptions of all the debug options.
2010-09-04 18:56:22 +02:00
Marek Olšák
d2f4ceaa47 r300/compiler: compute the final number of temporaries during translation
And not during the register allocation, which may be skipped for debugging
purposes. Also the predicate register is now added to the number of temps.
2010-09-04 18:56:21 +02:00
Marek Olšák
f46fd04136 r300/compiler: make optimizations not use 0.5 swizzles in vertex shaders 2010-09-04 18:56:21 +02:00
Marek Olšák
63eafaa8ec r300/compiler: use peephole and constant folding for vertex shaders too 2010-09-04 18:56:21 +02:00
Marek Olšák
f5609ff0d7 r300/compiler: remove unused enum OPCODE_REPL_ALPHA
We use RC_OPCODE_REPL_ALPHA instead.
2010-09-04 18:56:21 +02:00
Marek Olšák
fba5f6bda7 r300/compiler: refactor fragment shader compilation
This cleans up the mess in r3xx_compile_fragment_program.
2010-09-04 18:56:21 +02:00
Marek Olšák
3ba562e62a r300/compiler: add new compiler parameter max_constants 2010-09-04 18:56:21 +02:00
Marek Olšák
0b9f836147 r300/compiler: refactor vertex shader compilation
First list compiler passes in an array, then run the new function rc_run_compiler.
Every backend may need a different set of passes.
This cleans up the mess in r3xx_compile_vertex_program.
2010-09-04 18:56:21 +02:00
Marek Olšák
9a9aa7daa8 r300/compiler: remove a redundant parameter in rc_pair_regalloc 2010-09-04 18:56:21 +02:00
Marek Olšák
f0ae99252a r300/compiler: remove a redundant parameter in rc_dataflow_deadcode
&c->Base == c.
2010-09-04 18:56:21 +02:00
Marek Olšák
cc8f2d5599 r300/compiler: use null-terminated array of transformation functions
I need to reduce the number of parameters of each compiler pass function.
This is part of a larger cleanup.
2010-09-04 18:56:21 +02:00
Marek Olšák
56de72c78a r300g: only check for an empty shader if there are no compile errors 2010-09-04 18:56:20 +02:00
Marek Olšák
313e95f0c7 r300/compiler: add new compiler parameter max_alu_insts 2010-09-04 18:56:20 +02:00
Marek Olšák
a0fb406d9f r300/compiler: put emulate_loop_state in radeon_compiler 2010-09-04 18:56:20 +02:00
Kenneth Graunke
79088746a2 ir_reader: Run ir_validate on the generated IR.
It's just too easy to get something wrong in hand-written IR.
2010-09-04 02:19:38 -07:00
Kenneth Graunke
2809d70723 ir_reader: Emit global variables at the top of the instruction list.
Since functions are emitted when scanning for prototypes, functions
always come first, even if the original IR listed the variable
declarations first.

Fixes an ir_validate error (to be turned on in the next commit).
2010-09-04 02:19:38 -07:00
Kenneth Graunke
b758de16e3 ir_reader: Drop support for reading the old assignment format. 2010-09-04 02:19:38 -07:00
Kenneth Graunke
a878107d6c glsl: Regenerate autogenerated file builtin_function.cpp. 2010-09-04 02:19:37 -07:00
Kenneth Graunke
bacbf941d2 glsl/builtins: Convert assignments to new format (with write mask). 2010-09-04 02:19:37 -07:00
Kenneth Graunke
03a6276477 ir_reader: Read the new assignment format (with write mask).
This preserves the ability to read the old format, for momentary
compatibility with all the existing IR implementations of built-ins.
2010-09-04 02:19:37 -07:00
Kenneth Graunke
a71b46a8ad ir_reader: Track the current function and report it in error messages. 2010-09-04 02:19:37 -07:00
Kenneth Graunke
a7dc8081b6 glsl/builtins: Actually print the info log if reading a builtin failed. 2010-09-04 02:19:37 -07:00
Luca Barbieri
7a830ac49f nvfx: consolidate tiny files
We probably want to reorganize the remaining files too, but that's
for later, maybe.
2010-09-04 05:31:52 +02:00
Luca Barbieri
603bef5572 mesa/st: add missing _mesa_set_fetch_functions in st_get_tex_image
Fixes piglit fdo25614-genmipmap.
2010-09-04 05:13:06 +02:00
Luca Barbieri
f1d50606ba nvfx: fix vp DP2 2010-09-04 04:43:02 +02:00
Luca Barbieri
72648ca51f nvfx: implement fp SSG properly 2010-09-04 04:38:43 +02:00
Luca Barbieri
527a4f11a7 nvfx: don't claim we support preds since the driver doesn't 2010-09-04 04:05:37 +02:00
Luca Barbieri
f1507806ca nv40: support all 10 texcoords 2010-09-04 04:05:37 +02:00
Luca Barbieri
c98b29ec92 nvfx: add missing context init 2010-09-04 03:05:28 +02:00
Luca Barbieri
e887a9fcad nvfx: tidy up state_emit 2010-09-04 03:05:22 +02:00
Luca Barbieri
71a8544f89 nvfx: support all coord conventions in hardware 2010-09-04 02:57:14 +02:00
Luca Barbieri
5dd296bcb1 nvfx: add missing pushbuffer space check 2010-09-04 02:37:41 +02:00
Luca Barbieri
351a669465 nvfx: support all possible vs consts
We were incorrectly setting a register that limited the range of
constants accessible via indirect addressing.

Setting it correctly, we can address all the constants the GPU
supports.
2010-09-04 02:27:59 +02:00
Luca Barbieri
fa82ad84fb nvfx: set magic bit to round NPOT mipmap sizes down and not up
Does any API even use rounding-up?
2010-09-04 02:08:02 +02:00
Luca Barbieri
60fe5757ae nvfx: allow nested blitter usage, fixing bug in clear 2010-09-04 02:08:02 +02:00
Brian Paul
3b8182793b galahad: do map/unmap counting for resources 2010-09-03 16:35:07 -06:00
Brian Paul
f1de38b851 libgl-xlib: enable galahad support
If the GALLIUM_GALAHAD env var is 1 we'll wrap the regular driver with
the galahad validation driver.
2010-09-03 16:33:20 -06:00
Brian Paul
14056e052b scons: added galahad to driver list 2010-09-03 16:25:44 -06:00
Brian Paul
2a5491792e mesa: also build galahad driver 2010-09-03 15:57:48 -06:00
Brian Paul
a5fd039672 exec_list: replace class with struct
To match the definition below.
2010-09-03 15:25:55 -06:00
Brian Paul
8680c13240 mesa: fix up a comment 2010-09-03 15:22:26 -06:00
Brian Paul
d500ad4405 st/glx: added some comments 2010-09-03 15:22:26 -06:00
Luca Barbieri
befc66788b nvfx: implement LIT in fp 2010-09-03 22:37:35 +02:00
Ian Romanick
f061524f07 glsl2: Use as_constant some places instead of constant_expression_value
The places where constant_expression_value are still used in loop
analysis are places where a new expression tree is created and
constant folding won't have happened.  This is used, for example, when
we try to determine the maximal loop iteration count.

Based on review comments by Eric.  "...rely on constant folding to
have done its job, instead of going all through the subtree again when
it wasn't a constant."
2010-09-03 11:55:22 -07:00
Ian Romanick
4e5b41c2f6 glsl2: Allow copy / constant propagation into array indices 2010-09-03 11:55:22 -07:00
Ian Romanick
de7c3fe31a glsl2: Add module to perform simple loop unrolling 2010-09-03 11:55:22 -07:00
Ian Romanick
3bcfafcf03 glsl2: Track the number of ir_loop_jump instructions that are in a loop 2010-09-03 11:55:22 -07:00
Ian Romanick
351525d534 ir_expression: Add static operator_string method
I've used this in quite a few debug commits that never reached an
up-stream tree.
2010-09-03 11:55:21 -07:00
Ian Romanick
79082b8aca exec_node: Add insert_before that inserts an entire list 2010-09-03 11:55:21 -07:00
Ian Romanick
7850ce0a99 glsl2: Eliminate zero-iteration loops 2010-09-03 11:55:21 -07:00
Ian Romanick
8df2dbf91d glsl2: Perform initial bits of loop analysis during compilation 2010-09-03 11:55:21 -07:00
Ian Romanick
bfe3fbb38e glsl2: Add module to suss out loop control variables from loop analysis data
This is the next step on the road to loop unrolling
2010-09-03 11:55:21 -07:00
Ian Romanick
9434a0749f glsl2: Add module to analyze variables used in loops
This is the first step eventually leading to loop unrolling.
2010-09-03 11:55:21 -07:00
Ian Romanick
0f4f8c7364 ir_to_mesa: Handle loops with loop controls set
The downside of our talloc usage is that we can't really make static
(i.e., not created with new) instances of our IR types.  This leads to
a lot of unnecessary dynamic allocation in this patch.
2010-09-03 11:55:21 -07:00
Ian Romanick
53acbd87d7 ir_validate: Validate loop control fields in ir_loop 2010-09-03 11:55:21 -07:00
Ian Romanick
3b85f1cc6c glsl2: Add cmp field to ir_loop
This reprents the type of comparison between the loop induction
variable and the loop termination value.
2010-09-03 11:55:21 -07:00
Ian Romanick
c8ee8e07f7 glsl2: Set a flag when visiting the assignee of an assignment 2010-09-03 11:55:21 -07:00
Ian Romanick
29eebe9a9a exec_list: Add pop_head 2010-09-03 11:55:21 -07:00
Ian Romanick
9710d272f7 ir_print_visitor: Print empty else blocks more compactly 2010-09-03 11:55:21 -07:00
Luca Barbieri
67a9a90794 nvfx: fix division by zero in vp-ignore-input 2010-09-03 20:57:44 +02:00
Luca Barbieri
f1980af71d nvfx: report correct max lodbias
Fixes piglit lodbias
2010-09-03 20:54:48 +02:00
Luca Barbieri
657b88fc4c nvfx: remove message 2010-09-03 20:48:14 +02:00
Luca Barbieri
b946984e3b nvfx: support indirect addressing in vps
Negative or huge offsets not yet supported.
2010-09-03 20:48:14 +02:00
Alex Deucher
7e282b8e62 r600c: add proper returns for some evergreen functions
these weren't checked anyway.

Fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=29999
2010-09-03 12:13:47 -04:00
Luca Barbieri
6ddfdaead8 nvfx: fix support for more than 8 texture units (fixes etqw crash) 2010-09-03 16:13:21 +02:00
Christoph Bumiller
9e4901402c nv50: load address register before using it, not after 2010-09-03 14:27:23 +02:00
Dave Airlie
50c1b6f2e8 r600g: fix segfault in state after rework
probably can improve this a bit.
2010-09-03 19:39:14 +10:00
Alex Deucher
b009d50f44 r600c: emit DB_HTILE_DATA_BASE on evergreen
Make the hw happy.
2010-09-03 01:13:41 -04:00
Dave Airlie
191bfc5c3b r600g: refactor sample states into a reusable struct.
I will not cut-n-paste.
I will not cut-n-paste.
I will not cut-n-paste.
2010-09-03 14:12:38 +10:00
Dave Airlie
9ef228ee2d r600g: reduce size of r600 context structure to !insane
Its now about 7.8k, and might actually fit in a cache.
2010-09-03 13:53:39 +10:00
Dave Airlie
b5fcf82749 r600g: add texture border state.
Okay I finally wrapped my head around what r600_context_state is meant to be,
maybe I should just rename all the structs so that have distinct names.

I've no idea however why 16 is a good magic number for R600_MAX_RSTATE.
2010-09-03 13:34:57 +10:00
Dave Airlie
ce7077423f r600g: deref old driver states for set entry points. 2010-09-03 12:01:59 +10:00
Dave Airlie
4ca207b174 r600g: drop r600_bind_state.
This was another ugly function that really wasn't needed.

The 3 calls to it from the gallium api were shorter than it,
and all the calls from the set_ functions were pointless.
2010-09-03 11:56:07 +10:00
Dave Airlie
49b4f5259b r600g: kill r600_context_state function
having some sort of locality of code really matters, just create
and setup state at time. Not sure if this is just further polishing of a bad thing,
but at least it makes it more readable.
2010-09-03 11:35:08 +10:00
Dave Airlie
1bd8493a0b r600g: move lots of state inline helpers to separate header.
this gets them out of sight of the main codeflow.
2010-09-03 10:55:54 +10:00
Vinson Lee
619e899a42 draw: Include missing headers in draw_vs_aos.h.
Include tgsi_exec.h for TGSI_EXEC_NUM_TEMPS.
Include draw_vs.h for draw_vs_varient.
2010-09-02 17:03:47 -07:00
Dave Airlie
883cbbd99c r600g: drop magic numbers in depth state.
this also fixes occulsion queries.
2010-09-03 09:48:40 +10:00
Vinson Lee
23120b8d30 util: Include missing header in u_linear.h.
Include p_compiler.h for size_t and boolean symbols.
2010-09-02 16:30:34 -07:00
Vinson Lee
3888c38fc9 mesa: Fix printf-like warning. 2010-09-02 16:12:58 -07:00
Vinson Lee
c5dde53f4e mesa: Fix printf-like warnings. 2010-09-02 16:03:32 -07:00
Jerome Glisse
f8d11b2e8e r600g: force unbind of previously bind sampler/sampler_view
Previously bind sampler/sampler_view can be converted and endup
overwritting the current state we want to schedule. Example :
bind texA texB to sampler_view[0] & sampler_view[1], render,
bind texB to sampler_view[0] render. Now state associated to
texB are set to configure sampler_view slot 0, but as we don't
unbind sampler_view[1] still point to texB state so we end up
with sampler_view[1] overwritting sampler_view[0], which gives
wrong rendering if next rendering bind texA to sampler_view[0],
it will endup as texB is bound to sampler_view[0]. If you are
not confuse at that point give me a call i will be buying you
beer.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-02 16:58:47 -04:00
Brian Paul
e746a6bb9a st/mesa: clamp gl_constants::MaxVarying against MAX_VARYING
Don't try to use more generic varying vars than core Mesa supports.
Fixes fd.o bug 29959.
2010-09-02 13:00:10 -06:00
Ian Romanick
6e3cbeb361 glsl2: Update TODO file 2010-09-02 10:11:54 -07:00
Christoph Bumiller
222d2f2ac2 Merge remote branch 'origin/master' into nv50-compiler
Conflicts:
	src/gallium/drivers/nv50/nv50_program.c
2010-09-02 18:31:49 +02:00
Christoph Bumiller
443abc80db nv50: fix build-predicate function 2010-09-02 18:28:47 +02:00
Christoph Bumiller
9f9ae4eee1 nv50: fix find_dom_frontier 2010-09-02 18:28:39 +02:00
Jerome Glisse
e73c5501b2 r600g: fix memory/bo leak
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-02 11:47:30 -04:00
Brian Paul
c9039fdb16 mesa: fix code generation for ir_unop_sqrt
The CMP instruction needed to be flipped to properly handle
operand==0.

Fixes fd.o bug 29923.
2010-09-02 07:58:33 -06:00
Brian Paul
9eca0e2c3e mesa: fix some printf warnings with casts 2010-09-02 07:57:16 -06:00
Dave Airlie
5d5f693cef r600g: fix thinko in shadow code.
spotted by taiu on irc
2010-09-02 21:26:12 +10:00
Dave Airlie
76d0541e79 r600g: fix logicop, the 3d ROP is the 2D rop shifted twice. 2010-09-02 16:40:41 +10:00
Dave Airlie
e8ff0f63b6 r600g: fix depth texture tests 2010-09-02 15:51:23 +10:00
Kenneth Graunke
f32d3df8ab glsl: Apply implicit conversions to structure constructor parameters.
The code for handling implicit conversions should probably get
refactored, but for now, this is easy.

Fixes piglit test constructor-26.vert.
2010-09-01 20:39:09 -07:00
Kenneth Graunke
43a6200f3c glsl: Convert constant record constructor parameters to ir_constants.
I'm not sure if this is strictly necessary, but it seems wise.
2010-09-01 20:39:09 -07:00
Kenneth Graunke
cfe0dd5622 glsl: Reject structure constructors that have too many arguments.
Fixes piglit test constructor-27.vert.
2010-09-01 20:39:09 -07:00
Ian Romanick
e466b182bb glsl2: Remove unnecessary glsl_symbol_table::get_function parameter return_constructors
Now that constructors are not generated as functions or stored in the
symbol table, there is no need to flag whether or not constructors
should be returned.
2010-09-01 20:39:09 -07:00
Ian Romanick
4d6221f90d glsl2: Remove unused method glsl_type::generate_constructor 2010-09-01 20:39:09 -07:00
Ian Romanick
16d9ebb357 glsl2: Remove unused 'constructor' parameter from glsl_symbol_table::add_type 2010-09-01 20:39:09 -07:00
Ian Romanick
a789ca649c glsl2: Don't generate constructor functions for structures 2010-09-01 20:39:09 -07:00
Ian Romanick
37200d83d3 glsl2: Emit structure constructors inline
Fixes piglit test cases glsl-[fv]s-all-0[12].
2010-09-01 20:39:09 -07:00
Dave Airlie
7299023c2a r600g: add missing vertex fetch formats to the translation table.
fixes at least 2 more piglits.
2010-09-02 13:32:25 +10:00
Jerome Glisse
31b84acbd2 r600g: fix binding of same texture to several target slot
One can bind same texture or sampler to different slot,
each slot needs it own state. The solution implemented
here is not exactly beautifull or optimal need to think
to somethings better.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-01 21:59:28 -04:00
Kenneth Graunke
3960558795 glsl: Fix write mask in matrix-from-matrix constructors.
If the matrix being constructed was larger than the source matrix, it
would overwrite the lower-right part of the matrix with the wrong
values, rather than leaving it as the identity matrix.

For example, constructing a mat4 from a mat2 should only use a writemask
of "xy" when copying from the source, but was using "xyzw".

Fixes the code generated by piglit test constructor-23.vert.
2010-09-01 18:57:51 -07:00
Kenneth Graunke
54b35e6735 glsl: Add proper handling for constant matrix-from-matrix constructors.
Fixes piglit test case constructor-21.vert and changes
constructor-22.vert to give the correct output.
2010-09-01 18:57:51 -07:00
Kenneth Graunke
1f7c7df40f glsl: Move generate_constructor_(matrix|vector) to ir_constant ctor. 2010-09-01 18:57:50 -07:00
Kenneth Graunke
550237eedd ast_function: Fix check for "too few components".
This was triggering even for matrix-from-matrix constructors.  It is
perfectly legal to construct a mat3 from a mat2 - the rest will be
filled in by the identity matrix.

Changes piglit test constructor-23.vert from FAIL to PASS, but the
generated code is incorrect.
2010-09-01 18:57:50 -07:00
Kenneth Graunke
ee88c46640 ast_function: Remove bogus cases from generate_constructor_matrix.
There are no integer matrix types, so switching on them is silly.
2010-09-01 18:57:50 -07:00
Dave Airlie
36192b772e r600g: fix incorrect state naming in pipe_sampler vs pipe_sampler_view
fixes problems in valgrind with uninitialised values.
2010-09-02 11:17:37 +10:00
Eric Anholt
5ad74779ce ir_to_mesa: Load all the STATE_VAR elements of a builtin uniform to a temp.
Like the constant handling and the handling of other uniforms, we add
the whole thing to the Parameters, avoiding messy, incomplete logic
for adding just the elements of a builting uniform that get used.
This means that a driver that relies only on ParameterValues[] for its
parameters will have an increased parameter load, but drivers
generally don't do that (since they have other params they need to
handle, too).

Fixes glsl-fs-statevar-call (testcase for Ember).  Bug #29687.

Regresses glsl-vs-array-04 on 965.  Thanks to a slight change in
register allocation, this test of undefined behavior now wraps around
the register space and unexpectedly reads the constant value it's
trying to compare to.  The test should probably not look at the
resulting color, since behavior is undefined.
2010-09-01 17:08:23 -07:00
Eric Anholt
500e7b7599 ir_to_mesa: Add a little helper for emitting link failure messages. 2010-09-01 17:08:23 -07:00
Eric Anholt
86af037e6a mesa: Fix many printf-like warnings.
Most of these are just typecasting to long to match the arg type.  I
don't really care too much about getting a GLsizei or whatever
appropriate type in.  However, there were a number of real bugs, like
missing arguments or passing floats to integer format specifiers.  My
favorite: printflike("%s, argument") is missing an argument.
2010-09-01 17:08:23 -07:00
Eric Anholt
3cddc15d9d mesa: Add __printf__ attribute to printf-like functions to get warnings. 2010-09-01 17:08:23 -07:00
Dave Airlie
557a71c506 mesa/st: remove check for buffer/elements = 0
shown by the glsl-vs-point-size failing on r600g.

the test passes on softpipe and I get a full piglit test run completing on r600g.
2010-09-02 09:51:25 +10:00
Jerome Glisse
ffcb443cd7 r600g: silence compiler warning
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-01 18:09:37 -04:00
Jerome Glisse
67234b4b42 r600g: refix db/cb state
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-01 18:05:52 -04:00
Brian Paul
4ff3467daf mesa: fix out of bounds memory read in mipmap gen code
Out of bounds reads could happen for reducing WxH to WxH/2
or WxH to W/2xH.

Fixes fd.o bug 29918.
2010-09-01 13:24:26 -06:00
Brian Paul
fd7f2ae085 mesa: more prog_execute.c debug code 2010-09-01 13:24:26 -06:00
Kenneth Graunke
0181385f36 glsl: Add forgotten implementations of equal/notEqual on bvecs. 2010-09-01 11:50:23 -07:00
Alex Deucher
c70459a1b9 r600g: fix up default state differences between r6xx and r7xx
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2010-09-01 14:41:03 -04:00
Brian Paul
6ac66192a6 st/glx: re-order destruction of buffers, visuals
Free the buffers before the visuals.  Fixes valgrind warning
reported in fd.o bug 29919.
2010-09-01 12:40:31 -06:00
Eric Anholt
dd5ef33e3c i965: DP2 produces a scalar result like DP3, DP4, etc.
Fixes glsl-fs-dot-vec2-2.
2010-09-01 10:45:05 -07:00
Ian Romanick
a35faa6a41 glsl2: Perform algebraic simplifications on logical binary operators
Reduces glsl-vs-all-01 from 42 Mesa IR instructions (including the
END) to 17.
2010-09-01 10:25:11 -07:00
Ian Romanick
a4262874f8 glsl2: Allow ir_constant::zero to create boolean constants 2010-09-01 10:25:11 -07:00
Jerome Glisse
66e4cb1cd5 r600g: avoid dynamic allocation of states
Make state statically allocated, this kills a bunch of code
and avoid intensive use of malloc/free. There is still a lot
of useless duplicate function wrapping that can be kill. This
doesn't improve yet performance, needs to avoid memcpy states
in radeon_ctx_set_draw and to avoid rebuilding vs_resources,
dsa, scissor, cb_cntl, ... states at each draw command.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-01 13:16:23 -04:00
Jerome Glisse
15ce70252c Revert "Revert "r600g: precompute some of the hw state""
This reverts commit 1fa7245c34.

Conflicts:

	src/gallium/drivers/r600/r600_state.c
2010-09-01 13:04:42 -04:00
Patrice Mandin
4a955ab6b7 nouveau/nvfx: Remove enforcement of bit depth being same as front buffer
Signed-off-by: Patrice Mandin <patmandin@gmail.com>
2010-09-01 18:13:14 +02:00
Christoph Bumiller
a79da61a4b nv50: fix XPD, was negated 2010-09-01 18:02:51 +02:00
Christoph Bumiller
8e6ba3c8cc nv50: must join SELECT inputs before MOV inputs 2010-09-01 18:02:50 +02:00
Christoph Bumiller
e08f70a41d nv50: make use of TGSI immediate type 2010-09-01 18:02:50 +02:00
Christoph Bumiller
6f9978050e nv50: re-add proper TEXBIAS sequence 2010-09-01 18:02:50 +02:00
Christoph Bumiller
07fe7c2f02 nv50: make FrontFacing -1 or +1 2010-09-01 18:02:50 +02:00
Christoph Bumiller
917c79b384 nv50: SSG 2010-09-01 18:02:50 +02:00
Ben Skeggs
e02c63bc10 nv50: DPH 2010-09-01 18:02:50 +02:00
Ben Skeggs
7145ab214f nv50: DST 2010-09-01 18:02:50 +02:00
Christoph Bumiller
0a8292e096 nv50: attempt at making more complicated loops work
Nested loops, and loops with multiple exits (BREAK, CONT).
2010-09-01 18:02:50 +02:00
Christoph Bumiller
d90502b2b4 nv50: turn off verbose debug output by default 2010-09-01 18:02:50 +02:00
Christoph Bumiller
3844c36594 nv50: set the FragDepth output index 2010-09-01 18:02:50 +02:00
Christoph Bumiller
db1874272c nv50: handle TEXTURE_SWIZZLE and GEOMETRY_SHADER4 caps
GP support will probably be re-added soon.
2010-09-01 18:02:50 +02:00
Vladimir Vukicevic
0731701236 mesa: initialize dummy framebuffer and renderbuffer mutexes
See fd.o bug 29909.

Signed-off-by: Brian Paul <brianp@vmware.com>
2010-09-01 08:54:23 -06:00
Jon TURNEY
c085cd6917 Cygwin: Adjust mklib so -linker and -cplusplus options are processed more like they are for linux
It looks like we were ignoring -linker when -noprefix wasn't present, and
when -noprefix was present, -linker was mandatory and -cplusplus ignored.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Signed-off-by: Brian Paul <brianp@vmware.com>
2010-09-01 08:48:11 -06:00
Jon TURNEY
c55a8a73a4 Cygwin: Teach mklib/minstall to properly install libraries on cygwin
Teach mklib/minstall more about cygwin so libraries are properly installed

Have mklib install the .dll into the lib/ staging directory as well

Have minstall install the .dll into PREFIX/bin at the same time as
installing the .dll.a link library into PREFIX/lib

mklib uses a '-' rather than a '.' as the separator before the version
number in library names on cygwin.  Change the install globs so they match
library names like that.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Signed-off-by: Brian Paul <brianp@vmware.com>
2010-09-01 08:48:06 -06:00
Jon TURNEY
36b195332f Cygwin: Change mklib not to report the full archname on cygwin
Change mklib not to report the full archname when building a library for cygwin
(which is something like 'CYGWIN_NT-5.1' or 'CYGWIN_NT-6.1-WOW64' and kind of
confusing), but just 'CYGWIN'.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Signed-off-by: Brian Paul <brianp@vmware.com>
2010-09-01 08:48:02 -06:00
Jon TURNEY
8fee182e8c Cygwin: Have mklib exit with error code if link fails
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Signed-off-by: Brian Paul <brianp@vmware.com>
2010-09-01 08:48:00 -06:00
Ian Romanick
63b80f8cc1 glsl2: Disallow function declarations within function definitions in GLSL 1.20
The GLSL 1.20 spec specifically disallows this, but it was allowed in
GLSL 1.10.

Fixes piglit test cases local-function-0[13].frag and bugzilla #29921.
2010-09-01 07:08:34 -07:00
Andre Maasikas
c3c25a7ab8 r600: cube mipmap levels are aligned to 8 faces only starting from r7xx 2010-09-01 09:19:51 +03:00
Dave Airlie
1d7b4af817 r600g: correct cb/zb offset emits.
This fixes fbo-3d and fbo-cubemap
2010-09-01 14:59:18 +10:00
Dave Airlie
1fa7245c34 Revert "r600g: precompute some of the hw state"
This reverts commit de0b76cab2, its pre-computes the texture state wrong,

you can't just use an array of levels, since you can have FBOs to depth texture slices inside a level as well
it would get really messy quickly. Probably need to split commits like this up into pieces for each piece
of state, so we can revert bits easier in case of regressions.

This also break 5 piglit tests, and valgrind starts to warn about invalid read/writes after this.
2010-09-01 14:56:04 +10:00
Dave Airlie
d7e2509692 r600g: fix typo causing segfault.
fixes warning that
r600_blit.c: In function ‘r600_resource_copy_region’:
r600_blit.c:136: warning: passing argument 1 of ‘util_resource_copy_region’ from incompatible pointer type

and also 7 more piglit tests.
2010-09-01 13:55:56 +10:00
Dave Airlie
bea5f559a6 r600g: fix glean texCube and shadows.
add cube and shadow support to the texture code.
2010-09-01 12:55:21 +10:00
Brian Paul
3fa3c33844 gallivm: fix bug in nested conditionals
This, plus the previous commit fix fd.o bug 29806.
2010-08-31 19:15:07 -06:00
Brian Paul
16c733495d glsl2: fix bug in atan(y, x) function
When x==0, the result was wrong.  Fixes piglit glsl-fs-atan-1.shader_test
2010-08-31 19:15:07 -06:00
Eric Anholt
9b075cb9fa ir_to_mesa: When emitting a pixel kill, flag that we did so.
Both i965 and swrast rely on UsesKill to determine whether to do early
depth writes.  Fixes glsl-fs-discard-02.

Bug #29835.
2010-08-31 15:43:49 -07:00
Keith Whitwell
e38d2f7163 llvmpipe: slightly simplify build_mask 2010-08-31 23:31:45 +01:00
Keith Whitwell
0aa3a09ced llvmpipe: combine linear mask calculation 2010-08-31 23:31:45 +01:00
Keith Whitwell
d8c92a1eea llvmpipe: intrinsics versions of build_mask functions 2010-08-31 23:31:44 +01:00
Ian Romanick
a6c3cd5ca6 glsl2: Write vector constructor constants in a single assignment
Make two passes over the constructor parameters.  Write all of the
constants in a single write, then write the non-constants one at a
time.  This causes the fragment shader

varying float g;
void main()
{
	gl_FragColor = vec4(0.0, g, 0.0, 1.0);
}

to generate

(function main
  (signature void (parameters )
    (
      (declare (temporary ) vec4 vec_ctor@0x8580058)
      (assign (constant bool (1)) (xzw) (var_ref vec_ctor@0x8580058)  (constant vec4 (0.000000 0.000000 0.000000 1.000000)) )
      (assign (constant bool (1)) (y) (var_ref vec_ctor@0x8580058)  (swiz xxxx (var_ref g@0x8580218) ))
      (assign (constant bool (1)) (xyzw) (var_ref gl_FragColor@0x84d32a0)  (var_ref vec_ctor@0x8580058) )
    ))
)

instead of

(function main
  (signature void (parameters )
    (
      (declare (temporary ) vec4 vec_ctor@0x8580058)
      (assign (constant bool (1)) (x) (var_ref vec_ctor@0x8580058)  (constant vec4 (0.000000 0.000000 0.000000 1.000000)) )
      (assign (constant bool (1)) (y) (var_ref vec_ctor@0x8580058)  (swiz xxxx (var_ref g@0x8580218) ))
      (assign (constant bool (1)) (z) (var_ref vec_ctor@0x8580058)  (constant vec4 (0.000000 0.000000 0.000000 1.000000)) )
      (assign (constant bool (1)) (w) (var_ref vec_ctor@0x8580058)  (constant vec4 (0.000000 0.000000 0.000000 1.000000)) )
      (assign (constant bool (1)) (xyzw) (var_ref gl_FragColor@0x84d32a0)  (var_ref vec_ctor@0x8580058) )
    ))
)

A similar optimization could be done for matrix constructors, but it
is a little more complicate there.
2010-08-31 14:44:13 -07:00
Eric Anholt
99f3c9caa3 ir_to_mesa: Sort the uniform list we're adding to Parameters[] order.
Fixes glsl-uniform-linking-1 and failure to link a shader in Unigine.
An alternative here would be to just ditch using _mesa_add_parameter
and build the initial params list on our own, but that would require
two walks of the list as well.

Bug #29822
2010-08-31 11:34:29 -07:00
nobled
2a78807db7 ir_to_mesa: Fix struct/class confusion 2010-08-31 11:34:29 -07:00
Eric Anholt
7406898441 ir_to_mesa: Set up our instruction nodes with zeroed data.
cond_update wasn't being set by emit_op3, leading to valgrind
complaints, and failures in several piglit tests when built with
clang.
2010-08-31 11:34:29 -07:00
Kenneth Graunke
1eea96326f ast_to_hir: Add support for bit-wise operators (but not shifts).
Previously, using bit-wise operators in some larger expression would
crash on a NULL pointer dereference.  This code at least doesn't crash.

Fixes piglit test bitwise-01.frag.
2010-08-31 11:00:34 -07:00
Chia-I Wu
3fbbd70e80 st/egl: Enable EGL_MESA_drm_display. 2010-08-31 15:52:33 +08:00
Chia-I Wu
8cdeff8444 egl: Mark EGL_MESA_screen_surface as obsolete.
EGL_MESA_drm_{display,image} can achieve the same functionality.
2010-08-31 15:25:22 +08:00
Dave Airlie
b87b6e5bf7 r600g: fix up depth write swizzles.
For some reason r600c, emits extra instructions in the FP to do the depth write output swizzle,
I'm not sure this is required, so here I'm doing it in the exports.

this fixes the mesa trivial demos tri-depthwrite and tri-depthwrite2, it doesn't fix
the glsl1 gl_FragDepth writing test however.
2010-08-31 16:15:04 +10:00
Dave Airlie
ad202678fc r600g: fix fp-fragment-position test. 2010-08-31 15:13:24 +10:00
Dave Airlie
580781babe r600g: fix typo in last commit 2010-08-31 15:13:21 +10:00
Dave Airlie
5d66a8606d r600g: fix position input to fragment shader.
this fixes a few if the fs shader tests, 10 more piglits
2010-08-31 14:55:32 +10:00
Dave Airlie
4e61f085d0 r600g: remove unneeded function call from scs 2010-08-31 14:55:32 +10:00
Marek Olšák
4f189b3bf5 ir_to_mesa: use RSQ+MUL instead of RSQ+RCP for SQRT
sqrt(x) = 1/rsq(x) = x*rsq(x)

This optimization already was in the old GLSL compiler.

Acked on irc by Eric Anholt.
2010-08-31 06:36:52 +02:00
Kenneth Graunke
2619b1c96f linker: Require an exact matching signature when looking for prototypes.
Fixes piglit test glsl-override-builtin.  The linker incorrectly found
the prototype for the float signature, rather than adding a new
prototype with the int return type.  This caused ir_calls with type int
to have their callees set to the float signature, triggering an assert.
2010-08-30 21:04:13 -07:00
Dave Airlie
d3fa92584b r600g: make LIT work properly
this is a bit of a workaround, something is wrong with the literal emits here
so we just use the trig copy function to copy the immd to a temp at start of op.

fix VP/FP LIT tests
2010-08-31 12:59:10 +10:00
Zhenyu Wang
24ff42e7d5 i965: fix depth test on sandybridge
This includes several corrections for fixing depth test on sandybridge.
Fix wrong bits definition in depth stencil state. Fix wrong order of
state buffer offset in 3DSTATE_CC_STATE_POINTERS command. Correctly use
buffer width parameter in depth buffer setting.

Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
2010-08-31 09:58:18 +08:00
Dave Airlie
be7816f2b7 r600g: fixup trig functions when input is a literal
So as the trig functions used up the literal spots for the PI work, if the arg0 was an immediate
we'd hit failure, so copy the literal before starting.

add some tracking of max temp used to avoid trashing temp regs.

5 more piglits, fp1 COS,SCS,SIN tests
2010-08-31 11:44:34 +10:00
Dave Airlie
ee0153f891 r600g: make sure LIT splits constants 2010-08-31 10:47:08 +10:00
Dave Airlie
9bbc54a10d r600g: fix constant splitting
constant splitting was broken for multi-constant cases, fixes fp1 CMP+MAD, vp1 CMP.
2010-08-31 10:47:03 +10:00
Dave Airlie
85e401d8bf r600g: fix LIT tests 2010-08-31 10:46:58 +10:00
Dave Airlie
5ea238b799 r600g: add missing literals
Also add an error if we hit this problem again, we need to do this better
possibly tying the literal addition to the last flag.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-08-31 09:43:48 +10:00
Ian Romanick
df869d9163 linker: Handle varying arrays, matrices, and arrays of matrices
Fixes piglit test case glsl-array-varying-01.
2010-08-30 16:02:51 -07:00
Eric Anholt
a3c2bd416a Don't pass -ffast-math to clang, since it ignores it and complains. 2010-08-30 14:20:05 -07:00
nobled
2a50187a92 Make configure work with clang
It was mistaking clang for gcc and deciding its version
was too low.
2010-08-30 13:59:18 -07:00
Jon TURNEY
e637f8b40c Add talloc to osmesa library dependencies
also link osmesa with C++ standard libraries, as it now contains C++ code

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2010-08-30 13:41:39 -07:00
Jon TURNEY
6356303de6 Add talloc to dependencies for libGL built with xlib driver
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2010-08-30 13:41:36 -07:00
Eric Anholt
8b3d36d563 glsl: Clear the static values of builtin function profiles at release.
When releasing the builtin functions, we were just freeing the memory,
not telling the builtin function loader that we had freed its memory.
I wish I had done ARB_ES2_compatibility so we had regression testing
of this path.  Fixes segfault on changing video options in nexuiz.
2010-08-30 13:12:24 -07:00
Ian Romanick
33fe364e5a glsl2: Commit generated files changed by previous commit 2010-08-30 12:52:42 -07:00
Ian Romanick
bea3963f59 glsl2: Parse #pragma lines
All pragmas are currently ignored.  Also, the error messages when a
pragma is used incorrectly (i.e., '#pragma debug(on)' inside a
function) are crap, but I think this is sufficient for now.

Fixes piglit test cases pragma-0[1-8].(vert|frag).
2010-08-30 12:52:42 -07:00
Kenneth Graunke
9b0ba68b44 Fix inverted version checks in check_extra.
Previously, if an attribute was enabled by either a specific GL version
or an extension, the check would require -both- to be enabled.  This bug
was not discovered earlier because version checks are currently only ever
used on their own.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2010-08-30 12:29:22 -07:00
Jerome Glisse
de0b76cab2 r600g: precompute some of the hw state
Idea is to build hw state at pipe state creation and
reuse them while keeping a non PM4 packet interface
btw winsys & pipe driver. This commit also force rebuild
of pm4 packet on each call to radeon_state_pm4 which
in turn slow down everythings, this will be addressed.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-08-30 15:00:55 -04:00
Jerome Glisse
0bba7796a3 r600g: fix depth buffer decompression after states rework
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-08-30 15:00:55 -04:00
Dave Airlie
69c30f5d6d r600g: fixup states generation in winsys.
The current states code had an unhealthy relationship between
that had to somehow magically align themselves, editing either
place meant renumbering all states after the one you were on,
and it was pretty unapproachable code.

This replaces the huge types structures with a simple type + sub
type struct, which is keyed on an stype enum in radeon.h. Each
stype can have a per-shader type subclassing (4 types supported,
PS/VS/GS/FS), and also has a number of states per-subtype. So you
have 256 constants per 4 shaders per one CONSTANT stype.

The interface from the driver is changed to pass in the tuple,
(stype, id, shader_type), and we look for this. If
radeon_state_shader ever shows up on profile, it could use a
hashtable based on stype/shader_type to speed things up.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-08-30 15:00:55 -04:00
Luca Barbieri
699c82e30c glapi: fix generator which got out of sync with the codebase
The __GLapi typedef was removed in c356f5867f,
but the code generator hasn't been updated.
2010-08-30 20:51:49 +02:00
Eric Anholt
5360c48317 i965: Clear the cached constant buffer entry in the VS at control flow.
Fixes the 7 regressions with constant buffers forced on with piglit -t
glsl (glsl-vs-if-*).
2010-08-30 11:19:30 -07:00
Eric Anholt
3bae20bbc9 i965: Align the number of payload regs to 2 again in 16-wide mode.
Fixes a regression in point-line-no-cull and glean/paths tests since
501c9dc627.
2010-08-30 10:47:05 -07:00
Cedric Vivier
e1aa3c234f i965: Apply the rest of the old-libdrm guard patch.
Bug #29855
2010-08-30 10:42:20 -07:00
Eric Anholt
1fcb5a9858 i965: Add support for loops to the new FS backend.
This includes a handy little safety check to prevent the loop from
going "too long", as permitted by the spec.  I haven't gone out of my
way to test it, though…

Fixes 20 more piglit tests.
2010-08-30 10:26:05 -07:00
Eric Anholt
352dff62f8 i965: Make brw_CONT and brw_BREAK take the pop count.
We always need to set it, so pass it in.
2010-08-30 10:26:05 -07:00
Eric Anholt
b0a933a4d9 i965: Add "discard" support to the new FS backend.
Fixes 3 testcases related to discard.
2010-08-30 10:26:05 -07:00
Eric Anholt
4ff25c2106 i965: Fix the new implementation of ir_unop_sign to match brw_wm_emit.c
Like the comparison operations, this suffered from CMP only setting
the low bit.  Doing the AND instructions would be the same instruction
count as the more obvious conditional moves, so do cond moves.

Fixes glsl-fs-sign and 6 other cases, like trig functions that use
sign() internally.
2010-08-30 10:26:05 -07:00
Eric Anholt
40aadafa91 i965: Add support for texturing with bias to i965 FS backend.
Fixes 5 piglit tests for bias.  Note that LOD is a 1.30 feature and
not yet supported.
2010-08-30 10:26:05 -07:00
José Fonseca
f3eebb8465 glut: Silence missing initializer warning. 2010-08-30 14:12:01 +01:00
José Fonseca
4841c0a15a mesa: Return after assertion failure.
Addresses the warnings:
warning: ‘target’ may be used uninitialized in this function
warning: ‘target_string’ may be used uninitialized in this function
2010-08-30 13:59:24 +01:00
José Fonseca
0a6c908e0d gallivm: Compute the 4 texel offsets for linear filtering en ensemble. 2010-08-30 13:58:09 +01:00
José Fonseca
ccd8b935e4 glsl: Silence unused variable warning. 2010-08-30 13:53:15 +01:00
José Fonseca
128237927d mesa: Fix _mesa_lookup_parameter_constant's return value.
Fixes gcc warning

  In function ‘_mesa_add_unnamed_constant’:
  warning: ‘pos’ may be used uninitialized in this function

but also what appears to be a bug.
2010-08-30 13:48:21 +01:00
José Fonseca
e4c3e7f9d8 gallivm: Disable LLVM's pretty stack trace dumper.
By default LLVM adds a signal handler to output a pretty stack trace.
This signal handler is never removed, causing problems when unloading
the shared object where the gallium driver resides.

Thanks to Chris Li for finding this.
2010-08-30 13:27:28 +01:00
José Fonseca
7a08dbcf55 gallivm: Correct copy'n'pasted comments. 2010-08-30 13:27:03 +01:00
José Fonseca
e18c7f68b4 gallivm: Fix lp_build_sum_vector.
The result is scalar, so when argument is zero/undef we can pass vector
zero/undef.

Also, support the scalar case.
2010-08-30 13:26:29 +01:00
Michal Krol
1bb97610e9 svga: Fix CMP translation for vertex shader targets.
SVGA3DOP_CMP is not supported for vertex shaders;
use SLT + LRP instead.
2010-08-30 13:01:58 +01:00
José Fonseca
5a70db6432 svga: Re-emit bound rendertargets and texture samplers at the beginning of every command buffer.
Only non null resources.

To ensure that relocations are emitted for every resource currently
referred.
2010-08-30 13:01:57 +01:00
Marek Olšák
007bac8331 st/mesa: set the MaxVarying GLSL constant 2010-08-30 13:27:36 +02:00
Marek Olšák
77dac1945f r300g: fix warning in winsys 2010-08-30 13:25:07 +02:00
Dave Airlie
57eecbbf6c r600g: add DST opcode support. 2010-08-30 16:22:54 +10:00
Dave Airlie
92f5c7a597 r600g: add SCS support. 2010-08-30 16:09:39 +10:00
Dave Airlie
db92a03aac r600g: fix warning introduced by last commit. 2010-08-30 15:50:52 +10:00
Dave Airlie
47d5a19df1 r600g: add initial relative support to assembler
passes another ~20 piglits.

/me starts to run out low hanging fruit around now.
2010-08-30 15:47:49 +10:00
Ian Romanick
a2711d6968 linker: Treat sized and unsized array types as the same
If two shaders contain variables declared with array types that have
the same base type but one is sized and the other is not, linking
should succeed.  I'm not super pleased with the way this is
implemented, and I am more convinced than ever that we need more
linker tests.  We especially need "negative" tests.

Fixes bugzilla #29697 and piglit test glsl-link-array-01.
2010-08-29 22:11:35 -07:00
Dave Airlie
4502b17901 r600g: add KILP support
passes glsl1-discard tests
2010-08-30 15:04:40 +10:00
Dave Airlie
cb08b9fa84 r600g: fix SSG and op3 neg writing
8 more piglits, mainly the two SSG tests.
2010-08-30 14:22:12 +10:00
Dave Airlie
09547e1bce r600g : add basic loop support.
Adds BGNLOOP, BRK, CONT, ENDLOOP support, ported from r600c.

17 piglits more on r300g.tests.
2010-08-30 13:38:33 +10:00
Bas Nieuwenhuizen
cd4bd4fb53 r600g: use the values from the correct literals
Created an array for literals as we should not always use the last declared literal.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-08-30 09:41:02 +10:00
Bas Nieuwenhuizen
e77b1e777d r600g: added literals where needed for POW instruction
Fixes size calculation for the bytecode buffer.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-08-30 09:41:02 +10:00
Richard Li
b3d41844c7 evergreen : fix shader const allocation and instruction bugs. 2010-08-29 19:27:46 -04:00
Vinson Lee
0c93e69b25 glsl: Initialize data in ast_function_expression::hir.
Completely initialize data that is passed to ir_constant constructor.

Fixes piglit glsl-orangebook-ch06-bump valgrind uninitialized variable
error on softpipe and llvmpipe.
2010-08-29 14:05:07 -07:00
Vinson Lee
30a0865528 glsl: Completely initialize value member in ir_constant constructor.
The
ir_constant::ir_constant(const struct glsl_type *type, exec_list *value_list)
did not completely initialize the entire value member.

Fixes piglit glsl-fs-sampler-numbering-2 valgrind uninitialized value
error in softpipe and llvmpipe.
2010-08-29 13:15:56 -07:00
Vinson Lee
2d0ef6bfee glsl: Initialize variable in ir_swizzle::constant_expression_value.
Complete initialize data passed to ir_constant constructor.

Fixes piglit glsl-mat-from-int-ctor-02 valgrind unintialized variable
error with softpipe and llvmpipe.
2010-08-29 12:19:57 -07:00
Vinson Lee
b43611b79c glsl: Initialize data in read_constant.
Completely initialize data that is passed into a ir_constant constructor.

Fixes piglit glsl-fs-mix valgrind uninitialized variable error on
softpipe and llvmpipe.
2010-08-29 11:48:02 -07:00
Vinson Lee
0a46497a4e ir_to_mesa: Initialize variable in ir_to_mesa_visitor::visit.
Fixes piglit glsl-fs-loop valgrind uninitialized value error on softpipe
and llvmpipe.
2010-08-29 11:31:33 -07:00
Dave Airlie
c48ae0b6ed r600g: drop file I added by mistake in a previous commit 2010-08-29 18:45:26 +10:00
Vinson Lee
f67400d467 glsl: Initialize the rest of values of ir_constant::value.
Fixes valgrind uninitialized value errors in the piglit shader tests for
softpipe and llvmpipe.
2010-08-28 23:55:51 -07:00
Vinson Lee
182d635060 gallium: Remove unnecessary header from p_state.h.
Remove p_screen.h.
2010-08-28 22:15:37 -07:00
Vinson Lee
1fc396204b nvfx: Remove util_is_pot in favor of util_is_power_of_two.
This is a follow up to commit 89b2897220.
2010-08-28 22:12:55 -07:00
Vinson Lee
b812ff8f9e util: Include missing header in u_draw.h.
Include p_state.h for complete type to pipe_draw_info.
2010-08-28 21:46:41 -07:00
Vinson Lee
1f3e6e9726 util: Add forward declaration in u_transfer.h. 2010-08-28 21:42:28 -07:00
Marek Olšák
a922725118 r300g,u_blitter: use u_framebuffer
Removing another function duplication in u_blitter.
2010-08-29 06:16:53 +02:00
Marek Olšák
89b2897220 util: remove util_is_pot in favor of util_is_power_of_two
The function was duplicated.
2010-08-29 06:16:25 +02:00
Eric Anholt
735af3959f i965: Add initial support for texturing to the new FS backend.
Fixes 11 piglit tests.
2010-08-28 20:04:03 -07:00
Eric Anholt
af62060ef2 i965: Add disasm for gen5 sampler messages. 2010-08-28 20:02:54 -07:00
Cedric Vivier
3d4597f9d4 i965: Move libdrm/C++ hack introduced in fa2deb3d to intel_context.h
Fixes build on Linux/GCC 4.4 as libdrm includes are also used by other
brw_fs_*.cpp files.

Bug #29855
2010-08-28 20:02:54 -07:00
Vinson Lee
2dfd348e33 st/mesa: Include missing header in st_mesa_to_tgsi.c.
Include p_screen.h for complete type to pipe_screen.
2010-08-28 14:24:42 -07:00
Vinson Lee
d42b7d5f8d softpipe: Include missing header in sp_flush.c.
Include p_screen.h for complete type to pipe_screen.
2010-08-28 14:21:28 -07:00
Vinson Lee
9112e531d4 draw: Include missing header in draw_vs_llvm.c.
Include p_screen.h for completely type to pipe_screen.
2010-08-28 14:18:57 -07:00
Vinson Lee
cf1e4b15a4 llvmpipe: Include missing header in lp_flush.c.
Include p_screen.h for complete type to pipe_screen.
2010-08-28 14:14:33 -07:00
Marek Olšák
c5b8ba9368 r300g: fix blitting between 2D NPOT mipmaps
Even though MIP filtering is not supported, we can bind an arbitrary mipmap
as the zero mipmap level.

NPOT textures now follow GL_TEXTURE_BASE_LEVEL and GL_TEXTURE_MIN_LOD.

This fixes piglit/fbo-copyteximage.
2010-08-28 22:37:53 +02:00
Mathias Fröhlich
c0f0eb8668 r300g: fix min/max lod computation 2010-08-28 18:17:30 +02:00
Marek Olšák
97cbb563f8 r300g: set the correct value in PVS_NUM_CNTLRS
As per docs.
2010-08-28 18:17:30 +02:00
Vinson Lee
f7579f2f28 llvmpipe: Remove unnecessary header. 2010-08-28 00:29:02 -07:00
Ian Romanick
120d5a95cb glsl2: Decompose matrix comparison into vector operations 2010-08-27 17:41:16 -07:00
Jakob Bornecrantz
977f7d48ee trace: Don't try to dump the rgba array if null 2010-08-28 00:56:51 +01:00
Eric Anholt
c7adb4ff1e glsl: Rename a couple of common variable names in mat_op_to_vec.
It was easy while typing implementations to accidentally overwrite the
original expression or assignment variables.
2010-08-27 16:11:00 -07:00
Eric Anholt
3c96ef1f07 glsl: Make mat_op_to_vec allocate out of the IR's parent.
This will reduce memory consumption of compiled shaders by not
dragging optimized-out children around.
2010-08-27 16:11:00 -07:00
Eric Anholt
d17faf726e i965: Set the pop count on BRK/CONT inside of an if statement in the FS.
This is the same as 8de8c97275 for the
VS, and fixes glsl-fs-if-nested-loop and the mandelbrot demo.

Bug #29498
2010-08-27 16:10:53 -07:00
Eric Anholt
681492cbe2 glsl: Regenerate for double destroy fix. 2010-08-27 15:25:06 -07:00
Eric Anholt
d539c69044 glsl: Protect against double compiler-destroy.
DRI was doing teardown when we close the last screen, then an atexit()
was added to call it as well.
2010-08-27 15:25:06 -07:00
Eric Anholt
ae6e112c69 dri: Get prototype for _mesa_destroy_compiler().
Bug #29665.
2010-08-27 14:43:39 -07:00
Eric Anholt
d20c276618 i965: Don't strip negate/abs flags when assigning uniform locations.
Fixes glsl-algebraic-sub-zero-4.
2010-08-27 14:42:35 -07:00
Eric Anholt
f0aa2d6118 i965: Add missing handling for BRW_OPCODE_SEL.
Fixes 4 piglit tests about min, max, and clamp.
2010-08-27 14:11:25 -07:00
Eric Anholt
38d01c5b27 i965: Mask out higher bits of the result of BRW_CMP producing a boolean.
When it says it sets the LSB, that's not just a hint as to where the
result goes.  Only the LSB is modified.  Fixes 20 piglit cases.
2010-08-27 13:59:36 -07:00
Eric Anholt
4229a93cc7 i965: Fix the types of immediate integer values.
When we're trying to do integer ops, handing a float in doesn't help.
2010-08-27 13:59:36 -07:00
Eric Anholt
41e75cde26 i965: Add translation for RNDD and RNDZ.
Fixes:
glsl-fs-any.
glsl1-integer division with uniform var
2010-08-27 13:59:36 -07:00
Eric Anholt
31c9f468f3 i965: Add support for ir_binop_mod using do_mod_to_fract.
Fixes glsl-fs-mod.
2010-08-27 13:59:36 -07:00
Jerome Glisse
48d8814c03 r600g: fix vbo size
Silence the kernel, vbo size is size - 1.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-08-27 16:54:00 -04:00
Brian Paul
9ce0d92ae7 mesa: move null ptr check (fdo bug 29843) 2010-08-27 14:35:52 -06:00
Nick Bowler
f57df7f213 mesa: Use the format info to identify packed depth/stencil formats.
Due to a misunderstanding of the Z24_X8 and X8_Z24 formats, the earlier
patch created depth/stencil wrappers for them.  This broke swrast.

Use the format info instead, which only identifies Z24_S8 and S8_Z24 as
packed depth/stencil.  It also has the advantage of being nicer code.

Signed-off-by: Nick Bowler <nbowler@draconx.ca>
Signed-off-by: Brian Paul <brianp@vmware.com>
2010-08-27 14:31:00 -06:00
Brian Paul
579fce2524 mesa: use atexit() handler to release GLSL compiler memory
This releases a bunch of memory that was showing up as leaks with
valgrind.

If atexit() isn't widely supported we may need to add some #ifdef
tests around the call.
2010-08-27 14:30:59 -06:00
Brian Paul
b820bf979a glsl2: restructure header file for C++ and C inclusion
As it was, the header could not be cleanly #included by a C source.
2010-08-27 14:30:59 -06:00
Brian Paul
1be5d1c887 glsl2: remove 'extern' keyword in .c file 2010-08-27 14:30:59 -06:00
Eric Anholt
53290900db i965: Fix swapped instructions in ir_unop_abs and ir_unop_neg.
Fixes glsl-fs-neg and 5 other tests.
2010-08-27 13:19:28 -07:00
Eric Anholt
2776ad2641 i965: Add generate() handling for AND, OR, XOR.
10 more piglit tests pass.
2010-08-27 13:16:22 -07:00
Eric Anholt
130368f910 i965: Add support for if instructions in the new FS backend.
20 more piglit tests pass.
2010-08-27 13:15:05 -07:00
Eric Anholt
a0ffee2cd7 i965: When encountering an unknown opcode in new FS backend, print its name. 2010-08-27 13:14:52 -07:00
Eric Anholt
40932c1752 i965: Fix the maximum grf counting in the new FS backend.
glsl-algebraic-rcp-rsq managed to use 33 registers, and we claimed to
only use 32, so the write to g32 would go stomping over the precious
g0 of some other thread.
2010-08-27 12:21:40 -07:00
Eric Anholt
166b3fa29d i965: Validate the IR tree after doing our custom optimization passes.
This wouldn't catch the last failure fixed in them, because we don't
validate assignments well (due to the fact that we've got a pretty
glaring inconsistency in how we handle assignment writemasking), but
it could catch other failure we may produce.
2010-08-27 12:19:17 -07:00
Eric Anholt
55ced33675 i965: Add a bit of support for matrices to the new FS. 2010-08-27 12:02:15 -07:00
Eric Anholt
91a037b5e1 i965: Fix destination writemasking in the new FS. 2010-08-27 12:02:15 -07:00
Eric Anholt
0435cb348a i965: Fix swizzling in vector splitting for the new FS backend.
We weren't smearing a component of a split RHS out to reach an unsplit
LHS's writemask, so gl_FragColor (always unsplit) would often get
uninitialized values.

Fixes: glsl-algebraic-add-add-1 (and probably many others).
2010-08-27 12:02:15 -07:00
Zack Rusin
83e3a2d970 graw: fix the build (missing header) 2010-08-27 13:09:38 -04:00
Brian Paul
c8e0970667 mesa: free the fallback texture object in free_shared_state() 2010-08-27 10:51:47 -06:00
Brian Paul
476adf796b mesa: fix double-underscore naming 2010-08-27 10:21:59 -06:00
Keith Whitwell
55f4eab93c llvmpipe: use util_iround in place of round
Fix mingw build.
2010-08-27 13:43:06 +01:00
Keith Whitwell
04f8560dd8 util: fix typo in MAX4
Thanks to Michal for spotting it.
2010-08-27 13:34:12 +01:00
Keith Whitwell
aea6b415de llvmpipe: eliminate tri->dx, tri->dy values
Use an internal struct for line setup information.
2010-08-27 13:08:55 +01:00
Hui Qi Tay
29ec116e8f llvmpipe: point sprites rasterization
Point sprites now done in the rasterizer setup code instead of
going through the draw module.
2010-08-27 13:08:54 +01:00
Hui Qi Tay
2cd72dd459 llvmpipe: native point rasterization with better pixel rasterization
A few subpixel_snap and fixed width changes.

Conflicts:

	src/gallium/drivers/llvmpipe/lp_setup_point.c
2010-08-27 13:08:54 +01:00
Hui Qi Tay
57d84d9ca4 llvmpipe: native point rasterization
Conflicts:

	src/gallium/drivers/llvmpipe/lp_setup_context.h
	src/gallium/drivers/llvmpipe/lp_setup_line.c
	src/gallium/drivers/llvmpipe/lp_setup_tri.c
2010-08-27 13:08:54 +01:00
Keith Whitwell
3783053fa5 llvmpipe: update line rasterization code to current master 2010-08-27 13:08:54 +01:00
Keith Whitwell
e826d0e817 util: add MIN4, MAX4 2010-08-27 13:08:54 +01:00
Hui Qi Tay
b91553355f llvmpipe: native line rasterization with correct pixel rasterization
Line rasterization that follows diamond exit rule.
Can still optimize logic for start/endpoints.
2010-08-27 13:08:54 +01:00
Hui Qi Tay
5286dd7016 llvmpipe: native rasterization for lines
Rasterize lines directly by treating them as 4-sided polygons.
Still need to check the exact pixel rasteration.
2010-08-27 13:08:54 +01:00
Keith Whitwell
c95ca04b63 llvmpipe: add lp_setup_coef to makefile 2010-08-27 11:18:11 +01:00
Keith Whitwell
0be0ad5d58 llvmpipe: intrinsics version of triangle coeficient calculation
Looks nice, but makes almost no impact on performance - maybe
a percent or so in isosurf, nothing elsewhere.  May be of use
later on.
2010-08-27 09:47:22 +01:00
Vinson Lee
af8f037db2 gallium: Remove unnecessary header from p_shader_tokens.h.
Remove p_compiler.h.
2010-08-27 00:40:42 -07:00
Vinson Lee
ec21ed1ce7 tgsi: Include missing header in tgsi_parse.h.
Include p_compiler.h for boolean and INLINE symbols.
2010-08-27 00:34:32 -07:00
Vinson Lee
57421cb464 tgsi: Include missing header in tgsi_info.h.
Include p_compiler.h for uint symbol.
2010-08-27 00:31:27 -07:00
Vinson Lee
0b9b8694d9 tgsi: Include missing header in tgsi_dump.h.
Include p_compiler.h for uint symbol.
2010-08-27 00:26:59 -07:00
Vinson Lee
43ed82bdb2 gallium: Remove unnecessary header from p_format.h.
Remove p_compiler.h.
2010-08-27 00:15:04 -07:00
Vinson Lee
1b83ede8cc graw: Include missing header in graw.h.
Include p_compiler.h for PUBLIC symbol.
2010-08-27 00:07:38 -07:00
Vinson Lee
677623a6c8 r300g: Include missing header in r300_texture.h.
Include p_compiler.h for uint32_t and boolean symbols.
2010-08-27 00:04:50 -07:00
Kenneth Graunke
67ffbbbb5d Fix typo in function name "shading_laguage_version". 2010-08-26 23:07:45 -07:00
Dave Airlie
2184f3ec30 Revert "r600g: simplify states"
This reverts commit bd25e23bf3.

Apart from introducing a lot of hex magic numbers and being highly impenetable code,
it causes lots of lockups on an average piglit run that always runs without lockups.

Always run piglit before/after doing big things like this.
2010-08-27 15:45:58 +10:00
Dave Airlie
a03d456f5a r600g: add initial if/else/endif support
this adds handling for some more CF instructions and conditions
also adds parameter for stack size emission

These seem to pass on VS with the stack size hack but not on FS,

TODO: fix FS + stack size calcs
2010-08-27 15:30:07 +10:00
Dave Airlie
d8fb13bae3 r600g: optimise op2 and swapped op2 emission.
this makes op2 emission smaller, since it skips instructions
that don't write to the dst. not sure if this could have unwanted
side effects but try it and see.
2010-08-27 15:29:04 +10:00
Dave Airlie
36d91be75e r600g: add exp support in theory.
though it isn't passing the test, and this instruction is pure bonghits.
2010-08-27 15:29:04 +10:00
Dave Airlie
e57437ccd6 r600g: add DPH support. 2010-08-27 15:29:03 +10:00
Eric Anholt
a4d97d3726 i965: Add preliminary support for uniforms to the new FS backend.
+269 piglits
2010-08-26 17:11:18 -07:00
Eric Anholt
3dff682b65 i965: Abort on gl_FragDepth in the new FS backend for now.
It hangs the GPU due to FB_WRITE handling being incomplete.  There are
bigger issues to handle first.
2010-08-26 17:06:25 -07:00
Eric Anholt
1a3de23509 i965: Fix up and actually enable the NewShader and NewShaderProgram hooks. 2010-08-26 17:00:30 -07:00
Eric Anholt
fa2deb3ddc i965: Hack in avoidance of c++ reserved keyword in libdrm.
I'm also fixing this upstream in libdrm, but this avoids new libdrm
dependency for the moment.
2010-08-26 15:43:36 -07:00
Eric Anholt
363d0f6774 i965: Add GLSL IR-level source annotation and comments to new FS debug.
This should make debugging way easier, as now we have context for
reading large programs.
2010-08-26 14:55:44 -07:00
Eric Anholt
7268bd82f6 i965: Use the implied move in brw_math() in the new FS. 2010-08-26 14:55:44 -07:00
Eric Anholt
e85f8272d0 i965: Add support for in varyings to the new FS codegen.
At least some tests, like glsl-vs-sign, now work.
2010-08-26 14:55:44 -07:00
Eric Anholt
dcb7c0009b i965: Start building the codegen visitor.
This can successfully emit a real program that generates magenta now.
2010-08-26 14:55:44 -07:00
Eric Anholt
9763d0a82a i965: Start building direct GLSL2 IR to 965 assembly codegen.
Our channel-expressions and vector-splitting changes now happen into a
private copy of the IR that we maintain for ourselves.  Uniform
assignment still happens by the core, so we continue using Mesa IR
generation not just for swrast fallbacks but also for uniform values
(since there's no storage for their contents other than
shader_program->FragmentProgram->Parameters->ParameterValues).  And
most importantly, at the moment no actual codegen is hooked up other
than emitting our favorite color to the framebuffer.
2010-08-26 14:55:44 -07:00
Eric Anholt
c1dfdcb93a i965: Add new pass to split vectors into scalar variables
Combined with the previous pass, this lets other optimization passes
do their work thanks to ir_tree_grafting.  Still have regression in
instruction count with INTEL_NEW_FS, but register count is even
better.
2010-08-26 14:55:44 -07:00
Eric Anholt
3a8ad33dde i965: Add a pass for the FS to reduce vector expressions down to scalar.
This is a step towards implementing a GLSL IR backend for the 965
fragment shader.  Because it has downsides with the current codegen,
it is hidden under the environment variable INTEL_NEW_FS.

This results in an increase in instruction count at the moment (1444
-> 1752 for glsl-fs-raytrace, 345 -> 359 on my demo), because dot
products are turned into a series of multiplies and adds instead of a
custom expansion of MULs and MACs, and by not splitting the variable
types up we don't get tree grafting and thus there are extra moves of
temporary storage.  However, register count drops for the non-GLSL
path (64 -> 56 on my demo shader) because the register allocator sees
all the sub-operations.
2010-08-26 14:55:43 -07:00
Eric Anholt
a1bebf73df i965: Start building 965 FS backend. 2010-08-26 14:55:43 -07:00
Brian Paul
4418a493c2 llvmpipe: fix PIPE_CAP_MAX_VERTEX_TEXTURE_UNITS query
Fixes crashes in glean glsl1 and demos/src/glsl/vert-tex.
See comments for details.
2010-08-26 15:54:51 -06:00
José Fonseca
98ccee9ea6 graw: Add copyright headers to the interfaces. 2010-08-26 22:32:47 +01:00
Eric Anholt
264ba1ab88 ir_to_mesa: Don't assume that an ir_dereference_array is of a variable.
Fixes:
glsl-array-bounds-02 (software)
glsl-array-bounds-04
glsl-array-bounds-06 (software)
glsl-array-bounds-08
2010-08-26 11:23:09 -07:00
Eric Anholt
2db7bb9c66 glsl: Add a quick hack to constant folding to reduce duplicated work.
Reduces runtime of glsl-max-varyings 92% on my system.
2010-08-26 10:53:20 -07:00
Vinson Lee
9b4384c322 st/mesa: Remove unnecessary header. 2010-08-26 10:38:28 -07:00
José Fonseca
64b5a81e19 scons: Fix inverted logic. 2010-08-26 18:29:04 +01:00
Brian Paul
b8c53caac8 docs: update news.html with 7.8.2 release info 2010-08-26 11:24:22 -06:00
Brian Paul
30cd76ebbd docs: remove links to tungstengraphics.com, and misc updates 2010-08-26 11:20:48 -06:00
Brian Paul
59c9144e37 docs: remove link to old memory.html page 2010-08-26 11:20:48 -06:00
José Fonseca
58087b8d27 scons: Add glsl_symbol_table.cpp 2010-08-26 18:19:57 +01:00
Eric Anholt
9629dbf4f2 i965: Add support for destination RelAddr writes in the VS.
Fixes: glsl-vs-varying-array
2010-08-26 09:53:01 -07:00
Eric Anholt
b72c85df55 i965: Fix the test for variable indexing of shader inputs.
Shader inputs appear in source registers, not dst registers.  Catches
unsupported shaders in glsl-fs-varying-array and Humus
RaytracedShadows.
2010-08-26 09:53:01 -07:00
Ian Romanick
de3b40d8cd glsl2: Remove a couple FINISHME comments that have already been resolved 2010-08-26 09:24:58 -07:00
Kenneth Graunke
a044285e25 glsl: Move built-ins to live beyond the global scope.
Per the GLSL 1.20 specification (presumably a clarification of 1.10).

Also, when creating user functions, make a new ir_function that shadows the
built-in ir_function, rather than adding new signatures.  User functions
are supposed to hide built-ins, not overload them.

Fixes piglit tests redeclaration-{04, 12, 14}.vert.
2010-08-26 09:19:48 -07:00
Kenneth Graunke
b6f15869b3 glsl: Move is_built_in flag from ir_function_signature to ir_function.
Also rename it to "is_builtin" for consistency.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2010-08-26 09:19:48 -07:00
Kenneth Graunke
5d25746640 glsl: Refactor variable declaration handling.
Moving the check for an earlier variable declaration helps cleanly
separate out the re-declaration vs. new declaration code a bit.  With
that in place, conflicts between variable names and structure types or
function names aren't caught by the earlier "redeclaration" error
message, so check the return type on glsl_symbol_table::add_variable
and issue an error there.  If one occurs, don't emit the initializer.

Fixes redeclaration-01.vert and redeclaration-09.vert.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2010-08-26 09:19:48 -07:00
Kenneth Graunke
ac2376e6f5 glsl: Don't add overloads to existing structure constructors.
Instead, make a new ir_function and try to add it to the symbol table.

Fixes piglit test redeclaration-08.vert.
2010-08-26 09:19:48 -07:00
Kenneth Graunke
e09591317b glsl: Remove name_declared_this_scope check when adding functions.
Instead, rely on the symbol table's rules.

Fixes redeclaration-02.vert.
2010-08-26 09:19:48 -07:00
Kenneth Graunke
e9c7ceed27 glsl: Use a single shared namespace in the symbol table.
As of 1.20, variable names, function names, and structure type names all
share a single namespace, and should conflict with one another in the
same scope, or hide each other in nested scopes.

However, in 1.10, variables and functions can share the same name in the
same scope.  Structure types, however, conflict with/hide both.

Fixes piglit tests redeclaration-06.vert, redeclaration-11.vert,
redeclaration-19.vert, and struct-05.vert.
2010-08-26 09:19:48 -07:00
Brian Paul
86ddb356e8 st/mesa: add missing packed depth/stencil formats in st_format_datatype()
Fixes llvmpipe regression from one of the prev commits.
2010-08-26 09:20:21 -06:00
Brian Paul
7b07674667 mesa: fix mixed-up function call name 2010-08-26 08:59:54 -06:00
Nick Bowler
e71a9042cb mesa: Identify packed depth/stencil buffers using the Format field.
Intel sometimes uses packed depth/stencil buffers even when only a depth
buffer or only a stencil buffer was requested.  Common code currently
uses the _BaseFormat field to determine whether a depth/stencil wrapper
is necessary.  But unless the user explicitly requested a packed
depth/stencil buffer, the _BaseFormat field does not encode this
information, and the required wrappers are not created.

The problem was introduced by commit 45e76d2665 ("mesa: remove a
bunch of gl_renderbuffer fields"), which killed off the _ActualFormat
field upon which the decision to create a wrapper used to be made.  This
patch changes the logic to use the Format field instead, which is more
like the old code.

Fixes fdo bug 27590.

Signed-off-by: Nick Bowler <nbowler@draconx.ca>
Signed-off-by: Brian Paul <brianp@vmware.com>
2010-08-26 08:42:24 -06:00
Nick Bowler
bda941e1b8 intel: Merge identical cases in switch statement.
Signed-off-by: Nick Bowler <nbowler@draconx.ca>
Signed-off-by: Brian Paul <brianp@vmware.com>
2010-08-26 08:19:35 -06:00
Andre Maasikas
0599509fc4 r600: fix vertex buffer size calculation
when we dont know max_index we cannot calculate vb size from count
anymore - just use the bo size.
Also added an assert to remind that we dont handle GL_INT GL_DOUBLE
upload when we dont' know max_index - will fix later
2010-08-26 16:55:21 +03:00
José Fonseca
90437330e2 graw: Undo late loading of graw drivers.
Keith prefers a clean separation between graw applications and
implementations, where apps do not link libgallium.a but instead
get all functionality they need via graw interface.

Although this is not incompatible with late loading of graw drivers, it
it would make it very hard to maintain, as wrappers for every utility
symbol exposed in graw would have to be written or generated somehow.
2010-08-26 11:37:42 +01:00
Chia-I Wu
0f74efdef0 st/mesa: Fix glEGLImageTargetTexture2DOES.
stObj->pt should be set in st_bind_surface, just as in st_TexImage.  On
the other hand, st_TexImage should unreference stObj->pt.  It also needs
to initialize the texture image again as _mesa_clear_texture_object
clears the image.
2010-08-26 16:40:01 +08:00
Chia-I Wu
4f6faf65d1 st/egl: Add support for EGL_MESA_image_drm. 2010-08-26 16:40:01 +08:00
Chia-I Wu
9b6a63a0e2 st/egl: Add support for EGL_KHR_surfaceless_*. 2010-08-26 16:40:01 +08:00
Chia-I Wu
41c095bf31 st/mesa: Add support for surfaceless current contexts.
A surfaceless current context is a context that is made current without
draw and read framebuffers.  Such contexts can only render to FBOs.
2010-08-26 16:40:01 +08:00
Chia-I Wu
c5279fd795 st/egl: Make KMS support optional in KMS backend.
It should be called DRM backend now.
2010-08-26 16:40:01 +08:00
Vinson Lee
038068909f r300g: Include missing header in r300_texture_desc.h.
Include p_format.h for enum pipe_format symbol.

Fixes r300g build.
2010-08-26 01:38:23 -07:00
Vinson Lee
121b6d68c2 gallium: Clean up header file inclusion in p_defines.h.
Remove p_format.h.
Include p_compiler.h for boolean and uint64_t symbols.
2010-08-26 01:30:50 -07:00
Vinson Lee
81ac08f89d gallium: Clean up header file inclusion in p_context.h.
Remove p_state.h.
Include p_compiler.h for boolean symbol.
Add needed forward declarations after removing p_state.h.
2010-08-26 01:21:10 -07:00
Vinson Lee
2badf0f642 graw: Include missing header in graw_dl.h.
Include p_state.h for pipe_shader_state symbol.
2010-08-26 01:14:28 -07:00
Vinson Lee
57ce0de8cb util: Include missing header in u_simple_shaders.c.
Include p_state.h for PIPE_MAX_COLOR_BUFS symbol.
2010-08-26 01:08:30 -07:00
Vinson Lee
f099e73b7b tgsi: Include missing header in tgsi_sse2.h.
Include p_compiler.h for boolean symbol.
Clean up forward declarations.
2010-08-26 00:34:30 -07:00
Vinson Lee
b47af6ad6d rtasm: Include missing header in rtasm_x86sse.h.
Include p_compiler.h for stdint.h uint*_t symbols.
2010-08-26 00:29:58 -07:00
Vinson Lee
7822f99193 pipebuffer: Clean up header file inclusion in pb_bufmgr.h.
Remove p_compiler.h and p_defines.h.
Include pb_buffer.h for pb_size symbol.
2010-08-26 00:22:19 -07:00
Eric Anholt
9fd2a8d692 glsl2: Move ir_expression_flattening to using the rvalue visitor class.
The previous implementation was missing handling of some rvalues, such
as "if" conditions, leading to glsl-mat-int-from-ctor-* not getting
caught.
2010-08-26 00:15:18 -07:00
Eric Anholt
c735d85395 glsl: Don't consider things with a type containing a sampler as an lvalue.
We had ad-hoc handled some common cases by flagging sampler-typed
variables as read_only, and rejected initializers of samplers.
However, people could sneak them in in all sorts of surprising ways,
like using whole-array or structure assignment.

Fixes:
glslparsertest/glsl2/sampler-01.frag
glslparsertest/glsl2/sampler-03.frag
glslparsertest/glsl2/sampler-04.frag
glslparsertest/glsl2/sampler-06.frag

Bug #27403.
2010-08-25 23:43:21 -07:00
Eric Anholt
aa2f55883b mesa: Disable the debug spam for x86 CPU detection with a compile-time flag.
I don't know of any problems with CPU detection in years.  Don't spam
the user that was just looking to enable assertions with this stuff.
2010-08-25 23:43:21 -07:00
Eric Anholt
7af8f7f164 mesa: Move the x86 detection debug messages next to the detection. 2010-08-25 23:43:21 -07:00
Eric Anholt
0673b46933 mesa: Don't warn when the desired result of s3tc lib available occurs. 2010-08-25 23:43:21 -07:00
Vinson Lee
d8ad10dc45 util: Include missing header in u_blit.h.
Include p_compiler.h for uint symbol.
Clean up forward declarations.
2010-08-25 23:37:27 -07:00
Vinson Lee
3e41029d6e util: Include missing header in u_bitmask.h.
Include p_compiler.h for boolean symbol.
2010-08-25 23:31:04 -07:00
Vinson Lee
d2dd23e858 util: Include missing header in u_dirty_surfaces.h.
Include p_state.h for pipe_surface symbol.
2010-08-25 23:04:39 -07:00
Vinson Lee
c7111f321c util: Add include guard in u_split_prim.h. 2010-08-25 22:55:15 -07:00
Vinson Lee
cc3e322d96 util: Include missing headers in u_split_prim.h.
Include p_compiler.h for boolean symbol.
Include u_debug.h for assert symbol.
2010-08-25 22:51:15 -07:00
José Fonseca
43d94dba5f graw: Remove graw-null.
Pointless now that the graw tests can be built independently of any graw
implementation.
2010-08-26 06:47:24 +01:00
José Fonseca
f0eb02af80 graw: Dynamically load graw libraries.
This allows to build multiple graws libs simultaneously and avoid
unnecessary rebuilds of the tests.

Also remove graw_util.c from inside the graw implementation -- it was
only being provided by one implementation, and graw tests were linking
against gallium anyway.
2010-08-26 06:44:34 +01:00
José Fonseca
c32f87c39c scons: Fix old script compatability logic.
Sconscript could be invoked twice if specified in the command line.
2010-08-26 06:44:34 +01:00
Vinson Lee
58cfbd697d util: Include missing headers in u_tile.h.
Include p_format.h for enum pipe_format symbol.
Include p_state.h for pipe_box symbol.
2010-08-25 22:41:20 -07:00
Vinson Lee
c65c86cfe7 util: Clean up header file inclusion in u_upload_mgr.h.
Remove p_defines.h.
Remove unnecessary forward declarations.
Add forward declaration for pipe_context.
2010-08-25 22:34:31 -07:00
Marek Olšák
c1ab2c327e r300g: fix constant buffer upload once again for r3xx->r4xx 2010-08-26 07:19:10 +02:00
Vinson Lee
fdf054a585 r600: Remove unnecessary headers. 2010-08-25 18:06:01 -07:00
Vinson Lee
d430aea8bc r300: Remove unnecessary header. 2010-08-25 18:00:23 -07:00
Eric Anholt
b2872ea353 Revert "mesa: Don't add 1 to GL_ACTIVE_UNIFORM_MAX_LENGTH."
This reverts commit 001a7bfdfc.  I
hadn't found the section of the spec clarifying that the old behavior
was right.  Reverting fixes the new version of the testcase, and the
Humus demos that could no longer find their uniforms.

Bug #29782
Bug #29783
2010-08-25 16:45:31 -07:00
Aras Pranckevicius
5226f8c7b0 glsl: fix crash with variable indexing into array in a struct
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2010-08-25 16:22:44 -07:00
Eric Anholt
a1f2ac2b37 i965: Fix detection of implicit MOVs to message regs in brw_optimize.c.
Texcoords in AmbientApertureLighting were getting trashed since the
move of math arguments to implied moves, due to the logic for
detecting ALU message reg writes overriding the logic for SEND
implicit message reg writes.
2010-08-25 16:03:56 -07:00
Marcin Slusarz
a49167c1c0 nouveau: handle early initialization errors
handle very early errors in pipe_screen creation (failure of
nouveau_screen_init in nv50_screen_create)

Signed-off-by: Francisco Jerez <currojerez@riseup.net>
2010-08-26 00:28:01 +02:00
Jerome Glisse
bd25e23bf3 r600g: simplify states
Directly build PM4 packet, avoid using malloc (no states are
bigger than 128 dwords), remove unecessary informations,
remove pm4 building in favor of prebuild pm4 packet.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-08-25 17:41:50 -04:00
Eric Anholt
b5c07b9226 mesa: Remove now-unused _mesa_add_sampler().
We do the generation of "what sampler number within Parameters are we"
right in ir_to_mesa.cpp, instead of repeatedly walking the existing
list to find out.
2010-08-25 12:38:32 -07:00
Eric Anholt
aa452e20bf ir_to_mesa: Add support for samplers in structures.
Fixes:
glsl-fs-uniform-sampler-struct
glsl-fs-sampler-numbering-3
Bug #29690
2010-08-25 12:38:27 -07:00
Eric Anholt
9ab1332d74 mesa: Remove now-unused _mesa_add_uniform.
We had to inline it to avoid doing a double-lookup in the process of
adding assertion checks.
2010-08-25 12:38:27 -07:00
Eric Anholt
0924ba0c34 ir_to_mesa: Convert this code to using linker.cpp's uniform locations.
Fixes: glsl-fs-uniform-array-4.
2010-08-25 12:38:26 -07:00
Eric Anholt
45388b5467 glsl: Make uniform linking generate separate uniforms for struct members.
This is a step towards making the linker code usable as our uniform
setup, instead of having it wedged into ir_to_mesa.cpp.
2010-08-25 12:38:26 -07:00
Eric Anholt
ea2231ff5e mesa: Remove the "Used" flag in gl_program_parameter.
This was in place for uniform handling, but nothing actually needs the
value now, since presence in a parameter list indicates that the
uniform was used as far as the linker was concerned.
2010-08-25 12:38:26 -07:00
Marek Olšák
bcca7fd5d5 r300/compiler: emulate relative addressing with negative offsets in VS
3 more piglits, cool.
2010-08-25 21:22:56 +02:00
Vinson Lee
721954c334 nvfx: Set pointer to NULL after free.
Guard against potential use after free.
2010-08-25 11:22:55 -07:00
Marek Olšák
dc27515780 r300g: fix potentially uninitialized variables in create_rs_state
It had no impact on correctness, though.

Reported by Vinson Lee.
2010-08-25 20:10:06 +02:00
Vinson Lee
92cfcc2afd st/mesa: Remove unnecessary header. 2010-08-25 10:06:05 -07:00
Keith Whitwell
d4bfd8a24a llvmpipe: fix bad patch application 2010-08-25 18:01:51 +01:00
Vinson Lee
14ac294e1a llvmpipe: Remove unnecessary header. 2010-08-25 09:55:07 -07:00
Aras Pranckevicius
653ddaab26 glsl/mesa: fixes for MSVC
Signed-off-by: Brian Paul <brianp@vmware.com>
2010-08-25 09:21:10 -06:00
Kristian Høgsberg
f301932dba intel: Support EGL_MESA_image_drm 2010-08-25 09:17:48 -04:00
Kristian Høgsberg
9087ba1280 intel: Take an intel_screen pointer in intel_alloc_region_* functions 2010-08-25 09:17:48 -04:00
Kristian Høgsberg
5aaa53e66c egl_dri2: Add support for MESA_image_drm 2010-08-25 09:17:48 -04:00
Kristian Høgsberg
b7a8893a24 egl: Add EGL_MESA_drm_image extension
Create EGLImages from DRM buffer handles.
2010-08-25 09:17:47 -04:00
Keith Whitwell
29bcbf5e79 llvmpipe: track drawing region as a single u_rect 2010-08-25 10:29:27 +01:00
Keith Whitwell
d808f7b53e llvmpipe: better triangle debugging 2010-08-25 10:29:27 +01:00
Keith Whitwell
c25151dd6a llvmpipe: cull zero-area triangles early 2010-08-25 10:29:27 +01:00
Keith Whitwell
98f3ff8f4a llvmpipe: more rasterization counters 2010-08-25 10:29:27 +01:00
Keith Whitwell
5a45e53df4 llvmpipe: move some fence functions into lp_screen.c 2010-08-25 10:29:27 +01:00
Keith Whitwell
1e926fe42a llvmpipe: wake all threads waiting on a fence 2010-08-25 10:29:27 +01:00
Keith Whitwell
b6e03eafe3 llvmpipe: fence debugging, add llvmpipe_finish 2010-08-25 10:29:27 +01:00
Keith Whitwell
285ea417ef tgsi: helper for dumping tokens as hex 2010-08-25 10:29:26 +01:00
Keith Whitwell
6c0dc4bafb draw: specialized cliptesting routines 2010-08-25 10:29:21 +01:00
Keith Whitwell
4cef308726 util: add rectangle helpers to u_rect.h
This begins a process of repurposing this file.  The existing usage is
as a header file for some software blit fallbacks, which should be
moved to a more appropriately named header.
2010-08-25 10:07:36 +01:00
Keith Whitwell
bc3cff2a4f gallium/docs: notes on scissor state 2010-08-25 10:07:36 +01:00
Keith Whitwell
f77daaa882 llvmpipe: remove dead code 2010-08-25 10:07:36 +01:00
Chia-I Wu
d29d7807c1 draw: Remove UNDEFINED_VERTEX_ID checks in emit pathes.
UNDEFINED_VERTEX_ID is used by draw_pipe_vbuf to decide whether a vertex
has been emitted or not.  The non-pipeline pathes do not use it (they
tell the frontend the max vertex count when prepare() is called).
2010-08-25 16:23:01 +08:00
Chia-I Wu
22f6026324 gallium: Use draw_set_index_buffer and others.
Update all drivers to use draw_set_index_buffer,
draw_set_mapped_index_buffer, and draw_vbo.  Remove
draw_set_mapped_element_buffer and draw_set_mapped_element_buffer_range.
2010-08-25 16:06:45 +08:00
Chia-I Wu
94e8d4171d svga: Remove redundant svga_draw_range_elements.
That is, implement draw_vbo directly.  As a result,
svga_swtnl_draw_range_elements is also replaced by svga_swtnl_draw_vbo.

This commit should not have any functional change.
2010-08-25 16:06:38 +08:00
Chia-I Wu
4f024e0f64 draw: Add draw_set_index_buffer and others.
This commit adds draw_set_index_buffer, draw_set_mapped_index_buffer,
and draw_vbo.  The idea behind the new functions is that an index buffer
should be a state.

draw_arrays and draw_set_mapped_element_buffer are preserved, but the
latter will be removed soon.
2010-08-25 16:06:37 +08:00
Vinson Lee
4e82319733 nvfx: Clean up header file inclusion in nvfx_screen.h.
Remove nvfx_context.h.
Include p_compiler.h for INLINE symbol.

Fixes nvfx_context.h -> nvfx_screen.h -> nvfx_context.h include recursion.
2010-08-25 00:52:34 -07:00
Vinson Lee
fbc3a911e1 nvfx: Include missing headers in nvfx_shader.h.
Include stdint.h for uint8_t symbol.
Include p_compiler.h for INLINE symbol.
2010-08-25 00:44:28 -07:00
Vinson Lee
cc4925bfe6 i965: Remove unnecessary header. 2010-08-25 00:40:00 -07:00
Vinson Lee
a8177e7456 r600: Include missing header in evergreen_fragprog.c.
Include r600_emit.h for r600EmitShader and r600EmitShaderConsts symbols.

Fixes the following GCC warnings.
evergreen_fragprog.c: In function 'evergreenSetupFragmentProgram':
evergreen_fragprog.c:521: warning: implicit declaration of function 'r600EmitShader'
evergreen_fragprog.c:778: warning: implicit declaration of function 'r600EmitShaderConsts'
2010-08-25 00:29:19 -07:00
Vinson Lee
cab86cb765 r600: Include missing header in evergreen_vertprog.c.
Include r600_emit.h for r600EmitShader and r600EmitShaderConsts symbols.

Fixes the following GCC warnings.
evergreen_vertprog.c:614: warning: implicit declaration of function 'r600EmitShader'
evergreen_vertprog.c:701: warning: implicit declaration of function 'r600EmitShaderConsts'
2010-08-25 00:19:45 -07:00
Vinson Lee
deffeba172 gallivm: Include missing header in lp_bld_sample.h.
Include p_format.h for enum pipe_format symbol.
2010-08-24 23:53:26 -07:00
Vinson Lee
72ae834fa1 gallivm: Include missing header in lp_bld_pack.h.
Include p_compiler.h for boolean symbol.
2010-08-24 23:50:45 -07:00
Vinson Lee
0ae6b30c14 r300/compiler: Silence uninitialized variable warning.
The variable loops would be used uninitialized if it ever processed a
RC_OPCODE_ENDLOOP case first.

This patch initalizes the loops variable to NULL and adds an assert at
the RC_OPCODE_ENDLOOP case that loops isn't NULL.

Silence the following GCC warning.
r3xx_vertprog.c: In function 'translate_vertex_program':
r3xx_vertprog.c:469: warning: 'loops' may be used uninitialized in this function
2010-08-24 23:04:20 -07:00
Vinson Lee
19f9340e67 r300g: Add missing comma in SConscript.
This is a follow-on patch to commit
574ba4b5f5.

Fixes r300g SCons build.
2010-08-24 22:28:21 -07:00
Marek Olšák
879a730231 r300g: fix gl_PointCoord
Is this hackish or is this the correct way to use point_quad_rasterization?
Copied from nvfx.
2010-08-25 04:57:11 +02:00
Vinson Lee
3a97ec7f48 r600: Include missing header in evergreen_render.c.
Fixes the following GCC warning.
evergreen_render.c: In function 'evergreenTryDrawPrims':
evergreen_render.c:836: error: implicit declaration of function 'evergreenSetupFragmentProgram'
2010-08-24 19:08:47 -07:00
Vinson Lee
8cf7eaf3ff r600: Remove unused variable.
Silences the following GCC warning.
evergreen_state.c: In function 'evergreenSetBlendState':
evergreen_state.c:341: warning: unused variable 'id'
2010-08-24 19:04:19 -07:00
Vinson Lee
e96b311037 i965: Fix printf format warnings on 32-bit builds. 2010-08-24 18:51:56 -07:00
Vinson Lee
3db9d4b253 r600: Remove unused variable.
Fixes the following GCC warning.
r600_emit.c In function 'r600AllocShaderConsts':
r600_emit.c:59: warning: unused variable 'out'
2010-08-24 18:32:51 -07:00
Vinson Lee
67925c6cd6 r600: Remove spaces between backslash and newline.
Fixes the following GCC warnings.
r600_cmdbuf.h:201: warning: backslash and newline separated by space
r600_cmdbuf.h:202: warning: backslash and newline separated by space
2010-08-24 18:20:26 -07:00
Marek Olšák
0a21938de9 r300g: eliminate unused constants in FS 2010-08-25 02:44:29 +02:00
Marek Olšák
abae06ac85 r300g: eliminate unused constants in VS 2010-08-25 02:44:29 +02:00
Marek Olšák
62eb9eda1d r300g: clean up some mess in set_constant_buffer 2010-08-25 02:44:29 +02:00
Marek Olšák
2eeaf773fd r300g: fix indentation 2010-08-25 02:44:28 +02:00
Marek Olšák
574ba4b5f5 r300/compiler: implement elimination of unused constants
Wine likes to create a *lot* of constants, exceeding the size of the constant
file in hw.
2010-08-25 02:44:28 +02:00
Marek Olšák
4b9b2a3cdc r300/compiler: terminate vertex shader compilation immediately after an error
Also rename "compiler" to "c".
2010-08-25 02:44:28 +02:00
Marek Olšák
1802007ee9 r300/compiler: fail to compile if we hit hw limits or an unimplemented feature
i.e. relative addressing (mainly FS), saturate modifiers, exceeding
the maximum number of constants.
2010-08-25 02:44:28 +02:00
Marek Olšák
6c88f84bdd r300/compiler: handle indexable temporaries correctly in deadcode elimination 2010-08-25 02:44:28 +02:00
Marek Olšák
3aee8c3b1d r300/compiler: disable register allocation for indexable temporaries in VS
If there is relative addressing of temporaries, we cannot change register
indices, so skip register allocation entirely. To utilize register allocation
at least partially, we need separate indexable and non-indexable register
files in both TGSI and Mesa IR.
2010-08-25 02:44:28 +02:00
Marek Olšák
cb925970ee r300g: reset the index bias to 0 at the end of CS 2010-08-25 02:44:28 +02:00
Marek Olšák
5755d1d6a7 ir_to_mesa: set IndirectRegisterFiles
This fixes relative addressing of temporaries (and maybe others)
in all gallium drivers.

Acked on irc by Eric Anholt.
2010-08-25 02:44:28 +02:00
Vinson Lee
57e66ed9b1 nvfx: Initialize variables on error path. 2010-08-24 17:40:50 -07:00
Eric Anholt
2f5bf20e44 glsl: Set up uniform initializers by walking the shaders after linking.
Previously, uniform initializers were handled by ir_to_mesa as it made
its Parameters list.  However, uniform values are global to all
shaders, and the value set in one Parameters list wasn't propagated to
the other gl_program->Parameters lists.  By going back through the
general Mesa uniform handling, we make sure that all gl_programs get
updated values, and also successfully separate uniform initializer
handling from ir_to_mesa gl_program generation.

Fixes:
glsl-uniform-initializer-5.
2010-08-24 16:37:02 -07:00
Eric Anholt
7de4d8fe11 glsl: Don't dead-code eliminate a uniform initializer.
Partial fix for glsl-uniform-initializer-5.
2010-08-24 16:37:02 -07:00
Dave Airlie
37f0654fa5 r300g: rename radeong_dri.so to r300_dri.so
acked on irc by Corbin + Marek.
2010-08-25 06:10:01 +10:00
Brian Paul
ad58f0d9e0 make: Use C++ compiler to link stdc++ library.
glxinfo and glxgears run on swrast and softpipe without undefined symbol
errors.
2010-08-24 12:18:09 -07:00
Vinson Lee
d3772eab2d configs: Remove -lstdc++ from default.
This patch undoes commit 9b7480cd95.

A follow-on patch will provide the proper fix.
2010-08-24 12:14:14 -07:00
Henri Verbeet
547e867558 r600g: Add support for PIPE_FORMAT_R32_FLOAT. 2010-08-24 20:52:21 +02:00
Ian Romanick
0eb2026c87 prog_execute: Implement OPCODE_TXL
Fixes bugzilla #29628
2010-08-24 10:27:14 -07:00
Brian Paul
81137623e5 glsl2: rename local variable_entry class
With MSVC it seems that this class and its constructor is colliding
with the one in ir_variable_refcount.cpp.  Rename the class here to
avoid the collision.

This is a bit of a hack.  Can the two variable_entry classes be merged
and shared?
2010-08-24 10:21:27 -06:00
Brian Paul
2eb8b2d3bb glsl2: move constructor into .cpp file to work around compiler bug
Fixes fd.o bug 29770

The refcount==0 assertion only failed on some systems.  One example
being 32-bit Linux with gcc 4.4.4.
2010-08-24 10:01:44 -06:00
Brian Paul
f3ec111b0a docs: updated info about GLSL compiler
Ian or Eric should review this and add/edit as needed.
2010-08-24 09:02:08 -06:00
Brian Paul
484dde2d63 docs: list the new GLSL compiler 2010-08-24 09:01:54 -06:00
Brian Paul
f82163b012 mesa: added isblank() for MSVC 2010-08-24 08:04:37 -06:00
Brian Paul
d902eb59d5 mesa: remove non-existant files from tarball list 2010-08-24 07:51:52 -06:00
Vinson Lee
c8b26c63fd glsl: Add assert to check variable_entry referenced_count after construction.
A variable_entry after construction should have its referenced_count
member set to 0. However, occassionally this isn't the case and
entry->referenced_count has been observed to be a garbage value. This
leads to crashes of several tests in the Piglit test suite.

This patch adds an assert to check that a variable_entry instance has
its referenced_count member initialized to 0 after construction.
2010-08-24 01:16:46 -07:00
Vinson Lee
b018ea19a3 nvfx: Remove unnecessary headers. 2010-08-23 23:58:57 -07:00
Dave Airlie
f122dba59a glsl: make 'make clean' work properly.
this has make clean remove all the objects.
2010-08-24 16:10:28 +10:00
Vinson Lee
e5df3cc286 glsl: Silence unused variable warning.
The variable is used but only in the body of an assert.
2010-08-23 22:27:49 -07:00
Vinson Lee
b48f20dab8 r300g: Remove unused variable.
Fixes this GCC warning.
r300_render.c: In function 'r300_draw_flush_vbuf':
r300_render.c:988: warning: unused variable 'r300_render'
2010-08-23 22:15:24 -07:00
Chia-I Wu
1288d5c392 st/egl: Fix r300/r600 support in KMS backend.
When the kernel driver name is radeon, ask the loader for r300 or r600
depending on the PCI ID.
2010-08-24 11:50:37 +08:00
Chia-I Wu
65741c596f targets/egl: Check against drm_driver_descriptor::name.
drm_driver_descriptor::driver_name is defined to be the name of the
kernel module.  We should check against drm_driver_descriptor::name
instead of drm_driver_descriptor::driver_name.
2010-08-24 11:50:36 +08:00
Benjamin Franzke
0ba1643658 targets/egl: add pipe_r600
KNOWN ISSUE: eglShowScreenSurfaceMESA in st/egl/kms fails
but st/egl/x11 works
2010-08-24 11:50:36 +08:00
Benjamin Franzke
ce7016e882 targets/egl: rename pipe_radeon to pipe_r300
st/egl/x11/x11_screen.c requests a driver named r300 not radeon

KNOWN ISSUE: breaks st/egl/kms/
	st/egl/kms requests a pipe named "radeon"
	that will not be found now

	so why not leaving pipe_radeon there?
	that was possible as long we have only r300g.
	now there is also r600g for which st/egl/kms also
	requests a pipe named "radeon"
	(possible solution in later commit)
2010-08-24 11:50:36 +08:00
Chia-I Wu
9dd95b46c8 mesa: Remove extraneous semicolon. 2010-08-24 11:49:55 +08:00
Chia-I Wu
d473543069 st/dri: Remove unnecessary main/mtype.h. 2010-08-24 11:36:52 +08:00
Chia-I Wu
59e6e76542 st/wgl: Include main/core.h.
Make st/wgl include only main/core.h from core mesa.
2010-08-24 11:36:48 +08:00
Chia-I Wu
40fd4323b4 st/glx: Include main/core.h.
Make st/glx include only main/core.h from core mesa.
2010-08-24 11:28:12 +08:00
Chia-I Wu
bfd7c9ac22 glsl: Include main/core.h.
Make glsl include only main/core.h from core mesa.
2010-08-24 11:27:29 +08:00
Chia-I Wu
f90b5936d0 mesa: Add core.h.
core.h is the public header of core mesa.  GLX, WGL, and GLSL are
supposed to include this header file.  It should be noted that headers
included by core.h must not perform feature tests (#if FEATURE_xxx).
Otherwise, we cannot, for example, mix a FEATURE_ES2 libmesagallium.a
with a FEATURE_GL libglsl.a.
2010-08-24 11:00:29 +08:00
Luca Barbieri
6b6b454037 translate_sse: clear state for each function emission
Fixes #29771.
2010-08-24 04:18:11 +02:00
Eric Anholt
8dd619ba68 glsl: Rely on talloc_autofree_context() instead of trying to free on our own.
Because the static types talloc their names at dlopen time,
talloc_freeing the types at DRI driver screen teardown means that if
the screen gets brought back up again, the names will point at freed
memory.  talloc_autofree_context() exists to do just what we want
here: Free memory referenced across the program's lifetime so that we
avoid noise in memory leak checkers.

Fixes: bug #29722 (assertion failure in unigine).
2010-08-23 17:25:38 -07:00
Eric Anholt
e0564d56b1 intel: Add support for MAX_SAMPLES=1 EXT_framebuffer_multisample.
The spec specifically sets the minimum MAX_SAMPLES at 1 to allow exposing
the extension on all implementations, so do so.
2010-08-23 17:25:38 -07:00
Alex Deucher
d1b4f40347 radeon: print chip family for evergreen in renderer string 2010-08-23 20:18:28 -04:00
Dave Airlie
0e6a02d299 r600g: add XPD support
ported from r600c.
2010-08-24 09:56:22 +10:00
Dave Airlie
87f44d5723 r600g: add CMP support.
ported from r600c, fixes fp-cmp, glsl1-sqrt*
2010-08-24 09:18:32 +10:00
Luca Barbieri
c60c2d3a64 nvfx: don't emit dummy commands on nv30
Should fix errors on the original nv30, reported by pmdata.
2010-08-24 00:05:27 +02:00
Eric Anholt
e11757bb89 glsl: When unable to assign the initializer for a const variable, set it to 0.
This prevents assertion failures or cascading errors after we've
logged the fact that we were unable to handle the initializer.

Fixes unsized-array-non-const-index-2.vert
2010-08-23 14:58:38 -07:00
Luca Barbieri
d1e6b31cb8 translate_sse: fix x86-64 2010-08-23 23:23:27 +02:00
Eric Anholt
76e96d74f4 glsl: Cleanly fail when a function has an unknown return type.
Bug #29608.
2010-08-23 13:27:36 -07:00
Henri Verbeet
6fb39f0fa2 r600g: Add support for PIPE_CAP_DEPTH_CLAMP. 2010-08-23 22:13:18 +02:00
Eric Anholt
b75645d8ad glsl: Rebuild builtins for any() change. 2010-08-23 13:06:02 -07:00
Eric Anholt
5e9ac94cc4 mesa: Add new ir_unop_any() expression operation.
The previous any() implementation would generate arg0.x || arg0.y ||
arg0.z.  Having an expression operation for this makes it easy for the
backend to generate something easier (DPn + SNE for 915 FS, .any
predication on 965 VS)
2010-08-23 13:05:53 -07:00
Eric Anholt
47003a8f65 glsl: Regenerate builtins with the new sorting. 2010-08-23 12:58:07 -07:00
Eric Anholt
66afcb5607 ir_to_mesa: Implement f2b by comparing the arg to 0, not the result.
Fixes: glsl-fs-any
2010-08-23 12:58:07 -07:00
Eric Anholt
18a6023900 glsl: Count function call outvals as writing to variables for linker checks.
Fixes: glsl-vs-position-outval.  Bug #28138 (regnum online)
2010-08-23 12:57:59 -07:00
Ian Romanick
6dad5a4e8d glsl2: Include imports.h to get snprintf wrapper for MSVC
Signed-off-by: José Fonseca <jfonseca@vmware.com>
2010-08-23 20:55:50 +01:00
Aras Pranckevicius
44a6c13ac3 mesa: Fix msvc build of glsl.
Signed-off-by: José Fonseca <jfonseca@vmware.com>
2010-08-23 20:55:50 +01:00
Luca Barbieri
c0eb479e07 auxiliary: fix nvfx/nv50 primitive splitting for line loops
s->close_first was on the wrong side of the inequality.

Caught by blender.
Thanks to AndrewR for reporting this.
2010-08-23 21:47:47 +02:00
Jerome Glisse
bcf7f66a93 r600g: export one component per pixel + r7xx uncompression shader
We need to always at least export one component (wether it's depth
or color. Add valid r7xx shader program for depth decompression.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-08-23 15:42:32 -04:00
Kenneth Graunke
6355ae2b80 generate_builtins.py: Generate output in sorted order. 2010-08-23 12:36:40 -07:00
Luca Barbieri
4ab1001ac2 nvfx: improve fp temp accounting 2010-08-23 20:35:56 +02:00
Brian Paul
4b2b5f8e30 tgsi: fix false CondStackTop==0 assertion 2010-08-23 12:15:40 -06:00
Eric Anholt
ebef040117 ir_to_mesa: Fix constant array handling to return the temp we created.
We ended up returning CONST[loc] rather than TEMP[loc2].  Things would
*usually* end up working out OK, since the constants often ended up
getting allocated to CONST[loc..loc+columns] with no swizzle.  But for
the case where the contigous temporary copy of the swizzled constant
vec4 args was actually needed, we'd end up reading some other constant
values, possibly including ones not actually allocated.

Fixes: glsl-varying-mat3x2.
2010-08-23 11:03:13 -07:00
Carl Worth
61f73fec53 glcpp: Make standalone preprocessor work with a tty as stdin
Previously glcpp would silently abort if it couldn't fstat the file being
read, (so it would work with stdin redirected from a file, but would not
work with stdin as a tty). The stat was so that glcpp could allocate
a buffer for the file content in a single call.

We now use talloc_realloc instead, (even if the fstat is
possible). This is theoretically less efficient, but quite irrelevant,
(particularly because the standalone preprocessor is used only for
testing).
2010-08-23 10:48:10 -07:00
Carl Worth
21560c40e8 glcpp: Fix test suite to avoid flagging failed tests as valgrind errors.
We recently added several tests that intentionally trigger
preprocessor errors. During valgrind-based testing, our test script
was noticing the non-zero return value from the preprocessor and
incorrectly flagging the valgrind-based test as failing.

To fix this, we make valgrind return an error code that is otherwise
unused by the preprocessor.
2010-08-23 10:48:10 -07:00
Carl Worth
cf8bb19a11 glcpp: Fix segfault in standalone preprocessor for "file not found", etc.
This error message was missing so that the program would simply
segfault if the provided filename could not be opened for some reason.

While we're at it, we add explicit support for a filename of "-" to
indicate input from stdin.
2010-08-23 10:48:10 -07:00
Carl Worth
eab206510f glcpp: Update generated glcpp-lex.c for the last two changes.
This fixes both "#line 0" and "#line XXX YYY" as described in the two
most recent commits.
2010-08-23 10:48:10 -07:00
Carl Worth
c2280e6381 glcpp: Fix handling of "#line 0"
The existing DECIMAL_INTEGER pattern is the correct thing to use when
looking for a C decimal integer, (that is, a digit-sequence not
starting with 0 which would instead be an octal integer).

But for #line, we really want to accept any digit sequence, (including
"0"), and always interpret it as a decimal constant. So we add a new
DIGITS pattern for this case.

This should fix the compilation failure noted in bug #28138

	https://bugs.freedesktop.org/show_bug.cgi?id=28138

(Though the generated file will not be updated until the next commit.)
2010-08-23 10:48:10 -07:00
Carl Worth
ff10d239af glcpp: Fix source numbers set with "#line LINE_NUMBER SOURCE_NUMBER"
Previously, the YY_USER_ACTION was overwriting the yylloc->source value
in every action, (after that value had been carefully set by the handling
of the #line directive). Instead, we want to initialize it once in
YY_USER_INIT and then not touch it at all in YY_USER_ACTION.
2010-08-23 10:48:10 -07:00
Carl Worth
2a9e791fde glcpp: Add new test for #line directive.
This test exposes two current bugs:

	1. The source number is not being correctly emitted in error
	   messages (instead, it's always 0).

	2. A directive of "#line 0" is resulting in the following
	   parse error:

		preprocessor error: Invalid tokens after #
2010-08-23 10:48:10 -07:00
Carl Worth
c15f04b326 glcpp: Update README file (new specifications and fewer limitations).
The README file had grown a little bit stale. We've been using newer
versions of both the GLSL and C99 specifications, so list those. Also,
several of the documented known limitations have since been fixed, so
remove those.
2010-08-23 10:48:10 -07:00
Carl Worth
0acd68c405 glcpp: Add test for the #error directive.
This directive is already implemented nicely, but wasn't previously tested.
It will be convenient to use this directive in further tests that rely
on error messages, (such as ensuring that #line correctly sets the line
number in the error message).
2010-08-23 10:48:10 -07:00
Eric Anholt
a721abfbd1 glsl: Trim the size of uniform arrays to the maximum element used.
Fixes glsl-getactiveuniform-array-size.
2010-08-23 10:34:31 -07:00
Eric Anholt
001a7bfdfc mesa: Don't add 1 to GL_ACTIVE_UNIFORM_MAX_LENGTH.
Fixes: glsl-getactiveuniform-length.
2010-08-23 10:34:31 -07:00
Roland Scheidegger
c2f074d8a4 util: fix util_fill_rect to take util_color instead of u32 param
util_fill_rect could not handle formats with more than 32 bits,
since the fill color was a uint32_t value. Fix this by using
a util_color union instead, and also expand the union so it
works with formats which have up to 256 bits (the max of any
format currently defined).
2010-08-23 17:55:16 +02:00
Luca Barbieri
c907b94713 nvfx: emit bo relocations only when needed
Should improve performance, possibly significantly.
2010-08-23 17:12:31 +02:00
Eric Anholt
ea70969618 glsl2: Add missing sig_iter.next() to the no-constant-folding-to-outvals fix. 2010-08-23 07:22:16 -07:00
Luca Barbieri
2e215bc28f nvfx: match Gallium's gl_PointCoord brokenness
Gallium always puts gl_PointCoord in GENERIC[0] if
point_quad_rasterization is enabled.

This is silly, but for now it makes mesa-demos/glsl/pointcoord work.
2010-08-23 15:20:31 +02:00
Luca Barbieri
bfaa2577c6 nvfx: support clip planes sensibly and fix them on nv30
Before, we were discarding the compiled vertex program on each
vertex program change.

Now we compile the program as if there were 6 clip planes and
dynamically patch in an "end program" bit at the right place.

Also, nv30 should now work.
2010-08-23 15:09:22 +02:00
Christoph Bumiller
bae181f78d nv50: fix check for sprite/point coord enable 2010-08-23 14:25:57 +02:00
Christoph Bumiller
0df5e84b01 nv50: yet another case we need a nop.exit 2010-08-23 14:25:53 +02:00
Christoph Bumiller
33f45c5a8a nv50: DP2, fix ARL 2010-08-23 14:25:51 +02:00
Dave Airlie
eb430b0e94 r300g: avoid stall in no-tcl drawing when mapping vbo
the current code reuses the same vbo over and over, however after a flush
we'd stall and wait for mapping on the vbo when we should just fire and forget.

On a gears test this brings me from ~620 to ~750 on my rv530 in swtcl mode.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-08-23 20:31:21 +10:00
Chia-I Wu
e607b67ebc glapi: Clean up header inclusions.
Do not rely on PUBLIC being defined in glapi.h.  Do not include core
mesa headers.
2010-08-23 18:28:14 +08:00
Chia-I Wu
0c87828050 mesa: Assorted fixes for es_generator.py on win32.
Fix mixed use of GL_APIENTRY and GLAPIENTRY.  Parameter list of a function
prototype should never be empty.
2010-08-23 18:28:14 +08:00
Zhenyu Wang
8a537b2fb8 i965: Add sandybridge D0 pci ids
Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
2010-08-23 10:16:45 +08:00
Eric Anholt
27e931f679 mesa: Fix typo in autoconf.in that made talloc cflags still detect at runtime. 2010-08-22 18:54:30 -07:00
Marek Olšák
cfc4d86656 st/mesa: implement depth-only blit for BlitFramebuffer
Signed-off-by: Brian Paul <brianp@vmware.com>
2010-08-22 19:40:26 -06:00
Marek Olšák
7945e143e0 util: implement depth blitting in u_blit
Signed-off-by: Brian Paul <brianp@vmware.com>
2010-08-22 19:40:26 -06:00
Marek Olšák
36e523f4a3 st/mesa: fix BlitFramebuffer for D24S8 textures
This is the same issue as in the previous patch, but here the Blit is not
implemented for separate depth and stencil buffers at all (such
a configuration is not supported in Gallium) and the code incorrectly treated
a D24S8 texture as two separate buffers, making this Blit a no-op.

Signed-off-by: Brian Paul <brianp@vmware.com>
2010-08-22 19:40:26 -06:00
Brian Paul
24bd9780bc st/mesa: added st_is_depth_stencil_combined() function
This code is part of a patch by Marek Olšák.
2010-08-22 19:40:26 -06:00
Eric Anholt
428a3cd2d5 glsl: Don't constant-fold in a constant in place of a function outval. 2010-08-22 18:34:46 -07:00
Eric Anholt
6606fde3ec glsl: Convert constant folding to the rvalue visitor.
This should be mostly a noop, except that a plain dereference of a
variable that is not part of a constant expression could now get
"constant folded".  I expect that for all current backends this will
be either a noop, or possibly a win when it provokes more
ir_algebraic.  It'll also ensure that when new features are added,
tree walking will work normally.  Before this, constants weren't
getting folded inside of loops.
2010-08-22 18:34:46 -07:00
Eric Anholt
137b8397fa glsl: Don't tree-graft in an expression in place of a function outval.
Fixes: glsl-constant-folding-call-1 (bug #29737)
2010-08-22 18:34:45 -07:00
Brian Paul
6b90d1b1ac st/mesa: fix ReadPixels crashes when reading depth/stencil from a FBO
This is based on a patch from Marek Olšák.

NOTE: This is a candidate for the Mesa 7.8 branch.
2010-08-22 19:04:49 -06:00
Brian Paul
c94256e83b mesa: use driver hook for creating new renderbuffers 2010-08-22 18:54:55 -06:00
Brian Paul
ed57286b75 st/mesa: clean-up pipe_get_transfer() calls 2010-08-22 18:54:55 -06:00
Eric Anholt
639cdd3782 mesa: AC_SUBST the talloc libs/cflags so the ./configure results are saved.
I had used pkg-config from the Makefile because I didn't want to screw
around with the non-autoconf build, but that doesn't work because the
PKG_CONFIG_PATH or TALLOC_LIBS/TALLOC_CFLAGS that people set at
configure time needs to be respected and may not be present at build
time.

Bug #29585
2010-08-22 17:36:51 -07:00
Luca Barbieri
8ffc357228 nvfx: fix minor memory leak 2010-08-23 00:16:59 +02:00
Luca Barbieri
d507c0812d nvfx: support both sprite coord origins
Now we lie less when claiming OpenGL 2 support.

Also, first piglit result group is now all green, except for
fdo25614-genmipmap, which seems mesa/st's fault.
2010-08-23 00:15:03 +02:00
Luca Barbieri
d21be6ee2c nvfx: use 64-bit bitmasks for temps 2010-08-23 00:15:03 +02:00
Jerome Glisse
d843bbfd3f r600g: fix DB decompression
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-08-22 17:14:48 -04:00
Vinson Lee
d324fcea67 nvfx: Include missing header in nvfx_vertprog.c.
Include draw_context.h for draw_*_vertex_shader symbols.

Fixes the following GCC warning.
nvfx_vertprog.c: In function 'nvfx_vp_state_create':
nvfx_vertprog.c:1276: warning: implicit declaration of function 'draw_create_vertex_shader'
nvfx_vertprog.c:1276: warning: assignment makes pointer from integer without a cast
nvfx_vertprog.c: In function 'nvfx_vp_state_delete':
nvfx_vertprog.c:1298: warning: implicit declaration of function 'draw_delete_vertex_shader'
2010-08-22 12:45:04 -07:00
Jakob Bornecrantz
8e632666af translate_sse: add R32G32B32A32_FLOAT -> X8X8X8X8_UNORM for EMIT_4UB
Changed by me to use movd instead of movss to avoid penalties.
2010-08-22 20:30:16 +02:00
Luca Barbieri
4f3fedcef7 translate_sse: refactor constant management 2010-08-22 20:28:27 +02:00
Luca Barbieri
df86f1e7d5 nvfx: refactor to support multiple fragment program versions 2010-08-22 20:28:27 +02:00
Luca Barbieri
47537a4557 nvfx: move stuff around 2010-08-22 20:28:27 +02:00
Jerome Glisse
ed99c28d12 r600g: depth buffer likely needs decompression when used as texture
Before using depth buffer as texture, it needs to be decompressed
(tile pattern of db are different from one used for colorbuffer
like texture)

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-08-22 14:26:05 -04:00
Keith Whitwell
42719df0b8 glx/xlib: configurable strict/non-strict buffer size invalidate
Introduce a new configuration option XMESA_STRICT_INVALIDATE to switch
between swapbuffers-based and glViewport-based buffer invalidation.

Default strict invalidate to false, ie glViewport-based invalidation,
aka ST_MANAGER_BROKEN_INVALIDATE.

This means we will not call XGetGeometry after every swapbuffers,
which allows swapbuffers to remain asynchronous.  For apps running at
100fps with synchronous swapping, a 10% boost is typical.  For gears,
I see closer to 20% speedup.

Note that the work of copying data on swapbuffers doesn't disappear -
this change just allows the X server to execute the PutImage
asynchronously without us effectively blocked until its completion.

This applies even to llvmpipe's threaded rasterization as the
swapbuffers operation was a large part of the serial component of an
llvmpipe frame.

The downside of this is correctness - applications which don't call
glViewport on window resizes will get incorrect rendering, unless
XMESA_STRICT_INVALIDATE is set.

The ultimate solution would be to have per-frame but asynchronous
invalidation.  Xcb almost looks as if it could provide this, but the
API doesn't seem to quite be there.
2010-08-22 14:49:17 +01:00
Keith Whitwell
3d4b60f1f7 llvmpipe: reduce size of fragment shader variant key
Don't spend as much time comparing them.
2010-08-22 14:49:17 +01:00
Keith Whitwell
49a2ea082b llvmpipe: remove unused member from lp_fragment_shader_variant_key 2010-08-22 14:49:17 +01:00
Keith Whitwell
0ad82b8d28 llvmpipe: don't clear unused bins
If bins outside the current scene bounds are being corrupted, we'll
need to fix that separately.  Currently seems ok though.
2010-08-22 14:49:17 +01:00
Keith Whitwell
a1de6f48c3 draw: reduce the size of the llvm variant key 2010-08-22 14:49:16 +01:00
Keith Whitwell
8b15de2736 glx/xlib: remove another XSync
With this change, xmesa_get_window_size still does one round trip, but
that's better than doing two.
2010-08-22 14:48:24 +01:00
Keith Whitwell
8570232b3b glx/xlib: no need to call XSync from XMesaFlush
Try to eliminate some unnecessary X server round trips.
2010-08-22 14:48:24 +01:00
Luca Barbieri
7de1f86c49 nvfx: simplify and correct fragment program update logic
This version should hopefully be much clearer and thus less likely
to be subtly broken.

Also fixes point sprites on nv40 and possibly some other bugs too.
2010-08-22 15:42:17 +02:00
Luca Barbieri
9fefab340f nvfx: make stipple setting independent of enable 2010-08-22 15:42:16 +02:00
Luca Barbieri
793e398681 nvfx: fix vertex programs 2010-08-22 15:42:16 +02:00
Luca Barbieri
a0c45eabf9 nvfx: use relocations array for vp constants 2010-08-22 15:42:16 +02:00
Henri Verbeet
8a878c266a r600g: Don't blindly unmap NULL->size.
There may actually be something mapped in that range, especially for large
buffers like e.g. the GL Drawable.
2010-08-22 12:43:11 +02:00
José Fonseca
04094b2da2 svga: Do not shortcut NULL surface relocations with SVGA3D_INVALID_ID.
How to cope with NULL surface relocations should be entirely at winsys'
discretion.
2010-08-22 11:37:28 +01:00
Eric Anholt
52e9520274 i965: Fix 8-wide FB writes on gen6.
My merge of Zhenyu's patch on top of my previous patches broke it by
my code expecting simd16 single write and Zhenyu's simd8 path being
disabled by mine.  Merge the two for success.
2010-08-22 00:52:18 -07:00
Eric Anholt
250fccecc8 i965: Fix brw_math1 with scalar argument in gen6 FS.
The docs claim two conflicting things: One, that a scalar source is
supported.  Two, source hstride must be 1 and width must be exec size.
So splat a constant argument out into a full reg to operate on, since
violating the second set of constraints is clearly failing.

The alternative here might be to do a 1-wide exec on a constant
argument for math1.  It would probably save cycles too.  But I'll
leave that for the glsl2-965 branch.

Fixes glsl-algebraic-div-one-2.shader_test.
2010-08-22 00:52:18 -07:00
Eric Anholt
556f19415a i965: Fix up WM push constant setup on gen6.
Fixes glsl-algebraic-add-add-1.
2010-08-22 00:52:18 -07:00
Eric Anholt
527a9a4de2 i965: Use intel->gen >= 6 instead of IS_GEN6. 2010-08-22 00:52:18 -07:00
Vinson Lee
df604834d3 libgl-xlib: Include missing header in xlib.c.
Include st_api.h for st_api_create_OpenGL symbol.
2010-08-22 00:30:47 -07:00
Vinson Lee
928830606f nvfx: Silence unused variable warning.
The variable is used but only in the body of an assert.
2010-08-22 00:16:54 -07:00
Vinson Lee
48c289fb55 mesa: Initialize member variables in ir_to_mesa_src_reg constructor.
The default constructor did not initialize some member variables.
2010-08-22 00:09:43 -07:00
Vinson Lee
405546882a mesa: Initialize variables in mesa_src_reg_from_ir_src_reg. 2010-08-21 23:56:24 -07:00
Vinson Lee
3bdbccef2a util: Use #ifdef instead of #if.
This is a typo fix of earlier commit 0f3b3751b8.
2010-08-21 23:36:30 -07:00
Vinson Lee
0f3b3751b8 util: Define dump_cpu only for DEBUG builds.
dump_cpu is used only when DEBUG is defined.

Fixes the following GCC warning on builds without DEBUG defined.
util/u_cpu_detect.c:76: warning: 'debug_get_option_dump_cpu' defined but not used
2010-08-21 23:28:52 -07:00
Vinson Lee
2a7493ada4 translate_sse: Silence uninitialized variable warnings.
Initialize variables on error paths.
2010-08-21 23:24:28 -07:00
Vinson Lee
172953ef3a nvfx: Silence uninitialized variable warnings.
Variables weren't initialized on the error paths.
2010-08-21 22:59:46 -07:00
Vinson Lee
fdedff2dba i965g: Silence printf format warnings on 64-bit builds. 2010-08-21 22:45:09 -07:00
Vinson Lee
68d34f2979 nvfx: Silence uninitialized variable warnings.
Silence the following i686-apple-darwin10-gcc-4.2.1 warnings.
nv04_2d.c: In function 'nv04_region_copy_cpu':
nv04_2d.c:560: warning: 'dswy' may be used uninitialized in this function
nv04_2d.c:559: warning: 'dswx' may be used uninitialized in this function
nv04_2d.c:562: warning: 'sswy' may be used uninitialized in this function
nv04_2d.c:561: warning: 'sswx' may be used uninitialized in this function
2010-08-21 22:15:22 -07:00
Vinson Lee
4a06525737 nv50: Silence incompatible pointer type initialization warning.
Silence the following GCC warning.
warning: initialization from incompatible pointer type
2010-08-21 22:01:04 -07:00
Vinson Lee
2506b32eec nv50: Disable unused code.
Disable release_hw and emit_mov_from_pred functions as they are
currently not being used.
2010-08-21 21:42:17 -07:00
Vinson Lee
973c065abe i965g: Fix printf format warning on 32-bit platforms.
Fixes the following GCC warning on 32-bit platforms.
warning: format '%li' expects type 'long int', but argument 4 has type 'int'
2010-08-21 21:27:43 -07:00
Vinson Lee
56176f00f5 glsl: Silence uninitialized variable warning.
i686-apple-darwin10-gcc-4.2.1 generated the following warning.
warning: 'score' may be used uninitialized in this function

GCC 4.4.3 on Linux didn't generate the above warning.
2010-08-21 20:42:47 -07:00
Jerome Glisse
36efb86c05 r600g: partialy fix texturing from depth buffer + initial support for untiling
Partialy fix texturing from depth buffer, depth buffer is tiled
following different tile organisation that color buffer. This
properly set the tile type & array mode field of texture sampler
when sampling from db resource.

Add initial support to untiling buffer when transfering them,
it's kind of broken by corruption the vertex buffer of previous
draw.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-08-21 22:52:38 -04:00
José Fonseca
ae34a6393e draw: Don't assert if indices point outside vertex buffer.
This is valid input, and asserting here does causes the test suites that
verify this to crash.

Also, the assert was wrongly accepting the case

  max_index == vert_info->count

which, IIUC, is the first vertex outside the buffer. Assuming the
vert_info->count is precise (which often is not the case).
2010-08-22 02:26:44 +01:00
José Fonseca
ce9a6e6a7d mesa: Removed another unused variable. 2010-08-22 02:26:44 +01:00
Vinson Lee
13b3d4c23d glsl: Silence unused variable warning.
The variable is actually used but only in the body of an assert.
2010-08-21 16:22:18 -07:00
Vinson Lee
be99100ee7 util: Silence uninitialized variable warnings. 2010-08-21 15:49:17 -07:00
Kenneth Graunke
e511a35fc5 glsl: Handle array declarations in function parameters.
The 'vec4[12] foo' style already worked, but the 'vec4 foo[12]' style
did not.  Also, 'vec4[] foo' was wrongly accepted.

Fixes piglit test cases array-19.vert and array-21.vert.

May fix fd.o bug #29684 (or at least part of it).
2010-08-21 15:42:27 -07:00
Luca Barbieri
4edeeaf715 nvfx: actually fix it properly 2010-08-21 23:53:39 +02:00
Luca Barbieri
251e48c64a nvfx: fix incorrect assert 2010-08-21 23:45:32 +02:00
Vinson Lee
4a6eb492e8 util: Move loop variable declaration outside for loop.
Fixes build error with MSVC.
2010-08-21 14:36:29 -07:00
Vinson Lee
489c787b80 nvfx: Fix SCons build.
Move declarations before code.
Fix void pointer arithmetic.
2010-08-21 14:29:50 -07:00
Luca Barbieri
11d27871a7 nvfx: fix warnings 2010-08-21 23:09:43 +02:00
José Fonseca
0d96cbe4a5 gallivm: Emit DIVPS instead of RCPPS.
See comments for detailed rationale.

Thanks to Michal Krol and Zack Rusin for detecting and investigating this
in detail.
2010-08-21 21:58:22 +01:00
Luca Barbieri
42210f4464 nvfx: enable translate_sse 2010-08-21 21:56:29 +02:00
Vinson Lee
15d558c306 auxiliary: Add missing files to SCons build.
Add u_linear.c and u_linkages.c to SCons build.
Reorder list of files to be more alphabetical.
2010-08-21 12:32:17 -07:00
Vinson Lee
683118ccf2 auxiliary: Reorder list of files in Makefile.
This patch reorders the list of files so that the order is more alphabetic.
2010-08-21 12:21:59 -07:00
Vinson Lee
1badd3c43f scons: Fix nvfx build. 2010-08-21 12:00:57 -07:00
Luca Barbieri
d8e210eb11 nvfx: slightly improve handling of overlong vps 2010-08-21 20:42:15 +02:00
Luca Barbieri
5eddf95be9 nvfx: tweak CMP in fp 2010-08-21 20:42:15 +02:00
Luca Barbieri
8983621c6b nvfx: implement CMP in vp 2010-08-21 20:42:15 +02:00
Luca Barbieri
923f5c97b1 nvfx: implement TXL in fp 2010-08-21 20:42:15 +02:00
Luca Barbieri
847ac88671 nvfx: implement SSG in fp 2010-08-21 20:42:15 +02:00
Luca Barbieri
32d2525d64 nvfx: implement DP2 in vp and fp 2010-08-21 20:42:15 +02:00
Luca Barbieri
4aec8aa2e3 nvfx: implement TRUNC in vp and fp 2010-08-21 20:42:15 +02:00
Luca Barbieri
587d26fdf9 nvfx: implement NOP 2010-08-21 20:42:15 +02:00
Luca Barbieri
fe3c62dd77 nvfx: add vertex program control flow 2010-08-21 20:42:15 +02:00
Luca Barbieri
5287d86a0b nvfx: fix vertex shader headers 2010-08-21 20:42:15 +02:00
Luca Barbieri
af4a6eba55 nv40: add fragment program control flow 2010-08-21 20:42:15 +02:00
Luca Barbieri
cf0d156422 nvfx: refactor shader assembler 2010-08-21 20:42:15 +02:00
Luca Barbieri
28fa9451e1 nvfx: add option to dump shaders in TGSI and native code 2010-08-21 20:42:15 +02:00
Luca Barbieri
b2bad53478 nvfx: improve and correct nvfx_shader.h 2010-08-21 20:42:15 +02:00
Luca Barbieri
928cce672a nvfx: fix lodbias 2010-08-21 20:42:15 +02:00
Luca Barbieri
1dea9bc369 nvfx: mostly fix inline corruption magically
Not sure why this mostly works.
2010-08-21 20:42:15 +02:00
Luca Barbieri
ed232adc80 nvfx: fix GPU hardlocks when depth buffer is absent 2010-08-21 20:42:14 +02:00
Luca Barbieri
6931a01222 nvfx: fire ring after transfers
Might reduce the risk of running out of memory
2010-08-21 20:42:14 +02:00
Luca Barbieri
07b6fde410 nv30: band-aid viewport issues
For some reason nv30 seems to like to reset the viewport, even though
attempts to isolate where exactly it does that have currently been
inconclusive.
2010-08-21 20:42:14 +02:00
Luca Barbieri
0d74956a1f nvfx: support flatshade_first 2010-08-21 20:42:14 +02:00
Luca Barbieri
0184e29863 nvfx: expose GLSL
Still no control flow support, but basic stuff works.
2010-08-21 20:42:14 +02:00
Luca Barbieri
4d765f7fa3 nvfx: support proper shader linkage - adds glsl support 2010-08-21 20:42:14 +02:00
Luca Barbieri
8eb0fc430a nvfx: rewrite draw code and buffer code
This is a full rewrite of the drawing and buffer management logic.

It offers a lot of improvements:
1. A copy of buffers is now always kept in system memory. This is
   necessary to allow software processing of them, which is necessary
   or improves performance in many cases.
2. Support for pushing vertices on the FIFO, with index lookup if necessary.
3. "Smart" draw code that tries to intelligently choose the cheapest
  way to draw something: whether to use inline vertices or hardware
  vertex buffer, and whether to use hardware index buffers
4. Support for all vertex formats supported by the hardware
5. Usage of translate to push vertices, supporting all formats that are
   sensible to use as vertex formats
6. Support for base vertex
7. Usage of Ben Skeggs' primitive splitter originally for nv50, allowing
   correct splitting of line loops, triangle fans, etc.
8. Support for instancing
9. Precomputation using the vertex elements CSO

Thanks to Ben Skeggs for his primitive splitter originally for nv50.

Thanks to Christoph Bumiller for his nv50 push code, that was the basis
of this work, even though I changed his code dramatically, in particular
to replace his ad-hoc vertex data emitter with translate.

The changes could also go into nv50 too, but there are substantial
differences due to the additional nv50 hardware features.
2010-08-21 20:42:14 +02:00
Luca Barbieri
73b7c6fb33 nvfx: refactor sampling code, add support for swizzles and depth tex
This is a significant refactoring of the sampling code that:
- Moves all generic functions in nvfx_fragtex.c
- Adds a driver-specific sampler view structure and uses it to
  precompute texture setup as it should be done
- Unifies a bit more of code between nv30 and nv40
- Adds support for sampler view swizzles
- Support for specifying as sampler view format different from the
  resource one (only trivially)
- Support for sampler view specification of first and last level
- Support for depth textures on nv30, both for reading depth and
  for compare
- Support for sRGB textures
- Unifies the format table between nv30 and nv40
- Expands the format table to include essentially all supportable formats
  except mixed sign and "autonormal" formats
- Fixes the "is format supported" logic, which was quite broken, and
  makes it use the format table

Only tested on nv30 currently.
2010-08-21 20:42:14 +02:00
Luca Barbieri
4e2080a86e nvfx: new 2D: unify textures and buffers
Stop using the vtbl, and use real transfers for buffers too.
2010-08-21 20:42:14 +02:00
Luca Barbieri
0481ed25c9 nvfx: new 2D: use a CPU copy for up to 4 pixels, up from 0
Seems a reasonable threshold for now.

Significantly speeds up Piglit's 1x1 glReadPixels (but, you know,
reading pixels in 1x1 blocks is NOT a good idea, especially if you
might be running on a less-than-perfect driver).
2010-08-21 20:42:14 +02:00
Luca Barbieri
28eb392a85 nvfx: new 2D: new render temporaries with resources
This patch adds support for creating temporary surfaces to allow
rendering to surfaces that cannot be rendered to.
It uses the _second_ version of the render temporary infrastructure.

This is necessary for swizzled 3D textures and small mipmaps of
swizzled 2D textures.

This version of the patch creates a resource to use as a temporary
instead of a raw BO, making the code simpler.
2010-08-21 20:42:14 +02:00
Luca Barbieri
ff74143fcc nv30: new 2D: support ARB_texture_rectangle
This uses nv30's _RECT formats.
2010-08-21 20:42:14 +02:00
Luca Barbieri
4793f48a19 nvfx: new 2D: optimize fragtex format lookup
Use an array indexed by the pipe format instead of doing a linear scan.
2010-08-21 20:42:14 +02:00
Luca Barbieri
d983701267 nvfx: new 2D: enable swizzling for all surfaces
Now that the new 2D code is in place, swizzling can be safely enabled.

Render temporaries are needed in some cases, so this may degrade nv30
a bit until it gets render temporaries too.
2010-08-21 20:42:14 +02:00
Luca Barbieri
9ed0686e8e nvfx: new 2D: use new 2D engine in Gallium
This patch implements nv04_surface_copy/fill using the new 2D engine module.
It supports falling back to the 3D engine using the u_blitter module, which will be
added in a later patch.

Also adds support for using the 3D engine, reusing the u_blitter module
created for r300.
This is used for unswizzling and copies between swizzled surfaces.
2010-08-21 20:42:14 +02:00
Luca Barbieri
24a4ea003f nv04-nv40: new 2D: add new Gallium-independent 2D engine
This patch add a brand new nv04-nv40 2D engine module.
It should correctly implement all operations involving swizzled, and 3D-swizzled surfaces.

This code is independent from the Gallium framework and can thus be reused in the DDX and classic Mesa drivers (it's only likely to be useful in the latter, though).

Currently, surface_copy and surface_fill are broken for 3D textures, for swizzled source textures and possibly for some misaligned cases

The code is based around the new nv04_region structure, which encapsulates the information from pipe_surface needed for the 2D engine and CPU copies.
The use of nv04_region makes the code independent of the Gallium framework and allows to transform the nv04_region without clobbering the nv04_region.
The existing M2MF, blitter, and SWIZZLED_SURFACE paths have been improved and a new CPU path has been added.
There is also support to tell the caller to use the 3D engine.

The main feature of the copy/fill setup algorithm is linearization/contiguous-linearization of swizzled surfaces.
The idea of linearization is that some swizzled surfaces are laid out like linear ones (1xN, 2xN, Nx1) and can thus be used as such (e.g. useful for copying single pixels).
Also, some rectangles (e.g. the whole surface) are contiguous in memory. If both the source and destination rectangles are swizzled but contiguous, then they can be regarded as both linear: this is the idea of "contiguous linearization".
This, for instance, allows to use the 2D engine to duplicate the content of a swizzled surface to another swizzled surface, by pretending they are actually linear.
After linearization, the result may not be 64-byte aligned. Another transformation is done to enlarge the linear surface so that it becomes 64-byte aligned.
This is also used to 64-byte align swizzled texture mipmaps.

The inner loop of the CPU path is as optimized as possible without using SSE/SSE2.
Future improvements could include SSE/SSE2 support, and possibly a faster coordinate swizzling algorithm (which is however not used in the inner loop).
It may be a good idea to autogenerate swizzling code at least for all possible POT 2D texture dimensions  (less than 256), maybe for all 3D ones too (less than 4096).
Also, it woud be a very good idea to make a copy with the GPU first if the source surface is in uncached memory.
2010-08-21 20:42:14 +02:00
Luca Barbieri
23639dc046 nvfx: new 2D: rewrite transfer code to use staging transfers
This greatly simplifies the code, and avoids ad-hoc copy code.

Also, these new transfers work for buffers too, even though they
are still used for miptrees only.
2010-08-21 20:42:14 +02:00
Luca Barbieri
ed2930e7e2 nvfx: new 2D: rewrite miptree code, adapt transfers
Changes:
- Disable swizzling on non-RGBA 2D textures, since the current 2D
  code is mostly broken in those cases. A later patch will fix this.
  Thanks to Andrew Randrianasulu who reported this.
- Fix compressed texture transfers and hack around the current 2D
  code inability to copy compressed textures by using direct access.
  Thanks to Andrew Randrianasulu who reported this.

This patch rewrites all the miptree layout and transfer code in the
nvfx driver.

The current code is broken in several ways:
1. 3D textures are laid out first by face, then by level, which is
incorrect
2. Cube maps should have 128-byte aligned faces
3. Swizzled textures have a strange alignment test that seems
unnecessary
4. We store the image_offsets for each face/slice but they can be
easily computed instead
5. "Swizzling" is not supported for compressed formats. They can be
"swizzled" but swizzling only means that there are no gaps (pitch is
level-dependant) and the layout is still linear
6. Swizzling is not supported for non-RGBA formats. All formats (except
possibly depth) can be swizzled according to my testing.

The miptree layout is rewritten based on my empirical testing, which I
posted in the "miptree findings" mail.
The image_offset array is removed, since it can be calculated with a
simple multiplication; the only array in the miptree structure is now
the one for mipmap level starts, which it seems cannot be easily
computed in constant time.

Also, we now directly store a nouveau_bo instead of a pipe_buffer in
the miptree structure, like nv50 does.

Support for render temporaries is removed, and will be readded in a
later patch.

Note that the current temporary code is broken, because it does not
copy the temporary back on render cache flushes.
2010-08-21 20:42:14 +02:00
Luca Barbieri
ac97e8dba6 nvfx: add nouveau_resource_on_gpu
Add a function to get whether a resource is likely on the GPU or not.

Currently always returns TRUE.
2010-08-21 20:42:14 +02:00
Luca Barbieri
37fa0cf4ea nvfx: add linear flag for buffers 2010-08-21 20:42:14 +02:00
Luca Barbieri
6a73d99a52 nvfx: properly unreference bound objects on context destruction 2010-08-21 20:42:13 +02:00
Luca Barbieri
e189823eb4 nvfx: reference count bound objects 2010-08-21 20:42:13 +02:00
Luca Barbieri
95acfd0c8a nvfx: fix format support code for compressed texture
A source line was put in the wrong place.
2010-08-21 20:42:13 +02:00
Luca Barbieri
e6ff995d14 gallium/auxiliary: add semantic linkage utility code 2010-08-21 20:42:13 +02:00
Luca Barbieri
bed9dff9d9 u_debug_describe: use switch instead of if chain 2010-08-21 12:47:18 +02:00
Luca Barbieri
061c2a7cb3 u_debug_describe: add PIPE_TEXTURE_RECT 2010-08-21 12:45:39 +02:00
Luca Barbieri
fa32fde26c auxiliary: add copyright headers
Thanks to Jose Fonseca for pointing out they were missing.
2010-08-21 12:37:39 +02:00
José Fonseca
121aa3cfcb util: Match printf format to silence warning. 2010-08-21 10:38:22 +01:00
José Fonseca
a5888d3113 mesa: Remove unsused local variable. 2010-08-21 10:34:57 +01:00
José Fonseca
04c2a22175 util: Make the reference debuggin code more C++ friendly.
C++ doesn't accept function <-> void* conversions without a putting a
fight.
2010-08-21 10:34:42 +01:00
José Fonseca
7a40d15e6c util: Remove the x86 exception handlers.
Unused now that check_os_katmai_support was removed.
2010-08-21 10:07:12 +01:00
Alex Corscadden
ce3a07c392 trace: Don't immediately destroy the pipe's sampler view in the trace driver.
The trace driver's implementation of sampler_view_destroy was calling
directly into the underlying pipe's sampler_view_destroy implementation.
This causes problems for pipes that keep references to sampler views
even after the state tracker has released them.  Instead, we'll simply
drop the trace driver's reference to the pipe's sampler view.

Signed-off-by: José Fonseca <jfonseca@vmware.com>
2010-08-21 09:45:43 +01:00
Alex Corscadden
29dde59ea7 trace: Trace the correct version of the resource when setting the index buffer.
The trace driver was tracing the unwrapped version of the index buffer
when setting the index buffer.  This caused an assert validating that
a resource belonged to the trace driver to fail.  Instead, we'll log
the unmodified index buffer structure when setting the index buffer.

Signed-off-by: José Fonseca <jfonseca@vmware.com>
2010-08-21 09:44:12 +01:00
Vinson Lee
f7188ac9ce generate_builtins.py: Remove unused import sys. 2010-08-21 01:13:16 -07:00
Chia-I Wu
29cff9ce2e mapi: Use MAPI_EXPORT to export public functions.
mapi.h is included by vgapi and st/vega.  On win32, the macro expands to
dllexport and dllimport respectively.
2010-08-21 14:13:59 +08:00
Chia-I Wu
df98423f24 mapi: Prefix functions in u_current.h by u_current.
That is, replace the old _glapi_* names by new names that start with
u_current_.  When MAPI_GLAPI_CURRENT is defined, u_current.h defines
rename macros to restore the old names.  That is done for ABI
compatibility.
2010-08-21 14:13:59 +08:00
Chia-I Wu
760451baae glapi: Move public function/variable declarations to glapi.h.
glapi defines an interface that is used by DRI drivers.  It must not be
changed in an ABI incompatible way.  This commit moves all
functions/variables belong to the interface to glapi.h.  Instead of
including u_current.h from glapi.h, u_current.h now includes glapi.h.
2010-08-21 14:13:59 +08:00
richard
0eac4b8740 evergreen : initial support driver code. 2010-08-20 19:28:47 -04:00
Eric Anholt
501c9dc627 i965: Rename nr_depth_regs to nr_payload_regs.
Only 8 out of the up to 13 regs are for source/dest depth, so the name
wasn't particularly appropriate.  Note that this doesn't count the
constant or URB payload regs.  Also, don't pre-divide by 2, so it's
actually a number of registers.
2010-08-20 16:17:40 -07:00
Eric Anholt
e6ec500e19 i965: Also use the SIMD8 FB writes for SIMD8 mode on non-SNB. 2010-08-20 16:17:40 -07:00
Zhenyu Wang
5266c0a0c8 i965: Add support for FB writes on Sandybridge. 2010-08-20 16:17:40 -07:00
Zhenyu Wang
3ce2eccbfb i965: Set the destination horiz stride even for da16, as SNB seems to need it. 2010-08-20 16:17:40 -07:00
Zhenyu Wang
35c127362f i965: Set the maximum number of threads on Sandybridge. 2010-08-20 16:17:40 -07:00
Zhenyu Wang
93ba0055c3 i965: Add AccWrCtl support on Sandybridge.
Whenever the accumulator results are needed, this bit must be set.
2010-08-20 16:17:39 -07:00
Zhenyu Wang
ffb5095d56 i965: Mention the mlen and rlen for URB reads. 2010-08-20 16:17:39 -07:00
Zhenyu Wang
da1502494b i965: Sandybridge doesn't have Compr4 mode, since it's not needed any more. 2010-08-20 16:17:39 -07:00
Zhenyu Wang
0e2d0cc577 i965: Adjust disasm of subreg numbers to be in units of the register type.
This makes reading the code easier when matching up to the specs,
which also use this format.
2010-08-20 16:17:39 -07:00
Eric Anholt
b7004350fa i965: Fix DP write channel ordering on Sandybridge.
The SIMD16 message no longer has the goofy interleaved format that
made Compr4 compression necessary before.
2010-08-20 16:17:39 -07:00
Luca Barbieri
132b9439e2 os_stream: fix bugs in allocation path 2010-08-21 00:51:29 +02:00
Luca Barbieri
9960200d5e p_compiler: add replacement va_copy
This might technically not always be correct, because va_copy might
be a function, or a system might not have va_copy, and not work with
assignment.

Hopefully this is never the case.
Without configure tests, it doesn't seem possible to do better.
2010-08-21 00:51:29 +02:00
Kenneth Graunke
7f80041efa Delete more vestiges of the old shader compiler. 2010-08-20 13:06:02 -07:00
Kenneth Graunke
d6cc7191da glsl: Remove bogus "ambient" field from vec4 gl_TextureEnvColor. 2010-08-20 13:01:12 -07:00
Luca Barbieri
c3e3793c32 glsl: add missing ambient field to gl_LightModel
Again, this is a one-element struct that was incorrectly missing the
field.
2010-08-20 13:01:09 -07:00
Luca Barbieri
fc76d72763 glsl: don't crash if a field is specified for a non-struct uniform
This was triggered by the previous bug, but is a separate problem
in the general sense.
2010-08-20 13:01:07 -07:00
Luca Barbieri
c108a7927d glsl: add missing sceneColor field to gl_{Front, Back}LightModelProduct
According to both GLSL 1.20 and 4.0, these are a struct with one field
called "sceneColor".

Fixes a crash on loading in FlightGear.
2010-08-20 13:01:04 -07:00
Eric Anholt
27e6552a8f intel: Don't try to do work for BufferSubData with a size of 0.
If we hit the linear blit path, we'd come up with a pitch of 0, then
divide by zero.

Fixes vbo-subdata-zero, made for bug #28931 (warsow).
2010-08-20 12:36:34 -07:00
Nick Bowler
5482eaba6e mesa: Fix GetUniformLocation while compiling display lists.
This function was apparently missing from the display list dispatch
table, causing the generic no-op function to be called instead.  To make
matters worse, the no-op function is indistinguishable from a successful
call to GetUniformLocation.  GL specifies that GetUniformLocation is
executed immediately when compiling display lists.

Fixes fdo bug 29622.

Signed-off-by: Nick Bowler <nbowler@draconx.ca>
2010-08-20 10:55:50 -07:00
Eric Anholt
284ce20901 Remove remnants of the old glsl compiler. 2010-08-20 10:55:42 -07:00
Jerome Glisse
a4b10a5614 r600g: add POW instruction
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-08-20 18:54:26 +02:00
Jerome Glisse
921c987c6f r600g: cleanup definition, fix segfault when no valid pixel shader
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-08-20 18:54:26 +02:00
Michal Krol
a43a2f0662 util: Fix build for C++ compilers. 2010-08-20 18:51:22 +02:00
Luca Barbieri
c806a40277 gallium: hook up reference count debugging code
This commit adds the ability to produce a log file containing all
reference count changes, and object creation/destruction, on Gallium
objects.

The data allows to answer these crucial questions:
1. This app is exhausting all my memory due to a resource leak: where
   is the bug?
2. Which resources is this app using at a given moment? Which parts of
   the code created them?
3. What kinds of resources does this app use?
4. How fast does this app create and destroy resources? Which parts of
   the code create resources fast?

The output is compatible with the one produced by the similar facility
in Mozilla Firefox, allowing to use Mozilla's tools to analyze the data.

To get the log file:
export GALLIUM_REFCNT_LOG=<file>

To get function names and source lines in the log file:
tools/addr2line.sh <file>

To process the log file, see:
http://www.mozilla.org/performance/refcnt-balancer.html
2010-08-20 18:18:28 +02:00
Luca Barbieri
2ff13fe89e auxiliary: add reference count debugging code 2010-08-20 18:18:28 +02:00
Luca Barbieri
b1fa352db8 os_stream: add printf facility 2010-08-20 18:18:28 +02:00
Luca Barbieri
40eef4c20c u_debug_symbol: add symbol name caching
Without this, any form of logging that dumps stack traces continuously
will spend a lot of time resolving symbol names.
2010-08-20 18:18:28 +02:00
Luca Barbieri
b3e57fc868 u_debug_symbol: add support for getting symbol names from glibc 2010-08-20 18:18:28 +02:00
Luca Barbieri
64c4f9c566 u_debug_symbol: support getting a string without output 2010-08-20 18:18:28 +02:00
Luca Barbieri
d46f91af68 auxiliary: add functions to describe gallium objects 2010-08-20 18:18:28 +02:00
Dave Airlie
63d010115c r600g: add occlusion query support
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-08-20 16:43:44 +02:00
Luca Barbieri
3aaec4750d u_staging: improve interface 2010-08-20 16:38:32 +02:00
Luca Barbieri
c843a60e63 gallium/docs: improve documentation for resources 2010-08-20 15:24:36 +02:00
Chia-I Wu
cfc0081740 mesa: Add missing ES sources to SConscript.
These sources compile to nothing when FEATURE_ES is not defined and thus
were overlooked.  Note that api_exec_es[12].c are still missing on the
list.  They should be added when they can be generated on the fly.
2010-08-20 19:26:43 +08:00
Chia-I Wu
ae2ace64f4 mesa: Decorate functions with GL_APIENTRY in es_generator.py.
Note that GLES headers use GL_APIENTRY, not GLAPIENTRY.
2010-08-20 19:26:18 +08:00
Chia-I Wu
8043bf555e mesa: Include compiler.h for ASSERT.
mfeatures.h defines ASSERT_NO_FEATURE to ASSERT, which is defined in
compiler.h.  Header files using the macro should include compiler.h.
2010-08-20 19:22:51 +08:00
Chia-I Wu
5004f823ad targets/egl-gdi: Implement guess_gl_api.
It is needed to support calling eglGetProcAddress before eglInitialize.
2010-08-20 19:22:51 +08:00
Chia-I Wu
5eb33596a0 egl: Fix context API check and be verbose.
The API of the context was not checked against EGL_RENDERABLE_TYPE when there
was no attribute list.  Move the check to _eglInitContext, and be verbose about
common mistakes (EGL_RENDERABLE_TYPE not set, EGL_CONTEXT_CLIENT_VERSION not
set, or eglBindAPI not called).
2010-08-20 19:22:51 +08:00
Chia-I Wu
ce2cae4130 egl: Add egl.def for win32 build.
Without the .def file, function names are decorated and cannot be
queried by GetProcAddress easily.
2010-08-20 19:22:50 +08:00
Chia-I Wu
f508c0c097 egl: Allow core functions to be queried.
When _EGL_GET_CORE_ADDRESSES is defined, eglGetProcAddress can be used to query
core functions.  This is non-standard, but some apps expect it.
2010-08-20 19:22:35 +08:00
Keith Whitwell
4df17f9dfe st/mesa: fix code/declaration mixing 2010-08-20 11:52:01 +01:00
Luca Barbieri
7344e6d9b5 galahad: remove incorrect comment just added 2010-08-20 12:07:14 +02:00
Luca Barbieri
09bf09cf92 nv50: use NV50TIC_0_2_TARGET_RECT 2010-08-20 12:04:10 +02:00
Luca Barbieri
ccd0864357 galahad: check resource_create template 2010-08-20 12:04:10 +02:00
Luca Barbieri
7f15dca6d9 mesa/st: use PIPE_TEXTURE_RECT for GL_TEXTURE_RECTANGLE 2010-08-20 12:04:09 +02:00
Luca Barbieri
96a82cc314 winsys/sw: use PIPE_TEXTURE_RECT if appropriate 2010-08-20 12:04:08 +02:00
Luca Barbieri
d34f6e9db1 st/glx: use PIPE_TEXTURE_RECT if appropriate 2010-08-20 12:04:07 +02:00
Luca Barbieri
4a5acc0ec7 st/dri: use PIPE_TEXTURE_RECT if appropriate 2010-08-20 12:04:06 +02:00
Luca Barbieri
d4ec85e624 auxiliary: support using PIPE_TEXTURE_RECT internally
Currently Gallium internals always use PIPE_TEXTURE_2D and normalized
coordinates to access textures.

However, PIPE_TEXTURE_2D is not always supported for NPOT textures,
and PIPE_TEXTURE_RECT requires unnormalized coordinates.

Hence, this change adds support for both kinds of normalization.
2010-08-20 12:04:05 +02:00
Luca Barbieri
3070e0ea41 mesa/st: support using PIPE_TEXTURE_RECT internally
Currently Gallium internals always use PIPE_TEXTURE_2D and normalized
coordinates to access textures.

However, PIPE_TEXTURE_2D is not always supported for NPOT textures,
and PIPE_TEXTURE_RECT requires unnormalized coordinates.

Hence, this change adds support for both kinds of normalization.
2010-08-20 12:04:03 +02:00
Luca Barbieri
4a9bfb24eb u_staging: use PIPE_TEXTURE_RECT 2010-08-20 12:04:02 +02:00
Luca Barbieri
cbe3672279 u_blitter: use TGSI_TEXTURE_RECT
This seems to make sense, although I suspect the semantics of
TGSI_TEXTURE_RECT need to be closely reviewed.
2010-08-20 12:04:01 +02:00
Luca Barbieri
ae0ef6f69f gallium: make all checks for PIPE_TEXTURE_2D check for PIPE_TEXTURE_RECT too
Searched for them with:
git grep -E '[!=]=.*PIPE_TEXTURE_2D|PIPE_TEXTURE_2D.*[!=]=|case.*PIPE_TEXTURE_2D'

Behavior hasn't been changed.
2010-08-20 12:04:00 +02:00
Luca Barbieri
72b3e3fee3 gallium: add PIPE_TEXTURE_RECT target
This allows to properly support OpenGL rectangle textures in a well
defined way, especially on drivers that don't expose
PIPE_CAP_NPOT_TEXTURES.
2010-08-20 12:03:59 +02:00
Kenneth Graunke
9b3362932d i965: Fix compile warnings on 64-bit Linux.
format ‘%d’ expects type ‘int’, but argument 2 has type ‘long int’
2010-08-20 02:46:05 -07:00
Kenneth Graunke
edd180f032 ast_to_hir: Reject function names that start with "gl_".
Fixes piglit test redeclaration-03.vert.
2010-08-20 02:46:05 -07:00
Kenneth Graunke
826a39cb14 ast_to_hir: Fix crash when a function shadows a variable.
The code would attempt to add a new signature to the ir_function, which
didn't exist.  Simply bailing out/returning early seems reasonable.

Fixes piglit test redeclaration-02.vert, and fixes a crash in
redeclaration-03.vert (the test still fails).
2010-08-20 02:46:05 -07:00
Corbin Simpson
e0ef4800f5 galahad, i915g: Copy over constant buffer index check. 2010-08-20 00:18:30 -07:00
Corbin Simpson
cdc1c67b98 galahad, i915g: Move over a few state asserts. 2010-08-20 00:00:40 -07:00
Corbin Simpson
11fde173c2 galahad: Make it obvious on stderr that Galahad's active. 2010-08-19 23:34:39 -07:00
Jakob Bornecrantz
d377abd93f gallium/docs: Add Galahad 2010-08-20 02:29:42 +01:00
Vinson Lee
9b7480cd95 configs: Add -lstdc++ to default.
This fixes the following error when trying to run glxinfo or glxgears
with swrast.

undefined symbol: __cxa_pure_virtual
2010-08-19 18:09:24 -07:00
Vinson Lee
48dca27e33 mesa: Silence uninitialized variable warnings in dummy_enum_func. 2010-08-19 17:07:28 -07:00
Luca Barbieri
d3fe699b0b translate_sse: enable on Win64
According to Vinson, enabling it causes no regressions
2010-08-20 00:09:37 +02:00
Marek Olšák
a9b20d4597 u_blitter: fix a memory leak 2010-08-19 23:32:04 +02:00
Marek Olšák
06991d87be r300g: do not use fastfill with 16-bit zbuffers
To my knowledge, there is no way to flush zmask and thus write the clear
value.

This fixes zbuffer reads, among other things.
2010-08-19 23:30:26 +02:00
Alex Deucher
076c53879b r600g: update comments about ALU src operands 2010-08-19 12:06:20 -04:00
Luca Barbieri
c54dea66fd translate_sse: try to fix Win64
Not sure whether it works now (it is still disabled).
2010-08-19 10:08:57 +02:00
Luca Barbieri
18f207310b translate_sse: fix emit_load_sse2 2010-08-19 10:04:07 +02:00
Vinson Lee
11726c4e86 i915: Remove unnecessary header from i830_context.c. 2010-08-19 00:29:59 -07:00
Chia-I Wu
ce29e86458 st/egl: Fix win32 build.
Add new source files to SConscripts.
2010-08-19 14:07:29 +08:00
Dave Airlie
88f5976484 r600g: add sin/cos
This pretty much ports the code from r600c, however it doesn't
always seem to work quite perfectly, but I can't find anything in this
code that is wrong. I'm guessing either literal input or constants
aren't working always.
2010-08-19 15:36:55 +10:00
Dave Airlie
098064e8cb r600g: add a chiprev type for r600/r700/evergreen instead of using family 2010-08-19 15:36:54 +10:00
Dave Airlie
0d48925a56 r600g: add SSG, SEQ, SGT and SNE 2010-08-19 15:36:54 +10:00
Eric Anholt
8de8c97275 i965: Set the if stack pop count when breaking out of a loop inside an if.
Otherwise, we might end up with the if stack pointing at the wrong
place.  Fixes GPU hang with glsl-vs-if-loop.
2010-08-18 21:31:56 -07:00
Eric Anholt
bad29dc6da i965: Don't set the swizzle on an immediate value in the VS.
Fixes glsl-vs-if-nested (70.0 is not <= 70.000648 thanks to the
swizzle bits getting set).  Some safety checks are added to make sure
this doesn't happen again as we increase the usage of immediate values
in program generation.
2010-08-18 21:31:56 -07:00
Eric Anholt
af2ef53a27 mesa: Fix the whining for link failures to actually be under MESA_GLSL=dump. 2010-08-18 21:31:56 -07:00
Kenneth Graunke
365ce61997 glsl: Replace sscanf in s_expression reader with strspn and strcspn.
This seems to give roughly a 20% speedup.
2010-08-18 21:33:18 -07:00
Vinson Lee
a575067d70 mesa: Remove unnecessary heaaders from shaderapi.c. 2010-08-18 18:49:32 -07:00
Eric Anholt
f5703a54e2 mesa: Don't try to free components of a NULL uniform list.
This might happen if we manage to trigger the right linker errors.
2010-08-18 17:45:08 -07:00
Eric Anholt
f1d5a94197 glsl: Also strdup the names of uniform list entries for >vec4 types.
Fixes double-free since the fix to free all of the uniform list.
2010-08-18 17:45:08 -07:00
Kenneth Graunke
bd7853768d glcpp: Refresh autogenerated lexer. 2010-08-18 17:38:47 -07:00
Kenneth Graunke
9cf62bdfeb glcpp: Add basic #line support (adapted from the main compiler). 2010-08-18 17:38:47 -07:00
Eric Anholt
49dfa89873 ir_to_mesa: Fix leak by improper freeing of a uniform list. 2010-08-18 17:12:18 -07:00
Eric Anholt
b83846475b glsl2: Free the shader compiler at dri screen destruction.
Hooray, we can valgrind again without adding suppressions.  This also
adds an interface for use by an implementation of
glReleaseShaderCompiler().
2010-08-18 17:10:48 -07:00
Eric Anholt
3cd233eb57 ir_to_mesa: Don't leak the whole linked assembly program. 2010-08-18 16:29:02 -07:00
Eric Anholt
a482e03308 dri2: Clean up the common dri2 options at screen destroy. 2010-08-18 16:18:38 -07:00
Eric Anholt
4532feba14 glsl: Fix leak-causing typo in destructor that made it another constructor. 2010-08-18 16:18:38 -07:00
Vinson Lee
352e62c3c2 glsl: Fix uninitialized member in ir_hierarchical_vistor constructor.
Class member base_ir was not initialized by the default constructor.
2010-08-18 16:10:15 -07:00
Vinson Lee
e1c7f3af0c mesa: fpclassify is available on OpenSolaris.
There is no explicit predefined macro to distinguish between OpenSolaris
and Solaris. This patch assumes that the difference is in the compilers.
OpenSolaris uses GCC and not the Sun Studio compiler. Assume that the
availability of fpclassify is due to GCC.

This patch was not tested on Solaris. It would break the build on
Solaris with GCC if GCC on Solaris does not have fpclassify.
2010-08-18 14:36:08 -07:00
Eric Anholt
3ef83d270b ir_to_mesa: Fix leak of set_branchtargets temp data. 2010-08-18 14:16:07 -07:00
Eric Anholt
e271384219 glsl: Garbage collect old prototype for ir_to_mesa. 2010-08-18 14:16:07 -07:00
Eric Anholt
850c659044 ir_to_mesa: Stop leaking the ir_instruction * annotation of our compile. 2010-08-18 14:16:07 -07:00
Eric Anholt
56a0690a81 mesa: Free linked shaders when deleting the shader program. 2010-08-18 14:16:07 -07:00
Eric Anholt
5d0f430e8e mesa: Free old linked shaders when relinking new shaders. 2010-08-18 14:16:07 -07:00
Eric Anholt
0b09e6410f glsl2: Fix copy'n'paste hilarity leading to leaking in the refcount visitor. 2010-08-18 14:16:07 -07:00
Eric Anholt
abc6d7e0b4 ir_to_mesa: Free the ir_to_mesa temporary storage when we're done. 2010-08-18 14:16:07 -07:00
Eric Anholt
4a6a431684 mesa: Hang the compiled shader off the shader->ir, not the shader.
Otherwise, with repeated program recompile, we never free the results
of the previous compile.
2010-08-18 14:16:07 -07:00
Eric Anholt
0df61bdb66 mesa: Make MESA_GLSL=dump include when compile/link fails, and the info log. 2010-08-18 14:16:06 -07:00
Kenneth Graunke
665d75cc5a glsl: Fix scoping bug in if statements.
Fixes glslparsertest/glsl2/scoping-01.frag (successfully compiled but
should've failed) and scoping-02.frag (assertion triggered).
2010-08-18 14:03:25 -07:00
Kenneth Graunke
cf37ba3430 glsl: Refresh autogenerated file builtin_function.cpp. 2010-08-18 13:20:58 -07:00
Kenneth Graunke
011be6b594 generate_builtins.py: Clean up generated output a bit.
This should make it easier to diff the output, clean up some of the
insane whitespace, and make the strings a bit smaller.

We'll probably need to split up the prototype strings eventually, but
for now, this gets it under the 65K mark.
2010-08-18 13:20:41 -07:00
Kenneth Graunke
08a84c6a4a glsl/builtins: Add forgotten hyperbolic trig builtins in 1.30 profiles. 2010-08-18 13:16:50 -07:00
Kenneth Graunke
d12cb77d85 ir_constant_expression: Implement equal/notEqual for booleans.
Calls to equal(bvec, bvec) or notEqual(bvec, bvec) previously caused an
assertion.  Fixes piglit tests glsl-const-builtin-equal-bool and
glsl-const-builtin-notEqual-bool.
2010-08-18 12:08:19 -07:00
Christoph Bumiller
3e54d63429 Merge remote branch 'origin/master' into nv50-compiler 2010-08-18 14:37:47 +02:00
Christoph Bumiller
eaab764578 nv50: emit predicate for interp 2010-08-18 14:37:10 +02:00
Andre Maasikas
d442a01ac1 r600: implement SSG instruction 2010-08-18 14:27:43 +03:00
michal
8690c6a6b4 gallivm: Use proper index to lookup predicate register array.
Doesn't fix anything, as those indices were both always 0.
2010-08-18 13:16:42 +02:00
Andre Maasikas
c17d5de593 r600: implement DP2 opcode 2010-08-18 11:57:28 +03:00
Kenneth Graunke
a57b1e579d glsl2: Regenerate builtin_function.cpp. 2010-08-17 23:50:40 -07:00
Kenneth Graunke
f70ce12529 glsl2: Fix cut and paste error in EXT_texture_array builtins.
Fixes fd.o bug #29629.
2010-08-17 23:50:15 -07:00
Carl Worth
9751b4ec60 glcpp: Refresh generated files.
After a recent change to glcpp-parse.y (adding "redefined macro" error).
2010-08-17 23:41:53 -07:00
Carl Worth
3882cf2169 glcpp: Add support for "redefined macro" error.
Carefully avoiding printing any error when the new definition matches
the existing definition.

This fixes the recently-added 088-redefine-macro-legitimate.c and
089-redefine-macro-error.c tests as well as glsparsertest/preprocess1
in piglit.
2010-08-17 23:41:53 -07:00
Carl Worth
105e2137d6 glcpp: Add two new tests for testing redefined macros.
The specification says that redefining a macro is an error, unless the
new definitions is identical to the old one, (identical replacement
lists but ignoring differing amounts of whitespace).
2010-08-17 23:41:53 -07:00
Carl Worth
97638aa77c glcpp: Allow standalone glcpp to accept a filename as first argument.
This is useful for debugging the preprocessor.
2010-08-17 23:41:53 -07:00
Dave Airlie
3af87162cd r600g: add FRC, FLR, DDX and DDY
the first two are straight op2's and the DDX/DDY are taken from r600c.
2010-08-18 16:10:16 +10:00
Dave Airlie
be288c3505 r600g: add SGE and SLE opcodes
fixes fp-set-01 and glsl-fs-step
2010-08-18 16:03:49 +10:00
Dave Airlie
d01c0025e8 r600g: add TXB support
fixes biased texturing tests
2010-08-18 15:42:03 +10:00
Dave Airlie
b777db3254 r600g: fix TXP vs TEX in shader.
Don't do perspective for TEX, and also copy input to a temporary for TEX

also add tex opcode names
2010-08-18 15:42:02 +10:00
Carl Worth
ce5d0a296c glcpp: Fix 064-version.c expected result to track recent change.
In commit 6be3a8b70a, the #version directive
was fixed to stop generating a spurious newline. Here we simply update
the expected result for the single test which includes a #version directive.
2010-08-17 22:23:43 -07:00
Carl Worth
b9892f22d1 glcpp: Regenerated glcpp-lex.c from previous commit.
The previous commit changed glcpp-lex.l so we commit the resulting
generated file here.
2010-08-17 22:22:13 -07:00
Carl Worth
eb26f0d5b6 glcpp: Don't include the newline when discarding single-line comments
Matching the newline here meant having to do some redundant work here,
(incrementing line number, resetting column number, and returning a
NEWLINE token), that could otherwise simply be left to the existing rule
which matches a newline.

Worse, when the comment rule matches the newline as well, the parser
can lookahead and see a token for something that should actually be skipped.

For example, in a case like this:

	#if 0 // comment here
	fail
	#else
	win
	#endif

Both fail and win appear in the output, (not that the condition is being
evaluated incorrectly---merely that one token after the comment's newline
was being lexed/parse regardless of the condition).

This commit fixes the above test case, (which is also remarkably similar
to 087-if-comments which now passes).
2010-08-17 22:17:09 -07:00
Dave Airlie
4558b63455 r600g: add two simple tgsi opcodes.
makes glsl-fs-log2 and glsl1-integer division with uniform var pass
2010-08-18 13:48:04 +10:00
Dave Airlie
1147814365 r600g: fix point size
fixes piglit pointAtten and point-sprite tests
2010-08-18 13:30:34 +10:00
Eric Anholt
35220fc598 ir_to_mesa: Allow ir_return in main().
I didn't expect that this would really work, but it turns out there
are shaders in the wild that do it.

Fixes: (with swrast)
glsl-fs-main-return
glsl-vs-main-return
2010-08-17 19:55:14 -07:00
Eric Anholt
1cdef8e90a i965: Throw a link error when we see a "return" in main().
We'll need to use the HALT instruction to do this right, like returns
from other functions.
2010-08-17 19:55:14 -07:00
Dave Airlie
03c59e4ab1 r600g: fixup pitch alignment like r600c.
This still needs work, passes tex3d, fbo-scissor-bitmap, scissor-bitmap
2010-08-18 12:49:59 +10:00
Luca Barbieri
547e88e70d translate_sse: don't overwrite source buffer pointer
We were putting the source pointer in a register used as a temporary,
breaking all paths that don't read the data in a single instruction.
2010-08-18 04:21:46 +02:00
Eric Anholt
ede67e3071 glcpp: Add testcase for #if handling bug that breaks Savage2. 2010-08-17 17:51:10 -07:00
Dave Airlie
edb465e9bb r600g: fix height calcs for miptree
h needs to be rounded up, this probably needs revisiting when we get
to tiling etc.

fixes fbo-generatemipmap-npot
2010-08-18 10:50:19 +10:00
Dave Airlie
1d18739290 r600g: emit texture level offset in CB/DB setup.
8 more piglit tests pass,
fbo-clearmipmap, fbo-copyteximage, fbo-generatemipmap,
fbo-generatemipmap-nonsquare, fbo-generatemipmap-scissor,
fbo-generatemipmap-viewport, gen-teximage, gen-texsubimage
2010-08-18 10:35:09 +10:00
Eric Anholt
6992c3c373 ir_to_mesa: Fix implementation of ir_binop_equal, ir_binop_notequal.
These binops are the vector-to-bool comparisons, not vec-to-bvec.  We
likely want both operations avilable as expression, since 915 and 965
FS naturally does the vector version, while 965 VS can also naturally
do the scalar version.  However, we can save that until later.

Fixes:
glsl-fs-vec4-operator-equal.shader_test
glsl-fs-vec4-operator-notequal.shader_test
glsl-vs-vec4-operator-equal.shader_test
glsl-vs-vec4-operator-notequal.shader_test
2010-08-17 17:27:44 -07:00
Eric Anholt
02e1639829 i915: Add support for SSG opcode.
Fixes glsl-fs-sign and many of the tests of trig builtins.
2010-08-17 16:39:18 -07:00
Eric Anholt
e43b250fc0 i915: Add support for reading output regs in the FS.
Fixes glsl-unused-varying and many others, since we produce an output
reg read any time gl_FragColor is written inside an if statement.
2010-08-17 16:39:18 -07:00
Eric Anholt
66690864ef i915: Add support for OPCODE_DP2.
Fixes glsl-fs-dot-vec2.
2010-08-17 16:39:17 -07:00
Eric Anholt
a58514cc9c i915: Enable ARB_fragment_shader by default.
Now that we have glsl2 with if flattening in place, most shaders will
just work.  Remaining failing shaders will mostly be due to loop
unrolling (in progress), some possible if flattening failures in
inlining functions (planning on fixing), and the register/instruction
count limits.

While the GLSL and GLSL-ES specs say that shaders shouldn't fail to
compile/link due to register/instruction limits, in practice we're not
the first vendor to expose GLSL on hardware with these limitations.
The benefit to application developers of providing a better language
for GPU programming is greater than the pain of having to handle
instruction limits (which they had to for ARB_fp on this hardware
anyway)
2010-08-17 16:39:17 -07:00
Ian Romanick
bdc0e5285a glsl2: Fix transpose of rows and cols
This error led to an assertion failure for some constructors of
non-square matrices.  It only occured in matrices where the number of
columns was greater than the number of rows.  It didn't even always
occur on those.

Fixes piglit glslparsertest case constructor-16.vert.
2010-08-17 16:06:30 -07:00
Henri Verbeet
8f5f44c9c8 r600c: Handle reads from PROGRAM_OUTPUT
with glsl2, reads from outputs are legal
2010-08-17 18:25:32 -04:00
Ian Romanick
40e114b5dc linker: Demote user-defined varyings in the VS-only case
Fixes piglit test case glsl-vs-ff-frag and bugzilla #29623.
2010-08-17 14:57:18 -07:00
Benjamin Segovia
5a38e70d59 prog_optimize: Only merge writes to temporary registers
In one optimization pass, register files may have been messed therefore
merging instructions which use the same index in two different register
files.
2010-08-17 14:57:18 -07:00
Jerome Glisse
608f749ec3 r600g: fix fake pixel output
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-08-17 17:25:08 -04:00
Eric Anholt
147ca9f3fc i965: Add support for DP2 in the VS.
Fixes glsl-vs-dot-vec2.
2010-08-17 13:59:08 -07:00
Eric Anholt
0e6066df63 glsl: When doing algebraic simplification, make sure the type still matches.
When simplifying (vec4(1.0) / (float(x))) to rcp(float(x)), we forgot
to produce a vec4, angering ir_validate when starting alien-arena.

Fixes:
glsl-algebraic-add-zero-2
glsl-algebraic-div-one-2
glsl-algebraic-mul-one-2
glsl-algebraic-sub-zero-3
glsl-algebraic-rcp-sqrt-2
2010-08-17 13:50:45 -07:00
Eric Anholt
f166d94fac glsl: Make ir_algebraic new expressions allocate out of the parent.
This could reduce the amount of memory used by a shader tree after
optimization, and increases consistency with other passes.
2010-08-17 13:47:15 -07:00
Ian Romanick
664364052f ir_constant: Don't assert on out-of-bounds array accesses
Several optimization paths, including constant folding, can lead to
accessing an ir_constant array with an out of bounds index.  The GLSL
spec lets us produce "undefined" results, but it does not let us
crash.

Fixes piglit test case glsl-array-bounds-01 and glsl-array-bounds-03.
2010-08-17 13:00:03 -07:00
Eric Anholt
1b708d8f4d mesa: Dump shader source before validating the shader.
This will make extracting source to produce minimal testcases for
shader compile issues easier.
2010-08-17 12:39:03 -07:00
Christoph Bumiller
1bbbc8e0c8 nv50: initialize edgeflag input index 2010-08-17 19:03:48 +02:00
Alex Deucher
6cee1d6adf r600c: fix dword miscount in blit emit code 2010-08-17 10:42:06 -04:00
Christoph Bumiller
3e27785f3e nv50: check dst compatibility in CSE 2010-08-17 15:30:35 +02:00
Chia-I Wu
7f36b2980b targets/egl: Link with DRI_LIB_DEPS.
Use DRI_LIB_DEPS when linking GL/GLES state trackers.  This fixes
missing talloc symbol errors, and is hopefully more future proof.
2010-08-17 19:30:41 +08:00
nobled
37e5f78422 gallivm: Fix and re-enable MMX-disabling code
Signed-off-by: José Fonseca <jfonseca@vmware.com>
2010-08-17 12:25:10 +01:00
Christoph Bumiller
cb75082768 nv50: fix PSIZ and PRIMID mapping
Initializing map to 0x40 (0x80) instead of 0 now, so need to clear
it first.
2010-08-17 13:08:59 +02:00
Christoph Bumiller
ce1629564d nv50: more TGSI opcodes (SIN, SCS, ARL, RET, KILP) 2010-08-17 13:08:52 +02:00
Dave Airlie
0aa41e1d96 mesa: fix es1/2 build hopefully
needed to add cpp rules and includes properly for es1/es2
2010-08-17 20:54:45 +10:00
Dave Airlie
1c2a44e445 r300g: fix context destroy under hyperz
we were destroying the mm before unrefing all the objects, so segfault.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-08-17 19:01:18 +10:00
Vinson Lee
462e8a8b0d scons: Add -fno-common for 64-bit builds on Mac OS X.
This option is also needed for 64-bit builds if llvm is enabled.
Other the build fails during linking.
2010-08-17 00:20:58 -07:00
Dave Airlie
6043ee6e62 r600g: kill event type magic number in winsys
these events have names, use them.
2010-08-17 16:07:48 +10:00
Vinson Lee
279aeebff5 configs: Add -ltalloc to linux-dri.
Fixes build after glsl2 branch merge, which added talloc dependency.
2010-08-16 22:42:29 -07:00
Dave Airlie
3e58007892 r600g: add user clip plane support.
Apart from the fact that the radeon.h/r600_states.h editing is a nightmare, this
wasn't so bad.

passes piglit user-clip test now also trivial tests.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-08-17 14:19:09 +10:00
Eric Anholt
00ce188eb8 i965: Use the implied move available in most brw_wm_emit brw_math() calls.
This saves an extra message reg move in the program, though I'm not
clear on whether it will have any performance impact other than cache
footprint.  It will also fix those math calls on Sandybridge, where
the brw_eu_emit.c brw_math() support relies on the implied move being
used.
2010-08-16 20:09:53 -07:00
Eric Anholt
62383ae6fe i965: Add disasm for Compr4 instruction compression. 2010-08-16 20:06:55 -07:00
Ian Romanick
6c03c576cc Merge branch 'glsl2'
Conflicts:
	src/mesa/program/prog_optimize.c
2010-08-16 19:08:53 -07:00
Vinson Lee
15a3b42e13 util: Remove check_os_katmai_support.
check_os_katmai_support checks that the operating system running on a
SSE-capable processor supports SSE. This is necessary for unpatched
2.2.x and earlier kernels. 2.4.x and later kernels support SSE.

check_os_katmai_support will disable SSE capabilities for 32-bit x86
operating systems for which there is no code path. Currently, this
function handles Linux, Windows, and several BSDs. Mac OS, Cygwin, and
Solaris are several operating systems with no code paths.

Rather than add code for the unhandled operating systems, remove this
function altogether. This will fix SSE detection on all recent 32-bit
x86 operating systems. This completely breaks functionality on unpatched
2.2.x and earlier kernels, although there are likely no Gallium3D users
on such operating systems.
2010-08-16 18:52:37 -07:00
Dave Airlie
f50df65fcc r600g: drop libdrm_radeon link 2010-08-17 10:56:58 +10:00
Christoph Bumiller
62f933a6f6 nv50: generate JOINs for outermost IF clauses 2010-08-17 00:47:47 +02:00
Christoph Bumiller
6c5c55723d nv50: fix thinko in store to output reg possible check 2010-08-17 00:47:47 +02:00
Christoph Bumiller
e7a0bfa69a nv50: flatten simple IF/ELSE/ENDIF constructs
Less branching means less instructions and less thread divergence.
2010-08-17 00:47:46 +02:00
Kenneth Graunke
a433cd286c glsl2: Refresh autogenerated file builtin_function.cpp. 2010-08-16 15:18:44 -07:00
Kenneth Graunke
2f9ecc818d glsl2: Add builtins profile for GLSL 1.30.
Many functions are currently wrapped with #if 0 since we haven't
implemented them yet.
2010-08-16 15:18:44 -07:00
Ian Romanick
45d97dd6d5 linker: Include compiler.h to avoid spurious warnings about INLINE 2010-08-16 13:59:34 -07:00
Ian Romanick
d0a9cbd20e glsl2: Silence unused variable warning 2010-08-16 13:59:01 -07:00
Vinson Lee
f437ee85f4 translate: Move loop variable declaration outside for loop.
Fixes MSVC build.
2010-08-16 13:52:57 -07:00
Kenneth Graunke
2e26145862 glcpp: Refresh autogenerated lexer and parser. 2010-08-16 13:43:43 -07:00
Kenneth Graunke
6be3a8b70a glcpp: Remove spurious newline generated by #version handling.
This was causing line numbering to be off by one.  The newline comes
from the NEWLINE token at the end of the line; there's no need to
insert one.
2010-08-16 13:43:35 -07:00
Marek Olšák
ecec6df9cf r300g: fix assert in the rasterizer block for r3xx-r4xx
Reported-by: Niels Ole Salscheider <niels_ole@salscheider-online.de>
2010-08-16 19:19:17 +02:00
Ian Romanick
fc63e37b97 ir_to_mesa: Silence unused variable warnings 2010-08-16 09:45:01 -07:00
Ian Romanick
68772031e6 ir_to_mesa: Clean up assertions in ir_to_mesa_visitor::visit(ir_texture *) 2010-08-16 09:43:00 -07:00
Ian Romanick
0bf63733e5 ir_to_mesa: Support texture rectangle targets 2010-08-16 09:39:58 -07:00
José Fonseca
b421cb9546 translate: Remove unused temporary register.
Assuming the side-effect of x86_make_reg is also unnecessary.
2010-08-16 17:21:14 +01:00
José Fonseca
ded92e5dd8 translate: Eliminate void pointer arithmetic.
Non-portable.
2010-08-16 17:21:14 +01:00
Chia-I Wu
f945cb6515 st/egl: Add support for EGL_KHR_fence_sync.
The extension is implemented by pipe_fence_handle.
2010-08-17 00:06:19 +08:00
Chia-I Wu
2b2c5c4f5c egl: Add support for EGL_KHR_fence_sync.
Individual drivers still need to support and enable the extension.
2010-08-17 00:06:19 +08:00
Chia-I Wu
4b2495661f st/egl: Add support for EGL_KHR_reusable_sync.
The extension is implemented by pipe_condvar.
2010-08-17 00:06:19 +08:00
Chia-I Wu
4eebea74a8 egl: Add support for EGL_KHR_reusable_sync.
Individual drivers still need to support and enable the extension.
2010-08-17 00:06:19 +08:00
Chia-I Wu
b2a575ff28 egl: Update eglext.h.
Update to version 7 for EGL_KHR_fence_sync.
2010-08-17 00:06:18 +08:00
Alex Deucher
5ff769b21d r600c: blit emit updates
- set VGT_MAX_VTX_INDX to a larger value
- emit PA_SC_AA_CONFIG.  The command checker in 2.6.36+
  requires this reg.
2010-08-16 11:34:17 -04:00
Luca Barbieri
f201217c1d draw_llvm: fix segfaults on non-SSE2 CPUs where it is disabled (v2)
Changes in v2:
- Change function name

Currently draw_llvm refuses to create itself on non-SSE2 CPUs due to
an alleged LLVM bug.

However, this is implemented improperly, because other parts of draw
still attempt to access draw->llvm, resulting in segfaults.

Instead, put the check in debug_get_option_draw_use_llvm, check that
before calling draw_llvm_create, and then check whether draw->llvm is
non-null everywhere else.
2010-08-16 17:13:17 +02:00
Luca Barbieri
c2da8e7702 translate_sse: major rewrite (v5)
NOTE: Win64 is untested, and is thus currently disabled.
If you have such a system, please enable it and report whether it works.
To enable it, change src/gallium/auxiliary/translate/translate.c

Changes in v5:
- On Win64, preserve %xmm6 and %xmm7 as required by the ABI
- Use _WIN64 instead of WIN64

Changes in v4:
- Use x86_target() and x86_target_caps()
- Enable translate_sse in x86-64, but not in Win64

Changes in v3:
- Win64 support (untested)
- Use u_cpu_detect.h constants instead of #ifs

Changes in v2:
- Minimize #ifs
- Give a name to magic number CHANNELS_0001
- Add support for CPUs without SSE (only memcpy and swizzles, like non SSE2)
- Fixed comments

translate_sse is currently very limited to the point of
being useless in essentially all cases.

In particular, it only support some float32 and unorm8
formats and doesn't work on x86-64.

This commit rewrites it to support:
1. Dumb memory copy for any pair of identical formats
2. All formats that are swizzles of each other
3. Converting 32/64-bit floats and all 8/16/32-bit integers to 32-bit float
4. Converting unorm8/snorm8 to snorm16 and uscaled8/sscaled8 to sscaled16
5. Support for x86-64 (doesn't take advantage of it in any way though)

This new translate can even be useful to translate index buffers for
cards that lack 8-bit index support.

It passes the testsuite I wrote, but note that this is a major change, and more
testing would be great.
2010-08-16 17:09:24 +02:00
Luca Barbieri
a3e6e50544 rtasm: add minimal x86-64 support and new instructions (v5)
Changes in v5:
- Add sse2_movdqa

Changes in v4:
- Use _WIN64 instead of WIN64

Changes in v3:
- Add target and target caps functions, so that they could be different in
  principle from the current CPU and they don't need #ifs to check

Changes in v2:
- Win64 support (untested)
- Use u_cpu_detect.h constants instead of #ifs

This commit adds minimal x86-64 support: only movs between registers
are supported for r8-r15, and x64_rexw() must be used to ask for 64-bit
operations.

It also adds several new instructions for the new translate_sse code.

movdqa
2010-08-16 16:57:05 +02:00
Luca Barbieri
4a4e29a9ab translate: add support for 8/16-bit indices
Currently, only 32-bit indices are supported, but some use cases
translate needs support for all types.
2010-08-16 16:57:05 +02:00
Luca Barbieri
68e74f1b01 translate_sse: remove useless generated function wrappers
Currently translate_sse puts two trivial wrappers in the translate vtable.

These slow it down and enlarge the source code for no gain, except perhaps
the ability to set a breakpoint there, so remove them.

Breakpoints can be set on the caller of the translate functions, with no
loss of functionality.
2010-08-16 16:57:05 +02:00
Luca Barbieri
1cb92fb92e translate_generic: factor out common code between linear and indexed
This moves the common code into a separate ALWAYS_INLINE function.
2010-08-16 16:57:05 +02:00
Luca Barbieri
ddcf028aa0 translate_generic: use memcpy if possible (v3)
Changes in v3:
- If we can do a copy, don't try to get an emit func, as that can assert(0)

Changes in v2:
- Add comment regarding copy_size

When used in GPU drivers, translate can be used to simultaneously
perform a gather operation, and convert away from unsupported formats.

In this use case, input and output formats will often be identical: clearly
it would make sense to use a memcpy in this case.

Instead, translate will insist to convert to and from 32-bit floating point
numbers.

This is not only extremely expensive, but it also loses precision for
32/64-bit integers and 64-bit floating point numbers.

This patch changes translate_generic to just use memcpy if the formats are
identical, non-blocked, and with an integral number of bytes per pixel (note
that all sensible vertex formats are like this).
2010-08-16 16:57:05 +02:00
Chia-I Wu
9271059b36 drwa: Fix polygon edge flags.
Fix a copy-and-paste error introduced by
f141abdc8f.
2010-08-16 22:01:57 +08:00
Chia-I Wu
aaf51ed7c2 draw: No need to make max_vertices even.
Triangle strip alternates the front/back orientation of its triangles.
max_vertices was made even so that varray never splitted a triangle
strip at the wrong positions.

It did not work with triangle strips with adjacencies.  And it is no
longer relevant with vsplit.
2010-08-16 21:04:24 +08:00
Chia-I Wu
c3fee80f2b draw: Remove DRAW_PIPE_MAX_VERTICES and DRAW_PIPE_FLAG_MASK.
The higher bits of draw elements are no longer used for the stipple or
edge flags.
2010-08-16 20:57:08 +08:00
Chia-I Wu
a072f0e186 drwa: Add PRIMITIVE macro to vsplit.
PRIMITIVE is used by the indexed path to flush the entire primitive with
custom vertex count checks.  It replaces the existing fast path.
2010-08-16 20:46:29 +08:00
Chia-I Wu
7b3beb2240 draw: last_vertex_last is always true for GS and SO.
That is, OpenGL decomposition rule is assumed.  There should be a
pipe_context state to specify the rules.
2010-08-16 20:46:29 +08:00
Chia-I Wu
a97419a3ba draw: Remove varray and vcache.
They have been deprecated by vsplit.
2010-08-16 20:46:29 +08:00
Chia-I Wu
5a085c623f draw: Replace vcache by vsplit.
vcache decomposes primitives while vsplit splits primitives.  Splitting
is generally easier to do and is faster.  More importantly, vcache
depends on flatshade_first to decompose.  The outputs may have incorrect
vertex order which is significant to GS.
2010-08-16 20:46:28 +08:00
Chia-I Wu
5b6bf799e6 draw: Replace varray by vsplit.
vsplit is a superset of varray.  It sets the split flags comparing to
varray.
2010-08-16 20:46:28 +08:00
Chia-I Wu
04bc530dbd draw: Add vsplit frontend.
vsplit is based on varray.  It sets the split flags when a primitive is
splitted.  It also has support for indexed primitives.

For indexed primitives, unlike vcache, vsplit splits the primitives
instead of decomposes them.
2010-08-16 20:46:28 +08:00
Chia-I Wu
56213a64fe draw: Add new util function draw_pt_trim_count.
draw_pt_trim_count is renamed from trim in draw_pt.c.
2010-08-16 20:46:28 +08:00
Chia-I Wu
9d2be38fad draw: Simplify frontend interface a little.
The run method is simplified to take the start vertex and the vertex
count.
2010-08-16 20:46:27 +08:00
Chia-I Wu
f132498347 draw: Add prim flags to middle ends.
Update the middle end interface to pass the primitive flags from the
frontends to the pipeline.  No frontend sets the flags yet.
2010-08-16 20:46:27 +08:00
Chia-I Wu
f141abdc8f draw: Add flags to draw_prim_info.
A primitive may be splitted in frontends.  The splitted primitives
should convey certain flag bits so that the decomposer can correctly
decide the stipple or edge flags.

This commit adds flags to draw_prim_info and updates the decomposer to
honor the flags.  Frontends and middle ends will be updated later.
2010-08-16 20:46:27 +08:00
nobled
9d4a0d7d4d st/mesa: test for FEATURE defines
'struct dd_function_table' only conditionally contains
the function pointer NewFramebuffer and friends based on
FEATURE_EXT_framebuffer_* defines. (See src/mesa/main/dd.h)

Fixes the build when the features are disabled and the vfuncs
don't exist.
2010-08-16 20:29:19 +08:00
nobled
70f9f5f7d4 dri/nouveau: test for FEATURE defines
'struct dd_function_table' only conditionally contains
the function pointer NewFramebuffer and friends based on
FEATURE_EXT_framebuffer_* defines. (See src/mesa/main/dd.h)

Fixes the build when the features are disabled and the vfuncs
don't exist.
2010-08-16 20:29:16 +08:00
nobled
234a065171 dri/radeon: test for FEATURE defines
'struct dd_function_table' only conditionally contains
the function pointer NewFramebuffer and friends based on
FEATURE_EXT_framebuffer_* defines. (See src/mesa/main/dd.h)

Fixes the build when the features are disabled and the vfuncs
don't exist.
2010-08-16 20:29:12 +08:00
Vinson Lee
3261c6c41e x86: Remove unnecessary header from sse.h. 2010-08-16 00:26:10 -07:00
Vinson Lee
2144f8e95e x86: Include missing headers in mmx.h.
Include compiler.h for _ASMAPI symbol.
Include mtypes.h for GLcontext symbol.
2010-08-15 23:29:09 -07:00
Vinson Lee
51f979c347 x86: Remove unnecessary header from 3dnow.h. 2010-08-15 23:10:42 -07:00
Vinson Lee
15c7ce867c glsl: Clean up header file inclusion in slang_typeinfo.h.
Remove imports.h, mtypes.h, and slang_vartable.h.
Include glheader.h for GL symbols.
2010-08-15 22:44:29 -07:00
Vinson Lee
9965ee5571 glsl: Include missing header in slang_codegen.h.
Include slang_vartable.h for slang_var_table symbol.
2010-08-15 22:39:51 -07:00
Vinson Lee
640139f80c glsl: Include missing header in slang_compile_operation.h.
Include compiler.h for INLINE symbol.
2010-08-15 22:38:23 -07:00
Vinson Lee
35a27f6fce glsl: Clean up header file inclusion in slang_storage.h.
Remove slang_compile.h.
Include glheader.h for GL symbols.
Include slang_compile_function.h for slang_function_scope symbol.
Include slang_compile_struct.h for slang_struct_scope symbol.
Include slang_compile_variable.h for slang_variable_scope symbol.
Include slang_typeinfo.h for slang_type_specifier symbol.
Include slang_utility.h for slang_atom_pool symbol.
2010-08-15 22:26:27 -07:00
Vinson Lee
97590ebeb0 glsl: Clean up header file inclusion in slang_mem.h.
slang_mem.h
Remove imports.h.
Include glheader.h for GL symbols.

slang_label.c
Include imports.h now that slang_mem.c does not include it.
2010-08-15 22:07:04 -07:00
Vinson Lee
5d2d5bf0c7 glsl: Clean up header file inclusion in slang_ir.h.
Remove imports.h and slang_compile.h.
Include glheader.h for GL symbols.
Include slang_compile_variable.h for slang_variable symbol.
2010-08-15 21:17:50 -07:00
Vinson Lee
44ad729aa3 glsl: Include missing header in slang_link.c.
Include slang_compile.h for _slang_compile function.
2010-08-15 21:13:32 -07:00
Vinson Lee
43ba1f63c7 glsl: Include missing headers in slang_builtin.c.
Include slang_typeinfo.h for slang_type_specifier symbol.
Include slang_compiler_struct.h for slang_struct_ symbol.
2010-08-15 21:10:16 -07:00
Marek Olšák
ecae1fca6f r300g: fix an invalid pointer in free 2010-08-16 05:05:43 +02:00
nobled
e897bf524b r300g: Let hyperz init fail
Signed-off-by: Marek Olšák <maraeo@gmail.com>
2010-08-16 05:00:09 +02:00
nobled
1e2cd02eae r300g: Fix leaks in failed context creation
This changes r300_destroy_context() so it can be called
on a partially-initialized context, and uses it when
r300_create_context() hits a fatal error.

This makes sure r300_create_context() doesn't leak memory
or neglect to call r300_update_num_contexts() when it fails.

Signed-off-by: Marek Olšák <maraeo@gmail.com>
2010-08-16 04:59:58 +02:00
nobled
b0e1565b5f r300g: Fix macro
This fixes a potential bug if (has_hyperz) is false
(it would still init the atom as if has_hyperz were true).

Signed-off-by: Marek Olšák <maraeo@gmail.com>
2010-08-16 04:59:13 +02:00
Marek Olšák
83baa8a6c5 st/mesa: remove output register reads inside shaders
This is a GLSL2 regression fix.
2010-08-16 02:19:18 +02:00
Marek Olšák
27eb2e2755 r300/compiler: implement DP2 opcode 2010-08-16 00:08:00 +02:00
Marek Olšák
b217167056 r300/compiler: implement SSG opcode 2010-08-16 00:08:00 +02:00
Marek Olšák
b97ab20f29 r300/compiler: fix allocation of temporaries in radeonTransformTEX 2010-08-16 00:07:54 +02:00
Keith Whitwell
c9b7bece05 llvmpipe: special case triangles which fall in a single 16x16 block
Check for these and route them to a dedicated handler with one fewer
levels of recursive rasterization.
2010-08-15 23:02:10 +01:00
Vinson Lee
a0b0afc694 mesa: Check that _XOPEN_SOURCE is defined before using it. 2010-08-15 13:08:15 -07:00
Christoph Bumiller
4de293bb9a nv50: loops part 2
At least the mesa demo glsl/mandelbrot should work now.
2010-08-15 21:40:00 +02:00
Christoph Bumiller
34e0db4c50 nv50: more constant folding 2010-08-15 21:39:57 +02:00
Keith Whitwell
85d9bc236d llvmpipe: consolidate several loops in lp_rast_triangle 2010-08-15 17:40:39 +01:00
Keith Whitwell
ff26594a92 llvmpipe: remove all traces of step arrays, pos_tables
No need to calculate these values any longer, nor to store them in the
bin data.  Improves isosurf a bit more, 115->123 fps.
2010-08-15 17:31:13 +01:00
Keith Whitwell
4c0641454b llvmpipe: eliminate last usage of step array in rast_tmp.h
For 16 and 64 pixel levels, calculate a mask which is linear in x and
y (ie not in the swizzle layout).

When iterating over full and partial masks, figure out position by
manipulating the bit number set in the mask, rather than relying on
postion arrays.

Similarly, calculate the lower-level c values from dcdx, dcdy and the
position rather than relying on the step array.
2010-08-15 17:24:54 +01:00
Keith Whitwell
ee0d1c29ee llvmpipe: don't refer to plane->step when dcdx or dcdy would do 2010-08-15 17:22:25 +01:00
Keith Whitwell
4b322e71bb llvmpipe: also use build_mask at 16, 64 pixel levels 2010-08-15 16:49:26 +01:00
Keith Whitwell
515194968d llvmpipe: version of block4 which doesn't need the full step array
No noticable slowdown with isosurf.
2010-08-15 16:32:45 +01:00
Keith Whitwell
510b035394 llvmpipe: reorganize block4 loop, nice speedup
isosurf 95->115 fps just by exchanging the two inner loops in this
function...
2010-08-15 16:25:06 +01:00
Corbin Simpson
2d53dc873e gallium/docs: Cleanup debugging. Spelling, grammar, organization. 2010-08-15 03:43:54 -07:00
Corbin Simpson
bf357aedff gallium/docs: Add formatting for envvar role; change debugging.
Per Jakob's request. Not super-pretty, but it's a good point for modding
later.
2010-08-15 03:43:54 -07:00
Vinson Lee
d375cb869e glsl: Fix self inclusion in slang_compile_function.h.
Fix self inclusion introduced by commit
4fef77c7c5.
2010-08-15 01:30:02 -07:00
Vinson Lee
6f2077e1ab glsl: Include missing header in slang_ir.h.
Include prog_instruction.h for gl_inst_opcode symbol.
2010-08-15 01:23:10 -07:00
Vinson Lee
babea9f1f6 glsl: Clean up header file inclusion in slang_link.h.
Remove slang_compile.h.
Include mtypes.h for GLcontext symbol.
2010-08-15 01:06:43 -07:00
Vinson Lee
c4e99500f4 glsl: Clean up header file inclusion in slang_label.h.
Move mtypes.h and prog_instruction.h to slang_label.c.
Remove imports.h.
Include glheader.h from GL symbols.
2010-08-15 01:01:58 -07:00
Marek Olšák
6dfcff6b05 r300g: mark HiZ/ZMask_clear atoms as non-dirty after emission in clear 2010-08-15 09:20:30 +02:00
Vinson Lee
ff27c68ca2 glsl: Clean up header file inclusion in slang_emit.h.
Remove imports.h.
Remove mtypes.h.
Remove slang_compile.h.
Include glheader.h for GL symbols.
Include slang_vartable.h for slang_var_table symbol.
2010-08-14 23:40:42 -07:00
Vinson Lee
0ef5449832 glsl: Clean up header file inclusion in slang_compile.h.
Remove imports.h.
Remove slang_typeinfo.h.
Remove slang_compile_operation.h.
Include glheader.h for GL symbols.
Include slang_utility.h for slang_atom_pool symbol.
2010-08-14 23:32:08 -07:00
Vinson Lee
8981fae4c3 glsl: Include missing headers in slang_compile_struct.h.
Include glheader.h for GL symbols.
Include slang_utility.h for slang_atom symbol.
2010-08-14 23:19:28 -07:00
Marek Olšák
d5a86f9fc9 r300g: do not use HiZ if HiZ RAM is not properly initialized 2010-08-15 08:07:11 +02:00
Marek Olšák
59c2230879 r300g: rename dirty_zmask -> zmask_in_use 2010-08-15 08:07:11 +02:00
Marek Olšák
516152112e r300g: do not clear with blitter if we clear just the ZMask RAM
This skips the blitter clear path entirely if the color is not cleared and
the depth+stencil is cleared with the ZMask.
2010-08-15 08:07:11 +02:00
Marek Olšák
5f8ccf1e27 r300g: do not use fastfill if ZMask RAM is not properly initialized
z_fastfill -> dirty_zmask[level].
2010-08-15 08:07:11 +02:00
Marek Olšák
0d699e8ee9 r300g: separate num_cs_end_dwords out from prepare_for_rendering 2010-08-15 08:07:11 +02:00
Vinson Lee
f1702b1808 glsl: Include missing headers in slang_print.h.
Include glheader.h for GL symbols.
Include slang_compile_function.h for slang_function symbol.
Include slang_compile_operation.h for slang_operation symbol.
Include slang_compile_variable.h for slang_variable and slang_variable_scope symbols.
Include slang_typeinfo.h for slang_type_qualifer and slang_fully_specified_type symbols.
2010-08-14 23:14:42 -07:00
Vinson Lee
4fef77c7c5 glsl: Include missing headers in slang_compile_function.h
Include glheader.h for GL symbols.
Include slang_compile_function.h for slang_function symbol.
Include slang_compile_operation.h for slang_operation symbol.
Include slang_compile_variable.h for slang_variable and
slang_variable_scope symbols.
Include slang_log.h for slang_info_log symbols.
Include slang_utility.h for slang_atom and slang_atom_pool symbols.
2010-08-14 22:57:47 -07:00
Vinson Lee
9bfbfd55af glsl: Include missing headers in slang_compiler_operation.h.
Include glheader.h for GL symbols.
Include slang_compile_variable.h for slang_variable_scope symbol.
Include slang_utility.h for slang_atom symbol.
2010-08-14 22:43:26 -07:00
Vinson Lee
1918820d2e glsl: Include missing headers in slang_simplify.h.
Include glheader.h for GL symbols.
Include slang_compile.h for slang_name_space symbol.
Include slang_compile_function.h for slang_function symbol.
Include slang_compile_operation.h for slang_operation symbol.
Include slang_log.h for slang_info_log symbol.
Include slang_utility.h for slang_atom_pool symbol.
2010-08-14 21:21:10 -07:00
Vinson Lee
99003560ca glsl: Include missing header in slang_utility.h.
Include glheader.h for GL symbols.
2010-08-14 18:56:17 -07:00
Vinson Lee
845554eb3b glsl: Include missing headers in slang_vartable.h.
Include glheader.h for GL symbols.
Include slang_utility.h for slang_atom symbol.
2010-08-14 18:53:22 -07:00
Jakob Bornecrantz
fe19935a12 gallium/docs: Add rbug to distribution 2010-08-15 01:06:57 +01:00
Jakob Bornecrantz
d62b29f567 gallium/docs: Add a debugging section 2010-08-15 01:06:53 +01:00
Jakob Bornecrantz
7f5202be63 gallium: Make printing info on debug builds default off
This commit silences the printing off most of the debug information
when running debug builds. The big culprits are: the tgsi sanity checker
that gets run on all shaders on debug; all the options; and
finaly the cpu caps printer.
2010-08-15 01:03:23 +01:00
Vinson Lee
84ec422232 glsl: Include missing header in slang_log.h.
Include glheader.h for GLboolean symbol.
2010-08-14 16:27:42 -07:00
Vinson Lee
fcd2da4e7a glsl: Include missing headers in slang_compile_variable.h.
Include glheader.h for GL symbols.
Include slang_typeinfo.h for slang_fully_specified_type symbol.
Include slang_utility.h for slang_atom symbol.
2010-08-14 15:16:14 -07:00
Vinson Lee
586fbc7286 glsl: Clean up header file inclusion in slang_codegen.h.
Remove mtypes.h.
Include glheader.h for GL symbols.
Include slang_compile_variable.h for slang_variable symbol.
Include slang_typeinfo.h for slang_type_specifier symbol.
Include slang_utility.h for slang_atom_pool symbol.
2010-08-14 14:58:09 -07:00
Vinson Lee
10d77f3f6b gallivm: Remove unnecessary header. 2010-08-14 12:54:21 -07:00
Vinson Lee
db0e24e34a scons: Fix r600g build. 2010-08-14 12:18:51 -07:00
Vinson Lee
77458b565a r600g: Remove unnecessary headers. 2010-08-14 11:56:26 -07:00
Vinson Lee
e01a49af61 r300g: Remove unnecessary header. 2010-08-14 11:44:01 -07:00
Luca Barbieri
9232566269 u_cpu_detect: remove arch and little_endian
This logic duplicates the one in p_config.h, so remove it and adjust
the only two places that were using it.
2010-08-14 19:23:52 +02:00
José Fonseca
eacb624a4a gallivm: Refactor the Newton-Rapshon steps, and disable once again.
It causes a very ugly corruption on the Earth's halo on Google Earth.
2010-08-14 18:03:13 +01:00
José Fonseca
9349379d1a Revert "glsl2: Use stdint.h instead of inttypes.h"
This reverts commit a77a6bc008.
2010-08-14 16:01:24 +01:00
José Fonseca
8df0bea9c5 Replace our custom C99 headers with http://code.google.com/p/msinttypes/
Perhaps http://www.azillionmonkeys.com/qed/pstdint.h would be a better
(more portable) choice, but only MSVC uses this anyway, and we can always
change later.
2010-08-14 16:00:52 +01:00
José Fonseca
1cbcf6693a glsl: Standardize a few more uses of struct vs class keyword. 2010-08-14 15:35:57 +01:00
José Fonseca
1d22923fae scons: Link talloc. 2010-08-14 15:29:15 +01:00
José Fonseca
4b1721eaf3 glsl: Silence gcc warning "control reaches end of non-void function". 2010-08-14 14:40:39 +01:00
José Fonseca
19acfa42ed mesa: Silence gcc warning "control reaches end of non-void function". 2010-08-14 14:40:06 +01:00
José Fonseca
325aa1b3cd mesa: Silence gcc warning "missing initializer for member". 2010-08-14 14:38:09 +01:00
José Fonseca
8881b0fe43 mesa: Recent versions of MSVC define the single precision functions already. 2010-08-14 13:10:24 +01:00
José Fonseca
2322404b55 scons: Add new source files. 2010-08-14 12:45:14 +01:00
José Fonseca
68f602afb1 mesa: atan2f and powf need two args. 2010-08-14 12:44:41 +01:00
Vinson Lee
3c9b00e6e8 glsl: Clean up header file inclusion in slang_builtin.h.
Remove prog_parameter.h and slang_utility.h.
Include glheader.h for GL symbols.
Include mtypes.h for gl_*_result symbols.
2010-08-14 01:59:54 -07:00
Vinson Lee
71a6dea0f5 glsl: Clean up header file inclusion. 2010-08-14 01:46:21 -07:00
Vinson Lee
d75eac5db1 glsl: Include missing header in slang_compile.c.
Include sl_pp_purify.h for sl_pp_purify_options symbol.
2010-08-14 01:38:04 -07:00
Vinson Lee
de33671a4f glsl/cl: Add forward declaration. 2010-08-14 00:53:28 -07:00
Ian Romanick
443a7e4e9a Merge branch 'master' into glsl2 2010-08-13 20:22:46 -07:00
Ian Romanick
2f8ee757ab mesa: Work-arounds for platforms that lack C99 math functions 2010-08-13 20:18:08 -07:00
Kenneth Graunke
9364ad8528 glsl2/Makefile: Add a 'make builtins' target.
This copies over a dummy builtin_functions.cpp and rebuilds a
bootstrapped version of the compiler, then uses that to generate the
proper list of builtins.  Finally, it rebuilds the compiler with the new
list.

Unfortunately, it's no longer automatic, but at least it works.
2010-08-13 19:09:36 -07:00
Kenneth Graunke
43ff8f1a4b glsl2: Rework builtin function generation.
Each language version/extension and target now has a "profile" containing
all of the available builtin function prototypes.  These are written in
GLSL, and come directly out of the GLSL spec (except for expanding genType).

A new builtins/ir/ folder contains the hand-written IR for each builtin,
regardless of what version includes it.  Only those definitions that have
prototypes in the profile will be included.

The autogenerated IR for texture builtins is no longer written to disk,
so there's no longer any confusion as to what's hand-written or
generated.

All scripts are now in python instead of perl.
2010-08-13 19:09:36 -07:00
Kenneth Graunke
d802ba110f ir_reader: Don't mark functions as defined if their body is empty. 2010-08-13 19:09:35 -07:00
Ian Romanick
d01bf822dd glsl2: Commit generated file change by commit ab18be74
This would have been included in commit 23f6017d, but make wisely did
not regenerate the file when the .lpp file did not change.
2010-08-13 19:05:54 -07:00
Eric Anholt
8f8cdbfba4 glsl2: Add a pass to strip out noop swizzles.
With the glsl2-965 branch, the optimization of glsl-algebraic-rcp-rcp
regressed due to noop swizzles hiding information from ir_algebraic.
This cleans up those noop swizzles for us.
2010-08-13 17:54:47 -07:00
Eric Anholt
42cab131da glsl2: Convert ir_constant_propagation to ir_rvalue_visitor.
This one is a little tricky because of the LHS handling.
2010-08-13 17:54:47 -07:00
Eric Anholt
b3b0cf6a4c glsl2: Add a generic visitor class to call back with pointers to each rvalue.
I keep copy and pasting this code all over, so consolidate it in one
place.
2010-08-13 17:54:46 -07:00
Eric Anholt
9c3acce680 mesa: Avoid using c++ keyword in dri_util.h when compiled with c++. 2010-08-13 17:54:46 -07:00
Eric Anholt
c374487a54 intel: Remove include of texmem.h, since we haven't used it in ages. 2010-08-13 17:54:46 -07:00
Eric Anholt
d19eecef54 glsl2: Move ir_to_mesa handling to driver CompileShader and LinkShader hooks.
This lets drivers override ir_to_mesa with their own codegen, or at
least have a native alternative.
2010-08-13 17:54:42 -07:00
Eric Anholt
013bbbbb0a glsl2: Add support for ir_unop_neg to ir_mat_op_to_vec 2010-08-13 17:47:00 -07:00
Eric Anholt
2f4fe15168 glsl2: Move the common optimization passes to a helper function.
These are passes that we expect all codegen to be happy with.  The
other lowering passes for Mesa IR are moved to the Mesa IR generator.
2010-08-13 17:47:00 -07:00
Kenneth Graunke
c55aa4292f glsl2: Refresh autogenerated bison parser. 2010-08-13 17:16:43 -07:00
Vinson Lee
07ca55b7fa Fix an MSVC build error (bugzilla 29570). 2010-08-13 17:11:21 -07:00
Ian Romanick
768b55a526 glsl2: Remove unnecessary use of 'struct' before type names
In C++ you don't have to say 'struct' or 'class' if the declaration of
the type has been seen.  Some compilers will complain if you use
'struct' when 'class' should have been used and vice versa.

Fixes bugzilla #29539.
2010-08-13 16:46:43 -07:00
Ian Romanick
d960b61ea3 Add missing intmax_t and uintmax_t 2010-08-13 16:22:38 -07:00
Ian Romanick
a77a6bc008 glsl2: Use stdint.h instead of inttypes.h 2010-08-13 16:22:21 -07:00
Brian Paul
e8000ffeaf mesa: assorted clean-ups, var type changes, assertions in prog_optimize.c 2010-08-13 15:59:25 -06:00
Benjamin Segovia
9021c56a57 mesa: more/better program optimizations
This is the patch from Benjamin's Aug 11, 2010 email with minor fixes
(such as moving declarations before code)

Signed-off-by: Brian Paul <brianp@vmware.com>
2010-08-13 15:59:25 -06:00
Ian Romanick
23f6017d70 glsl2: Commit generated file changed by previous commit 2010-08-13 14:50:53 -07:00
Ian Romanick
ab18be74ac glsl2: Use --nounistd to fix MSVC build
Also remove the --never-interactive command line option for the
preprocessor lexer.  This was already done for main compiler lexer.
2010-08-13 14:50:53 -07:00
Ian Romanick
c33e78f62b linker: Assign attrib location 0 if gl_Vertex is not used
If gl_Vertex is not used in the shader, then attribute location 0 is
available for use.

Fixes piglit test case glsl-getattriblocation (bugzilla #29540).
2010-08-13 14:50:48 -07:00
George Sapountzis
5c0a0f2198 st/dri: make dri_drawable_validate_att static 2010-08-13 23:08:02 +03:00
George Sapountzis
c14b4371ed st/dri: move TFP code to dri_drawable.c
This is based on a patch by nobled <nobled@dreamwidth.org> and allows the TFP
extension to be enabled for DRISW also. This patch does not enable TFP for DRISW
though, because testing on xephyr segfaults here (for both classic and gallium):

Program received signal SIGSEGV, Segmentation fault.
0x00786a4a in _mesa_GenTextures (n=1, textures=0xbfffee4c) at main/texobj.c:788
788	   ASSERT_OUTSIDE_BEGIN_END(ctx);
(gdb)
(gdb) where
\#0  0x00786a4a in _mesa_GenTextures (n=1, textures=0xbfffee4c) at main/texobj.c:788
\#1  0x0817a004 in __glXDisp_GenTextures ()
\#2  0x08168498 in __glXDispatch ()
\#3  0x0808b6ce in Dispatch ()
\#4  0x08084435 in main ()

The TFP code is generic except for the teximage call. We need to verify that
DRISW correclty implements whatever hook teximage finally calls.
2010-08-13 22:58:11 +03:00
nobled
5270deaab6 st/dri: Fix segmentation fault in sw drivers 2010-08-13 22:57:26 +03:00
George Sapountzis
d3758feb6b st/dri: dri_drawable_get_format is shared between DRI2 and DRISW 2010-08-13 22:20:19 +03:00
Jakob Bornecrantz
204d4cbea0 glsl2: Include string.h in preprocessor 2010-08-13 18:36:55 +01:00
Ian Romanick
103453659d glsl2: Commit generated files changed by previous two commits 2010-08-13 09:34:52 -07:00
Ian Romanick
5c77efc0b2 glsl2: Avoid token name collisions with names used by Windows header files 2010-08-13 09:30:56 -07:00
Ian Romanick
5b9f3db719 glsl2: Eliminate tokens for square matrix short names
MAT2 and MAT2X2, for example, are treated identically by the parser.
The language version based error checking (becuase mat2x2 is not
available in GLSL 1.10) is already done in the lexer.
2010-08-13 09:29:39 -07:00
José Fonseca
3a3cdb909d scons: Build the new glsl2 code. 2010-08-13 13:55:34 +01:00
José Fonseca
1ca2945f84 talloc: Make it compile with MSVC, MinGW, and Xcode/gcc4.0.
Based on Aras Pranckevičius' patch.
2010-08-13 13:53:04 +01:00
José Fonseca
e6032b1d96 talloc: Import 2.0.1 code. 2010-08-13 12:31:10 +01:00
Vinson Lee
48def868d9 mesa: Clean up header file inclusion in vf.h.
Remove mtypes.h.
Include glheader.h for GL symbols.
2010-08-13 01:23:39 -07:00
Vinson Lee
5dbd3fe3d4 swrast: Clean up header file inclusion in ss_vb.h.
Remove unnecessary header swrast_setup.h.
2010-08-13 00:48:34 -07:00
Vinson Lee
c7f24afcaf swrast: Clean up header file inclusion in ss_triangle.h.
Remove ss_context.h.
Include mtypes.h for GLcontext symbol.
2010-08-12 23:56:52 -07:00
Vinson Lee
8829e0c3f3 swrast: Clean up header file inclusion in ss_context.h.
Remove mtypes.h and swrast_setup.h.
Include glheader.h for GL symbols.
2010-08-12 23:51:16 -07:00
Vinson Lee
db0c6810f9 mesa: Include missing header in programopt.h.
Include mtypes.h for GLcontext and gl_register_file symbols.
2010-08-12 23:28:25 -07:00
Marek Olšák
bac59b336b r300g: do not support separate depth/stencil clear in the driver
It doesn't work well with Hyper-Z, so put the burden on the state tracker.
2010-08-13 08:23:06 +02:00
Marek Olšák
aa6bdd38af r300g: fix fastfill when color and Z clear are invoked separately
This always restores the previous depth clear value after CBZB clear.
2010-08-13 04:41:38 +02:00
Marek Olšák
4985ce1755 r600g: update shader caps
Sent on ML by Владимир.

These values are what fglrx returns.
2010-08-13 03:28:35 +02:00
Ian Romanick
0dc39f481a glsl2: Use MIN2 from macros.h instead of open coding it 2010-08-12 18:01:14 -07:00
Marek Olšák
16e782b83f r300g: disable depth clamp for now
It breaks Regnum Online in that it renders random triangles
all over the screen.

https://bugs.freedesktop.org/show_bug.cgi?id=29518
2010-08-13 02:59:01 +02:00
Vinson Lee
06928ba3c3 mesa: fpclassify is available with MinGW.
This patch fixes the MinGW build.
2010-08-12 17:37:00 -07:00
Dave Airlie
527ac905f6 r600g: fix warning in the winsys 2010-08-13 10:22:46 +10:00
Dave Airlie
f2804e7062 r600g: fix memory leaks running gears.
I noticed gears memory usage was heading skywards, some r600 "states"
aren't properly refcounted, and the ctx->state is never freed.
2010-08-13 10:22:46 +10:00
Vinson Lee
26c042c30a translate_test: Fix compilation with MSVC. 2010-08-12 17:12:56 -07:00
Vinson Lee
ca70bf8c9d scons: Add main/querymatrix.c to SCons build.
Commit 87eb667759 added querymatrix.c to
make but not to SCons.
2010-08-12 16:34:22 -07:00
Ian Romanick
261bbc011d glsl2: Use Elements from main/compiler.h instead of open-coding 2010-08-12 15:05:39 -07:00
Brian Paul
c59c6c0122 glsl: print to stderr like other program printing code 2010-08-12 16:00:03 -06:00
Brian Paul
2d83e3fa0d mesa: check for null shader->InfoLog before printing 2010-08-12 16:00:01 -06:00
Vinson Lee
56450d5f11 mesa: Fix FreeBSD build with llvm enabled.
On FreeBSD LC_CTYPE_MASK is not available but 'llvm-config --cppflags'
adds the compiler flag -D_GNU_SOURCE to the build.
2010-08-12 14:54:30 -07:00
Luca Barbieri
b9abe7f62c translate_test: fix compilation on non-POSIX platforms
Use a kludgy function based on rand() instead of drand48()
2010-08-12 22:10:09 +02:00
Ian Romanick
4ca4edd20e glsl2: Commit generated file changed by previous commit 2010-08-12 10:09:05 -07:00
Ian Romanick
188f60fb05 glsl2: Add missing include of string.h
Makes the build happy on non-GCC platforms.
2010-08-12 10:09:05 -07:00
Luca Barbieri
4d946c4e8a translate_test: improve
1. Generate random data specifically for float and doubles, so that
   they end up in [0, 1] range
2. Don't test useless conversions like SCALED <-> NORM
3. Poison the buffers before testing
2010-08-12 18:36:21 +02:00
Jakob Bornecrantz
4f51762b07 gallium: Link DRI drivers with g++ and test with CXX
New shader compiler need libc++ runtime. This works already if
we are using llvm so this just covers the !llvm case.
2010-08-12 16:04:11 +01:00
Marek Olšák
f668ea11bd Revert "u_blitter: unify clear_depth_stencil and flush_depth_stencil"
This reverts commit de4784e365.
2010-08-12 13:35:16 +02:00
Andre Maasikas
e62e5b0922 r600: add support for draw_elements_base_vertex
use VTX_BASE_VTX_LOC for offset, last time using INDEX_OFFSET was
probably a wrong register for this
2010-08-12 12:44:10 +03:00
Vinson Lee
17bcfaa475 mesa: Clean up header file inclusion in prog_uniform.h.
Remove mtypes.h.
Remove prog_statevars.h.
Include glheader.h for GL symbols.
2010-08-12 00:33:48 -07:00
Vinson Lee
791d7d4bf9 mesa: Include missing headers in prog_print.h.
Include stdio.h for FILE symbol.
Include glheader.h for GL symbols.
Include mtypes.h for GLcontext symbol.
Add forward declarations.
2010-08-12 00:27:01 -07:00
Vinson Lee
991a24d033 mesa: Include missing header in prog_optimize.h.
Include mtypes.h for GLcontext symbol.
2010-08-12 00:18:33 -07:00
Dave Airlie
582129ced6 r600g: fix typo in stencil translate.
fixes piglit stencil-twoside and stencil-wrap
2010-08-12 16:32:19 +10:00
Dave Airlie
13bc2098ca r600g: fix provoking-vertex piglit test. 2010-08-12 16:29:04 +10:00
Dave Airlie
e2df0a8b23 r600g: improve texture format checker.
This takes the r300g texture format checker and fixes it up for r600g,
it passes glean texSwizzle, pixelformats, and texture_srgb tests,

however I think it L8S8_SRGB is broken as is L8_SRGB, need to investigate.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-08-12 16:20:31 +10:00
Marek Olšák
de4784e365 u_blitter: unify clear_depth_stencil and flush_depth_stencil
No need to enable depth test for clear.
2010-08-12 06:21:24 +02:00
Vinson Lee
e1bb9ee7a6 scons: Fix freebsd8 build. 2010-08-11 18:57:27 -07:00
Vinson Lee
4a859cd12f scons: Add freebsd8 to list of accepted platforms. 2010-08-11 17:58:06 -07:00
Ian Romanick
5a805079a8 glsl2: Change command line options passed to flex
Remove --never-interactive because it is already specified in the
source using %option.  Use -o instead of --outfile.  Some of the
%option commands may also need to be removed for compatibility with
older versions (e.g., 2.5.4) of flex.

This should fix bugzilla #29209.
2010-08-11 17:21:53 -07:00
Ian Romanick
a43871f763 glsl2: Commit generated files changed by previous commit 2010-08-11 17:21:53 -07:00
Ian Romanick
2fb94b37d2 glsl2: Use bison command line option to set prefix
Bison version 2.3 doesn't seem to support %name-prefix in the source.

This should fix bugzilla #29207.
2010-08-11 17:14:02 -07:00
Ian Romanick
db36e88052 glsl2: Commit generated files changed by previous commit 2010-08-11 17:03:37 -07:00
Ian Romanick
77215e7e7b glsl2: Emit error from lexer when illegal reserved word is encountered
Without this, the parser will generate obtuse, useless error
diagnostics when reservered word that are not used by the grammar are
encountered in a shader.

Fixes bugzilla #29519.
2010-08-11 17:03:31 -07:00
Ian Romanick
202604e816 glsl2: Don't declare a variable called sig that shadows the other one
Accidentally having a variable called 'sig' within an if-statement
cause the higher scope 'sig' to always be NULL.  As a result a new
function signature was created for a function definition even when one
already existed from a prototype declaration.

Fixes piglit test case glsl-function-prototype (bugzilla #29520).
2010-08-11 16:58:25 -07:00
Marek Olšák
608f168709 r300/compiler: remove an unused variable 2010-08-12 00:39:04 +02:00
Carl Worth
da6b10a7eb glcpp: Fix "unterminated if" diagnostic.
This was previously being appended to the output string *after* a copy
of the supposedly final string was made and handed to the caller. So
the diagnostic was never actually visible to the user.

We fix this by moving the check for an unterminated #if from
glcpp_parser_destroy to the calling function, preprocess.

This fixes the test case 083-unterminated-if.c.
2010-08-11 14:38:04 -07:00
Carl Worth
6b9e7b034c glccp: Regenerate glcpp-parse.c
Due to a recent change to glcpp-parse.y.
2010-08-11 14:38:04 -07:00
Carl Worth
253cad3f42 glcpp: Add an explicit diagnostic for #if with no expression.
This is more clear than the previously-generated diagnostic which was
something confusing like "enexpected newline".

This change makse test 080-if-witout-expression.c now pass.
2010-08-11 14:38:04 -07:00
Carl Worth
624dd585c7 glcpp: Reword diagnostic for #elif with no expression
Rather than telling the user what to fix, the standard convention is to
describe what the detected problem is. With this change, test
081-elif-without-expression now passes.
2010-08-11 14:38:03 -07:00
Carl Worth
cb5ea0c79b glcpp: Add several tests for diagnostics.
Which are proving to be useful since some of these tests are not yet
acting as desired, (in particular, the unterminated if test is not
generating any diagnostic).
2010-08-11 14:38:03 -07:00
Carl Worth
5a6285cc86 glcpp: Regenerate glcpp-lex.c
After a recent change to glcpp-lex.l
2010-08-11 14:38:03 -07:00
Carl Worth
bc64b89808 glcpp: Initialize line and column numbers to 1, not 0.
Error messages make more sense this way since the convention is for
the first line of a file to be numbered from 1, rather than 0.
2010-08-11 14:38:03 -07:00
Carl Worth
2bcff4c879 glcpp-test: Capture the stderr output of the preprocessor.
This allows writing tests that verify diagnostics from the preprocessor.
2010-08-11 14:38:03 -07:00
Brian Paul
dcb3a2899e configs: added -ltalloc to config files 2010-08-11 15:06:13 -06:00
Brian Paul
9b2d3c3285 osmesa: link with new libglsl.a lib 2010-08-11 15:06:13 -06:00
Brian Paul
9f9386d22a glsl2: added casts to silence warnings 2010-08-11 15:06:13 -06:00
Brian Paul
4415a84645 glsl2: remove stray semicolon 2010-08-11 15:06:13 -06:00
Brian Paul
d3b66be3c7 glsl2: added casts to silence warnings 2010-08-11 15:06:12 -06:00
Brian Paul
ffd3f15e96 glsl2: add cast to silence warning 2010-08-11 15:06:12 -06:00
Brian Paul
30d083903f glsl2: remove stray semicolon 2010-08-11 15:06:12 -06:00
Brian Paul
d1dda951c8 glsl2: move declarations before code 2010-08-11 15:06:12 -06:00
Brian Paul
6dc89d221d glsl2: remove trailing comma to silence warning 2010-08-11 15:06:12 -06:00
Luca Barbieri
39cd4f7ceb translate_test: fix segfault on x86-64 2010-08-11 22:32:20 +02:00
Luca Barbieri
41c7ff11e6 u_staging: remove useless inline keyword 2010-08-11 22:11:19 +02:00
Luca Barbieri
99cc6d70a4 translate_test: fix, reindent, and improve
1. Fix the segfault due to the reverted commit using the new interface
2. Reindent to Mesa 3 spaces style
3. Improve output and return success/failure with error code
4. Add much better support for testing translate_sse
2010-08-11 21:47:28 +02:00
Luca Barbieri
10adb7840c translate: allow clients to ask for supported output formats
Currently translate asserts on unsupported output formats, making
it impossible to use for some purposes, such as testing whether it
actually works on all formats it supports.

Removing the assert was met with opposition, so this change allows
clients to ask whether an output format is supported, and they are thus
able to avoid attempting to use it.

Since this is just an addition to the API, no adverse effect is
possible, and it makes the testsuite work again.
2010-08-11 21:47:27 +02:00
Carl Worth
8485f4d9aa glcpp: Clean up intermediate file when test suite is interrupted.
The glcpp-test script was leaving around bogus *.valgrind-errors files if
a valgrind test was interrupted.
2010-08-11 12:46:16 -07:00
Carl Worth
764e096647 glcpp: Regenerate glcpp-parse.c
After a recent change to glcpp-parse.y
2010-08-11 12:45:55 -07:00
Vinson Lee
27fe2347bc auxiliary: Make u_staging.c MSVC compatible.
Fixes MSVC build.
2010-08-11 12:45:02 -07:00
Carl Worth
48ba058e7a glcpp: Additional fixes for not evaluating skipped #if/#elif expressions.
This adds a couple of test cases to expand our coverage of invalid #if and
being skipped, (either by being nested inside an #if/#elif that evaluates to
zero or by being after an #if/#elif that evaluates to non-zero).
2010-08-11 12:43:44 -07:00
Vinson Lee
f7d7b080a1 translate: Add translate_test.c to SCons.
This is a follow-up to commit 945e38c73b,
which added translate_test.c to make.
2010-08-11 12:18:25 -07:00
Vinson Lee
04cfc6234c auxiliary: Add u_staging.c to SCons build.
This is a follow-up to commit b85c71d4e1
which added u_staging.c to make.
2010-08-11 12:04:54 -07:00
Tom Stellard
f78445de5d r300/compiler: Implement the CONT opcode. 2010-08-11 11:39:57 -07:00
Tom Stellard
953e39c61d r300/compiler: Handle loops in the register allocator. 2010-08-11 11:39:57 -07:00
Jerome Glisse
481b65abae r600g: accept empty frag prog shader
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-08-11 14:26:07 -04:00
Jerome Glisse
1bb0427a85 r600g: add src negation support
Should fix few glBitmap cases.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-08-11 13:50:19 -04:00
José Fonseca
b481a1237e gallivm: Fix and enable the extra Newton/Raphson step in lp_build_rcp().
Thanks to Michal for spotting this.
2010-08-11 18:45:26 +01:00
Jerome Glisse
457378e031 r600g: add point/sprite rendering support
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-08-11 12:20:28 -04:00
Luca Barbieri
5266bc3c60 Revert "translate_generic: return NULL instead of assert(0) if format not supported"
This reverts commit 16b45ca7ce.

José Fonseca asked for a revert.

Note that the testsuite will now segfault since it attempts to test
all possible formats.
2010-08-11 17:01:27 +02:00
Luca Barbieri
684aeb366f translate_generic: fix broken A8R8G8B8_UNORM output
translate was attempting to output A8R8G8B8_UNORM as if it were
R8G8B8A8_UNORM.

Now the tests just added pass.
2010-08-11 16:27:58 +02:00
Luca Barbieri
945e38c73b translate: add testsuite
Currently only checks all possible format conversions, and doesn't
attempt to test whether multiple buffers/elements or indices work.
2010-08-11 16:27:58 +02:00
Luca Barbieri
16b45ca7ce translate_generic: return NULL instead of assert(0) if format not supported
This gives the caller a chance to recover (or crash anyway otherwise).
2010-08-11 16:27:57 +02:00
Luca Barbieri
deb809ec98 auxiliary: fix util_framebuffer_copy
util_framebuffer_copy was attempting to copy all elements of the
source framebuffer state.

However, this breaks if the user does not zero initialize the structure.
Instead, only copy the elements up to nr_cbufs, and clear elements up
to dst->nr_cbufs, if the destination was larger than the source.
2010-08-11 16:27:57 +02:00
José Fonseca
10ce6779e8 gallivm: Use lp_build_div instead of lp_build_mul + lp_build_rcp.
Single divide, so let lp_build_div decide how to implement this.

This will save a multiplication in architectures which don't have
a RCP intrinsic.
2010-08-11 15:14:10 +01:00
José Fonseca
f8533482f4 gallivm: Use unsigned shift in lp_build_minify.
Texture dimensions are unsigned.
2010-08-11 15:14:10 +01:00
José Fonseca
66f57235d5 llvmpipe: Debug code to dump interpolation coefficients. 2010-08-11 15:14:10 +01:00
José Fonseca
3deca2e284 llvmpipe: Use single precision divide for one over area computation. 2010-08-11 15:14:10 +01:00
Marek Olšák
4b20ad7559 util: copy the u_staging commit message to the code 2010-08-11 15:11:42 +02:00
Luca Barbieri
b85c71d4e1 auxiliary: support for transfers using staging resources
Direct3D 10/11 has no concept of transfers. Applications instead
create resources with a STAGING or DYNAMIC usage, copy between them
and the real resource and use Map to map the STAGING/DYNAMIC resource.

This util module allows to implement Gallium drivers as a Direct3D
driver would be implemented: transfers allocate a resource with
PIPE_USAGE_STAGING, and copy the data between it and the real resource
with resource_copy_region.
2010-08-11 13:03:00 +02:00
Luca Barbieri
6f3c4819ec gallium: add ALWAYS_INLINE
Used when we want to be sure the compiler inlines a large function into
an inner loop.
2010-08-11 11:27:46 +02:00
Luca Barbieri
5668526c91 u_surfaces: add util_surfaces_peek
Used to find out if a surface exists without creating one.
2010-08-11 11:20:16 +02:00
Luca Barbieri
e45b2ce2c3 u_surfaces: use cso_hash instead of util_hash_table
Using cso_hash directly is the right thing since util_hash_table
adds useless overhead and is harder to use for this application.
2010-08-11 11:19:23 +02:00
Luca Barbieri
24f5ebb1d7 u_surfaces: fix surface leak due to off by one 2010-08-11 11:17:35 +02:00
Luca Barbieri
58b104d7f0 auxiliary: make primitive splitter assert on unimplemented adjacency prims
They are unimplemented, even though the framework makes it possible to
implement them well, and nv50 needs them.
2010-08-11 11:08:51 +02:00
Luca Barbieri
eee5cea385 auxiliary: fix u_split_prim naming convention
Current practice is to start identifiers with "util_" instead of "u_".
2010-08-11 11:08:51 +02:00
Luca Barbieri
0dcf0f9dfa auxiliary: move Ben Skeggs' primitive splitter to common code
This is a simple framework that handles splitting primitives in an
abstract way.

The user has to specify the primitive start, start index and count.

Then, it can ask the primitive splitter to "draw" a chunk of the
primitive, staying under a given vertex/index budget.

The primitive splitter will then call user-supplied functions to
emit a range of vertices/indices, as well as switch the edgeflag
on or off.

This is particularly useful for hardware that either has limits
on the vertex count field, or where vertices are pushed on a FIFO
or temporary buffer of limited size.

Note that unlike other splitters, it does not manipulate data in
any way, and merely asks a callback to do so, in vertex intervals.
2010-08-11 11:08:46 +02:00
Vinson Lee
0578acbe18 mesa: Include missing header in prog_noise.h.
Include glheader.h for GLfloat symbol.
2010-08-11 01:10:54 -07:00
Vinson Lee
f36a4b3c9e mesa: Clean up header file inclusion in prog_instruction.h.
Remove mfeatures.h.
Include glheader.h for GL symbols.
2010-08-11 01:06:58 -07:00
Vinson Lee
c20e92c3e0 mesa: Include missing header in prog_execute.h.
Include mtypes.h for GLcontext symbol.
2010-08-11 00:43:28 -07:00
Vinson Lee
2a5bf7b4d2 mesa: Include missing header in prog_cache.h.
Include mtypes.h for GLcontext symbol.
2010-08-11 00:35:34 -07:00
Vinson Lee
1c5a077e1b mesa: Include missing header in nvvertparse.h.
Include mtypes.h for GLcontext symbol.
2010-08-11 00:33:02 -07:00
Vinson Lee
13887f389f mesa: Include missing header in nvfragparse.h.
Include mtypes.h for GLcontext symbol.
2010-08-11 00:29:26 -07:00
Vinson Lee
48f8495040 mesa: Remove unnecessary header from hash_table.h. 2010-08-11 00:26:05 -07:00
M.Froehlich@science-computing.de
c8e714df01 swrast: fix span color array pointer assignment for 32-bit/channel rendering
See fd.o bug 29487.

NOTE: This is a candidate for the 7.8 branch.

Signed-off-by: Brian Paul <brianp@vmware.com>
2010-08-10 21:21:26 -06:00
Marek Olšák
ca5227ce8b r300g: initialize VAP_VTX_STATE_CNTL
This got lost during the rasterizer rewrite.
2010-08-11 04:48:56 +02:00
Marek Olšák
683ef52e19 r300g: implement gl_FrontFacing 2010-08-11 04:48:56 +02:00
Kenneth Graunke
298a6fcdde glcpp/tests: Commit forgotten file 074-elif-undef.c.expected. 2010-08-10 19:18:44 -07:00
Kenneth Graunke
64b408529a texture_builtins.py: Remove useless comments. 2010-08-10 19:18:44 -07:00
Carl Worth
9b7fd2099f glcpp: Discard output of cmp when running the test suite.
We're already using the return-value of cmp to print either PASS or
FAIL and in the case of failure, we're subsequently running and
showing the output of diff. So any warnings/errors from cmp itself are
not actually needed, and can be quite confusing.
2010-08-10 18:27:31 -07:00
Carl Worth
4f9a64407c glcpp: Fix expected result for the 064-version.c test.
Commit d4a04f3155 caused this test case
to produce an additional blank line, which is otherwise harmless, but
does need to be reflected in the .expected file for the test to pass.
2010-08-10 18:25:30 -07:00
Vinson Lee
cc732bf894 swrast: Remove unnecessary header. 2010-08-10 18:05:52 -07:00
Vinson Lee
61205f6189 svga: Remove unnecessary headers. 2010-08-10 17:53:08 -07:00
Vinson Lee
34cdad62dd r300g: Remove unnecessary header. 2010-08-10 17:39:13 -07:00
Carl Worth
e29cd39125 glcpp: Regnerate glcpp-parse.c and glcpp-parse.h
After making a minor change to the .y file.
2010-08-10 16:59:20 -07:00
Carl Worth
485f84d366 glcpp: Initialize location structure at beginning of parse.
Since we have a custom structure for YYLTYPE locations, we need to use
an %initial-action directive to avoid triggering use of uninitialized
memory when, for example, printing error messages.

We apparently don't yet have a test case that allowed valgrind to find
this bug for us, but valgrind found a similar problem in the other
parser, so we fix this one as well.
2010-08-10 16:58:28 -07:00
Carl Worth
a7d6c496cf glsl2: Regenerate glsl_parser.cpp and glsl_parser.h
After making a minor change to the .y file.
2010-08-10 16:54:23 -07:00
Carl Worth
60d8c46995 glsl2: Initialize location structure at beginning of parse.
Since we have a custom structure for YYLTYPE locations, we need to use
an %initial-action directive to avoid triggering use of uninitialized
memory when, for example, printing error messages.

Thanks to valgrind for noticing this bug.
2010-08-10 16:52:54 -07:00
Nigel Stewart
6768afbe9f glut: also check for GLX_ARB_multisample
Signed-off-by: Brian Paul <brianp@vmware.com>
2010-08-10 17:28:33 -06:00
Brian Paul
bbfdcc16df mesa: use switch stmt in init_program_limits() 2010-08-10 17:27:56 -06:00
Brian Paul
f6ca938bcb mesa: remove obsolete comments 2010-08-10 17:27:55 -06:00
Tom Stellard
8dd4308b5e r300/compiler: Use predicate bit for IF statements in r500 vertex shaders 2010-08-10 13:17:25 -07:00
Tom Stellard
c298bab60e r300/compiler: Implement hardware assisted loops for vertex shaders.
Single loops work, but nested loops do not.
2010-08-10 13:17:25 -07:00
Tom Stellard
5c7b7da798 r300/compiler: Correctly transform nested loops. 2010-08-10 13:17:25 -07:00
Jerome Glisse
72f8edfc0b r600g: avoid reemiting literal, avoid scheduling empty cs
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-08-10 11:53:05 -04:00
José Fonseca
247b253d32 util: Add util_format_srgb().
To convert RGB -> SRGB format.
2010-08-10 16:37:19 +01:00
Christoph Bumiller
3a68fcfb6b nv50: begin implementing loops 2010-08-10 17:36:25 +02:00
Christoph Bumiller
fc1d72d15d nv50: fix reg count 2010-08-10 17:35:26 +02:00
Brian Paul
f263fdee81 gallivm: fix non-SSE4.1 case in lp_build_pack2()
Since there's no SSE instruction for this case, fall through to the
generic shuffle code.

Fixes bug fd.o 29468.
2010-08-10 08:56:57 -06:00
Brian Paul
4567b47953 mesa: additional program limit assertions 2010-08-10 08:38:19 -06:00
Brian Paul
b80a830cd8 mesa: fix comment typo 2010-08-10 08:38:19 -06:00
nobled
20b3e40f16 gallivm: Fix bitwise operations for floats, division for integers
http://bugs.freedesktop.org/29407

Signed-off-by: José Fonseca <jfonseca@vmware.com>
2010-08-10 10:24:26 +01:00
nobled
a44a6960fa gallivm: Even more type checking
http://bugs.freedesktop.org/29407

Signed-off-by: José Fonseca <jfonseca@vmware.com>
2010-08-10 10:24:26 +01:00
nobled
e9f3994b16 llvmpipe: Always use floating-point operators for floating-point types
See:
http://bugs.freedesktop.org/29404
http://bugs.freedesktop.org/29407

Signed-off-by: José Fonseca <jfonseca@vmware.com>
2010-08-10 10:24:26 +01:00
Eric Anholt
0ff3b2b344 glsl2: Make ir_algebraic reassociate add/mul operands for constant folding.
It's rather easy to produce two constant multiplies separated by other
multiplies while writing a BRDF shader, and non-obvious enough in the
resulting codegen that I didn't catch it in my demo code until just
recently.  Cuts 3 965 instructions from my demo (<1%), and 20 from
glsl-fs-raytrace (1.3%).
2010-08-09 21:42:17 -07:00
Eric Anholt
5854d4583c glsl2: Add a pass to transform ir_binop_sub to add(op0, neg(op1))
All the current HW backends transform subtract to adding the negation,
so I haven't bothered peepholing it back out in Mesa IR.  This allows
some subtract of subtract to get removed in ir_algebraic.
2010-08-09 21:41:14 -07:00
Eric Anholt
8bebbeb7c5 glsl2: Add constant propagation.
Whereas constant folding evaluates constant expressions at rvalue
nodes, constant propagation tracks constant components of vectors
across execution to replace (possibly swizzled) variable dereferences
with constant values, triggering possible constant folding or reduced
variable liveness.
2010-08-09 19:21:18 -07:00
Eric Anholt
81996ae861 i965: More s/stderr/stdout/ for program debug. 2010-08-09 18:24:23 -07:00
Eric Anholt
2dd3ae0d4a glsl2: Teach copy propagation about "if" and "loop" instructions.
This lets us track copies across basic block boundaries.  The loop
doesn't get a filled out list of available copies into it yet, though.

glsl-fs-raytrace drops from 585 to 535 Mesa IR instructions out of the
compiler, and it appears that Yo Frankie's largest shaders decrease in
Mesa IR count by about 10% as well.
2010-08-09 17:14:31 -07:00
Kenneth Graunke
8aa7dbacaf glsl2: Refresh autogenerated file builtin_function.cpp. 2010-08-09 12:45:25 -07:00
Kenneth Graunke
2eed82ebc0 texture_builtins.py: Fix cut and paste errors in function names.
Some signatures were being generated with the wrong function name.
2010-08-09 12:41:39 -07:00
Henri Verbeet
e165453f84 radeon: Use MESA_FORMAT_SARGB8 for sRGB formats
This can be supported on r600 without using the endian swapper, and is a
better fit for (typical) uploads using GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV
anyway.
2010-08-09 15:06:02 -04:00
Henri Verbeet
08933b5a17 r600c: Disable alpha test during blits 2010-08-09 15:03:27 -04:00
Kenneth Graunke
dbff7b541e glsl2: Use gl_DepthRange's proper name.
It was being incorrectly added as gl_DepthRangeParameters, which is the
type name, not the variable name.
2010-08-09 11:42:37 -07:00
Ian Romanick
c88e60a27b ir_algebraic: Support other comparisons in ir_unop_logic_not 2010-08-09 10:46:38 -07:00
Ian Romanick
fe277089c7 ir_algebraic: Convert ir_unop_logic_not handler to use a switch statement
Currently only ir_binop_equal and ir_binop_nequal are supported, but
soon all of the relational operators will be added.  Making this
change now will simplify those commits.
2010-08-09 10:19:39 -07:00
José Fonseca
6e1f9bc8f6 gallivm: More type checks. 2010-08-09 17:31:18 +01:00
José Fonseca
8a3a971743 gallivm: Don't call LLVMBuildFNeg on llvm-2.6.
It didn't exist yet.
2010-08-09 17:31:18 +01:00
nobled
fc9a49b638 gallivm: Always use floating-point operators for floating-point types
This fixes the assert added in LLVM 2.8:
assert(getType()->isIntOrIntVectorTy() &&
       "Tried to create an integer operation on a non-integer type!")

But it also fixes some subtle bugs, since we should've been doing this
since LLVM 2.6 anyway.

Includes a modified patch from steckdenis@yahoo.fr for the
FNeg instructions in emit_fetch(); thanks for pointing those out.

http://bugs.freedesktop.org/29404
http://bugs.freedesktop.org/29407

Signed-off-by: José Fonseca <jfonseca@vmware.com>
2010-08-09 17:31:18 +01:00
José Fonseca
65b9747a54 util: Move _mm_shuffle_epi8() to u_sse.h.
It's bound to be useful elsewhere.
2010-08-09 17:31:18 +01:00
Aras Pranckevicius
3adce986c4 glsl2: do not use __retval name; two underscores is reserved word according to GLSL spec (and Win7 ATI drivers do complain about that) 2010-08-09 09:08:03 -07:00
Aras Pranckevicius
5023edaf5d glsl: fix missing return in ir_structure_splitting 2010-08-09 09:04:32 -07:00
Jerome Glisse
95fb0bf58d r600g: fix r600 context structure, avoid segfault when no scissor
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-08-09 11:33:25 -04:00
Marek Olšák
29b7d26401 r300g: do not print shader compiler errors by default 2010-08-09 17:18:45 +02:00
Marek Olšák
2cad5350f9 r600g: fix some warnings 2010-08-09 15:00:19 +02:00
Marek Olšák
00963589b4 r600g: fill out some missing caps and sort them
The shader caps need additional corrections.

(based on a patch from netkas at Phoronix)
2010-08-09 14:59:54 +02:00
Andre Maasikas
67ee40684d radeon: fix npot mipmap alignment on r600
seems it got lost in commit 0d383547
have no earlier radeons to test, but npot mipmaps were not supported there?
2010-08-09 14:37:01 +03:00
Andre Maasikas
8d0985b9b8 r600: bump glsl version
from the tests i couldn't find any new driver faults
2010-08-09 14:28:00 +03:00
Dave Airlie
771ad67414 r300g: fix hiz/zmask offset emissions.
ofs is in dwords, so need to shift it for registers.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-08-09 19:56:45 +10:00
Eric Anholt
f8d2cfe4a6 glsl2: Handle plain variable copies in struct splitting.
glsl-fs-raytrace goes from 620 Mesa IR instructions out of the
compiler to 585.
2010-08-08 23:45:58 -07:00
Luca Barbieri
3bb0719fe1 nouveau: fix maps with PIPE_TRANSFER_UNSYNCHRONIZED | PIPE_TRANSFER_DONTBLOCK
In this case, we were incorrectly prioritizing PIPE_TRANSFER_DONTBLOCK over
PIPE_TRANSFER_UNSYNCHRONIZED.

This can lead to failure in the Mesa VBO draw paths that end up specifying
both, but don't expect map to fail (in particular, the problem manifested as
a leak of buffer objects in teapot with other changes).
2010-08-09 05:02:12 +02:00
Marek Olšák
aef0fbd5b6 r300g: remove a flush
Ooops, it wasn't supposed to be there.
2010-08-08 23:20:43 +02:00
José Fonseca
12f5c0f9ce gallivm: Fix more integer operations. 2010-08-08 22:18:53 +01:00
nobled
cd5af8c703 gallivm: Use the correct context for integers
See:
http://bugs.freedesktop.org/29407
2010-08-08 22:08:52 +01:00
Marek Olšák
4f5e51068b r300g: flush zmasks of zbuffers we are going to use as samplers
It sometimes works, sometimes not. I guess we have the zmask offsets wrong.
2010-08-08 22:53:31 +02:00
Marek Olšák
363b74f132 r300g: do not allocate a zmask block for 3D textures and cubemaps 2010-08-08 22:29:00 +02:00
Marek Olšák
757c78afe7 r300g: generalize the way we ask for hyperz
This makes it compatible with the modified DRM interface in drm-radeon-testing.

Also, now you need to set RADEON_HYPERZ=1 to be able to use hyperz.
It's not bug-free yet.
2010-08-08 22:28:35 +02:00
José Fonseca
d827972816 gallivm: Add type checks for the basic operations. 2010-08-08 21:02:59 +01:00
José Fonseca
b9a21fd6ca draw: Remove unused variable. 2010-08-08 13:58:23 +01:00
nobled
445e59057f draw: Use the correct type for integers
Two integers were being operated on as
a vector of floats in draw_llvm_generate().

This bug got uncovered by fixing this bug:
http://bugs.freedesktop.org/29407
2010-08-08 12:19:07 +01:00
Dave Airlie
b55f627937 r300g: take hiz/zmask offsets into a/c when clearing.
Need to add a test for multi-hiz/zmask db in a single context.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-08-08 19:12:14 +10:00
Vinson Lee
ef3b17f5f3 i810: Add missing header m_xform.h.
This is another follow-up to commit
f4511c4835.
2010-08-07 23:38:20 -07:00
Vinson Lee
facf368df2 dri: Add missing header m_xform.h.
This is a follow-up patch to commit
f4511c4835.

Files that include tnl_dd/t_dd_dmatmp.h now need to also include
m_xform.h as t_context.h no longer includes it.
2010-08-07 23:19:27 -07:00
Vinson Lee
f4511c4835 tnl: Reduce header file inclusion in t_context.h.
t_context.h
Remove m_matrix.h and m_xform.h.

t_vb_program.c
Include m_xform.h.

t_vb_render.c
Include m_xform.h.
2010-08-07 22:56:35 -07:00
Vinson Lee
2154dfa701 swrast: Reduce header file inclusion in s_zoom.h.
Include mtypes.h for GLcontext symbol.
Include s_span.h for SWspan symbol.
2010-08-07 22:13:19 -07:00
Vinson Lee
a2a40cefe2 swrast: Fix header file inclusion in s_texfilter.h.
Include mtypes.h for GLcontext symbol.
Include s_context.h for texture_sample_func symbol.
2010-08-07 22:05:28 -07:00
Vinson Lee
c20e977467 swrast: Reduce header file inclusion in s_texcombine.h.
Include mtypes.h for GLcontext sybmol.
Include s_span.h for SWspan symbol.
2010-08-07 22:01:27 -07:00
Vinson Lee
e616d05b22 swrast: Reduce header file inclusion in s_stencil.h.
Include mtypes.h for GLcontext symbol.
Include s_span.h for SWspan symbol.
2010-08-07 21:44:53 -07:00
Vinson Lee
01739cdda2 swrast: Reduce header file inclusion in s_masking.h.
Include mtypes.h for GLcontext symbol.
Include s_span.h for SWspan symbol.
2010-08-07 21:24:16 -07:00
Vinson Lee
562c727414 swrast: Reduce header file inclusion in s_logic.h.
Include mtypes.h for GLcontext symbol.
Include s_span.h for SWspan symbol.
2010-08-07 21:07:11 -07:00
Vinson Lee
f009f177fd swrast: Reduce header file inclusion in s_fragprog.h.
s_fragprog.h
Include mtype.h for GLcontext symbol.
Include s_span.h for SWspan symbol.

s_fragprog.c
Include s_context.h now that it is removed from s_fragprog.h.
2010-08-07 21:01:12 -07:00
Vinson Lee
7b56285487 swrast: Reduce header file inclusion in s_fog.h.
Include mtypes.h for GLcontext symbol.
Include s_span.h for SWspan symbol.
2010-08-07 13:57:50 -07:00
Vinson Lee
5db13da866 swrast: Clean up header file inclusion in s_depth.h.
Include mtypes.h for GLcontext symbol.
Include s_span.h for SWspan symbol.
2010-08-07 13:04:50 -07:00
Vinson Lee
690ead0f22 swrast: Include missing header in s_context.h.
Include compiler.h for _ASMAPIP symbol.
2010-08-07 12:44:58 -07:00
Vinson Lee
d6273bb39b swrast: Clean up header file inclusion in s_blend.h.
Include mtypes.h for GLcontext symbol.
Include s_span.h for SWspan symbol.
2010-08-07 12:36:50 -07:00
Vinson Lee
12e8e5ee95 swrast: Clean up header file inclusion in s_atifragshader.h.
s_atifragshader.h
Include mtypes.h for GLcontext symbol.
Include s_span.h for SWspan symbol.

s_atifragshader.c
Include s_context.h for SWcontext symbol.
2010-08-07 12:25:20 -07:00
Vinson Lee
1bc1c669b2 swrast: Clean up header file inclusion in s_alpha.h.
Include mtypes.h for GLcontext symbol.
Include s_span.h for SWspan symbol.
2010-08-07 12:19:29 -07:00
Marek Olšák
1e46de3a83 r300c: do not advertise half float vertex on RV3xx, RS4xx, RC4xx
Fixes a hardlock.

NOTE: this is a candidate for the 7.8 branch, provided the half float vertex
is really implemented there.
2010-08-07 18:13:05 +02:00
Kenneth Graunke
b7e63c34e7 glsl2: Add the 1.30 reserved keywords. 2010-08-07 00:51:30 -07:00
Vinson Lee
d64a119c28 st/mesa: Remove unnecessary header. 2010-08-06 18:45:15 -07:00
Marek Olšák
ab0a3f30b8 r300g: fix cbzb clears when hyperz is off 2010-08-07 02:00:21 +02:00
Maarten Maathuis
a838cee6bc nouveau: fix potential NULL-ptr dereference in nouveau_stateobj.h
- This can only be triggered when DEBUG_NOUVEAU_STATEOBJ is active.
- Also remove a redundant pointer assignment.

Reported-by: Roy Spliet <r.spliet@student.tudelft.nl>
Signed-off-by: Maarten Maathuis <madman2003@gmail.com>
2010-08-06 23:56:31 +02:00
Jerome Glisse
d9f72b9f90 r600g: add PA_CL_CLIP_CNTL definition
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-08-06 17:27:36 -04:00
Jerome Glisse
32251c34f0 r600g: fix rendering, only enable target we write too
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-08-06 17:23:43 -04:00
Aras Pranckevicius
58f1ffdd7c ir_function_inlining: Fix missing iter.next() in inlining sampler params.
Fixes glsl-fs-function-samplers.
2010-08-06 14:17:40 -07:00
Jerome Glisse
b474478f20 r600g: really fix multi target support
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-08-06 17:13:28 -04:00
Aras Pranckevicius
63cddb27d7 copy_propagation: do propagation into non-out call params 2010-08-06 14:13:15 -07:00
Brian Paul
6b97fe52c9 st/mesa: remove stray semicolons 2010-08-06 15:09:51 -06:00
Brian Paul
14e9fbee1c gallium: remove stray semicolons 2010-08-06 15:09:41 -06:00
Eric Anholt
925b49ff31 glsl2: Move gl_program->InputsRead/OutputsWritten setting to an ir pass.
This lets us handle arrays much better than trying to work backwards
from assembly.

Fixes fbo-drawbuffers-maxtargets on swrast (i965 needs loop unrolling)
2010-08-06 13:22:31 -07:00
Jerome Glisse
c3ad060488 r600g: finish multi target rendering support
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-08-06 16:12:22 -04:00
Vinson Lee
69d450856a targets/egl: Fix build by including missing headers. 2010-08-06 11:46:16 -07:00
Chia-I Wu
e34c52da87 draw: Add an assertion to varray's version of trim().
Assert that "first" is always smaller than "count" and add reasoning.
It would be better to simply fix trim(), but it is used in tight loops
right now.
2010-08-07 02:20:06 +08:00
Chia-I Wu
600cd858d4 draw: Fix draw_pt_split_prim for primitives with adjacency.
Some primitives with adjacency have their "incr" wrong.
2010-08-07 02:16:50 +08:00
Chia-I Wu
6ae39f6dca draw: Assert that only the first vetex may have flags set.
642d5ba79a removed flags masking for
vertices other than the first one.  Add assertions to be on the safe
side.
2010-08-07 02:14:50 +08:00
Jerome Glisse
27041d7cb3 r600g: fix color format, indentation, defines
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-08-06 11:28:33 -04:00
Jerome Glisse
6e6103004c Revert "r600g: don't use dynamic state allocation for states"
This reverts commit 9c949d4a4d.

Conflicts:

	src/gallium/drivers/r600/r600_context.h
	src/gallium/drivers/r600/r600_draw.c
	src/gallium/drivers/r600/r600_shader.c
	src/gallium/drivers/r600/r600_state.c
2010-08-06 10:59:27 -04:00
Chia-I Wu
d38afcd2f2 draw: Avoid mixed declarations and code.
Do not expand LOCAL_VARS to void expression.  Otherwise, declarations
and code will be mixed when more variables are declared in FUNC_ENTER.

This fixes fdo bug #29416.
2010-08-06 17:14:21 +08:00
Vinson Lee
bec87456ed swrast: Reduce header file inclusion in s_aatriangle.h.
Include mtypes.h for GLcontext symbol.
2010-08-06 01:04:49 -07:00
Vinson Lee
a3439df79f swrast: Reduce header file inclusion in s_aaline.h.
Include mtypes.h for GLcontext symbol.
2010-08-06 00:57:52 -07:00
Eric Anholt
c234d0b25f ir_to_mesa: Add support for sampler arrays.
Support for samplers in general is still incomplete -- anything in a
uniform struct will still be broken.  But that doesn't appear to be
any different from master.

Fixes:
glsl-fs-uniform-sampler-array.shader_test
2010-08-06 00:51:42 -07:00
Eric Anholt
199c441239 glsl2: Fix inlining with sampler array or struct dereferences as arguments.
Previously, we'd replace an argument of mysampler[2] with a plain
reference to mysampler by using the cloning hash table.  Instead, use
a visitor to clone whatever complicated sampler dereference into the
sampler parameter derefs in the inlined function body.
2010-08-06 00:51:08 -07:00
Eric Anholt
8d61a23b1a glsl2: Don't assert in a couple of places when encountering sampler arrays.
Fixes glean shaderAPI.
2010-08-06 00:42:59 -07:00
Eric Anholt
658e25987f ir_to_mesa: Give the expected size for _mesa_add_attribute().
Fixes a failure in glean shaderAPI.
2010-08-06 00:23:48 -07:00
Vinson Lee
a6859f5ccc r300g: Remove unnecessary headers. 2010-08-05 23:58:00 -07:00
Dave Airlie
5f6ab5e259 r600g: start to fix up multiple targets.
fixup exports from pixel shader for multi-cbs + depth buffer writing.

Still crashes GPU running any of the multi-buffer or depth writing
2010-08-06 16:05:24 +10:00
Chia-I Wu
642d5ba79a draw: Remove unnecessary vertex flag ANDs.
Vertex flags are a contract between vcache and the pipeline.  They are
set only for the first vertex of a primitive.
2010-08-06 13:39:37 +08:00
Chia-I Wu
f1fc444bb0 draw: Mask out vertex flags in GS and stream output.
This fixes out-of-bound access to the vertices.
2010-08-06 13:39:37 +08:00
Chia-I Wu
eb3c6ddafb draw: Include draw_decompose_tmp.h in draw_pt_decompose.h.
Use draw_decompose_tmp.h to replace pipeline primitive decomposer.
2010-08-06 13:39:36 +08:00
Chia-I Wu
94d256591d draw: Include draw_decompose_tmp.h in draw_so_emit_tmp.h.
Use draw_decompose_tmp.h to replace stream out primitive decomposer.
2010-08-06 13:39:36 +08:00
Chia-I Wu
23176779f8 draw: Include draw_decompose_tmp.h in draw_gs_tmp.h.
Use draw_decompose_tmp.h to replace GS primitive decomposer.
2010-08-06 13:39:36 +08:00
Chia-I Wu
8a41b18b7d draw: Include draw_decompose_tmp.h in draw_pt_vcache_tmp.h.
Use draw_decompose_tmp.h to replace vcache primitive decomposer.  As the
new decomposer supports primitives with adjacency, vcache_triangle_adj
and vcache_line_adj (and their variants that have flags) are added.
2010-08-06 13:39:36 +08:00
Chia-I Wu
524b2626c2 draw: Add draw_decompose_tmp.h.
Including draw_decompose_tmp.h defines a primitive decomposer.  It is
intended to replace the existing vcache/so/gs/pipe decomposers.

This is based on draw_pt_vcache_tmp.h.
2010-08-06 13:39:36 +08:00
Dave Airlie
0a2a6c75bf r600g: add SRGB support.
This enables GL2.1 and passes glean's texture_srgb test.
2010-08-06 15:21:44 +10:00
Dave Airlie
fc47cb9d71 r600g: fixup z format translations.
this enables GL_EXT_packed_depth_stencil. fbo-d24s8 passes
2010-08-06 15:06:25 +10:00
Dave Airlie
b8de7788a4 r600g: fix targetmask to work correctly.
At least this seems to fix the glean maskedClear test.
2010-08-06 14:54:24 +10:00
Dave Airlie
2b90364765 r600g: improve supported format selection.
This fixes fbo-readpixels piglit test, and adds support for swapping
the formats. Not all formats are correct yet I don't think.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-08-06 14:53:38 +10:00
Dave Airlie
121a625c16 r600g: add bo wait after map. 2010-08-06 11:46:52 +10:00
Vinson Lee
f717fd25cc st/mesa: Clean up header file inclusion in st_program.h.
st_program.h
Remove p_shader_tokens.h
Include st_context.h for st_context symbol.
Include p_state.h for PIPE_MAX_SHADER_INPUTS symbol.
Remove unnecessary forward declarations.

st_cb_bitmap.c
st_cb_clear.c
Include p_shader_tokens.h now that st_program.h doesn't include it.
2010-08-05 18:21:09 -07:00
Marek Olšák
4d10ec4f18 r300g: do not emit GB_Z_PEQ_CONFIG on non-r500 if DRM < 2.6.0 2010-08-06 03:14:43 +02:00
Ian Romanick
0a86d766ef ir_to_mesa: Handle texture-array samplers
Fixes piglit test array_texture.
2010-08-05 17:57:48 -07:00
Jakob Bornecrantz
1a3a04d56b tgsi: Fix typo, so we follow what is in the comments 2010-08-05 17:53:48 -07:00
Ian Romanick
4f397e1d64 glsl2: Enable all supported extensions in stand-alone compiler 2010-08-05 17:50:13 -07:00
Jakob Bornecrantz
9f5c1194ff tgsi: Add option to stop the sanity checker from printing 2010-08-05 17:44:05 -07:00
Ian Romanick
0a09d679ca glsl_type: Don't have two versions of a type with the same name
Previously some sampler types were duplicated in GLSL 1.30 and
GL_EXT_texture_array.  This resulted in not being able to find the
built-in sampler functions when the extension was used.  When the
built-in functions were compiled, they bound to the 1.30 version.
This caused a type mismatch when trying to find the function.  It also
resulted in a confusing error message:

0:0(0): error: no matching function for call to `texture2DArray(sampler2DArray, vec3)'
0:0(0): error: candidates are: vec4 texture2DArray(sampler2DArray, vec3)

0:0(0): error:                 vec4 texture2DArray(sampler2DArray, vec3, float)
2010-08-05 17:29:15 -07:00
Jakob Bornecrantz
4d65055b1f util: Add option to not dump cpu caps 2010-08-05 17:25:13 -07:00
Jakob Bornecrantz
981c6bc6a5 st/mesa: Only get debug option once 2010-08-05 17:25:13 -07:00
Jakob Bornecrantz
99611f0849 st/mesa: Only get mesa mvp dp4 option once
The correct for this is of course to do what comment says
2010-08-05 17:25:13 -07:00
Jakob Bornecrantz
e00b17830b llvmpipe: Only get no rast option once 2010-08-05 17:25:13 -07:00
Jakob Bornecrantz
4bd061b127 gallivm: Only get debug option once 2010-08-05 17:25:13 -07:00
Ian Romanick
1e0f0459e0 glsl2: Log a better error message when a matching function cannot be found 2010-08-05 17:21:39 -07:00
Vinson Lee
1b8aa2176c st/mesa: Clean up header file inclusion in st_mesa_to_tgsi.h.
st_mesa_to_tgsi.h
Replace tgsi_ureg.h with a forward declaration.
Include p_compiler.h for ubyte symbol.

st_program.c
Include tgsi_ureg.h directly.
2010-08-05 17:15:25 -07:00
Luca Barbieri
bf5ee5aa4f nvfx: fix nv30 vertex program scalar opcodes
Apparently they have always been broken, even before unification.

Fixes a lot of stuff, starting from morph3d and lighting in teapot
with textures disabled.
2010-08-06 01:28:14 +02:00
Luca Barbieri
3e231361f3 nvfx: shut up unknown cap 64 warning 2010-08-06 01:28:14 +02:00
Vinson Lee
0a7cbe845f st/mesa: Clean up header file inclusion in st_manager.h.
Include mtypes.h for GLcontext, gl_buffer_index, and GLframebuffer
symbols.
Include p_compiler.h for boolean symbol.
Include st_context.h in st_cb_eglimage.c as it previously included
st_context.h indirectly through st_manager.h.
2010-08-05 16:20:07 -07:00
Brian Paul
3d038a3ed2 glsl: fix atan(0, -1)
Fixes fd.o bug 29388

NOTE: this is a candidate for the 7.8 branch.
2010-08-05 16:39:09 -06:00
Eric Anholt
bc4034b243 glsl2: Add a pass to convert exp and log to exp2 and log2.
Fixes ir_to_mesa handling of unop_log, which used the weird ARB_vp LOG
opcode that doesn't do what we want.  This also lets the multiplication
coefficients in there get constant-folded, possibly.

Fixes:
glsl-fs-log
2010-08-05 15:34:00 -07:00
Alex Deucher
918ef7ff18 r600c: tiling require drm 2.6.0, not 2.5.0 2010-08-05 17:42:29 -04:00
Eric Anholt
8048226b7b glsl2: Insert global declarations at the top of the instruction stream.
Fixes use-before-decl in glslparsertest shaders.

Fixes:
CorrectFull.frag
CorrectModule.frag
2010-08-05 14:41:09 -07:00
Alex Deucher
e93d413a0d r600: add support for getting the tiling config via drm ioctl (v2)
Needed for the the 2D tiling span functions.

v2: rebase on new kernel, mesa changes

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2010-08-05 17:13:10 -04:00
Alex Deucher
3095bc679d r600: add new relocs for tiling support
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2010-08-05 17:12:52 -04:00
Alex Deucher
063c70d7f7 r600: add span support for 2D tiling
Requires tiling config ioctl support from the drm to use.
kms only.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2010-08-05 17:12:37 -04:00
Eric Anholt
0a0ab121f8 ir_structure_splitting: Massive fixing to this.
I'd missed putting in the actual "find structures to split" part, so
most of the code didn't do anything.  I was running on too large of an
app and assuming the lack of progress was elsewhere.
2010-08-05 13:40:09 -07:00
Eric Anholt
748f81a8ea glsl2: Make the HV actually call ir_texture's visit_leave. 2010-08-05 13:34:02 -07:00
Eric Anholt
7f7eaf0285 ir_structure_splitting: New pass to chop structures into their components.
This doesn't do anything if your structure goes through an uninlined
function call or if whole-structure assignment occurs.  As such, the
impact is limited, at least until we do some global copy propagation
to reduce whole-structure assignment.
2010-08-05 12:56:03 -07:00
Eric Anholt
c314c8f231 glsl2: Fix the dereferences_variable check in ir_tree_grafting.
The HV doesn't descend into ir_variable, which is generally a good
thing (allowing one to distinguish between variable declarations and
refs), but here we never saw tree grafting opportunities killed
because we were looking for the ir_variable child of a dereference to
get visited.

Fixes:
glsl1-function call with inout params
2010-08-05 12:56:03 -07:00
Eric Anholt
b259eb2804 glsl2: Don't tree-grafting out assignment to an out variable.
Fixes:
glsl-deadcode-varying.
2010-08-05 12:56:03 -07:00
Eric Anholt
9f82806c7b glsl2: Don't dead-code eliminate a call where the return value is unused.
This showed up since the disabling of inlining at compile time, which
I apparently didn't regenerate piglit summary for.

Fixes:
glsl-deadcode-call.
2010-08-05 12:56:03 -07:00
Eric Anholt
3bd7e70bf7 glsl2: Add some easy-to-enable debug printfs to ir_dead_code.cpp. 2010-08-05 12:56:02 -07:00
Jerome Glisse
9c949d4a4d r600g: don't use dynamic state allocation for states
Simplify state handly by avoiding state allocation.
Next step is to allocate once for all context packet
buffer and then avoid rebuilding pm4 packet each time
(through use of combined crc) this would also avoid
number of memcpy.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-08-05 15:41:35 -04:00
Joakim Sindholt
0633c2e683 targets/egl: fix build 2010-08-05 20:42:04 +02:00
Eric Anholt
e995f0e10c ir_to_mesa: Don't do function inlining until linking.
Optimizations at compile time should generally be done with the goal
of reducing instruction count so that other work, particularly
linking, is less time-consuming if the shader is used multiple times.
However, function inlining increases instruction count for the inlined
function bodies without removing the original function body, since we
don't know if it will be used at link time or not.

Reduces the runtime of linking and executing a Yo Frankie fragment
shader from 0.9 seconds to 0.5 seconds (-45.9%, +/- 2.2%, n=5).
2010-08-05 10:18:45 -07:00
Eric Anholt
2e853ca23c glsl2: Add a pass for removing unused functions.
For a shader involving many small functions, this avoids running
optimization across all of them after they've been inlined
post-linking.

Reduces the runtime of linking and running a fragment shader from Yo
Frankie from 1.6 seconds to 0.9 seconds (-44.9%, +/- 3.3%).
2010-08-05 10:18:31 -07:00
Marek Olšák
a4be3b6b31 r300g: fix fb_state atom size 2010-08-05 19:06:09 +02:00
Marek Olšák
fc94fd9bfa r300g: debug_print on startup whether we can use hyper-z 2010-08-05 19:05:11 +02:00
Eric Anholt
c5b9cab499 glsl2: Catch pointless copies in copy propagation.
We wouldn't want to go rewriting dereferences to variables to point at
the same variable it did before.  While I didn't find a way to trigger
that, a shader in Yo Frankie managed to produce a self-assignment by
passing a constant to a function doing self assignment like this.

Cleans up the IR for glsl-deadcode-self-assign.shader_test
2010-08-05 09:17:45 -07:00
Eric Anholt
8f6a0c9ed9 glsl2: Don't try to dump GLSL IR for a shader that didn't compile. 2010-08-05 09:17:45 -07:00
Eric Anholt
9de2c4fc8e ir_to_mesa: Remove debug force-enablement of EmitNoIfs. 2010-08-05 09:17:45 -07:00
Dave Airlie
b5f1044711 r300g: always emit hyperz state atom. 2010-08-05 20:58:51 +10:00
Dave Airlie
41f9e60bb3 r300g: disable hiz on rv530 for now.
On my rv530 at least HiZ is causing rendering issues in gears.
2010-08-05 20:32:06 +10:00
Dave Airlie
6eb2a7fbaf r300g: implement hyper-z support. (v4)
This implements fast Z clear, Z compression, and HiZ support for r300->r500
GPUs.

It also allows cbzb clears when fast Z clears are being used for the ZB.

It requires a kernel with hyper-z support.

Thanks to Marek Olšák <maraeo@gmail.com>, who started this off, and Alex Deucher at AMD for providing lots of hints.

v2:
squashed zmask ram size fix]
squashed r300g/blitter: fix Z readback when compressed]

v3:
rebase around texture changes in master - .1 fix more bits

v4:
migrated to using u_mm in r300_texture to manage hiz/zmask rams consistently
disabled HiZ when using OQ
flush z-cache before turning hyper-z off
update hyper-z state on dsa state change
store depthclearvalue across cbzb clears and replace it afterwards.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-08-05 20:32:05 +10:00
Keith Whitwell
ccbd9ae7cc docs: clarify point sprite discussion
Plagiarizes email explanation from Roland.
2010-08-05 11:09:14 +01:00
Vinson Lee
5e56c8907b st/mesa: Remove unnecessary header from st_gl_api.h. 2010-08-05 01:38:46 -07:00
Vinson Lee
ea1744a664 mesa: Include missing header in st_get_mipmap.h.
Include mtypes.h for GLcontext symbol.
Add forward declaration for st_context.
2010-08-05 01:23:46 -07:00
Vinson Lee
ad4d27c6d1 st/mesa: Include missing headers in st_format.h. 2010-08-05 00:59:44 -07:00
Vinson Lee
2febc491bc st/mesa: Add forward delcaration in st_extensions.h. 2010-08-05 00:54:27 -07:00
Vinson Lee
4f9ca250d6 st/mesa: Add missing headers to st_draw.h. 2010-08-05 00:52:30 -07:00
Chris Wilson
66708fd8a9 intel: Check for a NULL src buffer prior to blt
This can only happen along a malloc failure path, but check anyway.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-08-05 08:39:15 +01:00
Chris Wilson
85cfe32180 intel: Check for region allocation failure.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-08-05 08:38:55 +01:00
Kenneth Graunke
f4239872c9 glcpp: Ignore #if and #elif expressions when skipping.
Fixes glcpp test cases 073 and 074, as well as piglit test
xonotic-vs-generic-diffuse.vert.
2010-08-04 23:37:19 -07:00
Kenneth Graunke
d65135a766 glcpp/tests: Add a corollary to testcase 073 for testing #elif. 2010-08-04 23:37:19 -07:00
Kenneth Graunke
c52b2be166 glcpp/tests: Fix 073-if-in-ifdef.c to use #ifdef, not #if.
The original intention was to use #ifdef.
2010-08-04 23:37:19 -07:00
Kenneth Graunke
16b4eed59a glcpp: Refactor HASH_IF and HASH_ELIF expansion to reuse code. 2010-08-04 23:37:18 -07:00
Vinson Lee
9c98e9e6b5 st/mesa: Add missing header in st_context.c. 2010-08-04 21:17:13 -07:00
Vinson Lee
a0989e9437 st/mesa: Add missing header in st_atom_pixeltransfer.c. 2010-08-04 21:13:33 -07:00
Vinson Lee
1525fb4afe st/mesa: Clean up header file inclusion in st_context.h. 2010-08-04 21:09:27 -07:00
Vinson Lee
6f8b6661ce st/mesa: Add missing header in st_cb_xformfb.h. 2010-08-04 20:58:22 -07:00
Eric Anholt
046bef2357 glsl2: Remove the shader_in/shader_out tracking separate from var->mode.
I introduced this for ir_dead_code to distinguish function parameter
outvals from varying outputs.  Only, since ast_to_hir's
current_function is unset when setting up function parameters (they're
needed for making the function signature in the first place), all
function parameter outvals were marked as shader outputs anyway.  This
meant that an inlined function's cloned outval was marked as a shader
output and couldn't be dead-code eliminated.  Instead, since
ir_dead_code doesn't even look at function parameters, just use
var->mode.

The longest Mesa IR coming out of ir_to_mesa for Yo Frankie drops from
725 instructions to 636.
2010-08-04 20:52:33 -07:00
Eric Anholt
a08f27940a glsl2: Remove a dead cut and paste member from ir_variable_refcount_visitor. 2010-08-04 20:52:33 -07:00
Eric Anholt
72fd0568db i965: Settle on printing our program debug to stdout.
Mixing stderr (_mesa_print_program, _mesa_print_instruction,
_mesa_print_alu) with stdout means that when writing both to a file,
there isn't a consistent ordering between the two.
2010-08-04 20:52:33 -07:00
Eric Anholt
455290e428 ir_to_mesa: Print shader source and compiled IR under MESA_GLSL=dump.
While the Mesa IR dumping includes some corresponding GLSL IR for
correlating Mesa IR to GLSL IR, it doesn't completely express it.
This printing includes things like variable declarations and control
flow structure that is hard to read otherwise.
2010-08-04 20:52:33 -07:00
Eric Anholt
e3a90b8e38 glsl2: Use linked ir_constant_variable after linking, instead of unlinked. 2010-08-04 20:52:33 -07:00
Eric Anholt
022f79e496 glsl2: Return progress from ir_vec_index_to_swizzle. 2010-08-04 20:52:33 -07:00
Vinson Lee
cb7638579e st/mesa: Clean up st_cb_viewport.h.
Add inclusion guard.
Add forward declaration.
2010-08-04 17:04:38 -07:00
Vinson Lee
e857293299 st/mesa: Add missing headers in st_cb_texture.h. 2010-08-04 17:00:23 -07:00
Francisco Jerez
bc578caefb dri/nouveau: Don't try to validate uninitialized teximages. 2010-08-05 01:48:14 +02:00
Francisco Jerez
d03f04bfb5 dri/nv20: Fix some PGRAPH_ERRORs seen with DATA_CHECK enabled. 2010-08-05 01:48:14 +02:00
Francisco Jerez
e96a52e993 dri/nouveau: Fix up software mipmap generation. 2010-08-05 01:48:14 +02:00
Ian Romanick
83cb310dbb glsl2: Generate masked assignments in some expanded matrix operations 2010-08-04 16:47:28 -07:00
Ian Romanick
3d58be6135 glsl2: Generate masked assignments in vector and matrix constructors
Previously the in-line matrix and vector constructors would generate
swizzles in the LHS.  The code is actually more clear if it just
generates the masked assignments instead of relying on the
ir_assignment constructor to convert the swizzles to write masks.
2010-08-04 16:47:28 -07:00
Ian Romanick
6235c6a838 glsl2: Additional validation of write masks 2010-08-04 16:47:28 -07:00
Ian Romanick
5a7758efbe glsl2: Add ir_assignment::write_mask and associated methods
Replace swizzles on the LHS with additional swizzles on the RHS and a
write mask in the assignment instruction.  As part of this add
ir_assignment::set_lhs.  Ideally we'd make ir_assignment::lhs private
to prevent erroneous writes, but that would require a lot of code
butchery at this point.

Add ir_assignment constructor that takes an explicit write mask.  This
is required for ir_assignment::clone, but it can also be used in other
places.  Without this, ir_assignment clones lose their write masks,
and incorrect IR is generated in optimization passes.

Add ir_assignment::whole_variable_written method.  This method gets
the variable on the LHS if the whole variable is written or NULL
otherwise.  This is different from
ir->lhs->whole_variable_referenced() because the latter has no
knowledge of the write mask stored in the ir_assignment.

Gut all code from ir_to_mesa that handled swizzles on the LHS of
assignments.  There is probably some other refactoring that could be
done here, but that can be left for another day.
2010-08-04 16:47:27 -07:00
Ian Romanick
8e9ce2eb56 glsl2: Don't try to construct an ir_assignment with an invalid LHS 2010-08-04 16:47:27 -07:00
Vinson Lee
060a95c3a9 st/mesa: Add forward declaration in st_cb_strings.h. 2010-08-04 16:46:42 -07:00
Vinson Lee
e9d6f2fc8a st/mesa: Add missing header in st_cb_readpixels.h.
Include mtypes.h for GLcontext symbol.
2010-08-04 16:40:04 -07:00
Vinson Lee
a25ac9b526 st/mesa: Clean up header file inclusion in st_cb_rasterpos.h. 2010-08-04 16:33:10 -07:00
Eric Anholt
8dbdcb0b43 glsl2: Constant fold the children of many more ir_instruction types. 2010-08-04 16:25:56 -07:00
Eric Anholt
6ecf62f673 glsl2: Return a real progress value from constant folding. 2010-08-04 16:25:56 -07:00
Eric Anholt
3d23f0a90c glsl2: Refactor constant folding of rvalues to a function. 2010-08-04 16:25:56 -07:00
Vinson Lee
2bb3bfa943 st/mesa: Add missing header in st_cb_program.h.
Include mtypes.h for GLcontext symbol.
2010-08-04 16:13:15 -07:00
Kenneth Graunke
0ef79a5f11 glcpp: Refresh autogenerated lexer and parser. 2010-08-04 15:57:20 -07:00
Kenneth Graunke
1ffc1cd861 glcpp: Remove xtalloc wrappers in favor of plain talloc.
Calling exit() on a memory failure probably made sense for the
standalone preprocessor, but doesn't seem too appealing as part of
the GL library.  Also, we don't use it in the main compiler.
2010-08-04 15:57:20 -07:00
Kenneth Graunke
ad98aa9d93 glsl2: Remove uses of deprecated TALLOC_CTX type. 2010-08-04 15:57:19 -07:00
Christoph Bumiller
aaa8802a22 nv50: build proper phi functions in the first place 2010-08-05 00:50:00 +02:00
Christoph Bumiller
720e0c430d nv50: fix constbuf validation
We only uploaded up to the highest offset a program would use,
and if the constant buffer isn't changed when a new program is
used, the new program is missing the rest of them.

Might want to introduce a "fill state" for user mem constbufs.
2010-08-05 00:50:00 +02:00
Christoph Bumiller
2c695d38e6 nv50: don't eliminate loads to dedicated values 2010-08-05 00:50:00 +02:00
Vinson Lee
7f7bbf0d5b r300/compiler: Remove unnecessary header. 2010-08-04 15:45:41 -07:00
Vinson Lee
81bc4f4cbf intel: Remove unnecessary header. 2010-08-04 15:38:24 -07:00
Vinson Lee
9f7e7ce757 st/mesa: Add missing headers in st_cb_flush.h.
Add forward declarations.
Include p_compiler.h for uint symbol.
2010-08-04 15:32:53 -07:00
Vinson Lee
85dbb2904b st/mesa: Clean up header inclusion in st_cb_feedback.h.
Replace mtypes.h with forward declaration.
Include compiler.h for INLINE symbol.
2010-08-04 15:26:37 -07:00
Aras Pranckevicius
ea3a9eb53a glsl2: add gl_LightModel built-in uniform. 2010-08-04 14:41:01 -07:00
Eric Anholt
b6ceddc371 glsl2: Don't try to assign locations for samplers during linking.
Mesa will do the mapping at _mesa_add_sampler() time.  Fixes assertion
failures in debug builds, which might have caught real problems with
multiple samplers linked in a row.
2010-08-04 14:28:57 -07:00
Eric Anholt
fe1918c71c ir_to_mesa: Clean up the mapping of samplers to Mesa's sampler uniforms.
Instead of using a linker-assigned location (since samplers don't
actually take up uniform space, being a link-time choice), use the
sampler's varaible pointer as a hash key.
2010-08-04 14:21:01 -07:00
Eric Anholt
8e181b629f mesa: Don't null deref looking for Mesa IR code at compile time.
The new compiler doesn't generate Mesa IR at compile time, and that
compile time code previously wouldn't have reflected the link time
code that actually got used.  But do dump the info log of the compile
regardless.
2010-08-04 14:13:08 -07:00
Jerome Glisse
12dac449fb r600g: force flush on map as temporary fix to readpixel
Should allow more piglit test to pass. Need to plugin
proper flushing.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-08-04 16:29:56 -04:00
Vinson Lee
2e85117b5f st/mesa: Add missing headers to st_cb_fbo.h. 2010-08-04 13:18:55 -07:00
Jerome Glisse
9a78e790dc r600g: always perform texture perspective divide + fix blending
quake3 engine seems to run fine at this point (ioquake)

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-08-04 16:11:39 -04:00
Vinson Lee
19bfb55fb5 st/mesa: Clean up header file inclusion in st_cb_eglimage.h.
Replace dd.h and mtypes.h with a forward declaration.
Include compiler.h for INLINE symbol.
2010-08-04 13:04:36 -07:00
Eric Anholt
952d0f88e1 glsl2: Skip talloc_parent in constant_expression of non-constant arrays. 2010-08-04 12:57:58 -07:00
Vinson Lee
988e86762f draw: Fix return type of draw_translate_vinfo_size.
Fixes typo from commit b609cfc7c9.
2010-08-04 12:55:21 -07:00
Vinson Lee
137c510097 st/mesa: Clean up header file inclusion in st_cb_drawtex.h.
Replace mtypes.h with forward declarations.
Include compiler.h for INLINE symbol.
2010-08-04 12:46:38 -07:00
Eric Anholt
8273bd4687 glsl2: Make the clone() method take a talloc context.
In most cases, we needed to be reparenting the cloned IR to a
different context (for example, to the linked shader instead of the
unlinked shader), or optimization before the reparent would cause
memory usage of the original object to grow and grow.
2010-08-04 12:42:47 -07:00
Vinson Lee
dce63cf431 st/mesa: Clean up header file inclusion in st_cb_drawpixels.h.
Replace mtypes.h with forward declarations.
Include compiler.h for INLINE symbol.
2010-08-04 12:29:26 -07:00
Vinson Lee
7fdf6d5c28 st/mesa: Add forward declaration in st_cb_condrender.h. 2010-08-04 12:24:51 -07:00
Vinson Lee
ed810ba724 st/mesa: Add forward declarations in st_cb_clear.h. 2010-08-04 12:22:31 -07:00
Vinson Lee
6bc17324da st/mesa: Include missing headers in st_cb_bufferobjects.h.
Include compiler.h for INLINE symbol.
Include mtypes.h for gl_buffer_object symbol.
2010-08-04 12:13:29 -07:00
Vinson Lee
eb4f2d4b02 st/mesa: Clean up header file inclusion in st_cb_blit.h.
Replaced mtypes.h and st_context.h with forward declarations.
Added compiler.h for INLINE symbol.
2010-08-04 12:08:17 -07:00
Vinson Lee
e6902afeee st/mesa: Clean up header file inclusion in st_cb_bitmap.h.
Removed mtypes.h.
Include compiler.h for INLINE symbol.
Added forward declarations.
2010-08-04 12:00:19 -07:00
Kristian Høgsberg
2542d8e0c2 glx: Move deref after NULL check 2010-08-04 12:51:26 -04:00
Aras Pranckevicius
84ee01f40a glsl2: Set ir_discard::ir_type when cloning it
Fixes unset ir_type after inlining.
2010-08-04 08:57:02 -07:00
Kristian Høgsberg
e3a0e468bc glx: Fix use after free in drisw error path 2010-08-04 08:57:02 -04:00
Kristian Høgsberg
e71c44cedd glx: We no longer need screen extensions for drisw
https://bugs.freedesktop.org/show_bug.cgi?id=29177
2010-08-04 08:52:26 -04:00
Kristian Høgsberg
9da1c9da13 glx: dri2InvalidateBuffers() needs the X drawable XID not the GLX one
This never ceases to entertain.
2010-08-04 08:47:36 -04:00
Andre Maasikas
8ad5b76d52 r600: relax stride/alignment requirements for vertices
seems hw can do unaligned accesses and unaligned strides
removes extra conversion when using vbo's

however I needed to switch 3 component byte format to 4 component formats
for tests to pass. Somewhat sililar to GL_SHORT fix done earlier

removes assert and gains +2 piglit especially draw-vertices
2010-08-04 12:49:39 +03:00
Chia-I Wu
5c2f01bbb0 draw: Fix the edge flags of flatshade_first polygons.
This bug can be triggered by rendering polygons with

   glProvokingVertexEXT(GL_FIRST_VERTEX_CONVENTION_EXT);
   glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
2010-08-04 14:03:05 +08:00
Tom Stellard
09c8fa570e r300/compiler: Always unroll loops when doing loop emulation. 2010-08-03 20:17:00 -07:00
Tom Stellard
2824d5687a r300/compiler: r500 hw support for break and continue in loops.
The BGNLOOP and ENDLOOP instructions are now being used correctly, which
makes break and continue possible.  The deadcode pass has been modified to
handle breaks, and the compiler is more careful about which loops are
unrolled.
2010-08-03 19:11:08 -07:00
Tom Stellard
9dcc500666 r300/compiler: KILP may not always be inside an IF statement. 2010-08-03 19:11:08 -07:00
Tom Stellard
680f486ffd r300/compiler: Don't unroll loops with continue or break. 2010-08-03 19:11:08 -07:00
Vinson Lee
a3ff6c2697 st/mesa: Clean up header file inclusion in st_cache.h. 2010-08-03 17:55:53 -07:00
Vinson Lee
279926859e st/mesa: Add forward declarations in st_atom_shader.h. 2010-08-03 17:35:29 -07:00
Dave Airlie
8bc5fe1ad6 r300g: disable multisample visuals until the state tracker bits catch up.
This stops us advertising lots of ms visuals we can't actually use.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-08-04 09:37:43 +10:00
Brian Paul
48268e0f2a draw: check for instance divisors in vcache_check_run()
When we have instance divisors we don't really know which vertex
elements we'll be fetching ahead of time.

This fixes a bug in instanced drawing which was exposed by the new
draw_vbo() code because of max_index not being ~0 as often as it used
to be.  The test for max_index >= DRAW_PIPE_MAX_VERTICES often hid
this problem before.
2010-08-03 16:37:58 -06:00
Brian Paul
e89e47e6d0 gallium/translate: make generic_run() and generic_run_elts() more alike
Plus more debug code and do clamping in generic_run().
2010-08-03 16:37:58 -06:00
Brian Paul
8c3cc83432 draw: added a comment 2010-08-03 16:37:58 -06:00
Brian Paul
0e7b53c75b draw: use instance divisor in draw_print_arrays() 2010-08-03 16:37:58 -06:00
Brian Paul
f94e7e25d1 draw: add assertion, rearrange debug code 2010-08-03 16:37:58 -06:00
Marek Olšák
afbf446de5 st/dri: fix crash when dri2_drawable_get_buffers fails
It's easily reproducible with Compiz with its Resize window mode
set to Normal (which is usually not the default mode).

https://bugs.freedesktop.org/show_bug.cgi?id=28658
https://bugs.freedesktop.org/show_bug.cgi?id=29303

This is actually a workaround to prevent Compiz crashes.
Instead, a completely white titlebar might show up during resizing
transparent windows (a rare case).

The underlying cause should be fixed by someone who has more knowledge
about the code. (dri2_drawable_get_buffers should not return NULL)

Acked-By: Jakob Bornecrantz <jakob@vmware.com>
2010-08-04 00:07:28 +02:00
Marek Olšák
0614006d09 mesa: increase the relative address offset limit to 4096 in ARB_vp/fp
Even though the spec says that the limits should be -64/+63, proprietary
drivers support much larger relative offsets and some applications do
depend on this non-standard behavior.

Also program_parse.tab.c has been regenerated.

This fixes the parser error:

  ARB_vp: error: relative address offset too large

See also: https://bugs.freedesktop.org/show_bug.cgi?id=28628

4096 * sizeof(vec4) is the maximum size of the constant buffer on NV50.
It is not supposed to be a definite hardware limit, it is for the parser
not to get in the way and let the underlying driver decide whether it can
run the shader or not.
2010-08-04 00:07:28 +02:00
Jerome Glisse
dd863bf5e7 r600g: add polygon offset support
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-08-03 17:45:51 -04:00
Jerome Glisse
a0b3944c30 r600g: flush and resubmit if we reach limit
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-08-03 17:02:48 -04:00
Jerome Glisse
3a8d4a8979 r600g: fix color target mask
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-08-03 16:16:01 -04:00
Zack Rusin
6f9d3516a4 gallium/draw: forgot about PIPE_PRIM_LINE_STRIP_ADJACENCY 2010-08-03 16:02:09 -04:00
Zack Rusin
1fd84b10f2 gallium/util: add extra primitives to the trimmer 2010-08-03 15:56:49 -04:00
Jerome Glisse
8f6341d421 r600g: fix stencil
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-08-03 15:49:21 -04:00
Eric Anholt
c22dee7216 glsl2: Fix ir_validate validating null variable names.
An unnamed variable in a prototype will have a NULL ->name, so don't
worry about storage then.

Fixes:
CorrectFunction1.vert
CorrectParse1.frag
2010-08-03 11:47:02 -07:00
Eric Anholt
900ab2f564 glsl2: No need to strdup the name passed in to ir_variable constructor.
ir_variable always strdups the incoming name so that it matches the
lifetime of the ir_variable.
2010-08-03 11:40:26 -07:00
Jerome Glisse
7e42b7e5d2 r600g: fix LIT + fix multiple constant one ALU + fix ALU block splitting
Make sure LIT fills all slot for instruction (can't do W instruction
without having the Z slot filled with at least a NOP).

ALU instruction can't access more than 4 constant, move constant to
temporary reg if we reach the limit.

Fix ALU block splitting, only split ALU after ALU with last instruction
bit sets.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-08-03 14:31:49 -04:00
Marek Olšák
57438adf32 r300g: handle polygon offset correctly
https://bugs.freedesktop.org/show_bug.cgi?id=29372
2010-08-03 15:53:26 +02:00
Vinson Lee
9c6b5a4407 st/mesa: Add forward declarations in st_atom_constbuf.h. 2010-08-03 01:20:13 -07:00
Vinson Lee
df66c641e3 st/mesa: Include glheader.h in st_atom.h.
Include glheader.h for GLenum symbol.
2010-08-03 01:14:37 -07:00
Vinson Lee
816ad9bc23 mesa: Clean up header file inclusion in m_xform.h.
Include compiler.h for CONST symbol.

Remove config.h as m_xform.h uses no additional symbols from config.h.
2010-08-03 00:51:51 -07:00
Vinson Lee
19f7db9c9c mesa: Reduce header file inclusion in m_translate.h.
m_translate.h does not use any additional symbols added by config.h.
2010-08-03 00:41:19 -07:00
Vinson Lee
29495bbb84 mesa: Include missing header in m_matrix.h. 2010-08-03 00:33:04 -07:00
Vinson Lee
d356ad349b mesa: Reduce header file inclusion in texgen.h.
texgen.h doesn't use any symbols additionally added by mtypes.h.
2010-08-03 00:19:26 -07:00
Vinson Lee
b5ce878fa7 mesa: Reduce header file inclusion in texcompress_fxt1.h.
texcompress_fxt1.h doesn't use any additional symbols added by mtypes.h.
2010-08-03 00:04:14 -07:00
Vinson Lee
f7d29d5881 mesa: Reduce header file inclusion in syncobj.h.
syncobj.h doesn't use any additional symbols that is added by context.h.
2010-08-02 23:53:23 -07:00
Eric Anholt
c8babd5d9b glsl2: Fix typo in clamp() constant builtin using uint instead of int.
I take back the bad things I've said about the signed/unsigned
comparison warning now.
2010-08-02 17:50:20 -07:00
Eric Anholt
47f305a4fc ir_to_mesa: Add support for 1.20 uniform initializers.
Fixes:
glsl-uniform-initializer-1
glsl-uniform-initializer-2
glsl-uniform-initializer-3
glsl-uniform-initializer-4
glsl1-GLSL 1.20 uniform array constructor
2010-08-02 17:47:35 -07:00
Eric Anholt
5704ed27dd glsl2: Don't consider uniform initializers as constant expressions.
We were happily optimizing away the body of
glsl-uniform-initializer-* to never use the uniforms.
2010-08-02 17:47:35 -07:00
Eric Anholt
b10bb527ea Initialize a couple of HasIndex2 fields on Mesa IR src regs. 2010-08-02 17:47:35 -07:00
Eric Anholt
26675e37bc ir_to_mesa: Support for struct uniforms.
Fixes glsl-uniform-struct.
2010-08-02 17:47:35 -07:00
Eric Anholt
9c02412cdc ir_to_mesa: Add a constructor for ir_to_mesa_src_reg.
This helps makes sure we don't miss any new fields, and makes totally
uninitialized src_regs be PROGRAM_UNDEFINED.
2010-08-02 17:47:35 -07:00
Carl Worth
1575070bfe glsl2: Use talloc_zero_size instead of talloc_size to allocate ast_node objects.
This is a zero-ing function, (like calloc), to avoid bugs due to
accessing uninitialized values. Thanks to valgrind for noticing the
use of uninitialized values.
2010-08-02 17:27:56 -07:00
Jerome Glisse
f031817450 r600g: split alu block to conform to limit + RCP opcode
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-08-02 17:41:52 -04:00
Ian Romanick
42f3e7b6d7 glsl_type: Use string key for array type hash 2010-08-02 13:53:33 -07:00
Ian Romanick
955ceef47f Keep a local copy of the symbol name in the symbol table
The symbol_header structure that tracks symbols with a particular name
may have a different (longer) life time than the symbols it tracks.
Not keeping a local copy of the name can lead to use-after-free
errors.  For example, the following sequence would trigger such an
error:

    char *copy = strdup(name);

    _mesa_symbol_table_push_scope(st);
    _mesa_symbol_table_add_symbol(st, 0, name, NULL);
    _mesa_symbol_table_pop_scope(st);
    free(name);
    _mesa_symbol_table_find_symbol(st, 0, copy);

With this change, the symbol table keeps a local copy of the name that
has the same life time as the symbol_header for that name.  This
resolves some use-after-free errors with built-in functions in the
GLSL compiler.
2010-08-02 13:53:32 -07:00
Ian Romanick
7ffe40532f glsl2: Clean-up two 'unused variable' warnings 2010-08-02 13:53:32 -07:00
Ian Romanick
cf41c8a0d8 glsl2: Make glsl_types::ctx private again 2010-08-02 13:53:32 -07:00
Eric Anholt
eb7e120f0f glsl2: Fix expression type in builtin tan().
Fixes glsl-fs-tan-1.
2010-08-02 12:33:18 -07:00
Eric Anholt
ee7666b5ac glsl2: Add validation that talloc ownership of ir_* names is right. 2010-08-02 12:08:52 -07:00
Eric Anholt
e75dbf66d0 glsl2: Fix validation for ir_unop_not.
We use vector ir_unop_not to implement builtin not(), and that seems fine.
2010-08-02 12:06:34 -07:00
Eric Anholt
47f3f22311 glsl2: Add support for floating constants like "1f".
Fixes glsl-floating-constant-120.
2010-08-02 11:26:43 -07:00
Jerome Glisse
313df41562 r600g: add autogenerated reg definition + debug print cleanup
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-08-02 14:22:58 -04:00
Eric Anholt
960ba0014a glsl2: Initialize the ARB_fcc fields of ir_variable.
Fixes intermittent failure in glsl-arb-fragment-coord-conventions.
2010-08-02 11:20:32 -07:00
Eric Anholt
b8db38e1c4 glsl2: Also initialize the identifier field of parameter_declarator.
The non-named parameter grammar understandably doesn't set the
identifier field.  Fixes intermittent failures about void main(void)
{} having a named void parameter.
2010-08-02 11:04:54 -07:00
Eric Anholt
004e924014 glsl2: Fix spelling of "precision" in error output. 2010-08-02 10:59:46 -07:00
Eric Anholt
f311d8e9e9 glsl2: Don't add mesa/program/ as an include dir. Let includes say program/. 2010-08-02 10:59:46 -07:00
Aras Pranckevicius
31747155ea glsl2: Give the path within src/mesa/ for headers instead of relying on -I. 2010-08-02 10:59:46 -07:00
Aras Pranckevicius
b35703df10 glsl2: initialize is_array and array_size of ast_parameter_declarator
The non-array path of glsl_parser.ypp wasn't setting is_array to false.
2010-08-02 10:59:42 -07:00
Mario Kleiner
646d2e9fbc radeon: Add DRI2 flush extension support, so we synchronize properly.
When a DRI2 swap buffer is pending we need to make sure we
have the flush extension so radeon doesn't resume rendering to
or reading from the not yet blitted front buffer.

This fixes:

https://bugs.freedesktop.org/show_bug.cgi?id=28341
https://bugs.freedesktop.org/show_bug.cgi?id=28410

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Mario Kleiner <mario.kleiner@tuebingen.mpg.de>
2010-08-02 13:29:44 -04:00
Jerome Glisse
3d39f56a87 Revert "radeon: Add DRI2 flush extension to so we synchronize properly."
This reverts commit 8446f257b3.
2010-08-02 13:28:15 -04:00
Marek Olšák
afa925066c r300g: fix hardlock when using more than one stuffed sprite coords
If texture coordinates come from the vertex shader, there are always
4 components in the rasterizer input packet, but if the coordinates
are stuffed (like for point sprites), there are only 2 or 3 components
(based on GB_ENABLE) and if we rasterize more, it locks up.
2010-08-02 17:26:23 +02:00
Mario Kleiner
8446f257b3 radeon: Add DRI2 flush extension to so we synchronize properly.
When DRI2 swap buffer is pending (copy buffer not pageflipping)
we need to make sure we have the flush extension so radeon doesn't
resume rendering on the not yet blitted front buffer.

Modified version of Jerome's patch to add flush extension
in the correct place.

This prepares a possible fix for:

https://bugs.freedesktop.org/show_bug.cgi?id=28341
https://bugs.freedesktop.org/show_bug.cgi?id=28410

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Mario Kleiner <mario.kleiner@tuebingen.mpg.de>
2010-08-02 10:43:51 -04:00
Kristian Høgsberg
1f1928db00 glx: Drop _Xglobal_lock while we create and initialize glx display 2010-08-02 09:53:44 -04:00
Andre Maasikas
d6a5f94ea4 r600: fix sin,cos functions on r600
r600 doesnt need the same normalization as r700 - instead it requires
range to be truncated to -pi..pi

I left the range trunc also effective on r700 althouch according the docs
it has sufficent range (-512*PI, +512*PI). The instructions seem
to be used not too often to cause perf loss because of this

Based on patches and testing by Conn Clark and Alain Perrot
2010-08-02 15:11:22 +03:00
Michal Krol
c1f33097f4 util: Fix unpacking of R8G8Bx_SNORM format.
Apparently, we must always use integers to perform calculations,
otherwise the results won't match D3D's CxV8U8 definition.
2010-08-02 14:06:37 +02:00
Dave Airlie
4af5f11c32 r600g: add stencil op/func translation 2010-08-02 16:27:15 +10:00
Dave Airlie
3f4ec394b0 r600g: initial alpha test state 2010-08-02 16:27:15 +10:00
Dave Airlie
7bcd39ce50 r600g: add initial blend state.
migrates cb_cntl to be regenerated
2010-08-02 16:27:01 +10:00
Dave Airlie
01984cf34f r600g: set correct tex coord type for rect textures. 2010-08-02 14:56:20 +10:00
Dave Airlie
919750a557 r600g: make r600_db_format static.
this isn't used anywhere else yet.
2010-08-02 14:31:49 +10:00
Eric Anholt
6a41626e90 glsl2: Make non-square matrix keywords not keywords pre-120.
Fixes glsl-mat-110.
2010-08-01 19:11:10 -07:00
Dave Airlie
aef4500ca4 draw: fix warning in sse code.
Not sure if this will actually fix the issue, but it fixes the warning.
2010-08-02 08:57:14 +10:00
Marek Olšák
a87cedbde0 r300g: fix microtiling on RS6xx
Getting tiling right has always been tricky.
There are so many subtle details...
2010-08-01 22:16:57 +02:00
Eric Anholt
b42519108d ir_to_mesa: Add support for MESA_GLSL=log.
This is the option that dumps shader source to files in the current
directory.
2010-08-01 11:41:02 -07:00
Eric Anholt
93b10bd353 glcpp: Add a testcase for the failure in compiling xonotic's shader.
gcc and mesa master agree that this is OK.
2010-08-01 11:40:07 -07:00
Vinson Lee
9846b06271 mesa: Remove inclusion of compiler.h from mtypes.h.
mtypes.h does not use any symbols from compiler.h.

Also add the required headers for files that depended on symbols from
compiler.h but were indirectly including compiler.h through mtypes.h.
2010-07-31 23:04:41 -07:00
Vinson Lee
e7242b6e8a mesa: Remove unnecessary header from mm.h. 2010-07-31 20:53:42 -07:00
Vinson Lee
ca2ceca5b1 mesa: Add headers containing sybmols used by mm.c. 2010-07-31 20:51:13 -07:00
Vinson Lee
1d74a1674c r600g: Remove unnecessary header. 2010-07-31 19:23:14 -07:00
Vinson Lee
8b909144a1 mesa: Reduce header file inclusion in get.h.
get.h only needs the GL headers.
2010-07-31 16:28:13 -07:00
Vinson Lee
9e75ac7d25 mesa: Include missing headers in vtxfmt.h.
Include compiler.h for INLINE symbol.
Include mtypes.h for GLcontext symbol.
2010-07-31 16:15:08 -07:00
Vinson Lee
dda9b80d07 mesa: Include missing header in shared.h.
Include mtypes.h for GLcontext symbol.
2010-07-31 16:13:05 -07:00
Vinson Lee
da93fba85d mesa: Include missing header in restart.h. 2010-07-31 16:10:14 -07:00
Eric Anholt
f6b03f3235 glsl2: Do algebraic optimizations after linking as well.
Linking brings in inlining of builtins, so we weren't catching the
(rcp(/sqrt(x)) -> rsq(x)) without it.
2010-07-31 15:52:24 -07:00
Eric Anholt
784695442c glsl2: Add new tree grafting optimization pass. 2010-07-31 15:52:21 -07:00
Eric Anholt
d72edc4ddd glsl2: Factor out the variable refcounting part of ir_dead_code.cpp. 2010-07-31 15:52:21 -07:00
Vinson Lee
e4ad42d421 mesa: Include missing headers in renderbuffer.h. 2010-07-31 15:45:40 -07:00
Vinson Lee
6d86b0116e mesa: Include missing header in remap.h.
Include compiler.h for INLINE symbol.
2010-07-31 15:39:35 -07:00
Vinson Lee
5fa1af0905 r600g: Remove unnecessary header. 2010-07-31 14:56:53 -07:00
Vinson Lee
245d5a8913 mesa: Remove unnecessary headers. 2010-07-31 14:37:32 -07:00
Vinson Lee
dba7875cda swrast: Remove unnecessary headers. 2010-07-31 13:35:17 -07:00
Vinson Lee
db71bdc31c egl: Fix '_eglAddAtExitCall' implicit declaration warning. 2010-07-31 13:28:32 -07:00
Aras Pranckevicius
1c325af4d6 glsl2: Fix stack smash when ternary selection is used. 2010-07-31 12:00:01 -07:00
Christoph Bumiller
fa67cabe7a nv50: fixes for nested IFs 2010-07-31 18:32:35 +02:00
Christoph Bumiller
5705b45b6a nv50: explicitly set src type for SET ops
Need to do this more nicely for all ops.
2010-07-31 18:32:35 +02:00
Christoph Bumiller
5de5e4fd5c nv50: insert MOVs also for PHI sources from dominating block
Otherwise we get live range conflicts for operands that are written
only in e.g. an ELSE block but not the IF block.
2010-07-31 18:32:35 +02:00
Christoph Bumiller
582311ca97 nv50: fix for empty BBs 2010-07-31 18:32:34 +02:00
Christoph Bumiller
28ded2585c nv50: add signed RGTC1 to format table, allow 2_10_10_10 for vbufs 2010-07-31 18:32:34 +02:00
Chia-I Wu
6c7e0b95a4 egl: Add checks for EGL_MESA_screen_surface.
This allows Mesa EGL to be compiled with eglext.h that does not define
EGL_MESA_screen_surface.
2010-07-31 17:49:32 +08:00
Vinson Lee
3cc471e429 tnl: Remove unnecessary headers. 2010-07-31 00:55:13 -07:00
Vinson Lee
ca0b0899d8 st/dri: Remove unnecessary headers. 2010-07-31 00:41:43 -07:00
Vinson Lee
2f30a83ea8 mesa: Include missing header in pixelstore.h.
Include mtypes.h for GLcontext symbol.
2010-07-30 23:32:32 -07:00
Vinson Lee
378b8df47a mesa: Include missing headers in nvprogram.h. 2010-07-30 23:30:38 -07:00
Eric Anholt
3fa1b85196 glsl2: Fix the implementation of atan(y, x).
So many problems here.  One is that we can't do the quadrant handling
for all the channels at the same time, so we call the float(y, x)
version multiple times.  I'd also left out the x == 0 handling.  Also,
the quadrant handling was broken for y == 0, so there was a funny
discontinuity on the +x side if you plugged in obvious values to test.

I generated the atan(float y, float x) code from a short segment of
GLSL and pasted it in by hand.  It would be nice to automate that
somehow.

Fixes:
glsl-fs-atan-1
glsl-fs-atan-2
2010-07-30 15:19:00 -07:00
Jerome Glisse
094d66f459 r600g: add KIL opcode support
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-07-30 18:05:07 -04:00
Carl Worth
ec9675ec53 ast: Initialize location data in constructor of all ast_node objects.
This prevents using uninitialized data in _msea_glsl_error in some
cases, (including at least 6 piglit tests). Thanks to valgrind for
pointing out the problem!
2010-07-30 15:03:37 -07:00
Eric Anholt
40f57c2bec ir_to_mesa: Add the function name as a comment to BGNSUB and ENDSUB. 2010-07-30 14:57:44 -07:00
Eric Anholt
5e5583ee06 glsl2: Update the callee pointer of calls to newly-linked-in functions.
Otherwise, ir_function_inlining will see the body of the function from
the unlinked version of the shader, which won't have had the lowering
passes done on it or linking's variable remapping.
2010-07-30 14:57:22 -07:00
George Sapountzis
873ddf547d st/dri: move backend hooks to appropriate object 2010-07-30 23:43:26 +03:00
George Sapountzis
a30b966f83 st/dri: drop dri1_helper 2010-07-30 23:43:26 +03:00
George Sapountzis
2e4ad14a52 st/dri: mv driDriverAPI to backends 2010-07-30 23:43:26 +03:00
Kenneth Graunke
939a1807fe glsl2: Initialize ir_function_signature::is_built_in.
Fixes a valgrind error.
2010-07-30 13:30:11 -07:00
Brian Paul
b3e3d0da58 st/mesa: better handling of indirect addressing of temp/const register files
With gl_program::IndirectRegisterFiles we can distinguish between indirect
addressing of constants vs. temporaries.  In the case of temporaries,
declare all temps up front sequentially.

Fixes fd.o bug 29305.
2010-07-30 14:29:19 -06:00
Brian Paul
56643096f1 mesa: added gl_program::IndirectRegisterFiles field
Now drivers, etc. can know which register files are accessed with
indirect addressing.  Before we just checked gl_program::NumAddressRegs
but didn't know if that was the constant buffer, temp regs, or what.

The only user of this new field so far will be the gallium state tracker.
2010-07-30 14:29:19 -06:00
Kenneth Graunke
805cbf3922 glcpp: Don't look for backslashes before the beginning of the string.
Fixes a valgrind error.
2010-07-30 13:26:14 -07:00
Vinson Lee
79ab5b9798 llvmpipe: Silence unused value warning. 2010-07-30 13:11:14 -07:00
Vinson Lee
c4c2897367 mesa: Add missing header to multisample.h.
Include mtypes.h for GLcontext symbol.
2010-07-30 13:00:13 -07:00
Zack Rusin
dd406cf341 draw: actually a noop, rather than not implemented
we just have nothing to do in it right now
2010-07-30 15:42:50 -04:00
Vinson Lee
dbfe11c7c3 mesa: Remove unnecessary header from colormac.h. 2010-07-30 12:32:47 -07:00
Brian Paul
ce1fed1659 tgsi: remove incorrect assertion 2010-07-30 13:28:42 -06:00
Vinson Lee
1a537b639e mesa: Remove unnecessary headers. 2010-07-30 12:13:17 -07:00
Vinson Lee
078eff659a llvmpipe: Fix implicit declaration of lp_func_delete_body warnings. 2010-07-30 11:48:48 -07:00
Chia-I Wu
0e7d7d3051 util: Fix the range of util_draw_elements_instanced.
Keep min_index and max_index at their defaults (0 and ~0).
2010-07-30 23:45:56 +08:00
Zack Rusin
042018a943 llvmpipe: delete function bodies after generating machine code 2010-07-30 16:25:29 +01:00
Jerome Glisse
6c288d06ac r600g: fix typo in tex instruction + shader semantic id fix
It seems we never get semantic id from TGSI so fallback
to use output number as id.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-07-30 11:12:10 -04:00
Li Peng
c33c1912dd configure: fix wrong variable name GLESv1_LIB_DEPS
GLESv1_CM_LIB_DEPS is defined in "configs/autoconf.in",
but configure.ac uses GLESv1_LIB_DEPS.

Signed-off-by: Li Peng <peng.li@linux.intel.com>
2010-07-30 08:52:58 -04:00
Keith Whitwell
f623d06c49 util: more helpers for old draw code 2010-07-30 10:47:20 +01:00
Vinson Lee
3fdd9fa556 mesa: Include macros.h in files that use symbols from macros.h.
Don't rely on inclusion of other files that already include macros.h.
2010-07-30 00:41:08 -07:00
Vinson Lee
bddbdd624f mesa: Include macros.h in attrib.c for COPY_4FV symbol. 2010-07-30 00:18:09 -07:00
Vinson Lee
11fce3a821 intel: Add missing header to intel_context.c.
Fixes "implicit declaration of function
_mesa_get_incomplete_framebuffer" warning.
2010-07-30 00:06:40 -07:00
Vinson Lee
5264615b52 mesa: Reduce clip.h header file inclusion. 2010-07-30 00:00:22 -07:00
Vinson Lee
95e3832b53 mesa: Add missing header to framebuffer.h.
Include mtypes.h for GLvisual and GLcontext symbols.
2010-07-29 23:53:13 -07:00
Vinson Lee
c6466f599c mesa: Add missing header to fboject.h.
Add mtypes.h for GLcontext symbol.
2010-07-29 23:50:32 -07:00
Vinson Lee
f58ec9dc4d mesa: Add missing header to texgetimage.h. 2010-07-29 23:41:46 -07:00
Vinson Lee
b5de2be8e0 mesa: Add missing header to texrender.h.
Add mtypes.h for GLcontext symbol.
2010-07-29 23:38:17 -07:00
Vinson Lee
1978247f85 mesa: Add missing header and forward declarations to uniforms.h. 2010-07-29 23:04:50 -07:00
Vinson Lee
3ef2a490d2 mesa: Add missing headers to viewport.h. 2010-07-29 22:57:54 -07:00
Vinson Lee
86abec0294 mesa: Add missing header to depthstencil.h.
Add mtypes.h for GLcontext symbol.
2010-07-29 22:43:42 -07:00
Vinson Lee
989c60bc92 mesa: Add missing headers to debug.h. 2010-07-29 22:41:03 -07:00
Vinson Lee
dfc7b7212f intel: Add missing header.
Add context.h for NEED_SECONDARY_COLOR symbol.
2010-07-29 19:10:14 -07:00
Vinson Lee
ebdc537ff7 dri: Add missing header to dri_metaops.c.
Add context.h for FLUSH_VERTICES symbol.
2010-07-29 19:04:43 -07:00
Vinson Lee
7e54c4a646 mesa: Reduce clear.h header file inclusion. 2010-07-29 18:15:41 -07:00
Vinson Lee
e5c128379a mesa: Reduce bufferobj.h header file inclusion.
Directly include mtypes.h instead of including context.h to include
mtypes.h.
2010-07-29 18:03:20 -07:00
Vinson Lee
bbe1385201 mesa: Remove unnecessary headers. 2010-07-29 17:14:32 -07:00
Brian Paul
e75da1a8d6 llvmpipe: fix on-debug build breakage 2010-07-29 17:49:49 -06:00
Brian Paul
6c1625cc40 llvmpipe: added some jit debug code
If we crash in the jitted function we can examine jit_line and
jit_state in gdb to learn more about the shader.
2010-07-29 17:31:18 -06:00
Brian Paul
b4c8de1ff2 draw: do bounds checking of array elements (debug only)
Make sure that all the element indexes actually lie inside the vertex
buffer.

Also, rename pipe_run() to pipe_run_elts() to be more specific.

And assert/check the vertex count for the non-indexed case.
2010-07-29 17:25:54 -06:00
Brian Paul
d88b6e19c1 draw: assorted clean-ups in clipper code 2010-07-29 17:25:54 -06:00
Brian Paul
ba2cc3b8e6 gallium: implement bounds checking for constant buffers
Plumb the constant buffer sizes down into the tgsi interpreter where
we can do bounds checking.  Optional debug code warns upon out-of-bounds
reading.  Plus add a few other assertions in the TGSI interpreter.
2010-07-29 17:25:54 -06:00
Brian Paul
8a2933f366 draw: add vertex buffer offset in draw_print_arrays() 2010-07-29 17:25:54 -06:00
Brian Paul
d1f38baa01 llvmpipe: silence warnings in lp_test_sincos.c 2010-07-29 17:25:54 -06:00
Jerome Glisse
7a73390f91 r600g: mipmap early support + EX2/ABS instruction + culling
Add mipmap support (demos/src/redbook/mipmap is working)
Add EX2/ABS shader instruction support.
Add face culling support.

Misc fixes.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-07-29 19:05:57 -04:00
Eric Anholt
0cf545ec69 glsl2: Do ir_if_return on the way out, not the way in.
The problem with doing it on the way in is that for a function with
multiple early returns, we'll move an outer block in, then restart the
pass, then move the two inside returns out, then never move outer
blocks in again because the remaining early returns are inside an else
block and they don't know that there's a return just after their
block.  By going inside-out, we get the early returns stacked up so
that they all move out with a series of
move_returns_after_block().

Fixes (on i965):
glsl-fs-raytrace-bug27060
glsl-vs-raytrace-bug26691
2010-07-29 15:56:17 -07:00
Kristian Høgsberg
e3e25dee20 glx: Fix copy/paste bug in glXWaitX and glXWaitGL
https://bugs.freedesktop.org/show_bug.cgi?id=29304
2010-07-29 18:49:10 -04:00
Kristian Høgsberg
f485ee724d glx: Compare old ctx against dummyCtx, not NULL
https://bugs.freedesktop.org/show_bug.cgi?id=29302
2010-07-29 18:49:10 -04:00
Eric Anholt
a62ef12ef2 glsl2: Make sure functions end with a return before doing ir_if_return.
This catches a few remaining functions that weren't getting inlined,
generally operating on global or out variables and using an early
return to skip work when possible.

Fixes for i965:
glsl1-function with early return (3)
2010-07-29 15:19:44 -07:00
Eric Anholt
18964618a1 glsl2: Make ir_if_return handle if () { return } else { not return }
This makes many remaining functions inlinable.

Fixes for i965:
glsl1-function with early return (1)
glsl1-function with early return (2)
2010-07-29 15:19:37 -07:00
Eric Anholt
92a3768cef glsl2: Refactor a bit of ir_if_return for the next changes. 2010-07-29 15:19:37 -07:00
Eric Anholt
806cb9f952 ir_to_mesa: Don't emit a duplicate return at the end of a function.
It was harmless, but ugly.
2010-07-29 15:19:37 -07:00
Eric Anholt
0e19922558 glsl2: Allow use of _mesa_print_ir without a parse state on hand. 2010-07-29 15:09:31 -07:00
Eric Anholt
ee4b4bab68 ir_constant_variable: Don't mark variable from outside our scope as constant.
Fixes (with software, except for alpha):
glsl1-function with early return(3)
2010-07-29 15:09:28 -07:00
Eric Anholt
bf496862be glsl2: When dumping IR for debug, indent nested blocks.
No more trying to match parens in my head when looking at the body of
a short function containing an if statement.
2010-07-29 14:38:04 -07:00
Eric Anholt
9a8eb684d4 glsl2: When dumping IR for debug, skip all the empty builtin prototypes. 2010-07-29 14:38:04 -07:00
Eric Anholt
62c4763b70 glsl2: Fix spelling of "sentinel." 2010-07-29 14:02:19 -07:00
Eric Anholt
fa33d0b854 glsl2: Fix spelling of "initializer." 2010-07-29 14:02:19 -07:00
Eric Anholt
4285247f12 glsl2: Remove an inlined unvalued return statement.
We already have asserts that it was the last call in the function, so
it's safe to remove after it got cloned in.

Fixes:
glsl-fs-functions-4.
2010-07-29 14:02:10 -07:00
Kristian Høgsberg
cd601513f5 glx: Fix linked list deletion in __glXCloseDisplay()
I hate single linked lists.
2010-07-29 16:03:44 -04:00
Kristian Høgsberg
32ea539417 intel: Declare the various tracked state variables using "extern" 2010-07-29 15:45:49 -04:00
Kristian Høgsberg
be9276d912 intel: Don't depend on context config values when picking texture formats 2010-07-29 15:45:48 -04:00
Kristian Høgsberg
e8a72460b7 egl_dri2: Set API version for DRM display 2010-07-29 15:08:00 -04:00
Marek Olšák
d8d7a3e0f9 r300g/swtcl: fix crash in ETQW and minor fixups
The Draw flush inside r300_flush was the culprit.

Also, no need to flush Draw when changing a state since the flush is
already inside swtcl_draw_vbo.
2010-07-29 20:57:18 +02:00
Marek Olšák
3f4680d8e2 r300g/swtcl: fix crash after the draw_vbo merge 2010-07-29 20:57:17 +02:00
Brian Paul
330852b3b3 llvmpipe: also test the new lp_build_assert() function 2010-07-29 12:51:45 -06:00
Brian Paul
d05cb9f018 llvmpipe: don't call LLVMCreateJITCompiler() twice
Fixes a failed assertion with LLVM 2.6:

<unnamed>::JITResolver::JITResolver(llvm::JIT&): Assertion
`TheJITResolver == 0&&  "Multiple JIT resolvers?"' failed.

Though, not everyone seems to experience this problem.
2010-07-29 12:51:45 -06:00
Brian Paul
8f3fe7e2f0 gallivm: added lp_build_assert() function to make assertions in LLVM code 2010-07-29 12:51:45 -06:00
José Fonseca
02da55676b Revert "gallivm: fix lp_build_sample_offset() crash when indexing a 1-D texture"
This reverts commit 5f90e76c54.

Bad cherry-pick.
2010-07-29 19:38:02 +01:00
Brian Paul
5f90e76c54 gallivm: fix lp_build_sample_offset() crash when indexing a 1-D texture
If y==NULL and y_stride==NULL it means the texture is 1D.  Return
zero for out_i and the offset instead of garbage.
2010-07-29 19:19:05 +01:00
Keith Whitwell
a258701cd9 util: add uint version of pack_z_stencil
Useful for packing mask values.
2010-07-29 19:15:10 +01:00
José Fonseca
bdaa8be5b7 scons: Use the current python executable for code generation.
Less susceptible to be broken.
2010-07-29 19:11:50 +01:00
José Fonseca
111902f2c4 draw: Also emit EMMS on generated LLVM IR. 2010-07-29 19:11:06 +01:00
José Fonseca
e3d2ebac11 llvmpipe: Avoid corrupting the FPU stack with MMX instructions on 32bit OSes.
Unfortunately LLVM doesn't emit EMMS itself, and there is no
easy/effective way to disable MMX.

http://llvm.org/bugs/show_bug.cgi?id=3287
2010-07-29 19:10:59 +01:00
José Fonseca
38f5b1bc38 util: Don't include xmmintrin.h.
Unnecessary.
2010-07-29 19:10:56 +01:00
Brian Paul
b4ad7c2843 mesa: implement RCC opcode 2010-07-29 08:23:59 -06:00
Brian Paul
275bae875d mesa: update table of opcodes used by GLSL 2010-07-29 08:23:33 -06:00
Andre Maasikas
9b3bf392e1 r600: since 8744c36e added asserts - use another random register for shader with no output 2010-07-29 15:18:19 +03:00
Chia-I Wu
ab25c1597d st/python: Adapt to interface change.
This is only compile tested.
2010-07-29 19:40:21 +08:00
Chia-I Wu
d4d62b6178 graw/tests: Use pipe_context::draw_vbo.
The other drawing variants such as draw_arrays or
draw_elements_instanced were removed.

This fixes fdo bug #29287.
2010-07-29 16:21:10 +08:00
Chia-I Wu
92f9b05499 gallium: Avoid void pointer arithmetic.
This fixes fdo bug #29286.
2010-07-29 15:55:14 +08:00
Vinson Lee
2bff1a08d9 mesa: Reduce arrayobj.h header file inclusion.
Directly include mtypes.h instead of including context.h to include
mtypes.h.
2010-07-28 23:16:31 -07:00
Vinson Lee
97b416eb67 mesa: Remove unnecessary header. 2010-07-28 23:07:44 -07:00
Chia-I Wu
e7f69c459a gallium/docs: Document draw_vbo and set_index_buffer.
Document the new unified drawing method and remove references to old
ones.
2010-07-29 13:45:31 +08:00
Chia-I Wu
a57f842519 gallium: Keep only pipe_context::draw_vbo.
That is, remove pipe_context::draw_arrays, pipe_context::draw_elements,
pipe_context::draw_arrays_instanced,
pipe_context::draw_elements_instanced,
pipe_context::draw_range_elements.
2010-07-29 13:45:31 +08:00
Chia-I Wu
cd3ef7592c gallium: Use unified pipe_context::draw_vbo.
Update u_draw_quad, st/vega, and st/mesa to use pipe_context::draw_vbo.
2010-07-29 13:45:31 +08:00
Chia-I Wu
6d28bf917f gallium: Implement draw_vbo and set_index_buffer for all drivers.
Some drivers define a generic function that is called by all drawing
functions.  To implement draw_vbo for such drivers, either draw_vbo
calls the generic function or the prototype of the generic function is
changed to match draw_vbo.

Other drivers have no such generic function.  draw_vbo is implemented by
calling either draw_arrays and draw_elements.

For most drivers, set_index_buffer does not mark the state dirty for
tracking.  Instead, the index buffer state is emitted whenever draw_vbo
is called, just like the case with draw_elements.  It surely can be
improved.
2010-07-29 13:45:30 +08:00
Chia-I Wu
c5e9d3114a gallium: Add pipe_context::draw_vbo and pipe_context::set_index_buffer.
This commit adds a new unified draw_vbo method to pipe_context.  Unlike
other draw methods, draw_vbo treats the index buffer as a state which is
set with set_index_buffer.
2010-07-29 13:45:30 +08:00
Vinson Lee
7e4e79be6b mesa: Remove unnecessary header. 2010-07-28 22:27:52 -07:00
Kristian Høgsberg
2c343af098 egl: Fix deref before NULL-check 2010-07-28 23:54:16 -04:00
Kristian Høgsberg
9456e22c7a intel: Implement EGL_KHR_surfaceless extension 2010-07-28 23:07:09 -04:00
Kristian Høgsberg
efd4a8cffd egl_dri2: Implement EGL_KHR_surfaceless_* extensions 2010-07-28 23:07:09 -04:00
Kristian Høgsberg
b90a3e7d8b egl: EGL_KHR_surfaceless_* extensions
These extensions allow an application to make a context current by
passing EGL_NO_SURFACE for the write and read surface in the call to
eglMakeCurrent.  The motivation is that applications that only want to
render to client API targets (such as OpenGL framebuffer objects)
should not need to create a throw-away EGL surface just to get a
current context.
2010-07-28 23:07:00 -04:00
Kristian Høgsberg
aa44bd9189 Untangle gallium/egl/glx source sharing mess and make it compile again 2010-07-28 22:18:58 -04:00
Eric Anholt
d6942460ce glsl2: Actually fix glsl-version-define. 2010-07-28 17:36:07 -07:00
Eric Anholt
d4a04f3155 glcpp: Add __VERSION__ define to the current language version.
Fixes:
glsl-version-define
glsl-version-define-110
glsl-version-define-120
2010-07-28 17:32:39 -07:00
Eric Anholt
8605c297cf glcpp: Print integer tokens as decimal, not hex. 2010-07-28 17:32:11 -07:00
Eric Anholt
192b57df8c glsl2: Make lowp, mediump, highp, and precision identifiers pre-1.20.
Fixes glsl-precision-110.
2010-07-28 17:32:11 -07:00
Jerome Glisse
42c1f27149 r600g: state context ptr in sampler_view & add I8/L8 buffer format
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-07-28 20:09:15 -04:00
Jerome Glisse
35e044ab56 r600g: switch btw flat/linear interpolation
I am not sure how to properly handle flat shading regarding
non color parameter to fragment shader. It seems we should
still interpolate non color using linear interpolation and
flat shade only apply to color.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-07-28 19:59:38 -04:00
Kenneth Graunke
35cc8b98ec glsl2/Makefile: Append to DEFINES rather than replacing them.
Otherwise, we lose DEBUG, which causes mtypes.h to set NDEBUG, which
causes assertions to not happen, which is no fun for anyone.
2010-07-28 16:48:04 -07:00
Jerome Glisse
6f0f6c6459 r600g: split pipe state creating/binding from hw state creation
Split hw vs pipe states creation handling as hw states group doesn't
match pipe state group exactly. Right now be dumb about that and
rebuild all hw states on each draw call. More optimization on that
side coming.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-07-28 19:36:16 -04:00
Eric Anholt
859fd56245 ir_to_mesa: Respect the driver if it rejects a shader. 2010-07-28 15:51:36 -07:00
Kenneth Graunke
56af4e56e3 glsl2: Fix outerProduct builtin.
The type signatures were completely backwards.
2010-07-28 15:46:29 -07:00
Kenneth Graunke
7ddee6a535 ir_constant_expression: Add support for the "outerProduct" builtin. 2010-07-28 15:46:29 -07:00
Kenneth Graunke
5d255e24b2 ir_constant_expression: Add support for the "mix" builtin.
Both 1.10 and 1.30 variants.
2010-07-28 15:46:29 -07:00
Kenneth Graunke
b09ae5dd3f ir_constant_expression: Add support for the "transpose" builtin. 2010-07-28 15:46:29 -07:00
Kenneth Graunke
546f3a2754 ir_constant_expression: Add support for the "smoothstep" builtin. 2010-07-28 15:46:29 -07:00
Kenneth Graunke
a4ca1cfb66 ir_constant_expression: Add support for the "clamp" builtin. 2010-07-28 15:46:29 -07:00
Kenneth Graunke
ff58b7c9b6 ir_constant_expression: Add support for the "step" builtin. 2010-07-28 15:46:29 -07:00
Kenneth Graunke
3d5c2f0adb ir_constant_expression: Add support for the "faceforward" builtin. 2010-07-28 15:46:29 -07:00
Kenneth Graunke
04b3643dbf ir_constant_expression: Add support for the "refract" builtin. 2010-07-28 15:46:28 -07:00
Kenneth Graunke
d60b2b03da ir_constant_expression: Add support for the "reflect" builtin. 2010-07-28 15:46:28 -07:00
Kenneth Graunke
53f306d573 ir_constant_expression: Add support for the "normalize" builtin. 2010-07-28 15:46:28 -07:00
Kenneth Graunke
8fe5f30645 ir_constant_expression: Add support for the "matrixCompMult" builtin. 2010-07-28 15:46:28 -07:00
Kenneth Graunke
a7650af706 ir_constant_expression: Simplify code that implements the "dot" builtin.
There's no need to use an ir_expression; we have a handy C function.
2010-07-28 15:46:28 -07:00
Kenneth Graunke
5489ad086f ir_constant_expression: Add support for the "length" builtin. 2010-07-28 15:46:28 -07:00
Kenneth Graunke
ffcec13599 ir_constant_expression: Extract dot product calculation for reuse. 2010-07-28 15:46:28 -07:00
Kenneth Graunke
4b1d77ea96 ir_constant_expression: Remove support for dot products of integers.
This shouldn't be required since dot is only defined for floating point
types, even in GLSL 4.0.
2010-07-28 15:46:28 -07:00
Kenneth Graunke
557827340a ir_constant_expression: Add support for the "greaterThanEqual" builtin. 2010-07-28 15:46:28 -07:00
Kenneth Graunke
7f042b9812 ir_constant_expression: Add support for the "greaterThan" builtin. 2010-07-28 15:46:28 -07:00
Kenneth Graunke
319f4949e0 ir_constant_expression: Add support for the "lessThanEqual" builtin. 2010-07-28 15:46:28 -07:00
Kenneth Graunke
6d897f07cf ir_constant_expression: Add support for the "lessThan" builtin. 2010-07-28 15:46:27 -07:00
Kenneth Graunke
48a69ba057 ir_constant_expression: Add support for the "notEqual" builtin. 2010-07-28 15:46:27 -07:00
Kenneth Graunke
0b6ef6ef6e ir_constant_expression: Add support for the "equal" builtin. 2010-07-28 15:46:27 -07:00
Kenneth Graunke
2eaf31642c ir_constant_expression: Add support for the "distance" builtin. 2010-07-28 15:46:27 -07:00
Kenneth Graunke
7bcaa3828f ir_constant_expression: Add support for the "degrees" builtin. 2010-07-28 15:46:27 -07:00
Kenneth Graunke
0afe349322 ir_constant_expression: Add support for the "radians" builtin. 2010-07-28 15:46:27 -07:00
Kenneth Graunke
20970f7dea ir_constant_expression: Add support for the "tanh" builtin. 2010-07-28 15:46:27 -07:00
Kenneth Graunke
9c9f8b2d69 ir_constant_expression: Add support for the "tan" builtin. 2010-07-28 15:46:27 -07:00
Kenneth Graunke
5d551daf38 ir_constant_expression: Add support for the "sinh" builtin. 2010-07-28 15:46:27 -07:00
Kenneth Graunke
ba4178345a ir_constant_expression: Add support for the "cosh" builtin. 2010-07-28 15:46:27 -07:00
Kenneth Graunke
13f8758e9c ir_constant_expression: Add support for "atan" builtins. 2010-07-28 15:46:27 -07:00
Kenneth Graunke
f6ea9dfe47 ir_constant_expression: Add support for "acos" builtin. 2010-07-28 15:46:27 -07:00
Kenneth Graunke
3b6c29b8f0 ir_constant_expression: Add support for "asin" builtin. 2010-07-28 15:46:26 -07:00
Kenneth Graunke
d6792a7f7c ir_constant_expression: Add support for "any" builtin. 2010-07-28 15:46:26 -07:00
Kenneth Graunke
aca7e95222 ir_constant_expression: Add support for "all" builtin. 2010-07-28 15:46:26 -07:00
Kenneth Graunke
8b1680acc3 ir_constant_expression: Implement builtins that wrap an expression.
These builtin functions are represented by ir_expression_operations, so
we can just create one of those and ask for its value.
2010-07-28 15:46:26 -07:00
Kenneth Graunke
38cb1b273f ir_constant_expression: Add support for builtins dFdx, dFdy, and fwidth.
These always return zero (the derivative of a constant).
2010-07-28 15:46:26 -07:00
Kenneth Graunke
46d91615a2 ast_function: Set constant_value on return value temporaries in 1.20+. 2010-07-28 15:46:26 -07:00
Kenneth Graunke
bafd89fa0f ir_constant_expression: Stub out support for constant builtins. 2010-07-28 15:46:26 -07:00
Kenneth Graunke
f914915d8e ir_constant_expression: Use Mesa's MIN2/MAX2 instead of our own. 2010-07-28 15:46:26 -07:00
Kenneth Graunke
f7b94f32a2 ir_algebraic: Use ir_constant::zero. 2010-07-28 15:46:26 -07:00
Kenneth Graunke
ee9a3a51b6 glsl2: Add new ir_constant::zero static method.
This conveniently creates a zero value of whatever type you want.
2010-07-28 15:46:26 -07:00
Eric Anholt
0c7b37c836 glsl2: Add the define for ARB_fragment_coord_conventions when present.
Fixes:
glsl-arb-fragment-coord-conventions-define
2010-07-28 15:00:29 -07:00
Eric Anholt
4a962170d7 glsl2: Add support for redeclaring layout of gl_FragCoord for ARB_fcc.
Fixes:
glsl-arb-fragment-coord-conventions
2010-07-28 15:00:09 -07:00
Ian Romanick
8d8469eb2a glsl2: Perform some semantic checking of ARB_fcc layout qualifiers
The rest cannot be handled until built-in variables (i.e.,
gl_FragCoord) can be redeclared to add qualifiers.
2010-07-28 14:16:12 -07:00
Ian Romanick
f50f06552e glsl2: Parser support for GL_ARB_fragment_coord_conventions 2010-07-28 14:14:38 -07:00
Eric Anholt
b706283c79 glsl2: Fail linking where the FS reads a varying that the VS doesn't write.
Fixes:
glsl1-varying read but not written
glsl1-varying var mismatch
2010-07-28 14:04:54 -07:00
Eric Anholt
a6c7606ab6 glsl2: Unmark unwritten varyings as varying.
This fixes an assertion failure in ir_to_mesa, and the varying won't
take up varying space.
2010-07-28 14:04:54 -07:00
Carl Worth
667173e362 glcpp: Add generated source files.
This is now consistent with other usage of flex/bison througout mesa,
(which is that these generated files are added to source control so
that the build system does not require external tools like flex/bison
for non-developers).
2010-07-28 13:48:32 -07:00
Carl Worth
f8a04b3877 glsl: Ignore glsl_compiler and glsl_parser.output files.
These are generated files where we can do the sane thing, and keep
them out of version control.
2010-07-28 13:48:32 -07:00
Carl Worth
e8a8f0f278 glsl: Add generated files from flex/bison.
The mesa build environment does not (currently) accept external
dependencies such as flex and bison. The compromise is to commit the
generated output files, (in spite of the pain that comes from having
generated files under version control).
2010-07-28 13:48:32 -07:00
Carl Worth
279cc22dbc glcpp: Add expected output for a recently-added test.
I simply forgot to add this file when adding the test case originally.
2010-07-28 13:48:32 -07:00
Kristian Høgsberg
6849916170 glx: Split indirect and applegl implementations into different files 2010-07-28 16:45:25 -04:00
Kristian Høgsberg
c491e585e4 glx: Move bind and unbind to context vtable 2010-07-28 16:45:25 -04:00
Kristian Høgsberg
c356f5867f glx: Rename __GLXcontext and __GLXdisplayPrivate to struct types. 2010-07-28 16:45:25 -04:00
Kristian Høgsberg
66fc35cde9 glx: Rename __GLXscreenConfigs to struct glx_screen
Because double underscores in private type names is painful.
2010-07-28 16:42:00 -04:00
Kristian Høgsberg
38c51a7653 glx: Use _X_EXPORT instead of our own PUBLIC macro
We're an X client library, so we can use Xfuncproto.h.
2010-07-28 16:42:00 -04:00
Kristian Høgsberg
65d98e2577 glx: Rename glcontextmodes.[ch] to glxconfig.[ch] 2010-07-28 16:42:00 -04:00
Kristian Høgsberg
6ddf66e923 glx: Rename __GLcontextModes to struct glx_config
With this rename, we use 'config' consitently to refer to GLX configurations
instead of the modes/configs/visual mess before.
2010-07-28 16:42:00 -04:00
Kristian Høgsberg
4f9f066485 glx: Delete unused glcontextmodes.c functions 2010-07-28 16:41:59 -04:00
Kristian Høgsberg
38765fe4c2 glx: Stop using glcore.h and glxint.h in glx
We'd like to get rid of these header files.
2010-07-28 16:41:59 -04:00
Eric Anholt
dc27e73569 ir_to_mesa: Add remaining state variable (builtin uniforms) support.
Fixes:
glsl1-GL state variable reference (diffuse product)
glsl1-GL state variable reference (gl_FrontMaterial.ambient)
glsl1-GL state variable reference (gl_LightSource[0].diffuse)
glsl1-GL state variable reference (point attenuation)
glsl1-GL state variable reference (point size)
glsl1-linear fog
2010-07-28 12:34:20 -07:00
Eric Anholt
85b5dba593 glsl2: Add the remaining builtin uniforms. 2010-07-28 12:34:08 -07:00
Eric Anholt
73df636e04 glsl2: Size builtin arrays according to the context constants.
Cleans up some of the FINISHMEs in this file.
2010-07-28 11:16:19 -07:00
Carl Worth
efef950f39 glcpp: Explicitly expect 0 shift/reduce conflicts.
The "%expect 0" construct will make bison emit an error if any future
changes to the grammar introduce shift/reduce conflicts, (without also
increasing the number after "%expect").
2010-07-28 11:10:52 -07:00
Carl Worth
2233d10442 glcpp: Remove 2 shift/reduce conflicts from the grammar.
Since we have productions to turn "defined FOO" and "defined ( FOO )"
into a conditional_token we don't need to list DEFINED as an operator
as well. Doing so just introduces the shift/reduce ambiguity with no
benefit.
2010-07-28 11:07:46 -07:00
Carl Worth
db011c8141 Avoid a compiler warning about a potentially unused variable.
There is no assignment to the "ret" variable if X_DRI2SwapBuffers is
not defined. In this case, the earlier explicit "return 0" is likely
to be used, but the compiler can't be sure of that, (nor can I for
that matter).

We cover this case by explicitly initializing "ret" to 0.
2010-07-28 10:42:46 -07:00
Carl Worth
14a3d61ea3 Avoid compiler warning for unused glx_dpy variable.
My earlier attempt to eliminate this warning (c0ca2bfb2a) was
invalid as it removed the variable declaration. Jerome correctly
reverted that (600c85efdb) since the variable is used when
X_DRI2SwapBuffers is defined.

Here, instead of removing the declaration, we move it to inside the
correct #ifdef.
2010-07-28 10:33:27 -07:00
Jerome Glisse
742ee7935d r600g: cleanup resource buffer/texture mess
Use a common function, fix the mess it was before.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-07-28 12:18:19 -04:00
Jerome Glisse
b346c4205d r600g: add lrp instruction support
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-07-28 10:35:32 -04:00
Jerome Glisse
9961a0b92d r600g: actualy fix the literal emission
Previous patch added literal emission to wrong place, we
want to emit literal before emitting a new alu group.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-07-28 09:11:14 -04:00
Vinson Lee
9b85818698 glapi: Fix VMware spelling. 2010-07-28 01:11:34 -07:00
Vinson Lee
8bae190f18 gallium/docs: Fix VMware spelling. 2010-07-28 01:09:40 -07:00
Vinson Lee
da30209afd draw: Fix VMware spelling. 2010-07-28 01:07:03 -07:00
Dave Airlie
2ab24a6fae r600g: fix up segfault with variation between views and count.
For some reason gallium hands us something with lots of empty views, and
we are expected to deal with it, just do what r300g does for this bit.
2010-07-28 15:28:18 +10:00
Corbin Simpson
0a663bb4db gallium/docs: Fix VMware spelling. 2010-07-27 21:43:00 -07:00
Dave Airlie
f514ad0a9b r600g: use gallium util for float->ui conversion 2010-07-28 11:55:09 +10:00
Vinson Lee
b172aebfdf scons: Fix sunos5 build. 2010-07-27 18:13:47 -07:00
Jerome Glisse
641c9adb09 r600g: texture support
Add texture mapping support, redbook/texbind works if
you comment out glClear and second checkboard. Need to
fix :
 - texture overwritting
 - lod & mip/map handling
 - unormalized coordinate handling
 - texture view with first leve > 0
 - and many other things

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-07-27 20:18:32 -04:00
Brian Paul
25472942c9 llvmpipe: pass face+slice to llvmpipe_unswizzle_cbuf_tile()
Cube map faces and 3D texture slices are treated the same in llvmpipe
textures.  Need to pass the sum of these fields to
llvmpipe_unswizzle_cbuf_tile() as we do elsewhere.

Fixes piglit fbo-3d test (fd.o bug 29135).
2010-07-27 17:42:27 -06:00
Vinson Lee
6a20539580 r600g: Move declaration before code.
Fixes SCons build.
2010-07-27 15:33:45 -07:00
Eric Anholt
f9b0e5e322 glsl2: When stealing var->constant_value, steal its children as well.
Fixes:
glsl1-GLSL 1.20 uniform array constructor
2010-07-27 15:25:07 -07:00
Eric Anholt
9a670c2e9b ir_to_mesa: Provide a restricted type size to _mesa_add_uniform.
Fixes:
glsl-uniform-out-of-bounds.
2010-07-27 15:10:38 -07:00
Eric Anholt
59c45e9e6c glsl2: Actually use the linked dead code eliminator.
I managed to revert the change from unlinked at some point while
cleaning up the changes.  glsl-fs-raytrace-bug27060 drops from 389
instructions to 370.
2010-07-27 14:34:53 -07:00
Jakob Bornecrantz
cc09dc2773 swrastg: Add SWRAST_NO_PRESENT option to not send updates to X server
There seem to be a problem with this path and freeglut where
the window wont open if SWRAST_NO_PRESENT is set to true.
2010-07-27 13:54:37 -07:00
Kristian Høgsberg
7d349f588a intel: Remove unused intel/server files 2010-07-27 15:22:07 -04:00
Eric Anholt
54f583a206 glsl2: Don't dereference a NULL var in CE handling during a compile error.
If an undeclared variable was dereferenced in an expression that
needed constant expression handling, we would walk off a null ir->var
pointer.

Fixes:
glsl1-TIntermediate::addUnaryMath
2010-07-27 12:10:50 -07:00
Eric Anholt
20c074ae28 ir_to_mesa: Add support for array constants.
Fixes:
glsl1-GLSL 1.20 array constructor 1
glsl1-GLSL 1.20 array constructor 2
glsl1-GLSL 1.20 array.length()
glsl1-GLSL 1.20 const array constructor 1
glsl1-GLSL 1.20 const array constructor 2
2010-07-27 12:02:11 -07:00
Eric Anholt
bf6ad0ab3d glsl2: Use ir_dead_code's linked version after linking.
glsl-fs-raytrace-bug27060 goes from 485 Mesa IR instructions to 389
before Mesa IR optimization.
2010-07-27 11:49:27 -07:00
Eric Anholt
5532c4ca69 glsl2: Fix the linked version of ir_dead_code.
If we don't walk into functions, we won't see any usage of variables
in the functions.
2010-07-27 11:46:06 -07:00
Eric Anholt
66d4c65ee2 glsl2: Make the dead code handler make its own talloc context.
This way, we don't need to pass in a parse state, and the context
doesn't grow with the number of passes through optimization.
2010-07-27 11:46:05 -07:00
Eric Anholt
8bbdf6e7cd mesa: Allow large temporary indices coming into the temporary reg allocator.
This gets glsl-vs-raytrace, glsl-fs-raytrace running on the new
compiler.
2010-07-27 11:45:27 -07:00
Eric Anholt
85cd64ee17 glsl2: Talloc type names.
Otherwise, we end up losing structure names after compile time, and
dumping IR often ends up reporting some other mysterious string.
2010-07-27 11:14:59 -07:00
Jerome Glisse
2b3b76a4a0 r600g: always emit literal after emiting an alu instruction
Make sure we always fill in the literal after alu instruction.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-07-27 13:50:11 -04:00
Eric Anholt
9a770ee49f ir_to_mesa: Set the swizzle on constant struct src regs.
MESA_GLSL=nopt now produces believable output for glsl-fs-raytrace.
2010-07-27 10:41:01 -07:00
Eric Anholt
fdbaca931a ir_to_mesa: Fix stray "break" that broke functions of >1 argument. 2010-07-27 10:08:38 -07:00
Eric Anholt
832aad989e glsl2: Add optimization pass for algebraic simplifications.
This cleans up the assembly output of almost all the non-logic tests
glsl-algebraic-*.  glsl-algebraic-pow-two needs love (basically,
flattening to a temporary and squaring it).
2010-07-27 09:43:52 -07:00
Eric Anholt
5533c6e380 ir_validate: Check the types of expression operations. 2010-07-27 09:43:52 -07:00
José Fonseca
4fbffb7d90 llvmpipe: Use lp_build_select_bitwise() where appropriate.
Fixes fdo 29269.
2010-07-27 13:09:47 +01:00
José Fonseca
2a45972fb2 gallivm: Add lp_build_select_bitwise() alternative to lp_build_select_bitwise
When

  (mask & a) | (~mask & b)

is meant instead of

   mask ? a : b
2010-07-27 13:09:46 +01:00
Eric Anholt
6a1401eb88 glsl2: Fix missing visit_continue return in ir_validate. 2010-07-27 00:18:57 -07:00
Brian Paul
fef5ae949f cell: comment-out unused fields, functions 2010-07-26 20:50:17 -06:00
Brian Paul
dd0cf2e1f5 cell: make functions static 2010-07-26 20:49:54 -06:00
Brian Paul
0315c00f58 cell: fix segfault when freeing samplers 2010-07-26 20:49:35 -06:00
Brian Paul
2a8021667d cell: comment-out unneeded padding field 2010-07-26 20:49:09 -06:00
Brian Paul
d2c714627c cell: added const qualifier 2010-07-26 20:48:46 -06:00
Brian Paul
b17ee335e3 util: fix unused function warning on non-x86 2010-07-26 20:48:29 -06:00
Eric Anholt
576d01ad8c ir_to_mesa: Fix up handling of void function returns.
void functions have a type of glsl_type::void_type, not a null type.
2010-07-26 19:41:39 -07:00
Eric Anholt
c91809e1e4 ir_to_mesa: Actually allocate the right size for constant matrix temps. 2010-07-26 19:41:23 -07:00
Eric Anholt
5b6890a388 ir_to_mesa: Add support for structure constants.
Fixes:
TPPStreamCompiler::assignOperands
2010-07-26 19:40:47 -07:00
Eric Anholt
fbaca31352 glsl2: Also steal the constant components of aggregate-typed ir_constants. 2010-07-26 19:30:19 -07:00
Kenneth Graunke
eb2cc4f1b1 glsl2: Steal ir_variable's constant_value field.
Fixes a link-time crash in glsl-vs-cross-3.
2010-07-26 19:09:10 -07:00
Eric Anholt
e2130d4e39 glsl2: Remove old .gitignore file from when we were out of tree. 2010-07-26 17:54:35 -07:00
Eric Anholt
afe125e0a1 Merge remote branch 'origin/master' into glsl2
This pulls in multiple i965 driver fixes which will help ensure better
testing coverage during development, and also gets past the conflicts
of the src/mesa/shader -> src/mesa/program move.

Conflicts:
	src/mesa/Makefile
	src/mesa/main/shaderapi.c
	src/mesa/main/shaderobj.h
2010-07-26 17:53:27 -07:00
Eric Anholt
d64343f1ae ir_to_mesa: Flag when we use the address reg.
Hardware backends will get angry otherwise.
2010-07-26 17:45:37 -07:00
Kristian Høgsberg
5403ca79b2 glx: Remove function prototypes no longer necessary 2010-07-26 17:37:59 -04:00
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
Christoph Bumiller
7d34e79e44 nv50: add missing 2nd source for POW multiplication 2010-07-26 11:21:05 +02:00
Christoph Bumiller
e1ad3bd2f2 nv50: permit usage of undefined TGSI TEMPs 2010-07-26 11:20:52 +02:00
Christoph Bumiller
a3ba99b303 nv50: fix constant_operand opt mul by 2 case 2010-07-26 11:20:39 +02:00
Christoph Bumiller
5811c69264 nv50: simple reload elimination and local CSE 2010-07-26 11:20:28 +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
Christoph Bumiller
bb9d634730 nv50: add/fix some license headers 2010-07-24 22:16:40 +02:00
Christoph Bumiller
4baaf1d4c3 nv50: change back accidentally swapped UNORM,SNORM vertex type 2010-07-24 21:20:46 +02:00
Christoph Bumiller
1d1bb20612 nv50: don't produce MOV immediate to output reg in store opt 2010-07-24 21:20:40 +02:00
Christoph Bumiller
d7aac107e6 nv50: introduce the big formats table 2010-07-24 14:48:19 +02:00
Christoph Bumiller
f3af1201c5 nouveau: update nouveau_class.h
Adds nvc0, new vertex formats, and dual source blending values.
2010-07-24 14:48:15 +02: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
Brian Paul
e393350904 st/mesa: fix bug in emit_adjusted_wpos()
If we bias x,y we still need to pass through z,w in case the shader
reads gl_FragCoord.z or .w.

Fixes fd.o bug 29183 (piglit glsl-bug-22603).

NOTE: This is a candidate for the 7.8 branch.
2010-07-23 13:42:06 -06:00
Christoph Bumiller
633f5ac612 nv50: import new compiler 2010-07-23 21:35:00 +02:00
Eric Anholt
c65f4fd5ae i965: Cleanly fail programs with unsupported array access.
This should be more useful for developers and for bug triaging than
just generating wrong code.
2010-07-23 10:54:08 -07:00
Eric Anholt
35bbbf4742 i965: Add support for VS relative addressing of temporary arrays.
Fixes glsl-vs-arrays.  Bug #27388.
2010-07-23 10:46:42 -07:00
Brian Paul
41e7347a17 draw: add small ybias factor for drawing wide points
Fixes minor rasterization error detected by some tests.
2010-07-23 10:32:58 -06:00
Brian Paul
6c3b9fa5fd docs: document new extensions for Gallium 2010-07-23 10:32:58 -06:00
Michal Krol
8122baf8ba softpipe: Check for NULL pointer in sp_destroy_tile_cache(). 2010-07-23 16:20:37 +02:00
Michal Krol
a0fc83b277 softpipe: Check for NULL pointer in sp_destroy_tex_tile_cache(). 2010-07-23 16:20:36 +02:00
Christoph Bumiller
0811b09669 nv50: implement depth clamp 2010-07-23 15:53:15 +02:00
Thomas Hellstrom
a96feddddb xorg/vmwgfx: Implement early mode pruning based on max fb size.
Also move some initialization from screen init to pre-init, now
that it is possible.

Also import a new vmwgfx drm (1.3) header.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2010-07-23 04:48:33 +02:00
Thomas Hellstrom
cec7d6a4de st/xorg: Init the Gallium3D / libkms resources in pre-init.
This makes it possible to prune modes already in pre-init.
We also keep these resources alive across server generations, and
they are implicitly closed on server exit.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2010-07-23 04:48:32 +02:00
Thomas Hellstrom
f3ddffc392 st/xorg: Kill a couple of compilation warnings
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2010-07-23 04:48:32 +02:00
Thomas Hellstrom
6ffa23b8fe st/xorg vmwgfx/xorg: Add a pre-init customizer callback
Add a customizer callback just before initial config setting, so that the
customizer code can initialize the mode validator using the drm
file-descriptor.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2010-07-23 04:48:32 +02:00
Thomas Hellstrom
a7a126bdfa st/xorg: Add a possibility to prune modes and limit fb allocation size based on max fb size.
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2010-07-23 04:48:32 +02:00
Jakob Bornecrantz
2299ff4c6b llvmpipe: Partially fix resource texture from_handle 2010-07-22 20:26:35 -07:00
Jakob Bornecrantz
dc544d87a2 llvmpipe: Don't align values already aligned 2010-07-22 20:26:35 -07:00
Jakob Bornecrantz
095e99ddf6 i915g: Rename winsys debug options 2010-07-22 20:26:35 -07:00
Jakob Bornecrantz
5ccab575fd i915g: Allow wrapping with software pipes 2010-07-22 20:26:35 -07:00
Jakob Bornecrantz
37dabfeef7 i915g: Set total_nblocksy in from_handle 2010-07-22 20:26:35 -07:00
Jakob Bornecrantz
5de2678b4e i915g: Add some debug prints in texture code 2010-07-22 20:26:35 -07:00
Jakob Bornecrantz
4eaa671052 i915g: Ifdef out debug code on non-debug builds 2010-07-22 20:26:35 -07:00
Jakob Bornecrantz
e36a082214 tgsi: Fix error message on invalid swizzle parse 2010-07-22 20:26:35 -07:00
Kristian Høgsberg
eeaab2047c glx: Drop screen argument to GetGLXDRIDrawable
We'll just get it from the returned drawable when we need it.
2010-07-22 22:36:37 -04:00
Kristian Høgsberg
7b7845a076 glx: Move WaitGL, WaitX, UseXFont to context vtable functions 2010-07-22 22:24:00 -04:00
Kristian Høgsberg
31819830b6 glx: Allocate the __GLXcontext in the DRI drivers 2010-07-22 22:16:32 -04:00
Kristian Høgsberg
ab434f6b76 glx: Use _Xglobal_lock for protecting extension display list
Avoids double locking glXLock in the X wire to event handlers.
2010-07-22 21:11:20 -04:00
Kenneth Graunke
3e882ec84a ir_constant_expression: Fix broken code for floating point modulus.
It's supposed to be x - y * floor(x/y), not (x - y) * floor(x/y).
2010-07-22 17:45:45 -07:00
Kenneth Graunke
0a71527dab glsl2: Refresh autogenerated file builtin_function.cpp. 2010-07-22 16:54:20 -07:00
Kenneth Graunke
0b8e5f384c glsl2/builtins: Add 1.30 bvec variant of the "mix" builtin. 2010-07-22 16:54:19 -07:00
Kenneth Graunke
5304c251fc glsl2/builtins: Fix 1.30 sign implementation for ints. 2010-07-22 16:50:56 -07:00
Kenneth Graunke
63a92c975d glsl2/builtins: Fix "mod" builtin to use scalar/vector operations. 2010-07-22 16:50:56 -07:00
Kenneth Graunke
0a89175a35 glsl2: Initialize ir_instruction::type and ir_rvalue::type.
Top-level instructions now get NULL as their default type (since type is
irrelevant for things like ir_function), while ir_rvalues get error_type
by default.

This should make it easier to tell if we've forgotten to set a type.  It
also fixes some "Conditional jump or move depends on uninitialized
value" errors in valgrind caused by ir_validate examining the type of
top level ir_instructions, which weren't set.
2010-07-22 16:50:37 -07:00
Kenneth Graunke
3c033637de glsl2: Make ir_assignment derive from ir_instruction, not ir_rvalue.
Assignments can only exist at the top level instruction stream; the
residual value is handled by assigning the value to a temporary and
returning an ir_dereference_variable of that temporary.
2010-07-22 16:50:37 -07:00
Kenneth Graunke
aa9f86ae8b glsl2: Fix standalone compiler to not crash horribly.
ir_to_mesa was updated for the _mesa_glsl_parse_state constructor
changes, but main.cpp was not.
2010-07-22 16:50:36 -07:00
Kenneth Graunke
40c4298a6e ir_print_visitor: Add "temporary" to mode string printing.
Variables with mode ir_var_temporary were causing an out of bounds array
access and filling my screen with rubbish.  I'm not sure if "temporary"
is the right thing to print.
2010-07-22 16:50:36 -07:00
Carl Worth
fbe4240626 glcpp: Fix function-like macros with an argument used multiple times.
It's really hard to believe that this case has been broken, but apparently
no test previously exercised it. So this commit adds such a test and fixes
it by making a copy of the argument token-list before expanding it.

This fix causes the following glean tests to now pass:

	glsl1-Preprocessor test 6 (#if 0, #define macro)
	glsl1-Preprocessor test 7 (multi-line #define)
2010-07-22 16:38:12 -07:00
Eric Anholt
a0879b9dd4 glsl2: Put side effects of the RHS of logic_or in the right branch.
Kind of missing the point to only do the side effects if the LHS
evaluates as true.

Fixes:
glsl1-|| operator, short-circuit
2010-07-22 16:34:36 -07:00
Eric Anholt
432b787b29 glsl2: Validate that ir_if conditions are actually bool. 2010-07-22 16:24:49 -07:00
Eric Anholt
85e93da18c ir_to_mesa: Fix the swizzles on record and array dereferences.
Fixes:
glsl1-struct (1)
glsl1-struct (2)
glsl1-struct (3)
glsl1-struct (4)
2010-07-22 16:17:57 -07:00
Eric Anholt
9703ed05e6 glsl2: When setting the size of an unsized array, set its deref's size too. 2010-07-22 15:56:07 -07:00
Brian Paul
c20a3628c7 glsl: remove invalid _mesa_problem() call
Fixes fd.o bug 29206.
2010-07-22 16:35:46 -06:00
Eric Anholt
c3081e6273 glsl2: Set the type on cloned tex instructions. 2010-07-22 15:34:01 -07:00
Eric Anholt
a711ad6bf2 glsl2: Add the API defines to the glsl2 build so we get the right GLcontext
Fixes:
draw_buffers-08.frag
draw_buffers-09.frag
glsl-vs-texturematrix-2
2010-07-22 15:22:57 -07:00
Brian Paul
815e79e72c draw: re-order optimization passes depending on LLVM version, 32/64-bit
This is a work-around for an apparent bug in LLVM seen with piglit's
glsl-vs-sqrt-zero test.
2010-07-22 16:09:03 -06:00
Eric Anholt
1bef4c8c4b glsl2: Fix builtin prototypes defined in multiple glsl/builtins/* files
If we put the protos in separate ir_functions, they wouldn't be found
at lookup time for linking.

Fixes:
glsl-fs-texture2d-bias
glsl-fs-texture2dproj-bias
glsl-fs-texture2dproj-bias-2
glsl-lod-bias
glsl1-texture2D(), computed coordinate
2010-07-22 15:03:40 -07:00
Carl Worth
47c90b1447 glsl2: Fix expected type for multiplying vector with non-square matrix.
Previously, the compiler expected the result of the multiplication to
be of the same type as the vector. This is correct for square
matrices, but wrong for all others.

We fix this by instead expecting a vector with the same number of rows
as the matrix (for the case of M*v with a column vector) or the same
number of columns as the matrix (for v*M with a row vector).

This fix causes the following four glean tests to now pass:

	glsl1-mat4x2 * vec4
  	glsl1-vec2 * mat4x2 multiply
  	glsl1-vec3 * mat4x3 multiply
  	glsl1-vec4 * mat3x4 multiply
2010-07-22 14:59:06 -07:00
Eric Anholt
e65dfa89ee glsl2: Fix the type of (1.0 - arg2) for mix(gen, gen, float).
Previously, we'd constant-fold up a value of vec4(1.0 - arg2, 0, 0, 0).

Fixes:
glsl1-mix(vec4) function
2010-07-22 14:25:26 -07:00
Eric Anholt
8ec0b8187e glsl2: When inlining, don't clone and assign sampler arguments.
Instead, just use the incoming sampler param.  Fixes many texture-using
piglit tests since the linker rework.
2010-07-22 13:58:32 -07:00
Eric Anholt
2d1ed7b1b1 glsl2: When a "continue" happens in a "for" loop, run the loop expression.
Fixes:
glsl1-for-loop with continue

Bug #29097
2010-07-22 13:02:40 -07:00
Eric Anholt
748c343f8b ir_to_mesa: Pretty up the printing of MESA_GLSL=dump 2010-07-22 12:37:43 -07:00
Eric Anholt
cc15ef07e0 mesa: Only complain about an infinite loop in a swrast program once.
Chances are, if one fragment looped badly, others will too, and
debugging output gets overwhelmed by the looping complaints.
2010-07-22 12:16:11 -07:00
Eric Anholt
c8d0a9f006 ir_to_mesa: Add support for MESA_GLSL=dump environment var. 2010-07-22 12:11:36 -07:00
Brian Paul
ca3238f3fc draw: added new assertions to clipping code 2010-07-22 11:18:54 -06:00
Eric Anholt
63ba1ec3c1 i965: Respect VS/VP point size result when enabled.
Fixes glsl-vs-point-size.
2010-07-22 10:06:55 -07:00
Eric Anholt
4ea71cbd0e i965: Fix the disasm output for da16 src widths.
This has confused me twice now.  It's a fixed width of 4 (usually a
region description of <4,4,1>), not 1.  If it was 1, we'd have been
skipping all over register space.
2010-07-22 10:06:55 -07:00
Eric Anholt
86fb92f59c i965: Avoid extra MOV in VS indirect register reads. 2010-07-22 10:06:55 -07:00
Eric Anholt
b69ef5744a i965: Fix up VS temporary array access for fixed index offset != 0. 2010-07-22 10:06:55 -07:00
Henri Verbeet
2fdff50999 r600: Flip point sprite coordinates when rendering to an FBO.
This supersedes http://lists.freedesktop.org/archives/mesa-dev/2010-July/001442.html.
2010-07-22 11:10:11 -04:00
Eric Anholt
7095e2f860 glsl2: Use talloc on InfoLog handling in ValidateProgram
Fixes a segfault in Regnum Online.
2010-07-21 23:21:23 -07:00
Eric Anholt
c686ee0fa7 i965: In the VS, multiply the address reg by the appropriate register size.
The ARL value is increments of vec4 in the register file.  But
PROGRAM_TEMPORARY or PROGRAM_INPUT are stored as vec4s interleaved
between the two verts being executed (thus a vec8 each), compared to
PROGRAM_STATE_VAR being packed vec4s.

Fixes:
glsl-vs-arrays-2
glsl-vs-mov-after-deref
(without regressing glsl-vs-arrays-3)
2010-07-21 22:05:30 -07:00
Eric Anholt
21eaa62ba4 i965: Clean up brw_dp_READ_4_vs() now that it has fewer options to support. 2010-07-21 20:17:24 -07:00
Eric Anholt
96b11f1e3e i965: Support relative addressed VS constant reads using the appropriate msg.
The previous support was overly complicated by trying to use the same
1-OWORD message for both offsets.
2010-07-21 20:17:24 -07:00
Eric Anholt
9e9e87a9b2 i965: Fix the DP read msg_control definitions other than plain OWORD. 2010-07-21 20:17:24 -07:00
Eric Anholt
d0326e0e4e i965: Clean up dead code from the VS get_constant/get_reladdr_constant split. 2010-07-21 20:17:24 -07:00
Eric Anholt
04de6861c1 i956: Set the execution size correctly for scratch space writes.
Otherwise, the second half isn't written, and we end up reading back
black.

Fixes the remaining junk drawn in glsl-max-varyings, and will likely
help with a number of large real-world shaders.
2010-07-21 20:17:24 -07:00
Eric Anholt
ff81a1dd92 i965: Set the GEM domain flags for the scratch space.
They go into the render cache, so while we don't care about their
contents after execution, failing to note them could cause the writes
to be flushed over important buffer contents later.
2010-07-21 20:17:24 -07:00
Eric Anholt
a3bfb2f755 i965: Use the pretty define for 4-oword DP reads. 2010-07-21 20:17:24 -07:00
Eric Anholt
d2f3eac8ff i965: Set the send commit bit on register spills as required pre-gen6.
Otherwise, the subsequent read may not get the written value.
2010-07-21 20:17:24 -07:00
Eric Anholt
0ecf5128a4 i965: Add disasm for dataport reads (register unspilling). 2010-07-21 20:17:24 -07:00
Kristian Høgsberg
7a66e54958 glx: Move last few dri_interface.h types out of glxclient.h and drop include 2010-07-21 22:17:24 -04:00
Kristian Høgsberg
f679640868 glx: Move __driContext field out of __GLXcontextRec 2010-07-21 22:17:24 -04:00
Kenneth Graunke
e9384d1d7f glsl2: Update TODO. 2010-07-21 16:38:33 -07:00
Kenneth Graunke
9a6d40fbfb ir_constant_expression: Add support for array == and !=.
Piglit parser tests const-array-03.frag and const-array-04.frag now
generate the correct code.
2010-07-21 16:38:33 -07:00
Kenneth Graunke
a096fa7476 ir_constant_expression: Add support for constant arrays.
Fixes piglit test const-array-02.frag.
2010-07-21 16:38:33 -07:00
Kenneth Graunke
ef2c38b245 ir_reader: Add support for reading constant arrays. 2010-07-21 16:38:33 -07:00
Kenneth Graunke
9930d18c2a ir_print_visitor: Print out constant arrays. 2010-07-21 16:38:33 -07:00
Kenneth Graunke
7ea977a15c ir_print_visitor: Remove commas between ir_constant's components.
The IR reader does not expect commas.
2010-07-21 16:38:33 -07:00
Kenneth Graunke
74e1802f5d glsl2: Extend ir_constant to store constant arrays, and generate them.
Since GLSL permits arrays of structures, we need to store each element
as an ir_constant*, not just ir_constant_data.

Fixes parser tests const-array-01.frag, const-array-03.frag,
const-array-04.frag, const-array-05.frag, though 03 and 04 generate the
wrong code.
2010-07-21 16:38:33 -07:00
Kenneth Graunke
13a19745d4 glsl2: Emit array constructors inline. 2010-07-21 16:38:32 -07:00
Kenneth Graunke
e1d71850fa ast_to_hir: Fix bug in constant initializers.
Implicit conversions were not being performed, nor was there any
type checking - it was possible to have, say, var->type == float
and var->constant_value->type == int.  Later use of the constant
expression would trigger an assertion.

Fixes piglit test const-implicit-conversion.frag.
2010-07-21 16:38:32 -07:00
Kenneth Graunke
46d6b8d1ba ir_constant_expression: Add support for ir_unop_u2f.
Also make ir_unop_i2f only operate on signed integers.
2010-07-21 16:38:32 -07:00
Kenneth Graunke
3163f87463 ir_constant_expression: Remove open coded equality comparisons.
The ir_constant::has_value method already does this.
2010-07-21 16:38:32 -07:00
Kenneth Graunke
0048c7aef8 glsl2: Add some comments. 2010-07-21 16:37:57 -07:00
Kenneth Graunke
c7a18da690 glsl2: Replace insert_before/remove pairs with exec_node::replace_with. 2010-07-21 16:37:57 -07:00
Ian Romanick
d5be2acae3 linker: Link built-in functions instead of including them in every shader
This is an invasive set of changes.  Each user shader tracks a set of other
shaders that contain built-in functions.  During compilation, function
prototypes are imported from these shaders.  During linking, the
shaders are linked with these built-in-function shaders just like with
any other shader.
2010-07-21 15:52:58 -07:00
Ian Romanick
4ccd3c548b glsl2: Add function to import function prototypes from one IR tree to another 2010-07-21 15:52:58 -07:00
Brian Paul
7cd6a6cc99 softpipe: add missing support for PIPE_FORMAT_S8_USCALED surfaces
And remove checks of surface depth bits.  The state tracker should
not turn on depth/stencil testing if the framebuffer doesn't have
depth/stencil.
2010-07-21 16:52:01 -06:00
Brian Paul
ef2d10cd45 softpipe: fix sp_tile_cache_flush_clear() regression 2010-07-21 16:00:52 -06:00
Jerome Glisse
600c85efdb Revert "dri2: Remove an unused variable."
glx_info is used if X_DRI2SwapBuffers is defined
This reverts commit c0ca2bfb2a.
2010-07-21 17:40:37 -04:00
Jerome Glisse
0bca8fbfda r600g: add support for all R6XX/R7XX asic
This configure some of the value properly based on
asic so others asic than RV710 works too.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-07-21 17:05:37 -04:00
Dave Airlie
4b2820534e r600g: add r600 compile mode to compiler.
some of the ALU instructions are different on r6xx vs r7xx,
separate the alu translation to separate files, and use family
to pick which compile stage to use.
2010-07-21 17:05:37 -04:00
Dave Airlie
9433d0e801 r600g: add family retrival
allow pipe driver to get the family of the gpu.
2010-07-21 17:05:36 -04:00
Marek Olšák
1a3fa3e910 llvmpipe: say no to depth clamp
The other drivers just return 0 without the assert.
2010-07-21 22:54:34 +02:00
Marek Olšák
ca7ead03da r300g: implement depth clamp
Depth clamping seems to be implicit if clipping is disabled.

It's not perfect, but it's good enough for wine and passes
the corresponding piglit tests.
2010-07-21 22:54:34 +02:00
Marek Olšák
5725738ef6 r300g: cleanup clip state emission 2010-07-21 22:54:34 +02:00
Marek Olšák
9ca48de106 draw: disable depth clipping if depth clamp is enabled 2010-07-21 22:54:34 +02:00
Marek Olšák
c304869ec0 st/mesa: implement depth clamp 2010-07-21 22:54:34 +02:00
Marek Olšák
4460e9f0a1 cso: handle depth clamp 2010-07-21 22:54:34 +02:00
Marek Olšák
f47c9b0880 gallium: add depth clamp to the interface 2010-07-21 22:54:34 +02:00
Carl Worth
56d33f8e2b ir_to_mesa: Add missing initializion of lod_info variable.
To quiet a compiler warning.
2010-07-21 13:52:33 -07:00
Carl Worth
a0cfe8c440 glsl: Fix missing initialization of yylloc.source
In both the preprocessor and in the compiler proper, we use a custom
yyltype struct to allow tracking the source-string number in addition
to line and column. However, we were previously relying on bison's
default initialization of the yyltype struct which of course is not
aware of the source field and leaves it uninitialized.

We fix this by defining our own YYLLOC_DEFAULT macro expanding on the
default version (as appears in the bison manual) and adding
initialization of yylloc.source.
2010-07-21 13:52:33 -07:00
Carl Worth
19e3771cff Add missing initialization of inOutFlags pointer.
This quiets a compiler warning, (and ensures a segmentation fault rather
than memory corruption if this variable is written through before being
initialized elsewhere).
2010-07-21 13:26:26 -07:00
Carl Worth
9d1a61efbe Makefiles: Don't complain if depend file to be included doesn't exist.
While bootstrapping the dependencies, make will see the "include depend"
directive before the depend file has been created. To avoid a spurious
warning in this case we use "-include" instead, (which differs precisely
in the fact that it will not emit a diagnostic if the named file does
not exist).
2010-07-21 13:19:33 -07:00
Carl Worth
171a25eaba i965: Remove an unused variable.
To quiet a compiler warning.
2010-07-21 13:17:22 -07:00
Carl Worth
c0ca2bfb2a dri2: Remove an unused variable.
To quiet a compiler warning.
2010-07-21 13:17:05 -07:00
Carl Worth
349fa9ced7 Regenerate program/lex.yy.c
Based on the two recent changes to program_lexer.l.
2010-07-21 13:13:46 -07:00
Carl Worth
b4a08a0d87 Avoid more warnings in flex-generated code.
This avoids two "function defined but not used" warnings. For the yyinput
function we define YY_NO_INPUT which tells flex to simply not generate this
function.

For unput, we add a call to this function, but inside a while(0) so
that it will quiet the warning without actually changing any
functionality.
2010-07-21 13:11:46 -07:00
Carl Worth
3c716a7ec2 Avoid warnings in flex-generated code.
Add declarations for two functions generated in the flex ouput. It
would be nicer if flex simply declared these generated functions as
static, but for now we can at least avoid the warning this way.
2010-07-21 12:49:01 -07:00
Carl Worth
c24bcad9f8 glsl: Correctly handle unary plus operator.
Previously, any occurence of the unary plus operator would trigger a
bogus type mismatch error. Fix this by making the ast_plus case look
more like the ast_neg case as far as type-checking is concerned.

With this change the shaders/CorrectPreprocess8.frag test in piglit
now passes.
2010-07-21 11:42:27 -07:00
Brian Paul
aa9003e20e draw: tweak aa line width threshold and sampling
Set sampler max_lod to avoid sampling the 1x1 and 2x2 mipmap levels.

Fixes piglit line-aa-width test, fd.o bug 29160.
2010-07-21 11:38:43 -06:00
Patrice Mandin
c052213fb3 nouveau/nvfx: Add new PIPE_CAP values
Signed-off-by: Patrice Mandin <patmandin@gmail.com>
2010-07-21 19:28:45 +02:00
Brian Paul
3662afd87d gallivm: replace has_indirect_addressing field with indirect_files field
Instead of one big boolean indicating indirect addressing, use a
bitfield indicating which register files are accessed with indirect
addressing.

Most shaders that use indirect addressing only use it to access the
constant buffer.  So no need to use an array for temporary registers
in this case.
2010-07-21 10:16:32 -06:00
Brian Paul
85206e56a1 tgsi: added tgsi_shader_info::indirect_files field
Indicates which register files are accessed with indirect addressing.
2010-07-21 10:16:32 -06:00
Brian Paul
0115f07507 gallivm: refactor code into get_indirect_offsets() function 2010-07-21 10:16:32 -06:00
Brian Paul
890976e02d gallivm: added comment 2010-07-21 10:16:32 -06:00
Brian Paul
be22e1e781 gallivm: remove extraneous braces 2010-07-21 10:16:32 -06:00
Brian Paul
f674ed6b06 gallivm: no longer do indirect addressing in get_temp_ptr() 2010-07-21 10:16:32 -06:00
Brian Paul
105ed7dfd4 gallivm: implement correct indirect addressing of temp registers
As with indexing the const buffer, the ADDR reg may have totally
different values for each element.  Need to use a gather operation.
2010-07-21 10:16:32 -06:00
Brian Paul
695814a15b gallivm: re-org, comments for get_temp_ptr() 2010-07-21 10:16:31 -06:00
Brian Paul
6921a6dd4e draw: whitespace clean-up 2010-07-21 10:16:31 -06:00
Keith Whitwell
d350695a6b gallium: remove pointless bitfield restrction in pipe_vertex_element
This used to be a somewhat packed struct, but no longer.  Remove the
last remaining bitfield tag.
2010-07-21 16:30:38 +01:00
Brian Paul
ec0e7b16bb gallivm: rename a var to avoid compiler warnings 2010-07-21 08:08:12 -06:00
Brian Paul
4363d4d0b9 gallivm: fix indirect addressing of constant buffer
The previous code assumed that all elements of the address register
were the same.  But it can vary from pixel to pixel or vertex to
vertex so we must use a gather operation when dynamically indexing
the constant buffer.

Still need to fix this for the temporary register file...
2010-07-20 18:50:35 -06:00
Brian Paul
b0636f78aa gallivm: added lp_build_const_int32() helper 2010-07-20 18:50:35 -06:00
Ian Romanick
f38d15b80d glsl2: glsl_type has its own talloc context, don't pass one in 2010-07-20 17:48:25 -07:00
Ian Romanick
a7ba9a7919 linker: Do post-link lowering and optimization
The lowering code should probably be moved elsewhere.
2010-07-20 17:48:24 -07:00
Ian Romanick
60e2d06d1c glsl2: Implement utility routine to talloc reparent an IR tree 2010-07-20 17:48:24 -07:00
Ian Romanick
2462a536ea glsl2: Add a constructor for _mesa_glsl_parse_state
Coming changes to the handling of built-in functions necessitate this.
2010-07-20 17:48:24 -07:00
Ian Romanick
7e2aa91507 glsl2: Add and use new variable mode ir_var_temporary
This is quite a large patch because breaking it into smaller pieces
would result in the tree being intermitently broken.  The big changes
are:

    * Add the ir_var_temporary variable mode

    * Change the ir_variable constructor to take the mode as a
      parameter and correctly specify the mode for all ir_varables.

    * Change the linker to not cross validate ir_var_temporary
      variables.

    * Change the linker to pull all ir_var_temporary variables from
      global scope into 'main'.
2010-07-20 17:48:24 -07:00
Eric Anholt
1124e5a3cb ir_to_mesa: Validate the linked shaders as well.
This caught the failure in cloning of ir_dereference_record.
2010-07-20 17:30:11 -07:00
Eric Anholt
f141fa63a4 glsl2: Check that nodes in a valid tree aren't error-type.
We're good at propagating error types around, but finding when the
first one was triggered can be painful if we aren't paying attention.
2010-07-20 17:30:10 -07:00
Eric Anholt
fade78edcb glsl2: strdup the field names used in dereference_record.
Otherwise, after linking and freeing the old data, the pointer would
dangle.  Partial fix for glsl1-struct*.
2010-07-20 17:30:10 -07:00
Eric Anholt
21b0dbd799 glsl2: talloc the glsl_struct_field[] we use to look up structure types.
Since the types are singletons across the lifetime of the compiler,
repeatedly compiling a program with the same structure type defined
would drop a copy of the array on the floor per compile.

This is a bit tricky because the static GLSL types are not called with
the talloc-based new, so we have to use the global type context, which
may not be initialized yet.
2010-07-20 17:30:10 -07:00
Eric Anholt
b6e92ad7da glsl2: Don't claim a match on structure types with different field names.
We regularly do lookups on the field names of the structure to find
the types within the struct, so returning a structure type with bad
names will lead to lots of error types being found.
2010-07-20 17:30:10 -07:00
Kenneth Graunke
094cf8c199 glsl2: Add support for the .length() method on arrays.
Fixes piglit test glsl-array-length, and provides proper error messages
for negative piglit tests array-length-110.frag, array-length-unsized.frag,
and array-length-args.frag.
2010-07-20 17:13:17 -07:00
Kenneth Graunke
1036a7ebae glsl2: Remove incorrect assertion in the parser.
This assertion is triggered by method calls (i.e. array.length()), where
subexpressions[1] is an ast_function_call expression.  Since the
assertion itself had a comment saying it could be removed eventually,
simply do so.

Causes negative glslparser tests array-length-110.frag,
array-length-args.frag, and array-length-unsized.frag to pass, but only
because the length() method is not supported yet.
2010-07-20 17:13:17 -07:00
Kenneth Graunke
2b7c42b40a glsl2: Disallow non-constant array indexing for unsized arrays.
Fixes piglit test unsized-array-non-const-index.vert.
2010-07-20 17:13:17 -07:00
Kenneth Graunke
e4768eecd5 ir_constant_expression: Remove pointless use of variable_referenced.
ir_dereference_variable always references an ir_variable, so there's no
point in calling a function and NULL-checking the result.
2010-07-20 17:10:05 -07:00
Kenneth Graunke
98f32a13be ir_constant_expression: Use "this" pointer directly.
In ir_expression's signature, I replaced ir->operands[i] with op[i] as
it is more concise; an assertion already ensures these are equal.
2010-07-20 17:10:05 -07:00
Kenneth Graunke
fb2ffd2846 ir_constant_expression: Convert from a visitor to a virtual function.
The constant_expression_wrapper was already the only external API, and
much of the internal code used it anyway.  Also, it wouldn't ever visit
non-rvalue ir_instructions, so using a visitor seemed a bit unnecessary.

This uses "ir_foo *ir = this;" lines to avoid code churn.  These should
be removed.
2010-07-20 17:10:05 -07:00
Kenneth Graunke
e340854115 glsl2: Move constant_expression_value method to ir_rvalue.
This prevents top-level callers from asking for the value of something
that is guaranteed not to have one.
2010-07-20 17:10:05 -07:00
Carl Worth
e1acbfca32 glcpp: Avoid accidental token pasting in preprocessed result.
Consider this test case:

	#define EMPTY
	int foo = 1+EMPTY+4;

The expression should compile as the sequence of tokens 1, PLUS,
UNARY_POSITIVE, 4. But glcpp has been failing for this case since it
results in the string "1++4" which a compiler correctly sees as a
syntax error, (1, POST_INCREMENT, 4).

We fix this by changing any macro with an empty definition to result
in a single SPACE token rather than nothing. This then gives "1+ +4"
which compiles correctly.

This commit does touch up the two existing test cases which already
have empty macros, (to add the space to the expected result).

It also adds a new test case to exercise the above scenario.
2010-07-20 17:01:12 -07:00
Carl Worth
942ccc5170 glcpp: Add missing include in xtalloc.c
Without this, the compiler was legitimately complaining about missing
declarations for all of the functions being defined here.
2010-07-20 17:01:12 -07:00
Carl Worth
d80dcaf427 glcpp: Add static keyword to several functions in the parser.
This quiets warnings about missing declarations otherwise.
2010-07-20 17:01:11 -07:00
Carl Worth
fb90560744 glcpp: Avoid warnings in generated flex code.
We define the YY_NO_INPUT macro to avoid one needless function being
generated.

for the other needless functions, (yyunput and yy_top_state), we add a
new UNREACHABLE start condition and call these functions from an
action there. This doesn't change functionality at all, (since we
never enter the UNREACHABLE start condition), but makes the compiler
stop complaining about these two functions being defined but not used.
2010-07-20 17:01:11 -07:00
Carl Worth
a9bb4bcde3 glcpp-lex: Declare some generated functions to eliminate compiler warnings.
It's really a bug in flex that these functions are generated with neither
a declaration nor the 'static' keyword, but we can at least avoid the
warnings this way.
2010-07-20 17:01:11 -07:00
Carl Worth
1d7e03e48e glcpp: Fix support for nested #ifdef and nested #ifndef
Previously, if the outer #ifdef/#ifndef evaluated to false, the inner
directive would not be parsed correctly, (the identifier as the subject
of the #ifdef/#ifndef would inadvertently be skipped along with the other
content correctly being skipped).

We fix this by setting the lexing_if state in each case here.

We also add a new test to the test suite to ensure that this case is tested.
2010-07-20 17:01:11 -07:00
Carl Worth
17f9beb6c3 glcpp: Support #if(expression) with no intervening space.
And add a test case to ensure that this works.
2010-07-20 17:01:11 -07:00
Carl Worth
61ebc01dfe glcpp: Fix use-after-free error from #undef directive.
By taking advantage of the recently-added hash_table_remove function.

With this change, all existing tests are now valgrind-clean.
2010-07-20 17:01:11 -07:00
Carl Worth
d4f239de6e hash_table: Add new hash_table_remove function.
To allow for the removal of a single element from a hash table.
2010-07-20 17:01:11 -07:00
Carl Worth
d1500f8a19 glcpp: Make test suite test for valgrind cleanliness.
As it turns out, 4 of our current tests are not valgrind clean,
(use after free errors or so), so this will be helpful for
investigating and fixing those.
2010-07-20 17:01:11 -07:00
Carl Worth
3a530b8ef6 glcpp: Make test suite report final count of passed/total tests.
And report PASS or FAIL for each test along the way as well.
2010-07-20 17:01:11 -07:00
Carl Worth
41d525f2df Build a standalone glcpp binary.
This is convenient for testing the preprocessor independent of the rest of
mesa, (just run glcpp-test in the src/glsl/glcpp/tests).
2010-07-20 17:01:11 -07:00
Carl Worth
f15e27ec1d glcpp: Delete copies of hash_table.c, hash_table.h, and other headers.
These were only ever intended to exist in the original, standalone
implementation of glcpp, (with the idea of dropping them as soon as
the code moved into mesa). The current build system wasn't compiling
this C file, but the presence of the header files could cause problems
if the two copies diverge in the future.

We head those problems off by deleting al of these redundant files.
2010-07-20 17:01:11 -07:00
Eric Anholt
325a49701f glsl2: Fix handling of out values in function inlining.
The parameters[i] is our inlined variables representing the
parameters, so they are always ir_var_auto.  Walk the signature params
in handling "out" values like we do for "in" values to find the mode.

Fixes (with the previous 2 commits):
glsl1-function call with in, out params
glsl1-function call with inout params
2010-07-20 16:21:07 -07:00
Eric Anholt
2927c81ed1 glsl2: Don't mark a variable as constant if it was used as an out param. 2010-07-20 15:59:04 -07:00
Eric Anholt
02d3711a21 glsl2: Always insert function calls into the instruction stream.
If they have a return value, this means putting it into a temporary
and making a deref of the temp be the rvalue, since we don't know if
the rvalue will be used or not.
2010-07-20 15:59:04 -07:00
Vinson Lee
c4889fa5f0 radeon: Remove unnecessary header. 2010-07-20 14:18:42 -07:00
Eric Anholt
f8946699ec glsl2: Add definitions of the builtin constants present in GLSL 1.10.
Fixes:
glsl1-built-in constants
2010-07-20 14:03:35 -07:00
Eric Anholt
1245babe0c glsl2: Fix asin() implementation.
I'd flipped around the order of two operations in paren-balancing
adventures, and left out the multiply by sign(x) required for negative x.

Fixes:
glsl1-acos(vec4) function
glsl1-asin(vec4) function
glsl1-atan(vec4) function
2010-07-20 12:24:01 -07:00
Jerome Glisse
62f8b56dc6 r600g: split trans unit computation
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-07-20 15:07:32 -04:00
Eric Anholt
117d154b4d glsl2: notEqual() produces a boolean value, not the base type of the args.
Fixes:
glsl1-vector relational (bvec2 ==,!=)
glsl1-vector relational (vec4 !=)
2010-07-20 12:01:40 -07:00
Eric Anholt
14f8e16132 glsl2: Constant-fold assignment conditions. 2010-07-20 12:01:40 -07:00
Ian Romanick
5a2e0b8ce5 glsl2: Don't validate IR if there were compilation errors 2010-07-20 11:38:54 -07:00
Eric Anholt
18ab797d3a ir_to_mesa: Fix swizzled writemasks with swapped component ordering.
I hadn't noticed you could do this, but glsl1 tests caught it.  Fixes:
glsl1-Swizzled writemask
glsl1-Swizzled writemask (2)
glsl1-Swizzled writemask (rgba)
glsl1-Swizzled writemask (stpq)
2010-07-20 11:28:33 -07:00
Marek Olšák
5ed6627ceb st/mesa: implement and advertise GL_ARB_draw_elements_base_vertex
Signed-off-by: Brian Paul <brianp@vmware.com>
2010-07-20 11:53:43 -06:00
Brian Paul
691c1fb074 draw: correctly handle max_index=0xffffffff case in vcache code
If max_index=0xffffffff and elt_bias > 0 the test for
elt_bias + max_index >= DRAW_PIPE_MAX_VERTICES
was wrong.  Check earlier if max_index=0xffffffff and do the
"fail" case.

This fixes the piglit draw-elements-base-vertex test (and probably
some other things).
2010-07-20 11:53:43 -06:00
Marek Olšák
e794fac35a st/mesa: implement depth texture modes 2010-07-20 18:09:12 +02:00
Brian Paul
bab484a59b mesa: call ctx->Driver.ChooseTextureFormat() only when necessary.
When defining mipmap level 'L' and level L-1 exists and the new level's
internalFormat matches level L-1's internalFormat, then use the same hw
format.  Otherwise, do the regular ctx->Driver.ChooseTextureFormat() call.

This avoids a problem where we end up choosing different hw formats for
different mipmap levels depending on how the levels are defined (glTexImage
vs. glCopyTexImage vs. glGenerateMipmap, etc).

The root problem is the ChooseTextureFormat() implementation in some
drivers uses the user's glTexImage format/type parameters in the choosing
heuristic.  Later mipmap levels might be generated with different calls
(ex: glCopyTexImage()) so we don't always have format/type info and the
driver may choose a different format.

For more background info see the July 2010 mesa-dev thread "Bug in
_mesa_meta_GenerateMipmap"
2010-07-20 08:50:32 -06:00
Brian Paul
895086467e graw/tests: pass -e option to test draw_elements_instanced() 2010-07-20 08:50:32 -06:00
Michal Krol
3b2ca688a7 softpipe: Support non-depth-stencil formats in sp_tile_cache_flush_clear(). 2010-07-20 15:01:25 +02:00
Kristian Høgsberg
c1cbdbfde0 glx: #ifdef DRI specific prototype
https://bugs.freedesktop.org/show_bug.cgi?id=29162
2010-07-20 07:43:50 -04:00
Michel Dänzer
bd3d2724f5 glx/dri2: Fix dri2CopySubBuffer() again.
Only refresh the fake front buffer if there is one, and only destroy the region
once.

Fixes X11 protocol errors reported by 'mcgreg' on IRC.
2010-07-20 12:21:17 +02:00
Marek Olšák
bdde9d2fce util: mempool: initialize last block's magic number in a page 2010-07-20 10:23:54 +02:00
Chia-I Wu
87290a383b st/egl: Fixes for recent GLX cleanup.
Mainly, the type of __GLXdisplayPrivateRec::screenConfigs has changed
from "__GLXscreenConfigs *" to "__GLXscreenConfigs **".
2010-07-20 12:39:23 +08:00
Chia-I Wu
c7ad2a4e79 st/dri: Remove driFrameTrackingExtension.
The extension has been removed in
22266c391f.
2010-07-20 12:37:13 +08:00
Kristian Høgsberg
a7292f2920 glx: Move DRI CopySubBuffer extension to DRI1 code
We do this in the X server for DRI2.
2010-07-19 22:45:51 -04:00
Kristian Høgsberg
bab13969d8 glx: Move driver_configs to DRI screen privates 2010-07-19 22:45:51 -04:00
Kristian Høgsberg
e3e8196c02 glx: Move drawHash to display private
The XIDs are display wide so the natural location of the hash is here.
This way we don't have to lookup in each of the screen hashes.
2010-07-19 22:45:51 -04:00
Kristian Høgsberg
037755122e glx: Don't use __glXInitialize() when we might be holding __glXLock() 2010-07-19 22:45:51 -04:00
Kristian Høgsberg
8d0228912b glx: Workaround mismatch in signedness between extensions and protocol
The DRI2 protocol for ust, msc and sbc are unsigned but the extensions
talk about int64_t.  Do a little dance to make the compiler shut up.
2010-07-19 22:45:50 -04:00
Kristian Høgsberg
271c3c3a90 glx: Move __DRIdrawable pointers to DRI drawable privates 2010-07-19 22:45:50 -04:00
Kristian Høgsberg
22266c391f glx: Remove support for MESA_swap_frame_usage
The extension never worked, the implementation returns GLX_BAD_CONTEXT
when enabling the frame tracking.
2010-07-19 22:45:50 -04:00
Kristian Høgsberg
70887d5172 glx: Move __driScreen into the dri screen privates 2010-07-19 22:45:50 -04:00
Kristian Høgsberg
089fc37c6f glx: Move DRI1 specific extensions and code to DRI1 screen private 2010-07-19 22:45:50 -04:00
Kristian Høgsberg
9e546ecfd4 glx: Move DRI2 extensions to DRI2 screen private 2010-07-19 22:45:50 -04:00
Kristian Høgsberg
cb2a66fd0c glx: Drop support for GLX_MESA_allocate_memory
Only r200 implemented it.
2010-07-19 22:45:50 -04:00
Kristian Høgsberg
f972115d33 glx: Add screen privates for dri drivers and moved some fields there
GLXscreenConfigs is badly named and a dumping ground for a lot of stuff.
This patch creates private screen structs for the dri drivers and moves
some of their fields over there.
2010-07-19 22:45:50 -04:00
Kristian Høgsberg
a296d96de4 glx: Rename various DRI structs away from obnoxious __GLXfooRec convention
Enough is enough.
2010-07-19 22:45:50 -04:00
Kristian Høgsberg
308e13ecd1 glx: Factor out common code from dri2WaitGL() and dri2WaitX() 2010-07-19 22:45:50 -04:00
Kristian Høgsberg
b006d465ea glx: Dont use dri2WaitX() to update fake front
This saves a superfluous flush and a create/destryo region.
2010-07-19 22:45:50 -04:00
Eric Anholt
f9d11b8cee i965: Mostly fix glsl-max-varyings.
There was confusion on both the size of message we can send, and on
what the URB destination offset means.

The remaining problems appear to be due to spilling of regs in the
fragment shader being broken.
2010-07-19 19:29:48 -07:00
Eric Anholt
e179fa9a0a i965: Clean up message register setup in emit_vertex_write(). 2010-07-19 19:29:03 -07:00
Eric Anholt
09788ce10e i965: Reduce repeated calculation of the attribute-offset-in-VUE.
This cleans up some chipset dependency sprinkled around, and fixes a
potential overflow of the attribute offset array for many vertex
results.
2010-07-19 19:29:03 -07:00
Eric Anholt
e29cff6273 i965: Clarify the nr_regs calculation in brw_clip.c 2010-07-19 19:29:03 -07:00
Eric Anholt
bdcaaed6ff i965: Don't set up VUE space for the disabled user clip distances on gen6. 2010-07-19 19:29:03 -07:00
Brian Paul
37692e5dc9 draw: fix incorrect instancing divisor in LLVM code 2010-07-19 18:29:12 -06:00
Ian Romanick
cd6764ed6e linker: Remove the FINISHME comment for intrastage linking 2010-07-19 14:50:43 -07:00
Ian Romanick
1a03a644d2 linker: Remove redundant check for 'main' in shaders
This is now handled in link_intrastage_shaders.
2010-07-19 14:50:43 -07:00
Ian Romanick
25f51d3b9b linker: Track and validate GLSL versions used in shaders 2010-07-19 14:50:43 -07:00
Ian Romanick
b64e979971 glsl2: Use Elements macro 2010-07-19 14:50:43 -07:00
Ian Romanick
fc9ae101b4 linker: Recursively resolve function calls in imported functions 2010-07-19 14:50:43 -07:00
Ian Romanick
532c2d3085 linker: look up function signatures during linking instead of using callee
Instead of using ir_call::callee, search for the signature in the
linked shader.  This will allow resolving calls from functions
imported from other shaders.  The ir_call::callee pointer in the
imported function will still reference a signature in the original shader.
2010-07-19 14:50:43 -07:00
Ian Romanick
5adbf0bff1 linker: Pull find_matching_signature out of call_link_visitor
The list of shaders to search needs to be provided as an explicit
parameter to support coming changes.  At that point there is no reason
for it to be in the class.  Also, fix some of the 'const' decorators.
2010-07-19 14:50:43 -07:00
Ian Romanick
b95897b89d glsl2: Explicitly walk lists in ir_function::parameter_lists_match
Give ir_function::parameter_lists_match_exist similar treatment.  Make
the parameters const, and propogate the constness as far as it will
trivially go.
2010-07-19 14:50:43 -07:00
Ian Romanick
de415b7f4b linker: Add comment about bug in initializer handling 2010-07-19 14:50:43 -07:00
Ian Romanick
8fe8a814b0 linker: First bits of intrastage, intershader function linking
This handles the easy case of linking a function in a different
compilation unit that doesn't call any functions or reference any
global variables.
2010-07-19 14:50:43 -07:00
Ian Romanick
a48a2b66e8 ir_function_signature: Make actual_parameters public 2010-07-19 14:50:43 -07:00
Ian Romanick
3880d07f4b linker: Remove some unnecessary includes 2010-07-19 14:50:43 -07:00
Kenneth Graunke
61a44ccaef exec_list: Fix foreach_list_safe.
It now works correctly when nodes are removed, as it was originally
intended to do; it no longer processes nodes added to the list before
the current node, nor those added immediately after the current node.

This matches the behavior of Linux's list_for_each_safe.
2010-07-19 14:49:34 -07:00
Brian Paul
374c74f4c4 mesa: remove restart.c from build 2010-07-19 15:29:03 -06:00
Ian Romanick
303c99f12f linker: Use foreach_list_safe in move_non_declarations
The node being processed may be removed from the list and put in a
different list.  Not using the safe version caused list processing to
change streams after moving a node.
2010-07-19 12:36:32 -07:00
Ian Romanick
9303e358cb linker: Move global instructions from the linked shader first
For the shader containing 'main', use the linked shader (i.e., the
clone of the original shader that contained main) as the source for
global instructions to move into main.
2010-07-19 12:36:32 -07:00
Marek Olšák
3b189d888a r300g: fix possible crash in destroy_context
The problem is destroy_context is almost NEVER called.
The only test for destroy_context I know is compiz.

Reported by Vinson Lee.

FDO bug #29150.
2010-07-19 21:12:52 +02:00
Marek Olšák
fd03dd203f util: remove the dummy field in mempool
It should allocate less memory now.
2010-07-19 21:05:47 +02:00
Eric Anholt
5304493c40 glsl2: Fix lexing of octal values, including "0".
When faced with a constructor like 'ivec4(0, 2, 0, 0)', we would
manage to get a value of 2 instead of 0 for the first "0".  Usually 2
characters past "0" would point at some junk and lex as 0 anyway.

Fixes glsl-octal and glsl-unused-varyings.
2010-07-19 11:58:03 -07:00
Vinson Lee
95ca22001a scons: Fix Mac OS X SCons build on 32-bit CPUs.
The Mac OS X SCons build failed on 32-bit CPUs starting with commit
2f6d47a7c8 during linking of graw-null.
The build succeeds though on a 64-bit CPU. See FDO bug 29117.

This was the compiler error.
scons: building associated VariantDir targets: build/darwin-x86-debug
  Linking build/darwin-x86-debug/gallium/targets/graw-null/libgraw.dylib ...
Undefined symbols:
  "_lp_swizzled_cbuf", referenced from:
      _lp_swizzled_cbuf$non_lazy_ptr in libllvmpipe.a(lp_rast.os)
      _lp_swizzled_cbuf$non_lazy_ptr in libllvmpipe.a(lp_rast_tri.os)
     (maybe you meant: _lp_swizzled_cbuf$non_lazy_ptr)
  "_lp_dummy_tile", referenced from:
      _lp_dummy_tile$non_lazy_ptr in libllvmpipe.a(lp_rast.os)
      _lp_dummy_tile$non_lazy_ptr in libllvmpipe.a(lp_rast_tri.os)
      _lp_dummy_tile$non_lazy_ptr in libllvmpipe.a(lp_setup.os)
     (maybe you meant: _lp_dummy_tile$non_lazy_ptr)

The patch adds -fno-common to all Mac OS X builds to work around this issue.
2010-07-19 11:31:44 -07:00
Eric Anholt
82d4b9593b glsl2: Fix the expression type for atan's pi * sign(y).
Fixes CorrectFunction.vert.
2010-07-19 10:47:12 -07:00
Eric Anholt
95c08920ea i915: Ask the compiler to flatten out all the if statements that it can. 2010-07-19 10:47:08 -07:00
Eric Anholt
29ce44ad2b glsl2: Add a pass for converting if statements to conditional assignment.
This will be used on 915 and similar hardware of that generation.
2010-07-19 10:21:38 -07:00
Eric Anholt
d16044ad4d glsl2: Give IR nodes a type field.
This is a big deal for debugging if nothing else ("what class is this
ir_instruction, really?"), but is also nice for avoiding building a
whole visitor or an if (node->as_whatever() || node->as_other_thing())
chain.
2010-07-19 09:50:29 -07:00
Eric Anholt
ee7b2b3f44 ir_to_mesa: Do validation on the IR tree. 2010-07-19 09:50:26 -07:00
Brian Paul
369e9272de util: add dummy field to empty structure types
Empty structure types aren't allowed with MSVC.
I haven't tested this change.  Hope I haven't broken it...
2010-07-19 10:50:11 -06:00
Eric Anholt
4802fd905a ir_to_mesa: Don't do lowering passes on an errored-out shader. 2010-07-19 09:44:30 -07:00
Marek Olšák
d1671ceb71 r300g: fix typo 2010-07-19 17:33:40 +02:00
Marek Olšák
7b31b235d0 r300g: use memory pools for buffer_create and get_transfer
The improvement in Tremulous: 68.9 fps -> 71.1 fps.
2010-07-19 17:12:11 +02:00
Marek Olšák
ad44b775e3 util: add a memory pool for equally sized memory allocations
malloc/free are in O(1).
2010-07-19 17:12:11 +02:00
Marek Olšák
4fd39a8d69 st/mesa: fix FRAMEBUFFER_UNSUPPORTED with the D24S8 format
Fixes FDO bug #29116.

NOTE: this is a candidate for the 7.8 branch
2010-07-19 17:11:23 +02:00
Kristian Høgsberg
3750ebd540 glx: Fix drawable lookup in DRI2 event handler
DRI2 events are sent to the X drawable ID used to create the DRI2 drawable,
not the GLX drawable ID.  So when an event comes in, we need to look up
the __GLXDRIdrawable by its X drawable ID, which needs a new hash table.
2010-07-19 09:37:38 -04:00
Eric Anholt
b29d31cd67 ir_to_mesa: Rename struct temp_entry, which is used for all variables now. 2010-07-18 18:13:07 -07:00
Eric Anholt
7b13014942 ir_to_mesa: Add support for function calls.
Unlike the previous compiler, in this case we emit only one copy of
the function regardless of how many times it's called.
2010-07-18 18:13:06 -07:00
Eric Anholt
1f47245bdd glsl2: Remove the const disease from function signature's callee. 2010-07-18 18:13:06 -07:00
Eric Anholt
9be7f63813 glsl2: Make cross() be an expression operation.
ARB_fp, ARB_vp, Mesa IR, and the 965 vertex shader all have
instructions for cross.  Shaves 12 Mesa instructions off of a
66-instruction shader I have.
2010-07-18 18:12:12 -07:00
Eric Anholt
87a2ee8db6 glsl2: Fix warning from always-false assert not being known to not return. 2010-07-18 17:49:15 -07:00
Dave Airlie
4eaf591d15 r300g: u_upload optimisation
fix vb/ib uploads
2010-07-18 18:11:29 +02:00
Sven Arvidsson
14e362c79a gallium/st/dri2: add dri2 vblank query extension support
from bugzilla:
https://bugs.freedesktop.org/show_bug.cgi?id=28771

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-07-18 19:18:49 +10:00
Vinson Lee
f3a2f458a3 llvmpipe: Remove dead initialization. 2010-07-18 01:14:36 -07:00
Marek Olšák
70b27be923 r300g: final fix for r3xx constant buffer emission 2010-07-17 17:18:59 +02:00
Marek Olšák
f7d6cab6cd r300g: fix typo in r3xx constant buffer emission
Ooops.
2010-07-17 14:40:41 +02:00
Marek Olšák
f92d1a54e9 r300g: fix constant buffer emission on r3xx
FDO bug #29128.
2010-07-17 13:37:14 +02:00
Vinson Lee
184abe8e26 llvmpipe: Remove unused variable in lp_test_sincos. 2010-07-17 00:35:10 -07:00
Vinson Lee
e02edab1a1 nv50: s/__func__/__FUNCTION__/ 2010-07-16 18:41:32 -07:00
Vinson Lee
b5fcab976f nouveau: s/__func__/__FUNCTION__/ 2010-07-16 18:14:11 -07:00
Vinson Lee
37648b86b1 nouveau: s/snprintf/util_snprintf/ 2010-07-16 18:03:03 -07:00
Vinson Lee
68744f9325 r300g: Remove unnecessary header. 2010-07-16 17:55:57 -07:00
Vinson Lee
e02c1e215e nouveau: s/inline/INLINE/ 2010-07-16 17:49:18 -07:00
José Fonseca
65ba566ff1 glut: Remove duplicate symbol definition. 2010-07-16 21:48:36 +01:00
José Fonseca
6f81b78cb4 scons: Make PIPE_ALIGN_VAR() of static/global vars work on MinGW.
Workaround http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37216
2010-07-16 21:27:14 +01:00
Vinson Lee
5cf0789f91 scons: Fix Cygwin build.
The Cygwin SCons build needed several file names to be fully qualified.
2010-07-16 12:34:22 -07:00
Marek Olšák
5862b6ed61 r300g: inline winsys_buffer_destroy 2010-07-16 21:13:21 +02:00
Marek Olšák
3eb5577783 r300g: do not make copies of constant buffers, emit them directly 2010-07-16 21:13:21 +02:00
Brian Paul
80e07c4190 draw: updated debug/dump code 2010-07-16 11:10:25 -06:00
Brian Paul
959a458ea0 draw: added array element debug / bounds checking code (disabled) 2010-07-16 11:09:32 -06:00
Keith Whitwell
2f6d47a7c8 llvmpipe: use single swizzled tile
Use a single swizzled tile per colorbuf (and per thread) to avoid
accumulating large amounts of cached swizzled data.

Now that the SSE3 code has been merged to master, the performance delta
of this change is minimal, the main benefit is reduced memory usage
due to no longer keeping swizzled copies of render targets.

It's clear from the performance of the in-place version of this code
that there is still quite a bit of time being spent swizzling &
unswizzling, but it's not clear exactly how to reduce that.
2010-07-16 17:24:21 +01:00
José Fonseca
b7fff13d58 llvmpipe: Describe _mm_shuffle_epi8() with gcc extended inline assembly when -mssse3 is not supported/enabled. 2010-07-16 17:24:21 +01:00
José Fonseca
0a36a064a1 llvmpipe: Only use -mssse3 on gcc 4.3+ 2010-07-16 17:24:21 +01:00
Zack Rusin
fab4ac9e94 draw/llvm: adjust the instance id at run time
fixes instancing in draw llvm
2010-07-16 12:19:26 -04:00
Zack Rusin
b77f5024ca draw: use the instance id when fetching vertex data 2010-07-16 11:58:20 -04:00
Brian Paul
41bcd8cb1e mesa: return retval in _mesa_RenderObjectUnpurgeable()
Found by Vinson with static analysis.

NOTE: This is a candidate for the 7.8 branch.
2010-07-16 07:37:30 -06:00
Chia-I Wu
08f4bc07e4 st/egl: Fix build on FreeBSD.
There is no libdl on FreeBSD.  Based on patch from Thinker
<thinker@branda.to>, which is against 7.8.

This fixes fdo bug #29093.
2010-07-16 20:19:13 +08:00
Chia-I Wu
39ae965783 egl: Build egl_dri2 only when DRI drivers are built.
That is, build egl_dri2 only when --with-driver=dri is given (the
default).
2010-07-16 19:50:16 +08:00
Chia-I Wu
bb217ba76a egl: Build egl_dri2 only when xcb-dri2 is available.
The driver does not build when xcb-dri2 is not available.
2010-07-16 19:41:29 +08:00
Vinson Lee
6f6c8ec7b7 glu/sgi: Remove dead initialization in extract565rev. 2010-07-16 01:11:03 -07:00
Vinson Lee
4b387ee087 i965g: Remove dead initialization in precalc_tex. 2010-07-16 01:07:13 -07:00
Marek Olšák
fe3caa91d3 r300g: rebuild winsys and command submission to support multiple contexts 2010-07-16 08:51:16 +02:00
Vinson Lee
5f9d7bb242 mesa: Add error path in compressed_texture_error_check.
Add error path for unhandled dimensions in
compressed_texture_error_check.
2010-07-15 23:45:25 -07:00
Vinson Lee
643f5ea1e0 glsl/apps: Handle ftell errors in non-debug builds. 2010-07-15 18:45:20 -07:00
Brian Paul
5824fbf674 llvmpipe: implement instanced drawing functions
And express all the other drawing functions in terms of
llvmpipe_draw_range_elements_instanced().
2010-07-15 15:56:09 -06:00
Brian Paul
839608a8be draw: update comments for drawing functions 2010-07-15 15:42:36 -06:00
Brian Paul
5c0f6bf13b draw: move prototype, update comment 2010-07-15 15:42:36 -06:00
Brian Paul
7fce75ed29 softpipe: re-order drawing functions to get rid of prototype 2010-07-15 15:42:36 -06:00
Brian Paul
77e651db07 graw: new tri-instanced.c program to test instanced drawing 2010-07-15 15:42:36 -06:00
Alex Deucher
2bd69080a2 r600: fix typo in r700 assembler
Noticed by Henri Verbeet on IRC.

NOTE: This is a candidate for the 7.8 branch.
2010-07-15 17:03:58 -04:00
Henri Verbeet
fef9b532cd radeon: Also flush if it's not the current context that's being destroyed.
This avoids calling radeonFlush() during context destruction, when
ctx->DrawBuffer would be NULL.

NOTE: This is a candidate for the 7.8 branch.
2010-07-15 14:54:25 -04:00
Alex Deucher
0a7803cbac radeon: allow driconf vblank settings with dri2
fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=28771

NOTE: This is a candidate for the 7.8 branch.
2010-07-15 14:47:06 -04:00
Brian Paul
3fde89e439 st/mesa: fix quad strip trimming bug
The translate_prim() function tries to convert quad strips into
tri strips.  This is normally OK but we have to check for an odd
number of vertices so that we don't accidentally draw an extra
triangle.  The mesa-demos/src/samples/prim.c demo exercises that.
With this fix the stray yellow triangle is no longer drawn.

Use the u_trim_pipe_prim() function to make sure that prims have
the right number of vertices and avoid calling gallium drawing
functions when the prim has a degenerate number of vertices.

Plus add comments, clean-up formatting, etc.

NOTE: This is a candidate for the 7.8 branch.
2010-07-15 10:49:56 -06:00
José Fonseca
0eaccb30de llvmpipe: Remove redundant statement.
Thanks to Vinson for spotting this.
2010-07-15 10:59:03 +01:00
Vinson Lee
4f6aa567c0 glu/sgi: Remove dead initialization in extract565. 2010-07-15 01:42:02 -07:00
Vinson Lee
3471ac9569 tgsi: Remove dead assignment in uprcase function. 2010-07-15 01:26:09 -07:00
Vinson Lee
cc2f337d06 mesa: Fix potential out-of-bounds access by _vbo_Materialf.
_vbo_Materialf calls _vbo_Materialfv, which uses the params argument as
an array.
2010-07-15 00:53:07 -07:00
Vinson Lee
5c9e54f2ff glx: Move dereference and initialization to after NULL check. 2010-07-15 00:20:41 -07:00
Chia-I Wu
d7284b45e2 egl: Return the correct array size in _eglFlattenArray.
The function is used by _eglGetConfigs and _eglGetScreens.  The array
size should not be limited by the buffer size when the buffer is NULL.

This fixes fdo bug #29052.
2010-07-15 10:05:46 +08:00
Kenneth Graunke
17a307d154 ast_function: Actually do type conversion on function arguments. 2010-07-14 16:49:24 -07:00
Kenneth Graunke
1fdcdb2dca exec_list: Add a new replace_with method. 2010-07-14 16:49:24 -07:00
Kenneth Graunke
53120805a8 Refresh autogenerated file builtin_function.cpp. 2010-07-14 16:49:24 -07:00
Kenneth Graunke
d5316aeb38 glsl2/builtins: Rework clamp to use scalar/vector combinations. 2010-07-14 16:49:24 -07:00
Kenneth Graunke
8984203abb glsl2/builtins: Rework min/max to use scalar/vector combinations. 2010-07-14 16:49:24 -07:00
Kenneth Graunke
ce5ae5f49d ir_constant_expression: Add support for ir_binop_mod. 2010-07-14 16:49:24 -07:00
Kenneth Graunke
79fed377f4 ir_constant_expression: Add support for ir_binop_min and ir_binop_max.
These now work on scalar/vector combos. Semantically, if a is a scalar,
min(a, vec2(x,y)) == vec2(min(a,x), min(a,y))
2010-07-14 15:50:28 -07:00
Kenneth Graunke
891a0647e4 ir_constant_expression: Add support for ir_binop_pow. 2010-07-14 15:50:28 -07:00
Kenneth Graunke
3fab376bef ir_constant_expression: Add support for ir_unop_cos. 2010-07-14 15:50:28 -07:00
Kenneth Graunke
908afd16d1 ir_constant_expression: Add support for ir_unop_sin. 2010-07-14 15:50:28 -07:00
Kenneth Graunke
074720477c ir_constant_expression: Add support for ir_unop_floor. 2010-07-14 15:50:28 -07:00
Kenneth Graunke
c1ee30a145 ir_constant_expression: Add support for ir_unop_ceil. 2010-07-14 15:50:28 -07:00
Kenneth Graunke
323d909ab2 ir_constant_expression: Add support for ir_unop_trunc.
This uses a C99 function.
2010-07-14 15:50:28 -07:00
Kenneth Graunke
cb63929df4 ir_constant_expression: Add support for ir_unop_log2.
This uses a C99 function.
2010-07-14 15:50:27 -07:00
Kenneth Graunke
aca01edc83 ir_constant_expression: Add support for ir_unop_exp2.
This uses a C99 function.
2010-07-14 15:50:27 -07:00
Kenneth Graunke
14b7b2660c ir_constant_expression: Add support for ir_unop_sign. 2010-07-14 15:50:27 -07:00
Kenneth Graunke
5e840dba44 ir_constant_expression: Remove bogus assert in ir_unop_abs case.
abs is defined for integral types; it's even implemented.
2010-07-14 15:50:27 -07:00
Kenneth Graunke
7d19bf2ec3 glsl2: Remove ir_program bong hits. 2010-07-14 15:50:27 -07:00
Brian Paul
2f4ce25645 mesa: fix _mesa_Texture/Render/BufferObjectUnpurgeable() return values
Fixes piglit object_purgeable-api-pbo, object_purgeable-api-vbo
and object_purgeable-api-texture failures with swrast.

NOTE: This is a candidate for the 7.8 branch.
2010-07-14 15:13:55 -06:00
Brian Paul
f2bfc2b7d2 mesa: update assertions and fix refcounting in depth/stencil renderbuffer code 2010-07-14 15:13:54 -06:00
Brian Paul
4beea12f17 mesa: silence a printf warning 2010-07-14 15:13:54 -06:00
Brian Paul
871feeb165 llvmpipe: delete lp_test_*.o files with make clean 2010-07-14 15:13:54 -06:00
Brian Paul
1957bef995 gallium: added CLEAN_EXTRA var for make clean target 2010-07-14 15:13:54 -06:00
Nick Bowler
f8d81c31ce dri2: Track event mask in client code.
When direct rendering is being used, DRI2 BufferSwapComplete events are
sent unconditionally to clients, even if they haven't been requested.
This causes error messages to be printed by every freeglut application
of the form

  freeglut (./gears): Unknown X event type: 104

and might confuse other clients.

This is a fixed up version of the patch by Jesse Barnes, which drops
BufferSwapComplete events if they are not requested by clients.

Fixes fdo bug 27962.

Signed-off-by: Nick Bowler <nbowler@draconx.ca>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2010-07-14 10:23:09 -07:00
José Fonseca
467928c6e0 gallium: Ensure prototypes are wrapped in extern "C".
Fixes MSVC build failure due to inconsistent _ReadWriteBarrier
prototype.
2010-07-14 16:15:56 +01:00
José Fonseca
d023fb3928 llvmpipe: Remove redundant alignments.
The lp_rast_shader_inputs' alignment is irrelevant now that it contains
pointers instead of actual data.

Likewise, lp_rast_triangle's size alignment is meaningless.
2010-07-14 14:53:35 +01:00
Chris Li
bed78862d4 llvmpipe: Addi ssse3 swizzling for B8G8R8A8_UNORM. 2010-07-14 14:38:02 +01:00
José Fonseca
c6c62164c3 gallium: Add a macro for memory barriers. 2010-07-14 14:38:02 +01:00
José Fonseca
5e2437a232 gallium: Add a new PIPE_ARCH_SSSE3 define for SSSE3 compiler support. 2010-07-14 14:38:02 +01:00
Zack Rusin
582132aaef Merge branch 'mesa-2d-registers' 2010-07-13 21:54:14 -04:00
Zack Rusin
1491c6aa2d mesa: add comments and change Index2D to just Index2 2010-07-13 21:49:53 -04:00
Marek Olšák
9fa64ea675 r300/compiler: fix swizzling in the transformation of Abs modifiers 2010-07-14 02:01:03 +02:00
Eric Anholt
021222c6a8 ir_to_mesa: Add convenience function for opcodes with no src/dst reg.
Most of flow control is like this.
2010-07-13 12:24:39 -07:00
Jakob Bornecrantz
20a3dda726 i965g: Fix scons build of dri driver 2010-07-13 19:32:16 +01:00
Eric Anholt
c10a68522c glsl2: When linking makes a variable not a varying output, make it ir_var_auto.
This almost fixes glsl-unused-varying, except that the used varying
gets assigned to the first varying slot (position).
2010-07-13 11:07:16 -07:00
Roland Scheidegger
217926f350 llvmpipe: fix comment typo 2010-07-13 19:59:38 +02:00
Roland Scheidegger
edac740095 llvmpipe: move rasterizer to screen instead of setup context
there's no point of having this per context, so move to screen
(and protect with a mutex).
2010-07-13 19:58:58 +02:00
Eric Anholt
4d5da50b94 ir_to_mesa: Add support for variable array indexing of builtin varyings.
That is to say, gl_TexCoord[i] now works, fixing glsl-texcoord-array
on swrast.
2010-07-13 09:52:20 -07:00
Eric Anholt
f8a2b65bc9 ir_to_mesa: Add support for array dereferences on the LHS of assignments.
The big change is to delay address reg setup until the instruction
that needs the deref.  It was hard to use the deref chain support for
the LHS because it does the copy of the dereffed value to a temporary
(to avoid problems when two src regs are array derefs), so we wouldn't
haev a pointer to actual storage in the end.

Fixes glsl-vs-arrays on swrast.
2010-07-13 09:52:20 -07:00
José Fonseca
962da13ba3 llvmpipe: Align texture data to the cache line. 2010-07-13 17:32:44 +01:00
Keith Whitwell
e21e7ab4da llvmpipe: eliminate the set_state rasterizer command
Just put a pointer to the state in the tri->inputs struct.  Remove
some complex logic for eliminating unused statechanges in bins at the
expense of a slightly larger triangle struct.
2010-07-13 17:28:54 +01:00
Keith Whitwell
d4b64167b5 llvmpipe: pass mask into fragment shader
Move this code back out to C for now, will generate separately.

Shader now takes a mask parameter instead of C0/C1/C2/etc.

Shader does not currently use that parameter and rasterizes whole
pixel stamps always.
2010-07-13 17:23:49 +01:00
Keith Whitwell
3bd9aedbac llvmpipe: move fences from per-bin to per-thread
Rather than inserting an lp_rast_fence command at the end of each
bin, have each rasterizer thread call this function directly once
it has run out of work to do on a particular scene.

This results in fewer calls to the mutex & related functions, but more
importantly makes it easier to recognize empty bins.
2010-07-13 17:23:48 +01:00
José Fonseca
6d17f00600 llvmpipe: Always swizzle/unswizzle whole tiles.
This was already the case, but the generated (un)swizzling code was not
benefiting of that knowledge.
2010-07-13 17:23:48 +01:00
Ian Romanick
4e6a3e0d2d glsl2: Remove unnecessary casts of clone return values 2010-07-13 09:22:35 -07:00
Jakob Bornecrantz
654009f7f8 llvmpipe: Ignores! 2010-07-13 07:49:00 -07:00
Jakob Bornecrantz
04453a32b4 targets: Link xorg drivers with LLVM if built 2010-07-13 07:49:00 -07:00
Jakob Bornecrantz
433a08445c targets: Clean up xorg make files a bit 2010-07-13 07:49:00 -07:00
Jakob Bornecrantz
4f956889b7 st/xorg: When selecting st via configure make sure to test for xorg-server 2010-07-13 07:49:00 -07:00
Brian Paul
271af2a874 libgl-xlib: add depend to make clean list 2010-07-13 07:46:22 -06:00
Brian Paul
672f6cdc19 glapi: use _mesa_snprintf()
Note that the enums.c file is generated with this script.
This will preserve the change from commit
c4066b78c0.
2010-07-13 07:44:35 -06:00
Marek Olšák
56da2403fc r300/compiler: implement the Abs source operand modifier for vertex shaders 2010-07-13 15:06:22 +02:00
Marek Olšák
b5fc699b1e r300/compiler: emulate SIN/COS/SCS in r3xx-r4xx vertex shaders
Despite the docs, the corresponding hardware instructions are r5xx-only.
2010-07-13 15:06:22 +02:00
Vinson Lee
c4066b78c0 mesa: s/snprintf/_mesa_snprintf/ 2010-07-13 00:31:37 -07:00
Marek Olšák
2470750b4e r300g: do not advertise half_float_vertex on rv3x0
rv3x0 can't do it.
2010-07-13 06:31:36 +02:00
Eric Anholt
4ca07882af ir_to_mesa: Rely on ir_mat_op_to_vec for matrix multiplication support. 2010-07-12 19:50:49 -07:00
Eric Anholt
15ded63279 glsl2: Add matrix multiplication to ir_mat_op_to_vec. 2010-07-12 19:50:49 -07:00
Eric Anholt
3f08989267 ir_to_mesa: Emit OPCODE_MAD when we find an ADD of a MUL.
Bug #27914.
2010-07-12 19:50:49 -07:00
Eric Anholt
562c3d0cb1 glsl2: Flatten expression that appear as the parameters of ir_call as well. 2010-07-12 19:50:49 -07:00
Eric Anholt
94da2abfd4 glsl2: Flatten expressions that appear as the children of ir_return as well. 2010-07-12 19:50:49 -07:00
Ian Romanick
31a97868fc linker: Merge global-scope instructions into main
Find instructions in all shaders that are not contained in a function
(i.e., initializers for global variables).  "Move" these instructions
to the top of the main function in the linked shader.  As a
side-effect, many global variables will also be copied into the linked
shader.
2010-07-12 19:12:28 -07:00
Ian Romanick
15ce87e9f2 linker: Detect the shader that contains "main" during intrastage linking 2010-07-12 18:51:55 -07:00
Ian Romanick
11fc7beb2f ir_function: Make matching_signature not return const
The linker needs to use this function to get specific function signatures, but
it also needs to modify the returned signature.  Since this method isn't itself
const (i.e., const this pointer), there is no value in making a const and
non-const version.
2010-07-12 18:51:55 -07:00
Ian Romanick
13f782c4ae linker: Implement first bits of intrastage linking
This currently involves an ugly hack so that every link doesn't result
in all the built-in functions showing up as multiply defined.  As soon
as the built-in functions are stored in a separate compilation unit,
ir_function_signature::is_built_in can be removed.
2010-07-12 18:51:55 -07:00
Ian Romanick
e2e5d0def4 linker: Refactor cross_validate_uniforms into cross_validate_globals
The later, more generic function will be used in the intra-stage linker.
2010-07-12 18:51:55 -07:00
Marek Olšák
50db6dba65 r300g: extend and clean up debug logging 2010-07-13 01:34:21 +02:00
Marek Olšák
499022c282 r300g/swtcl: do not emit texcoords if they are also stuffed in GA 2010-07-13 01:34:21 +02:00
Marek Olšák
f5804e64b4 r300g: rework the draw_rectangle hook
It is a lot simplier, cleaner, and more stable now.
2010-07-13 01:34:09 +02:00
Eric Anholt
d74c9ff046 glsl2: Use a better talloc context for ir_expression_flattening.
The instruction can be hung off of any other in the tree, even if the
other one will be deleted, since it'll get stolen to the shader's
context later if it's still live.
2010-07-12 16:07:02 -07:00
Eric Anholt
7b96b474e0 glsl2: Add support for variable vector indexing on the LHS of assignments.
Fixes glsl-vs-vec4-indexing-3.
2010-07-12 16:07:02 -07:00
Eric Anholt
b87259d3ef glsl2: Fix copy propagation in the presence of derefs in array indexes.
We would clear the in_lhs flag early, avoiding copy propagation on the
array index variable (oops) and then copy propagating on the array
variable (ouch).  Just avoid all copy propagation on the LHS instead.
2010-07-12 16:07:02 -07:00
Eric Anholt
8258a6a2c3 ir_to_mesa: Add support for dereferencing matrices from arrays. 2010-07-12 16:07:02 -07:00
Ian Romanick
506880bc32 ir_validate: Also perform usual checks on ir_dereference_variable nodes 2010-07-12 15:46:16 -07:00
Ian Romanick
8baf21b1a4 ir_validate: Validate that varibles are declared before used in IR 2010-07-12 15:43:50 -07:00
Ian Romanick
3fb878722e linker: Stub-out intrastage linker 2010-07-12 15:19:30 -07:00
Ian Romanick
ffd7bb031e Make shader_api.h be C++ friendly 2010-07-12 15:19:30 -07:00
Ian Romanick
c67016de96 ir_validate: Additional function related invariant checks
Add two invariant checks related to functions and function signatures:

1. Ensure that function definitions (ir_function) are not nested.

2. Ensure that the ir_function pointed to by an ir_function_signature
is the one that contains it in its signatures list.
2010-07-12 15:19:29 -07:00
Ian Romanick
df05ad4e1a ir_function_signature: Add method to get the function owning a signature
There is no setter function, the getter returns a constant pointer,
and ir_function_signature::_function is private for a reason.  The
only way to make a connection between a function and function
signature is via ir_function::add_signature.  This helps ensure that
certain invariants (i.e., a function signature is in the list of
signatures for its _function) are met.
2010-07-12 15:19:29 -07:00
Ian Romanick
f3235eb37f glsl2: Add utility function clone_ir_list 2010-07-12 15:19:29 -07:00
Ian Romanick
792e01c1e2 ir_call: Add method to set the function signature being called 2010-07-12 15:19:29 -07:00
Ian Romanick
b500981226 glsl2: Implement ir_function::clone and ir_function_signature::clone 2010-07-12 15:19:29 -07:00
Ian Romanick
81d664f099 glsl2: Move temp declaration to correct side of if-statement in IR 2010-07-12 15:19:29 -07:00
Ian Romanick
10d222b702 glsl2: Add missing fields in ir_variable::clone 2010-07-12 14:56:21 -07:00
Ian Romanick
0b9ae3befb glsl2: Add declarations for temporaries to instruction stream
Temporary variables added for &&, ||, and ?: were not being added to
the instruction stream.  This resulted in either test failures or
Valgrind being angry after the original IR tree was destroyed by
talloc_free.  The talloc_free caused the ir_variables to be destroyed
even though they were still referenced.
2010-07-12 14:56:21 -07:00
Maciej Cencora
7facb8f2c8 Merge branch 'master' of git://anongit.freedesktop.org/mesa/mesa 2010-07-12 23:42:06 +02:00
Vinson Lee
c6b7aa96f9 r600: Fix include recursion.
Fix r600_context.h -> r700_oglprog.h -> r600_context.h include
recursion.
2010-07-12 14:23:51 -07:00
Vinson Lee
5ba0ba72d9 r300g: Remove unnecessary header. 2010-07-12 14:12:02 -07:00
Eric Anholt
288733f600 glsl2: Store the gl_type of the array's element type in the array.
Fixes glsl-fs-uniform-array-1, glsl-vs-uniform-array-1, and the -2
tests on software.
2010-07-12 14:05:20 -07:00
Eric Anholt
7b48843ecd Revert "ir_to_mesa: Add support for adding/subtracting matrices."
This reverts commit b4d0c0e0ee.
Now that ir_mat_op_to_vec is landed, this change is no longer needed.
2010-07-12 13:26:49 -07:00
Eric Anholt
6d8a0a0aad glsl2: Add a new pass at the IR level to break down matrix ops to vector ops.
This will be used by the Mesa IR and likely most HW backends, as it
allows other optimizations to occur that might not otherwise.

Fixes glsl-vs-mat-sub-1, glsl-vs-mat-div-1.
2010-07-12 13:26:46 -07:00
Maciej Cencora
ba03a0b5ba radeon: fix some wine d3d9 tests
Need to flush command stream before mapping texture image
that is referenced by current cs.

Candidate for 7.8 branch.

Signed-off-by: Maciej Cencora <m.cencora@gmail.com>
2010-07-12 21:48:43 +02:00
Eric Anholt
5723e5bb8b glsl2: Flatten out expressions that are the child of an assignment rhs.
This feels a little odd, but it will be useful for ir_mat_to_vec,
where I want to see a plain assignment of the expression to a
variable, not to a writemasked array dereference with a call as the
array index.
2010-07-12 12:02:32 -07:00
Eric Anholt
d2afc87445 glsl2: Check when inlining a bare function call that it actually is.
It would be easy to miss an entry either of the two visitors involved
that would result in trying to ir->remove() the call to remove it from
the instruction stream when really it's part of an expression tree
that wasn't flattened.
2010-07-12 12:02:11 -07:00
José Fonseca
cd629c28d7 llvmpipe: Re-enable threading on windows. 2010-07-12 15:40:33 +01:00
nobled
209009d75f os: remove gratuitous pipe_barrier placeholder code
There's already an implementation of pipe_barrier using
the other pipe_* primitives; just use that on Windows, too.

Now Windows passes pipe_barrier_test.
2010-07-12 15:40:33 +01:00
nobled
7ce9a3adc5 os, rbug: remove PIPE_THREAD_HAVE_CONDVAR
The new default implementation of pipe_condvar makes it
unnecessary.
2010-07-12 15:40:33 +01:00
nobled
f321d5c38a os: Implement pipe_condvar on Windows Vista and later
Unfortunately compiling with these defines enabled would mean
Gallium can't run on Windows XP/2003 or older.

Todo: Need a macro to declare if we don't care about WinXP
compatibililty.
2010-07-12 15:40:32 +01:00
nobled
9795a60a8f os: Implement pipe_condvar on win32
Or at least a little of it. This version will sleep
for a fixed amount of time instead of just deadlocking,
which is a slight improvement.

Also do the same thing on any unrecognized platform.
2010-07-12 15:40:32 +01:00
Marek Olšák
8c836f7f74 r300g: implement fast color clear
An initial implementation made by Dave Airlie.

For it to be used, a color-only clear must be invoked and exactly one
point-sampled render target must be set. The render target must be
macrotiled (for us to overcome alignment issues) and bpp must be either
16 or 32.

I can't see a difference in performance. :(

Conflicts:

	src/gallium/drivers/r300/r300_blit.c
2010-07-12 13:26:00 +02:00
Marek Olšák
78e8a8765f r300g: clear and copy a resource with a rectangular point sprite
With an ordinary quad, the pixels on the main diagonal are computed
and stored twice, which is somewhat inefficient and might not work well
with specialized clear codepaths.
2010-07-12 13:06:45 +02:00
Marek Olšák
0864851e27 r300g: do not use immediate mode if there is a VBO in VRAM
And other minor fixups.
2010-07-12 06:52:06 +02:00
Marek Olšák
9be8f7d226 u_blitter: add draw_rectangle callback which can be overridden by a driver 2010-07-12 06:32:52 +02:00
Marek Olšák
749e24521a u_blitter: clean up the texcoord computations 2010-07-12 05:32:42 +02:00
Marek Olšák
3bd15a9e43 u_blitter: simplify blitter_set_rectangle 2010-07-12 05:16:19 +02:00
Marek Olšák
9b03da9bdd u_blitter: rename blitter->base, add a way to get a pipe context from blitter 2010-07-12 02:06:39 +02:00
Marek Olšák
9cdd481f8e r300g: ugly fix of a hardlock in the cubestorm xscreensaver
FDO bug #28563.
2010-07-12 00:04:52 +02:00
Maciej Cencora
72e6a1e72f radeon: lower texture memory consumption is some cases
When searching for valid miptree check images in range
of [BaseLeve, MaxLevel] not [MinLod, MaxLoad].
Prevents unnecessary miptree allocations in cases when during
every rendering operation different texture image level
was selected using MIN_LOD = MAX_LOD = level (for every level
new miptree for whole texture was allocated).

Candidate for 7.8 branch.

Signed-off-by: Maciej Cencora <m.cencora@gmail.com>
2010-07-11 15:39:48 +02:00
Maciej Cencora
ad24ea37bb radeon: fix teximage migration failure in rare case
Always store selected miptree in texObj->mt so get_base_teximage_offset returns correct data.
Found with piglit/mipmap-setup.

Candidate for 7.8 branch.

Signed-off-by: Maciej Cencora <m.cencora@gmail.com>
2010-07-11 15:34:17 +02:00
Maciej Cencora
452a7d5a9d r300c: Fix vertex data setup for named buffer objects with unaligned offset
Candidate for 7.8 branch

Signed-off-by: Maciej Cencora <m.cencora@gmail.com>
2010-07-11 14:25:35 +02:00
Vinson Lee
932e4e65e3 r600: Remove unnecessary headers. 2010-07-11 00:14:53 -07:00
Zack Rusin
79b643dd02 mesa: make uniform work with geometry shaders 2010-07-10 19:21:42 -04:00
Zack Rusin
748d8d4613 Revert "mesa: temporarily enable printing of Mesa's GPU instructions"
This reverts commit 7b8726a99d.
2010-07-10 18:24:22 -04:00
Zack Rusin
df0831f375 mesa: GL_TRIANGLE_STRIP_ADJACENCY_ARB is the last valid primitive 2010-07-10 18:14:47 -04:00
Zack Rusin
cc426b8132 tgsi: make sure that we print out the adjacency prims correctly 2010-07-10 18:14:14 -04:00
Zack Rusin
f52f8e9a8c draw: fix decomposition to work with adjacency primitives 2010-07-10 18:13:48 -04:00
Marek Olšák
d63cb78ddd r300g: do not print a rejected CS if RADEON_DUMP_CS is not set
Also print relocation failures on non-debug builds too.
2010-07-10 20:46:26 +02:00
Vinson Lee
8dc6d7610f r600: Fix GCC 'implication declaration of function' warnings.
Fix GCC 'implicit declaration of function' compiler warnings resulting
from commit 00fb58ed5d.
2010-07-10 00:15:27 -07:00
Zack Rusin
425870c5fd mesa: get the translation from mesa 2d regs to tgsi working
first working version of arb_geometry_shader4
2010-07-10 02:02:35 -04:00
Zack Rusin
9808308f9a mesa: initial support for emitting 2D registers from slang 2010-07-09 22:40:04 -04:00
Vinson Lee
00fb58ed5d r600: Remove unnecessary header.
Fixes r600_emit.h -> r600_cmdbuf.h -> r600_emit.h include recursion.
2010-07-09 18:59:01 -07:00
Zack Rusin
7b8726a99d mesa: temporarily enable printing of Mesa's GPU instructions 2010-07-09 21:20:50 -04:00
Zack Rusin
b4855288e4 mesa: add basic support for 2D register arrays to mesa
just like in Gallium it's a basic functionality needed by a lot
of modern graphcis extensions
2010-07-09 21:19:28 -04:00
Vinson Lee
308f52d573 r600: Fix include recursion.
r700_chip.h included r600_context.h, which included r700_chip.h.

Remove the unnecessary r600_context.h inclusion and add missing
headers.
2010-07-09 18:09:26 -07:00
Vinson Lee
0c767b9ae6 glslcompiler: Fix GCC warn_unused_result warning. 2010-07-09 17:34:40 -07:00
Vinson Lee
16def30870 glslcompiler: Fix memory leaks on error paths. 2010-07-09 16:20:32 -07:00
Vinson Lee
011e6794e3 glslcompiler: Remove unnecessary headers. 2010-07-09 16:05:42 -07:00
Vinson Lee
343b38a692 mesa: Move [UN]CLAMPED_FLOAT_TO_UBYTE from imports.h to macros.h.
The other similar integer/float conversion macros are in macros.h.
2010-07-09 15:06:19 -07:00
Marek Olšák
347c00c46e r300g: allow the GTT domain for samplers
This fixes sluggishness in vdrift.
2010-07-09 20:28:13 +02:00
Kenneth Graunke
284d821206 ast_function: Fix non-float constructors with matrix arguments.
Previously, code like ivec4(mat2(...)) would fail because the compiler
would naively try to convert a mat2 to an imat2...which doesn't exist.
Now, a separate pass breaks such matrices down to their columns, which
can be converted from vec2 to ivec2.

Fixes piglit tests constructor-11.vert, constructor-14.vert,
constructor-15.vert, and CorrectConstFolding2.frag.
2010-07-09 09:46:29 -07:00
Kenneth Graunke
f58bbd134e ast_function: Move error return earlier and don't indent the world.
This has no functional changes.
2010-07-09 09:46:29 -07:00
Kenneth Graunke
59df3385e1 ast_function: Remove unnecessary check for empty constructors.
This case is already caught by a later check that ensures sufficient
components were provided, based on the type.
2010-07-09 09:46:29 -07:00
Kenneth Graunke
a4dde28ee6 glsl2: Use new foreach_list_safe abstraction. 2010-07-09 09:46:29 -07:00
Kenneth Graunke
f3290e950c glsl2: Add foreach_list_safe which works even when mutating the list.
In particular, with foreach_list_safe, one can remove and free the current
node without crashes; if new nodes are added after the current node,
they will be properly visited as well.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2010-07-09 09:46:07 -07:00
Tom Stellard
8a8e311d8c r300/compiler: Add a register rename pass.
This pass renames register in order to make it easier for the pair
scheduler to group TEX instructions together.

This fixes fdo bug #28606
2010-07-08 21:11:03 -07:00
Tom Stellard
3724a2e65f r300/compiler: Fix scheduling of TEX instructions.
The following instruction sequence will no longer be emitted in separate
TEX blocks:

0: TEX temp[0].xyz, temp[1].xy__, 2D[0];
1: TEX temp[1].xyz, temp[2].xy__, 2D[0];

This fixes fdo bug #25109
2010-07-08 21:11:03 -07:00
Marek Olšák
75d0e95a3a r300g/swtcl: fix out-of-bounds write
This is a typo fix, the generated code should be the same.
2010-07-09 03:53:47 +02:00
Vinson Lee
f8f1c629d6 draw: Fix off-by-one error in assert.
textures is an array of size PIPE_MAX_VERTEX_SAMPLERS.
2010-07-08 17:54:47 -07:00
Brian Paul
41f66915ab glsl: fix indirect addressing of gl_TextureMatrix[] arrays
The code to emit an array of OpenGL state vars lacked the code
to handle the gl_TextureMatrix[] array.

Fixes fd.o bug 28967

NOTE: this is a candidate for the 7.8 branch.
2010-07-08 18:42:45 -06:00
Kristian Høgsberg
2168b87b51 egl_dri2: Support _EGL_PLATFORM_DRM
This lets the egl_dri2 driver initialize on just a DRM fd.
2010-07-08 20:10:37 -04:00
Vinson Lee
7595733677 glslcompiler: Fix build. 2010-07-08 16:06:01 -07:00
Vinson Lee
6dd7d654db Merge branches 'master' and 'master' of ssh://git.freedesktop.org/git/mesa/mesa 2010-07-08 15:58:23 -07:00
Kenneth Graunke
dfd30ca6a9 glsl2: Remove generate_temporary and global temporary counter.
Most places in the code simply use a static name, which works because
names are never used to look up an ir_variable.  generate_temporary is
simply unnecessary (and looks like it would leak memory, and isn't
thread safe...)
2010-07-08 15:44:19 -07:00
Marek Olšák
392a2515c0 r300g: fix texturing with negative lod bias
This should fix FDO bugs #28437 and #28625.
2010-07-09 00:16:49 +02:00
Marek Olšák
61a26cdfdc r300g: store/return the stride for winsys_handle in winsys 2010-07-08 22:39:52 +02:00
Eric Anholt
8a3f2eb9e6 i965: Add disasm for SEND mlen/rlen on Sandybridge. 2010-07-08 13:30:56 -07:00
Zhenyu Wang
20be3ff576 i965: Add 'wait' instruction support
When EU executes 'wait' instruction, it stalls and sets notification
register state. Host can issue MMIO write to clear notification
register state to allow EU continue on executing again.

Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
2010-07-08 12:50:53 -07:00
Eric Anholt
a3cc7585ea i965: Fix disasm of a SEND's mlen and rlen on Ironlake. 2010-07-08 12:50:53 -07:00
Zhenyu Wang
3f906621da i965: Add decode for Sandybridge DP write messages. 2010-07-08 12:50:53 -07:00
Zhenyu Wang
0446679551 i965: Add definitions for Sandybridge DP write/read messages. 2010-07-08 12:50:53 -07:00
Marek Olšák
9cc6b5b043 r300g: fix transfering compressed textures 2010-07-08 21:37:04 +02:00
Eric Anholt
e72b87736d intel: Update intel_decode.c from intel-gpu-tools.
This came from commit cf255e382d147fe3ca450f0dcec3525190e7dcbc
2010-07-08 12:12:54 -07:00
Brian Paul
b273928140 gallium: bump PIPE_MAX_SHADER_INPUTS/OUTPUTS to 32 2010-07-08 11:03:54 -06:00
Marek Olšák
62c631b205 r300g: add a function for marking framebuffer atoms as dirty 2010-07-08 18:02:30 +02:00
Marek Olšák
f9e8cdc145 r300g: minor fixups 2010-07-08 18:02:30 +02:00
Brian Paul
3751e6e1fc glsl: fix 'if ((x=foo()) > 1.0)' bug
Fixes fd.o bug 27216.  May also be the root cause of fd.o bug 28950.

We weren't propogating the storage info for the x=foo() expression up
through the IR tree to the inequality expression.

NOTE: This is a candidate for the Mesa 7.8 branch.
2010-07-08 09:22:54 -06:00
Brian Paul
7c6a897275 st/mesa: additional assertions in st_translate_mesa_program() 2010-07-08 08:51:22 -06:00
Eric Anholt
25cda5039d mesa: Extend register lifetimes to the end of the largest loop required.
Previously, a register defined at main scope and used in a loop in a
loop could end up getting marked as needed only from the definition
outside of the loops to the end of the inner loop, and we would
cleverly slot in something else in its register in the end of the
outer loop.

Fixes glsl-vs-loop-nested and glsl-fs-loop-nested on glsl2.  This
doesn't happen much on master because the original compiler does its
own register allocation, so we find little we can do with linear scan
register (re)allocation.
2010-07-07 21:33:38 -07:00
Zack Rusin
396f2cd94f slang: fix typos 2010-07-08 00:33:31 -04:00
Zack Rusin
f11e25ee95 slang: add some comments related to geometry shaders 2010-07-08 00:28:29 -04:00
Zack Rusin
7c42390453 gs: inject const int gl_VerticesIn at link time 2010-07-08 00:28:29 -04:00
Eric Anholt
f632a330ec mesa: Fix documentation of BranchTarget for BRK.
It was changed in 2009 and the comment wasn't updated.
2010-07-07 21:00:32 -07:00
Eric Anholt
152b55e74d glsl2: Add support for gl_PointCoord in 1.20.
Fixes glsl-fs-pointcoord on swrast (remains broken on 965, like master)
2010-07-07 19:45:22 -07:00
Brian Paul
6988f65e43 mesa: initial support for new GL 3.0 texture formats 2010-07-07 20:26:33 -06:00
Eric Anholt
ea2a03f0a5 ir_to_mesa: Fix the assertion on LHS array derefs to DWIM.
This allows array derefs of matrices now, which makes idr's GLSL demo
happy.
2010-07-07 17:59:50 -07:00
Eric Anholt
ffd24b0a68 ir_to_mesa: Add support for constant matrices (untested). 2010-07-07 17:49:05 -07:00
Eric Anholt
b4d0c0e0ee ir_to_mesa: Add support for adding/subtracting matrices.
This isn't really tested, but didn't break normal vector add/sub.
2010-07-07 17:27:06 -07:00
Eric Anholt
69676fc6a3 ir_to_mesa: Don't assert that we can't assign matrices. It should work now. 2010-07-07 17:27:04 -07:00
Eric Anholt
9968f1b23c ir_to_mesa: Only allocate a vector per column of a matrix. 2010-07-07 16:37:48 -07:00
Eric Anholt
7d8091f7cc ir_to_mesa: Add support for assignment of aggregates. 2010-07-07 16:37:48 -07:00
Eric Anholt
9b68b88e43 ir_to_mesa: Add support for matrix * matrix. 2010-07-07 16:37:48 -07:00
Kenneth Graunke
e024c5c690 ir_reader: Don't emit ir_function multiple times. 2010-07-07 16:37:48 -07:00
Brian Paul
d95b40759e gallivm: restore const qualifier 2010-07-07 17:36:43 -06:00
Brian Paul
b17fba92db gallivm: fix cube map LOD computation
First, this undoes commit e503af4baa
so we use iround() in lp_build_nearest_mip_level().

Second, in lp_build_sample_general() we need to check if we're sampling
a cube map before anything else.  Choose the cube face and then recompute
the partial derivatives of (S,T) with respect to the chosen cube face.
Before, we were using the directional (S,T,R) derivatives to compute
the LOD.

Third, work around an apparent bug in LLVM 2.7 where setting the lod
variable to a const(0) value results in bad x86 code.  See comments in
the code.
2010-07-07 17:33:43 -06:00
Ian Romanick
35c89204e5 linker: Use bit-0 instead of VERT_BIT_GENERIC0
Uses of the bits for allocation are offset by 16, and
VERT_BIT_GENERIC0 already has the 16 offset.  As a result, it was
preventing the wrong thing from being allocated.
2010-07-07 16:28:39 -07:00
Eric Anholt
0b74bbb3dc glsl: Fix the setup of refract()'s output for vec3/vec4 and k < 0.0.
caught by valgrind.
2010-07-07 14:55:33 -07:00
Eric Anholt
9cbd8a1d5a glsl2: Fix ir_div_to_mul_rcp for integer division.
rcp of an integer value did not produce the result you're looking for.
Instead, do the a * rcp(b) as float and truncate after.  This mostly
fixes glsl-fs-loop-nested.
2010-07-07 14:06:26 -07:00
Eric Anholt
43b5b03d67 glsl2: Actually add the declaration of _post_incdec_temp. 2010-07-07 14:06:26 -07:00
Kenneth Graunke
acf88f2769 ir_constant_expression: Fix loop increments. 2010-07-07 12:41:26 -07:00
Kenneth Graunke
388ab9fa6b glsl2: Initialize yylineno and yycolumn so line numbers are sane. 2010-07-07 12:41:26 -07:00
Ian Romanick
e78e0fa42b glsl2: Put the initializer in the instruction stream after the declaration 2010-07-07 12:41:26 -07:00
Ian Romanick
c44556317a exec_list: Add method to append one complete list to another 2010-07-07 12:41:26 -07:00
Ian Romanick
2e85f993d8 Revert "glsl2: Put the declaration in the instruction stream before its initializer."
This change causes segfaults in other tests.  A fix for both sets of
segfaults is coming.

This reverts commit d4d630b72c.
2010-07-07 12:41:26 -07:00
Brian Paul
9755539116 st/mesa: fix sampler max_lod computation
This change makes gallium behave like other GL implementations and fixes
a conformance failure.
2010-07-07 13:05:35 -06:00
Eric Anholt
76101f7c04 ir_to_mesa: Add support for gl_TextureMatrix access.
Fixes glsl-vs-texturematrix-1, and glsl-vs-texturematrix-2 on swrast.
2010-07-07 11:51:36 -07:00
Eric Anholt
8bb15c1ed5 ir_to_mesa: Fill in some uninitialized fields that sometimes contained junk. 2010-07-07 11:39:21 -07:00
Andre Maasikas
51c438feb7 r600: workaround 3 comp GL_SHORT vertex attribute format on r700
guess it's a hw errata?
2010-07-07 21:32:07 +03:00
Eric Anholt
d674ebcee0 glsl2: Add a pass to simplify if statements returning from both sides.
This allows function inlining making the following tests work even
without function calls implemented:
glsl-fs-functions-2
glsl-fs-functions-3
glsl-vs-functions
glsl-vs-functions-2
glsl-vs-functions-3
glsl-vs-vec4-indexing-5

(Note that those tests were designed to trigger actual function calls,
and this defeats them.  However, those testcases ended up catching the
bug in the previous commit.)
2010-07-07 09:10:48 -07:00
Eric Anholt
6de882334a glsl2: Clean up vec_index_to_cond_assign after the clone return type change. 2010-07-07 09:07:52 -07:00
Eric Anholt
773025b92c glsl2: Don't forget to walk the parameters to a function in the hv.
Fixes segfaults from use after free after the steal of ir nodes and
free of the compile context.
2010-07-07 09:07:52 -07:00
Eric Anholt
570dc0d400 glsl2: Avoid null deref in scalar constant unop expressions. 2010-07-07 09:07:52 -07:00
Brian Paul
84a5f27b9b glsl: use Elements() in arrays instead of sentinal values
The _slang_*_output_name() functions had one too many loop iterations
because of the sentinal end-of-list values in the vertOutput array.
Just use Elements() everywhere.
2010-07-07 09:00:00 -06:00
Eric Anholt
d4d630b72c glsl2: Put the declaration in the instruction stream before its initializer.
This fixes a regression in the generated code from when I did the
ir_validate.cpp-driven rework of assignments.
2010-07-06 18:49:24 -07:00
Eric Anholt
a36334be02 glsl2: Add pass for supporting variable vector indexing in rvalues.
The Mesa IR needs this to support vector indexing correctly, and
hardware backends such as 915 would want this behavior as well.

Fixes glsl-vs-vec4-indexing-2.
2010-07-06 18:49:24 -07:00
Eric Anholt
2d1789e667 ir_to_mesa: Add support for conditional moves.
Nothing generates conditional moves yet.
2010-07-06 18:49:24 -07:00
Ian Romanick
ca088cc277 glsl2: Clone methods return the type of the thing being cloned
This is as opposed to returning the type of the base class of the hierarchy.
2010-07-06 17:44:37 -07:00
Kenneth Graunke
f14e596f11 ir_constant_expression: Declare loop counting variables in the loops.
Fixes "name lookup of 'c' changed" warning.
2010-07-06 17:43:56 -07:00
Vinson Lee
c89ea8f213 llvmpipe: Don't build lp_test_round when using MSVC.
lp_test_round uses the math functions round and trunc, which aren't
available with MSVC.

Fixes the MSVC build for now.
2010-07-06 17:25:39 -07:00
Vinson Lee
2e423ac074 llvmpipe: Add lp_test_round to SCons build. 2010-07-06 16:18:32 -07:00
Kenneth Graunke
f2dfac6d74 glsl2: Update TODO. 2010-07-06 16:03:33 -07:00
Kenneth Graunke
3f4a0b8bb0 ir_constant_expression: Add support for dot products. 2010-07-06 16:03:33 -07:00
Kenneth Graunke
cf80a4d177 ir_constant_expression: Add support for matrix multiplication.
Also handles matrix/vector and vector/matrix multiplication.

Fixes piglit tests const-matrix-multiply-01.frag,
const-matrix-multiply-02.frag, and const-vec-mat.frag.
2010-07-06 16:03:33 -07:00
Kenneth Graunke
37b3f9d0ed ir_constant_expression: Support scalar * vector and scalar * matrix.
The test here is slightly different since we need to keep matrix
multiplication separate.

Fixes piglit tests const-vec-scalar-03.frag and const-mat-scalar-03.frag.
2010-07-06 16:03:33 -07:00
Kenneth Graunke
dad35eb8b0 ir_constant_expression: Support scalar / vector and scalar / matrix.
Fixes piglit tests const-vec-scalar-04.frag and const-mat-scalar-04.frag.
2010-07-06 16:03:33 -07:00
Kenneth Graunke
97b44f040a ir_constant_expression: Support scalar - vector and scalar - matrix.
Fixes piglit tests const-vec-scalar-02.frag and const-mat-scalar-02.frag.
2010-07-06 16:03:33 -07:00
Kenneth Graunke
e74dcd7924 ir_constant_expression: Support scalar + vector and scalar + matrix.
Fixes piglit tests const-vec-scalar-01.frag, const-vec-scalar-05.frag,
and const-mat-scalar-01.frag.
2010-07-06 16:03:33 -07:00
Kenneth Graunke
6fc983b9bb ir_constant_expression: Assert that both operands share a base type. 2010-07-06 16:03:33 -07:00
Kenneth Graunke
6bc432e14e ir_constant_expression: Initialize op[0] and op[1] to NULL.
This makes it easy to check if there is a second argument.
2010-07-06 16:03:33 -07:00
Kenneth Graunke
c63a1db81f ir_constant_expression: Initialize all components of constant data to 0.
This is probably just a good idea, and will come in useful when
implementing things like matrix multiplication.
2010-07-06 16:03:32 -07:00
Vinson Lee
ff318c45ec egl: Remove unnecessary headers. 2010-07-06 16:02:49 -07:00
Vinson Lee
9ead6c129f draw: Remove unnecessary header. 2010-07-06 15:49:40 -07:00
Vinson Lee
01985390be gallivm: Remove unnecessary header. 2010-07-06 15:45:31 -07:00
Marek Olšák
98cb202444 util: print help for debug options on non-debug builds
I'd like to see the help when I request it.
2010-07-07 00:12:49 +02:00
Ian Romanick
d1a1ee583e Add hash table helper functions for using pointers as hash keys 2010-07-06 15:00:46 -07:00
Ian Romanick
e45a982313 Make hashtable.h be C++ friendly 2010-07-06 15:00:46 -07:00
Eric Anholt
a0b3b93029 ir_to_mesa: Use the compiler-assigned locations for builtin attrs/varyings.
The previous table didn't distinguish gl_Color for the VS and FS, so
we would use the FS's attribute index for the VS and read undefined.
This partially fixes glsl-routing to match its behavior on master.
2010-07-06 14:05:51 -07:00
Brian Paul
e503af4baa gallivm: use trunc, not round in lp_build_nearest_mip_level()
Fixes fd.o bug 28036 (piglit fbo-cubemap.c regression)
2010-07-06 13:22:57 -06:00
Brian Paul
7743791da0 llvmpipe: add test program for round(), trunc(), floor(), ceil() 2010-07-06 11:36:37 -06:00
Brian Paul
e834c48100 gallivm: finish implementation of lp_build_iceil()
Plus fix minor error in lp_build_iceil() by tweaking the offset value.
And add a bunch of comments for the round(), trunc(), floor(), ceil()
functions.
2010-07-06 11:36:37 -06:00
Zack Rusin
99c8d9b6da llvmpipe: disconnect vertex texture sampling from the setup
it was wrong to put this in the fs paths, but it was easier to just
stuff it along the fragment texture sampling paths. the patch
disconnects vertex texture sampling and just maps the textures
before the draw itself and unmaps them after.
2010-07-06 13:29:04 -04:00
Zack Rusin
ca88683459 draw: make sure softpipe doesn't crash with vertex tex sampling
softpipe doesn't implement the draw's llvm tex sampling interface
so make sure draw can handle the cases where the driver doesn't
implement the interface
2010-07-06 13:29:04 -04:00
Zack Rusin
01eebfe1b6 draw: implement vertex texture sampling using llvm 2010-07-06 13:29:04 -04:00
Tom Stellard
ce929d8210 r300/compiler: Implement KILP opcode.
Signed-off-by: Marek Olšák <maraeo@gmail.com>
2010-07-06 18:45:32 +02:00
José Fonseca
88b6abfba5 gallivm: Use SSE4.1's BLENDV instructions for lp_build_select(). 2010-07-06 11:53:15 +01:00
José Fonseca
b3d4e5bd26 gallivm: Fix 8bit comparisons. 2010-07-06 11:53:15 +01:00
Alan Hourihane
5a723afabb llvmpipe: ensure all bins are reset avoids memory corruption. 2010-07-06 11:42:18 +01:00
Chia-I Wu
32a9b2799e mesa: Always initialize transform feedback state.
Assert ctx->Driver.NewTransformFeedback if the feature is enabled;  Use
the default callbacks otherwise.  The rest of core mesa expects the
state to be initialized.
2010-07-06 17:03:32 +08:00
Chia-I Wu
f2aa361f3b egl: Rework driver loading.
Driver loading is now splitted into two stages.  In the first stage, an
_EGLModule is created for each driver: user driver, default drivers, and
all files in the search directories that start with "egl_".  Modules are
not loaded at this stage.

In the second stage, each module is loaded to initialize a display.  The
process stops at the first module that can initialize the display.

If eglGetProcAddress is called before eglInitialize, the same code path
will be taken to find the first module that supports
EGL_DEFAULT_DISPLAY.  Because we do not want to initialize the display,
drv->Probe is used instead in this case.
2010-07-06 16:16:39 +08:00
Chia-I Wu
cf588ab3f1 st/egl: Add support for !GLX_DIRECT_RENDERING.
st/egl uses GLX code for DRI2 support.  It should honor
GLX_DIRECT_RENDERING.

Also updates configure.ac to define GLX_DIRECT_RENDERING for st/egl.
2010-07-06 15:27:09 +08:00
Brian Paul
abd5627a6a mesa: initial support for unnormalized integer texture formats
As defined by GL_EXT_texture_integer.
2010-07-05 20:14:39 -06:00
Corbin Simpson
e54164b4e3 auxiliary/util: Add SM3 meta-cap list. 2010-07-05 14:59:12 -07:00
Roland Scheidegger
3ed0a099c7 llvmpipe: wait for queries being finished when asked for it or before deletion
This fixes bug #28757, though does not yet address the issue that fences aren't
always emitted.
2010-07-05 17:17:50 +02:00
Vinson Lee
a3b0aaf26f i915g: Remove unnecessary header. 2010-07-04 11:34:15 -07:00
Jakob Bornecrantz
2d818ed0f8 i915g: Add flag to not send commands to hw 2010-07-04 13:32:02 +01:00
Jakob Bornecrantz
34bd0569d3 i915g: If the kernel reject the batchbuffer print it then assert 2010-07-04 13:32:02 +01:00
Jakob Bornecrantz
50f17a001f i915g: Minor cleanups 2010-07-04 13:32:02 +01:00
Jakob Bornecrantz
57fc2ad7a1 i915g: Make batchbuffer flush function not be inline 2010-07-04 13:32:02 +01:00
Jakob Bornecrantz
ded664b1ac i915g: Rename texture state to map state 2010-07-04 13:32:01 +01:00
Jakob Bornecrantz
8b122bdf6c i915g: Move fragment state to its own file 2010-07-04 13:32:01 +01:00
Jakob Bornecrantz
d64561472b i915g: Move static state to its own file 2010-07-04 13:32:01 +01:00
Jakob Bornecrantz
7174038e29 i915g: Don't dirty dynamic state if it hasn't changed 2010-07-04 13:32:01 +01:00
Jakob Bornecrantz
22d4d5fc3f i915g: Don't flush after blit 2010-07-04 13:32:01 +01:00
Jakob Bornecrantz
62bcf2e6ad i915g: Don't flush empty batchbuffers 2010-07-04 13:32:01 +01:00
Jakob Bornecrantz
ed5ce78b81 gallium: Make trivial examples use target helpers 2010-07-04 13:31:55 +01:00
Jakob Bornecrantz
abbb96b2fe gallium: Fix compilation of trivial quad-tex 2010-07-04 13:09:13 +01:00
Vinson Lee
1f0bcce6be st/egl: Remove unnecessary headers. 2010-07-03 19:28:31 -07:00
Chia-I Wu
b365b150a1 docs: Update EGL doc.
Updated for the reorganization of st/egl targets.
2010-07-03 17:20:52 +08:00
Chia-I Wu
40ef298641 mesa: Fix OpenGL ES-only builds.
Check FEATURE_GL in _mesa_init_shader_dispatch and
_mesa_init_shader_uniform_dispatch.  OpenGL ES can not and does not use
_mesa_init_<...>_dispatch.  This is supposed to be temporary.  Ideally,
a more flexible way for initializing dispatch tables should be
developed.
2010-07-03 16:48:36 +08:00
nobled
c43ab4fe1f egl: Always use EGLAPIENTRY in api function prototypes
Fixes the build on Windows.
2010-07-03 16:36:43 +08:00
Vinson Lee
fbc4b88e76 gallivm: Remove unnecessary headers. 2010-07-03 01:04:50 -07:00
Marek Olšák
0e6d7ce017 r300g: fix warnings 2010-07-03 04:32:41 +02:00
Tom Stellard
7da9e1e61b r300/compiler: Fix loop unrolling 2010-07-03 04:32:41 +02:00
Tom Stellard
f381c52081 r300/compiler: Use hardware flow control instructions for loops on r500. 2010-07-03 04:32:31 +02:00
Tom Stellard
3c3b7e02eb r300g: Fix typo in r300_reg.h 2010-07-03 04:27:09 +02:00
Tom Stellard
0dbdcb4321 r300/compiler: Don't continue copy propagation inside loops. 2010-07-03 04:27:09 +02:00
Tom Stellard
7f57530943 r300/compiler: Print debug info for flow control instructions. 2010-07-03 04:27:09 +02:00
Tom Stellard
82d0602c1f r300/compiler: Enable hardware IF statements for r500 cards. 2010-07-03 04:27:09 +02:00
Tom Stellard
1732751242 r300/compiler: In the peephole optimizer, ELSE should mark the end of a
block.
2010-07-03 04:27:09 +02:00
Tom Stellard
29a1d6aee7 r300/compiler: Correctly calculate the max number of iterations for loops. 2010-07-03 04:27:09 +02:00
Tom Stellard
697d666d78 r300/compiler: Handle loops in deadcode analysis.
This also allows us to split the loop emulation into two phases.  A
tranformation phase which either unrolls loops or prepares them to be
emulated, and the emulation phase which unrolls remaining loops until the
instruction limit is reached.  The second phase is completed after the
deadcode analysis in order to get a more accurate count of the number of
instructions in the body of loops.
2010-07-03 04:27:09 +02:00
Kenneth Graunke
83035574db Refresh autogenerated file builtin_function.cpp. 2010-07-02 18:20:19 -07:00
Kenneth Graunke
7e908a6a27 glcpp: Add #error support. 2010-07-02 18:03:58 -07:00
Kenneth Graunke
2070f9f5be glsl2: Fix for dead strings being stored in the symbol table. 2010-07-02 18:03:58 -07:00
Kenneth Graunke
e2a358348b ir_to_mesa: Fix uninitalized value. 2010-07-02 18:03:58 -07:00
Kenneth Graunke
ddc3aa0783 glsl2/builtins: Use vector ops in the 130 version of "sign." 2010-07-02 18:03:58 -07:00
Kenneth Graunke
9a7ac272fb glsl2/builtins: Use vector ops in "smoothstep." 2010-07-02 18:03:58 -07:00
Brian Paul
91c37599f6 osmesa: remove old renderbuffer before adding new
Fixes fd.o bug 10966 when OSMesaMakeCurrent() was called twice.

NOTE: This is a candidate for the 7.8 branch.
2010-07-02 18:22:53 -06:00
Brian Paul
7cc58c1992 mesa: updated instruction comments 2010-07-02 18:22:53 -06:00
Eric Anholt
b0ac07e3de ir_to_mesa: Fix up implementation of ir_unop_exp.
OPCODE_EXP is not to ir_unop_exp what OPCODE_EX2 is to ir_unop_exp2.
It's the weird VP approximation helper opcode.  Just implement it with
OPCODE_POW instead.

Fixes glsl-fs-exp.
2010-07-02 17:06:32 -07:00
Eric Anholt
4e7d5d0e74 i965: Add support for the DP2 opcode, which we use for dot(vec2, vec2).
The original glsl compiler would generate a.x * b.x + a.y * b.y, which
we would do mul+mul+add for instead of this mul+mac.

Fixes glsl-fs-dot-vec2.
2010-07-02 17:06:23 -07:00
Eric Anholt
8f25d198e5 ir_to_mesa: Add support for scalar * mat, vec * mat.
This is not tested by piglit currently.
2010-07-02 17:06:08 -07:00
Eric Anholt
b61f4241f3 ir_to_mesa: Add support for shadow comparison to texture instructions.
piglit lacks tests for this currently.
2010-07-02 17:06:06 -07:00
Eric Anholt
d3983ca032 ir_to_mesa: Move projection handling out of ir_tex so txb and txl get it.
Fixes:
glsl-fs-texture2dproj-bias
glsl-fs-texture2dproj-bias-2
2010-07-02 17:06:05 -07:00
Ian Romanick
4d962e66e3 glsl2: Print the linking info log in the stand-alone compiler 2010-07-02 14:57:07 -07:00
Eric Anholt
de75dfac4e ir_to_mesa: Add support for projected non-shadow/bias/lod texturing.
Fixes:
glsl-fs-texture2dproj
glsl-fs-texture2dproj-2
2010-07-02 14:50:02 -07:00
Brian Paul
ae8164a67b mesa: add geometry shader fields to gl_shader_program
These 3 fields are per shader-program.  Copy them into the geometry
program at link time for convenient access later.

Also, add some missing glGetProgramiv() queries.
2010-07-02 15:36:14 -06:00
Eric Anholt
cab95c228b ir_to_mesa: Fix sparse swizzling of src regs when a writemask is present.
Fixes glsl-fs-texture2d-masked.
2010-07-02 14:08:20 -07:00
Eric Anholt
28faa12dc2 ir_to_mesa: Don't forget to run the Mesa IR optimization passes.
With how we generate assignments, the trivial copy propagation in it
is really important, and some drivers will really want the register
allocation, too.
2010-07-02 11:38:02 -07:00
Eric Anholt
9a0e421983 glsl2: Add a pass to break ir_binop_div to _mul and _rcp.
This results in constant folding of a constant divisor.
2010-07-02 11:27:06 -07:00
José Fonseca
d981bde384 gallivm: Do 4ubyte AoS texture filtering for any format that can be expressed.
Except if it has only one channel, as it would take the same number of
instructions.
2010-07-02 18:45:49 +01:00
José Fonseca
e70b20fa83 gallivm: Use util_format_description::fetch_rgba_8unorm() when available. 2010-07-02 18:45:49 +01:00
José Fonseca
a2d360b915 util: Add a fetch_rgba_8unorm.
Not always implemented, but useful in situations where we want 8unorms
and the samples comes as 8unorms as we needlessly convert to/from
floats.
2010-07-02 18:45:49 +01:00
José Fonseca
7071eefdb2 gallivm: Support multiple pixels in lp_build_fetch_rgba_aos().
This allows to do the unpacking of formats that fit in 4 x unorm8 in
parallel, 4 pixels at a time.
2010-07-02 18:45:49 +01:00
José Fonseca
eb20c57f03 gallivm: Move lp_build_rgba8_to_f32_soa() to lp_bld_format_soa.c
It will be more useful here.
2010-07-02 18:45:49 +01:00
José Fonseca
bb1546f55b gallivm: Move gather functions to its own module.
They need to grow, and they provide basic functionality which is not
specific to sampling.
2010-07-02 18:45:49 +01:00
José Fonseca
e29ef44cf1 gallivm: Check inputs/outputs in lp_build_conv() 2010-07-02 18:45:49 +01:00
José Fonseca
9b69545c42 util: Expose util_format_fits_8unorm(). 2010-07-02 18:45:48 +01:00
Brian Paul
6e83420ee0 mesa: fix texenv generation when num color bufs == 0
Before, if there were no color buffers enabled (with glDrawBuffers(GL_NONE))
when the texenv program was generated, we'd emit writes to OUTPUT[1] but
the OutputsWritten mask was 0.  This inconsistency caused an assertion to
fail later in the Mesa->TGSI translation.

Fixes fd.o bug 28169

NOTE: this is a candidate for the 7.8 branch (and depends on commit
b6b9b17d27).
2010-07-02 10:16:08 -06:00
Brian Paul
7a5a0b205e softpipe: fix incorrect blend func index passed to blend_quad()
Need to pass the index indicating which blend terms to use, not which
color buffer we're blending into.

Rename the parameter to blend_quad() and add comments to be more clear
about this.
2010-07-02 09:56:57 -06:00
Brian Paul
fbc6c316d2 softpipe: better assertions 2010-07-02 09:53:08 -06:00
Brian Paul
291bcfd831 mesa: add missing error checks in _mesa_program_parameteri() 2010-07-02 09:09:06 -06:00
Brian Paul
e3c961de36 main: change some GS field types, added comments 2010-07-02 09:07:36 -06:00
Brian Paul
b6b9b17d27 mesa: make the number of draw buffers part of the texenv program key state
All the state that effects the program should be in the key.
This didn't help with bug 28169 but is a good fix anyway.

NOTE: this is a low-priority candidate for the 7.8 branch.  In practice,
this issue might never be hit.
2010-07-02 08:14:54 -06:00
Brian Paul
e845765f0f gallium/cso: check for set_vertex_sampler_views != NULL before calling it
Not all drivers implement this method.
Fixes regression reported by Chris Rankin and bug 28889.
2010-07-02 08:08:22 -06:00
José Fonseca
53d3f0c788 mesa: Silence warning. 2010-07-02 11:50:01 +01:00
José Fonseca
3cc4301c14 gallivm: Code generate YUV format unpacking. 2010-07-02 11:50:01 +01:00
José Fonseca
37f4c2f906 gallivm: Fix 4 x unorm8 -> 4 x float conversion.
Also fix the test.
2010-07-02 11:50:00 +01:00
Dave Airlie
8556b77c56 r600: use gallium list macros instead of making our own.
before this change, r600 glxinfo segfaulted in the list code, and I wasn't
debugging another linked list implementation, its 2010 after all.

So add the two missing list macros to the gallium header from X.org list header file (after fixing them), then port all r600 lists to the new header.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-07-02 15:27:17 +10:00
Ian Romanick
667f4e1940 glsl2: Conditionally allow optional extensions to be enabled
The only optional extension currently supported by the compiler is
GL_EXT_texture_array.
2010-07-01 20:40:08 -07:00
Ian Romanick
efb6b24223 glsl2: Append _TOK to some parser tokens
This prevents conflicts with defines elsewhere in Mesa and allows
including mtypes.h in the compiler.
2010-07-01 20:40:08 -07:00
Ian Romanick
06143ea094 glsl2: Conditionally define preprocessor tokens for optional extensions
The only optional extension currently supported by the compiler is
GL_EXT_texture_array.
2010-07-01 20:40:08 -07:00
Ian Romanick
2d12236117 glsl2: Define preprocessor tokens for extensions
Currently only GL_ARB_draw_buffers and GL_ARB_texture_rectangle are
defined because those extensions are always enabled.  This make
tex_rect-03.frag pass.
2010-07-01 20:40:08 -07:00
Ian Romanick
6f0823da09 glsl2: Support AST-to-IR translation of invariant keyword 2010-07-01 20:39:08 -07:00
Brian Paul
44732103b2 mesa: extension flags and version testing for GL 3.x features 2010-07-01 20:03:32 -06:00
Brian Paul
120a9f46cd mesa: entrypoints for GL 3.1 primitive restart 2010-07-01 20:03:31 -06:00
Ian Romanick
3832706f81 glsl2: Initialize ast_declarator_list::invariant in constructor 2010-07-01 17:10:11 -07:00
Ian Romanick
12873fa4e3 glsl2: Don't bounds check unsize array redeclarations
This along with several previous commits fix test CorrectUnsizedArray.frag.
2010-07-01 14:10:19 -07:00
Ian Romanick
127308b4be glsl2: Add gl_MaxTextureCoords 2010-07-01 13:30:50 -07:00
Ian Romanick
cd00d5b88c glsl2: Default delcaration of gl_TexCoord is unsized 2010-07-01 13:17:54 -07:00
Dan Nicholson
442c37e2ef Use GLW_CFLAGS when building libGLw
We check for libX11 and libXt, so we might as well use the CFLAGS
pkg-config tells us about.
2010-07-01 13:00:02 -07:00
John Hein
9617254a1e Use GLUT_CFLAGS when building glut
Fix this build error (in MesaGLUT-7.6.1)...
glut_cmap.c:23:66: error: X11/Xmu/StdCmap.h: No such file or directory

...by not preventing the cflags that pkg-config finds for glut dependencies
(including 'xmu') from being used.

Defining GLUT_CFLAGS before running the pkg-config prevents the
cflags found by pkg-config from being used.

This patch lets GLUT_CFLAGS that configure & pkg-config work
so hard to set actually get used.

Also make sure the generated configs/autoconf defines GLUT_CFLAGS
used in (at least) src/glut/glx/Makefile.

Signed-off-by: Dan Nicholson <dbn.lists@gmail.com>
2010-07-01 13:00:02 -07:00
Ian Romanick
5466b63968 glsl2: Change order of semaintic checks on variable declarations
This will make it easier to support more (valid) kinds of redeclarations.
2010-07-01 12:56:49 -07:00
Fernando Carrijo
d2fe97a209 mesa: Purge macros NEED_EVENTS and NEED_REPLIES
Signed-off-by: Fernando Carrijo <fcarrijo@yahoo.com.br>
Signed-off-by: Brian Paul <brianp@vmware.com>
2010-07-01 13:07:07 -06:00
Brian Paul
1d298a3764 gallium/cso: unbind sampler views in cso_release_all() 2010-07-01 13:07:07 -06:00
Brian Paul
5b90f83aee mesa: free xform feedback hash table 2010-07-01 13:07:07 -06:00
Brian Paul
30f46e7b4c st/mesa: fix comment 2010-07-01 13:07:07 -06:00
Eric Anholt
411fb36b7c ir_to_mesa: Fill in remaining ops, remove default case for expression types.
We should now have support for all the expression types we need for
GLSL 1.20.
2010-07-01 11:24:38 -07:00
Eric Anholt
8761fcc2bf ir_to_mesa: Add support for ir_unop_rcp.
This isn't used at the moment, but will be soon.
2010-07-01 11:23:02 -07:00
Eric Anholt
d1b07167b9 glsl2: Update README for what I've been thinking about with expr types work. 2010-07-01 11:07:58 -07:00
Eric Anholt
8a1f186cc5 glsl2: Add a pass to convert mod(a, b) to b * fract(a/b).
This is used by the Mesa IR backend to implement mod, fixing glsl-fs-mod.
2010-07-01 11:07:23 -07:00
Eric Anholt
9acf618f24 glsl2: Remove dead member from dead code visitor. 2010-07-01 11:07:22 -07:00
Eric Anholt
d925c91730 glsl2: Add ir_unop_fract as an expression type.
Most backends will prefer seeing this to seeing (a - floor(a)), so
represent it explicitly.
2010-07-01 11:07:22 -07:00
Brian Paul
17c176eb73 llvmpipe: silence pointer type warnings 2010-07-01 09:15:31 -06:00
José Fonseca
8d93f360c5 gallivm: Support 4 x unorm8 in lp_build_fetch_rgba_aos().
Uses code and ideas from Brian Paul.
2010-07-01 15:02:17 +01:00
José Fonseca
b919bb7f61 gallivm: Allow to conversions to/from registers of different sizes.
Allow for example to convert from 4 x float32 to 4 x unorm8 and vice versa.

Uses code and ideas from Brian Paul.
2010-07-01 15:02:15 +01:00
José Fonseca
a70ec096aa gallivm: Support extended swizzles in lp_build_swizzle1_aos().
And rename to lp_build_swizzle_aos().
2010-07-01 15:02:12 +01:00
José Fonseca
e277d5c1f6 gallivm: Setup a global optimization pass.
Modules are still free to setup their own optimization passes, but for the
normal case it should not be necessary.
2010-07-01 15:02:10 +01:00
José Fonseca
83ced5a918 llvmpipe: Remove lp_build_swizzle2_aos().
Unnecessary special case.
2010-07-01 15:02:04 +01:00
Eric Anholt
5e4dd061d1 ir_to_mesa: Add support for discard instructions.
Fixes glsl-fs-discard-01.
2010-06-30 17:31:06 -07:00
Eric Anholt
f5b3b2a01a glsl2: Don't break sign() down by vector components. 2010-06-30 17:29:12 -07:00
Eric Anholt
3acd92a91f ir_to_mesa: Add support for ir_unop_sign.
Fixes glsl-fs-sign, glsl-vs-sign.
2010-06-30 17:29:12 -07:00
Eric Anholt
e558786a3e i965: Add support for OPCODE_SSG.
The old compiler didn't use SSG, and instead emitted SGT/SGT/SUB.  We
can do a little better for SSG than we do for the SGT series.
2010-06-30 17:29:09 -07:00
Eric Anholt
d6ebe9b16b ir_to_mesa: Add missing no-op type conversions.
Fixes glsl-fs-step.
2010-06-30 16:23:32 -07:00
Eric Anholt
02d615306e glsl2: Fix reversed value of step().
It's 0.0 if x < edge, not 1.0.  Partial fix for glsl-fs-step.
2010-06-30 16:23:15 -07:00
Eric Anholt
e64a4aaacb ir_to_mesa: Note which of our expr ops are unsupported 1.30 features. 2010-06-30 16:18:06 -07:00
Eric Anholt
4e16a7b526 glsl2: Fix up the implementation of fract() for vector types.
There's no need to split each vector component out, just do vector ops.
2010-06-30 15:59:07 -07:00
Eric Anholt
285ff93819 ir_to_mesa: Initialize the (we never use it) abs field of Mesa src regs. 2010-06-30 15:49:04 -07:00
Eric Anholt
ea6b34cce4 ir_to_mesa: Send the negate field on to Mesa IR.
Fixes glsl-fs-neg.
2010-06-30 15:47:11 -07:00
Eric Anholt
698b844443 ir_to_mesa: When generating a swizzle, respect the reg's current swizzle.
Fixes depth-tex-modes-glsl.
2010-06-30 15:30:00 -07:00
Kenneth Graunke
77049a702a glsl2: Implement AST->HIR support for the "discard" instruction. 2010-06-30 14:54:58 -07:00
Kenneth Graunke
16efab1c4d glsl2: Define new ir_discard instruction. 2010-06-30 14:54:58 -07:00
Eric Anholt
88c20c46b8 ir_to_mesa: Support gl_FragDepth.
Fixes glsl-bug-22603.
2010-06-30 14:55:45 -07:00
Eric Anholt
97eba76b8c glsl2: Allow a fragment shader to not write a color.
I can't find any text justifying this check, and it caused a
reasonable-looking shader in glsl-bug-22603 (which writes only
gl_FragDepth) to fail.
2010-06-30 14:51:50 -07:00
Eric Anholt
3e2127b9de mesa: Don't look in unallocatd param slots for parameter values.
glsl-derivs would add 40.0, 0.0, and 1.0 in order.  When we went
looking for 0.0, we'd find it in the second slot of the param, and use
it, but param->Size would still be 1.  When we went to add 1.0 and
didn't find it, we'd put allocate it to that second slot and the 0.0
would actualy end up being 1.0.

Fixes glsl-derivs, glsl-deriv-varyings.
2010-06-30 14:46:06 -07:00
Eric Anholt
c64da87611 ir_to_mesa: Fix the indexing of attributes in the program's Attributes.
This fixes GetAttribLocation returning VERT_ATTRIB_GENERIC1 instead of 1,
caught by glsl-dlist-getattriblocation.
2010-06-30 14:44:14 -07:00
Kenneth Graunke
c7f4ff193a glsl2: Fix storing of dead memory in the symbol table.
decl->identifier is part of the AST, so it doesn't live very long.
Instead, add var->name which is owned by var.
2010-06-30 13:52:24 -07:00
Kenneth Graunke
629198b96a glsl2: Preprocessed source doesn't need to live past compile time. 2010-06-30 13:52:24 -07:00
Kenneth Graunke
c6099a65f8 glsl2: Create new talloc contexts the "right" way. 2010-06-30 13:52:24 -07:00
Kenneth Graunke
953ff1283d glsl2: Use _mesa_glsl_parse_state as the talloc parent, not glsl_shader.
_mesa_glsl_parse_state should be the parent for all temporary allocation
done while compiling a shader.  glsl_shader should only be used as the
parent for the shader's final IR---the _result_ of compilation.

Since many IR instructions may be added or discarded during optimization
passes, IR should not ever be allocated to glsl_shader directly.

Done via sed -i s/talloc_parent(state)/state/g and s/talloc_parent(st)/st/g.

This also removes a ton of talloc_parent calls, which may help performance.
2010-06-30 13:52:24 -07:00
Kenneth Graunke
116f1d4f95 glsl2: Steal the live IR and free the rest of the junk. 2010-06-30 13:52:24 -07:00
Brian Paul
fb06b543a5 llvmpipe: another null pointer check 2010-06-30 14:05:45 -06:00
Brian Paul
2b3e1ad731 llvmpipe: use dummy tile when out of memory 2010-06-30 14:05:45 -06:00
Ian Romanick
ef5f194831 linker: Don't dynamically allocate slots for linked shaders
The can be at most one shader per stage.  There are currently only two
stages.  There is zero reason to dynamically size this array.
2010-06-30 12:20:44 -07:00
Eric Anholt
edcb9c2b06 ir_to_mesa: Tell Mesa about our choices for vertex attribute locations. 2010-06-30 12:02:31 -07:00
Ian Romanick
982e3798d8 linker: Don't automatically allocate VERT_ATTRIB_GENERIC0 2010-06-30 12:02:11 -07:00
Eric Anholt
849e18153c glsl2: Use Mesa's gl_shader_program instead of our own struct glsl_program.
This avoids more allocation and shuffling of data around.
2010-06-30 12:01:42 -07:00
Eric Anholt
0eda9ae0a6 glsl2: Make function names and variable names be children of the node.
This avoids losing their memory when the parser state is freed.
2010-06-30 11:52:40 -07:00
Eric Anholt
16b68b1952 glsl2: Move our data from a glsl_shader* on the side to the main gl_shader *.
This saves recompiling at link time.  gl_shader->ir is made a pointer
so that we don't have to bring exec_list into mtypes.h.
2010-06-30 11:30:26 -07:00
Brian Paul
effd33071e llvmpipe: added new lp_memory.[ch] files
Functions for using dummy tiles when we detect OOM conditions.
2010-06-30 12:00:22 -06:00
Brian Paul
87d2c77ed3 draw: fix out of memory handling in polygon stipple stage 2010-06-30 11:46:17 -06:00
Neil Roberts
75acb896c6 glu: Fix some compiler warnings in libtess
When compiled with the more aggressive compiler warnings such as
-Wshadow and -Wempty-body the libtess code gives a lot more
warnings. This fixes the following issues:

* The 'Swap' macro tries to combine multiple statements into one and
  then consume the trailing semicolon by using if(1){/*...*/}else.
  This gives warnings because the else part ends up with an empty
  statement. It also seems a bit dangerous because if the semicolon
  were missed then it would still be valid syntax but it would just
  ignore the following statement. This patch replaces it with the more
  common idiom do { /*...*/ } while(0).

* 'free' was being used as a local variable name but this shadows the
  global function. This has been renamed to 'free_handle'

* TRUE and FALSE were being unconditionally defined. Although this
  isn't currently a problem it seems better to guard them with #ifndef
  because it's quite common for them to be defined in other headers.

https://bugs.freedesktop.org/show_bug.cgi?id=28845

Signed-off-by: Brian Paul <brianp@vmware.com>
2010-06-30 07:59:39 -06:00
Chia-I Wu
a8815b754d egl: Update MaxSize when a dynamic array is grown. 2010-06-30 18:52:00 +08:00
Chia-I Wu
98ebc8165c egl: Make _eglUnloadDrivers no-op on Windows.
Windows unloads DLLs before atexit.  Make _eglUnloadDrivers no-op on
Windows for now.
2010-06-30 18:32:48 +08:00
Chia-I Wu
c5bc0a8d66 st/egl: Manually free configs on terminate.
The configs should be FREE()ed, not free()ed.  We cannot rely on
_eglCleanupDisplay here.
2010-06-30 18:32:48 +08:00
Chia-I Wu
8b0c6c4a8d egl: Store screens in a dynamic array. 2010-06-30 18:32:48 +08:00
Chia-I Wu
6717a313f2 egl: Store configs in a dynamic array. 2010-06-30 18:32:48 +08:00
Chia-I Wu
106466783f egl: Add dynamic array.
Dynamic arrays will be used to store configs and screens of a display.
2010-06-30 18:32:48 +08:00
Chia-I Wu
2d8e70fcd5 st/vega: Match MALLOC/FREE for vg_shader.
A vg_shader is destroyed with FREE.
2010-06-30 18:32:48 +08:00
José Fonseca
a2311400fe llvmpipe: Add a new scene state to describe scenes which only have state changes.
It's a rare condition, but it may happen if all primitives are
clipped/culled.

For now we just do a no-op rasterization, but we could bypass it.
2010-06-30 11:10:33 +01:00
José Fonseca
4ca3e0d84b llvmpipe: Don't reset the bin when there's a zsbuf bound.
The previous rendering may have secondary effects on the zsbuf.

Fixes the missing tiles on gearbox.
2010-06-30 10:19:50 +01:00
nobled
f914cd1796 st/vega: s/free/FREE for matching MALLOC/CALLOC
[Manually fix a conflict in vg_context.c by Chia-I Wu]
2010-06-30 14:25:43 +08:00
nobled
78215b02e4 st/xorg: s/free/FREE for matching MALLOC/CALLOC 2010-06-30 14:16:20 +08:00
Chia-I Wu
8977879ec9 st/egl: Add egl-gdi target.
The target supports OpenVG on Windows with software rasterizer.  The
egl_g3d_loader defined by the target supports arbitrary client APIs and
window systems.  It is the SConscript that limits the support to OpenVG
and GDI.

This commit also fixes a typo in gdi backend.
2010-06-30 14:00:43 +08:00
Chia-I Wu
2f0b01826d mesa: Use fpclassify for GL_OES_query_matrix on OpenBSD and NetBSD.
Patch from Brad Smith <brad@comstyle.com>

  The attached patch allows the GL_OES_query_matrix function to use the
  systems fpclassify() for OpenBSD and NetBSD.
2010-06-30 13:01:10 +08:00
Zack Rusin
0d68d01347 mesa: make the arguments in the asm statemants optional
geometry shaders emit/end functions don't take any arguments
2010-06-29 21:45:41 -04:00
Eric Anholt
524745bc55 ir_to_mesa: Add support for ir_unop_abs. 2010-06-29 17:18:28 -07:00
Eric Anholt
ba9bd708cb ir_to_mesa: Add support for dFdx, dFdy. 2010-06-29 17:18:28 -07:00
Eric Anholt
d4f7e660dd ir_to_mesa: Start adding support for texture instructions.
Fixes:
glsl-fs-bug25902
glsl-fs-sampler-numbering
glsl-lod-bias
2010-06-29 17:18:28 -07:00
Kenneth Graunke
506199b852 glsl2: Keep the same number of components in implicit conversions.
Fixes piglit test glsl-implicit-conversion-01.
2010-06-29 16:31:52 -07:00
Ian Romanick
22971e922a glsl2: Make gl_MaxDrawBuffers available in the vertex shader 2010-06-29 15:32:19 -07:00
Ian Romanick
e2f84f04e5 glsl2: Make gl_MaxDrawBuffers available in the fragment shader 2010-06-29 15:32:15 -07:00
Ian Romanick
9c4b1f2bad glsl2: Make gl_FragData be available in GLSL 1.10 too 2010-06-29 15:19:42 -07:00
Ian Romanick
5e18b051c0 glsl2: Pass MaxDrawBuffers from core Mesa into the GLSL compiler 2010-06-29 15:19:38 -07:00
Marek Olšák
b939f83eb7 r300g: add workaround for multiple contexts 2010-06-30 00:03:04 +02:00
Marek Olšák
6a34287bb5 r300g: move one flush from winsys to the context
This flush happens when changing the tiling flags, and it should really be
done in the context.

I hope this fixes FDO bug #28630.
2010-06-30 00:03:04 +02:00
Brian Paul
3d6101245b llvmpipe: don't crash/assert on out of memory
Check for null pointers and return early, etc.
2010-06-29 15:40:19 -06:00
Brian Paul
249c6735dd llvmpipe: restore call to lp_setup_update_state()
This undoes part of commit 8be645d53a
and fixes fd.o bug 28822 as well as other regressions.

The 'draw' module may issue additional state-change commands while
we're inside the draw_arrays/elements() call so it's important to
check for updated state at this point.
2010-06-29 15:19:01 -06:00
Ian Romanick
efc15f862b glsl_type: Add _mesa_glsl_release_types to release all type related storage 2010-06-29 11:15:40 -07:00
Ian Romanick
e1374d48de glsl_type: All glsl_type objects live in their own talloc context 2010-06-29 11:15:40 -07:00
Ian Romanick
72e627d02a glsl_type: Record type constructors are private 2010-06-29 11:15:39 -07:00
Ian Romanick
49e3577b91 glsl_type: Add get_record_instance method 2010-06-29 11:15:39 -07:00
Ian Romanick
31bcce04b1 glsl_type: Vector, matrix, and sampler type constructors are private 2010-06-29 11:15:39 -07:00
Ian Romanick
e94642eb0d glsl_type: Make all static objects be class private 2010-06-29 11:15:39 -07:00
Ian Romanick
4b6feb0398 glsl2: Use talloc_strdup when generating constructor temporary names 2010-06-29 11:15:26 -07:00
Ian Romanick
12681610f5 glsl_type: Remove vector and matrix constructor generators
All scalar, vector, and matrix constructors are generated in-line
during AST-to-HIR translation.  There is no longer any need to
generate function versions of the constructors.
2010-06-29 11:15:26 -07:00
Ian Romanick
699b247661 glsl2: Don't flatten constructor parameters to scalars
Now that all scalar, vector, and matrix constructors are emitted
in-line, the parameters to these constructors should not be flattened
to a pile of scalars.  Instead, the functions that emit the in-line
constructor bodies can directly write the parameters to the correct
locations in the objects being constructed.
2010-06-29 11:15:26 -07:00
Ian Romanick
81c7e94466 glsl2: Always emit matrix constructors inline 2010-06-29 11:15:26 -07:00
Ian Romanick
c31dcdf57e glsl2: Always emit vector constructors inline 2010-06-29 11:15:26 -07:00
Ian Romanick
6315b68f5f ir_swizzle: Add new constructor, refactor constructors
Adds a new constructor that takes an array of component values.  Refactors
the meat of the two constructors to an init_mask method.
2010-06-29 11:15:26 -07:00
Kenneth Graunke
50577b96ac glsl2: Update TODO. 2010-06-29 11:12:54 -07:00
Kenneth Graunke
6de8256505 glsl2: Check for non-void functions that don't have a return statement.
This doesn't do any control flow analysis to ensure that the return
statements are actually reached.

Fixes piglit tests function5.frag and function-07.vert.
2010-06-29 11:12:54 -07:00
Kenneth Graunke
ac04c257e3 glsl2: Reject return types with qualifiers.
Fixes piglit test return-qualifier.frag.
2010-06-29 11:12:54 -07:00
Kenneth Graunke
28527ed557 glsl2: Add a method for querying if an AST type has any qualifiers. 2010-06-29 11:12:53 -07:00
Kenneth Graunke
18707eba1c glsl2: Check that returned expressions match the function return type.
From my reading of the specification, implicit conversions are not
allowed.  ATI seems to agree, though nVidia allows it without warning.
2010-06-29 11:12:53 -07:00
Ian Romanick
153eca9806 glsl2: Invoke preprocessor before calling the compiler proper 2010-06-29 11:00:58 -07:00
Jakob Bornecrantz
172f3f5eac egl: Check for drm winsys not just the driver name
Also fix pipe_radeon.so not building
2010-06-29 18:25:49 +01:00
José Fonseca
bb6ca7b3f7 draw: Add inline keyword to inline function.
Otherwise gcc will warn about unusued functions.
2010-06-29 14:30:44 +01:00
Jakob Bornecrantz
218da1ef34 i915g: Fix copy pasto 2010-06-29 12:36:40 +01:00
Jakob Bornecrantz
006d02a911 egl: Fix gallium build when EGL is not installed on system 2010-06-29 12:28:41 +01:00
Jakob Bornecrantz
eebb048753 i915g: Add missing egl pipe file 2010-06-29 12:28:15 +01:00
Chia-I Wu
4cb853402b egl: Remove st/egl probe code.
It is no longer needed.
2010-06-29 17:16:20 +08:00
Chia-I Wu
afcea9b115 egl: Do not call drv->Initialize with global mutex locked. 2010-06-29 17:16:20 +08:00
Chia-I Wu
a81ef14228 st/egl: Build a single EGL driver.
This change makes st/egl build a single egl_gallium.so and multiple
st_<API>.so and pipe_<HW>.so.  When a display is initialized, the
corresponding pipe driver will be loaded.  When a context is created,
the corresponding state tracker will be loaded.

Unlike DRI drivers, no ABI compatibility is maintained.  egl_gallium,
pipe drivers and state trackers should always be distributed as a single
package.  As such, there is only a single src/gallium/targets/egl/ that
builds everything for the package.
2010-06-29 17:16:20 +08:00
Chia-I Wu
d5ab243d5a st/egl: Move module loading code to targets.
Several changes are made.  libegl.a no longer defines _eglMain.  It
defines functions to create and destroy a _EGLDriver instead.  The
creation function is called by the targets.  It takes an egl_g3d_loader
as its argument.  The loader is defined by the targets and is in charge
of creating st_api and pipe_screen.  This allows us to move the module
loading code to targets.  Lastly, the modules are now loaded as the
respective contexts are created.
2010-06-29 17:16:20 +08:00
Chia-I Wu
d8e0e11456 st/egl: Reorganize targets.
Merge all targets into targets/egl/.  The target produces
egl_gallium_<HW>.so for each pipe driver and st_<API>.so for each client
APIs.  This enables us to further merge egl_gallium_<HW>.so into
egl_gallium.so later.
2010-06-29 17:16:20 +08:00
Chia-I Wu
ea05299ce5 st/egl: One driver per hardware.
Merge multiple egl_<platform>_<pipe>.so into a single
egl_gallium_<pipe>.so.  The environment variable EGL_PLATFORM is now
used to modify the return value of _eglGetNativePlatform.
2010-06-29 17:16:19 +08:00
Chia-I Wu
f66a4e20c1 st/egl: Introduce native_platform.
Move native_get_name, native_create_probe, native_get_probe_result, and
native_create_display into struct native_platform, and add
native_get_platform to get a handle to the struct.
2010-06-29 17:16:19 +08:00
Chia-I Wu
f9574c5f89 st/egl: Make api_OpenGL support OpenGL ES.
This allows api_OpenGL.so to support OpenGL ES.
2010-06-29 17:16:19 +08:00
Chia-I Wu
57c654324f st/mesa: Add support for multiple APIs.
Add st_gl_api_create_es1 and st_gl_api_create_es2 to create OpeGL ES 1.1
and OpenGL ES 2.0 contexts respectively.
2010-06-29 17:16:19 +08:00
Chia-I Wu
982aba97c5 st_api: Remove st_context::is_visual_supported.
The callback is used by st/vega to check if a visual specifies the
depth/stencil format.  It forces st/vega to be loaded by st/egl to
perform the check.  As noted in EGL spec, the depth/stencil format of a
visual should not affect OpenVG.  It should be better to ignore the
field and always allocate the depth/stencil texture.
2010-06-29 17:16:19 +08:00
Zack Rusin
da7bd6a90e mesa: initial support for ARB_geometry_shader4
laying down the foundation for everything and implementing most of the
stuff.
linking, gl_VerticesIn and multidimensional inputs are left.
2010-06-28 22:53:21 -04:00
Marek Olšák
0b50fcbd55 util: reference surfaces and sampler views in blitter when saving them
Ooops. This should possibly fix some bugs...
2010-06-29 01:54:26 +02:00
Eric Anholt
59a23d7fb9 ir_to_mesa: Actually initialize the undef register for scalar_op1.
Fixes glsl-sin, glsl-cos on 965, where we rely on unused src arguments
in the VS having a file of PROGRAM_UNDEFINED.
2010-06-28 15:07:19 -07:00
Eric Anholt
f9ffccb06b ir_to_mesa: Support user-defined varyings using the linker's locations.
Fixes glsl-reload-source.
2010-06-28 14:49:59 -07:00
Eric Anholt
ad8ad338f4 ir_to_mesa: Actually add the header file for the interface. 2010-06-28 13:45:43 -07:00
Jakob Bornecrantz
7e1ce791c7 i915g: Add Galahad to targets 2010-06-28 22:33:39 +02:00
Jakob Bornecrantz
77cd1a989b r300g: Galahad for scons as well 2010-06-28 22:27:51 +02:00
Jakob Bornecrantz
2da9d80a4b r300g: Add target defines for Galahad 2010-06-28 22:27:08 +02:00
Jakob Bornecrantz
40d4b414d9 glhd: Build with scons 2010-06-28 22:27:06 +02:00
Eric Anholt
8f62ad6d0f ir_to_mesa: Fix binop_sqrt for multi-channel and negative source channels.
Fixes glsl-fs-sqrt-branch.
2010-06-28 13:03:10 -07:00
Jakob Bornecrantz
d12c4c5a62 glhd: Re-integrate with the debug system 2010-06-28 21:52:03 +02:00
Eric Anholt
d5a5df45a4 ir_to_mesa: Fix indexes of temps used in expressions.
It looks like I managed to horribly mangle this in some rebase of the
branch.  Fixes:
glsl-fs-fragcoord
glsl-fs-mix
2010-06-28 12:49:28 -07:00
Eric Anholt
7dc1e0b326 ir_to_mesa: Notify the driver when we generate new Mesa programs for GLSL.
Fixes glsl-fs-if-*.
2010-06-28 12:38:19 -07:00
Jakob Bornecrantz
2932dd6374 glhd: Remove leftover file 2010-06-28 21:37:03 +02:00
Eric Anholt
904b5bfe99 ir_to_mesa: Add support for the pow expression.
Fixes glsl-algebraic-pow-two.
2010-06-28 12:26:19 -07:00
Eric Anholt
cbe52c8012 ir_to_mesa: Fix EmitCondCodes for boolean vars as condition.
Fixes glsl-vs-if-bool.
2010-06-28 12:17:25 -07:00
Jakob Bornecrantz
a01e0afd9f Merge branch 'gallium-drm-driver-drescriptor'
Conflicts:
	src/gallium/state_trackers/egl/x11/native_dri2.c
	src/gallium/state_trackers/egl/x11/native_x11.c
	src/gallium/state_trackers/egl/x11/native_x11.h
	src/gallium/state_trackers/xorg/xorg_driver.c
	src/gallium/winsys/radeon/drm/radeon_drm.c
2010-06-28 21:14:45 +02:00
Eric Anholt
854fd66cbb ir_to_mesa: Respect EmitCondCodes for IF statements.
Fixes glsl-vs-if-* for the 965 driver.
2010-06-28 12:01:23 -07:00
Eric Anholt
0a52e8b691 ir_to_mesa: Traverse the "else" instrs after "else", instead of "then" again. 2010-06-28 11:45:10 -07:00
Eric Anholt
3f3f41357d ir_to_mesa: Fix matrix * scalar multiplication.
We're accessing in terms of columns, so we need to do MUL/MAD/MAD/MAD
instead of DP4s.

Fixes:
glsl-fs-exp2
glsl-fs-log2
glsl-fs-mix-constant
glsl-fs-sqrt-zero
glsl-vs-sqrt-zero
2010-06-28 11:14:47 -07:00
Eric Anholt
ad2dc740b9 ir_to_mesa: Check the right element for matrix * scalar multiplication. 2010-06-28 11:14:47 -07:00
Eric Anholt
bd3b835e7c glsl2: Add support for some builtin matrices. 2010-06-28 11:14:47 -07:00
Eric Anholt
81b7b79c47 ir_to_mesa: Fix copy and wasted InputsRead/OutputsWritten setup. 2010-06-28 11:14:47 -07:00
Kenneth Graunke
5f3fe44595 Use a more sensible context in copy propagation. 2010-06-28 11:14:47 -07:00
Kenneth Graunke
a815f7fb83 Use more sensible contexts in ir_dead_code_local. 2010-06-28 11:14:47 -07:00
Ian Romanick
22c23dedad glsl2: Add option to stand-alone GLSL compiler to dump IR before optimizations 2010-06-28 10:04:22 -07:00
Ian Romanick
26b5d33dce glsl2: Use i2b and f2b IR opcodes for casting int or float to bool 2010-06-28 10:04:18 -07:00
José Fonseca
250b92f3bb llvmpipe: set WRITE_ALL only a per-tile basis in lp_resource_copy(). 2010-06-28 16:33:52 +01:00
José Fonseca
a9e0fda070 llvmpipe: Actually flush in lp_resource_copy()
The cpu_access is redundant in a software rasterizer.
2010-06-28 16:33:21 +01:00
José Fonseca
8be645d53a llvmpipe: Ensure outdated framebuffer state is not reused in lp_setup_bind_framebuffer().
We were starting a scene whenever lp_setup_get_vertex_info() was called by
the draw module. So when when all primitives were culled/clipped, not only
did we create a new scene for nothing, but we end up using the old scene
with the old framebuffer state instead of a new one.

Fix consists in:
- don't call lp_setup_update_state() in lp_setup_get_vertex_info() -- no
  longer necessary
- always setting the scene state before binning a command -- query
  commands were bypassing it
- assert no old scene is reused in lp_setup_bind_framebuffer()
2010-06-28 16:33:05 +01:00
Marek Olšák
ce7a70b8b4 r300g: fix a compile error on non-debug builds 2010-06-27 17:15:23 +02:00
Marek Olšák
57c3f70018 util: fix a memory leak in blitter 2010-06-27 15:13:14 +02:00
Marek Olšák
0a19d57b84 r300g: separate the hyperz state and pipelined FB regs out of the FB state 2010-06-27 15:13:14 +02:00
Marek Olšák
808ad22592 r300g: release referenced objects in destroy_context 2010-06-27 15:13:13 +02:00
Marek Olšák
639a7daa85 r300g: reference surfaces in set_framebuffer_state 2010-06-27 15:13:13 +02:00
Marek Olšák
408a886127 r300g: group debug messages 2010-06-27 15:13:13 +02:00
Marek Olšák
0a9510814e r300g: turn rasterizer state into a command buffer 2010-06-27 15:13:13 +02:00
Marek Olšák
c200c47e6c r300g: move emission of the MSPOS regs into the framebuffer state
Now the question is whether we are allowed to ignore gl_rasterization_rules and
pipe_rasterizer_state::multisample. The former is invariant anyway and
I think the latter would need re-emitting the AA state which is quite costly,
considering that it implicitly flushes the whole pipeline (all AA regs
in the AA state are *unpipelined*).
2010-06-27 15:13:13 +02:00
Marek Olšák
bb47d1c26f r300g: turn invariant state into a command buffer 2010-06-27 15:13:12 +02:00
Marek Olšák
8959f48bce r300g: initialize some crucial state in the first CS 2010-06-27 15:13:08 +02:00
Marek Olšák
fcacc6a076 r300g: introduce VAP invariant state
Unlike other invariant states, this one must be emitted after VAP flush.
2010-06-26 17:57:20 +02:00
Marek Olšák
8350d1d6f1 r300g: immediate mode cleanup 2010-06-26 17:47:32 +02:00
Marek Olšák
5acdfdbf42 r300g: update my notes about fastfill and zbuffer compression 2010-06-26 17:43:58 +02:00
Marek Olšák
f39800b339 r300g: enum r300_blitter_op is a bitmask 2010-06-26 17:35:56 +02:00
Marek Olšák
8924201530 draw: fix build with llvm and make 2010-06-26 14:01:41 +02:00
Vinson Lee
ecd8c66d6a mesa: Remove unnecessary header. 2010-06-26 00:47:52 -07:00
Vinson Lee
2943f1ed8c st/mesa: Remove unnecessary headers. 2010-06-26 00:38:05 -07:00
Vinson Lee
3443b581fb draw: Remove unnecessary header. 2010-06-26 00:31:57 -07:00
Eric Anholt
0bef5b97a9 glsl2: Add support for non-float constants in Mesa IR.
Fixes glsl-vs-vec4-indexing-4.
2010-06-25 18:01:20 -07:00
Eric Anholt
6152fa16a1 glsl2: Take out the spamming of debug flags I'd added. 2010-06-25 17:23:31 -07:00
Eric Anholt
b2d7ed2aba glsl2: Don't clear swizzles for Mesa IR constants after fetching them.
Missed this while hacking in constants support.  Fixes:
glsl-algebraic-mul-*
glsl-algebraic-rcp-*
glsl-vs-swizzle-swizzle-lhs
glsl-vs-vec4-indexing-6
2010-06-25 17:20:46 -07:00
Kenneth Graunke
78062273de ir_reader: Free memory for S-Expressions earlier.
There's no point in keeping it around once we've read the IR.

Also, remove an unnecessary talloc_parent call.
2010-06-25 17:07:42 -07:00
Zack Rusin
4503bd33da draw: deleted by mistake 2010-06-25 20:06:53 -04:00
Zack Rusin
a5c44986a3 draw: initialize headers in the none post paths as well 2010-06-25 19:58:09 -04:00
Eric Anholt
85c978f38c glsl2: Start trying to hook up uniforms.
This should be resolved with linker.cpp's location assignment, as
currently we drop that location assignment on the ground.  However,
this gets basic programs using uniforms working for now.
2010-06-25 16:35:36 -07:00
Eric Anholt
0fd97db8b0 glsl2: Associate the GLenum for the type with builtin GLSL types. 2010-06-25 16:35:22 -07:00
Zack Rusin
8ebfcf31eb draw: limit the number of vertex shader variants kept around
we used to create and cache unltimited number of variant, this
change limits the number of variants kept around to a fixed number.
the change is based on a similar patch by Roland for llvmpipe fragment
shaders.
2010-06-25 19:33:27 -04:00
Zack Rusin
5cf1921e6d draw: initialize vertex header 2010-06-25 19:33:27 -04:00
Eric Anholt
bda27424cf glsl2: Use the parser state as the talloc context for dead code elimination.
This cuts runtime by around 20% from talloc_parent() lookups.
2010-06-25 13:38:38 -07:00
Eric Anholt
abc4e52992 glsl2: Emit OPCODE_END at the end of the Mesa program.
The 965 driver can now run a glsl2-generated shader!
2010-06-25 13:28:16 -07:00
Eric Anholt
582b73fe69 glsl2: Hook up constant parameters in ir_to_mesa. 2010-06-25 13:27:57 -07:00
Brian Paul
4ae530370d gallium/util: fix pipe_sampler_view_reference() calls
The conditionals aren't needed.
2010-06-25 14:12:34 -06:00
Eric Anholt
ffc845a50a glsl2: Set InputsRead and OutputsWritten on the generated programs. 2010-06-25 12:52:01 -07:00
Eric Anholt
364fcd8ee1 glsl2: Start integrating ir_to_mesa.cpp into shader_api.h
The compiler is now called by the driver, and generates program
instructions.  Parameter lists are still not set up, so the driver
chokes on it shortly thereafter.
2010-06-25 12:37:21 -07:00
Eric Anholt
7f2bf62d25 glsl2: Use Mesa types instead of duping them into our program.h. 2010-06-25 12:25:19 -07:00
Eric Anholt
2a3d46dd46 glsl2: Fix dependencies. (at least partially) 2010-06-25 12:23:20 -07:00
Brian Paul
e099ed2c64 softpipe: rename a var 2010-06-25 09:56:22 -06:00
Chia-I Wu
7a9246c5d7 draw: Work around an invalid write.
SSE vertex shader does not seem to honor the execution mask.  Pad the
output array as a workaround.
2010-06-25 23:17:18 +08:00
Brian Paul
a879d14ecf mesa: initialize extension string when context is first bound
...instead of waiting until glGetString(GL_EXTENSIONS) is called.
This fixes a problem where the MESA_EXTENSION_OVERRIDE env var is
ignored if the app never calls glGetString(GL_EXTENSIONS).

NOTE: this is a candidate patch for the 7.8 branch.
2010-06-25 08:47:33 -06:00
Brian Paul
cc8c142e2a llvmpipe: fix comment typo 2010-06-25 08:47:22 -06:00
Brian Paul
fd60bf8e33 softpipe: fix comment typo 2010-06-25 08:47:22 -06:00
Eric Anholt
0a1b54df7a glsl2: Replace the GLSL compiler with the glsl2 project. 2010-06-24 17:23:21 -07:00
Eric Anholt
3d6012303c glsl2: Wrap includes of C interfaces with extern "C". 2010-06-24 17:23:19 -07:00
Eric Anholt
f4869f3326 glsl2: Remove files that had been imported for standalone. 2010-06-24 17:14:00 -07:00
Eric Anholt
e82ddb781a glsl2: Stop .gitignoring the old standalone build system. 2010-06-24 15:52:56 -07:00
Eric Anholt
9aa0b6d728 glsl2: Move the Mesa IR codegen into mesa/shader/ 2010-06-24 15:49:18 -07:00
Eric Anholt
bcc13b7444 Merge branch 'glsl2-head' into glsl2
This brings in the standalone GLSL compiler that we are planning on
replacing the existing Mesa GLSL compiler.  It currently targets GLSL
1.20 and the Mesa IR.
2010-06-24 15:47:40 -07:00
Eric Anholt
e5cf3aadb8 glsl2: Add a README file for the new compiler. 2010-06-24 15:46:53 -07:00
Eric Anholt
2928588267 glsl2: Move the compiler to the subdirectory it will live in in Mesa. 2010-06-24 15:36:00 -07:00
Eric Anholt
0ee7d80269 Merge branch 'mesa'
This brings in the ir_to_mesa.cpp code I've been developing to codegen
to the Mesa IR.  It does not actually generate a complete Mesa
fragment/vertex program yet.
2010-06-24 15:27:10 -07:00
Eric Anholt
6b01b50888 Move the talloc_parent lookup down in a few hot paths.
talloc_parent is still 80% of our runtime, but likely talloc_parent
lookups will be reduced as we improve the handling of memory
ownership.
2010-06-24 15:18:39 -07:00
Eric Anholt
e33c10328c Merge remote branch 'cworth/master'
Conflicts:
	ast_to_hir.cpp
	ir.cpp

This brings in the talloc-based memory management work, so that the
compiler (almost) no longer leaks memory.
2010-06-24 15:13:03 -07:00
Eric Anholt
8364fc85b8 ir_to_mesa: Handle a limited subset of matrix multiplication.
glsl-mvp.vert now generates believable code, and mesa mode fails only
5 tests that master doesn't.  I must have left out some asserts...
2010-06-24 15:05:21 -07:00
Eric Anholt
7672064756 ir_to_mesa: Handle constant matrices.
There's not much to it since we're not actually storing constant data yet.
2010-06-24 15:05:21 -07:00
Eric Anholt
f4bd7f262e ir_to_mesa: Fix copy-and-wasted second argument to compare expresssion ops.
Fixes CorrectParse2.vert assertion due to uninitialized values.
2010-06-24 15:05:21 -07:00
Eric Anholt
4006424f5b ir_to_mesa: Don't allocate temps for swizzles.
We do them in place by actually, you know, swizzling.
2010-06-24 15:05:21 -07:00
Eric Anholt
a9b619bb3b ir_to_mesa: Set up storage for uniform vars. 2010-06-24 15:05:21 -07:00
Eric Anholt
554dbcce77 ir_to_mesa: Move the classes into the file now that we don't have the burg.
At 1kloc, it doesn't look like I'll want to split the ir_to_mesa file
up even once it's feature-complete.  Move definitions closer to usage,
and prevent rebuilding the world when changing the definitions.
2010-06-24 15:05:21 -07:00
Eric Anholt
2401338ef8 ir_to_mesa: Remove old monoburg structure. 2010-06-24 15:05:21 -07:00
Eric Anholt
9cd8cad9f3 ir_to_mesa: Restrict dst writemasks like we did in the monoburg setup. 2010-06-24 15:05:21 -07:00
Eric Anholt
9d2b8e0b70 ir_to_mesa: Fix copy-and-wasted DIV instruction sequence. 2010-06-24 15:05:21 -07:00
Eric Anholt
0161515c39 ir_to_mesa: Remove the BURG code.
The promise of the BURG was to recognize multi-instruction sequences
and emit reduced sequences for them.  It would have worked well for
recognizing MUL+ADD -> MAD and possibly even MIN(MAX(val, 0), 1) ->
MOV_SAT with some grammar changes.  However, that potential benefit in
making those optimizations easy is outweighed by the fragility of
monoburg, the amount of (incorrect, as I wrote it) code for using it,
and the burden it was going to cause for handling operations on
aggregate types.
2010-06-24 15:05:21 -07:00
Eric Anholt
224f712950 ir_to_mesa: Fix mapping of FS texcoord inputs and color output. 2010-06-24 15:05:21 -07:00
Eric Anholt
ab386f18b0 ir_to_mesa: Try to fix up the dereference handling for the visitor rework.
One of the gstreamer shaders I play with now compiles, but input
mappings are wrong.
2010-06-24 15:05:21 -07:00
Eric Anholt
c23c6c773a ir_to_mesa: Implement min and max expressions.
fixes glsl-orangebook-ch06-bump.frag.
2010-06-24 15:05:21 -07:00
Eric Anholt
346daeca07 ir_to_mesa: Don't assert over assignments with a constant-true condition. 2010-06-24 15:05:21 -07:00
Eric Anholt
c2014f03e8 ir_to_mesa: Add support for trunc/ceil/floor. 2010-06-24 15:05:20 -07:00
Eric Anholt
c45b615a37 ir_to_mesa: Implement neg expression. 2010-06-24 15:05:20 -07:00
Eric Anholt
3c5979565f ir_to_mesa: Add sin/cos. 2010-06-24 15:05:20 -07:00
Eric Anholt
2c432637d0 ir_to_mesa: Start trying to support struct storage. 2010-06-24 15:05:20 -07:00
Eric Anholt
4a1bd916e7 ir_to_mesa: Fix up array indexing.
The grammar for array_reference_vec4_vec4 was set up wrong, so we
weren't generating instructions if necessary for the array index.
2010-06-24 15:05:20 -07:00
Eric Anholt
2ee85e20c8 ir_to_mesa: Remove stale comment about monoburg. 2010-06-24 15:05:20 -07:00
Eric Anholt
bdbd9f112e ir_to_mesa: Add support for variable indexing of temporary arrays.
Fixes loop-01.vert, loop-02.vert.
2010-06-24 15:05:20 -07:00
Eric Anholt
4e5e0f018b ir_to_mesa: Clean up some handling of builtins and arrays.
Constant-index dereferences of arrays should work now.  One test is
regressed, but it should have been failing before this commit, too.
2010-06-24 15:05:20 -07:00
Eric Anholt
64fcbbca9c ir_to_mesa: Add support for loops.
Fixes CorrectParse1 and the glsl2 loop tests that don't use arrays.
2010-06-24 15:05:20 -07:00
Eric Anholt
0c005bd773 Make loop jump mode public so I can switch on it. 2010-06-24 15:05:20 -07:00
Eric Anholt
4380099c98 ir_to_mesa: Add logic_or and logic_and to get CorrectFunction1.vert working. 2010-06-24 15:05:20 -07:00
Eric Anholt
763cd75863 ir_to_mesa: add logic_xor to get CorrectParse2.vert working. 2010-06-24 15:05:20 -07:00
Eric Anholt
1d20862c8a ir_to_mesa: add logic_not and f2b to get CorrectParse2.frag working. 2010-06-24 15:05:20 -07:00
Eric Anholt
c5ca73e72c ir_to_mesa: Add support for ir_if. 2010-06-24 15:05:20 -07:00
Eric Anholt
3831507957 ir_to_mesa: Add support for comparison operations. 2010-06-24 15:05:20 -07:00
Eric Anholt
bf99533350 ir_to_mesa: Introduce shorthand for common Mesa IR emit patterns. 2010-06-24 15:05:20 -07:00
Eric Anholt
423a75c5d6 ir_to_mesa: Add ir_unop_f2i -> OPCODE_TRUNC. 2010-06-24 15:05:20 -07:00
Eric Anholt
878740bedf ir_to_mesa: Add codegen for rsq expression operation. 2010-06-24 15:05:20 -07:00
Eric Anholt
8c29a1d84d ir_to_mesa: Add exp/log expression operations. 2010-06-24 15:05:20 -07:00
Eric Anholt
829e0a8eff ir_to_mesa: Add (almost) the rest of the builtin varyings. 2010-06-24 15:05:20 -07:00
Eric Anholt
110d5cc83c ir_to_mesa: Support gl_Position output. 2010-06-24 15:05:20 -07:00
Eric Anholt
8041bce333 ir_to_mesa: Support gl_FragData[] output. 2010-06-24 15:05:20 -07:00
Eric Anholt
48e282d8a2 ir_to_mesa: Support gl_FragData[] output. 2010-06-24 15:05:20 -07:00
Eric Anholt
50ad96ebce ir_to_mesa: Start doing some int support. 2010-06-24 15:05:20 -07:00
Eric Anholt
315c638b8c ir_to_mesa: Fix bugs in swizzle handling for scalar operations.
Looking at a vec2 / float codegen, the writemasks on the RCPs were wrong and
the swizzle on the multiply by the RCP results was wrong.
2010-06-24 15:05:20 -07:00
Eric Anholt
f30100c19c ir_to_mesa: Fix copy'n'paste bug where divide multiplied left by 1/left.
Multiply left by 1/right, please.
2010-06-24 15:05:20 -07:00
Eric Anholt
3d70d1f4d6 ir_to_mesa: Emit more reduced writemasks for ops on small types.
This should help prevent Mesa from having to be smart to give
channel-wise drivers better information.
2010-06-24 15:05:19 -07:00
Eric Anholt
b07cc372c6 ir_to_mesa: Handle swizzles on LHS of assignment (writemasks). 2010-06-24 15:05:19 -07:00
Eric Anholt
12f654c63b ir_to_mesa: Produce multiple scalar ops when required to produce vec4s.
Fixes the code emitted in a test shader for vec2 texcoord / vec2 tex_size.
2010-06-24 15:05:19 -07:00
Eric Anholt
b2ed4dd7b0 ir_to_mesa: Get temps allocated at the right times.
The alloced_vec4/vec4 distinction was an experiment to expose the cost
of temps to the codegen.  But the problem is that the temporary
production rule gets called after the emit rule that was using the
temp.  We could have the args to emit_op be pointers to where the temp
would get allocated later, but that seems overly hard while just
trying to bring this thing up.  Besides, the temps used in expressions
bear only the vaguest relation to how many temps will be used after
register allocation.
2010-06-24 15:05:19 -07:00
Eric Anholt
ae252d3613 ir_to_mesa: Make the first temp index we use 1 to show off bugs.
Regs aren't allocated at the right times yet, so we see TEMP[0] a lot.
2010-06-24 15:05:19 -07:00
Eric Anholt
7aa0b034f7 ir_to_mesa: Fix up the assign rule to use left and right correctly.
The destination of assign is in left, not in the node itself.
2010-06-24 15:05:19 -07:00
Eric Anholt
f14913d4b7 ir_to_mesa: Do my best to explain how the codegen rules work. 2010-06-24 15:05:19 -07:00
Eric Anholt
b7abce770f ir_to_mesa: Print out the ir along with the Mesa IR.
Ideally this would be hooked up by ir_print_visitor dumping into a
string that we could include as prog_instruction->Comment when in
debug mode, and not try keeping ir_instruction trees around after
conversion to Mesa.  The ir_print_visitor isn't set up to do that for
us today.
2010-06-24 15:05:19 -07:00
Eric Anholt
3419583266 ir_to_mesa: Fix up src reg swizzling. 2010-06-24 15:05:19 -07:00
Eric Anholt
c554d7cede ir_to_mesa: Remove dead code from when this was an ARB_fp printer. 2010-06-24 15:05:19 -07:00
Eric Anholt
8197eeee3b ir_to_mesa: Fill in more bits of dest resg. 2010-06-24 15:05:19 -07:00
Eric Anholt
aaee40e107 ir_to_mesa: Print out the resulting program. 2010-06-24 15:05:19 -07:00
Eric Anholt
b5039eff3f Add missing dist file. 2010-06-24 15:05:19 -07:00
Eric Anholt
182b623de3 Ignore the generated codegen files for now.
Later we'll throw them in revision control.
2010-06-24 15:05:19 -07:00
Eric Anholt
84771df82e ir_to_mesa: Start building GLSL IR to Mesa IR conversion.
There are major missing pieces here.  Most operations aren't
supported.  Matrices need to be broken down to vector ops before we
get here.  Scalar operations (RSQ, RCP) are handled incorrectly.
Arrays and structures are not even considered.
2010-06-24 15:05:19 -07:00
Eric Anholt
9290e0dd28 Make inlined function variables auto, not in/out. 2010-06-24 15:05:11 -07:00
Ian Romanick
84341f4b20 Make sure that symbols aren't multiply defined in the same scope.
The assembly parser is already checking this, but we're relying on the
symbol table handling it in glsl2.
2010-06-24 14:56:26 -07:00
Eric Anholt
ebefeb2bdd Attach a pointer to variable names in LIR dumping.
Since variable names are not unique, and we like to make lots of
__retvals and assignment_tmps and a,b,c,d this helps in debugging.
2010-06-24 13:32:35 -07:00
Eric Anholt
9ca0a022e6 Quiet unused arg warning for ir_constant cloning. 2010-06-24 13:32:35 -07:00
Eric Anholt
5f38408833 Move ir_constant cloning alongside the other cloning functions. 2010-06-24 13:32:35 -07:00
Eric Anholt
ae805922b7 Don't forget to add the declaration of our temporary variable for assigns.
Otherwise, dead code elimination gets confused since it relies on
seeing decls.
2010-06-24 13:32:35 -07:00
Eric Anholt
f66ba4f357 ir_function_inlining: Re-add the "s/return/retval =/" functionality.
I ripped it out with the cloning changes yesterday, and should have
tested and noticed that there were now returns all over.
2010-06-24 13:32:35 -07:00
Eric Anholt
1b2bcf7913 Fix variable remapping in function cloning.
It's (ht, data, key) not (ht, key, data).
2010-06-24 13:32:35 -07:00
Marek Olšák
5d1cc93077 r300g: a couple more chipsets do not have HiZ RAM 2010-06-24 22:24:22 +02:00
Corbin Simpson
474dc40fb4 gallium/docs: Vertex data formats.
I'm not sure if I really got it right. This seems like one of those
"Duh, of course it works that way" things, but I'd like the
documentation to be readable by people not acquainted with OGL/D3D.
2010-06-24 07:57:30 -07:00
Corbin Simpson
484bb0ea58 glhd: Add test for logicop enable.
Only for first RT at the moment, as there is no trivial way in galahad
to look at framebuffer state and (sadly) people don't usually calloc
their CSOs, so flags could be wrongly set.

On the other hand, of course, galahad will hopefully encourage more
people to calloc their CSOs. :3
2010-06-24 07:22:29 -07:00
Corbin Simpson
49735d1c6c gallium/docs: Lops override the rest of the blending state when enabled. 2010-06-24 07:22:29 -07:00
Brian Paul
05a18f48e5 gallium/docs: updated remaining semantic label docs 2010-06-24 07:50:29 -06:00
nobled
fd7de146f6 pipe: Add PIPE_OS_HURD
One tiny step toward porting Gallium to the GNU/Hurd kernel
(and fixing Debian bug #585618).

Signed-off-by: Corbin Simpson <MostAwesomeDude@gmail.com>
2010-06-24 06:45:36 -07:00
Corbin Simpson
06a75bd873 gallium/docs: Add lop table.
Was feeling kind of weird without it.
2010-06-24 06:43:50 -07:00
Corbin Simpson
1e10464557 gallium/docs: Slight clarification and formatting for Blend. 2010-06-24 06:43:50 -07:00
Brian Paul
ca12aefdac Merge branch 'shader-file-reorg'
1. Move all GL entrypoint functions and files into src/mesa/main/
This includes the ARB vp/vp, NV vp/fp, ATI fragshader and GLSL bits
that were in src/mesa/shader/

2. Move src/mesa/shader/slang/ to src/mesa/slang/ to reduce the tree depth

3. Rename src/mesa/shader/ to src/mesa/program/ since all the
remaining files are concerned with GPU programs.

4. Misc code refactoring.  In particular, I got rid of most of the
GLSL-related ctx->Driver hook functions.  None of the drivers used
them.

Conflicts:
	src/mesa/drivers/dri/i965/brw_context.c
2010-06-23 22:30:26 -06:00
Marek Olšák
f2122d4724 r300g: remove an XXX comment 2010-06-24 06:15:45 +02:00
Marek Olšák
69adebf594 r300g: move AA registers into the new AA state 2010-06-24 06:10:47 +02:00
Marek Olšák
93bce03b27 r300g: separate the cache flush from the framebuffer state 2010-06-24 06:10:47 +02:00
Marek Olšák
a2f14153cc r300g: reorder and cleanup register writes everywhere 2010-06-24 06:10:47 +02:00
Marek Olšák
6b15a8d2af r300g: add "has HiZ" flag, add ZMask regs 2010-06-24 06:10:47 +02:00
Carl Worth
26bbfb7917 glsl2 main: Switch from realloc to talloc_realloc to construct program source.
This closes 1 leak in the glsl-orangebook-ch06-bump.frag test leaving
4 to go, (all of which are inside hash_table.c).
2010-06-23 19:09:56 -07:00
Carl Worth
b3bd77da56 glsl_type: Add a talloc-based new
And hook it up at the two sites it's called.

Note that with this change we still don't use glsl_type* objects as
talloc contexts, (see things like get_array_instance that accept both
a talloc 'ctx' as well as a glsl_type*). The reason for this is that
the code is still using many instance of glsl_type objects not created
with new.

This closes 3 leaks in the glsl-orangebook-ch06-bump.frag test:

	total heap usage: 55,623 allocs, 55,618

Leaving only 5 leaks to go.
2010-06-23 19:04:45 -07:00
Carl Worth
12c411504c Close memory leaks in glsl_type (constructor and get_array_instance)
Add a talloc ctx to both get_array_instance and the glsl_type
constructor in order to be able to call talloc_size instead of
malloc.

This fix now makes glsl-orangebook-ch06-bump.frag 99.99% leak free:

	total heap usage: 55,623 allocs, 55,615

Only 8 missing frees now.
2010-06-23 19:00:42 -07:00
Carl Worth
dc5811fd0c Close memory leak in lexer.
Simply call talloc_strdup rather than strdup, (using the talloc_parent
of our 'state' object, (known here as yyextra).

This fix now makes glsl-orangebook-ch06-bump.frag 99.97% leak free:

	total heap usage: 55,623 allocs, 55,609 frees

Only 14 missing frees now.
2010-06-23 19:00:42 -07:00
Carl Worth
a9696e79fb main: Close memory leak of shader string from load_text_file.
Could have just added a call to free() to main, but since we're using
talloc everywhere else, we might as well just use it here too. So pass
a new 'ctx' argument to load_text_file.

This removes a single memory leak from all invocations of the
standalone glsl compiler.
2010-06-23 19:00:42 -07:00
Carl Worth
007efe50fd s_symbol: Close memory leak of symbol name.
Easily done now that s_expression is allocated with talloc. Simply
switch from new to talloc_strdup and the job is done.

This closes the great majority (11263) of the remaining leaks in the
glsl-orangebook-ch06-bump.frag test:

	total heap usage: 55,623 allocs, 55,546 frees
	(was 44,283 frees)

This test is now 99.86% leak-free.
2010-06-23 19:00:42 -07:00
Carl Worth
e01193af32 Close memory leak in ir_call::get_error_instruction.
By propagating a 'ctx' parameter through these calls.

This fix happens to have no impact on glsl-orangebook-ch06-bump.frag,
(since it doesn't trigger any errors).
2010-06-23 19:00:42 -07:00
Carl Worth
522de3f5ec Close memory leaks from generate_constructor_intro
By simply propagating a 'ctx' parameter through these function
calls. (We do this because these function are otherwise only receiving
an exec_list, which is not a valid talloc context.)

This closes 1611 leaks in the glsl-orangebook-ch06-bump.frag test:

	total heap usage: 55,623 allocs, 44,283 frees
	(was 42,672 frees)
2010-06-23 19:00:42 -07:00
Carl Worth
1660a29547 exec_node: Add new talloc-based new()
And fix all callers to use the tallbac-based new for exec_node
construction. We make ready use of talloc_parent in order to get
valid, (and appropriate) talloc owners for everything we construct
without having to add new 'ctx' parameters up and down all the call
trees.

This closes the majority of the memory leaks in the
glsl-orangebook-ch06-bump.frag test:

	total heap usage: 55,623 allocs, 42,672 frees
	(was 14,533 frees)

Now 76.7% leak-free. Woo-hoo!
2010-06-23 18:59:35 -07:00
Carl Worth
8f52c9b5fc ast_node: Add new talloc-based new()
And use the talloc-based new for all of the ast objects created by the
parser.  This closes a lot of memory leaks, and will allow us to use
these ast objects as talloc parents in the future, (for things like
exec_nodes, etc.).

This closes 164 leaks in the glsl-orangebook-ch06-bump.frag test:

	total heap usage: 55,623 allocs, 14,553 frees
	(was 14,389 frees)
2010-06-23 18:15:28 -07:00
Jakob Bornecrantz
9ca563a9a8 nouveau: Remove reference to drm_api 2010-06-24 02:36:30 +02:00
Jakob Bornecrantz
09b73b2a5f i965g: Remove last references to drm_api 2010-06-24 02:30:00 +02:00
Jakob Bornecrantz
44c64596d1 swrastg: Use target-helpers 2010-06-24 02:19:44 +02:00
Jakob Bornecrantz
57d14f2fbb gallium: Use debugging helper in all drm targets 2010-06-24 02:19:43 +02:00
Jakob Bornecrantz
ea1786ec5b gallium: Add debug target helper 2010-06-24 02:19:38 +02:00
Jakob Bornecrantz
59981d418f gallium: Fix scons build 2010-06-24 02:15:50 +02:00
Jakob Bornecrantz
e47d32d721 gallium: Remove drm_api and all references to it 2010-06-24 02:15:50 +02:00
Jakob Bornecrantz
92fde20de3 r600g: Move bootstrap code to target 2010-06-24 02:15:50 +02:00
Brian Paul
7315300fa5 gallium/docs: document TGSI_SEMANTIC_EDGEFLAG 2010-06-23 17:38:58 -06:00
Brian Paul
a544a8a82a gallium/docs: update TEXTURE_SHADOW_MAP MAX_PREDICATE_REGISTERS 2010-06-23 17:38:42 -06:00
Carl Worth
015b3a5115 exec_node: Remove destructor from exec_node and all descendants.
Two of these destructors are non-empty, (s_symbol and s_list), so this
commit could potentially introduce memory leaks, (though, no additional
leaks are found in glsl-orangebook-ch06-bump.frag at least---perhaps
the current code is never calling delete on these classes?).

Going forward, we will switch to talloc for exec_node so we won't need
explicit destrcutors to free up any memory used.
2010-06-23 16:38:05 -07:00
Carl Worth
f961e4458f glsl_symbol_table: Add new talloc-based new()
We take advantage of overloading of the new operator (with an
additional parameter!) to make this look as "C++ like" as possible.

This closes 507 memory leaks when compiling glsl-orangebook-ch06-bump.frag
when measured with:

	valgrind ./glsl glsl-orangebook-ch06-bump.frag

as seen here:

	total heap usage: 55,623 allocs, 14,389 frees
	(was 13,882 frees before)
2010-06-23 16:35:45 -07:00
Carl Worth
2d2561ef96 glsl2 main: Use talloc to allocate _mesa_glsl_parse_state
This is a short-lived object. It exists only for the duration of the
compile_shader() function, (as opposed to the shader and whole_program
which live longer).

The state is created with the same talloc parent as the shader, so
that other allocation can be done with talloc_parent(state) as the
owner in order to attach to a long-lived object.
2010-06-23 16:18:13 -07:00
Carl Worth
be83eb8671 glsl2 main: Use talloc to allocate whole_program struct.
This way, whole_program can be our top-level talloc context object,
allowing us to free the lot with a single talloc_free in the end.
2010-06-23 16:18:13 -07:00
Carl Worth
4b2d32b5b5 ast_node: Remove empty destructor.
This wasn't serving any purpose. So delete it.
2010-06-23 16:16:32 -07:00
Carl Worth
c42e64099b preprocessor: Initialize a potentially uninitialized variable.
My current reading of the relevant static functions suggests that last
is never used without being uninitialized, (we only use it if the
expansion function returned non-NULL and the expansion functions
always set it before returning non-NULL).

Apparently gcc isn't coming to the same conclusion. Initializing this
to NULL nicely quites gcc and will guarantee a nice, early segfault if
my anaylsis turns out to be wrong.
2010-06-23 16:13:31 -07:00
Carl Worth
726faddda2 preprocessor: Remove dead code _token_list_length
As gcc noticed, this function is not currently being used. Good-bye.
2010-06-23 16:13:31 -07:00
Carl Worth
45cbc08438 preprocessor: Remove dead code _string_list_append_list
As gcc noticed, this function is not currently being used. Good-bye.
2010-06-23 16:13:31 -07:00
Carl Worth
60c67e46b1 configure: Ensure that config.h can be safely included multiple times.
Use AH_TOP and AH_BOTTOM macros so that the standard include guard
mechanisms are emitted by autoheader into the generated config.h file.
2010-06-23 16:13:31 -07:00
Carl Worth
a32305a8bd configure: Remove some dead code.
This block of code is useless because a (nearly-equivalent) assignment
is made immediately after. The only difference is the omission of
-Wunreadchable-code in the assignment being used. Presumably, that was
intended to be -Wunreachable-code (without the first 'd'), but since
this hasn't been being used we just drop it.
2010-06-23 16:13:31 -07:00
Carl Worth
a22426dc4c Fix typos of "variable" as "varaible"
One of these was just in a comment. But ther other was in an enum
tag, (which is apparently not being used anywhere yet).
2010-06-23 16:12:53 -07:00
Carl Worth
7fd7104fbb ir_variable: Add some missing initialization to the constructor.
Thanks to valgrind for noticing this problem.
2010-06-23 16:12:53 -07:00
Brian Paul
50b3f2e789 gallium/docs: fix definitions of TGSI_SEMANTIC_POSITION, COLOR 2010-06-23 17:00:23 -06:00
Brian Paul
bf2d2772a2 draw: use gallium's TRUE/FALSE 2010-06-23 17:00:22 -06:00
Eric Anholt
a9d58ad6c9 Fix double usage of the post-inc/dec's temporary pre-inc/dec copy.
Fixes CorrectSwizzle3.frag.
2010-06-23 15:20:29 -07:00
Eric Anholt
2731a739d0 Avoid using the RHS of an assignment twice.
This would fix double-evaluation of assignment RHS expressions,
including possible side effects.
2010-06-23 15:20:29 -07:00
Eric Anholt
959a9ecdd8 get_lvalue_copy doesn't need all the checking of do_assignment(). 2010-06-23 15:20:29 -07:00
Eric Anholt
3e24ef68a9 ast_to_hir: Clone LHS derefs of assignment expressions. 2010-06-23 15:20:29 -07:00
Eric Anholt
8006576b36 ir_function_inlining: Allow inlining of loops and conditionals.
The new cloning code handles them.
2010-06-23 15:20:29 -07:00
Eric Anholt
4b6fd39c89 Add a virtual clone() method to ir_instruction.
This will be used by function inlining, the linker, and avoiding double
usage of the LHS deref chains in ++, *=, and similar operations.
2010-06-23 15:20:29 -07:00
Eric Anholt
02fc4b34e4 Avoid using the same ir_constant 0.0 multiple times in mat constructors. 2010-06-23 15:20:29 -07:00
Vinson Lee
fddd5834ff llvmpipe: Remove unnecessary header. 2010-06-23 15:17:00 -07:00
Jakob Bornecrantz
cf91accc93 nouveau: Move bootstrap code to targets
Well sorta, at least I removed the drm_api dependancy and the
target can layer anything it wants to now.
2010-06-23 23:15:07 +02:00
Kenneth Graunke
bc1097d151 glcpp: Support line continuations within preprocessor directives.
Fixes CorrectPreprocess5.frag.
2010-06-23 14:14:57 -07:00
Kenneth Graunke
186e2634bf glcpp: Make standalone binary use preprocess().
This prevents the two code paths from getting out of sync.  Also, future
work will need the shader source as a string anyway.

Unfortunately, this copies and pastes load_text_file from main.cpp, with
small changes (support for reading from stdin, talloc).
2010-06-23 14:14:57 -07:00
Kenneth Graunke
12a820c9d8 glcpp: Fix "dangerous trailing context" warning.
Flex couldn't be sure whether "def" and "ndef" were part of the #ifdef
and #ifndef patterns or the trailing context of the #if pattern.
2010-06-23 14:14:57 -07:00
Kenneth Graunke
d07bb7b83a Remove comment support from the main lexer.
Now handled by the preprocessor.
2010-06-23 14:14:57 -07:00
Kenneth Graunke
e6ae7afc0c glcpp: Recognize plain "//" as a comment.
Found in glsl-orangebook-ch06-bump.(frag|vert).  This was resulting in
the comments getting passed through to the main compiler's lexer.
2010-06-23 14:14:57 -07:00
Ian Romanick
fa455fc2a5 Generate errors for empty constructors instead of asserting
This causes the following tests to pass:

     glslparsertest/glsl2/constructor-10.vert
2010-06-23 13:58:34 -07:00
Jakob Bornecrantz
10e3b9f4d0 nouveau: Rename winsys file 2010-06-23 22:49:11 +02:00
Ian Romanick
3ed850e91c linker: Update some comments, remove a couple FINISHMEs 2010-06-23 12:18:21 -07:00
Ian Romanick
553dcdcaaf linker: Use InfoLog in assign_attribute_locations
Since the program is now passed in, refactor the parameter list to the
function as well.
2010-06-23 12:14:02 -07:00
Ian Romanick
ed1fe3db3b linker: Refactor parameters to cross_validate_uniforms 2010-06-23 12:09:14 -07:00
Ian Romanick
f36460e1a7 linker: Write errors to info log instead of stdout 2010-06-23 12:07:22 -07:00
Corbin Simpson
e6ee4e1bdf glhd: Simple rasterizer checks.
From the documentation.
2010-06-23 11:34:51 -07:00
Corbin Simpson
666fdc01c4 id, glhd: Unbreak texturing.
Argfl.
2010-06-23 11:25:52 -07:00
Ian Romanick
0e59b2698a linker: Initial implementation of varying slot allocation 2010-06-23 11:24:26 -07:00
Ian Romanick
9342d269a4 linker: Limit attribute allocation to MAX_VERTEX_ATTRIBS 2010-06-23 11:24:26 -07:00
Ian Romanick
6984670f97 linker: Support matrix and array vertex inputs 2010-06-23 11:24:26 -07:00
Ian Romanick
0ad22cd1ce linker: Initial implementation of attribute slot allocation 2010-06-23 11:24:26 -07:00
Ian Romanick
a8ca9cbc69 Import some bits Mesa's mtypes.h 2010-06-23 11:24:26 -07:00
Ian Romanick
4485c5ae78 Import gl_program_parameter and gl_program_parameter_list types from Mesa 2010-06-23 11:24:26 -07:00
Ian Romanick
abee16e8cb linker: Store the par-linked per-stage shaders in the glsl_program 2010-06-23 11:24:26 -07:00
Ian Romanick
019a59b264 linker: Initial implementation of uniform slot allocation 2010-06-23 11:24:21 -07:00
Corbin Simpson
9526305834 glhd: Use an environment variable (GALAHAD) to enable. Off by default. 2010-06-23 11:06:42 -07:00
Ian Romanick
5edf6f98d8 Import gl_uniform and gl_uniform_list types from Mesa 2010-06-23 10:56:04 -07:00
Ian Romanick
8b80e9f9e3 ir_variable: Add query to get number of slots used by a variable 2010-06-23 10:56:04 -07:00
Ian Romanick
57bb893a46 glsl_type: Add method to get number of slots used by a type 2010-06-23 10:56:04 -07:00
Ian Romanick
13e10e43c3 linker: Document what remains to be done 2010-06-23 10:56:04 -07:00
Ian Romanick
ed0626ebc7 ir_variable: Set locations for shader built-in variables 2010-06-23 10:56:03 -07:00
Ian Romanick
69a079aee8 ir_variable: Track the location of uniforms, varings, attributes, etc. 2010-06-23 10:56:03 -07:00
Ian Romanick
371019248e linker: Initial implementation of interstage input / output validation 2010-06-23 10:56:03 -07:00
Ian Romanick
950ceb2bd6 ir_variable: Add method to get string representing interpolation qualifier 2010-06-23 10:56:03 -07:00
Ian Romanick
cc22c5a544 linker: Initial implementation of interstage uniform validation 2010-06-23 10:56:03 -07:00
Ian Romanick
1e8b7a714e ir_constant: Add method to determine if two constants have the same value 2010-06-23 10:56:03 -07:00
Eric Anholt
53e48d3f63 Fix multiple usage of an rvalue in constructor component splitting.
Store the thing in a variable and deref it for each swizzle if we have to.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2010-06-23 10:55:25 -07:00
Keith Whitwell
64682da8ab draw: don't try to precalculate the pipeline output primitive
We were previously calculating a value which was either the geometry
shader output primitive or the application's input primitive, and
passing that to the various front/middle/back components for use as
the ultimate rendering primtive.

Unfortunately, this was not correct -- if the vcache decomposition
path is active and geometry shaders are *not* active, we can end up
with a third primitive -- specifically the decomposed version of the
input primitive.

Rather than trying to precalculate this, just let the individual
components inform their successors about which primitive type they are
recieving.
2010-06-23 18:10:20 +01:00
Ian Romanick
865cf2d1f5 ir_validate: Use callback functionality in ir_hierarchical_visitor 2010-06-23 09:25:33 -07:00
Ian Romanick
7c09576a97 ir_hierarchical_visitor: Add generic callback functionality 2010-06-23 09:25:28 -07:00
Brian Paul
292eecca8c draw: mask off DRAW_PIPE_FLAG_MASK bits in prim decompose code
Any elt may potentially have flags bits set so mask off those bits
everywhere.

Fixes crashes with demos/gamma.c, redbook/polys.c, etc. but polygon
stippling is still broken.
2010-06-23 09:20:02 -06:00
Chia-I Wu
985c2fca10 egl: Add a test for MESA_EGL_NO_X11_HEADERS.
When the macro is defined, X11 headers will not be included.
2010-06-23 15:15:00 +08:00
Chia-I Wu
78d70ddbbd egl: Add support for EGL_MESA_drm_display.
The extension defines eglGetDRMDisplay that creates an EGLDisplay from a
DRM fd.  Calling eglCreateWindowSurace or eglCreatePixmapSurface with
such displays will generate EGL_BAD_NATIVE_WINDOW or
EGL_BAD_NATIVE_PIXMAP.
2010-06-23 15:14:59 +08:00
Chia-I Wu
f22665df95 egl: Introduce platform displays internally.
This commit introduces type-safe platform displays internally.  A
platform display consists of a generic pointer and an enum that
specifies the platform.

An EGLDisplay is created from a platform display.  Native displays
become platform displays whose platform is determined by
_eglGetNativePlatform().  Platform windows and pixmaps may also be
introduced if needed.
2010-06-23 15:14:59 +08:00
Corbin Simpson
7dc1cf19ac radeong: Disable Galahad for now; breaks texturing. 2010-06-23 00:11:42 -07:00
Corbin Simpson
ee2c6d748d id, glhd: Fix malloc/calloc of struct.
( >&)
2010-06-22 23:40:11 -07:00
Corbin Simpson
a6cc914874 glhd: Add query protection.
Not quite copied from r300g. This is slightly more API-compliant.
2010-06-22 23:11:01 -07:00
Corbin Simpson
aa451d509d glhd: Grab framebuffer state checks from r300g. 2010-06-22 23:00:44 -07:00
Corbin Simpson
3f758d4ed4 glhd: Grab resource_copy_region from r300g. 2010-06-22 22:49:13 -07:00
Corbin Simpson
de7b181e99 glhd: Grab is_format_supported warning from r300g. 2010-06-22 22:49:13 -07:00
Corbin Simpson
7d551eb03d glhd: Add glhd_warn for unconditional stderr output.
Design decision. Bad API errors should never be silenced.

Of course, you can always not use galahad.
2010-06-22 22:49:13 -07:00
Corbin Simpson
75612aa199 id, glhd: Fix segfault with misreferenced pipe member.
And remove the offending member to keep that from happening again.
2010-06-22 22:49:13 -07:00
Corbin Simpson
40faedfe7b targets, radeong: Add Galahad.
Currently unconditional and causes segfaults.
2010-06-22 22:49:13 -07:00
Corbin Simpson
2560978588 configure: Add galahad to default build. 2010-06-22 22:49:13 -07:00
Corbin Simpson
d3ad6fa579 gallium/drivers: Create Galahad from identity.
Galahad is a sanity-checking layer meant to replace the crufty and
scattered sanity checks inside drivers with a robust, non-silenceable,
useful set of warnings and errors that can be used to keep misbehaving
state trackers from going unnoticed.
2010-06-22 22:49:13 -07:00
Brian Paul
61ec205816 mesa: fix attachment error checking for glGetFramebufferAttachmentParameteriv()
This is a follow-on to commit 80dfec3e53.

The valid attachments for glGetFramebufferAttachmentParameteriv() depends
on whether we're querying the default FBO or a user-created FBO.
2010-06-22 21:55:51 -06:00
Marek Olšák
a20fa67448 r300/compiler: allow 1024 instructions in r5xx vertex shaders 2010-06-23 03:58:46 +02:00
Marek Olšák
dd90c3040e r300/compiler: allow 32 temporaries in vertex shaders 2010-06-23 03:57:27 +02:00
Marek Olšák
2f6b4187eb r300/compiler: emulate loops in vertex shaders
It is not perfect, but it is the best we got.
2010-06-23 03:55:20 +02:00
Jakob Bornecrantz
23a915e2cf gallium: Drop sw drm winsys
Last user went away
2010-06-23 03:43:52 +02:00
Jakob Bornecrantz
41e0f6bc2f i965g: Move bootstrap code to targets 2010-06-23 03:43:48 +02:00
Jakob Bornecrantz
0106be903a i965g: Rename winsys file 2010-06-23 03:20:45 +02:00
Jakob Bornecrantz
2b15e37348 i965g: Moved pci_id to winsys struct 2010-06-23 03:20:45 +02:00
Jakob Bornecrantz
bd739e9576 target-helpers: Add inline helpers 2010-06-23 03:20:40 +02:00
Eric Anholt
53cdb7e51d ir_validate: New pass for checking our invariants. 2010-06-22 18:18:30 -07:00
Eric Anholt
e46a454305 ir: Give ir_instruction a print visitor helper.
This avoids spamming each file with includes of ir_print_visitor.h
because someone was doing debugging at some point, and is less typing
when doing debugging.
2010-06-22 18:18:30 -07:00
Eric Anholt
216580dbd7 Hook up texturing in the hierarchical visitor. 2010-06-22 18:18:30 -07:00
Marek Olšák
cbd33e7d3a mesa: fix assertion failure for GL_ALPHA FBOs 2010-06-23 01:39:26 +02:00
Marek Olšák
9ed7325848 r300g: attempt to fix texture corruption on RV505 2010-06-23 01:35:11 +02:00
Marek Olšák
d84bf6d44d r300g: index buffer range checking 2010-06-23 00:20:11 +02:00
Jakob Bornecrantz
e130f524a9 i915g: Revert debug hunks from last commit 2010-06-22 22:55:13 +02:00
Eric Anholt
ac95f2f8c8 Include stdio.h and stdlib.h everywhere, and don't cook our own #define NULL. 2010-06-22 12:30:55 -07:00
Ian Romanick
b302359394 Add missing build products to gitignore 2010-06-22 12:24:42 -07:00
Jakob Bornecrantz
ca43b6ec9d i915g: Reduce state emission by using a index bias 2010-06-22 20:04:56 +02:00
Jakob Bornecrantz
255d4f24e0 i915g: Drop fifo code in vbuf 2010-06-22 20:04:56 +02:00
Jakob Bornecrantz
4dd742cec3 i915g: Change state code in vbuf code 2010-06-22 20:04:56 +02:00
Jakob Bornecrantz
abbb1bde06 i915g: Rework debug print code 2010-06-22 20:04:55 +02:00
Jakob Bornecrantz
e694f3fd48 i915g: Switch to state atoms 2010-06-22 20:04:55 +02:00
Jakob Bornecrantz
ed675bb460 i915g: i915_state_sampler.c code style 2010-06-22 20:04:55 +02:00
Jakob Bornecrantz
2e7a90546d i915g: i915_state_immediate.c code style 2010-06-22 20:04:55 +02:00
Jakob Bornecrantz
f93e378bfb i915g: i915_state_dynamic.c code style 2010-06-22 20:04:55 +02:00
Jakob Bornecrantz
7dce4f3c27 i915g: Create seperate option for i915g and i965g 2010-06-22 20:04:54 +02:00
Jakob Bornecrantz
ed3d17e14c u_math: Add align function npot alignments 2010-06-22 20:04:54 +02:00
Jakob Bornecrantz
3a3e80ff96 llvmpipe: Ignores 2010-06-22 20:04:32 +02:00
Zack Rusin
b5e381d978 llvmpipe: make geometry shaders and stream output work 2010-06-22 12:58:04 -04:00
Zack Rusin
e433b73dd2 gallium: add a timestamp disjoint query
allows application to not only request the frequency of the TIME_ELAPSED
clock but also to detect if that frequency was consistent throughout the
entire bracketed range of graphics commands.
2010-06-22 12:58:04 -04:00
Zack Rusin
b6c360b46c gallium: add a new query
to figure out if gpu is finished with all of the previously issues commands
2010-06-22 12:58:04 -04:00
Roland Scheidegger
583f241716 st/mesa: remove bogus assertions st_CompressedTexSubImage2D
width/height may not be a multiple of blocksize (small mip levels / npot
textures). This should be handled just fine.
Fixes #28530.
2010-06-22 13:32:25 +01:00
Marek Olšák
eb7ef433bb r300g: optimize the immediate mode emission path a bit 2010-06-22 06:50:23 +02:00
Marek Olšák
bd52246248 r300g: do not emit ZTOP every draw call 2010-06-22 06:50:22 +02:00
Tim Evans
64e32ffb6e swrast: fix incorrect specular highlights on backfaces
See bug 28577 for details.
NOTE: this is a candidate for the 7.8 branch.

Signed-off-by: Brian Paul <brianp@vmware.com>
2010-06-21 17:19:59 -06:00
Brian Paul
b875c02668 docs: add link to 7.9 relnotes 2010-06-21 17:19:59 -06:00
Marek Olšák
59df6725af r300g: fix crash when destroying the context on r3xx-r4xx
FDO bug #28652,
2010-06-21 23:46:38 +02:00
Kenneth Graunke
1b85c46bcf glcpp: Initialize error state. 2010-06-21 13:55:12 -07:00
Kenneth Graunke
332fc47dc0 glcpp: Accept #elif without an expression if the expression doesn't matter.
Issue a warning.  nVidia's compiler seems to accept this; apparently
GCC < 4.4 did as well: http://gcc.gnu.org/gcc-4.4/porting_to.html
2010-06-21 12:41:05 -07:00
Kenneth Graunke
74704e80c6 glcpp: Print to the main compiler's infolog, not stdout. 2010-06-21 12:41:05 -07:00
Kenneth Graunke
4a2bbdacfc Use yy_scan_string and stop caring about shader->SourceLen.
We had to call strlen on the preprocessed source, which seemed a bit
pointless; also, we updated shader->SourceLen but not shader->Source,
which was even more confusing.  Just leave both untouched.
2010-06-21 12:41:05 -07:00
Kenneth Graunke
26e761edb2 glcpp: Rework handling of "defined" operator.
It's now done in the grammar, and as a result, can easily handle
parenthesis.  defined ( identifier ) is now supported.

Fixes glcpp/tests/065-if-defined-parens.c.
2010-06-21 12:41:05 -07:00
Kenneth Graunke
bac0e371e3 glcpp/tests: Add a test for #if defined (identifier)
Previously we only tested #if defined identifier (without parenthesis).
2010-06-21 12:41:05 -07:00
Kenneth Graunke
6587574354 glcpp: Ignore junk tokens at end of #ifdef/#ifndef (with warning)
Both nVidia's compiler and GCC accept this.
Fixes CorrectPreprocess11.frag.
2010-06-21 12:41:05 -07:00
Kenneth Graunke
c9529c4d77 glcpp: Add glcpp_warning for printing warnings to the info log. 2010-06-21 12:41:05 -07:00
Kenneth Graunke
62b4b7785a glcpp: Add boolean 'error' flag.
We used to check if the info log is non-empty, but when we print
warnings, this will no longer be valid.
2010-06-21 12:39:49 -07:00
Kenneth Graunke
33eaa3e0b3 glcpp: Rename "errors" to "info_log."
Eventually, we'll want to be be able to print out warnings as well.
2010-06-21 12:38:39 -07:00
Kenneth Graunke
03ee33809f glcpp: Don't include newlines as part of #version-passthrough.
Fixes glcpp/tests/064-version.c.
2010-06-21 12:31:04 -07:00
Kenneth Graunke
214632f527 glcpp/tests: Add a test for #version followed by #define.
This isn't really a C file, but...that's probably okay.
2010-06-21 12:31:04 -07:00
Kenneth Graunke
8f32221638 glcpp: Fix line and column numbering.
Lines were off by one, and column numbering was completely daft.
2010-06-21 12:31:03 -07:00
Kenneth Graunke
e8e93a4543 glcpp: Remove calls to exit().
Calling exit() would be really bad once integrated into mesa.  Even in
the standalone binary, we want to print the error log first.

Since each case already flags an error, compilation will still fail,
but it may go on (with something fudged) and generate more errors.
2010-06-21 12:31:03 -07:00
Kenneth Graunke
0774523d18 glcpp: Add line locations to "Unterminated #if" error message. 2010-06-21 12:31:03 -07:00
Kenneth Graunke
8a132aa08b glcpp: Add line locations to various mismatched #if error messages. 2010-06-21 12:31:03 -07:00
Kenneth Graunke
dcdf62f1c6 glcpp: Add line locations to "reserved name" error messages. 2010-06-21 12:31:03 -07:00
Kenneth Graunke
ca9e5fce25 glcpp: Print locations in error messages where possible. 2010-06-21 12:31:03 -07:00
Kenneth Graunke
f1e6c069fa glcpp: Introduce new glcpp_error function. 2010-06-21 12:31:02 -07:00
Kenneth Graunke
b78c9ddfbf glcpp: Set locations on tokens. 2010-06-21 11:31:56 -07:00
Kenneth Graunke
db938103c7 glcpp: Set line locations in the lexer. 2010-06-21 11:31:56 -07:00
Kenneth Graunke
465e03ee07 glcpp: Add plumbing to support line locations. 2010-06-21 11:31:55 -07:00
Kenneth Graunke
f70f60739a glcpp: Add %error-verbose. 2010-06-21 11:31:55 -07:00
Kenneth Graunke
77260fc0a0 glcpp: Actually support #ifdef and #ifndef.
Strangely, the lexer never created these tokens, even though the parser
already had code to handle them.
2010-06-21 11:31:55 -07:00
Kenneth Graunke
e0e429fca3 glcpp: Build a reentrant parser. 2010-06-21 11:31:55 -07:00
Kenneth Graunke
b673ff91ab glcpp: Print errors on stdout instead of stderr (non-standalone version).
Otherwise, piglit marks tests as "warn" when the shader was (correctly)
failing.
2010-06-21 11:31:55 -07:00
Kenneth Graunke
3370c5f90b glcpp/tests: Add extra newline at the end of expected output.
This newline at EOF is harmless and generated by the previous commit.
2010-06-21 11:31:55 -07:00
Kenneth Graunke
f82d673648 glcpp: Handle missing newline at EOF.
Fixes CorrectFuncOverload.vert.
2010-06-21 11:31:55 -07:00
Kenneth Graunke
739ba06680 glcpp: Complain about unrecognized directives. 2010-06-21 11:31:55 -07:00
Kenneth Graunke
3b73ea36c4 glcpp: Pass #version, #extension, and #pragma directives through unchanged.
Let the main compiler's lexer/parser handle them.
2010-06-21 11:31:55 -07:00
Kenneth Graunke
04ba86a536 Make the main compiler call the preprocessor.
By using a single function, the main compiler doesn't need to include
glcpp.h, which currently has a lot of details about the preprocessor
internals.  In particular, this prevents the two yacc grammars from
seeing each other, which would be rather messy to sort out.
2010-06-21 11:31:54 -07:00
Kenneth Graunke
2848c4c183 Complain and exit if the given shader file doesn't exist. 2010-06-21 11:27:33 -07:00
Kenneth Graunke
1b1f43e608 glcpp: Add support for lexing from a string.
The standalone binary still reads from stdin, however.
2010-06-21 11:25:50 -07:00
Kenneth Graunke
4c8a1af811 glcpp: Output to a buffer and error log rather than directly printing.
In the standalone case, simply print the buffers when done.
2010-06-21 11:25:50 -07:00
Kenneth Graunke
0656f6b875 glcpp: Fix a case of == where = probably ought to be.
Caught by a GCC warning.
2010-06-21 11:25:50 -07:00
Kenneth Graunke
cbaab7093c Add glcpp to the build. 2010-06-21 11:25:48 -07:00
Kenneth Graunke
254a485c33 Specify %option prefix="glcpp_" in the source code, not the Makefile. 2010-06-21 11:25:30 -07:00
Kenneth Graunke
6f510a49d2 Merge Carl's preprocessor into the glcpp subdirectory. 2010-06-21 11:22:11 -07:00
José Fonseca
197636814e llvmpipe: s/lpfs/shader/ 2010-06-21 14:11:15 +01:00
Marek Olšák
d82f625333 r300g: fix the KIL opcode for r3xx-r4xx (v4) 2010-06-21 04:07:11 +02:00
Marek Olšák
646e9c2fd7 r300g: fix assigning the texture cache region for 1 texture 2010-06-20 14:06:14 +02:00
Vinson Lee
7f6754af25 mapi: Add missing stdlib.h header for malloc declaration. 2010-06-20 01:03:00 -07:00
Vinson Lee
d05e848035 i965g: Fix setup of immediate types for gen4 disasm.
Caught by clang.

Follow-up to commit 070bbd4fcd.
2010-06-20 00:58:52 -07:00
Marek Olšák
e8f2adf8e3 r300g: manually assign texture cache regions
This should fix corrupted texturing on r3xx-r4xx.
2010-06-20 05:30:04 +02:00
Marek Olšák
c85e53bebf r600g: handle DRM_API_HANDLE_TYPE_KMS in buffer_get_handle 2010-06-20 03:59:32 +02:00
Marek Olšák
e4fe18a620 r300g: cleanup buffer_{from, get}_handle 2010-06-20 03:59:32 +02:00
Marek Olšák
6e96cfa39a r300g: cleanup includes 2010-06-20 03:59:31 +02:00
Marek Olšák
a916669468 r300g: texture alignment code cleanup + use special alignment for AA textures 2010-06-20 03:59:28 +02:00
Will Dyson
c674a7eb7f Revert "Fix image_matches_texture_obj() MaxLevel check"
This reverts commit a9ee956511.
It was based on a failure to understand how ther driver allocates
memory, and causes a regression with Celestia.

Set MaxLevel to dstLevel before allocating new mipmap level.

The radeon driver will fail to allocate space for a new level that
is outside of BaseLevel..MaxLevel. Set MaxLevel before allocating.

Signed-off-by: Maciej Cencora <m.cencora@gmail.com>
2010-06-19 22:09:24 +02:00
Kenneth Graunke
f3eb42d200 Print out the info log if compilation fails. 2010-06-19 11:44:22 -07:00
Kenneth Graunke
b2ba6fac09 Change error/warning functions to print to the info log. 2010-06-19 11:44:21 -07:00
Ian Romanick
ca97bd395f Initialize the shader info log
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2010-06-19 11:36:15 -07:00
Kenneth Graunke
32cf482215 Make shader a talloc context. 2010-06-19 11:36:15 -07:00
Kenneth Graunke
57d0fc4139 Link against talloc. We're going to be using it. 2010-06-19 11:36:15 -07:00
Marek Olšák
9b2ebcaf4b r300g: fix random pixels appearing / incomplete rendering
This should fix the FDO bug #28612.

Also, these piglit tests have been fixed:
- fbo-copypix
- scissor-copypixels
- copytexsubimage
- texredefine

Finally, 2 flushes in the transfer path are no longer needed.
2010-06-19 20:26:16 +02:00
Marek Olšák
4c76184305 r300g: output floats instead of halfs when passed through translate 2010-06-19 17:20:40 +02:00
Kenneth Graunke
c186b3fbe0 Fix crash when running glsl on a signle fragment shader. 2010-06-19 01:29:17 -07:00
Kenneth Graunke
29e6087481 Rename prog to shader. Less confusing. 2010-06-19 01:29:17 -07:00
Kenneth Graunke
520aad2c3e Fix compile on 64-bit. 2010-06-19 01:29:17 -07:00
Marek Olšák
ce4c9a7f25 r300g: fix clamp and mirror_clamp wrap modes when used with nearest filtering 2010-06-19 06:18:17 +02:00
Marek Olšák
6acd2117c1 r300g: more informative warning in END_CS 2010-06-19 05:15:07 +02:00
Marek Olšák
371ca689ec r300g: improve the ZTOP condition
The real difference here is that ZTOP is now enabled if all stencil ops
are set to KEEP. This improves performance.
2010-06-19 05:14:31 +02:00
Marek Olšák
8ea45a2c0e r300g: fix up the CS size of the rasterizer state 2010-06-19 05:14:18 +02:00
Ian Romanick
c96822cf31 Ensure that shader_in and shader_out are correctly set in declarations 2010-06-18 19:02:45 -07:00
Ian Romanick
93dad36844 glsl_lexer: centroid and invariant are not reserved words in GLSL 1.10 2010-06-18 19:02:45 -07:00
Ian Romanick
8655b7e78a glsl_lexer: Handle interpolation qualifiers 2010-06-18 19:02:45 -07:00
Eric Anholt
6dd6830e6f intel: Finalize the miptree before mapping it for fallbacks.
Fixes segfault in mipmap_view.c demo.  Bug #27212.
2010-06-18 17:44:47 -07:00
Eric Anholt
1ea7a6a44d i965: Fix the name of aa_coverage_slope in the improved AA line params. 2010-06-18 17:44:47 -07:00
Zack Rusin
0ea927b3ad graw: add two examples using new register files 2010-06-18 13:46:44 -04:00
Zack Rusin
101f792a2a gallium: add a temporary array register file
like normal temporaries, but allows to define a number of distinct
arrays, all of which make it explicit that they contain /indexable/
registers.
as a side-effect we're adding support for multi-dimensional destination
registers.
The whole thing looks like this:
DCL TEMPX[0][0..128]  # 0 array with 128 registers

ADD TEMPX[0][0], IN[0], IMM[0]
ADD TEMPX[0][1], IN[0], IMM[0]
ABS OUT[0], TEMPX[0][TEMP[0]]
2010-06-18 13:46:44 -04:00
Zack Rusin
2b221e11da gallium: add a new register file - immediate array
allows one to specify a safe (bound checked) array
filled with immediates. it works just like a const
array and declares much like our current immediates.
2010-06-18 13:46:44 -04:00
José Fonseca
d7f4250333 llvmpipe: Fix pointer dereference after free. 2010-06-18 17:37:37 +01:00
Roland Scheidegger
17c9d7eea7 llvmpipe: limit the number of fragment shader variants kept around
llvmpipe can create a large number of shader variants for a single shader
(which are quite big), and they were only ever deleted if the shader itself
was deleted. This is especially apparent in things like glean
blendFunc where a new variant is created for every different subtest, chewing
up all memory.
This change limits the numbers of fragment shader variants (for all shaders)
which are kept around to a fixed number. If that would be exceeded a fixed
portion of the cached variants is deleted (since without tracking the used
variants this involves flushing we don't want to delete only one).
Always the least recently used variants (from all shaders together) are
deleted.
For now this is all per-context.
Both the number of how many variants are cached (1024) as well as how many
will be deleted at once (1/4 of the cache size) are just rough guesses and
subject to further optimization.
2010-06-18 13:52:17 +01:00
Ian Romanick
c93b8f1d2c linker: Add some function header comments 2010-06-17 20:37:38 -07:00
Ian Romanick
4230cfdb42 TODO: Add note about initializers for constants 2010-06-17 20:37:17 -07:00
Ian Romanick
ce03088406 Allow initializers for uniforms 2010-06-17 20:09:34 -07:00
Ian Romanick
c648a124b2 Don't link shaders by default
Add a command line option to trigger linking.  This "fixes" all the
failing test cases.  Oops.
2010-06-17 19:51:48 -07:00
Marek Olšák
ff8e1452df r300g: fix hardlocks in occlusion queries
Early Z test (=ZTOP) must be disabled before a query is started,
otherwise the GPU is dead. The order of emitted registers matters more
than you might think.

This fixes hardlocks in sauerbraten.
2010-06-18 02:17:29 +02:00
Marek Olšák
3c351e2c83 r300g: debug option for fake occlusion queries 2010-06-18 02:17:17 +02:00
Ian Romanick
832dfa58b2 linker: Initial bits of the linker
No linking is done yet, but some of the semantic checking is done.
2010-06-17 15:04:20 -07:00
Ian Romanick
705fb01b59 Use glsl_program instead of an open-coded vector of shaders 2010-06-17 12:59:45 -07:00
Ian Romanick
3f09c2508a Add glsl_program that is similar to Mesa's gl_shader_program 2010-06-17 12:59:27 -07:00
Ian Romanick
f8fe53ca2e Change glsl_program to glsl_shader 2010-06-17 12:54:24 -07:00
Ian Romanick
6fd9fb23de Compile multiple shaders listed on the command line 2010-06-17 12:22:16 -07:00
Ian Romanick
8ce55dbd92 Extract compilation to a separate routine
Pull all of the code that actually compiles shaders into a separate
function.  Use a glsl_program to track data about the compiled shader.
2010-06-17 12:01:18 -07:00
Ian Romanick
869b6f680f Add glsl_program that is similar to Mesa's gl_program
This will be used as the header for individual compilation units.
2010-06-17 12:00:25 -07:00
Zack Rusin
4320a451a3 draw: implement triangle strips with adjacency in geometry shader 2010-06-17 13:21:38 -04:00
Zack Rusin
f542a2770a draw: implement triangle lists with adjacency support in gs 2010-06-17 12:05:15 -04:00
Zack Rusin
06b854752f draw: fix a silly error 2010-06-17 11:13:18 -04:00
Zack Rusin
eb33dd6954 draw: implement line strip adjacency 2010-06-17 10:54:44 -04:00
Zack Rusin
dc8f64c537 draw: implement lines with adjacency in geometry shaders 2010-06-17 10:48:23 -04:00
Zack Rusin
91862051f9 draw: validate stream output buffers
fixes a crash.
2010-06-17 10:47:10 -04:00
Zack Rusin
c85971da31 draw: fix some unsigned issue
spotted by Vinson
2010-06-17 05:00:50 -04:00
Chia-I Wu
da39d5d3b4 egl: s/EGL_DISPLAY/EGL_PLATFORM/.
A platform is already used to mean a window system in EGL.  No need to
use a different term.
2010-06-17 16:30:26 +08:00
Chia-I Wu
6f690caddc egl: s/_EGL_PLATFORM/_EGL_OS/ and s/POSIX/UNIX/.
A platform means a native window system in EGL.  Use OS that follows
Gallium instead.
2010-06-17 16:05:18 +08:00
Chia-I Wu
8f3e48ee2c st/egl: Build sw/fbdev winsys for fbdev backend.
Target egl_fbdev_swrast.so needs sw/fbdev/libfbdev.a.
2010-06-17 14:13:30 +08:00
Marek Olšák
c3c2023323 r300g: more reasonable MSPOS defaults in error path 2010-06-17 05:14:24 +02:00
Marek Olšák
6771622e22 r300g: fix surface leaks 2010-06-17 05:11:07 +02:00
Corbin Simpson
1e6d51e805 gallium/docs: GLSL glossary entry. 2010-06-16 18:58:18 -07:00
Corbin Simpson
f98c462770 gallium/docs: Explain DFRACEXP/DLDEXP. 2010-06-16 18:58:18 -07:00
Corbin Simpson
dbc95e8edc gallium/docs: Remove unneeded "doubles", add double blurb. 2010-06-16 18:58:18 -07:00
Corbin Simpson
9d4cb6ea36 gallium/docs: Label opcodes by capability bits. 2010-06-16 18:58:18 -07:00
Corbin Simpson
92867dcc42 gallium/docs: R and RG texture swizzles.
We *did* reach an agreement on this a few months ago, and now the docs
reflect it. However, we never got around to UV and Z...
2010-06-16 18:58:18 -07:00
Corbin Simpson
e7d05f1f0d gallium/docs: Flesh out the distro information.
I'm not sure I picked the best voice here. I might come back to this
later.
2010-06-16 18:58:18 -07:00
Corbin Simpson
517a4fb051 gallium/docs: Fix RST error. 2010-06-16 18:58:18 -07:00
Vinson Lee
2412188453 r300g: Fix uninitialized variable warnings in error path. 2010-06-16 17:56:00 -07:00
Vinson Lee
84178547df intel: Remove unnecessary headers. 2010-06-16 17:44:26 -07:00
Zack Rusin
638a80bc07 draw: make sure we correctly iterate over output buffers on stream out
we kept overwriting the first attribute of a vertex in a single-stream-
out-buffer case
2010-06-16 15:56:17 -04:00
Zack Rusin
509ff13d06 graw: remove wrong test 2010-06-16 15:10:21 -04:00
Zack Rusin
0b8e198027 draw: add stream output decomposition file 2010-06-16 15:03:55 -04:00
Zack Rusin
287531772c draw: rewrite stream output to handle all the dark corners
register masks, multiple output buffers, multiple primitives,
non-linear vertices (elts) and stride semantics.
2010-06-16 14:43:56 -04:00
Zack Rusin
668fa68019 translate: don't crash on elts paths with instances 2010-06-16 14:43:56 -04:00
Corbin Simpson
e41ad8d2c5 r300g: Fix up resolve.
Yay for old code.
2010-06-16 11:01:34 -07:00
Corbin Simpson
61145c0d5c r300g: Fix MSAA state size. 2010-06-16 10:54:09 -07:00
Corbin Simpson
8ecca392da r300g: Don't multisample non-32-bpp render targets. 2010-06-16 10:54:09 -07:00
Corbin Simpson
68cefb423a r300g: Finish resolve function. 2010-06-16 10:54:08 -07:00
Corbin Simpson
e163fc0b15 r300g: Add resource resolve function. 2010-06-16 10:54:08 -07:00
Corbin Simpson
a91fea65dc r300g: Moar MSAA setup.
Need to just add the resolve, then go switch to new DRM and test.
2010-06-16 10:54:08 -07:00
Corbin Simpson
3784b0fa69 r300g: Fix indentation.
I could *not* let this slide since I'm on a 78-char-wide terminal.
2010-06-16 10:54:08 -07:00
Corbin Simpson
5c58618406 r300g: Old MSAA code from before gallium-msaa. 2010-06-16 10:54:06 -07:00
Alan Hourihane
867478b6f6 util: add alloc check 2010-06-16 18:10:34 +01:00
Alan Hourihane
51729b5119 draw: add alloc check 2010-06-16 18:02:21 +01:00
Henri Verbeet
71646528da r600: GL_COORD_REPLACE state is only relevant when point sprites are enabled. 2010-06-16 12:47:28 -04:00
Marc
5552dffa39 r600: fix warnings 2010-06-16 12:47:28 -04:00
Dan Nicholson
cbf30fce32 osmesa: always build standalone for internal symbols
When building OSMesa and xlib GL, the resulting OSMesa would be linked
against libGL instead of the internal mesa libraries. However, when
building with -fvisibility=hidden, some of the internal functions used
in OSMesa could not be resolved through libGL.

Instead, always build OSMesa standalone without linking against libGL.
This has the advantage that OSMesa is always built the same way, but it
means that disk space is wasted when libGL is installed since both
libraries will contain the internal objects.

Signed-off-by: Dan Nicholson <dbn.lists@gmail.com>
Tested-by: Tom Fogal <tfogal@alumni.unh.edu>
2010-06-16 09:23:17 -07:00
Alan Hourihane
1c377cea10 draw: handle some out of memory conditions 2010-06-16 12:27:53 +01:00
Zack Rusin
9829ec2ad8 graw: add a gs test for non-sequential inputs 2010-06-16 05:33:46 -04:00
Ian Romanick
298586fd6c Add TODO list
Don't want to forget anything, no do we?
2010-06-15 17:42:16 -07:00
Vinson Lee
88308ea173 draw: Remove unnecessary headers. 2010-06-15 17:34:59 -07:00
Zack Rusin
3560652ccf gs: make sure we end primitives when finishing executing shaders 2010-06-15 16:37:32 -04:00
Zack Rusin
215e10ac26 draw/gs: make sure gs works with elts and doesn't overrun the buffer 2010-06-15 16:10:18 -04:00
Ian Romanick
81e1747ac5 Printing LIR is optional 2010-06-15 12:51:38 -07:00
Ian Romanick
7babbdbd82 Printing the AST is optional 2010-06-15 12:50:53 -07:00
Ian Romanick
fc0ef6451c Minor bits of code rearranging 2010-06-15 12:20:49 -07:00
Ian Romanick
2b36895f0c Infer shader type from suffix on filename 2010-06-15 12:00:37 -07:00
Kristian Høgsberg
80dfec3e53 mesa: Allow querying the system FBO in GetFramebufferAttachmentParameteriv
If the default framebuffer is bound to <target>, then
        <attachment> must be one of FRONT_LEFT, FRONT_RIGHT, BACK_LEFT,
        BACK_RIGHT, AUXi, DEPTH_BUFFER, or STENCIL_BUFFER, identifying a
        color buffer, the depth buffer, or the stencil buffer, and
        <pname> may be FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE or
        FRAMEBUFFER_ATTACHMENT_OBJECT_NAME.

as well as these <pname> values

        FRAMEBUFFER_ATTACHMENT_RED_SIZE,
        FRAMEBUFFER_ATTACHMENT_GREEN_SIZE,
        FRAMEBUFFER_ATTACHMENT_BLUE_SIZE,
        FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE,
        FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE,
        FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE,
        FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE, or
        FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING.

https://bugs.freedesktop.org/show_bug.cgi?id=28551
2010-06-15 13:28:38 -04:00
Zack Rusin
726f18ee69 graw: test multiple cb's in geometry shaders 2010-06-15 12:14:18 -04:00
Zack Rusin
ec82e9fbfa graw: fix setup for multiple constant buffers 2010-06-15 12:01:47 -04:00
Zack Rusin
bf577393c7 draw: run the pipeline with the correct number of verts
verts per primitive, not total count
2010-06-15 09:12:20 -04:00
Zack Rusin
9cf5e814b9 draw: fix primitive indexing in the pipeline
spotted by Keith
2010-06-15 09:12:20 -04:00
Zack Rusin
a192b5eeaf draw: finish the new pipeline setup
Keith came up with a new way of running the pipeline which involves passing
a few info structs around (for fetch, vertices and prims) and allows us
to correctly handle cases where we endup with multiple primitives generated
by the pipeline itself.
2010-06-15 09:12:20 -04:00
Zack Rusin
92e521a799 softpipe/gs: fix a crash when a gs isn't present 2010-06-15 09:12:19 -04:00
Keith Whitwell
b85a361ccb draw wip 2010-06-15 09:12:19 -04:00
Vinson Lee
5d4d4b2134 i965: Remove unnecessary header. 2010-06-14 17:50:15 -07:00
Ian Romanick
54992c30b0 Remove ability to read "IR shaders" from stand-alone compiler 2010-06-14 14:47:26 -07:00
Ian Romanick
61d4aa041f Move stand-alone compiler main routine to main.cpp 2010-06-14 14:46:09 -07:00
Marek Olšák
0452d52ae3 r300g: initialize US_CODE_BANK on r4xx 2010-06-14 23:39:56 +02:00
Eric Anholt
7dcba1af9d i965: Fix surface state dumping with INTEL_DEBUG=batch.
I broke this with the state streaming changes.
2010-06-14 14:03:56 -07:00
Zhenyu Wang
9a1ce46fce i965: correct the gen6 line stipple enable define. 2010-06-14 14:03:56 -07:00
Eric Anholt
44ad62b86c intel: Remove long-dead comment about releasing texture heaps.
BOs are stored in the bufmgr, which is freed as part of the screen
structure.
2010-06-14 14:03:56 -07:00
José Fonseca
4b383054d3 gallivm: Omit references to NoFramePointerElimNonLeaf
It was added after 2.7.
2010-06-14 17:36:17 +01:00
José Fonseca
27fafa2587 util: Use int type for format field width.
As suggested by gcc warning.
2010-06-14 17:11:21 +01:00
José Fonseca
4d2407699b gallivm: Override some of the default target options.
In particular:
- enable LLVM <-> GDB integration for JIT code
- disable frame-pointer elimination on debug/profile builds
- enable fast-math.
2010-06-14 16:51:47 +01:00
José Fonseca
21a9ef12bf gallivm: Use func_to_pointer(). 2010-06-14 16:50:40 +01:00
José Fonseca
91bbe466c7 util: Add a func_to_pointer util function too. 2010-06-14 16:50:39 +01:00
Jakob Bornecrantz
0ee7a17d0c swrastg: Fix glue file 2010-06-14 17:37:21 +02:00
Zack Rusin
5d5fa34757 graw: small fixups for the gs examples 2010-06-14 10:49:16 -04:00
Marek Olšák
8ad410dc13 r300g: fix uploading RC state shader constants on r3xx
I've messed this up in one of my previous commits.

Reported-by: Igor Murzov
2010-06-14 13:03:13 +02:00
Marek Olšák
1c0e5ba9f1 r300g: drop begin_cs/end_cs
I have had a look at the libdrm sources and they just contain more or less
the same checking we do in macros, and begin_cs may realloc the CS buffer
if we overflow it, which never happens with r300g. So these are pretty
much useless.

There is a small but measurable performance increase by dropping the two
functions.
2010-06-14 12:46:38 +02:00
Marek Olšák
cf3778bae0 r300g: rewrite occlusion queries
The previous implementation had issues with queries spanning over several
command streams as well as using a very large number of queries.

This fixes flickering in Enemy Territory: Quake Wars. The driver now renders
everything correctly in this game and the graphics is awesome.
2010-06-14 12:46:38 +02:00
Marek Olšák
824c1f6a4a r300g: emit viewport state as a dword table 2010-06-14 12:46:37 +02:00
Marek Olšák
8874c9d7a3 r300g: subclass pipe_surface 2010-06-14 12:46:37 +02:00
Marek Olšák
39826a2036 r300g: simplify reloc macros 2010-06-14 12:46:37 +02:00
Marek Olšák
c1f18bff3e r300g: count CS dwords on debug builds only 2010-06-14 00:52:11 +02:00
Marek Olšák
f558bcb397 r300g: optimize emission of fragment shader constants 2010-06-13 17:43:39 +02:00
Marek Olšák
3da6487115 r300g: turn fragment shader into a CB 2010-06-13 17:43:39 +02:00
Marek Olšák
0a44efaeb9 r300g: turn depth stencil state into a CB 2010-06-13 17:43:39 +02:00
Marek Olšák
f803211629 r300g: turn clip state into a CB 2010-06-13 17:43:39 +02:00
Marek Olšák
9dd50993c6 r300g: turn blend color into a CB 2010-06-13 17:43:38 +02:00
Marek Olšák
cd891648d4 r300g: turn blend state into a CB 2010-06-13 17:43:38 +02:00
Marek Olšák
a062156bb2 r300g: add API for building command buffers
The idea is to build a hardware command buffer for every CSO and memcpy
the buffer to a command stream at bind time (or dirty-state-emission time,
to be precise).
2010-06-13 17:43:38 +02:00
Marek Olšák
7ca24dfa6d r300g: inline FLUSH_CS
The fewer macros, the better.
2010-06-13 17:43:38 +02:00
Marek Olšák
98f67a6bbd r300g: reorder CS macros and document them a little 2010-06-13 17:43:38 +02:00
Marek Olšák
8f13e2bda1 r300g: drop DBG_CS
I'd like the CS macros to be as lightweight as possible for performance
reasons.
2010-06-13 17:43:38 +02:00
Marek Olšák
7005feabcd r300g: inline CHECK_CS 2010-06-13 17:43:38 +02:00
Marek Olšák
ae182296ce r300g: replace r300_cs_info with simplier get_cs_free_dwords 2010-06-13 17:43:38 +02:00
Marek Olšák
7d5230ce90 r300g: fix multiple render targets
This fixes tests/drawbuffers.
2010-06-13 17:43:38 +02:00
Marek Olšák
ea0ec0b48e r300g: remove r300_state.h 2010-06-13 17:43:38 +02:00
Marek Olšák
cb17f5ee75 r300g: move two-sided stencilref fallback to its own file 2010-06-13 17:43:37 +02:00
Marek Olšák
aa5422327d r300g: move index buffer translate functions to their new home 2010-06-13 17:43:37 +02:00
Marek Olšák
028459b0bf r300g: add fallback for unaligned/unsupported vertex stride/offset/format
There is a problem though, the translate module cannot emit half float
vertices.
2010-06-13 17:43:37 +02:00
Marek Olšák
1384a7bcca r300g: upload only vertex buffers referenced by vertex elements 2010-06-13 17:43:37 +02:00
Eric Anholt
1dc573a881 i965: Fix gen6 front cull mode. 2010-06-12 21:47:32 -07:00
Zhenyu Wang
5dbbb48f46 i965: Use the new message header format for FF_SYNC on gen6. 2010-06-12 21:47:32 -07:00
Zhenyu Wang
881ec3a814 i965: Add support for math instructions in the gen6 WM. 2010-06-12 21:47:32 -07:00
Zhenyu Wang
7ba2ecb32b i965: Set the correct WM GRF start reg on gen6. 2010-06-12 21:47:31 -07:00
Eric Anholt
0f59b9a95d i965: Update gen6 paths for the streaming rework. 2010-06-12 21:47:31 -07:00
Eric Anholt
7ad26b0030 i965: Stream out CC unit state.
before:
[ # ]  backend                         test   min(s) median(s) stddev. count
[  0]       gl            firefox-talos-gfx   31.791   32.287   1.11%    6/6
after:
[  0]       gl            firefox-talos-gfx   31.198   31.675   0.96%    6/6
2010-06-12 21:47:31 -07:00
Zack Rusin
db05972807 draw/gs: copy the outputs only if we emitted something 2010-06-12 10:45:42 -04:00
Zack Rusin
1551b4da8c softpipe: small cleanup 2010-06-12 10:45:42 -04:00
Joakim Sindholt
60cfed6c70 r300/compiler: fix scons build 2010-06-12 15:40:14 +02:00
Vinson Lee
b6cfca42e3 i965: Remove unnecessary header. 2010-06-12 01:44:43 -07:00
Vinson Lee
e0b211d07c scons: Disable i965g build if using MSVC.
i965g uses C99 constructs that are not supported by MSVC.
2010-06-11 18:43:58 -07:00
Vinson Lee
de51485000 scons: Disable i915g build if using MSVC.
i915g uses C99 constructs that are not supported by MSVC.
2010-06-11 18:42:57 -07:00
Ian Romanick
824b659d91 ir_constant: Eliminate 'void *' constructor
All of the places that had been using the (glsl_type *, void *)
constructor were actually passing an ir_constant_data for the
'void *'.  The code can be greatly simplified by replacing this
constructor with a (glsl_type *, ir_constant_data *) constructor.
This should also help prevent one class of invalid uses of the old
constructor.
2010-06-11 17:12:40 -07:00
Ian Romanick
b74b43e4ba Use statically typed ir_constant constructors wherever possible 2010-06-11 17:12:23 -07:00
Ian Romanick
4976e57448 ir_reader: Use 'union ir_constant_data' in read_constant 2010-06-11 17:12:23 -07:00
Ian Romanick
f8b88bea0f ir_constant_visitor: Type of constant result is same as original expression
The type of the resulting constant must be the same as the type of the
original expression.  The changes to the code require that the case
where an unhandled expression is received, and there really shouldn't
be any of these, must be an exit point.
2010-06-11 17:12:12 -07:00
Ian Romanick
083d75a942 ir_constant_visitor: Types of ir_binop_{equal,nequal} must match
The types must match exactly, so there is no reason to check the types here.
2010-06-11 17:11:14 -07:00
Ian Romanick
4daaab6040 ir_constant_visitor: Use 'union ir_constant_data' in expression handler 2010-06-11 17:11:06 -07:00
Ian Romanick
0bb70a30d5 ir_constant_visitor: Use 'union ir_constant_data' instead of open-coded version 2010-06-11 15:49:49 -07:00
Ian Romanick
be1d2bfdea Matrix and vector constructors with a single constant scalar are constant 2010-06-11 15:48:26 -07:00
Ian Romanick
39d6dd3537 ir_constant_visitor: Handle bool-to-int and int-to-bool 2010-06-11 15:43:59 -07:00
Ian Romanick
7825d3d157 Treat ?: with all constant subexpressions as a constant expression 2010-06-11 15:43:59 -07:00
Ian Romanick
0ad76c6767 Rearrange code in HIR conversion of ?: operator
There are no functional changes.  Code is just moved arround.  This
prepares for the next set of changes that do change the functionality.
2010-06-11 15:43:59 -07:00
Ian Romanick
c2ba619092 ir_constant_visitor: Handle constant swizzles 2010-06-11 15:43:59 -07:00
Ian Romanick
9b92af9ebc ir_constant_visitor: Handle array access of constant vectors and matrices 2010-06-11 15:43:56 -07:00
Ian Romanick
2cf0969de5 Remove redundant type checks for constant constructors
All of the cases (e.g., arrays and structures) that were being
filtered by these tests were already filtered by the earlier
is_numeric and is_boolean tests.
2010-06-11 15:37:34 -07:00
Ian Romanick
1a872b1af3 Do simple constant folding while processing function call parameters 2010-06-11 15:37:34 -07:00
Ian Romanick
253dedeb6c ir_constant_visitor: Handle dereferences of constant records 2010-06-11 15:37:27 -07:00
Ian Romanick
b94c29a47b ir_constant: Add get_record_field query 2010-06-11 15:36:05 -07:00
Ian Romanick
eeedd355cf Add glsl_types::field_index to get the location of a record field 2010-06-11 13:51:42 -07:00
Ian Romanick
ab92d0e53e Detect and process constant record constructors 2010-06-11 13:51:42 -07:00
Ian Romanick
c077131c0f Move parameter processing out of match_function_by_name
Eventually code that processes constant structure constructors will
need to use the processed list of parameters.
2010-06-11 13:51:42 -07:00
Ian Romanick
d4b33edbd0 ir_constant_visitor: Use clone to create a constant from a variable reference 2010-06-11 13:51:42 -07:00
Ian Romanick
710919fd7c ir_constant: Support constant structures in clone 2010-06-11 13:51:42 -07:00
Ian Romanick
7f1ab834d7 ir_constant: Add storage for multiple constants for arrays and records 2010-06-11 13:51:42 -07:00
Ian Romanick
93073551f9 Add glsl_type::is_record query 2010-06-11 13:51:42 -07:00
Ian Romanick
7dc2b71a89 Add float/bool conversion to ir_constant_expression.cpp. 2010-06-11 13:51:42 -07:00
Ian Romanick
00eb466e38 Constant-fold constructor parameters after type conversion
This causes the following tests to pass:

         glslparsertest/shaders/CorrectMatComma2.frag

One of the incorrect errors in glslparsertest/shaders/CorrectComma.frag
is also eliminated.
2010-06-11 13:51:42 -07:00
Ian Romanick
9e08d019ce Make constructors with all constant parameters generate in-line constants 2010-06-11 13:51:09 -07:00
Ian Romanick
756a3fac4f Construct an ir_constant from a list of ir_constant values 2010-06-11 13:51:09 -07:00
Ian Romanick
7c40a32054 Add queries to determine if a node is a list sentinal 2010-06-11 13:51:09 -07:00
Ian Romanick
31881908eb Add methods to ir_constant to get scalar components in a particular type 2010-06-11 13:51:09 -07:00
Ian Romanick
c9cb1032be Derefence components of constants smarter
During generation of calls to constructors, derefernce constants by creating
new constants instead of creating dereferences.
2010-06-11 13:51:09 -07:00
Ian Romanick
989cfc432e Construct an ir_constant from a scalar component of another ir_constant 2010-06-11 13:51:09 -07:00
Ian Romanick
565185cd8f Use ir_unop_b2i when converting a bool-to-int and add a missing break
The previous code just had dumb cut-and-paste errors.
2010-06-11 13:49:00 -07:00
Tom Stellard
3eca311b72 r300/compiler: Handle more complex conditionals in loops. 2010-06-11 22:06:59 +02:00
Tom Stellard
bde34a76b5 r300/compiler: Fix warning. 2010-06-11 22:06:59 +02:00
Tom Stellard
f7269cf26a r300/compiler: Handle SGT and SLE at the beginning of loops. 2010-06-11 22:06:59 +02:00
Tom Stellard
0125f5270b r300/compiler: Verify assumptions about opcode types. 2010-06-11 22:06:59 +02:00
Tom Stellard
6f1b6814bc r300/compiler: Unroll loops that decrement the counter.
e.g. for(i=10; i>0; i--)
2010-06-11 22:06:58 +02:00
Tom Stellard
0f1109ce36 r300/compiler: Unroll loops that have a constant number of iterations.
This only works with for loops that increment the counter.
e.g. for(i=0; i<10; i++)
2010-06-11 22:06:58 +02:00
Tom Stellard
622fd4d061 r300/compiler: Implement simple loop emulation
The loop emulation unrolls loops as may times as possbile while still
keeping the shader program below the maximum instruction limit.  At this
point, there are no checks for constant conditionals.  This is only enabled
for fragment shaders.
2010-06-11 22:06:58 +02:00
Eric Anholt
108264e859 i965: Remove the surface key used to generate constant surfaces.
We had to fill out all that junk when using the cache, but no more.
2010-06-11 12:21:23 -07:00
Eric Anholt
34c82804ed i965: Warning fixes from the i965-streaming merge. 2010-06-11 12:09:26 -07:00
Zack Rusin
53bd9796a1 gallium/softpipe/draw: support samplers in geometry shaders 2010-06-11 13:31:52 -04:00
Zack Rusin
2396967038 tgsi: support 2d indirect addressing 2010-06-11 10:35:24 -04:00
Eric Anholt
27bc2de546 i965: Use the state base address to avoid relocations.
This makes the binding table code simpler, and is required for gen6,
which requires binding table addresses to be under 64k offset from the
surface state base addr.

No significant change in performance on firefox-talos-gfx.
2010-06-11 00:16:15 -07:00
Eric Anholt
8ad3fdc967 i965: GC the last two arguments to brw_cache_data.
Now that the binding table is streamed indirect state, they were
always NULL/0.
2010-06-11 00:16:15 -07:00
Eric Anholt
309c011641 i965: Remove brw_state_cache_bo_delete now that it's unused again. 2010-06-11 00:16:09 -07:00
Eric Anholt
178414eba4 i965: Remove caching of surface state objects.
It turns out that computing a 56 byte key to look up a 20-byte object
out of a hash table was some sort of a bad idea.  Whoops.

before:
[ # ]  backend                         test   min(s) median(s) stddev. count
[  0]       gl            firefox-talos-gfx   37.799   38.203   0.39%    6/6
after:
[  0]       gl            firefox-talos-gfx   34.761   34.784   0.17%    5/6
2010-06-11 00:15:59 -07:00
Eric Anholt
73de09f265 i965: Convert the binding table to streamed indirect state.
This slightly reduces reduces cairo-gl firefox-talos-gfx runtime on my
Ironlake:
before:
[ # ]  backend                         test   min(s) median(s) stddev. count
[  0]       gl            firefox-talos-gfx   38.236   38.383   0.43%    5/6
after:
[  0]       gl            firefox-talos-gfx   37.799   38.203   0.39%    6/6

It turns out the cost of caching these objects and looking them up in
the cache again is greater than the cost of just computing the object
again, particularly when the overhead of having a separate BO to pin
is removed.

(Those that are paying close attention will note that this is a
reversal of the path I was moving the driver in a couple of years ago.
The major thing that has changed is that back then all state was
recomputed when we wrapped the streaming state buffer, including
recompiling our precious programs.  Now, we're uncaching just the
objects that are cheap to compute, and retaining caching of expensive
objects)
2010-06-11 00:15:56 -07:00
Eric Anholt
118a47623a i965: Split constant buffer setup from its surface state/binding state.
This was bothering me when redoing the binding tables.
2010-06-11 00:15:56 -07:00
Eric Anholt
321014156b i965: Add support for streaming indirect state rather than caching objects. 2010-06-11 00:15:56 -07:00
Eric Anholt
f5bb775fd1 i965: Set the CC VP state immediately on state change.
The cache lookup of these two little floats was .12% of total CPU time
on firefox-talos-gfx because we did it any time commonly-changed state
changed.  On the other hand, updating the CC VP bo immediately whenver
CC VP state changes is a .07% overhead due to putting a driver hoook
in glEnable().
2010-06-11 00:15:56 -07:00
Eric Anholt
315ef0312a i965: Update old comment about state cache sizing. 2010-06-11 00:15:56 -07:00
Eric Anholt
3b3278519a i965: Move no_batch_wrap assertion out across the area we're trying to verify.
It's more likely that we wrap badly in state setup than in the little
primitive packet.
2010-06-11 00:15:55 -07:00
Brian Paul
0a48949a11 i965: remove UseProgram driver callback
It just duplicated the default/core Mesa behaviour.
2010-06-10 23:33:51 -06:00
Brian Paul
ec2b92f98c mesa: rename src/mesa/shader/ to src/mesa/program/ 2010-06-10 23:23:13 -06:00
Chia-I Wu
411bba3446 docs: Update EGL doc.
Update for recent removal of demos and additions of new displays and
functions.
2010-06-11 12:55:09 +08:00
Chia-I Wu
ebed500fae st/egl: Do not build non-working driver combinations.
The KMS backend requires a hardware pipe driver.  Do not build
egl_kms_swrast.  Also, only build egl_fbdev_swrast for fbdev backend.
It is a pure software backend.
2010-06-11 12:55:09 +08:00
Chia-I Wu
71580edc01 st/egl: Add fbdev backend.
The backend is pure software.  It implements EGL_MESA_screen_surface
extension, and is kept simple by only exporting the current mode.
2010-06-11 12:55:09 +08:00
Brian Paul
f1c5043f94 mesa: move shader/slang/* sources to main/slang/*
Reduce the source tree depth a bit.
2010-06-10 22:48:16 -06:00
Brian Paul
7936e06657 mesa: move nvprogram.[ch] to main/ 2010-06-10 22:37:31 -06:00
Brian Paul
412cddf954 mesa: move arbprogram.[ch] to main/ 2010-06-10 22:32:21 -06:00
Brian Paul
70c8d29b6b mesa: move atifragshader.[ch] to main/ 2010-06-10 22:24:45 -06:00
Brian Paul
936605fc8a mesa: move uniforms.c to main/ 2010-06-10 22:24:37 -06:00
Chia-I Wu
ce0c837f60 winsys: Add fbdev software winsys.
This is a simple winsys that mmap()s the framebuffer device and
memcpy()s the contents of display targets to the framebuffer device for
displaying.
2010-06-11 12:23:38 +08:00
Brian Paul
a37b2219d6 mesa: refactor shader api / object code
Remove the unneeded ctx->Driver hooks for shader-related functions.
Move state and API-related things into main/.
2010-06-10 20:32:57 -06:00
Brian Paul
050eed095a i965: remove UseProgram driver callback
It just duplicated the default/core Mesa behaviour.
2010-06-10 20:06:45 -06:00
Vinson Lee
628cf02d67 st/egl: Remove unnecessary header. 2010-06-10 15:52:04 -07:00
Vinson Lee
77cbf32e61 intel: Remove unnecessary header. 2010-06-10 15:47:37 -07:00
Zack Rusin
9896b7ebeb draw: forgot to add a file 2010-06-10 15:25:30 -04:00
Zack Rusin
29639932f7 draw: rewrite geometry shader pipeline
done to handle strips correctly as inputs - we need to decompose
the strips
2010-06-10 15:23:01 -04:00
Zack Rusin
226ff53e63 gs: give our test an option of rendering a strip 2010-06-10 13:20:15 -04:00
Zack Rusin
4d0baa73c9 draw: geometry shader fixes
don't overwrite the inputs and make sure the correct primitive
is used on entry
2010-06-10 13:07:27 -04:00
Zack Rusin
9ef6d34f7e draw: make sure that the gs never outputs more data than we allocated for 2010-06-10 05:15:55 -04:00
Vinson Lee
9be40de087 r300g: Fix memory leak on error path. 2010-06-10 00:33:25 -07:00
Eric Anholt
6383428588 i965: Add support for GL_ALPHA framebuffer objects. 2010-06-10 00:40:00 -07:00
Eric Anholt
262cdbd957 mesa: Allow GL_ALPHA FBOs with ARB_framebuffer_object.
Drivers still reject them today, but cairo would like to use these.
2010-06-10 00:22:01 -07:00
Eric Anholt
ceba688cb5 swrast: When reading from a 0-bits r,g,b channel, return 0 not 1.
It looks like we were reading a fractional value, multiplying by an
enormous negative value, then stuffing that value into a bitfield
assuming it was already clamped.  This becomes relevant for GL_ALPHA
or R/RG FBOs.
2010-06-10 00:22:00 -07:00
Kenneth Graunke
332920a940 Remove linux_list in favor of exec_list. 2010-06-09 17:05:14 -07:00
Kenneth Graunke
75393ee16b Add forgotten autogenerated EXT_texture_array_fs folder. 2010-06-09 16:46:09 -07:00
Kenneth Graunke
af05703826 Implement 1.30 int/uint variants of min/max/clamp. 2010-06-09 16:14:45 -07:00
Kenneth Graunke
c3bf0cbefc texture_builtins.py: The unsigned integer type is "uint", not "unsigned"
This doesn't actually affect anything yet, but is good to fix anyway.
2010-06-09 16:11:36 -07:00
Kenneth Graunke
c9aabc866f Implement 1.30 hyperbolic trig builtins (sinh, cosh, tanh). 2010-06-09 16:08:36 -07:00
Kenneth Graunke
1d0e07c420 Implement 1.20 'transpose' builtin. 2010-06-09 15:56:46 -07:00
Kenneth Graunke
43ff6fc4ae Implement 1.20 'outerProduct' builtin. 2010-06-09 15:47:34 -07:00
Kenneth Graunke
0c8ffadc8c Implement matrixCompMult builtin - the last of the 110 builtins. 2010-06-09 15:35:54 -07:00
Kenneth Graunke
d6a32d4b54 ir_constant_visitor: Add support for dFdx and dFdy operations.
If the argument is a constant expression...it's not changing per pixel,
so the result is simply 0.
2010-06-09 15:23:40 -07:00
Kenneth Graunke
b843c7a20c Implement dFdx, dFdy, and fwidth via new expression opcodes. 2010-06-09 14:44:39 -07:00
Kenneth Graunke
cbd881da3f Implement 'refract' builtin. 2010-06-09 14:44:39 -07:00
Eric Anholt
94731797c6 intel: Use the blitter to upload TexSubImage data to busy textures.
This avoids many pipeline stalls in cairo-gl.
[ # ]  backend                         test   min(s) median(s) stddev. count
Before:
[  0]       gl            firefox-talos-gfx   36.799   36.851   2.34%    3/3
[  0]       gl            firefox-talos-svg   33.429   35.360   3.46%    3/3
After:
[  0]       gl            firefox-talos-gfx   35.895   36.250   0.48%    3/3
[  0]       gl            firefox-talos-svg   26.669   29.888   5.34%    3/3

This doesn't avoid all the pipeline stalls because the kernel reports
!busy for buffers on the flushing list.  That should be fixed in .36.
2010-06-09 14:23:46 -07:00
Eric Anholt
503eb57a00 i965: Avoid calloc/free in the CURBE upload process.
In exchange we end up with an extra memcpy, but that seems better than
calloc/free.  Each buffer is 4k maximum, and on the i965-streaming
branch this allocation was showing up as the top entry in
brw_validate_state profiling for cairo-gl.
2010-06-09 14:17:52 -07:00
Kenneth Graunke
3ffedf1249 Fix some typing issues in asin.
CorrectFunction.vert now passes.
2010-06-09 14:15:04 -07:00
Kenneth Graunke
c476ba8fe2 Add a completely bogus implementation of the noise[1234] builtins.
idr suggested this.  Eventually we will need a real one.
2010-06-09 14:07:35 -07:00
Kenneth Graunke
855fcb22c1 Implement 'acos' builtin.
This is tacked on to the end of the 'asin' file because acos calls asin,
whech means asin needs to be defined first.  Alphabetical order fail.
2010-06-09 13:52:32 -07:00
Carl Worth
2fb30a2e49 Merge remote branch 'kwg/fixes' 2010-06-09 13:29:37 -07:00
Kenneth Graunke
539f29323f Implement 'faceforward' builtin. 2010-06-09 13:27:16 -07:00
Kenneth Graunke
29b22287fe Implement 'distance' builtin. 2010-06-09 13:17:00 -07:00
Kenneth Graunke
cdf1726ffd Add remaining signatures for 'clamp' builtin. 2010-06-09 13:10:00 -07:00
Kenneth Graunke
76796ed66f Add remaining signatures for 'max' builtin. 2010-06-09 13:05:40 -07:00
Kenneth Graunke
47d44c877e Add remaining signatures for 'min' builtin. 2010-06-09 13:04:16 -07:00
Kenneth Graunke
2438f64e63 Add remaining signatures for 'mod' builtin. 2010-06-09 13:04:03 -07:00
Marek Olšák
45fb47d50c r300g: try harder to create a transfer object
I was told this wouldn't help to fix the FDO bug #28443, but still,
it's a harmless last resort.

Also, linear textures safely fallback to an unpipelined transfer here.
2010-06-09 21:43:31 +02:00
Zack Rusin
1d11eac93f draw: make sure geometry shader correctly iterates the output buffer 2010-06-09 15:02:08 -04:00
Marek Olšák
f571a569a0 r300g: debug output texture size 2010-06-09 20:22:52 +02:00
Marek Olšák
950be3fa3c r300g: return NULL texture early if buffer_create fails 2010-06-09 20:17:27 +02:00
Kenneth Graunke
b97efa5db5 ir_function_cloning_visitor: Add support for ir_texture. 2010-06-09 11:14:58 -07:00
Kenneth Graunke
8331d48948 Don't call _mesa_glsl_initialize_types for every builtin function.
This was clearly wrong; types are now only initialized once.
2010-06-09 11:14:58 -07:00
Kenneth Graunke
57503a22d7 Only initialize types after #extension directives have been processed.
Since _mesa_glsl_initialize_types add types for various extensions, we
can't call it until after processing "#extension foo : disable" lines.

Fixes tex_rect_02.frag.
2010-06-09 11:14:58 -07:00
Kenneth Graunke
4b0029a97d Commit output of texture_builtins.py and refresh builtin_function.cpp. 2010-06-09 11:14:58 -07:00
Kenneth Graunke
5e65c1ccae texture_builtins.py: Support the EXT_texture_array extension. 2010-06-09 11:14:58 -07:00
Kenneth Graunke
0d80f71867 Add EXT_texture_array support. 2010-06-09 11:14:58 -07:00
Kenneth Graunke
cc249f79e7 generate_builtins.pl: Support stage-specific builtins even for extensions. 2010-06-09 11:14:58 -07:00
Kenneth Graunke
c34a624c9f texture_builtins.py: Fixes for Array variants.
The array layer is now included as part of the texture coordinate.
2010-06-09 11:14:58 -07:00
Kenneth Graunke
538da12092 texture_builtins.py: Add support for 130 Proj variants. 2010-06-09 11:14:58 -07:00
Kenneth Graunke
b3bcea7db6 Add a python script to generate texture builtins. 2010-06-09 11:14:58 -07:00
Kenneth Graunke
9aefbe838c generate_builtins.pl: Support directiories for each extension. 2010-06-09 11:14:58 -07:00
Kenneth Graunke
9d1fc46f0c generate_builtins.pl: Support _fs directories as well as _vs. 2010-06-09 11:14:57 -07:00
Kenneth Graunke
56d3f6ad78 Set the type of ir_texture properly; infer it from the sampler type. 2010-06-09 11:14:57 -07:00
Kenneth Graunke
dd5b4a544b ir_reader: Add support for reading ir_texture. 2010-06-09 11:14:57 -07:00
Kenneth Graunke
3c7934bfaa ir_reader: Refactor reading of dereferences for later reuse. 2010-06-09 11:14:57 -07:00
Kenneth Graunke
26d74cd1d1 Add stub visitor support for ir_texture. 2010-06-09 11:14:57 -07:00
Kenneth Graunke
be298063b5 ir_print_visitor: Add support for ir_texture. 2010-06-09 11:14:57 -07:00
Kenneth Graunke
c30f6e5dea Add mappings between ir_texture_opcode and strings. 2010-06-09 11:14:57 -07:00
Ian Romanick
81377c012c Define IR instruction for texture look-ups 2010-06-09 11:14:57 -07:00
Zack Rusin
da4185ca77 draw: make sure the buffer is big enough to fit everything emitted by the gs 2010-06-09 14:11:43 -04:00
Ian Romanick
2f8b0435b0 Use array delete operator to delete an array
This was detected by valgrind.  I think GCC still does the right
thing, but the C++ spec allows the compiler to do something
stupid... like crash or only delete the first entry in the array.
2010-06-09 11:00:23 -07:00
Roland Scheidegger
26d5d4d995 llvmpipe: fix copy & paste bug in clear logic
fixes bug 28450.
2010-06-09 18:46:52 +02:00
Zack Rusin
04490ad31d draw: fix geometry shader which emit multiplie primitives 2010-06-09 11:59:53 -04:00
Zack Rusin
d27d45a2df graw: add a multiple primitive geometry shader test 2010-06-09 11:44:19 -04:00
Zack Rusin
db7ed20730 nv: fix compile after the latest gs changes 2010-06-09 11:29:45 -04:00
Zack Rusin
d4ef0f6c67 geometry shaders: make gs work with changable primitives and variable number of vertices
lots and lots of fixes for geometry shaders. in particular now we work when the gs
emits a different primitive than the one the pipeline was started with and also
we work when gs emits more vertices than would fit in the original buffer.
2010-06-09 11:13:34 -04:00
Thomas Hellstrom
cec9955acc xorg/vmwgfx: Disable 3D by default.
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2010-06-09 07:40:07 +02:00
Thomas Hellstrom
2e27bf8b7c st/xorg: Add a customizable option to disable 3D.
If no customizer is present, 3D will be enabled by default.
Otherwise the option will default to the customizer value.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2010-06-09 07:40:07 +02:00
Ben Skeggs
ebd98b3496 nvfx: fix typo from gallium-msaa merge 2010-06-09 11:59:49 +10:00
Ben Skeggs
851ca2f7f9 nv50: fix typo from gallium-msaa merge 2010-06-09 11:59:01 +10:00
Ben Skeggs
7bf678f7ec nv50: use MARK_RING correctly 2010-06-09 11:59:01 +10:00
Vinson Lee
c217d94cca draw: Remove unnecessary headers. 2010-06-08 17:40:23 -07:00
Marek Olšák
eee570a0fe r600g: save vertex buffers in blitter 2010-06-09 02:26:44 +02:00
Marek Olšák
26f3f13fa1 r300g: save vertex buffers in blitter 2010-06-09 02:26:44 +02:00
Marek Olšák
8f17e011c3 util: reference vertex buffers in blitter 2010-06-09 02:26:24 +02:00
Marek Olšák
89dc925150 r300g: report that transfers are always supported 2010-06-09 00:26:28 +02:00
Marek Olšák
25470dcbb1 r300g: fix loading compressed textures 2010-06-09 00:18:28 +02:00
Marek Olšák
fccfb7b165 r300g: skip rendering for unsupported vertex formats instead of aborting
The next step is to replace skipping by an actual fallback.
2010-06-08 23:50:05 +02:00
Eric Anholt
bcf63dbbd8 intel: Flag NEW_BUFFERS when changing draw buffers.
There were entries to this function (most imporantly, prepare_render
-> update_renderbuffers) that wouldn't have had NEW_BUFFERS set, but
brw_wm_surface_state (the i965 state tracking the drawing regions)
expected this to change.
2010-06-08 13:42:02 -07:00
Eric Anholt
df3c1a563f intel: Convert remaining dri_bo_emit_reloc to drm_intel_bo_emit_reloc.
The new API makes so much more sense, I'd like to forget how the old
one worked.
2010-06-08 13:42:02 -07:00
Eric Anholt
34474fa411 intel: Change dri_bo_* to drm_intel_bo* to consistently use new API.
The slightly less mechanical change of converting the emit_reloc calls
will follow.
2010-06-08 13:42:02 -07:00
Eric Anholt
22409756d4 intel: Clean up stale comments in intel_batchbuffer.c. 2010-06-08 13:42:02 -07:00
Eric Anholt
754fcd605b intel: Remove the non-gem paths for batchbuffer upload. 2010-06-08 13:42:02 -07:00
Eric Anholt
4527faa344 intel: Update comment in intel_tex_copy from before miptree x/y rework. 2010-06-08 13:42:02 -07:00
Zack Rusin
551467d4ef softpipe: make sure we don't fallback to assert on so stats query
spotted by Vinson
2010-06-08 16:20:25 -04:00
Zack Rusin
38b13459be softpipe: make sure that invalid calls to sosettargets don't crash us 2010-06-08 16:18:38 -04:00
Henri Verbeet
8744c36ea4 r600: Make next_inst() static. 2010-06-08 15:40:25 -04:00
Henri Verbeet
1bf75a921b r600: Assert output registers have a valid export index. 2010-06-08 15:40:25 -04:00
Henri Verbeet
1ec492a366 r600: Process exports for all written fragment outputs. 2010-06-08 15:40:25 -04:00
Henri Verbeet
1f7bc87391 r600: Fill uiFP_OutputMap for all written fragment outputs. 2010-06-08 15:40:25 -04:00
Keith Whitwell
e3c6d4108c SConscript: don't build mesa components if mesa not in state trackers 2010-06-08 17:38:56 +01:00
Brian Paul
10379e4edf softpipe: added sp_state_so.c to file list 2010-06-08 08:21:27 -06:00
Zack Rusin
b5d2fc2b48 gallium: scream when one of two unimplemented features in draw is used
plus used the correctly specified stride
2010-06-08 06:28:11 -04:00
Zack Rusin
be7d8ddf0c gallium: add basic support for stream output queries 2010-06-08 06:28:11 -04:00
Zack Rusin
34f7681669 gallium: adjust the query interface to support custom types
we need to change it to support composite types
2010-06-08 06:28:11 -04:00
Zack Rusin
3a7fc2e4f3 gallium: rename draw_auto to draw_stream_output, plus fix a comment
Brian spotted those
2010-06-08 06:28:11 -04:00
Zack Rusin
2c22b8e61d gallium: make draw auto work and add relevant caps and docs 2010-06-08 06:28:11 -04:00
Zack Rusin
ba5975dd32 gallium: add interface for DrawAuto and implement it in softpipe 2010-06-08 06:28:11 -04:00
Zack Rusin
c9db97c822 gallium: a lot more complete implementation of stream output
interface wise we have everything needed by d3d10 and gl transform feedback.
the draw module misses implementation of some corner cases (e.g. when stream
output wants different number of components per output than normal rendering
paths)
2010-06-08 06:28:10 -04:00
Zack Rusin
a45b7f47ee gallium: basic and initial implementation of the stream output interface
aka transform feedback
2010-06-08 06:28:10 -04:00
Dave Airlie
a2817f6ae5 st/mesa: attempt to fix TFP by using sampler views (v1)
Okay I think this is good enough for now, I can't see any other reason
for mesa to want to use a sampler view so lets just leave it at all the A->X conversions for now.

I've been running gnome-shell under r300g with this for day or so and it seems fine.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-06-08 19:08:36 +10:00
Jakob Bornecrantz
3a876e8473 llvmpipe: Add geom shader file to make build 2010-06-08 04:46:52 +02:00
Ian Romanick
cfb3536f10 Bump GL_MAX_TEXTURE_COORDS from 2 to 4
Every platform that supports GLSL sets GL_MAX_TEXTURE_COORDS to at
least 4, so hard-code 4 for now.

This causes the following tests to pass:

    glslparsertest/glsl2/norsetto-bumptbn_sh_fp.vert
    glslparsertest/glsl2/xreal-lighting-d-omni.vert
    glslparsertest/glsl2/xreal-lighting-db-omni.vert
    glslparsertest/glsl2/xreal-lighting-dbs-omni.vert
2010-06-07 19:10:33 -07:00
Ian Romanick
19eb5896c4 Only allow global precision qualifier for int and float
This causes the following tests to pass:

    glslparsertest/glsl2/precision-03.vert
2010-06-07 19:03:03 -07:00
Ian Romanick
9bcb67bdc4 Fix parsing of precision qualifiers
This causes the following tests to pass:

     glslparsertest/glsl2/precision-02.vert
     glslparsertest/glsl2/precision-04.vert
     glslparsertest/glsl2/precision-06.vert

This causes the following test to fail.  This shader was previously
failing to compile, but it was failing for the wrong reasons.

     glslparsertest/glsl2/precision-03.vert
2010-06-07 18:56:16 -07:00
Ian Romanick
15d162d7b1 Don't process empty shaders
Some valid shaders, such as 'precision highp float;', evaluate to
empty sets of instructions.  This causes some of the optimization
stages to enter infinite loops.  Instead, don't bother processing the
empty ones.
2010-06-07 18:53:06 -07:00
Ian Romanick
6cd2a5cc4b Generate an error on empty declaration lists
This causes an error for code such as 'float;'
2010-06-07 18:49:48 -07:00
Vinson Lee
380f08f4ec graw: Fix file handle leaks. 2010-06-07 18:34:13 -07:00
Vinson Lee
d09271d6ef graw: Remove unnecessary headers. 2010-06-07 18:14:34 -07:00
Vinson Lee
b0acaaac53 sw: Remove unnecessary header. 2010-06-07 18:08:33 -07:00
Jakob Bornecrantz
0528106cc7 glew: Drop glew now that we don't need it for the progs
configs/beos           |    2 +-
 configs/darwin         |    2 +-
 configs/default        |    4 +-
 configs/freebsd-dri    |    2 +-
 configs/linux-cell     |    2 +-
 configs/linux-dri-xcb  |    2 +-
 configs/linux-indirect |    2 +-
 configure.ac           |    2 +-
 include/GL/glew.h      |14435 ------------------------------------------------
 include/GL/glxew.h     | 1476 -----
 include/GL/wglew.h     | 1247 -----
 src/SConscript         |    1 -
 src/glew/LICENSE.txt   |   73 -
 src/glew/Makefile      |   54 -
 src/glew/SConscript    |   69 -
 src/glew/glew.c        |14320 -----------------------------------------------
 src/glew/glewinfo.c    | 8441 ----------------------------
 src/glew/visualinfo.c  | 1173 ----
 18 files changed, 8 insertions(+), 41299 deletions(-)

Revert "glew: update to version 1.5.4"
This reverts commit a189b1c53b.

Revert "glew: Include X11 headers and libraries in SCons build."
This reverts commit efdd33985c.

Revert "scons: Fix GLEW build on Mac OS X."
This reverts commit 8f81769148.

Revert "scons: Use static glew library on Unices to avoid binary compatability issues"
This reverts commit de22c940a1.

Revert "glew: Update to version 1.5.2."
This reverts commit aaf7ecfd81.

Revert "scons: Build glew on all platforms."
This reverts commit 52eb3e4235.

Revert "scons: Put glut and glew shared libraries into build/xxx/bin or lib."
This reverts commit 8a318edd08.
Didn't revert scons/gallium.py

Revert "scons: Fix glew build on MSVC."
This reverts commit 14a8c9dac7.

Revert "scons: Build progs together with everything else."
This reverts commit 7bbf7f94ea.
Only changed src/glew/SConscript

Revert "mesa: include glew headers in MesaDemos tarballs"
This reverts commit c57d81ddc9.

Revert "mesa: include GLEW sources in MesaDemos tarball"
This reverts commit b9e2e32daf.

Revert "glew: correct misspelling of glFramebufferTextureLayer"
This reverts commit 1b05b5b4fe.

Revert "glew: fix GLEW_LIB_NAME"
This reverts commit c10df26a31.

Revert "Add dummy install target for glew to fix 'make install'"
This reverts commit c273dfe6a2.

Revert "autoconf: Add GLEW needed by progs when building GLUT"
This reverts commit 2977cee38e.

Revert "glew: Build it as a static lib."
This reverts commit fcf9353fea.

Revert "glew: Initial import."
This reverts commit 57d00016ca.
2010-06-08 02:07:24 +02:00
Vinson Lee
1574fb7846 r600g: Remove unnecessary header. 2010-06-07 16:54:18 -07:00
Vinson Lee
29dfb2f8f0 llvmpipe: Remove unnecessary header. 2010-06-07 16:44:22 -07:00
Vinson Lee
4af8d48a9f graw: Add gallium library to SCons build.
Fixes MSVC SCons build.
2010-06-07 16:34:03 -07:00
Marek Olšák
c1d91c4901 r300g: fix hardlock caused by an incompatible vertex format
The drivers aborts instead, I am working on a real fix...
2010-06-07 22:11:58 +02:00
Keith Whitwell
d095d95e77 graw: add gs-test.c and some simple geometry shader examples 2010-06-07 19:53:01 +01:00
Roland Scheidegger
a3dffd76d3 softpipe: use util_clear_render_target/depth_stencil fallbacks 2010-06-07 20:49:16 +02:00
Roland Scheidegger
f92879576e llvmpipe: use util_clear_render_target/depth_stencil fallbacks 2010-06-07 20:49:16 +02:00
Roland Scheidegger
a2bf4817bb util: implement util_clear_depth_stencil fallback
this doesn't really look terribly useful for drivers to use, but until
drivers use their own implementation provide this since some state trackers
really want to use these functions.
2010-06-07 20:49:16 +02:00
Keith Whitwell
9d343f4ba1 graw: add parse_geometry_shader helper 2010-06-07 19:38:30 +01:00
Keith Whitwell
eb430046de tgsi: null-terminate string in parse_identifier
Hit this parsing geometry shader properties.
2010-06-07 19:38:30 +01:00
Keith Whitwell
045174b685 draw: don't use llvm engine when geometry shaders active
They aren't implemented for llvm.
2010-06-07 19:38:30 +01:00
Keith Whitwell
c9c6b56e48 graw: trivial geometry shader test 2010-06-07 19:38:30 +01:00
Keith Whitwell
8a778d7bcf graw: add symlinks to shader test directories 2010-06-07 19:38:30 +01:00
Jakob Bornecrantz
6e3fc2de2a r300g: Move bootstrap code to targets 2010-06-06 13:02:56 +01:00
Jakob Bornecrantz
c7015877be i915g: Move bootstrap code to targets 2010-06-06 13:02:49 +01:00
Jakob Bornecrantz
9ff10b67bc svga: Move bootstrap code to targets 2010-06-06 13:02:43 +01:00
Jakob Bornecrantz
16fa300d55 swrastg: Use new drm_driver interface in EGL
The EGL state tracker is really weird in how it does software,
in the past we would just not return a drm_api struct but now,
there is no callback to get a function so we just set the
create_screen hock to NULL to make it switch to software.
2010-06-06 12:29:40 +01:00
Jakob Bornecrantz
c1a19689b8 gallium: Make all drm drivers use the new drm compat helper 2010-06-06 12:29:29 +01:00
Jakob Bornecrantz
27c49b16d3 i965g: Use Xorg template makefile 2010-06-06 12:29:28 +01:00
Jakob Bornecrantz
e72b15aa47 gallium: drm api compat helper
This is temporary untill all drivers have moved
to the new drm driver descriptor interface.
2010-06-06 12:29:28 +01:00
Jakob Bornecrantz
f9d9574913 gallium: Convert state trackers to drm driver interface 2010-06-06 12:29:28 +01:00
Jakob Bornecrantz
76aed4b070 gallium: Add drm driver interface
This interfacre replaces the drm_api api it works very much the same
way as drm_api but with the exception that its meant for the target
to implement it. And it does not export a get function and neither a
destroy function.
2010-06-06 12:29:28 +01:00
Jakob Bornecrantz
def70b17d4 nouveau: Use Xorg template makefile 2010-06-06 12:29:27 +01:00
Jakob Bornecrantz
20ef3a793f nouveau: Remove left over argument in drm api 2010-06-06 12:12:54 +01:00
Jakob Bornecrantz
77bfdb3530 r300g: Use Xorg template makefile 2010-06-06 12:07:48 +01:00
Keith Whitwell
149e709701 graw: remove references to unistd.h 2010-06-07 17:53:43 +01:00
Keith Whitwell
df2d5dd61d util: new file u_dirty_flags.h 2010-06-07 17:25:45 +01:00
Keith Whitwell
f38b2cf63f tests/graw: missing file tri.c 2010-06-07 17:22:53 +01:00
Keith Whitwell
edda7fd745 graw_xlib: build fixes 2010-06-07 16:44:40 +01:00
Keith Whitwell
00fe54a879 graw: update graw_null after interface changes and build graw tests again 2010-06-07 16:43:49 +01:00
Keith Whitwell
14ce1860d4 softpipe: remove assert on setting constbufs greater than zero 2010-06-07 16:40:05 +01:00
Keith Whitwell
a6d9d18fae llvmpipe: hook up basic gs and multiple constant buffer support 2010-06-07 16:39:02 +01:00
Keith Whitwell
0cdc0a702c cell/spu: divorce from tgsi_exec.h 2010-06-07 16:37:21 +01:00
Keith Whitwell
d6861be9cc util: add u_box_3d 2010-06-07 16:34:55 +01:00
Keith Whitwell
5a91620417 gallivm: eliminate tgsi_exec.h include 2010-06-07 16:34:55 +01:00
Keith Whitwell
cd73360e48 include/st: new file swrast_screen_create.h 2010-06-07 16:34:55 +01:00
Keith Whitwell
258f433fff util: add util_framebuffer_min_size 2010-06-07 16:34:55 +01:00
Keith Whitwell
ac7c8f7dd3 util: allocate larger tmp_row in util_format_translate
The tmp_row storage allocation took into account the format's y block
size by allocating y_step rows of data.  However, the x block size was
not being taken into account when deciding how wide those rows need to
be.

Now make sure that tmp_row is at least x_step by y_step in size.
2010-06-07 16:34:55 +01:00
Keith Whitwell
69faf5b48f tgsi: reject interpolation and semantics on vs inputs 2010-06-07 16:34:55 +01:00
Keith Whitwell
81cb6ac042 regress: remove interpolation and semantic info from vs inputs 2010-06-07 16:34:55 +01:00
Keith Whitwell
ebdb43fd98 test/graw: add vp-test 2010-06-07 16:34:55 +01:00
Keith Whitwell
78e6e081a1 tests/graw: add fp-test 2010-06-07 16:34:55 +01:00
Kristian Høgsberg
0c2bac0718 .gitignore: Ignore emacs .dir-locals.el files 2010-06-07 10:23:55 -04:00
Kristian Høgsberg
56c3cce2a1 Remove last bits of progs/ infrastructure 2010-06-07 10:08:48 -04:00
Marek Olšák
b4483823d9 r300g: fix 24-bit depth texturing
This is a secret texture format, do not tell anybody.
And it looks like we can read stencil in the shader too.
2010-06-07 04:26:16 +02:00
Jerome Glisse
c6131879eb r600g: add shader literal constant support
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-06-06 22:16:47 +02:00
Marek Olšák
aeffba454f st/mesa: advertise GL_ARB_fragment_program_shadow
There is nothing driver-specific about this one.
I've also tested it just to be sure.
2010-06-06 20:50:29 +02:00
Marek Olšák
eb2a1521cf r300g: workaround index bias on chipsets that do not support it 2010-06-06 19:44:58 +02:00
Marek Olšák
31a74a6df7 st/mesa: trivially enable GL_ATI_texture_env_combine3
This extension is implemented in the texenv program.
Gallium drivers pass patched glean/texCombine.
(I am going to send the patch soon)

Catalyst9.3 advertises this extension too so I don't see a reason we shouldn't.
2010-06-05 19:39:16 +02:00
Marek Olšák
a7fa91b658 mesa: add ARB_texture_swizzle as alias of EXT_texture_swizzle, update relnotes
The specifications are identical.
2010-06-05 17:43:38 +02:00
Kenneth Graunke
2ab0b13dd9 Disallow defining macros whose names start with "__" or "GL_".
The GLSL specification reserves these for future use.
2010-06-04 14:53:58 -07:00
Kenneth Graunke
603b8fc4b2 Check variable mode when comparing qualifier lists.
Fixes function-05.vert.
2010-06-04 12:57:20 -07:00
Jakob Bornecrantz
c0b66f471c i915g: Use template Xorg makefile 2010-06-04 19:54:11 +01:00
Jakob Bornecrantz
94d5239511 gallium: Use correct defines in Xorg template makefile 2010-06-04 19:54:11 +01:00
Jakob Bornecrantz
30456f775c gallium: Add winsys to include path to Xorg template makefile 2010-06-04 19:54:11 +01:00
Joakim Sindholt
fb08e03ae1 gallium: always build drivers/sw 2010-06-05 17:19:46 +02:00
Joakim Sindholt
4a329c67bc r300compiler: fix scons build 2010-06-05 17:19:46 +02:00
Jerome Glisse
0db388eedd r600g: split instruction into scalar
Split instruction into scalar in core compiler this simplify
the way we translate the instruction in latter stage.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-06-05 17:13:25 +02:00
Roland Scheidegger
7643f45b10 Revert "llvmpipe: handle PIPE_CAP_TEXTURE_SWIZZLE query"
This reverts commit acb20e7208.
Oops should check commits after rebase...
2010-06-05 16:55:51 +02:00
Roland Scheidegger
b6cd0712e9 i915g: fix bug in ds clear logic (still disabled) 2010-06-05 16:54:36 +02:00
Roland Scheidegger
c00065e5c2 st/mesa: fix bug in depthstencil optimizing clear logic 2010-06-05 16:54:36 +02:00
Roland Scheidegger
acb20e7208 llvmpipe: handle PIPE_CAP_TEXTURE_SWIZZLE query
asserts on unknown caps
2010-06-05 16:54:36 +02:00
José Fonseca
9881b5c2df llvmpipe: Expose PIPE_CAP_TEXTURE_SWIZZLE. 2010-06-05 14:48:39 +01:00
Chris Wilson
6d741627b0 i915: Only emit a MI_FLUSH when the drawing rectangle offset changes.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-06-05 11:37:23 +01:00
Chris Wilson
add3260157 i915: Fix off-by-one for drawing rectangle.
The drawing rectangle is given in *inclusive* pixel values, so the range
is only [0,2047]. Hence when rendering to a 2048 wide target, such as an
extended desktop, we would issue an illegal instruction zeroing the draw
area.

Fixes:

  Bug 27408: Primary and Secondary display blanks in extended
             desktop mode with Compiz enabled
  https://bugs.freedesktop.org/show_bug.cgi?id=27408

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-06-05 09:33:58 +01:00
Chris Wilson
ff74c2ced5 i915: Inhibit render cache flush when changing drawing rectangle offset.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-06-05 09:32:28 +01:00
Dave Airlie
42ebe3dfd9 mesa/st: add support for EXT_texture_swizzle.
This passes on r300g, the only bit I'm not really sure about is the handling
of the sampler_view in st_atom_texture.c, I unreference it there if the swizzle
value changes and I also have to create a new set of functions to create a new
one since the u_sampler.c ones don't handle swizzle so much.

adds r300g + softpipe enables, I think other drivers could pass easily enough.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-06-05 16:53:43 +10:00
Marek Olšák
f855e16afa r300/compiler: implement SIN+COS+SCS for vertex shaders 2010-06-05 07:03:15 +02:00
Marek Olšák
722db9fa77 r300/compiler: implement SNE unwound for r3xx VS, natively for r5xx VS 2010-06-05 07:03:15 +02:00
Marek Olšák
df36bc8dad r300/compiler: implement SEQ unwound for r3xx VS, natively for r5xx VS
Fixes piglit/glsl-vs-vec4-indexing-4.
2010-06-05 07:03:15 +02:00
Marek Olšák
e629de94b5 r300/compiler: implement SFL for vertex shaders
And sort the "case" statements alphabetically.
2010-06-05 07:03:14 +02:00
Brian Paul
89cb314f26 docs: note that the Mesa demos are in a new repo 2010-06-04 17:47:54 -06:00
Brian Paul
7ba1a879ef docs: links to the Mesa demos git repo 2010-06-04 17:47:53 -06:00
Brian Paul
3d07060ae3 mesa: remove PROGRAM_DIRS from config files 2010-06-04 17:47:53 -06:00
Brian Paul
0a401b5d2f mesa: remove old references to demo files and progs subdir 2010-06-04 17:47:53 -06:00
Brian Paul
74bea8d21f progs: remove rbug subdir 2010-06-04 17:47:53 -06:00
Brian Paul
06e911a757 demos: remove fbdev subdir 2010-06-04 17:47:53 -06:00
Brian Paul
db3b92b42f progs: remove beos subdir 2010-06-04 17:47:53 -06:00
Brian Paul
700717175c progs: remove tools subdir 2010-06-04 17:47:53 -06:00
Brian Paul
ca10ab6da8 progs: remove slang subdir 2010-06-04 17:47:53 -06:00
Brian Paul
8585c01265 vbo: misc clean-ups 2010-06-04 17:47:53 -06:00
Vinson Lee
f5b9ad9a7d i915g: Rename winsys c file.
This was missed in commit e7f0f6bb72.
Fixes i915g SCons build.
2010-06-04 16:19:08 -07:00
Brian Paul
4f067ada47 llvmpipe: new -s option to run single test
Put specific test code in the test_single() function and pass -s to
execute that code.
2010-06-04 17:01:24 -06:00
Eric Anholt
f0ff214bee i915: Don't use XRGB8888 on 830 and 845.
The support for XRGB8888 appeared in the 855 and 865, and this format
is reserved on 830/845.  This should fix a regression from
b4a6169412 that caused hangs in etracer
on 845s.

Bug #26557.
2010-06-04 13:40:48 -07:00
Eric Anholt
b80a728f8a i915: Clamp minimum lod to maximum texture level too.
Otherwise, we'd run into minlod > maxlod, and the sampler would give
us the undefined we asked for.

Bug #24846.  Fixes OGLC texlod.c.
2010-06-04 13:28:48 -07:00
Eric Anholt
18a6e5ee73 intel: Fix intel_compressed_num_bytes for FXT1 after I broke it.
Fixes piglit fxt1-teximage since
7554b83a21, and also OGLC tests that hit
FXT1 with a million other things.

Bug #28184.
2010-06-04 12:43:15 -07:00
Kristian Høgsberg
a663a63718 glsl: Recject rect samplers when GL_ARB_texture_rectangle is disabled 2010-06-04 09:06:34 -04:00
José Fonseca
be5a514d4e llvmpipe: Do unswizzling in parallel when flushing for transfers. 2010-06-04 13:05:59 +01:00
José Fonseca
e5a48fcabd progs: Remove forked/dead files. 2010-06-04 13:05:59 +01:00
Chia-I Wu
0cfb5ffe30 st/egl: Fix compiler warnings.
Forgot to stage this chunk in last commit.
2010-06-04 12:56:06 +08:00
Chia-I Wu
22c2e57cbb st/egl: Move sw screen creation to native helper.
The code is shared by ximage and gdi backend.
2010-06-04 12:12:50 +08:00
Vinson Lee
27910c42a9 scons: Add cygwin to list of accepted platforms. 2010-06-03 18:41:19 -07:00
Marek Olšák
8819421a3b r600g: implement clear_{render_target, depth_stencil}, resource_copy_region
resource_copy_region uses a software fallback because it relies on texture
samplers which haven't been implemented yet.
2010-06-04 03:04:16 +02:00
Marek Olšák
7d0418d3dc r600g: make blit functions static (private) 2010-06-04 03:04:16 +02:00
Marek Olšák
ffd0a2e215 r600g: use cast wrappers 2010-06-04 03:04:16 +02:00
Vinson Lee
42aad574f2 r600g: Move declaration before code.
Fixes SCons build.
2010-06-03 17:41:57 -07:00
Vinson Lee
1687ef2be6 util: Remove unnecessary header. 2010-06-03 17:30:55 -07:00
Vinson Lee
9cdcabbb2b nv50: Remove unnecessary header. 2010-06-03 17:29:59 -07:00
Vinson Lee
16009b6a40 svga: Remove unnecessary header. 2010-06-03 17:29:30 -07:00
Vinson Lee
a52f577270 llvmpipe: Fix uninitialized variable on non-debug builds. 2010-06-03 17:24:22 -07:00
Bas Nieuwenhuizen
d6ba70c658 r600g: added code for depthtesting
- added code to configure the depth buffer and to set up depth testing.
2010-06-03 21:38:53 +02:00
Roland Scheidegger
c674ce5e3a r600g: adapt to interface changes
r600g should be able to handle separate depth stencil clears as well.
Also adapt surface_fill/copy stubs to new interface (not that it matters).
2010-06-03 17:46:47 +02:00
Roland Scheidegger
992382762a Merge branch 'gallium-newclear'
Conflicts:
	src/gallium/state_trackers/python/p_context.i
2010-06-03 17:46:14 +02:00
Roland Scheidegger
a6e5c6c000 gallium: rename clearRT / clearDS to clear_render_target / clear_depth_stencil
more consistent with rest of gallium naming conventions.
Also rename driver-internal names for these the same.
2010-06-03 16:33:25 +02:00
Carl Worth
5ae88af988 test suite: Add expected output for every test.
Rather than using the (munged) output of "gcc -E" we now capture
precisely the output we expect from every test case. This allows us to
stay immune from strange output from gcc (unpredictable whitespace
output---aprticularly with different gcc versions).

This will also allow us to write tests that capture expected error
messages from the preprocessor as well.
2010-06-02 15:59:45 -07:00
Carl Worth
14c98a5644 Restore error message for a macro with unbalanced parentheses.
We had to remove this earlier because our recursive function calls
caused the same nodes to be examined for expansion more than once.
And in the test suite, one node would be examined before it had
its closing parenthesis and then again later after the parenthesis
was added.

So we removed this error message to allow the test case to pass.
Now that we've removed the unnecessary recursive function call
we can catch this error case and report it as desired.
2010-06-02 15:49:54 -07:00
Carl Worth
22b3aced03 Eliminate some recursion from children of _expand_token_list
Previously, both _expand_node and _expand_function would always make
mutually recursive calls into _expand_token_list. This was unnecessary
since these functions can simply return unexpanded results, after which
the outer iteration will next attempt expansion of the results.

The only trick in doing this is to arrange so that the active list is
popped at the appropriate time. To do this, we add a new token_node_t
marker to the active stack. When pushing onto the active list, we set
marker to last->next, and when the marker is seen by the token list
iteration, we pop from the active stack.
2010-06-02 15:32:03 -07:00
Carl Worth
c7c95fe51f Remove dead code: _glcpp_parser_expand_token_list_onto
This function simply isn't being called anymore.
2010-06-02 14:43:03 -07:00
Ian Romanick
384c051b8c ir_dereference_array always operates on an r-value
ir_dereference_array::array is always an r-value.  If the dereference
is of a varaible, that r-value will be an ir_dereference_variable.
This simplifies the code a bit.
2010-06-02 13:50:27 -07:00
Ian Romanick
35159b542c There is no class ir_label, so there's no need for ir_instruction::as_label 2010-06-02 13:39:45 -07:00
Ian Romanick
c8021ee01d Remove some cruft from the Makefile
This was affecting the build, but the files don't actually exist.
2010-06-02 13:13:40 -07:00
Carl Worth
111e25bd84 Factor out common sub-expression from multi-line-comment regular expression.
In two places we look for an (optional) sequence of characters other
than "*" followed by a sequence of on or more "*". Using a name for
this (NON_STARS_THEN_STARS) seems to make it a bit easier to
understand.
2010-06-02 12:54:15 -07:00
Carl Worth
e4b2731a25 Make the multi-line comment regular expression a bit easier to read.
Use quoted strings for literal portions rather than a sequence of
single-character character classes.
2010-06-02 10:59:08 -07:00
Carl Worth
4c22f4dba7 Fix multi-line comment regular expression to handle (non) nested comments.
Ken reminded me of a couple cases that I should be testing. These are
the non-nestedness of things that look like nested comments as well as
potentially tricky things like "/*/" and "/*/*/".

The (non) nested comment case was not working in the case of the
comment terminator with multiple '*' characters. We fix this by not
considering a '*' as the "non-slash" to terminate a sequence of '*'
characters within the comment. We also fix the final match of the
terminator to use '+' rather than '*' to require the presence of a
final '*' character in the comment terminator.
2010-06-02 10:57:18 -07:00
Eric Anholt
aa5794384f Add builtin gl_LightSource[].
Fixes gst-gl-bumper.vert parsing.
2010-06-01 15:36:01 -07:00
Eric Anholt
5b9ac87941 builtins: Add support for reflect().
Fixes glsl-orangebook-ch06.frag parsing.
2010-06-01 15:15:05 -07:00
Eric Anholt
da46e5f534 builtins: Add ftransform().
Fixes glsl-orangebook-ch06-bump.vert.
2010-06-01 15:15:05 -07:00
Eric Anholt
0ca171908d Allow arrays of floats as varyings.
The comment just above the code said arrays were OK, then it didn't
handle arrays.  Whoops.  Partially fixes CorrectUnsizedArray.frat.
2010-06-01 15:15:04 -07:00
Eric Anholt
cd512b0063 gl_Normal is a vec3 not a vec4.
Fixes CorrectSwizzle1.vert.
2010-06-01 15:15:04 -07:00
Eric Anholt
f03acfc7d7 builtins: Add the mix(gentype, gentype, float) variant.
The broken-in-mesa Regnum Online shader now parses, except for its
preprocessor usage.
2010-06-01 15:15:04 -07:00
Eric Anholt
336b4ad8c7 Handle GLSL 1.20 implicit type conversions.
We were nicely constructing a new expression for the implicit type
conversion, but then checking that the previous types matched instead
of the new expression's type.  Fixes errors in Regnum Online shaders.
2010-06-01 15:15:04 -07:00
Eric Anholt
60fa1a9458 builtins: Add atan(). 2010-06-01 15:15:04 -07:00
Eric Anholt
5e58e541e0 builtins: Add asin(). 2010-06-01 15:15:04 -07:00
Eric Anholt
43ad37aa88 ir_constant_expression: Handle several floating point unops.
Cleans up a bunch of pointless operations in a GStreamer fragment shader.
2010-06-01 15:15:04 -07:00
Eric Anholt
65122e9e80 ir_constant_variable: New pass to mark constant-assigned variables constant.
This removes a bunch of gratuitous moving around of constant values
from constructors.  Makes a shader ir I was looking at for structure
handling almost readable.
2010-06-01 15:15:04 -07:00
Eric Anholt
f389862006 ir_constant_folding: Look at instructions in functions.
This was broken in the ir_label -> ir_function rework.
2010-06-01 15:15:04 -07:00
Eric Anholt
49a5d5c4f5 ir_swizzle_swizzle: Reduce swizzle chains to a single swizzle. 2010-06-01 15:15:04 -07:00
Eric Anholt
b145e90369 ir_vec_index_to_swizzle: Pass to convert indexing of vectors to swizzles.
This should remove the burden of handling constant vector indexing
well from backend codegen, and could help with swizzle optimizations.
2010-06-01 15:15:04 -07:00
Eric Anholt
f8bb17260a ir_expression_flattening: Handle flattening values out of swizzles, too.
Fixes an uninlined normalize() in CorrectSwizzle2.vert.
2010-06-01 15:15:04 -07:00
Eric Anholt
459e4a286c ir_expression_flattening: Fix breakage from hierarchichal visitor.
Similar to other situations where the visitor pattern doesn't fit, in
this case we need the pointer to the base instruction in the
instruction stream for where to insert any new instructions we
generate (not the instruction in the tree we're looking at).  By
removing the code for setting the base_ir, flattened expressions would
end up, for example, before the function definition where they had appeared.
2010-06-01 15:15:04 -07:00
Carl Worth
2571415d1a Implement comment handling in the lexer (with test).
We support both single-line (//) and multi-line (/* ... */) comments
and add a test for this, (trying to stress the rules just a bit by
embedding one comment delimiter into a comment delimited with the
other style, etc.).

To keep the test suite passing we do now discard any output lines from
glcpp that consist only of spacing, (in addition to blank lines as
previously). We also discard any initial whitespace from gcc output.
In neither case should the absence or presence of this whitespace
affect correctness.
2010-06-01 12:18:43 -07:00
Carl Worth
a771a40e22 Fix #if-skipping to *really* skip the skipped group.
Previously we were avoiding printing within a skipped group, but we
were still evluating directives such as #define and #undef and still
emitting diagnostics for things such as macro calls with the wrong
number of arguments.

Add a test for this and fix it with a high-priority rule in the lexer
that consumes the skipped content.
2010-06-01 11:23:08 -07:00
Jakob Bornecrantz
05863c4877 gallium: Don't depend directly on staging dir in Xorg template makefile 2010-06-01 10:30:27 +01:00
Brian Paul
b297b14d30 tgsi: we don't support indirect input/output registers in SSE codegen yet
Extend the check for indirect addressing of temp regs to include
input/output regs.

Fixes failure with piglit glsl-texcoord-array.shader_test test when using
SSE codegen.
2010-06-03 09:01:32 -06:00
Brian Paul
d4afee9202 tgsi: whitespace cleanup 2010-06-03 08:58:31 -06:00
Brian Paul
d18fb4822b gallium: add interpolation parameter to simple shader functions
This lets us specify linear interpolation instead of perspective
interpolation for blit operations.  Might be a bit faster.
2010-06-03 08:54:15 -06:00
Jakob Bornecrantz
35d75e4930 gallium: Don't always copy the dri driver to the staging dir
So something in the build keept updating the timestamp on the
staging directory causing us to always copy the library to it.
2010-06-01 09:41:01 +01:00
Jakob Bornecrantz
d212a4d414 gallium: Create a Xorg driver template Makefile 2010-06-01 09:41:00 +01:00
Brian Paul
6cc51b982e util/u_debug: use MAX2 macro 2010-06-03 07:52:46 -06:00
José Fonseca
81862bbbc8 llvmpipe: Number shaders/variants for more reproducible function names in the IR. 2010-06-03 14:32:56 +01:00
José Fonseca
55948247eb gallivm: Register the JIT engine with oprofile on debug/profile builds. 2010-06-03 14:32:56 +01:00
José Fonseca
ef81779850 gallivm: Factor out the quad derivative code into a single place. Fix ddy.
For ddy it should be (bottom - top).
2010-06-03 14:32:56 +01:00
Joakim Sindholt
9eb730a735 r300g: use util/u_debug 2010-06-03 13:45:05 +02:00
Joakim Sindholt
8413b92a6f gallium: silence all debug_named_value related warnings 2010-06-03 13:45:05 +02:00
Joakim Sindholt
fbeab4cbce util/u_debug: add description field to debug_named_value 2010-06-03 13:45:05 +02:00
Vinson Lee
d062d21416 scons: Handle Python OSError exception when missing libdrm_radeon.
Instead of crashing when libdrm_radeon is unavailable, the SCons build
just does not build r600g.
2010-06-03 00:08:22 -07:00
Marek Olšák
128190e4a9 r300/compiler: print opcode names instead of numbers 2010-06-03 05:15:10 +02:00
Marek Olšák
e0d72814be r300g: set the minimum texture stride to 64 bytes on RS600, RS690, and RS740
I hope I've done it right. No way to test it here...
2010-06-03 03:46:34 +02:00
Vinson Lee
88008dfaa4 dri/swrast: Remove unnecessary header. 2010-06-02 17:54:10 -07:00
Brian Paul
dfe9dec04f st/mesa: fix indirect addressing of input/output regs
This fixes an issue that was missed with commit
9f544394c1.
Fixes piglit glsl-texcoord-array.shader_test
2010-06-02 17:43:39 -06:00
Brian Paul
14b7fdb8ac gallivm: bump up LP_BUILD_FLOW_MAX_VARIABLES
Fixes failed assertion with piglit fbo-drawbuffers-fragcolor.c
See fd.o bug 28358.

With 8 color buffers + Z we need to declare 33 vars, at least.
2010-06-02 16:23:20 -06:00
Kristian Høgsberg
890b3c61e3 intel: Remove a leftover DRI1/DRI2 conditional 2010-06-02 18:07:14 -04:00
Brian Paul
2c30a8d8f9 glx: fix indentation and remove extraneous break 2010-06-02 16:04:10 -06:00
Brian Paul
fc72452b97 glx: reformat and silence unused expression warning 2010-06-02 16:03:22 -06:00
Brian Paul
398e046efd glsl: handle indirectly indexed input registers in linker
For example, if the fragment shader reads gl_TexCoord[i] with a
dynamic index we need to set all the InputsRead bits for all
texcoords.  We were already doing this for shader outputs.
Refactored the later code so inputs and outputs are handled with
similar code.

Fixes a swrast failure with piglit's glsl-texcoord-array.shader_test
2010-06-02 15:34:49 -06:00
Brian Paul
e57689c6ba mesa: use BITFIELD64_BIT() macro 2010-06-02 15:34:49 -06:00
Brian Paul
7a156476e4 glsl: fix bad sanity-check assertion 2010-06-02 15:34:49 -06:00
Brian Paul
23c5b21c16 mesa: whitespace and 80 column wrapping 2010-06-02 15:34:49 -06:00
Eric Anholt
84db95bfcd shaders: Don't lose the param binding swizzle for single params.
Multiple item params are OK because we don't allow swizzles for them
(in case you do array access to hit their elements, for example).  For
singles, though, using the swizzle can cut down on storage, we do want
to allow a swizzled use of another param.

Fixes OGLC texRect.c.
2010-06-02 14:06:41 -07:00
José Fonseca
a33b5ef7d0 llvmpipe: Fix bad logic.
Courtesy of Vinson and coverity.
2010-06-02 21:32:49 +01:00
Vinson Lee
fae7bee475 llvmpipe: Remove unnecessary header. 2010-06-02 12:09:23 -07:00
José Fonseca
92cbbba7fb llvmpipe: Fix typo in assert. 2010-06-02 20:00:30 +01:00
José Fonseca
ead58101f9 llvmpipe: Per quad interpolation.
First interpolate the 4 quads upper left corners, then sub-interpolate
each quad pixel. Do the perspective divide once per quad.

Saves some muls and reciprocates. But doesn't seem to make a
noticeable improvement.

It make the code simpler and more compact, so commiting anyway.
2010-06-02 18:43:35 +01:00
José Fonseca
5871b7ebc9 llvmpipe: Minor cleanup to the interpolator. 2010-06-02 16:09:21 +01:00
José Fonseca
952d188c3c gallivm: Add a lp_build_const_elem(). 2010-06-02 16:00:40 +01:00
José Fonseca
21a6bf8624 llvmpipe: Store often used LLVM types in the lp_build_context. 2010-06-02 16:00:15 +01:00
José Fonseca
baf4393105 gallivm: Zero min_lod and max_lod when only one view is selected and min/mag filter are equal. 2010-06-02 13:24:26 +01:00
José Fonseca
804e76ac4f gallivm: Make lp_build_sample_wrap_int usage more accurate.
Fixes mesa texwrap demo border with GL_CLAMP.
2010-06-02 13:24:26 +01:00
José Fonseca
a37de72967 gallivm: Don't use reciprocate in lp_build_sample_wrap_linear().
Always clamp the scaled coordinates.
2010-06-02 13:24:26 +01:00
José Fonseca
6463dcbc01 gallivm: Avoid fp arithmetic in lp_build_sample_wrap_nearest(). 2010-06-02 13:24:25 +01:00
José Fonseca
e3d3f30440 gallivm: Don't use lp_build_sample_wrap_nearest()
Always clamp with scaled coordinates.
2010-06-02 13:24:25 +01:00
José Fonseca
147dc2354c llvmpipe: Centralize all position interpolation in lp_bld_interp.c. 2010-06-02 13:24:25 +01:00
Marek Olšák
53beea574f r300g: use the stored GEM domain in add_buffer/write_reloc
I admit blitting to/from GTT is actually enforced in this commit,
texture transfers are now damned fast!
2010-06-02 07:09:51 +02:00
Marek Olšák
b6b76cbb20 r300g: store the GEM domain in buffer and texture structs 2010-06-02 07:01:08 +02:00
Marek Olšák
bb45a15168 r300g: use r300_buffer_domain everywhere 2010-06-02 06:26:15 +02:00
Marek Olšák
19498be935 r300g: blit directly to/from GTT when transfering textures 2010-06-02 06:07:53 +02:00
Marek Olšák
37f3454eb3 r300g: let the driver determine the GEM domain for buffer_create 2010-06-02 06:01:22 +02:00
Marek Olšák
ae3063066c r300g: make texture transfers more pipelined
Mostly based on Michel Dänzer's patch.
2010-06-02 04:59:00 +02:00
Marek Olšák
d614541d52 r300g: better describe another flush and move it closer to the real problem
I haven't been able to get rid of this one, see the comments in the code.
2010-06-02 04:59:00 +02:00
Marek Olšák
9f8dbd3396 r300g: remove one flush
Looks like it's not needed now.
2010-06-02 04:59:00 +02:00
José Fonseca
489f637741 llvmpipe: Obey color interpolation.
Don't force color to be linearly interpolated when that's not being
requested.
2010-06-01 21:30:57 +01:00
José Fonseca
6ce68ad3ca llvmpipe: Use struct lp_shader_input in the interpolator.
Eliminates all this identical yet slightly different code to decide how
shader inputs should be interpolated.

As bonus, don't interpolate the position twice when it is listed in the
TGSI shader inputs.
2010-06-01 21:30:57 +01:00
Kristian Høgsberg
c7c64d9783 intel: Fallback to meta if we're asked to CopyTexImage2D from RGB to RGBA
The pixel transfer rules state that we must set alpha to 1.0 in this case
which we can't easily do with the blitter.  We can do to passes: one that
sets the alpha to 0xff and one that copies the RGB bits or we can just
use the 3D engine.  Neither approach seems worth it for this case.
2010-06-01 14:33:43 -04:00
Thomas Hellstrom
d12f2bb9c0 st/xorg, vmware: Make throttling configurable.
The xorg state tracker gets two new options to let the user choose
whether to enable / disable dirty throttling and swapbuffer throttling.
The default value of these options are enabled, unless the winsys
supplies a customizer with other values. The customizer record has been
extended to allow this, and also to set winsys-based throttling on a per-
context basis.

The vmware part of this patch disables the dirty throttling if the kernel
supports command submission throttling, and also in that case sets kernel
based throttling for everything but swapbuffers. The vmware winsys does not
set throttling per context, even if it theoretically could, but instead
sets throttling per screen. This should perhaps be changed, should the
xorg state tracker start to use multiple rendering contexts. Kernel throttling
is off by default for all new screens/contexts, so the dri state tracker
is not affected.

This significantly improves interactivity of the vmware xorg driver.

Cherry-picked from commit a8f3b3f88a

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
2010-05-31 22:34:59 +01:00
Thomas Hellstrom
cd151effe6 svga: Add a winsys callback to get the svga_winsys_context
The winsys may need to extract the svga_winsys_context from a
pipe_context. Add a function to enable that functionality.

Cherry-picked from commit e8a8c5e339

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
2010-05-31 22:34:59 +01:00
José Fonseca
056ae405b6 tgsi: Drop uses_fogcoord and uses_frontfacing from tgsi_scan.
It was not used anywhere; the code was buggy (it didn't take care of
indirect registers and could potential cause buffer underflows) and the
same effect can now be easily achieved by just by looking at
input_semantic_name[] and input_usage_mask[].
2010-06-01 16:39:04 +01:00
José Fonseca
2c67e754cf tgsi: Remove tgsi-instruction-set.txt.
Deprecated by tgsi.rst, and no point in keeping it around if it's not
being updated.
2010-06-01 16:39:04 +01:00
José Fonseca
149cb7682e llvmpipe: Don't waste time interpolating unused input channels. 2010-06-01 16:39:03 +01:00
José Fonseca
abe4f3d1aa tgsi: Determine which shader input channels are effectively.
TGSI's UsageMask flag is never set. We can move this logic into
tgsi_ureg, but there there are still cases where's not used, so this
seems a better place for now.
2010-06-01 16:39:03 +01:00
José Fonseca
d9c6ebb4fe gallium/docs: Update FRAC -> FRC. 2010-06-01 16:39:03 +01:00
Brian Paul
1bbf803e3b mesa: use split_location_offset() in GetUniform() functions
Commit 5d0e136eff exposed a long-standing
bug in the glGetUniform*() code paths.  We weren't properly decoding
the location parameter.

Fixes fd.o bug/regression 28344

Note: this patch should go into the 7.8 branch after the above-mentioned
commit.
2010-06-01 09:02:10 -06:00
Thomas Hellstrom
7356d1c140 st/xorg: Fix Xv cliprect scaling.
Due to a quantization error, different cliprects of scaled video windows may
not have identical x / y scale.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2010-05-31 18:33:09 +01:00
Thomas Hellstrom
195c476f9f st/xorg Avoid advertizing rotation / reflection support.
We don't support it yet since we don't implement the shadow allocate
functions.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2010-05-31 18:33:05 +01:00
Chia-I Wu
79e5bea3cb vgapi: Generate PIC objects.
Fixes "...; recompile with -fPIC" error on x86-64.  See fdo 28336.
2010-06-01 07:33:29 +08:00
José Fonseca
4e6c880ea2 glapi: Generate PIC objects.
Fixes fdo 28336.
2010-05-31 22:11:38 +01:00
José Fonseca
524ec6464d llvmpipe: Show fs's TGSI when LP_DEBUG=tgsi is set. 2010-05-31 21:58:38 +01:00
Chia-I Wu
a27690931b st/egl: Use stamps only to avoid unnecessary geometry update.
resource_surface_add_resources should still be called even when the
stamps match.  For example, a caller may ask for two different sets of
attachments.
2010-05-31 20:06:59 +08:00
Chia-I Wu
593cf8b54c mesa: Fix excess initializers in get.c table. 2010-05-31 17:37:42 +08:00
Dave Airlie
8d789be034 swrast: add TFP support to swrast.
This adds TFP support to the swrast driver, with this I can run gnome-shell inside Xephyr slowly. I've no idea why I did it, and g-s has other rendering issues under swrast, but it might be useful to hook up llvmpipe later. I've no idea if I even want to commit it at this point.

An enhanced version might just pass the pointer in the indirect rendering case
and avoid the memcpy.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-05-31 19:28:08 +10:00
Dave Airlie
47de9adece gallium: fix TFP on gallium
This fixes an uninitialised value use in the dri2 st when doing TFP.

It uses the driContextPriv which isn't initialised at alloc time.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-05-31 19:28:08 +10:00
Chia-I Wu
7ede18abac st/egl: Update KMS backend to use resource_surface. 2010-05-31 17:03:58 +08:00
Chia-I Wu
e4400a48a6 st/egl: Update GDI backend to use resource_surface. 2010-05-31 17:03:58 +08:00
Chia-I Wu
f38a20b461 st/egl: Update ximage backend to use resource_surface. 2010-05-31 17:03:58 +08:00
Chia-I Wu
e1e0307c91 st/egl: Add helper functions for use by backends.
There is only resource_surface for now.  It helps manage the resources
of a software-based native surface such as XImage or GDI.
2010-05-31 17:03:58 +08:00
Chris Wilson
8accf0a891 intel: Initialize batch->reserved_space on allocation
Fixes the assert (and buffer overrun):

  glknots: intel_batchbuffer.c:164: _intel_batchbuffer_flush: Assertion
  'used >= batch->buf->size' failed.

Reported in bug:

  Bug 28274 - xscreensaver's glknots hangs GPU (945GME/Pineview)
  https://bugs.freedesktop.org/show_bug.cgi?id=28274

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-05-31 09:58:25 +01:00
Chia-I Wu
636f7becfd targets/egl: Add SConscript for egl-apis.
It will build api_OpenVG.dll on Windows.
2010-05-31 13:28:03 +08:00
Chia-I Wu
e5b5d84e8a st/vega: Use SConscript for Windows build.
Fix several portability issues and add SConscript for Windows build.
2010-05-31 13:28:01 +08:00
Chia-I Wu
a2f3115307 gallium/util: Define isfinite and isnan for MSVC.
Define isfinite and isnan to _finite and _isnan respectively for MSVC.
Those macros are needed by st/vega.
2010-05-31 13:27:58 +08:00
Chia-I Wu
60558b1594 mapi/vgapi: Add SConscript for Windows build. 2010-05-31 13:27:53 +08:00
Chia-I Wu
f6f9d1014b st/egl: Use OS-specific module suffices.
At least, .dll is used on Windows.
2010-05-31 13:27:48 +08:00
Chia-I Wu
ec0bab3a51 targets/egl: Add SConscript for egl_gdi_swrast.
egl_gdi_swrast uses st/egl/gdi and winsys/sw/gdi to provide an EGL
driver for Windows.
2010-05-31 13:27:46 +08:00
Chia-I Wu
a8e195ec24 st/egl: Add GDI backend.
The backend uses Windows GDI driver to provide a software EGL
implementation on Windows.
2010-05-31 13:27:44 +08:00
Chia-I Wu
1e6c10f4be egl: Use SConscript for Windows build.
Fix several portability issues and add SConscript for Windows build.
2010-05-31 13:27:41 +08:00
Chia-I Wu
0d820fc203 egl: Use khronos types for EGL_MESA_screen_surface.
That is, use khronos_uint32_t instead of uint32_t.
2010-05-31 11:31:08 +08:00
Chia-I Wu
ba26631d0d Define PUBLIC to dllexport on MSVC.
Define PUBLIC to __declspec(dllexport) when _MVC_VER is defined.
2010-05-31 11:31:07 +08:00
Chia-I Wu
14f1157a2e Update KHRONOS_APICALL for _WIN32 platform.
Use __declspec(dllexport) when KHRONOS_DLL_EXPORTS is defined.
2010-05-31 11:31:07 +08:00
Chia-I Wu
d2cb999045 Always define int32_t in compiler headers.
eglplatform.h no longer defines int32_t.
2010-05-31 11:00:01 +08:00
Chia-I Wu
fa97399f42 glapi: Update SConscript for Windows.
Define macros to enable dllexport and thread support.  Adjust the output
path of mapi sources.
2010-05-31 10:53:29 +08:00
Chia-I Wu
59f8dca7cf Update OpenGL ES headers. 2010-05-31 10:43:17 +08:00
Chia-I Wu
8e1b375a8d autoconf: Remove unused APIS.
It was used by glapi, which has been moved to mapi.
2010-05-31 10:43:00 +08:00
Chia-I Wu
c08449b78e mesa: Fix/add feature test to shader.c.
Those macros used by _mesa_init_shader_dispatch are not available when
FEATURE_GL is not defined.
2010-05-31 10:40:56 +08:00
Marek Olšák
21dfcde3ff r300g: set correct pitch in libdrm
to match what DDX sets. This prevents some flushes from occuring.
2010-05-31 04:16:24 +02:00
Marek Olšák
7a4601db52 r300g: remove texture usage transfer flag 2010-05-31 04:16:24 +02:00
Marek Olšák
4182d3ea00 r600g: remove unused struct r600_state
What was the purpose of it?
2010-05-31 04:16:24 +02:00
Vinson Lee
33c2dbe5b0 vbo: Remove unnecessary header. 2010-05-30 15:47:21 -07:00
Vinson Lee
1202f17063 r600g: Remove unnecessary headers. 2010-05-30 15:30:05 -07:00
Alex Deucher
3b869b4cdb r600g: RS880 is r6xx-based
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2010-05-30 16:08:55 -04:00
José Fonseca
7f1c007840 llvmpipe: Remove unused framebuffer stuff from the rasterizer. 2010-05-30 16:39:14 +01:00
José Fonseca
2b7fbccfdc llvmpipe: Don't force a linear to tiled conversion after rasterization on debug builds.
Only do this if runtime debugging flags to show subtiles/tiles are set.
2010-05-30 16:39:06 +01:00
José Fonseca
82715bb227 llvmpipe: Call llvmpipe_set_texture_tile_layout only when necessary.
Like the other places.
2010-05-30 16:38:46 +01:00
José Fonseca
b57e18c35c util: Add inline function for approximate floating point comparison. 2010-05-30 16:38:41 +01:00
José Fonseca
f503b3dd9d llvmpipe: Use pointer_to_func() instead of custom wrappers. 2010-05-30 16:38:23 +01:00
José Fonseca
4b29da1226 draw: Use pointer_to_func() instead of custom wrappers. 2010-05-30 16:38:03 +01:00
José Fonseca
6f67a71aad util: Generic pointer to func conversion helper.
That observes strict-aliasing rules.
2010-05-30 16:36:08 +01:00
José Fonseca
18fb9ff6d8 llvmpipe: Pass the fs variant to the rasterizer. 2010-05-30 10:30:01 +01:00
José Fonseca
dc10943038 python/retrace: Interpret resource_copy_region. 2010-05-30 10:30:01 +01:00
José Fonseca
311227abbb st/python: Expose region_copy/fill_region instead of deprecated surface_copy/fill 2010-05-30 10:30:01 +01:00
Chia-I Wu
0f37f242dd st/vega: Use FREE.
Match MALLOC with FREE.  Otherwise, it causes weird segfaults when built
with memory debugging.
2010-05-30 11:11:27 +08:00
Chia-I Wu
a5183a38c2 st/egl: Hook eglCreatePbufferFromClientBuffer.
This is some refactoring works.  Creating a pbuffer from an
EGL_OPENVG_IMAGE is still not supported.
2010-05-30 11:09:30 +08:00
Chia-I Wu
9d7219c560 st/egl: Fix eglCopyBuffers.
It was broken since surface_copy -> resource_copy_region transition.
2010-05-30 11:05:15 +08:00
Chia-I Wu
20c3d7190e st/egl: Initialize KMS backend from an fd.
Check if the native native is EGL_DEFAULT_DISPLAY.  If not, treat it as
an fd.
2010-05-30 10:52:50 +08:00
Marek Olšák
b202c78586 r300: fix blits for textures of width/height greater than 2048 on r5xx
Yes I am fixing r300c ... who knew?
2010-05-29 17:44:20 +02:00
Marek Olšák
b5c147caba r600g: remove unused variable 2010-05-29 15:41:22 +02:00
Marek Olšák
7d9396d7cf r600g: fix gallium function parameters 2010-05-29 15:41:22 +02:00
Marek Olšák
1d57b6ebd1 r600g: make a local copy of viewport state 2010-05-29 15:41:22 +02:00
Carl Worth
96d3994881 Merge branch 'take-2'
The take-2 branch started over with a new grammar based directly on
the grammar from the C99 specification. It doesn't try to capture
things like balanced sets of parentheses for macro arguments in the
grammar. Instead, it merely captures things as token lists and then
performs operations like parsing arguments and expanding macros on
those lists.

We merge it here since it's currently behaving better, (passing the
entire test suite). But the code base has proven quite fragile
really. Several of the recently added test cases required additional
special cases in the take-2 branch while working trivially on master.

So this merge point may be useful in the future, since we might have a
cleaner code base by coming back to the state before this merge and
fixing it, rather than accepting all the fragile
imperative/list-munging code from the take-2 branch.
2010-05-29 06:03:40 -07:00
Carl Worth
ae3fb09cd2 Add three more tests cases recently added to the take-2 branch.
The 071-punctuator test is failing only trivially (whitespace change only).

And the 072-token-pasting-same-line.c test passes just fine here, (more
evidence perhaps that the approach in take-2 is more trouble than it's
worth?).

The 099-c99-example test case is the inspiration for much of the rest
of the test suite. It amazingly passes on the take-2 branch, but
doesn't pass here yet.
2010-05-29 06:01:32 -07:00
Carl Worth
75ef1c75dd Add killer test case from the C99 specification.
Happily, this passes now, (since many of the previously added test
cases were extracted from this one).
2010-05-29 05:57:22 -07:00
Carl Worth
b06096e86e Add test and fix bugs with multiple token-pasting on the same line.
The list replacement when token pasting was broken, (failing to
properly update the list's tail pointer). Also, memory management when
pasting was broken, (modifying the original token's string which would
cause problems with multiple calls to a macro which pasted a literal
string). We didn't catch this with previous tests because they only
pasted argument values.
2010-05-29 05:54:19 -07:00
Carl Worth
631016946c Fix pass-through of '=' and add a test for it.
Previously '=' was not included in our PUNCTUATION regeular expression,
but it *was* excldued from our OTHER regular expression, so we were
getting the default (and hamful) lex action of just printing it.

The test we add here is named "punctuator" with the idea that we can
extend it as needed for other punctuator testing.
2010-05-29 05:07:24 -07:00
Jakob Bornecrantz
e7f0f6bb72 i915g: Rename winsys c file 2010-05-29 13:31:30 +02:00
Jakob Bornecrantz
835f5a65a1 i915g: Move pci id to winsys struct 2010-05-29 13:30:25 +02:00
Jakob Bornecrantz
bbaaf823fa targets/egl: Give egl targets a good build enviroment 2010-05-29 13:19:13 +02:00
Kristian Høgsberg
0defc25977 egl_dri2: Split driver loading out into its own function 2010-05-28 21:31:22 -04:00
Kristian Høgsberg
c5ddaa2cd7 egl_dri2: Check for xcb_connect() failure the right way
It always returns a valid xcb_connection_t, but if connection failed, it's in the
error state.
2010-05-28 21:31:22 -04:00
Marek Olšák
ba10b2732b r600g: fix build 2010-05-29 02:31:44 +02:00
Roland Scheidegger
1e17178fc4 llvmpipe: adapt to clear interface changes
with some newfangled code, should support separate depth/stencil clears.
Needs some testing.
2010-05-29 01:31:01 +02:00
Roland Scheidegger
837d32062e i965g: adapt to clear interface changes
just like i915g, should in theory support separate depth/stencil clears
(untested), with the same 2d blitter hacks.
2010-05-29 01:29:31 +02:00
Roland Scheidegger
4bc7b14224 i915g: adapt to clear interface changes
should in theory support separate depth/stencil clears (untested).
Also fix some format omissions?
2010-05-29 01:28:21 +02:00
Roland Scheidegger
10baf7ec1d r300g: adapt to clear interface changes
should support separate depth/stencil clears just fine with changed u_blitter.
2010-05-29 01:26:22 +02:00
Roland Scheidegger
e5b82c8222 nv50: adapt to clear interface changes
should support separate depth/stencil clears just fine.
2010-05-29 01:25:09 +02:00
Roland Scheidegger
c5cccf8a49 nvfx: adapt to clear interface changes 2010-05-29 01:24:25 +02:00
Roland Scheidegger
d1998962ef svga: adapt to clear interface changes
this should support separate stencil/depth clears just fine.
2010-05-29 01:22:23 +02:00
Roland Scheidegger
72c77d472b softpipe: adapt to clear interface changes 2010-05-29 01:21:15 +02:00
Roland Scheidegger
9d596ea492 rbug: adapt to clear interface changes 2010-05-29 01:20:11 +02:00
Roland Scheidegger
e4de4b0755 trace: adapt to clear interface changes 2010-05-29 01:19:59 +02:00
Roland Scheidegger
25296a3ed3 identity: adapt to clear interface changes 2010-05-29 01:19:48 +02:00
Roland Scheidegger
9eae3fd992 fo: adapt to clear interface changes 2010-05-29 01:19:24 +02:00
Roland Scheidegger
821498bd6f cell: adapt to clear interface changes 2010-05-29 01:18:47 +02:00
Roland Scheidegger
c350068720 st/python: adapt to clear interface changes 2010-05-29 01:18:17 +02:00
Carl Worth
614a9aece0 Add two more (failing) tests from the take-2 branch.
These tests were recently fixed on the take-2 branch, but will require
additional work before they will pass here.
2010-05-28 15:15:59 -07:00
Carl Worth
b1249f69fd Add two (passing) tests from the take-2 branch.
These two tests were tricky to make work on take-2, but happen to
already eb working here.
2010-05-28 15:15:00 -07:00
Carl Worth
792bdcbeee Tweak test 25 slightly, (so the non-macro doesn't end the file).
This isn't a problem here, but on the take-2 branch, it was trickier
at one point to make a non-macro work when the last token of the file.

So we use the simpler test case here and defer the other case until
later.
2010-05-28 15:13:11 -07:00
Carl Worth
c7144dc2e0 Remove some blank lines from the end of some test cases.
To match what we have done on the take-2 branch to these test cases.
2010-05-28 15:12:36 -07:00
Carl Worth
681afbc855 Perform macro by replacing tokens in original list.
We take the results of macro expansion and splice them into the
original token list over which we are iterating. This makes it easy
for function-like macro invocations to find their arguments since they
are simply subsequent tokens on the list.

This fixes the recently-introduced regressions (tests 55 and 56) and
also passes new tests 60 and 61 introduced to strees this feature,
(with macro-argument parentheses split between a macro value and the
textual input).
2010-05-28 15:10:27 -07:00
Roland Scheidegger
783083c3b8 st/mesa: use new ability to clear only depth or stencil 2010-05-29 00:04:14 +02:00
Roland Scheidegger
a1d5131d2e util: adapt to clear interface changes 2010-05-29 00:02:05 +02:00
Roland Scheidegger
0cd70b554c gallium: clear interface changes
clears were a bit limited in gallium:
- no scissoring (OGL only) nor explicit rectangle list (d3d9)
- no color/stencil masks (OGL only)
- no separate depth/stencil clears (d3d9/d3d10/OGL)
- cannot really clear single color buffer (only with resource_fill_region)

Additionally, d3d can clear surfaces not currently bound to the framebuffer.

It is, however, not easy to find some common ground what a clear should be able
to do, due to both API requirements and also hw differences (a case which might
be able to use a special clear path on one hw might need a "normal" quad render
on another).

Hence several clear methods are provided, and a driver should implement all of
them.
- clear: slightly modified to also be able to clear only depth or stencil in a
  combined depth/stencil surface. This is however optional based on driver
  capability though ideally it wouldn't be optional. AFAIK this is in fact
  something used by applications quite a bit.
  Otherwise, for now still doesn't allow clearing with scissors/mask (or single
  color buffers)
- clearRT: clears a single (potentially unbound) color surface. This was formerly
  roughly known as resource_fill_region. mesa st will not currently use this,
  though potentially would be useful for GL ClearBuffer.
- clearDS: similar to above except for depth stencil surfaces.

Note that clearDS/clearRT currently handle can handle partial clear. This might
change however.
2010-05-28 23:57:47 +02:00
Eric Anholt
828f648ac3 i965: Add cache unit -> bo name mapping for more gen6 state objects.
This will help in bufmgr debugging and aub dumping.
2010-05-28 12:51:48 -07:00
Zou Nan hai
9390af0d96 i965: fix PIPE_CONTROL command for gen6.
Signed-off-by: Zou Nan hai <nanhai.zou@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2010-05-28 12:51:48 -07:00
Brian Paul
e6d8b4090f llvmpipe: add PIPE_BUFFER to assertion
Fixes regression from commit f2e05acac9.
2010-05-28 13:31:23 -06:00
Brian Paul
f57edc58b5 softpipe: add PIPE_BUFFER to assertion
Fixes regression from commit f2e05acac9.
2010-05-28 13:30:24 -06:00
Brian Paul
151b3bb3af llvmpipe: add out of memory checking to triangle setup path 2010-05-28 12:52:41 -06:00
Brian Paul
5d0e136eff glsl: change uniform location/offset encoding
This lets Mesa work like other OpenGL implementations with regard
to indexing uniform arrays.  See comments for details.

Note: this is a candidate for the 7.8 branch.
2010-05-28 12:52:34 -06:00
Carl Worth
3c93d39705 Simplify calling conventions of functions under expand_token_list_onto.
We previously had a confusing thing where _expand_token_onto would
return a non-zero value to indicate that the caller should then call
_expand_function_onto. It's much cleaner for _expand_token_onto to
just do what's needed and call the necessary function.
2010-05-28 08:17:46 -07:00
Carl Worth
9b519f9c79 Stop interrupting the test suite at the first failure.
This behavior was useful when starting the implementation over
("take-2") where the whole test suite was failing. This made it easy
to focus on one test at a time and get each working.

More recently, we got the whole suite working, so we don't need this
feature anymore. And in the previous commit, we regressed a couple of
tests, so it's nice to be able to see all the failures with a single
run of the suite.
2010-05-28 08:04:13 -07:00
Carl Worth
95ec433d59 Revert "Add support for an object-to-function chain with the parens in the content."
This reverts commit 7db2402a80

It doesn't revert the new test case from that commit, just the
extremely ugly second-pass implementation.
2010-05-28 08:02:07 -07:00
Marek Olšák
f4bcd0cab0 r300g: remove unnecessary breaks 2010-05-28 03:30:11 +02:00
Marek Olšák
ebe2b54663 r300g: report vertex format support in is_format_supported 2010-05-28 03:30:11 +02:00
Marek Olšák
f2e05acac9 st/mesa: advertise ARB_half_float_vertex when available
Both softpipe and llvmpipe pass the piglit half float test.
2010-05-28 03:30:11 +02:00
Marek Olšák
3262554bb3 r300g/swtcl: fix WPOS
There you are! r300->viewport_state is undefined when using SW TCL.

Piglit score (r300g.tests):
HW TCL: 231/275
SW TCL: 233/275
2010-05-28 03:30:11 +02:00
Marek Olšák
49244df5a8 r300g/swtcl: avoid an infinite loop if an occl. query doesn't return anything 2010-05-28 03:30:11 +02:00
Carl Worth
baa17c8748 Remove blank lines from output files before comparing.
Recently I'm seeing cases where "gcc -E" mysteriously omits blank
lines, (even though it prints the blank lines in other very similar
cases). Rather than trying to decipher and imitate this, just get rid
of the blank lines.

This approach with sed to kill the lines before the diff is better
than "diff -B" since when there is an actual difference, the presence
of blank lines won't make the diff harder to read.
2010-05-27 14:53:51 -07:00
Carl Worth
886e05a35a Add test for token-pasting of integers.
This test was tricky to make pass in the take-2 branch. It ends up
passing already here with no additional effort, (since we are lexing
integers as string-valued token except when in the ST_IF state in the
lexer anyway).
2010-05-27 14:45:20 -07:00
Carl Worth
050e3ded1e Implement token pasting of integers.
To do this correctly, we change the lexer to lex integers as string values,
(new token type of INTEGER_STRING), and only convert to integer values when
evaluating an expression value.

Add a new test case for this, (which does pass now).
2010-05-27 14:38:20 -07:00
Jerome Glisse
6a143b8424 r600g: disable rendering
Disable rendering to avoid GPU lockup.
Use radeondb to debug shader compiler :
radeondb -c gallium.bof
radeondb -s gallium.json
Will print shader generated, best is to use fp demos to test
the compiler.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-05-27 23:24:26 +02:00
Bas Nieuwenhuizen
9e8a6f801d r600g: various fixes
- enabled flushing a buffer more than once
- enabled the blitter for r600_clear
- added some more colors to r600_is_format_supported (copied from r600_conv_pipe_format)
- r600_set_framebuffer_state now sets rctx->fb_state
- more states are saved before a blit (had to add some accounting for the viewport and the vertex elements state)
- fixed a few errors with reference counting
2010-05-27 23:24:22 +02:00
Jerome Glisse
e68b4e5053 r600g: fix driver + shader compiler backend change
Change the way we translate from c_compiler to the
asic specific representation. Should make things
simpler.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-05-27 23:24:17 +02:00
Jakob Bornecrantz
aeee52691c r600g: Integrate into build
Signed-off-by: Jakob Bornecrantz <wallbraker@gmail.com>
2010-05-27 23:24:12 +02:00
Jakob Bornecrantz
9abfc5ef60 r600g: Fix buffer offsets
Signed-off-by: Jakob Bornecrantz <wallbraker@gmail.com>
2010-05-27 23:24:07 +02:00
Marek Olšák
b8fb1d75ce r600g: adapt to latest interfaces changes
- Wrapped the buffer and texture create/destroy/transfer/... functions
  using u_resource, which is then used to implement the resource functions.
- Implemented texture transfers.
  I left the buffer and texture transfers separate because one day we'll
  need a special codepath for textures.
- Added index_bias to the draw_*elements functions.
- Removed nonexistent *REP and *FOR instructions.
- Some pipe formats have changed channel ordering, so I've removed/fixed
  nonexistent ones.
- Added stubs for create/set/destroy sampler views.
- Added a naive implementation of vertex elements state (new CSO).
- Reworked {texture,buffer}_{from,to}_handle.
- Reorganized winsys files, removed dri,egl,python directories.
- Added a new build target dri-r600.
2010-05-27 23:24:02 +02:00
Jerome Glisse
72128962d6 r600g: Initial import 2010-05-27 23:23:56 +02:00
Carl Worth
85b50e840d Add placeholder tokens to support pasting with empty arguments.
Along with a passing test to verify that this works.
2010-05-27 14:01:18 -07:00
Brian Paul
3d41dd7934 llvmpipe: s/bool/boolean/ 2010-05-27 14:55:58 -06:00
Brian Paul
bd024ce2b1 llvmpipe: s/bool/boolean 2010-05-27 14:54:21 -06:00
Carl Worth
fb48fcdf9b Add test for macro invocations with empty arguments.
This case was recently solved on the take-2 branch.
2010-05-27 13:44:13 -07:00
Carl Worth
a19297b26e Provide support for empty arguments in macro invocations.
For this we always add a new argument to the argument list as soon as
possible, without waiting until we see some argument token. This does
mean we need to take some extra care when comparing the number of
arguments with the number of expected arguments. In addition to
matching numbers, we also support one (empty) argument when zero
arguments are expected.

Add a test case here for this, which does pass.
2010-05-27 13:29:19 -07:00
Brian Paul
0faefb194e sw/xlib: avoid dereferencing a null pointer 2010-05-27 13:40:16 -06:00
Brian Paul
c3b62bc86c gallivm: add assertions to check type of phi variables 2010-05-27 13:40:16 -06:00
Brian Paul
a504f2387e mesa: fix incorrect GL_DEPTH_STENCIL_ATTACHMENT format check
We want to check the incoming renderbuffer format, not the (potentially
non-existant) current attachment.

Fixes segfault w/ fbotexture -ds2.

NOTE: this will be applied to the 7.8 branch too.
2010-05-27 13:11:08 -06:00
Marek Olšák
90e5a37d12 r300g/swtcl: fix secondary color and back-face color outputs
These piglit tests have been fixed:
- bgra-sec-color-pointer
- glsl-routing

See comments at the beginning of r300_vs_draw.c

WPOS is implemented too but it doesn't work yet. I'm still working on it.
2010-05-27 20:56:32 +02:00
Carl Worth
a65cf7b1d2 Make two list-processing functions do nothing with an empty list.
This just makes these functions easier to understand all around.  In
the case of _token_list_append_list this is an actual bug fix, (where
append an empty list onto a non-empty list would previously scramble
the tail pointer of the original list).
2010-05-27 11:55:36 -07:00
José Fonseca
8bd3a4c1aa llvmpipe: Refer to my personal udis86 repository.
As it has a bunch of fixes/additions not merged by upstream yet.
2010-05-27 19:40:10 +01:00
José Fonseca
571ee049f2 util: Also add a define for the dynamic library's prefix. 2010-05-27 19:37:56 +01:00
Brian Paul
057f7e8140 egl/mks: remove extra param from function call 2010-05-27 12:04:43 -06:00
Brian Paul
462bccef4f egl_g3d: add missing param to egl_g3d_st_manager_get_egl_image() 2010-05-27 12:04:08 -06:00
Carl Worth
602a34769a Add test 56 for a comma within the expansion of an argument.
This case was tricky on the take-2 branch. It happens to be passing already
here.
2010-05-27 10:14:38 -07:00
Carl Worth
dd7490093d Avoid treating an expanded comma as an argument separator.
That is, a function-like invocation foo(x) is valid as a
single-argument invocation even if 'x' is a macro that expands into a
value with a comma. Add a new COMMA_FINAL token type to handle this,
and add a test for this case, (which passes).
2010-05-27 10:12:33 -07:00
Brian Paul
df64122c30 fbdev: some hacking to get the driver to compile (untested) 2010-05-27 09:46:32 -06:00
Brian Paul
a4bd52adba update linux-fbdev config 2010-05-27 09:46:21 -06:00
Brian Paul
3644dbbdbd vbo: comments and whitespace 2010-05-27 09:40:33 -06:00
Brian Paul
4225c4e1b0 vbo: remove unused prototype 2010-05-27 09:40:33 -06:00
Brian Paul
9aae67ca3a vbo: remove dead code 2010-05-27 09:40:33 -06:00
Brian Paul
b6187057be vbo: update/add comments 2010-05-27 09:40:33 -06:00
Vinson Lee
f49a65628f mesa: Remove unnecessary headers. 2010-05-27 08:10:31 -07:00
Kristian Høgsberg
6e9da8ab60 egl: Return NULL if we fail to load a default driver 2010-05-27 09:59:27 -04:00
Brian Paul
7d7bdee50d mesa: remove unused includes 2010-05-26 22:42:13 -06:00
Brian Paul
eb88c02a4b mesa: rewrite _mesa_get_handle() and add some comments 2010-05-26 22:40:38 -06:00
Brian Paul
69861ae497 mesa: move GLSL uniform functions into new source file 2010-05-26 22:30:10 -06:00
Vinson Lee
655c9a0533 st/mesa: Remove unnecessary headers. 2010-05-26 20:12:33 -07:00
Ian Romanick
e668c2a9ee Reimplement ir_function_inlining_visitor using ir_hierarchical_vistor 2010-05-26 18:58:27 -07:00
Ian Romanick
2fd22486d4 Reimplement ir_copy_propagation_visitor using ir_hierarchical_vistor 2010-05-26 17:04:19 -07:00
Carl Worth
7db2402a80 Add support (and test) for an object-to-function chain with the parens in the content.
That is, the following case:

	#define foo(x) (x)
	#define bar
	bar(baz)

which now works with this (ugly) commit.

I definitely want to come up with something cleaner than this.
2010-05-26 17:01:57 -07:00
Carl Worth
a8ea26d7c9 Add two tests developed on the take-2 branch.
The define-chain-obj-to-func-parens-in-text test passes here while the
if-with-macros test fails.
2010-05-26 16:18:05 -07:00
Ian Romanick
4b389492b9 Reimplement ir_expression_flattening_visitor using ir_hierarchical_vistor 2010-05-26 16:07:49 -07:00
Carl Worth
95951ea7bb Treat newlines as space when invoking a function-like macro invocation.
This adds three new pieces of state to the parser, (is_control_line,
newline_as_space, and paren_count), and a large amount of messy
code. I'd definitely like to see a cleaner solution for this.

With this fix, the "define-func-extra-newlines" now passes so we put
it back to test #26 where it was originally (lately it has been known
as test #55).

Also, we tweak test 25 slightly. Previously this test was ending a
file function-like macro name that was not actually a macro (not
followed by a left parenthesis). As is, this fix was making that test
fail because the text_line production expects to see a terminating
NEWLINE, but that NEWLINE is now getting turned into a SPACE here.

This seems unlikely to be a problem in the wild, (function macros
being used in a non-macro sense seems rare enough---but more than
likely they won't happen at the end of a file). Still, we document
this shortcoming in the README.
2010-05-26 16:04:31 -07:00
Carl Worth
0324cad796 All macro lookups should be of type macro_t, not string_list_t.
This is what I get for using a non-type-safe hash-table implementation.
2010-05-26 15:53:05 -07:00
Kenneth Graunke
13e1b6b725 ir_reader: Read record_refs.
Also changes the print visitor to not emit extraneous parenthesis.
2010-05-26 15:24:53 -07:00
Kenneth Graunke
350bd70348 ir_reader: Fix reading of array deferences and correct error messages.
Previously, the syntax was (array_ref <variable name> <index>), but the
subject is now a general rvalue (not a name).  In particular, it might
be a (var_ref ...).

Also, remove "expected ... or (swiz)" from error messages; swiz is not
allowed inside a var_ref.
2010-05-26 15:24:40 -07:00
Ian Romanick
a9159f9e87 Fix setting the maximum accessed array element
Array dereferences now point to variable dereferences instead of
pointing directly to variables.  This necessitated some changes to the
way the variable is accessed when setting the maximum index array element.
2010-05-26 15:23:25 -07:00
Ian Romanick
fd55da2147 ir_dereference::mode is no longer used, kill with fire 2010-05-26 15:23:25 -07:00
Ian Romanick
b067db2e25 Refactor whole-variable assigment checking into member function 2010-05-26 15:23:25 -07:00
Ian Romanick
36ea28646c Refactor ir_dereference data fields to subclasses 2010-05-26 15:23:25 -07:00
Ian Romanick
7fe3de6fde Replace open coded deref navigation with hierarchical visitors 2010-05-26 15:23:25 -07:00
Ian Romanick
c7b1046a9f Refactor ir_dereference support for ir_visitor
Move the accept method for visitors from ir_dereference to the derived
classes.
2010-05-26 15:23:25 -07:00
Ian Romanick
f3a002b503 Refactor ir_dereference support for ir_hierarchical_visitor
Move the accept method for hierarchical visitors from ir_dereference
to the derived classes.  This was mostly straight-forward, but I
suspect that ir_dead_code_local may be broken now.
2010-05-26 15:23:25 -07:00
Ian Romanick
70fe8b6663 Begin refactoring ir_dereference
Create separate subclasses of ir_dereference for variable, array, and
record dereferences.  As a side effect, array and record dereferences
no longer point to ir_variable objects directly.  Instead they each
point to an ir_dereference_variable object.

This is the first of several steps in the refactoring process.  The
intention is that ir_dereference will eventually become an abstract
base class.
2010-05-26 15:23:19 -07:00
Will Dyson
055750fafb Enable hardware mipmap generation for radeon.
Use _mesa_meta_GenerateMipmap. It is Fast Enough(tm).

Signed-off-by: Maciej Cencora <m.cencora@gmail.com>
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2010-05-26 18:17:28 -04:00
Will Dyson
a9ee956511 Fix image_matches_texture_obj() MaxLevel check
When generating or uploading a new (higher) mipmap level for an image,
we can need to allocate a miptree for a level greater than
texObj->MaxLevel.

Signed-off-by: Maciej Cencora <m.cencora@gmail.com>
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2010-05-26 18:17:28 -04:00
Will Dyson
f49da110a8 Fallback to software render if there is no miptree for an image
This can happen when checking if a software fallback for a higher level
operation (such as GenerateMipmap) is needed.

Signed-off-by: Maciej Cencora <m.cencora@gmail.com>
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2010-05-26 18:17:28 -04:00
Marek Olšák
76034aaf65 r300g: decouple drawing code and two-sided stencil refvalue fallback
It's now more separate from the rest of the driver and it can be disabled
by commenting out just 1 line. Well, I couldn't make the previous version
work with SW TCL reliably, that's the reason of this little rework.
2010-05-27 00:08:42 +02:00
Marek Olšák
1345c5bf94 r300g/swtcl: handle large index count properly
This fixes piglit/draw-elements.
2010-05-26 22:39:19 +02:00
Marek Olšák
3a6fd21917 r300g/swtcl: force vertex prefetching for non-indexed primitives 2010-05-26 22:22:52 +02:00
Marek Olšák
55a6d37434 r300g/swtcl: move emitting AOS to prepare_for_rendering 2010-05-26 22:22:52 +02:00
Marek Olšák
500160a3c9 r300g/swtcl: vbo transfer sanity checks 2010-05-26 22:22:52 +02:00
Marek Olšák
a81730cb32 r300g: add get_cs_info winsys entrypoint, abandon check_cs 2010-05-26 22:22:52 +02:00
Marek Olšák
6ca3f86bdc r300g/swtcl: do not use u_upload_mgr and do not compute max_index 2010-05-26 22:22:52 +02:00
Marek Olšák
bbfd785259 r300g: remove unnecessary includes 2010-05-26 22:22:52 +02:00
Eric Anholt
3b68b6c83e i965: Add support for EXT_timer_query on Ironlake.
We could potentially do this on G45 as well, though the units are
different.  On 965, the timestamp is tied to hclk, which would make
supporting it harder.
2010-05-26 12:14:44 -07:00
Eric Anholt
fd3425fdff intel: Handle decode of PIPE_CONTROL instructions. 2010-05-26 12:13:54 -07:00
Eric Anholt
ddb10c3e60 i965: Move Gen6 debugging emit_mi_flush into the Gen6 block. 2010-05-26 12:13:54 -07:00
Eric Anholt
8f61114907 i965: Don't PIPE_CONTROL instruction cache flush.
This is a workaround for Ironlake errata.  The emit_mi_flush is used
for a few purposes:
1) Flushing write caches for RTT (including blit to texture)
2) Pipe fencing for sync objects
3) Spamming cache flushes to track down cache flush bugs

Spamming cache flushes seems less important than following the docs,
and we should probably do that with a different mechanism than the one
for render cache flushes.
2010-05-26 12:13:54 -07:00
Eric Anholt
6e2330daa6 i965: Emit MI_FLUSH before PSP on Ironlake for clip max threads errata. 2010-05-26 12:13:54 -07:00
Carl Worth
8e82fcb070 Implement (and test) support for macro expansion within conditional expressions.
To do this we have split the existing "HASH_IF expression" into two
productions:

First is HASH_IF pp_tokens which simply constructs a list of tokens.

Then, with that resulting token list, we first evaluate all DEFINED
operator tokens, then expand all macros, and finally start lexing from
the resulting token list. This brings us to the second production,
IF_EXPANDED expression

This final production works just like our previous "HASH_IF
expression", evaluating a constant integer expression.

The new test (54) added for this case now passes.
2010-05-26 11:15:21 -07:00
Vinson Lee
80689ae615 gallivm: Remove unnecessary headers. 2010-05-26 11:13:23 -07:00
Vinson Lee
2966a25d3b st/xorg: Remove unnecessary headers. 2010-05-26 10:59:57 -07:00
Vinson Lee
3fa8a8ea28 util: Remove unnecessary headers. 2010-05-26 10:53:54 -07:00
Vinson Lee
67d5a51021 st/dri: Remove dri.c from SCons build.
This was missed in commit f501230db3.
Fixes SCons build.
2010-05-26 10:24:36 -07:00
Carl Worth
16c1e980e2 Fix lexing of "defined" as an operator, not an identifier.
Simply need to move the rule for IDENTIFIER to be after "defined" and
everything is happy.

With this change, tests 50 through 53 all pass now.
2010-05-26 09:37:14 -07:00
Carl Worth
f6914fd37b Implement #if and friends.
With this change, tests 41 through 49 all pass. (The defined operator
appears to be somehow broken so that test 50 doesn't pass yet.)
2010-05-26 09:33:23 -07:00
Carl Worth
8fed1cddae stash 2010-05-26 09:32:12 -07:00
Carl Worth
ad0dee6bb0 Implement token pasting.
Which makes test 40 now pass.
2010-05-26 09:04:50 -07:00
Kristian Høgsberg
cee4220f16 Revert the 'make static' part of 962f926112
The es1 and es2 dispath table initialization code is generated from the
API XML files and we can't easily share the dispatch table code setup.
Keep the _mesa_init_shader_dispatch() part of the patch, but roll back
the static-ization of shader entrypoints so es1 and es2 dispatch
initialization still works.
2010-05-26 11:32:36 -04:00
Carl Worth
ce540f2571 Rename identifier from 'i' to 'node'.
Now that we no longer have nested for loops with 'i' and 'j' we can
use the 'node' that we already have.
2010-05-26 08:30:36 -07:00
Carl Worth
63909fc196 Remove some stale token types.
All the code referencing these was removed some time ago.
2010-05-26 08:16:56 -07:00
Carl Worth
ec4ada01c0 Prevent unexpanded macros from being expanded again in the future.
With this fix, tests 37 - 39 now pass.
2010-05-26 08:15:49 -07:00
Carl Worth
c9dcc08d45 README: Document some known limitations.
None of these are fundamental---just a few things that haven't been
implemented yet.
2010-05-26 08:11:08 -07:00
Carl Worth
b1ae61a2ee Fix a typo in a comment.
Always better to use proper grammar in our grammar.
2010-05-26 08:10:38 -07:00
Carl Worth
d5cd40343f Expand macro arguments before performing argument substitution.
As required by the C99 specification of the preprocessor.

With this fix, tests 33 through 36 now pass.
2010-05-26 08:09:29 -07:00
Carl Worth
0197e9b64f Change macro expansion to append onto token lists rather than printing directly.
This doesn't change any functionality here, but will allow us to make
future changes that were not possible with direct printing.
Specifically, we need to expand macros within macro arguments before
performing argument substitution. And *that* expansion cannot result
in immediate printing.
2010-05-26 08:05:55 -07:00
Carl Worth
c0607d573e Check active expansions before expanding a function-like macro invocation.
With this fix, test 32 no longer recurses infinitely, but now passes.
2010-05-26 08:01:42 -07:00
Carl Worth
039739b2da Defer test 26 until much later (to test 55).
Supporting embedded newlines in a macro invocation is going to be
tricky with our current approach to lexing and parsing. Since this
isn't really an important feature for us, we can defer this until more
important things are resolved.

With this test out of the way, tests 27 through 31 are passing.
2010-05-26 08:00:43 -07:00
Marek Olšák
1bdbc0e38f r300g: fix fence referencing 2010-05-26 16:39:32 +02:00
Brian Paul
d3f598a506 mesa: move all vertex array functions into varray.c 2010-05-25 21:42:13 -06:00
Carl Worth
10ae438399 Avoid getting extra trailing whitespace from macros.
This trailing whitespace was coming from macro definitions and from
macro arguments. We fix this with a little extra state in the
token_list. It now remembers the last non-space token added, so that
these can be trimmed off just before printing the list.

With this fix test 23 now passes. Tests 24 and 25 are also passing,
but they probbably would ahve before this fix---just that they weren't
being run earlier.
2010-05-25 20:39:33 -07:00
Brian Paul
a830eef8c2 mesa: added _mesa_GetVertexAttribIiv / AttribIuiv()
Refactor the code for all the glGetVertexAttrib() functions.
2010-05-25 21:38:02 -06:00
Brian Paul
e00d07cff6 mesa: added _mesa_VertexAttribIPointer() 2010-05-25 21:18:33 -06:00
Brian Paul
e793a24d7c mesa: new GL 3.0 VertexAttrib commands
Still need to plug in API dispatch...
2010-05-25 21:18:33 -06:00
Brian Paul
962f926112 mesa: make a bunch of shader API functions static 2010-05-25 21:18:33 -06:00
Brian Paul
a017c7ecb7 mesa: display list support for uint uniforms
Still need to plug into dispatcher...
2010-05-25 21:18:33 -06:00
Brian Paul
09c7d7bf2a mesa: consolidate some glUniform code 2010-05-25 21:18:32 -06:00
Brian Paul
07b0529e55 mesa: unsigned int uniform functions (GL3) 2010-05-25 21:18:32 -06:00
Brian Paul
91f841aefc mesa: support for unsigned int uniforms 2010-05-25 21:18:32 -06:00
Marek Olšák
f0896e7f80 r300/compiler: implement SGT+SLE opcodes
Reported-by: Gianluca Anzolin <gianluca@sottospazio.it>
2010-05-26 04:47:55 +02:00
Marek Olšák
49bac3ccd8 r300/compiler: fix dumping r5xx vertex shaders 2010-05-26 04:47:27 +02:00
Marek Olšák
5c067a6304 r300/compiler: move hardware caps to the radeon_compiler base struct
Needed for vertex shaders too.
2010-05-26 04:47:26 +02:00
Marek Olšák
f2582da3bb r300/compiler: shorten swizzle expressions 2010-05-26 04:47:26 +02:00
Dave Airlie
15496e06b7 rbug: add set sample mask passthrough.
This at least stops rbug segfaulting at startup.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-05-26 11:45:32 +10:00
Carl Worth
5aa7ea0809 Remove a bunch of old code and give the static treatment to what's left.
We're no longer using the expansion stack, so its functions can go
along with most of the body of glcpp_parser_lex that was using it.
2010-05-25 18:39:43 -07:00
Carl Worth
652fa272ea Avoid swallowing initial left parenthesis from nested macro invocation.
We weren't including this left parenthesis in the argument's token
list so the nested function invocation wasn not being recognized.

With this fix, tests 21 and 22 now pass.
2010-05-25 17:45:22 -07:00
Carl Worth
c7581c2e6e Ignore separating whitespace at the beginning of a macro argument.
This causes test 16 to pass. Tests 17-20 are also passing now, (though
they would probably have passed before this change and simply weren't
being run yet).
2010-05-25 17:41:07 -07:00
Carl Worth
9ce18cf983 Implement substitution of function parameters in macro calls.
This makes tests 16 - 19 pass.
2010-05-25 17:32:21 -07:00
Carl Worth
e9397867dd Collapse multiple spaces in input down to a single space.
This is what gcc does, and it's actually less work to do
this. Previously we were having to save the contents of space tokens
as a string, but we don't need to do that now.

We extend test #0 to exercise this feature here.
2010-05-25 17:08:07 -07:00
Carl Worth
f8ec4e0be8 Add a test #0 to ensure that we don't do any inadvertent token pasting.
This simply ensures that spaces in input line are preserved.
2010-05-25 17:06:17 -07:00
Carl Worth
f34a0009dd Pass through literal space values from replacement lists.
This makes test 15 pass and also dramatically simplifies the lexer.

We were previously using a CONTROL state in the lexer to only emit
SPACE tokens when on text lines. But that's not actually what we
want. We need SPACE tokens in the replacement lists as well. Instead
of a lexer state for this, we now simply set a "space_tokens" flag
whenever we start constructing a pp_tokens list and clear the flag
whenever we see a '#' introducing a directive.

Much cleaner this way.
2010-05-25 17:06:08 -07:00
Marek Olšák
e6a8513a86 r300g: more efficient finish + fix comments 2010-05-26 01:41:32 +02:00
Carl Worth
b1854fdfb6 Implement simplified substitution for function-like macro invocation.
This supports function-like macro invocation but without any argument
substitution. This now makes test 11 through 14 pass.
2010-05-25 16:28:26 -07:00
Marek Olšák
2c072c8f72 r300g: implement fake but compliant fences 2010-05-26 01:23:11 +02:00
Carl Worth
e6fb7827c9 Implement #undef.
Which is as simple as copying the former action back from the git
history.

Now all tests through test 11 pass.
2010-05-25 15:28:58 -07:00
Carl Worth
ae6517f4a8 Implement expansion of object-like macros.
For this we add an "active" string_list_t to the parser. This makes
the current expansion_list_t in the parser obsolete, but we don't
remove that yet.

With this change we can now start passing some actual tests, so we
turn on real testing in the test suite again. I expect to implement
things more or less in the same order as before, so the test suite now
halts on first error.

With this change the first 8 tests in the suite pass, (object-like
macros with chaining and recursion).
2010-05-25 15:24:59 -07:00
Carl Worth
9fb8b7a495 Make the lexer pass whitespace through (as OTHER tokens) for text lines.
With this change, we can recreate the original text-line input
exactly. Previously we were inserting a space between every pair of
tokens so our output had a lot more whitespace than our input.

With this change, we can drop the "-b" option to diff and match the
input exactly.
2010-05-25 15:04:32 -07:00
Carl Worth
808401fd79 Store parsed tokens as token list and print all text lines.
Still not doing any macro expansion just yet. But it should be fairly
easy from here.
2010-05-25 14:52:43 -07:00
Carl Worth
80dc60b9c3 Delete some trailing whitespace.
This pernicious stuff managed to sneak in on us.
2010-05-25 14:42:00 -07:00
Carl Worth
9bb796f33a Add xtalloc_reference.
Yet another talloc wrapper that should come in handy.
2010-05-25 14:40:47 -07:00
Carl Worth
3ff8167084 Starting over with the C99 grammar for the preprocessor.
This is a fresh start with a much simpler approach for the flex/bison
portions of the preprocessor. This isn't functional yet, (produces no
output), but can at least read all of our test cases without any parse
errors.

The grammar here is based on the grammar provided for the preprocessor
in the C99 specification.
2010-05-25 14:38:15 -07:00
Marek Olšák
e1c117d87b r300g: add r300_init_render_functions, remove r300_render.h 2010-05-25 23:32:25 +02:00
Marek Olšák
73ee4e7eb2 r300g: remove r300_query.h 2010-05-25 23:32:25 +02:00
Marek Olšák
d1dac36004 r300g: remove r300_flush.h 2010-05-25 23:32:25 +02:00
Marek Olšák
85eede1b2f r300g: add r300_init_blit_functions, remove r300_blit.h 2010-05-25 23:32:25 +02:00
Marek Olšák
4d70a25964 util: update comments at blitter 2010-05-25 23:32:25 +02:00
Marek Olšák
16d1fb30a9 util: fix indentation in blitter 2010-05-25 23:32:25 +02:00
Marek Olšák
876de34c91 r300g,util: remove pipe_surface from the util_blitter_copy interface and clean up 2010-05-25 23:32:25 +02:00
Marek Olšák
59e51d9640 r300g,util: remove pipe_surface from the util_blitter_fill interface and clean up 2010-05-25 23:32:25 +02:00
Marek Olšák
85c55f2cf4 util: remove unused util_blitter_copy_surface 2010-05-25 23:32:25 +02:00
Jakob Bornecrantz
b9706886db drm_api: Remove type argument from create screen callback
With the removal of DRI1 support there where no use of this argument,
some drivers didn't even properly check it.
2010-05-25 19:05:07 +01:00
Jakob Bornecrantz
395b605e19 gallium: Remove dri1_api.h and winsys support for DRI1
Since DRI1 support was dropped from st/dri it
makes no sense to keep this code around.
2010-05-25 19:04:11 +01:00
Jakob Bornecrantz
f501230db3 st/dri: Remove DRI1 support
Nobody used it and the current code had been trough so many
changes yet never once being tested.
2010-05-25 19:03:19 +01:00
José Fonseca
378796fe11 llvmpipe: Stop relying on PIPE_FLUSH_TEXTURE_CACHE/PIPE_FLUSH_RENDER_CACHE magic.
Flush means flush, i.e., all previous operations should be visible from
other contexts.

This does not imply unswizzling tiles, since unswizzling should be done on
a needed basis for any context.
2010-05-25 14:39:25 +01:00
José Fonseca
ba404c8f2a gallivm: Choose an appropriate code generation optimization level.
'Default' unless GALLIVM_DEBUG=nopt option is set.
2010-05-25 11:48:00 +01:00
Brian Paul
e5d0c730d1 sw/xlib: NULL-out pointers after freeing image data
This fixes a double-free() error when not using a shared memory XImage.
The XDestroyImage() function frees the ximage->data buffer if non-NULL.
If we free it ourselves, we also need to NULL-out the pointer.
2010-05-24 16:21:55 -06:00
Brian Paul
8cbc1517c1 st/glx: check if deleting head of buffer list 2010-05-24 16:21:55 -06:00
Brian Paul
a949558430 meta: Convert Z value from normalized to object-space in meta code
Convert Z from a normalized value in the range [0, 1] to an
object-space Z coordinate in [-1, +1] so that drawing at the new Z
position with the default/identity ortho projection results in the
original Z value.  Used by the meta-Clear, Draw/CopyPixels and Bitmap
functions where the Z value comes from the clear value or raster
position.

Fixes piglit tests fdo23670-depth_test, quad-invariance and
glsl-orangebook-ch06-bump as well as oglc zbfunc.c.

https://bugs.freedesktop.org/show_bug.cgi?id=23670
2010-05-24 17:22:35 -04:00
Kristian Høgsberg
e88cef3c9d mesa: Reenable check for GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT
The check was disabled when FEATURE_OES_framebuffer_object was enabled,
since that used to mean we weren't implementing regular OpenGL semantics.
Now that we can compile in support for multiple APIs, change the #ifdef to
compile the check in when FEATURE_GL is enabled and enable the check for
contexts that implement OpenGL at runtime.
2010-05-24 16:56:56 -04:00
Carl Worth
00f1ec421e Add test for '/', '<<', and '>>' in #if expressions.
These operators have been supported already, but were not covered in
existing tests yet. So this test passes already.
2010-05-24 11:41:36 -07:00
Carl Worth
bb9315f804 Add test of bitwise operators and octal/hexadecimal literals.
This new test covers several features from the last few commits.

This test passes already.
2010-05-24 11:33:07 -07:00
Carl Worth
03f6d5d2d4 Add support for octal and hexadecimal integer literals.
In addition to the decimal literals which we already support. Note
that we use strtoll here to get the large-width integers demanded by
the specification.
2010-05-24 11:29:02 -07:00
Carl Worth
35419095f8 Switch to intmax_t (rather than int) for #if expressions
This is what the C99 specification demands. And the GLSL specification
says that we should follow the "standard C++" rules for #if condition
expressions rather than the GLSL rules, (which only support a 32-bit
integer).
2010-05-24 11:27:23 -07:00
Carl Worth
89b933a243 Add the '~' operator to the lexer.
This was simply missing before, (and unnoticed since we had no test of
the '~' operator).
2010-05-24 11:26:42 -07:00
Brian Paul
c10154a298 glsl: silence unused var warnings 2010-05-24 11:43:55 -06:00
Carl Worth
bcbd587b0f Implement all operators specified for GLSL #if expressions (with tests).
The operator coverage here is quite complete. The one big thing
missing is that we are not yet doing macro expansion in #if
lines. This makes the whole support fairly useless, so we plan to fix
that shortcoming right away.
2010-05-24 10:37:38 -07:00
José Fonseca
6460ba5eeb llvmpipe: Also test compressed formats in lp_test_format() 2010-05-24 16:41:28 +01:00
José Fonseca
f7b57245cc llvmpipe: Fix lp_test_format on 32bit OSes. 2010-05-24 16:38:09 +01:00
Carl Worth
b20d33c5c6 Implement #if, #else, #elif, and #endif with tests.
So far the only expression implemented is a single integer literal,
but obviously that's easy to extend. Various things including nesting
are tested here.
2010-05-20 22:27:07 -07:00
Carl Worth
d8327e575d Implement (and add test) for token pasting.
This is *very* easy to implement now that macro arguments are pre-expanded.
2010-05-20 15:18:54 -07:00
Carl Worth
c10a51ba13 Pre-expand macro arguments at time of invocation.
Previously, we were using the same lexing stack as we use for macro
expansion to also expand macro arguments. Instead, we now do this
earlier by simply recursing over the macro-invocations replacement
list and constructing a new expanded list, (and pushing only *that*
onto the stack).

This is simpler, and also allows us to more easily implement token
pasting in the future.
2010-05-20 15:15:26 -07:00
Carl Worth
b894583fd0 Add xtalloc_asprintf
I expect this to be useful in the upcoming implementation of token pasting.
2010-05-20 15:02:03 -07:00
Carl Worth
876e510bda Finish cleaning up whitespace differences.
The last remaining thing here was that when a line ended with a macro,
and the parser looked ahead to the newline token, the lexer was
printing that newline before the parser printed the expansion of the
macro.

The fix is simple, just make the lexer tell the parser that a newline
is needed, and the parser can wait until reducing a production to
print that newline.

With this, we now pass the entire test suite with simply "diff -u", so
we no longer have any diff options hiding whitespace bugs from
us. Hurrah!
2010-05-20 14:38:06 -07:00
Carl Worth
5a6b9a27fd Avoid printing a space at the beginning of lines in the output.
This fixes more differences compared to "gcc -E" so removes several
cases of erroneously failing test cases. The implementation isn't very
elegant, but it is functional.
2010-05-20 14:29:43 -07:00
Carl Worth
005b32061f Fix bug of consuming excess whitespace.
We fix this by moving printing up to the top-level "input" action and
tracking whether a space is needed between one token and the next.

This fixes all actual bugs in test-suite output, but does leave some
tests failing due to differences in the amount of whitespace produced,
(which aren't actual bugs per se).
2010-05-20 14:19:57 -07:00
Carl Worth
ff13cfed81 Remove unused function _print_string_list
The only good dead code is non-existing dead code.
2010-05-20 14:08:19 -07:00
Carl Worth
323421db65 Remove "unnecessary" whitespace from some tests.
This whitespace was not part of anything being tested, and it
introduces differences (that we don't actually care about) between the
output of "gcc -E" and glcpp.

Just eliminate this extra whitespace to reduce spurious test-case
failures.
2010-05-20 14:05:37 -07:00
Carl Worth
660bda057a Stop ignoring whitespace while testing.
Sometime back the output of glcpp started differing from the output of
"gcc -E" in the amount of whitespace in emitted. At the time, I
switched the test suite to use "diff -w" to ignore this. This was a
mistake since it ignores whitespace entirely. (I meant to use "diff
-b" which ignores only changes in the amount of whitespace.)

So bugs have since been introduced that the test suite doesn't
notice. For example, glcpp is producing "twotokens" where it should be
producing "two tokens".

Let's stop ignoring whitespace in the test suite, which currently
introduces lots of failures---some real and some spurious.
2010-05-20 14:01:59 -07:00
Carl Worth
805ea6afe6 Add test (and fix) for a function argument of a macro that expands with a comma.
The fix here is quite simple (and actually only deletes code). When
expanding a macro, we don't return a ',' as a unique token type, but
simply let it fall through to the generic case.
2010-05-20 12:06:33 -07:00
Carl Worth
9f3d2c4e3d Add support for commas within parenthesized groups in function arguments.
The specification says that commas within a parenthesized group,
(that's not a function-like macro invocation), are passed through
literally and not considered argument separators in any outer macro
invocation.

Add support and a test for this case. This support makes a third
occurrence of the same "FUNC_MACRO (" shift/reduce conflict appear, so
expect that.

This change does introduce a fairly large copy/paste block in the
grammar which is unfortunate. Perhaps if I were more clever I'd find a
way to share the common pieces between argument and argument_or_comma.
2010-05-20 08:46:54 -07:00
Carl Worth
b569383bbd Avoid re-expanding a macro name that has once been rejected from expansion.
The specification of the preprocessor in C99 says that when we see a
macro name that we are already expanding that we refuse to expand it
now, (which we've done for a while), but also that we refuse to ever
expand it later if seen in other contexts at which it would be
legitimate to expand.

We add a test case for that here, and fix it to work. The fix takes
advantage of a new token_t value for tokens and argument words along
with the recently added IDENTIFIER_FINALIZED token type which
instructs the parser to not even look for another expansion.
2010-05-20 08:01:44 -07:00
Carl Worth
472524413d Use new token_list_t rather than string_list_t for macro values.
There's not yet any change in functionality here, (at least according
to the test suite). But we now have the option of specifying a type
for each string in the token list. This will allow us to finalize an
unexpanded macro name so that it won't be subjected to excess
expansion later.
2010-05-19 13:54:37 -07:00
Carl Worth
aaa9acbf10 Perform "re lexing" on string list values rathern than on text.
Previously, we would pass original strings back to the original lexer
whenever we needed to re-lex something, (such as an expanded macro or
a macro argument). Now, we instead parse the macro or argument
originally to a string list, and then re-lex by simply returning each
string from this list in turn.

We do this in the recently added glcpp_parser_lex function that sits
on top of the lower-level glcpp_lex that only deals with text.

This doesn't change any behavior (at least according to the existing
test suite which all still passes) but it brings us much closer to
being able to "finalize" an unexpanded macro as required by the
specification.
2010-05-19 13:28:24 -07:00
Carl Worth
71c59ec66b Remove unused NEWLINE token.
We fixed the lexer a while back to never return a NEWLINE token, but
negelcted to clean up this declaration.
2010-05-19 10:07:31 -07:00
Carl Worth
66df1c262a Remove unneeded YYLEX_PARAM define.
I'm not sure where this came from, but it's clearly not needed.
2010-05-19 10:06:56 -07:00
Carl Worth
0293b2e2dd Rename yylex to glcpp_parser_lex and give it a glcpp_parser_t* argument.
Much cleaner this way, (and now our custom lex function has access to
all the parser state which it will need).
2010-05-19 10:05:40 -07:00
Carl Worth
8f38aff9b5 Add a wrapper function around the lexer.
We rename the generated lexer from yylex to glcpp_lex. Then we
implement our own yylex function in glcpp-parse.y that calls
glcpp_lex. This doesn't change the behavior at all yet, but gives us a
place where we can do implement alternate lexing in the future.

(We want this because instead of re-lexing from strings for macro
expansion, we want to lex from pre-parsed token lists. We need this so
that when we terminate recursion due to an already active macro
expansion, we can ensure that that symbol never gets expanded again
later.)
2010-05-19 10:01:29 -07:00
Carl Worth
5d21142545 Like previous fix, but for object-like macros (and add a test).
The support for an object-like amcro within a macro-invocation
argument was also implemented at one level too high in the
grammar. Fortunately, this is a very simple fix.
2010-05-19 07:57:03 -07:00
Carl Worth
59ca98990f Fix bug as in previous fix, but with multi-token argument.
The previous fix added FUNC_MACRO to a production one higher in teh
grammar than it should have. So it prevented a FUNC_MACRO from
appearing as part of a mutli-token argument rather than just alone as
an argument. Fix this (and add a test).
2010-05-19 07:49:47 -07:00
Carl Worth
69f390d609 Fix bug (and test) for an invocation using macro name as a non-macro argument
This adds a second shift/reduce conflict to our grammar. It's basically the
same conflict we had previously, (deciding to shift a '(' after a FUNC_MACRO)
but this time in the "argument" context rather than the "content" context.

It would be nice to not have these, but I think they are unavoidable
(withotu a lot of pain at least) given the preprocessor specification.
2010-05-19 07:42:42 -07:00
Carl Worth
be0e2e9b2a Fix bug (and add tests) for a function-like macro defined as itself.
This case worked previously, but broke in the recent rewrite of
function- like macro expansion. The recursion was still terminated
correctly, but any parenthesized expression after the macro name was
still being swallowed even though the identifier was not being
expanded as a macro.

The fix is to notice earlier that the identifier is an
already-expanding macro. We let the lexer know this through the
classify_token function so that an already-expanding macro is lexed as
an identifier, not a FUNC_MACRO.
2010-05-19 07:29:22 -07:00
Carl Worth
a807fb72c4 Rewrite macro handling to support function-like macro invocation in macro values
The rewrite her discards the functions that did direct, recursive
expansion of macro values. Instead, the parser now pushes the macro
definition string over to a stack of buffers for the lexer. This way,
macro expansion gets access to all parsing machinery.

This isn't a small change, but the result is simpler than before (I
think). It passes the entire test suite, including the four tests
added with the previous commit that were failing before.
2010-05-18 22:10:04 -07:00
Carl Worth
d476db38fe Add several tests where the defined value of a macro is (or looks like) a macro
Many of these look quite similar to existing tests that are handled
correctly, yet none of these work. For example, in test 30 we have a
simple non-function macro "foo" that is defined as "bar(baz(success))"
and obviously non-function macro expansion has been working for a long
time.  Similarly, if we had text of "bar(baz(success))" it would be
expanded correctly as well.

But when this otherwise functioning text appears as the body of a
macro, things don't work at all.

This is pointing out a fundamental problem with the current
approach. The current code does a recursive expansion of a macro
definition, but this doesn't involve the parsing machinery, so it
can't actually handle things like an arbitrary nesting of parentheses.

The fix will require the parser to stuff macro values back into the
lexer to get at all of the existing machinery when expanding macros.
2010-05-18 22:09:57 -07:00
Ian Romanick
461c294ac5 Use ir_rvalue::variable_referenced instead of open coding it 2010-05-18 13:53:20 +02:00
Carl Worth
1a29500e72 Fix (and add test for) function-like macro invocation with newlines.
The test has a newline before the left parenthesis, and newlines to
separate the parentheses from the argument.

The fix involves more state in the lexer to only return a NEWLINE
token when termniating a directive. This is very similar to our
previous fix with extra lexer state to only return the SPACE token
when it would be significant for the parser.

With this change, the exact number and positioning of newlines in the
output is now different compared to "gcc -E" so we add a -B option to
diff when testing to ignore that.
2010-05-17 13:21:13 -07:00
Carl Worth
796e1f0ead Expect 1 shift/reduce conflict.
The most recent fix to the parser introduced a shift/reduce
conflict. We document this conflict here, and tell bison that it need
not report it (since I verified that it's being resolved in the
direction desired).

For the record, I did write additional lexer code to eliminate this
conflict, but it was quite fragile, (would not accept a newline
between a function-like macro name and the left parenthesis, for
example).
2010-05-17 12:46:35 -07:00
Ian Romanick
c65cfef317 ir_visit_tree is no longer used, remove ir_visit_tree.{cpp,h} 2010-05-17 12:03:13 -07:00
Ian Romanick
551c9c0deb Reimplement kill_for_derefs using ir_hierarchical_vistor
The output of all test cases was verified to be the same using diff.
2010-05-17 12:03:13 -07:00
Ian Romanick
77dd4f3536 Reimplement has_call_callback using ir_hierarchical_vistor
This has the added advantage that it will stop traversing the tree as
soon as the first call is found.

The output of all test cases was verified to be the same using diff.
2010-05-17 12:03:13 -07:00
Ian Romanick
a0b4f3d631 Reimplement ir_if_simplicifation_visitor using ir_hierarchical_vistor
The output of all test cases was verified to be the same using diff.
2010-05-17 12:03:13 -07:00
Ian Romanick
458d5c61ef Make visit_list_elements safe against node removals 2010-05-17 12:03:13 -07:00
Ian Romanick
671e4f6321 Reimplement ir_function_can_inline_visitor using ir_hierarchical_vistor
The output of all test cases was verified to be the same using diff.
2010-05-17 12:03:13 -07:00
Ian Romanick
b5a7cf9344 Reimplement ir_dead_code_visitor using ir_hierarchical_vistor
The output of all test cases was verified to be the same using diff.
2010-05-17 12:03:13 -07:00
Ian Romanick
8895bae55b Add ir_hierarchical_visitor base class and associated infrastructure
This type of visitor should eventually replace all or almost all
current uses of ir_visitor.
2010-05-17 12:03:13 -07:00
Ian Romanick
86790dd43f Replace find_dead_code with visit_exec_list
find_dead_code appears to be an open-coded version of visit_exec_list
that was implemented first.
2010-05-17 12:03:13 -07:00
Carl Worth
acf87bc034 Fix bug (and add test) for a function-like-macro appearing as a non-macro.
That is, when a function-like macro appears in the content without
parentheses it should be accepted and passed on through, (previously
the parser was regarding this as a syntax error).
2010-05-17 10:34:29 -07:00
Carl Worth
420d05a15b Add test and fix bug leading to infinite recursion.
The test case here is simply "#define foo foo" and "#define bar foo"
and then attempting to expand "bar".

Previously, our termination condition for the recursion was overly
simple---just looking for the single identifier that began the
expansion. We now fix this to maintain a stack of identifiers and
terminate when any one of them occurs in the replacement list.
2010-05-17 10:15:23 -07:00
Ian Romanick
5d82e239f9 Use ir_rvalue::variable_referenced instead of open-coding it 2010-05-14 17:36:00 -07:00
Ian Romanick
2b3c476fa0 Add ir_rvalue::variable_referenced 2010-05-14 17:35:42 -07:00
Carl Worth
e36a4d5be9 Fix two whitespace bugs in the lexer.
The first bug was not allowing whitespace between '#' and the
directive name.

The second bug was swallowing a terminating newline along with any
trailing whitespace on a line.

With these two fixes, and the previous commit to stop emitting SPACE
tokens, the recently added extra-whitespace test now passes.
2010-05-14 17:29:24 -07:00
Carl Worth
81f01432bd Don't return SPACE tokens unless strictly needed.
This reverts the unconditional return of SPACE tokens from the lexer
from commit 48b94da099 .

That commit seemed useful because it kept the lexer simpler, but the
presence of SPACE tokens is causing lots of extra complication for the
parser itself, (redundant productions other than whitespace
differences, several productions buggy in the case of extra
whitespace, etc.)

Of course, we'd prefer to never have any whitespace token, but that's
not possible with the need to distinguish between "#define foo()" and
"#define foo ()". So we'll accept a little bit of pain in the lexer,
(enough state to support this special-case token), in exchange for
keeping most of the parser blissffully ignorant of whether tokens are
separated by whitespace or not.

This change does mean that our output now differs from that of "gcc -E",
but only in whitespace. So we test with "diff -w now to ignore those
differences.
2010-05-14 17:13:00 -07:00
Carl Worth
4eb2ccf261 Add test with extra whitespace in macro defintions and invocations.
This whitespace is not dealt with in an elegant way yet so this test
does not pass currently.
2010-05-14 17:03:43 -07:00
Carl Worth
3596bb149e Provide implementation for macro arguments containing parentheses.
We were correctly parsing this already, but simply not returning any
value (for no good reason). Fortunately the fix is quite simple.

This makes the test added in the previous commit now pass.
2010-05-14 16:53:52 -07:00
Carl Worth
f6ae186cfd Add test invoking a macro with an argument containing (non-macro) parentheses.
The macro invocation is defined to consume all text between a set of
matched parentheses. We previously tested for inner parentheses from a
nested function-like macro invocation. Here we test for inner
parentheses occuring on their own, (not part of another macro
invocation).
2010-05-14 16:51:54 -07:00
Kenneth Graunke
67e07ad3a3 Refresh autogenerated builtin_function.cpp. 2010-05-14 16:34:46 -07:00
Kenneth Graunke
c8de850dd5 Implement "tan" builtin. 2010-05-14 16:34:46 -07:00
Kenneth Graunke
57e7da173e Implement "sin" and "cos" builtins via new expression operators. 2010-05-14 16:34:46 -07:00
Kenneth Graunke
6a9b1e1f06 Implement "cross" builtin. 2010-05-14 16:34:46 -07:00
Kenneth Graunke
d9bda3c29d Implement "fract" builtin. 2010-05-14 16:34:46 -07:00
Kenneth Graunke
a4b7b5a654 Implement "sign" builtin via a new expression operator. 2010-05-14 16:34:46 -07:00
Kenneth Graunke
c2de187523 Implement "smoothstep" builtin. 2010-05-14 16:34:46 -07:00
Kenneth Graunke
a2b63d3ed1 Implement "step" builtin. 2010-05-14 16:34:46 -07:00
Kenneth Graunke
9287ecc3aa Integrate generate_builtins.pl into the build process.
make will now regenerate builtin_function.cpp whenever you
change/add/remove files in the builtins/* folders.
2010-05-14 16:34:46 -07:00
Kenneth Graunke
b3262128fe Replace old builtin_function.cpp with new autogenerated one. 2010-05-14 16:34:46 -07:00
Kenneth Graunke
4c7367b3f9 Add a perl script to generate builtin_function.cpp.
Usage: ./builtins/tools/generate_builtins.pl > builtin_function.cpp
2010-05-14 16:34:46 -07:00
Kenneth Graunke
a40e68b256 Fix bogus expression typing in various builtins. 2010-05-14 16:34:46 -07:00
Kenneth Graunke
e4afc64290 Initial commit of IR for builtins.
These were all generated by Eric's existing builtin_functions.cpp; I split
the uvec* signatures out of 110 into the 130 folder.
2010-05-14 16:34:46 -07:00
Kenneth Graunke
f6c90d8b34 ir_reader: Set function signatures as defined. 2010-05-14 16:34:46 -07:00
Eric Anholt
c05bc5b7cc FS gl_FragCoord and and gl_FrontFacing are FS ins, not outs. 2010-05-14 16:11:37 -07:00
Ian Romanick
2384937835 Fix function call parameter printer to omit extraneous leading comma
The output of all test cases was verified to be the same using diff.
2010-05-14 16:07:04 -07:00
Carl Worth
38bd27b444 Fix expansion of composited macros.
This is a case such as "foo(bar(x))". The recently added test for this
now passes.
2010-05-14 12:05:37 -07:00
Carl Worth
92e7bf0f50 Add test for composed invocation of function-like macros.
This is a case like "foo(bar(x))" where both foo and bar are defined
function-like macros. This is not yet parsed correctly so this test
fails.
2010-05-14 11:50:33 -07:00
Carl Worth
ac070e8bf5 Eliminate a shift/reduce conflict.
By simply allowing for the argument_list production to be empty rather
than the lower-level argument production to be empty.
2010-05-14 11:50:32 -07:00
Carl Worth
8f6a828e4a Support macro invocations with multiple tokens for a single argument.
We provide for this by changing the value of the argument-list
production from a list of strings (string_list_t) to a new
data-structure that holds a list of lists of strings
(argument_list_t).
2010-05-14 11:50:27 -07:00
Carl Worth
db272e6e6f Add test for function-like macro invocations with multiple-token arguments.
These are not yet parsed correctly, so these tests fail.
2010-05-14 11:50:27 -07:00
Carl Worth
2be8be0f74 Make macro-expansion productions create string-list values rather than printing
Then we print the final string list up at the top-level content
production along with all other printing.

Additionally, having macro-expansion productions that create values
will make it easier to solve problems like composed function-like
macro invocations in the future.
2010-05-14 11:50:27 -07:00
Carl Worth
04af13539a Move most printing to the action in the content production.
Previously, printing was occurring all over the place. Here we
document that it should all be happening at the top-level content
production, and we move the printing of directive newlines.

The printing of expanded macros is still happening in lower-level
productions, but we plan to fix that soon.
2010-05-14 11:50:27 -07:00
Carl Worth
c5e9855f13 Remove _list suffix from several identifiers.
Instead of "parameter_list" and "replacement_list" just use
"parameters" and "replacements". This is consistent with the existing
"arguments" and keeps the line length down in the face of the
now-longer "string_list_t" rather than "list_t".
2010-05-14 11:50:27 -07:00
Carl Worth
610053b2c6 Rename list_t and node_t to string_list_t and string_node_t.
We'll soon be adding other types of lists, so it will be helpful to
have a qualified name here.
2010-05-14 11:50:27 -07:00
Carl Worth
7f9aa36bbc Fix case of a macro formal parameter matching a defined macro.
Simply need to allow for a macro name to appear in the parameter list.

This makes the recently-added test pass.
2010-05-14 09:53:50 -07:00
Carl Worth
3014073311 Add test where a macro formal parameter is the same as an existing macro.
This is a well-defined condition, but something that currently trips up
the implementation. Should be easy to fix.
2010-05-14 09:53:50 -07:00
Carl Worth
dcc2ecd30d Implement substitution of macro arguments.
Making the two recently-added tests for this functionality now pass.
2010-05-14 09:53:50 -07:00
Carl Worth
af71ba41bd Add tests exercising substitution of arguments in function-like macros.
This capability is the only thing that makes function-like macros
interesting. This isn't supported yet so these tests fail for now.
2010-05-14 09:53:50 -07:00
Carl Worth
48b94da099 Make the lexer return SPACE tokens unconditionally.
It seems strange to always be returning SPACE tokens, but since we
were already needing to return a SPACE token in some cases, this
actually simplifies our lexer.

This also allows us to fix two whitespace-handling differences
compared to "gcc -E" so that now the recent modification to the test
suite passes once again.
2010-05-14 09:48:14 -07:00
Carl Worth
462cce1852 Makefile: Make "make test" depend on the main program.
Otherwise, running "make test" can run an old version of the code,
(even when new changes are sitting in the source waiting to be
compiled).
2010-05-14 09:20:13 -07:00
Carl Worth
27bc8930ba Add some whitespace variations to test 15.
This shows two minor failures in our current parsing (resulting in
whitespace-only changes, oso not that significant):

  1. We are inserting extra whitespace between tokens not originally
     separated by whitespace in the replacement list of a macro
     definition.

  2. We are swallowing whitespace separating tokens in the general
     content.
2010-05-14 09:20:13 -07:00
Carl Worth
0a93cbbe4f Fix parsing of object-like macro with a definition that begins with '('.
Previously our parser was incorrectly treating this case as a
function-like macro. We fix this by conditionally passing a SPACE
token from the lexer, (but only immediately after the identifier
immediately after #define).
2010-05-14 09:20:13 -07:00
Carl Worth
67c27afc16 Add test for an object-like macro with a definition beginning with '('
Our current parser sees "#define foo (" as an identifier token
followed by a '(' token and parses this as a function-like macro.

That would be correct for "#define foo(" but the preprocessor
specification treats this whitespace as significant here so this test
currently fails.
2010-05-14 09:20:13 -07:00
Carl Worth
db35d557a4 Eliminate a reduce/reduce conflict in the function-like macro production.
Previously, an empty argument could be parsed as either an "argument_list"
directly or first as an "argument" and then an "argument_list".

We fix this by removing the possibility of an empty "argument_list"
directly.
2010-05-14 08:47:32 -07:00
Carl Worth
fcbbb46886 Add support for the structure of function-like macros.
We accept the structure of arguments in both macro definition and
macro invocation, but we don't yet expand those arguments. This is
just enough code to pass the recently-added tests, but does not yet
provide any sort of useful function-like macro.
2010-05-13 09:36:23 -07:00
Carl Worth
4abc3dec72 Add tests for the structure of function-like macros.
These test only the most basic aspect of parsing of function-like
macros.  Specifically, none of the definitions of these function like
macros use the arguments of the function.

No function-like macros are implemented yet, so all of these fail for
now.
2010-05-13 09:35:50 -07:00
Carl Worth
9f62a7e9e2 Make the lexer distinguish between identifiers and defined macros.
This is just a minor style improvement for now. But the same
mechanism, (having the lexer peek into the table of defined macros),
will be essential when we add function-like macros in addition to the
current object-like macros.
2010-05-13 07:38:29 -07:00
Carl Worth
8bcb6f1777 Remove some redundancy in the top-level production.
Previously we had two copies of all top-level actions, (once in a list
context and once in a non-list context). Much simpler to instead have
a single list-context production with no action and then only have the
actions in their own non-list contexts.
2010-05-12 13:21:20 -07:00
Carl Worth
012295f94c Simplify lexer significantly (remove all stateful lexing).
We are able to remove all state by simply passing NEWLINE through
as a token unconditionally (as opposed to only passing newline when
on a driective line as we did previously).
2010-05-12 13:20:31 -07:00
Carl Worth
a68e668b17 Add test case to define, undef, and then again define a macro.
Happily, this is another test case that works just fine without any
additional code.
2010-05-12 13:14:08 -07:00
Carl Worth
cd27e6413a Add support for the #undef macro.
This isn't ideal for two reasons:

1. There's a bunch of stateful redundancy in the lexer that should be
   cleaned up.

2. The hash table does not provide a mechanism to delete an entry, so
   we waste memory to add a new NULL entry in front of the existing
   entry with the same key.

But this does at least work, (it passes the recently added undef test
case).
2010-05-12 13:11:50 -07:00
Carl Worth
7bdd1f36d9 Add test for #undef.
Which hasn't been implemented yet, so this test fails.
2010-05-12 13:11:23 -07:00
Carl Worth
39cd7c2f2e Add test for an empty definition.
Happily this one passes without needing any additional code.
2010-05-12 12:49:07 -07:00
Carl Worth
5070a20cd1 Convert lexer to talloc and add xtalloc wrappers.
The lexer was previously using strdup (expecting the parser to free),
but is now more consistent, easier to use, and slightly more efficent
by using talloc along with the parser.

Also, we add xtalloc and xtalloc_strdup wrappers around talloc and
talloc_strdup to put all of the out-of-memory-checking code in one
place.
2010-05-12 12:47:29 -07:00
Carl Worth
33cc400714 Fix defines involving both literals and other defined macros.
We now store a list of tokens in our hash-table rather than a single
string. This lets us replace each macro in the value as necessary.

This code adds a link dependency on talloc which does exactly what we
want in terms of memory management for a parser.

The 3 tests added in the previous commit now pass.
2010-05-12 12:25:34 -07:00
Carl Worth
df2ab5b992 Add tests defining a macro to be a literal and another macro.
These 3 new tests are modeled after 3 existing tests but made slightly
more complex since now instead of definining a new macro to be an
existing macro, we define it to be replaced with two tokens, (one a
literal, and one an existing macro).

These tests all fail currently because the replacement lookup is
currently happening on the basis of the entire replacement string
rather than on a list of tokens.
2010-05-11 12:39:29 -07:00
Carl Worth
34db0d332e Add a couple more tests for chained #define directives.
One with the chained defines in the opposite order, and one with the
potential to trigger an infinite-loop bug through mutual
recursion. Each of these tests pass already.
2010-05-11 12:35:06 -07:00
Carl Worth
c6d5af3351 Fix to handle chained #define directives.
The fix is as simple as adding a loop to continue to lookup values
in the hash table until one of the following termination conditions:

	1. The token we look up has no definition

	2. We get back the original symbol we started with

This second termination condition prevents infinite iteration.
2010-05-11 12:30:09 -07:00
Carl Worth
49206ef4c8 Add test for chained #define directives.
Where one macro is defined in terms of another macro. The current
implementation does not yet deal with this correctly.
2010-05-11 12:29:22 -07:00
Carl Worth
beb26e8ac3 Add README file describing glcpp.
Mostly this is a place for me to write down the URLs of the GLSL and
C99 specifications that I need to write this code.
2010-05-11 12:20:15 -07:00
Ian Romanick
2b97dc657a Replace many uses of foreach_list with foreach_list_typed 2010-05-10 17:42:05 -07:00
Ian Romanick
4cfbad9e4d exec_list: Add foreach_list_typed and foreach_list_typed_const
These variations are parameterized by the type of the nodes in the
list.  This enables skipping the explicit usage of exec_node_data in
the loop body.
2010-05-10 17:40:41 -07:00
Carl Worth
e8c790b3ce Add a very simple test for the pre-processor.
Validate desired test cases by ensuring the output of glcpp matches
the output of the gcc preprocessor, (ignoring any lines of the gcc
output beginning with '#').

Only one test case so far with a trivial #define.
2010-05-10 16:21:10 -07:00
Carl Worth
0b27b5f051 Implment #define
By using the recently-imported hash_table implementation.
2010-05-10 16:16:06 -07:00
Carl Worth
725c17a926 Makefile: Enable debugging of parser.
This compiles the debugging code for teh parser. It's not active
unless the yydebug variable is set to a non-zero value.
2010-05-10 16:14:59 -07:00
Carl Worth
633a692225 Add hash table implementation from glsl2 project.
The preprocessor here is intended to become part of the glsl2 codebase
eventually anyway.
2010-05-10 13:36:26 -07:00
Carl Worth
a70e7bab2b Add .gitignore file.
To ignore generated source files (and glcpp binary).
2010-05-10 13:32:42 -07:00
Carl Worth
a1e32bcff0 Add some compiler warnings and corresponding fixes.
Most of the current problems were (mostly) harmless things like
missing declarations, but there was at least one real error, (reversed
argument order for yyerrror).
2010-05-10 13:32:29 -07:00
Carl Worth
38aa83560b Make the lexer reentrant (to avoid "still reachable" memory).
This allows the final program to be 100% "valgrind clean", (freeing
all memory that it allocates). This will make it much easier to ensure
that any allocation that parser actions perform are also cleaned up.
2010-05-10 11:52:29 -07:00
Carl Worth
3a37b8701c Add the tiniest shell of a flex/bison-based parser.
It doesn't really *do* anything yet---merlely parsing a stream of
whitespace-separated tokens, (and not interpreting them at all).
2010-05-10 11:46:34 -07:00
Ian Romanick
304ea90233 Convert ast_node use of simple_node to exec_list and exec_node 2010-05-10 11:17:53 -07:00
Ian Romanick
752c905b8c exec_list: Add simpler exec_list for-each macros 2010-05-10 11:17:23 -07:00
Ian Romanick
43bfc2b6b5 exec_list: Add macros to get ptr to structure containing a node
This has some ugly hackery to work-around C++ fail.  I have
emperically determined that it works in all the cases that matter.
2010-05-10 11:16:24 -07:00
Ian Romanick
4f9d72fa9e Loop bodies, then-statements, and else-statements are not lists
The statement making up a loop body, a then-statement, or an
else-statement are single nodes.  If the statement is a block, the
single node will be an ast_compound_statement.  There is no need to
loop at the top level when processing these statements.
2010-05-10 11:10:26 -07:00
Ian Romanick
f4e06981cc Remove unnecessary include of simple_list.h 2010-05-10 11:04:22 -07:00
Ian Romanick
3521f0bdd5 Store AST function call parameters in expressions
Previously the list of function call parameters was stored as a
circular list in ast_expression::subexpressions[1].  They are now
stored as a regular list in ast_expression::expressions.
2010-05-10 11:04:02 -07:00
Eric Anholt
bdd9b1f3ff Move optimization pass prototypes to a single header. 2010-05-05 11:47:33 -07:00
Eric Anholt
6255a1f4c6 ir_dead_code_local: Remove redundant assignments within basic blocks.
This cleans up a bunch of junk code in some of the GLSL parser tests,
and could potentially help real-world too (particularly after copy
propagation has happened).
2010-05-05 11:08:18 -07:00
Eric Anholt
dc1dbd65e1 ir_visit_tree: Make sure we visit dereference targets, too.
Found this with the local dead code pass, which never saw variable
dereferences occurring.
2010-05-05 11:08:18 -07:00
Eric Anholt
aef0aaee67 ir_copy_propagation: Fix up the doxygen about the file. 2010-05-05 09:38:09 -07:00
Eric Anholt
8e75de3164 ir_copy_propagation: Return true if we optimized out any assignments.
This may trigger other optimization phases to make more progress themselves.
2010-05-05 09:32:44 -07:00
Eric Anholt
4e2c0b99d9 ir_copy_propagation: Handle swizzles and array derefs on LHS of assign.
This improves the ACP to not get cleared when more complicated assignments
occur, cleaning up more redundant copies in programs.
2010-05-05 09:27:50 -07:00
Eric Anholt
5c89f0ecb9 ir_copy_propagation: New pass to rewrite dereferences to avoid copies.
This is pretty basic.  Right now it only handles pure assignments --
same type on each side, no swizzling, and only within basic blocks.
2010-05-04 17:00:42 -07:00
Eric Anholt
05a4e59c24 ir_to_mesa.cpp: Fix missing types on some ir_swizzles.
Debugging this took forever as I only looked at constructors in ir.cpp
to find who wasn't setting up ->type.  I dislike hiding code (as
opposed to prototypes and definitions) in C++ header files, but in
this case I have only myself to blame.
2010-05-03 17:09:31 -07:00
Eric Anholt
3bc8b68436 Remove the pedantic C junk.
Mesa doesn't use pedantic ANSI C89, so I have no idea why we would.
2010-05-03 11:41:00 -07:00
Eric Anholt
3623df68fa Store warnings and errors in a parser state infolog.
Cleans up compile warning about unused state in _mesa_glsl_warning.  We
would want infolog handling roughly like this anyway.
2010-05-03 11:40:26 -07:00
Eric Anholt
81f49a774e Quiet warnings about ir_shader not being handled in places it's not needed. 2010-05-03 11:40:26 -07:00
Eric Anholt
7f436a837c Use the AM_SILENT_RULES when available. 2010-05-03 11:40:26 -07:00
Eric Anholt
a35e62d97a glsl_lexer: Quiet warning about unused unput(). 2010-05-03 11:40:25 -07:00
Ian Romanick
970353e047 Merge branch 'fixes' 2010-05-03 10:15:02 -07:00
Kenneth Graunke
b0e0da5f07 Use %p rather than %08x when printing pointers to fix compile. 2010-05-01 00:38:36 -07:00
Kenneth Graunke
05ddebac0a Fix ir_return cloning to actually use the cloned subexpression.
This caused a nasty bug where the function inliner would create new
variables for each of the formal parameters, but the body would still
reference the old copies.

This was highly visible since the dead code eliminator (rightly) removed
the new declarations, leading to printed IR that referenced non-existent
variable names.
2010-05-01 00:31:35 -07:00
Kenneth Graunke
c07fdae33f Fix incorrect comments in function inliner. 2010-04-30 23:38:50 -07:00
Jakob Bornecrantz
734522acee xorg-vmwgfx: Add vmwctrl proto 2010-04-30 11:47:27 +01:00
Kristian Høgsberg
f67b020a94 mesa: Handle FEATURE_es2_glsl differences at runtime too
Now that we can support different APIs at runtime, we need to check the
context for the API we're currently providing as well.

https://bugs.freedesktop.org/show_bug.cgi?id=28194
2010-05-24 10:02:13 -04:00
José Fonseca
740c8ea6d3 llvmpipe: Delete extraneous arugment too. 2010-05-24 14:24:06 +01:00
José Fonseca
5a0b4627fc llvmpipe: Remove unused sincos_test_case struct. 2010-05-24 13:56:53 +01:00
Qicheng Christopher Li
80ee3a440c llvmpipe: Unit test for sin/cos that compares against reference implementation.
Signed-off-by: José Fonseca <jfonseca@vmware.com>
2010-05-24 13:45:26 +01:00
Qicheng Christopher Li
3c929e5544 gallivm: Efficient implementation of sin/cos.
Based on Julien Pommier's SSE and SSE2 algorithms.

Signed-off-by: José Fonseca <jfonseca@vmware.com>
2010-05-24 13:45:21 +01:00
Eric Anholt
9b775c1e58 i965: Add support for all 8 possible ARB_draw_buffers in Mesa.
We should be able to do 16, but are limited by Mesa's static buffer
allocations.
2010-05-23 16:59:43 -07:00
Eric Anholt
08b42bc97d i965: Fix bit allocation for number of color regions for ARB_draw_buffers.
If you used all 4 color targets we currently support, we would see 0
and end up just writing the first output.  Give enough bits that we
can do the maximum of 16.

Fixes piglit fbo-drawbuffers-maxtargets.
2010-05-23 16:59:07 -07:00
Marek Olšák
fa552261ea util/blitter: allow NULL clear color 2010-05-23 19:01:11 +02:00
Marek Olšák
a650d7068a r300g: extend compile error message 2010-05-23 18:34:04 +02:00
Marek Olšák
7d602b3651 r300g: fix dummy vertex shader compilation 2010-05-23 17:13:31 +02:00
Marek Olšák
98630a900e r300g: fix warnings 2010-05-23 17:13:31 +02:00
José Fonseca
a3ef2fb9c4 llvmpipe: Fill in slice_stride. 2010-05-22 16:14:20 +01:00
Chia-I Wu
e8d8ea2a39 progs: Remove remaining EGL demos.
They have been moved to git+ssh://git.freedesktop.org/git/mesa/demos.
2010-05-21 22:13:32 -06:00
Kristian Høgsberg
ab780bccb7 glx: Invalidate drawable in glXBindTexImageEXT() if we don't get events
When we don't get invalidate events, we need to invalidate a drawable
before using it for tfp to make sure we have uptodate buffers.
2010-05-21 23:24:37 -04:00
Kristian Høgsberg
643b2af020 glx: Split tfp functions out to context vtable
This introduces a new per-context vtable, which lets us clean up all the
#ifdef's a bit and move the DRI2 specific implementation into dri2_glx.c.
2010-05-21 23:24:37 -04:00
Jakob Borncrantz
4db0c76019 st_api: Give get_egl_image arguments directly to the function 2010-05-21 23:29:05 +01:00
Brian Paul
ffd2bc3dfb mesa: fix warnings about missing initializers in get.c table 2010-05-21 14:57:29 -06:00
Brian Paul
0a2e963ce3 st/mesa: remove unused var 2010-05-21 14:57:06 -06:00
Brian Paul
83adf8c3a4 st/glx: fix incorrect parameter type 2010-05-21 14:51:36 -06:00
Jakob Bornecrantz
a93f9f343a gallium: Fix invalidate framebuffer with old libGL libraries 2010-05-21 21:25:07 +01:00
Jakob Bornecrantz
5f66363f8e st_api: Add get param function to st_manager 2010-05-21 21:25:07 +01:00
Jakob Bornecrantz
0853401805 nouveau: Fix build after msaa merge 2010-05-21 21:25:07 +01:00
Brian Paul
7c226d0ab8 mesa: disable building the removed demos with scons 2010-05-21 14:12:16 -06:00
Brian Paul
6af41a5edc mesa: disable building the removed demos
This is a quick fix.
2010-05-21 14:11:42 -06:00
Eric Anholt
1a8b1277c5 Fix test for MESA_LLVM. 2010-05-21 12:20:40 -07:00
Eric Anholt
68fc4b415e Remove demos that have moved to git+ssh://git.freedesktop.org/git/mesa/demos.
The remaining programs are ones I've had difficulty finding a build
environment for to make the build system or are unit tests that should
probably live next to their code instead.  Hopefully people can bring
over the build for remaining pieces they care about.
2010-05-21 12:20:39 -07:00
Roland Scheidegger
e4f4489e3f rbug: fix breakage due to interface changes 2010-05-21 20:52:01 +02:00
Roland Scheidegger
3293bcdc80 Merge branch 'gallium-msaa'
Conflicts:
	src/mesa/state_tracker/st_gen_mipmap.c
	src/mesa/state_tracker/st_texture.c
2010-05-21 20:02:22 +02:00
Patrice Mandin
8504c5d931 nouveau/nvfx: Fill more PIPE_CAP_MAX_ values
Signed-off-by: Patrice Mandin <patmandin@gmail.com>
2010-05-21 19:10:31 +02:00
David Shao
d2fa95a4c0 Add __DragonFly__ in querymatrix for fpclassify()
Signed-off-by: Brian Paul <brianp@vmware.com>
2010-05-21 09:59:52 -06:00
Brian Paul
3bd5888584 progs/tests: print more info in copypixrate.c 2010-05-21 09:58:39 -06:00
Brian Paul
b7f8f176f1 docs: update 7.8.2 relnotes with Cell driver fixes 2010-05-21 09:51:42 -06:00
Brian Paul
2c6882f8c1 cell: assorted compilation fixes 2010-05-21 09:47:00 -06:00
Brian Paul
6e0efad38b cell: fix breakage from earlier draw module changes 2010-05-21 09:36:07 -06:00
Keith Whitwell
519694e0fc gallium: remnants of old ccw state 2010-05-21 16:05:16 +01:00
Keith Whitwell
ef9b4d20d7 Merge branch 'gallium-front-ccw' 2010-05-21 15:41:06 +01:00
Keith Whitwell
0ff2373131 docs: update rasterizer for ccw changes
Also rearrange some of the fields into point/line/polygon categories.
2010-05-21 15:40:36 +01:00
Vinson Lee
0293b1abf5 scons: Remove debug print statement.
Fixes Python IndexError exception with default SCons build.
2010-05-20 21:03:03 -07:00
Eric Anholt
6f77b751b6 Make TLS EGL dri2 driver search path behavior match TLS GLX dri2 behavior. 2010-05-20 14:44:43 -07:00
Eric Anholt
111dce90c1 Fix a substitution in glesv1_cm.pc 2010-05-20 13:57:10 -07:00
Eric Anholt
f716063ad1 i965: remove disabled code for cycling through MRF registers in clipping.
The idea would be that you could have multiple send messages going on
if nothing depended on the previous message's results and you used a
different send message.  The problem is that the later send requires
the VUE handle returned by the first send's allocate anyway.
2010-05-20 13:42:27 -07:00
Xavier Chantry
f2b80e5679 nv50: fixed other void pointer arithmetic errors 2010-05-20 19:47:12 +02:00
Xavier Chantry
828053726b nv50: fix too long shader uploads by splitting them 2010-05-20 19:47:09 +02:00
Christoph Bumiller
9886293eb8 nv50: fill in shader limits 2010-05-20 19:47:01 +02:00
Brian Paul
6ca6189e09 scons: add comments and whitespace 2010-05-20 10:27:12 -06:00
Brian Paul
5c682485b8 scons: fix llvm detection
The test for env['platform'] caused an exception since 'env' is not
defined at that point.  Instead, determine the target platform by
scanning sys.argv[].
2010-05-20 10:27:12 -06:00
Brian Paul
846b2fccc2 gallivm: rename a var: s/val/array_size/ 2010-05-20 10:27:12 -06:00
Brian Paul
3b7914c364 gallivm: fix spelling in comment 2010-05-20 10:27:12 -06:00
Brian Paul
9226d427c3 gallivm: handle pointer types in lp_dump_llvmtype() 2010-05-20 10:27:11 -06:00
Brian Paul
d574ffbb4d llvmpipe: more tweaks to dump_fs_variant_key() 2010-05-20 10:27:11 -06:00
Brian Paul
b2119e4b2f gallium: fix/update tex target dumping 2010-05-20 10:27:11 -06:00
Brian Paul
75189ef960 llvmpipe: use util_dump_logicop() 2010-05-20 10:27:11 -06:00
Brian Paul
df61404dae gallium: added util_dump_logicop() 2010-05-20 10:27:11 -06:00
Brian Paul
c2a036d4ef llvmpipe: put variant print/debug code into separate function 2010-05-20 10:27:11 -06:00
Kristian Høgsberg
e67c338b41 intel: Throttle after doing copyregion/swapbuffers round trip
Before we would throttle in the flush callback prior to round-tripping
to the server to do copyregion or swapbuffer.  Now, instead just note
that we need to throttle and do it in intel_prepare_render(), which
will be called after receiving the response from the server but before
we start rendering the next frame.  Even if the server also throttles
us in swapbuffer, this just makes the throttling a no-op when we hit
intel_prepare_render().  With that we can drop the
using_dri2_swapbuffers hack and just always throttle.
2010-05-20 11:39:28 -04:00
Vinson Lee
f490525685 graw-null: Remove unnecessary header. 2010-05-20 07:36:53 -07:00
Roland Scheidegger
ce65caba84 util: fix obvious util_blitter_copy bugs... 2010-05-19 18:34:01 +02:00
Brian Paul
23808f1b5e nv50: fix typo: s/_/./ 2010-05-19 09:30:35 -06:00
Roland Scheidegger
5be35de0fb util: util_blitter_fill no longer needs to handle overlap 2010-05-19 17:20:26 +02:00
Roland Scheidegger
1adbe2c82d i915g: remove unused flip parameter 2010-05-19 17:14:06 +02:00
Roland Scheidegger
db0ddb7c01 docs: update differences to d3d11 2010-05-18 21:42:09 +02:00
Roland Scheidegger
f4ad68a528 util: fix some leftover util_surface_fill/copy calls 2010-05-18 21:41:15 +02:00
Roland Scheidegger
6f3721a8ec st/mesa: fix wrong argument order 2010-05-18 18:03:37 +02:00
Roland Scheidegger
43234cee40 gallium: implement set_sample_mask() in all drivers
prevents segfault when state trackers try to set default mask.
Other option would be to make this required only for drivers
supporting multisampling, but this seems more clean.
Only dummy implementations (for normal drivers) provided (no driver
supports multisampling yet neither).
2010-05-18 16:20:44 +02:00
Roland Scheidegger
2a15553e43 st/egl: adapt to interface changes 2010-05-17 21:34:30 +02:00
Roland Scheidegger
bf3c8ed481 st/dri: adapt to interface changes 2010-05-17 21:34:03 +02:00
Roland Scheidegger
685bb69416 st/glx: adapt to interface changes 2010-05-17 21:33:53 +02:00
Roland Scheidegger
a127e4709d st/wgl: adapt to interface changes 2010-05-17 21:33:45 +02:00
Roland Scheidegger
c36c3d86b6 st/vega: adapt to interface changes 2010-05-17 21:33:37 +02:00
Roland Scheidegger
48780ec9f9 st/xorg: adapt to interface changes 2010-05-17 21:33:27 +02:00
Roland Scheidegger
8bd87b662f st/python: adapt to interface changes
compile tested only.
Should probably change the python surface_copy/fill functions
also into resource_copy/fill_region functions and adapt the code
using them.
2010-05-17 21:32:41 +02:00
Roland Scheidegger
eb2b668b37 svga: adapt to interface changes
might need further cleanup. Using surfaces internally just to be able to use
the existing code might cause unnecessary copies afaict.
2010-05-17 21:30:01 +02:00
Roland Scheidegger
39b4bf71b5 r300g: adapt to interface changes
might need further cleanup. Using surfaces internally for the u_blitter code
seems nonoptimal.
2010-05-17 21:29:17 +02:00
Roland Scheidegger
b59b23a51d nouveau: adapt to interface changes
this probably needs further cleanup (just getting a surface for the resource
seems quite nonoptimal and potentially cause unnecessary copies I think)
2010-05-17 21:28:14 +02:00
Roland Scheidegger
433701a721 fo: adapt to interface changes 2010-05-17 21:25:27 +02:00
Roland Scheidegger
fd578be828 identity: adapt to interface changes 2010-05-17 21:25:16 +02:00
Roland Scheidegger
bd771cda8e trace: adapt to interface changes 2010-05-17 21:25:07 +02:00
Roland Scheidegger
a02ddd48c5 i965g: adapt to interface changes 2010-05-17 21:24:50 +02:00
Roland Scheidegger
bccf31bf5f i915g: adapt to interface changes 2010-05-17 21:24:04 +02:00
Roland Scheidegger
6c32670706 softpipe: adapt to interface changes 2010-05-17 21:23:46 +02:00
Roland Scheidegger
e121a73d62 llvmpipe: adapt to interface changes 2010-05-17 21:23:31 +02:00
Roland Scheidegger
57a0171225 cell: adapt to interface changes
not even compile tested but fairly trivial
2010-05-17 21:22:23 +02:00
Roland Scheidegger
127328bfad mesa/st: adapt to interface changes
adapt to blit changes, and also handle a bit more msaa state in theory
(incomplete, doesn't handle resolves in any way for now).
2010-05-17 21:19:03 +02:00
Roland Scheidegger
815b75705f gallium/util: adapt util code to interface changes
The util blit functions change their interface (apart from some rename) too
(in particular util_blit_pixels now also takes a pipe_resource as the src blit
argument instead of a surface, as it might just call resource_copy_region).
Maybe the blit util code might need a bit more cleanup, it still doesn't feel
very clean. In particular it seems that util_blit_pixels_tex should probably
disappear, and I think it would be great if the code called by drivers for
blitting (u_blitter.c, which isn't really touched by this change) could somehow
be merged with the u_blit code.
2010-05-17 21:15:20 +02:00
Roland Scheidegger
379db6a36b gallium: clean up resource_copy_region function
Previously, surface_copy was said to allow overlapping blits, and it was
"optional". However, some state trackers actually assumed it is always present,
and quite some code (like in u_blit) assumed overlapping isn't allowed.
Hence, resource_copy_region (and in the same spirit, resource_fill_region) is
now mandatory, but overlapping blits are no longer allowed. A driver can plug
in the cpu fallback util_resource_copy_region if it does not want to provide its
own implementation, though this is not optimal.
2010-05-17 21:02:24 +02:00
Roland Scheidegger
6272d7632a gallium: another interface change for multisampling
due to popular request, use nr_samples parameter in is_format_supported()
instead of new is_msaa_supported() query.
This makes it easily possible to query if a format with a given sample count
is also supported not only as render target, but for sampler views (note that
texture sampling from multisampled resources isn't supported yet).
It is not quite how dx10 format msaa queries work, but we might need to revisit
format queries completely in the future anyway.
2010-05-17 20:52:08 +02:00
Brian Paul
e5ee8b4fae llvmpipe: fix front/back tri culling mix-up 2010-05-17 11:43:43 -06:00
Keith Whitwell
5ebd2fa7da draw: fix front/back error in unfilled pipeline stage 2010-05-14 23:47:05 +01:00
Keith Whitwell
7813d12e05 draw: fix typo checking for unfilled polygons 2010-05-14 23:46:43 +01:00
Keith Whitwell
4ff1274e23 softpipe: restore culling code 2010-05-14 20:36:08 +01:00
Keith Whitwell
9c264642c3 gallium: more work on ccw flag removal
The linux-debug target builds...
2010-05-14 19:20:25 +01:00
Keith Whitwell
0bd1cbcd0d gallium: convert rasterizer state to use gl-style front/back concepts
Use front/back instead of cw/ccw throughout.
Also, use offset_point/line/fill instead of offset_cw/ccw.

Brings gallium representation of this state into line with its main
user, and also what turns out to be the most common hardware
representation.

This fixes a long-standing bias in the interface towards the
architecture of the software rasterizer.
2010-05-14 13:04:42 +01:00
Keith Whitwell
fc4d1b9ba9 util: fix copy_rect stride in default transfer_inline_write 2010-05-14 12:19:28 +01:00
Kristian Høgsberg
52c554a79d egl: Implement EGL_NOK_swap_region
This extension adds a new function which provides an alternative to
eglSwapBuffers. eglSwapBuffersRegionNOK accepts two new parameters in
addition to those in eglSwapBuffers. The new parameters consist of a
pointer to a list of 4-integer blocks defining rectangles (x, y,
width, height) and an integer specifying the number of rectangles in
the list.
2010-05-13 20:30:45 -04:00
Marek Olšák
13ef7a4be8 r300g: fix for piglit/fp-indirections2 2010-05-14 00:27:52 +02:00
Brian Paul
f667526016 rtasm: fix void * / func * casting warnings 2010-05-13 14:15:44 -06:00
Brian Paul
56da0cb7ac draw: silence casting warnings 2010-05-13 14:15:44 -06:00
Brian Paul
415c40735d gallivm: silence uninitialized var warning 2010-05-13 14:15:44 -06:00
Brian Paul
d9096926f8 llvmpipe: silence casting warnings 2010-05-13 14:15:44 -06:00
Brian Paul
17542c1e3e gallivm: silence casting warning 2010-05-13 14:15:44 -06:00
Brian Paul
c91d9cb563 gallivm: silence uninitialized var warning 2010-05-13 14:15:44 -06:00
Brian Paul
77ee438e61 llvmpipe: silence uninitialized var warnings 2010-05-13 14:15:44 -06:00
Brian Paul
966d28cb2e llvmpipe: silence cast warnings in test programs 2010-05-13 14:15:44 -06:00
Brian Paul
45d6289fab gallivm: added lp_dump_llvmtype() debug helper 2010-05-13 14:15:44 -06:00
Brian Paul
adc6e73538 llvmpipe: additional comments 2010-05-13 14:15:44 -06:00
Brian Paul
5b5ce16da5 gallivm: rename a var 2010-05-13 14:15:44 -06:00
Kristian Høgsberg
681fd73f1e egl: Allow a prioritized list of default drivers
When there is no user driver or any matching display drivers we fall
back to the default driver.  This patch lets us have a list of default
drivers instead of just one.  The drivers are loaded in turn and we
attempt to initialize the display.  If it fails we unload the driver
and move on to the next one.

Compared to the display driver mechanism, this avoids loading a number
of drivers and then only using one.  Also, we call Initialize to see
if the driver will work instead of relying on Probe.  To know for sure
that a driver will work, Probe really have to do a full Initialize, so
we will just use Initialize directly.
2010-05-13 16:14:07 -04:00
Kristian Høgsberg
7413d9ae9f egl_dri2: Downgrade initialization errors to warnings
Don't want to shutdown everything if egl_dri2 fails to initialize.
2010-05-13 16:14:07 -04:00
José Fonseca
f19b202556 util: Fix ptr -> int conversion. 2010-05-13 21:14:39 +01:00
José Fonseca
c5c0e0172f Conditionally revert "gallivm: Use a more compact approach for lp_build_broadcast_scalar()."
This reverts commit a09e46c724.
2010-05-13 21:14:39 +01:00
Eric Anholt
c67d9d84f5 i965: Reduce a single GL_QUADS to GL_TRIANGLE_FAN.
This is similar to the GL_QUAD_STRIP -> TRIANGLE_STRIP optimization --
the GS usage to split the quads into tris is a huge bottleneck, so a
quick check improves glean blendFunc time massively (width * height of
the window of single-pixel GL_QUADS, many many times).  This may also
end up helping with cairo performance, which sometimes ends up drawing
a single quad.
2010-05-13 13:02:09 -07:00
Eric Anholt
61aa9c86c2 intel: Don't update window system renderbuffers on TexImage.
While sometimes rendering occurs in the form of blits for TexImage, it
doesn't interact with the window system renderbuffers, so skip it.
2010-05-13 13:02:09 -07:00
Eric Anholt
165694ad65 mesa: Remove no-op wrappers around trig functions. 2010-05-13 13:02:09 -07:00
Eric Anholt
fef303bc94 mesa: Remove _mesa_pow(), which is always just pow(). 2010-05-13 13:02:09 -07:00
Marek Olšák
60a0535101 r300g: fix texture transfers
The regression has first shown up after this state tracker change:
b0427bedde.

FDO bug #28082.
2010-05-13 21:11:20 +02:00
Alan Hourihane
8b3bf9c299 mesa: silence compiler warning 2010-05-13 18:49:02 +01:00
José Fonseca
f379e7df4b llvmpipe: Update instructions for MSVC builds. 2010-05-13 16:18:05 +01:00
Kristian Høgsberg
021a68b7e8 egl: Drop broken _EGL_PLATFORM_NO_OS code
It would do strlen(library_suffix()) in _eglLoaderFile(), with
library_suffix() returning NULL.  So obviuosly not used or tested.
2010-05-13 08:59:56 -04:00
Kristian Høgsberg
41797e1659 egl: Don't try to load driver basename if the platform needs a suffix
That is, don't dlopen(egl_glx) when we know we need to append .so.
2010-05-13 08:28:45 -04:00
Vinson Lee
8230ead0cf trace: Add missing header.
Fixes GCC implicit function declaration warning.
2010-05-13 01:47:31 -07:00
Vinson Lee
3f168eef09 st/mesa: Remove unnecessary header. 2010-05-13 01:37:44 -07:00
Vinson Lee
1775829f8c gallium: Add tokens for Cygwin. 2010-05-13 01:25:07 -07:00
Vinson Lee
65e82f0404 trace: Remove unnecessary headers. 2010-05-13 01:18:35 -07:00
Marek Olšák
0ccc1367d7 r300g: re-order caps 2010-05-13 02:37:56 +02:00
Marek Olšák
dca2a9fcd4 r300g: fill out the shader limits 2010-05-13 02:37:56 +02:00
Jakob Bornecrantz
617c51daf2 trace: Update README 2010-05-12 23:07:17 +01:00
Jakob Bornecrantz
5d2e24fe18 rbug: Update and add READMEs 2010-05-12 23:06:54 +01:00
Jakob Bornecrantz
2ebe0277d4 scons: Add -fvisibility=hidden to CFLAGS for gcc builds 2010-05-12 22:49:32 +01:00
Jakob Bornecrantz
0f9b496916 graw: Make functions public 2010-05-12 22:47:15 +01:00
Jakob Bornecrantz
9f7f711020 rbug: No need to have rbug as a input 2010-05-12 21:12:31 +01:00
José Fonseca
07d741926b gallivm: Ensure PIPE_OS_xxx are defined. 2010-05-12 20:48:27 +01:00
José Fonseca
a09e46c724 gallivm: Use a more compact approach for lp_build_broadcast_scalar().
It produces exactly the same machine code, but it cuts 5% of the
number of instructions generated for a typical shader.

Also, preserve the scalar when length is 1.
2010-05-12 20:40:31 +01:00
José Fonseca
648c9d5247 llvmpipe: Dump fs key's stencil state. 2010-05-12 20:40:14 +01:00
José Fonseca
994e45de49 util: Add function to dump PIPE_STENCIL_OP_xxx 2010-05-12 20:40:07 +01:00
José Fonseca
5326e1846d llvmpipe: Enable mem2reg pass even with LP_DEBUG=nopt.
Otherwise things start crashing.
2010-05-12 20:18:32 +01:00
Jakob Bornecrantz
53cbb81576 rbug: Add to all targets that link against trace
Also added calls to the create function in target helpers and in
tr_drm.c the latter being a hack and should be replaced with the
wrap screen target helper. But at least this way we don't regress.
2010-05-12 20:15:23 +01:00
Jakob Bornecrantz
5494332128 trace: Remove rbug from trace 2010-05-12 20:15:23 +01:00
Jakob Bornecrantz
395e9449ca rbug: Use container of macro 2010-05-12 20:15:23 +01:00
Jakob Bornecrantz
f6946c9214 rbug: Fix draw blocking 2010-05-12 20:15:23 +01:00
Jakob Bornecrantz
73684216ba rbug: Fix sampler views and surfaces in context info 2010-05-12 20:15:23 +01:00
Jakob Bornecrantz
21b668e11e rbug: Fix shaders 2010-05-12 20:15:23 +01:00
Jakob Bornecrantz
2c3fb4ecce rbug: Break out of trace 2010-05-12 20:15:23 +01:00
Brian Paul
92b1908db8 gallivm: additional comments 2010-05-12 12:43:09 -06:00
Brian Paul
c722029f3a llvmpipe: s/bool/boolean/ in test progs 2010-05-12 12:43:09 -06:00
Brian Paul
f81ec062c2 gallivm: s/bool/boolean 2010-05-12 12:43:09 -06:00
Brian Paul
5b876241a0 gallivm: rename vars, update comments, etc 2010-05-12 12:43:09 -06:00
Kristian Høgsberg
880acbe177 egl_dri2: Zero out driver struct
Otherwise testing ->Probe for non-NULL and calling it goes boom.
2010-05-12 14:34:55 -04:00
Corbin Simpson
5f161261c7 r300g: Correct viewport setup for SW TCL.
glxgears now renders in the right place on-screen, although it is still
rather...psychedelic.
2010-05-12 10:16:19 -07:00
Corbin Simpson
3bb1724f37 r300g: Add VBO dumper for SW TCL.
Commented out, not easily enabled. *Very* noisy.
2010-05-12 10:16:19 -07:00
Corbin Simpson
505bea8355 r300g: Immediate mode won't work with SW TCL right now.
This could be done later of course. SW TCL should have a much different
threshold because it's much more worth it.
2010-05-12 10:16:19 -07:00
Corbin Simpson
c037c376fb r300g: Fix indentation. 2010-05-12 10:16:19 -07:00
Brian Paul
fcf532ce6f gallivm: comment out LLVMUnionTypeKind case 2010-05-12 10:54:45 -06:00
Brian Paul
1cd31459af gallivm: rename texel result param
Be clear that this parameter returns four texel channel results.
2010-05-12 10:38:00 -06:00
Brian Paul
0a0d176163 gallivm: add a few comments 2010-05-12 10:38:00 -06:00
Brian Paul
3f6dc8e79d gallivm/llvmpipe: add const qualifiers 2010-05-12 10:38:00 -06:00
Brian Paul
3dcb25364f gallivm: added lp_typekind_name() util function 2010-05-12 10:37:59 -06:00
Brian Paul
6080e567f0 tgsi: also count instructions in tgsi_scan_shader() 2010-05-12 10:37:59 -06:00
José Fonseca
cf9baf68cb llvmpipe: Handle PIPE_CAP_GUARD_*.
Without asserting.
2010-05-12 17:25:17 +01:00
José Fonseca
4c4f98c6fc llvmpipe: Use RAST_WHOLE/EDGE_TEST in more places. 2010-05-12 17:24:34 +01:00
José Fonseca
10fdbb9298 llvmpipe: Move the opaque flag computation into the variant. 2010-05-12 17:12:59 +01:00
José Fonseca
686215d9e5 svga: Advertise shader limits. 2010-05-12 14:11:28 +01:00
José Fonseca
a1b3ca6a14 llvmpipe: Advertise (gallivm's) shader limits. 2010-05-12 14:11:28 +01:00
José Fonseca
7b5931b313 softpipe: Adverstise (tgsi_exec's) shader limits. 2010-05-12 14:11:28 +01:00
José Fonseca
6ac93e469a mesa/st: Expose pipe driver's shader limits. 2010-05-12 14:11:28 +01:00
José Fonseca
bfc702d1e7 gallium: Add new fine grained PIPE_CAP_xx for shader limits.
PIPE_CAP_GLSL and PIPE_CAP_SM3 not removed yet, as opcode support is not
yet covered.
2010-05-12 14:11:28 +01:00
José Fonseca
e1238b5cad gallium: Make PIPE_CAP_xxx enums. 2010-05-12 14:11:28 +01:00
Chia-I Wu
084eadac88 st/egl: Link egl-apis to LLVM when enabled.
This is required when a client API (i.e. OpenGL) uses the draw module.
2010-05-12 15:48:11 +08:00
Chia-I Wu
d9f38e1a71 st/mesa: Do not use draw module in OpenGL ES build.
This removes references to symbols in draw module for OpenGL ES build.
As OpenGL ES does not support feedback/selection mode, draw module is
used in pathes that will never be reached.  However, if the symbols are
referenced, it will bloat the final shared libraries unnecessarily.
This is serious when LLVM is enabled.
2010-05-12 15:46:28 +08:00
Chia-I Wu
87cc2da16e mesa/es: Merge back to core mesa.
With the omit list gone, there are not too many differences in building
core mesa and ES overlay.  Remove the mesa/es and build both of them in
src/mesa/Makefile.
2010-05-12 15:03:42 +08:00
Chia-I Wu
8d5c83c467 mesa/es: Remove omit list.
vbo/vbo_save* are the last members on the omit list.  Test FEATURE_dlist
in the sources and remove the omit list.
2010-05-12 13:50:29 +08:00
Chia-I Wu
eb5100accc mesa: Make FEATURE_ATI_fragment_shader more modular.
This allows atifragshader.h to be used without knowing if
FEATURE_ATI_fragment_shader is enabled.  As a result, atifragshader.c is
removed from the omit list in ES overlay.
2010-05-12 13:46:53 +08:00
Chia-I Wu
82c6c31f55 mesa/es: Remove sources.mak.
All ES overlay sources have been merged into core Mesa.  Not much is
left in sources.mak so merge it into Makefile.
2010-05-12 13:08:09 +08:00
Chia-I Wu
cc289e2221 mesa/es: Update sources.mak and fix the build.
Remove sources that are feature-aware from the omit list.  x86 -O0 build
is ~12KiB smaller afther making those sources feature-aware.

Also, remove get.c from the omit list as get_es[12].c have been merged
to it.
2010-05-12 12:30:22 +08:00
Chia-I Wu
1975208919 st/mesa: Make st_cb_drawtex.h FEATURE_OES_draw_texture aware.
This change allows st_cb_drawtex.h to be used without knowing if
FEATURE_OES_draw_texture is enabled.
2010-05-12 12:12:58 +08:00
Chia-I Wu
278bca0db9 mesa: Add dummy _mesa_lookup_query_object to queryobj.h.
This allows condrender.c to be compiled without FEATURE_queryobj.
2010-05-12 12:12:58 +08:00
Chia-I Wu
e76e17d569 st/mesa: Make st_cb_blit.h FEATURE_EXT_framebuffer_blit aware.
This change allows st_cb_blit.h to be used without knowing if
FEATURE_EXT_framebuffer_blit is enabled.
2010-05-12 12:12:58 +08:00
Chia-I Wu
16775f4951 st/mesa: Make st_cb_queryobj.h FEATURE_queryobj aware.
This change allows st_cb_queryobj.h to be used without knowing if
FEATURE_queryobj is enabled.
2010-05-12 12:12:57 +08:00
Chia-I Wu
bcce57c2e9 st/mesa: Make FEATURE_feedback and FEATURE_rastpos more modular.
Make st_cb_feedback.h FEATURE_feedback aware and st_cb_rastpos.h
FEATURE_rastpos aware.  Move creation of selection/feedback draw context
to st_init_draw.
2010-05-12 12:12:57 +08:00
Chia-I Wu
14a92b26ff st/mesa: Make st_cb_{bitmap,drawpixels}.h FEATURE_drawpix aware.
This change allows st_cb_{bitmap,drawpixels}.h to be used without
knowing if FEATURE_drawpix is enabled.
2010-05-12 12:12:57 +08:00
Chia-I Wu
e33ad4999e st/mesa: Make st_cb_accum.h FEATURE_accum aware.
This change allows st_cb_accum.h to be used without knowing if
FEATURE_accum is enabled.
2010-05-12 12:12:57 +08:00
Chia-I Wu
b093016bd0 mesa: Make FEATURE_EXT_transform_feedback more modular.
This allows transformfeedback.h and st_cb_xformfb.h to be included and
used without knowing if FEATURE_EXT_transform_feedback is enabled.  Fix
build of ES overlay.
2010-05-12 12:12:56 +08:00
Brian Paul
903986ca12 glapi: fix generator scripts w.r.t. GLX_USE_APPLEGL
Commit 80b280db88 changed the .c files
instead of the .py generator scripts.
2010-05-11 21:40:56 -06:00
Brian Paul
6c06e2f053 glapi: added GL_ARB_transform_feedback2 entrypoints 2010-05-11 21:31:08 -06:00
Brian Paul
92a8ba844c progs/tests: disable invalid 3D texture compression tests 2010-05-11 21:27:31 -06:00
Brian Paul
67a27b82f5 progs/tests: fix a couple bugs in the getprocaddress.c test 2010-05-11 21:21:26 -06:00
Brian Paul
2236a301c3 mesa: fix error message strings 2010-05-11 21:13:21 -06:00
Brian Paul
0dc18841f5 progs/tests: update getprocaddress test since moving glapi files 2010-05-11 21:09:20 -06:00
Brian Paul
42d31bf390 mesa: added glGet code for GL_ARB_transform_feedback2 2010-05-11 21:08:08 -06:00
Brian Paul
d6164a2ef3 mesa: remove unused header 2010-05-11 21:07:16 -06:00
Brian Paul
19913a1a7c mesa: remove unused header 2010-05-11 21:07:00 -06:00
Brian Paul
a189b1c53b glew: update to version 1.5.4 2010-05-11 21:06:31 -06:00
Brian Paul
1e0afa695b st/mesa: update query code for transform feedback 2010-05-11 21:04:43 -06:00
Brian Paul
d35c2ca345 docs: update GL3.txt w/ GL 3.3, 4.0 lists 2010-05-11 21:03:53 -06:00
José Fonseca
edbc302ad6 mesa/st+tgsi: Provide a free callback to match with ureg_get_tokens().
This fixes crashes with the memory debugging routines on Windows.

NOTE: This is a candidate for the 7.8 stable branch
2010-05-11 21:27:22 +01:00
Vinson Lee
48f8a76549 autoconf: Also strip '\r' character in version scrape.
Fixes autoconf GCC conftest.c test on Cygwin.
2010-05-11 12:33:30 -07:00
Kristian Høgsberg
199b0894b5 mesa: Optimize get.c by using a table-driven approach 2010-05-11 14:06:22 -04:00
Brian Paul
08e443a1c8 llvmpipe: fix texture image size calculation
We were allocating too much memory for linear layouts.  The block_size
factor is already included in the row_stride and should not be used in
the img_stride calculation.  This is typically a 4x savings!
2010-05-11 11:52:06 -06:00
Brian Paul
fea189d6e4 llvmpipe: add a simple resource tracking/debug feature
If debug build, keep a linked list of all allocated resources (textures).
The llvmipe_print_resources() function can be called from a debugger to
print a list of all resources, their sizes, total size, etc.
2010-05-11 11:52:06 -06:00
Brian Paul
f70d900b80 llvmpipe: remove trailing whitespace, rewrap comment 2010-05-11 11:52:06 -06:00
José Fonseca
30a44ee4c5 scons: Export shouldn't be part of the if stanza. 2010-05-11 17:50:09 +01:00
Vinson Lee
4d374bf7eb st/mesa: Remove unnecessary header. 2010-05-11 09:03:42 -07:00
Kristian Høgsberg
f829e76d88 intel: Don't update renderbuffers in intelSetTexBuffer2 if we have invalidate 2010-05-11 10:32:40 -04:00
Kristian Høgsberg
db2993faa0 intel: Drop viewport hack when we can 2010-05-11 10:23:53 -04:00
Kristian Høgsberg
4258e3a2e1 glx: Provide the __DRI_USE_INVALIDATE extension to the driver when we can
When we have DRI2 protocol at least 2.3, we get an event from the
server when the back buffers get invalidated.  When that's the case
let the driver know that it can rely on invalidate instead of the
glViewport polling.
2010-05-11 10:23:53 -04:00
Kristian Høgsberg
97a6cbc6dd dri_interface.h: Add new __DRI_USE_INVALIDATE extension
The presence of this extension indicates to the DRI driver that the
loader will call invalidate in the __DRI2_FLUSH extension, whenever
the needs to query for new buffers.  This means that the DRI driver
can drop the polling in glViewport().
2010-05-11 10:23:53 -04:00
Michel Dänzer
1f6648418d st/xorg: Fix SCons build. 2010-05-11 16:02:42 +02:00
José Fonseca
b0427bedde mesa/st: Remove internal flushes from Mesa state tracker.
Now that transfers are context operations it is the driver's
responsibility to ensure that transfers happen in order with all other
context operations, so flushes and finishes inside Mesa should be no
longer necessary. The attached patch implements that.

This should proportionate significant improvements for hardware drivers
which are able to stream transfers in the command buffers.

You can use the softpipe/llvmpipe_flush_resource() as reference
implementation of the worst case scenario, where the driver is not able
to streamline transfers. But the expectation is that driver
implementators will want to avoid flushing as much as possible.
2010-05-11 14:00:01 +01:00
José Fonseca
d99a7497ed tests/graw: raw -> graw
for consistency
2010-05-11 07:03:27 +01:00
Vinson Lee
d74f525060 mesa: s/uint/GLuint/ in _mesa_BindTransformFeedback prototype.
From http://www.opengl.org/registry/api/glext.h
GLAPI void APIENTRY glBindTransformFeedback (GLenum target, GLuint id);

Fixes MinGW build.
2010-05-10 22:58:23 -07:00
Chia-I Wu
3ecb8c20f8 gallium: Add llvmpipe support to st/egl.
Update Makefile rules for st/egl.
2010-05-11 12:42:22 +08:00
Brian Paul
fef6e36e07 mesa: more transform feedback infrastructure
Includes GL_ARB_transform_feedback2 which encapsulates transform feedback
state in objects.
2010-05-10 21:11:25 -06:00
Kristian Høgsberg
12bc39f30c intel: Also flush front buffer in glFinish() 2010-05-10 21:10:24 -04:00
Brian Paul
7b937cf47f llvmpipe: enable PIPE_CAP_INDEP_BLEND_ENABLE
This enables the GL_EXT_draw_buffers2 extension.
Tested with progs/tests/drawbuffers2.
2010-05-10 17:04:20 -06:00
Brian Paul
f795735f42 llvmpipe: fix up indexing of blend/colormask state for render targets 2010-05-10 17:04:19 -06:00
Brian Paul
47ecb51eb4 llvmpipe: update image dump/debug code 2010-05-10 17:04:19 -06:00
Brian Paul
bd34f61a7a llvmpipe: add, update, rewrap comments 2010-05-10 17:04:19 -06:00
Brian Paul
e0b5c6f921 gallivm/llvmpipe: move an old comment to a better location 2010-05-10 17:04:19 -06:00
Brian Paul
4e9c3bbc60 st/mesa: rename vars, added comments 2010-05-10 17:04:19 -06:00
Vinson Lee
0bf1ddd60a i915: Drop intelFlush().
This was missed in commit c4775a27e3.
Fixes i915 build.
2010-05-10 15:42:15 -07:00
Kristian Høgsberg
c4775a27e3 intel: Drop intelFlush()
Now that intel_flush() deosn't use the needs_mi_flush argument, we can
finally drop one of the two flush functions.
2010-05-10 17:48:11 -04:00
Kristian Høgsberg
a86e4852f4 intel: Only flush fake front buffer on API level glFlush()
Without this patch, any old intel_flush() call will cause a round trip to
the server and do a copy from fake to real front.  We only actually
guarantee that frontbuffer results show up when glFlush() ia called, so
move the flushing to intel_glFlush().

We also need to flush fake to front before getting new buffers, but
we just handle that manually.
2010-05-10 17:48:11 -04:00
Kristian Høgsberg
d8cfdbe894 intel: Don't mark front buffer dirty if we're only reading
When we call intel_prepare_render() from intelReadPixels(), we'll mark
the front buffer dirty.  That's silly, since we're only reading from it
and marking it dirty will cause us to copy from fake front to front
eventually.

Just clear the dirty flag after doing the read.
2010-05-10 17:48:11 -04:00
Kristian Høgsberg
32942d2b1c intel: Mark frontbuffer dirty in intel_prepare_render()
Now that we have intel_prepare_render() in place, we can use it to mark
the front buffer dirty if we're rendering to the front buffer once we
get there.
2010-05-10 17:48:11 -04:00
Kristian Høgsberg
2d00d16da7 glx: Only call DRI2 invalidate when necessary
We only need this when the server may have swapped the buffers or
when we receive an invalidate event from the server.  The default
behaviour is still that the DRI driver will invalidate its own buffers
when glViewport is called.

https://bugs.freedesktop.org/show_bug.cgi?id=27277
2010-05-10 17:48:11 -04:00
José Fonseca
7c5152c199 svga: Fill in is_resource_referenced callback. 2010-05-10 21:23:39 +01:00
José Fonseca
533ec3f667 gallivm: Silent warning. 2010-05-10 21:23:39 +01:00
José Fonseca
54b94ee96a gallivm: Add missing lvalue. 2010-05-10 21:23:38 +01:00
Brian Paul
3b2bdde1b2 st/mesa: only set prevInstWrotePsiz if translating a vertex program 2010-05-10 12:35:52 -06:00
Brian Paul
adbbaae7b9 st/mesa: additional assertions in dst_register() 2010-05-10 12:35:52 -06:00
Jakob Bornecrantz
a1cc4c1924 i965g: link with software- wrapper winsys and drm api helper 2010-05-10 17:06:02 +01:00
Jakob Bornecrantz
40faa56efb gallium: Add software drm api helper to scons build 2010-05-10 17:06:02 +01:00
Jakob Bornecrantz
8ff59f0987 gallium: Add pipe wrapper software winsys to scons build 2010-05-10 17:06:02 +01:00
Roland Scheidegger
bb7205895e i965g: fix resource creation recursion bug 2010-05-10 17:42:28 +02:00
Roland Scheidegger
804daedd75 i965g: add brw_state_debug.c to SConscript 2010-05-10 17:42:12 +02:00
Roland Scheidegger
433bdb1601 i965g: avoid void * arithmetic 2010-05-10 17:40:44 +02:00
José Fonseca
2e524fd8bc gallivm: Temporarily disable custom LLVMDumpValue on MSVC.
Seeing very weird crashes during std::cout initialization.

The fault probably lies in the way I build LLVM on MSVC, but disable for
now to allow more time to investigate.
2010-05-10 14:43:47 +01:00
José Fonseca
e3205b0540 gallivm: cosf/sinf are macros on MSVC.
So taking the function address does not work.
2010-05-10 08:31:54 +01:00
Vinson Lee
7c5e2672f0 mesa: Update comments in get_gen_es.py. 2010-05-09 22:22:53 -07:00
Brian Paul
e3d8d25ebf swrast: fix 16-bit/channel rendering
NOTE: This is a candidate for the 7.8 stable branch
2010-05-09 22:08:56 -06:00
Brian Paul
9b990c81c0 osmesa: use unsigned 16-bit/channel format 2010-05-09 22:08:33 -06:00
Brian Paul
980df845a3 osmesa: add mapi/glapi to SRC_DIRS to fix build 2010-05-09 21:19:42 -06:00
Brian Paul
969103124b mesa: fix typos, comment in signed 16-bit tex fetch code 2010-05-09 21:19:42 -06:00
Brian Paul
17e9671894 mesa: added unsigned 16-bit/channel tex format 2010-05-09 21:19:42 -06:00
Brian Paul
7a57af6d11 mesa: added comments for signed 16-bit formats 2010-05-09 21:19:42 -06:00
Brian Paul
8ea614832d mesa: use GL_RGBA16_SNORM for accum buffer 2010-05-09 21:19:42 -06:00
Brian Paul
279056f803 mesa: added texstore function for signed 16-bit formats 2010-05-09 21:19:42 -06:00
Brian Paul
6274bb865f mesa: added UNCLAMPED_FLOAT_TO_SHORT macro 2010-05-09 21:19:42 -06:00
Brian Paul
880e04ba74 mesa: add missing cases for signed 16-bit formats 2010-05-09 21:19:41 -06:00
Chia-I Wu
913d7c388d st/mesa: Ignore internal_format in st_context_teximage.
When internal_format and tex->format differ, st_finailize_texture will
surface_copy between surfaces with different formats.  This commit works
around the issue by ignoring internal_format.  A sane fix is needed
here.
2010-05-09 16:23:28 +08:00
José Fonseca
8ad3e0b55d gallivm: Add an alternative to LLVMDumpValue that works with Windows GUI apps. 2010-05-08 23:29:05 +01:00
José Fonseca
08b3179f48 gallivm: Fix mipfiltering with negative lod bias.
In particular, don't use the clamped lod to compute level + 1, or
lod in [-1, 0] range will actually interpolate with level 1.

This makes Mipfilter DCT pass 100%.
2010-05-08 23:29:05 +01:00
José Fonseca
ff7542ab90 gallivm: Actually do floor/ceil/trunc for scalars.
Also start axing the code duplication for scalar case. The olution is to
treat the scalar case specially in a few innermost functions, and leave
outer functions untouched.
2010-05-08 23:29:05 +01:00
José Fonseca
ffebc7f2a7 gallivm: Import the code to compute the minimax polynomials.
It's quite a pain to remember the details after a while, and it is quite
likely we'll want to use this again, either for different polynomial
orders or different functions, so commit it here.
2010-05-08 23:29:05 +01:00
José Fonseca
c376dadbb0 gallivm: Use a minimax polynomial for exp2 in range [0,1] instead [-0.5,5].
The advantage of range[-0.5, 0.5] is that it doesn't require floor (for
which intrinsics are only available in SSE4.1).

But the EXP opcode pretty much forces us to use floor, and there is a
good floor approximation around truncation available anyway.

This fixes EXP failures in VShader DCT.
2010-05-08 23:29:05 +01:00
José Fonseca
de088c6ae4 gallivm: Don't hardcode number of args twice. 2010-05-08 23:29:05 +01:00
Marek Olšák
d044ecbe76 r300g: follow pipe_rasterizer_state::light_twoside 2010-05-08 23:19:33 +02:00
Marek Olšák
084580fa43 r300g: follow pipe_rasterizer_state::point_size_per_vertex 2010-05-08 23:19:30 +02:00
Marek Olšák
34a5109bc2 r300g: move GA_POINT_MINMAX back to rs_state
This basically reverts commit 74f94e8fdf.
2010-05-08 23:03:45 +02:00
Marek Olšák
ceafb391e6 r300g: fix glean/pointSprite using lodbias correction 2010-05-08 23:03:45 +02:00
Marek Olšák
71584d0cc7 r300g: pass depth texture swizzle to the compiler if compare mode is enabled 2010-05-08 23:03:45 +02:00
Marek Olšák
78e881368b r300g: respect compare mode regardless of sampler type 2010-05-08 23:03:45 +02:00
Marek Olšák
e812c0439c r300/compiler: fake equal/notequal for shadow samplers
This is actually better than a real implementation, which would be useless
due to inaccuracy (I know because I've tried to implement it).
2010-05-08 23:03:45 +02:00
Marek Olšák
35a6df5730 r300/compiler: use perspective division only for TXP in shadow samplers 2010-05-08 23:03:44 +02:00
Marek Olšák
0cbe1e6c14 r300/compiler: make shadow sampler codegen more readable, add comments 2010-05-08 23:03:44 +02:00
Marek Olšák
39d0ece5f5 r300/compiler: shorten RC_*SWIZZLE* expressions 2010-05-08 23:03:44 +02:00
Marek Olšák
eb9dc2595f r300/compiler: generalize depth texture mode to support arbitrary swizzles 2010-05-08 23:03:44 +02:00
Marek Olšák
c637f38e70 r300/compiler: fix LIT instruction case 0^0 = 1 2010-05-08 23:03:44 +02:00
Marek Olšák
da180a8d34 r300g: consolidate common render code into one function
This reduces redundant code by moving:
- CS space reservation
- buffer validation
- dirty state emission
- index bias emission
- AOS emission
into r300_prepare_for_rendering.
2010-05-08 23:03:44 +02:00
José Fonseca
e9fc5b463f gallivm: The the JIT engine to use our sinf()/cosf() on Windows.
A quick hack to get the right results, as there are many DCT tests
which use these opcodes to generate data to test other opcodes.
2010-05-08 18:36:22 +01:00
José Fonseca
2d91903882 gallivm: Fix BREAK/CONT translation.
The cont_mask must be restored and exec mask recomputed in order to decide
whether to repeat the loop or not.

Unlike the continue mask, the break_mask must be preserved across loop
iterations.

Fixes several VShader DCT cases, and no regressions with glean.
2010-05-08 16:17:09 +01:00
José Fonseca
852f735236 llvmpipe: Cover more formats in unit test. 2010-05-08 13:18:14 +01:00
José Fonseca
36e28d42b3 gallivm: Fix segfaul when inserting allocas in an empty function. 2010-05-08 13:02:46 +01:00
José Fonseca
2c2debaea7 gallivm: Centralize SoA swizzling into a single place. 2010-05-08 12:52:50 +01:00
José Fonseca
ff6c78f44f gallivm: Support predicates. 2010-05-08 12:50:52 +01:00
José Fonseca
6e47d4f889 llvmpipe: Match p_screen.h's function prototype. 2010-05-08 10:14:35 +01:00
Chia-I Wu
238f782982 Update file list for the tarballs.
Mainly for the recent work on mapi and gles.  The latter adds some
sources to src/mesa/main that are generated on the fly.  This makes
python a requirement for building Mesa.  An alternative is to package
those sources into the tarballs.  That may be done in another commit.
2010-05-08 16:14:52 +08:00
Vinson Lee
cc346b51fa llvmpipe: Remove unnecessary header. 2010-05-08 00:37:38 -07:00
Chia-I Wu
2e3c4e4784 docs: Update EGL and OpenGL ES docs.
Update to reflect recent gles and mapi works.
2010-05-08 14:58:59 +08:00
Chia-I Wu
56530c9097 egl: Build drivers in $(TOP)/$(LIB_DIR)/egl.
There are enough EGL modules that they deserve a subdirectory, to avoid
polluting $(TOP)/$(LIB_DIR).
2010-05-08 14:58:59 +08:00
Chia-I Wu
63ab2509bf gallium: Add egl-apis target.
The new target installs client API modules to EGL_DRIVER_INSTALL_DIR.
They are used by st/egl.

The client APIs are built from OpenGL and OpenVG state trackers.  For
this to work, st/vega is modified to produce a static library,
libvega.a, instead.  st/es is also not needed any more.  It is removed
and --with-state-trackers=es is replaced by --enable-gles-overlay.

As st/egl now has its own client API modules, this solves the ABI issue
between st/egl and client APIs, as long as the client API modules are
distributed with st/egl.  Plus, this allows st/egl to support OpenGL
with non-Gallium libGL.so.
2010-05-08 14:57:21 +08:00
Chia-I Wu
559046e791 mapi: Add install rules for OpenGL ES.
Move the install rules for OpenGL ES from src/mesa/Makefile to mapi.
2010-05-08 14:55:57 +08:00
Chia-I Wu
bc918efb56 mapi: Install .pc file for OpenVG. 2010-05-08 14:55:57 +08:00
Chia-I Wu
b0749fd09b mapi: Update vgapi to build libOpenVG.so.
Unlike the one produced by st/vega, this is a dispatch-only library.
2010-05-08 14:55:57 +08:00
Chia-I Wu
3e1ccb2508 mapi: Merge src/gles/.
Remove src/gles and have mapi/{es1api,es2api} build libGLESv1_CM.so and
libGLESv2.so.
2010-05-08 14:55:57 +08:00
Chia-I Wu
874ccd5d83 Define OpenGL ES and OpenVG library names.
Define <API>_LIB, <API>_LIB_NAME, <API>_LIB_GLOB, and some other
variables in the configs.  Fix a typo in glesv1_cm.pc.in where an
inexistent variable is used.
2010-05-08 14:55:52 +08:00
Chia-I Wu
2773f888dc egl_g3d: Check external modules for client APIs first.
dlopen api_<API>.so before dlopening the process itself in case the
client APIs are implemented in external modules.
2010-05-08 14:54:13 +08:00
Chia-I Wu
e8ba2812e6 egl: Add _eglSearchPathForEach.
The function can be used by a driver to check each search path of EGL.
2010-05-08 14:54:13 +08:00
Brian Paul
74fb08018a gallium/draw: additional comments in the clipping code 2010-05-07 17:13:16 -06:00
Brian Paul
3965bc5d22 mesa: remove driver hooks for GetFloat/Integer/Doublev, etc
Once upon a time some drivers hooked into these for GL_HP_occlusion_test
and GL_OES_read_format.  They're not being used anymore so get rid of them.
2010-05-07 17:10:05 -06:00
Kristian Høgsberg
db178af09d glx: Get GLX_SCREEN first in __glXQueryContextInfo()
And lookup the GLX screen for the context.  Otherwise we'll end up
jumping through a NULL-pointer once we try to look up the visual
or config for the shared context.

https://bugs.freedesktop.org/show_bug.cgi?id=14245
2010-05-07 18:40:54 -04:00
Jon TURNEY
f350b10617 mesa: fpclassify dummy definition is not needed on cygwin
fpclassify is provided by math.h

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Signed-off-by: Brian Paul <brianp@vmware.com>
2010-05-07 14:36:13 -06:00
Brian Paul
12d74d6ba1 tgis: fix SOA aliasing for MUL instruction in SSE codegen
Part of a fix for piglit trinity-fp1 test failure.
2010-05-07 10:40:59 -06:00
Vinson Lee
50c940707e apple: Move glapi to mapi.
This was missed in commit 296adbd545.
Fixes darwin build.
2010-05-06 23:39:33 -07:00
José Fonseca
5065d33276 mapi/glapi: Don't allocate a page for every function on windows. 2010-05-07 07:31:44 +01:00
José Fonseca
5569faf05a mapi: Avoid Data Execution Prevention on windows. 2010-05-07 06:57:11 +01:00
José Fonseca
80c8c891c9 wgl: Add mapi to includes. 2010-05-07 06:45:20 +01:00
Chia-I Wu
de3994076e mapi: Add x86-64 dispatcher. 2010-05-07 10:41:12 +08:00
Chia-I Wu
56eb5d7e85 mapi: Add x86 dispatcher. 2010-05-07 10:41:12 +08:00
Chia-I Wu
75143ef055 st/vega: Use vgapi.
Rename vgFooBar to vegaFooBar and use vgapi as the dispatcher.  This
makes sure there is always a current context when the internal functions
are called.  And eglGetProcAddress is finally supported.
2010-05-07 10:41:12 +08:00
Chia-I Wu
bdc4504252 mapi: Add vgapi.
vgapi is a dispatcher for OpenVG.
2010-05-07 10:41:12 +08:00
Chia-I Wu
d4589d3816 mapi: Add a generic C dispatcher.
The idea is to have an API generate a header using mapi_abi.py.  The API
can then use the header to build a dispatcher.
2010-05-07 10:41:12 +08:00
Chia-I Wu
a73c6540d9 mapi: Add mapi and share the code with glapi.
Specifically, move all or most of

      glapi/glapi.c         to mapi/u_current.c,
      glapi/glapi_execmem.c to mapi/u_execmem.c,
      glapi/glthread.[ch]   to mapi/u_thread.[ch]

and remove their dependencies on core Mesa headers.
2010-05-07 10:41:11 +08:00
Chia-I Wu
296adbd545 glapi: Move to src/mapi/.
Move glapi to src/mapi/{glapi,es1api,es2api}.
2010-05-07 10:41:11 +08:00
Chia-I Wu
73ded0624d glapi: Move assembly dispatchers back into glapi/. 2010-05-07 10:41:10 +08:00
Török Edwin
4d52a25326 gallivm: Require SSE2 for draw_llvm/llvmpipe due to LLVM PR6960.
Note that this also requires X86 for llvm, if llvmpipe/draw_llvm works
on PPC then the condition should be extended to include && x86.

Signed-off-by: Török Edwin <edwintorok@gmail.com>
Signed-off-by: José Fonseca <jfonseca@vmware.com>
2010-05-06 22:43:37 +01:00
Brian Paul
1fce9d58cc softpipe: fix dangling references to shaders in the TGSI executor
If a shader was bound to the fragment shader TGSI executor and it was
then deleted and a new shader was allocated at the same address as the
old shader, the new fragment shader would not get properly bound to
the TGSI machine and we'd wind up using the old one.

This would not have been a problem if shaders were refcounted.

Now the TGSI machine is owned by the context rather than the quad
pipeline's shader stage so that the softpipe_delete_fs_state()
function can access it.

Fixes sporadic failures of the piglit fp-long-alu test (fd.o bug 27989).
2010-05-06 15:19:02 -06:00
Brian Paul
4b274f311c tgsi: make SSE ADD instruction SOA-safe
To properly execute an instruction such as "ADD tmp, tmp.wzyx, foo;"
with SOA we (sometimes) need to put the results into temporaries before
writing the results to the destination register.

This patch fixes the ADD instruction but this needs to be done for
many more instructions.

Helps to fix piglit fp-long-alu test (fd.o bug 27989).
2010-05-06 15:19:02 -06:00
Brian Paul
895ee712ba tgsi: code refactoring 2010-05-06 15:19:02 -06:00
Brian Paul
92d88ccd9a tgsi: added tgsi_get_processor_name() 2010-05-06 15:19:02 -06:00
Brian Paul
c8f0e805a9 tgsi: fix tgsi_exec_machine_bind_shader() to handle NULL tokens, samplers
This lets us unbind a shader from the tgsi_exec_machine.  Since
shaders aren't ref counted we need this to properly clean up when
deleting shaders elsewhere.
2010-05-06 15:19:02 -06:00
Brian Paul
fbb1ad33a4 gallium/tgsi: remove unused tgsi_exec_labels code 2010-05-06 15:19:02 -06:00
José Fonseca
680071502f llvmpipe: Fix fence wait.
Avoids crashing when fence is NULL (LP_NUM_THREADS=0) and leaking when
it is not.
2010-05-06 21:38:06 +01:00
Brian Paul
c37d8259bb st/mesa: fix compressed mipmap generation for small image sizes
When the mipmap level is smaller than the compression block width, height
we need to fill in / replicate pixels so that we don't get garbage values.

Fixes piglit gen-compressed-teximage test.
2010-05-06 14:26:58 -06:00
Brian Paul
4b59d2ba22 st/mesa: fix bug in compute_num_levels()
Fix more fall-out from the "ignore BaseLevel" change.
This may help with fd.o bug 27991.
2010-05-06 14:26:58 -06:00
Brian Paul
9adebe172d st/mesa: when copying mipmap levels between textures, start at BaseLevel
Saves some work and avoids potential issue with inconsistant mipmap
level sizes.  As long as the mipmap levels from BaseLevel to MaxLevel
are consistant, we don't care about the other levels.
2010-05-06 14:26:58 -06:00
José Fonseca
095a6531a2 scons: Disable graw-null on msvc until linkage works. 2010-05-06 21:19:35 +01:00
José Fonseca
f63672c9ab graw-null: Try to fix MSVC linkage problems. 2010-05-06 21:06:53 +01:00
Jakob Bornecrantz
54f95d20e3 es: Ignores 2010-05-06 20:03:51 +01:00
Jakob Bornecrantz
4cad69a31b svga: Fix scons build 2010-05-06 20:03:51 +01:00
Qicheng Christopher Li
86afe8250e llvmpipe: implement occlusion query
OpenGL occlusion queries work now.  The Mesa demos, glean test and piglit
tests all pass.  A few enhancements are possible in the future. -Brian

Signed-off-by: Brian Paul <brianp@vmware.com>
2010-05-06 11:45:45 -06:00
Jakob Bornecrantz
f587615e13 util: Recognize FALSE and F in debug_get_bool_option
Concidering that we actually print FALSE when displaying the
option we should also accept that value.
2010-05-06 15:45:20 +01:00
José Fonseca
7ed2f953c0 gallium: untrack u_indices_gen.c and u_indices_gen.c
These files are built with make and removed with make clean, so it does not
seem necessary to track them.

Looking at the Makefile, it seems that the two u_indices_* files are handled
similarly to u_format_srgb.c u_format_table.c and u_half.c, and these 3
files are already untracked and in .gitignore

Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com>
Signed-off-by: José Fonseca <jfonseca@vmware.com>
2010-05-06 14:23:04 +01:00
José Fonseca
0f4e61d193 raw/clear: Make it portable. 2010-05-06 14:20:28 +01:00
José Fonseca
d5e741d6d8 graw-null: New target to ensure we always have a graw implementation available. 2010-05-06 14:20:13 +01:00
José Fonseca
2b322ad147 graw-xlib: Remove duplicate graw.h file. 2010-05-06 13:08:39 +01:00
José Fonseca
f58d780b08 Revert "gallium: untrack u_indices_gen.c and u_indices_gen.c"
This incomplete patch got commited by mistake.

This reverts commit 2142c769a4.
2010-05-06 12:47:23 +01:00
Xavier Chantry
b0524d3a8f gallium: untrack u_indices_gen.c and u_indices_gen.c
These files are built with make and removed with make clean, so it does not
seem necessary to track them.

Looking at the Makefile, it seems that the two u_indices_* files are handled
similarly to u_format_srgb.c u_format_table.c and u_half.c, and these 3
files are already untracked and in .gitignore

Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com>
Signed-off-by: José Fonseca <jfonseca@vmware.com>
2010-05-06 12:31:39 +01:00
Xavier Chantry
2142c769a4 gallium: untrack u_indices_gen.c and u_indices_gen.c
These files are built with make and removed with make clean, so it does not
seem necessary to track them.

Looking at the Makefile, it seems that the two u_indices_* files are handled
similarly to u_format_srgb.c u_format_table.c and u_half.c, and these 3
files are already untracked and in .gitignore

Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com>
Signed-off-by: José Fonseca <jfonseca@vmware.com>
2010-05-06 12:26:54 +01:00
Jeremy Huddleston
a18702f067 darwin: Fix build
This is a regression from e42d84eaba

https://bugs.freedesktop.org/show_bug.cgi?id=27929

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit 4d63be67f3)
2010-05-05 18:17:45 -07:00
Brian Paul
fca24899cb gallium: still more provoking vertex fixes
This fixes edge flags for polygons and provoking vertex for
filled quads.
2010-05-05 18:46:11 -06:00
Brian Paul
eaad99d230 gallium: added edge flag print/debug code (disabled) 2010-05-05 18:25:19 -06:00
Brian Paul
740e50c60f gallium: rename draw() to draw_elements() in vbuf code
Now we have draw_elements() and draw_arrays() to be consistent with the
pipe_context drawing functions.
2010-05-05 18:19:37 -06:00
Brian Paul
246d39059e llvmpipe: update driver's provoking vertex code
Note that the lp_setup_vbuf.c code is very, very similar to the
corresponding code in softpipe.  It could probably be shared.
2010-05-05 18:19:30 -06:00
Brian Paul
cb136a93ab gallium: rework provoking vertex code
Builds on commit ddb0e18f6c and fixes
regressions in glean clipFlat test.

We assume that Gallium drivers observe flatshade_first for all triangles
and that all the assorted per-triangle calls in the 'draw' module also
follow flatshade_first.  Everything else builds on those rules.

Gallium does not use follow flatshade_first for GL quads, quad strips
and polygons; the "last" vertex is always the provoking vertex for those
prims.  So now there are separate QUAD_FIRST_PV and QUAD_LAST_PV macros
in the draw primitive decomposition code instead of one QUAD macro.
2010-05-05 18:19:06 -06:00
Marek Olšák
a8bb495629 tgsi: make dumping work on non-debug builds 2010-05-05 23:33:44 +02:00
Marek Olšák
0ad541a684 st/mesa: fix per-vertex point size
This fixes FDO bug #27343.
2010-05-05 23:04:44 +02:00
Brian Paul
5c2f6a3e9f llvmpipe: added a new assertion as a hint to Coverity
Looks like coverity found a false positive for an out of bounds array write.
2010-05-05 08:22:12 -06:00
Xavier Chantry
6ddd640365 nouveau: only advertise PIPE_FORMAT_DXT* if s3tc available 2010-05-05 14:39:59 +02:00
José Fonseca
8ddf93e84c graw-xlib: Revert the output dir lib change. 2010-05-05 09:40:59 +01:00
Vinson Lee
e3ce10f7ac st/mesa: Remove unnecessary headers. 2010-05-05 01:14:25 -07:00
Vinson Lee
8191e5ae65 mesa: fpclassify dummy definition not needed on Mac OS X. 2010-05-05 00:49:25 -07:00
Vinson Lee
bc751b5be0 svga: Remove unnecessary header. 2010-05-04 23:06:34 -07:00
Vinson Lee
e768d11ca0 draw: Remove unnecessary header. 2010-05-04 23:04:13 -07:00
Vinson Lee
57f0a25c27 util: Remove unnecessary headers. 2010-05-04 23:02:05 -07:00
Vinson Lee
dbcd5622d5 llvmpipe: Remove unnecessary headers. 2010-05-04 22:57:24 -07:00
Vinson Lee
3234066be2 r300g: Fix memory leak on error path. 2010-05-04 22:55:00 -07:00
Eric Anholt
ce914fff08 i965: When an RB gets a new region, clear the old from the state cache.
This prevents memory usage explosion in blender due to the state cache
hanging on to old fake frontbuffer regions.  Sigh at blender still
using frontbuffer rendering.

Bug #24119.
2010-05-04 22:06:12 -07:00
Eric Anholt
453f0b1f24 intel: Don't tile textures so small that size is blown up by over 2x.
Noted on the mailing list for an app that puts each glyph for its text
into a separate texture.
2010-05-04 22:06:12 -07:00
Chia-I Wu
781d56eac4 progs/egl: Fix eglut with OpenGL ES 2.0.
EGL_OPENGL_ES2_BIT is not set when choosing OpenGL ES 2.0 configs.
2010-05-05 12:29:19 +08:00
Brian Paul
53a53b2549 osmesa: remove unused var 2010-05-04 21:59:54 -06:00
Brian Paul
d148e25953 mesa: remove some color index code 2010-05-04 21:59:54 -06:00
Brian Paul
00b7dcd27a mesa: remove unused renderbuffer adaptor code 2010-05-04 21:59:54 -06:00
Brian Paul
7f07ac80eb mesa: remove renderbuffer adaptor calls
Was only used for OSMesa but no longer needed.
2010-05-04 21:59:54 -06:00
Brian Paul
36b3a8bd5a osmesa: fix OSMesa for CHAN_BITS=32
CHAN_BITS=16 still broken.

NOTE: this is a candidate for back-porting to the 7.8 stable branch.
2010-05-04 21:59:54 -06:00
Chia-I Wu
719f7049bb st/mesa: Fix texture-from-pixmap.
Remember the size of the level=0 mipmap image.  Do not call
util_format_get_component_bits when st_context_teximage is called to
release a texture image.
2010-05-05 11:58:04 +08:00
Chia-I Wu
a6ec153830 mesa: Fix build of ES overlay.
ES overlay is built with FEATURE_ES1 or FEATURE_ES2, and is built
without FEATURE_GL.  Fix the build by always building OpenGL ES sources,
but test for FEATURE_ES1 or FEATURE_ES2.  Also, define symbols that are
missing because FEATURE_GL is not defined.
2010-05-05 11:57:46 +08:00
Brian Paul
b29b27c118 st/mesa: remove commented-out struct field 2010-05-04 21:19:30 -06:00
Brian Paul
382eb1a728 gallium: remove trailing comma in enum list 2010-05-04 21:18:55 -06:00
Brian Paul
791c3395ab mesa: add a dummy definition for fpclassify() if needed 2010-05-04 21:14:42 -06:00
Brian Paul
bef9460dcd mesa: remove trailing comma in enum list
Some compilers complain about this.
2010-05-04 21:12:01 -06:00
Brian Paul
1169d8619a llvmpipe: predicate LLVMDumpModule() on DEBUG_JIT 2010-05-04 20:46:27 -06:00
José Fonseca
b2e343daab tests/raw: Get it building with scons. 2010-05-05 02:39:08 +01:00
José Fonseca
ddb0e18f6c draw: Preserve the provoking vertex both when decomposing and clipping.
Based on John Lawless' feedback.
2010-05-05 00:46:13 +01:00
Brian Paul
dc1c33b448 draw: Adjust wideline vertex coords for D3D. 2010-05-05 00:46:13 +01:00
José Fonseca
f816937d77 scons: Add support for Mingw64. 2010-05-05 00:46:12 +01:00
Brian Paul
c6fdb950e9 st/mesa: need to pass srcLevel to st_texture_image_copy()
Fixes a regression in mipmap setup.
2010-05-04 17:25:36 -06:00
Brian Paul
87022efb4f llvmpipe: fix broken compressed cube maps
When the cube faces were stored in a compressed format, the img_stride
values were wrong and didn't match the per-face size computed in the
tex_image_face_size() function.  This caused bad rendering or segfaults.
2010-05-04 17:17:04 -06:00
Brian Paul
0f0c0368fa gallium/util: added is_format_compressed() 2010-05-04 17:17:04 -06:00
Brian Paul
477b0d838b llvmpipe: do some null pointer checking 2010-05-04 17:17:04 -06:00
Brian Paul
0671c6b589 llvmpipe: add some tests for malloc() returning NULL.
Start propogating NULL pointers from allocation functions and checks for
NULL in the callers...
2010-05-04 17:17:04 -06:00
Brian Paul
2649d64fee progs/demos: set line width back to 1.0 in DrawBox() 2010-05-04 17:17:04 -06:00
Kristian Høgsberg
6a191b2713 glxinfo: Get visual info when an fbconfig has an associated visual 2010-05-04 15:29:25 -04:00
Kristian Høgsberg
9e4f2da848 Fix gles .pc file generation 2010-05-04 14:13:46 -04:00
Kristian Høgsberg
ceffd7b924 Add egl.pc file 2010-05-04 14:13:46 -04:00
Marek Olšák
88512e837e r300g: advertise S3TC only when it's available in Gallium 2010-05-04 20:09:53 +02:00
Wiktor Janas
677a604556 u_blitter: fix creating fragment shaders
See FDO bug #27887.

Signed-off-by: Marek Olšák <maraeo@gmail.com>
2010-05-04 19:56:44 +02:00
Kristian Høgsberg
06c72da97a intel: Update renderbuffers unconditionally in intelSetTexBuffer2() 2010-05-04 13:35:51 -04:00
Brian Paul
2b53f4a9c6 st/mesa: return success/fail from guess_and_alloc_texture()
Before we looked at stObj->pt to see if we may have run out of memory,
but that's not a good indicator.  This fixes the spurious GL_OUT_OF_MEMORY
errors that could arise before.
2010-05-04 10:32:02 -06:00
Brian Paul
c2b47a7557 st/mesa: improved st_texture_image_copy()
No longer need to search for the src mipmap level.
Added assertions.
Updated comments.
Moved debug code into separate function.
2010-05-04 10:29:42 -06:00
José Fonseca
dad962bafe mesa/st: Fill in native program limits.
In the lack of more fine grained capabilities in Gallium, assume that if
the pipe driver supports GLSL then native limits match Mesa software
limits.
(cherry picked from commit 40a90cd11234a09c2477f5c9984dd6d9fac3f52c)
2010-05-04 15:41:19 +01:00
Roland Scheidegger
0ae2f59c02 Merge commit 'origin/master' into gallium-msaa 2010-05-04 15:58:29 +02:00
Kristian Høgsberg
1c920c6176 intel: Enable GL_EXT_framebuffer_object for gles2 2010-05-04 09:22:35 -04:00
José Fonseca
ec43b2eb45 gallivm: Proper implementation of TXL opcode. 2010-05-04 13:51:54 +01:00
José Fonseca
4554cdc289 gallivm: Fix several glitches introduced in the prev commit. 2010-05-04 13:32:40 +01:00
Kristian Høgsberg
2b1f0e17d8 mesa: Forgot to add .pc.in files for gles
Some day I'll grow up and remember to add new files when I commit.
2010-05-04 07:23:30 -04:00
José Fonseca
962558daae gallivm: Implement TXD. 2010-05-04 10:08:10 +01:00
Chia-I Wu
3c6756d6f5 gles: Add -I$(TOP)/include. 2010-05-04 16:00:55 +08:00
Kristian Høgsberg
e83ca4052b mesa: Only initialize TNL for OpenGL 2010-05-03 21:21:58 -04:00
Kristian Høgsberg
208fdac73a mesa: Only initialize save dispatch table for OpenGL 2010-05-03 21:21:58 -04:00
Kristian Høgsberg
642839824e progs/egl/opengles2: Add es2gears demo
Because every subdirectory under progs has to have a version of gears.
2010-05-03 21:21:58 -04:00
Brian Paul
e2ea69afef mesa: increase MAX_DRAW_BUFFERS to 8
Required for GL 3.x
2010-05-03 17:35:40 -06:00
Brian Paul
8b0c217f2b gallium: move surface utility functions into u_surface.c
This is a better place than in u_rect.c
2010-05-03 17:28:32 -06:00
José Fonseca
6c8c88f02f gallivm: Increase the TGSI translation limits and centralize them in a header. 2010-05-04 00:22:16 +01:00
José Fonseca
a9d1a85f81 gallicm: Newton-Raphson step to improve precision.
Disabled as it doesn't make VS/PSPrecision DCT happy, and it would
unnecessarily slow some cases where it is not needed.
2010-05-04 00:22:16 +01:00
Brian Paul
9b02f41cac cso: use framebuffer utility functions 2010-05-03 17:13:21 -06:00
Brian Paul
1fc5a318a6 gallium: move framebuffer utility functions into a new file 2010-05-03 17:08:17 -06:00
Brian Paul
d8306c9caf st/mesa: remove dead code 2010-05-03 16:13:57 -06:00
Brian Paul
295a87f6c2 st/mesa: remove unused needFlush parameter to st_finalize_texture() 2010-05-03 16:13:20 -06:00
Brian Paul
013b332cbc st/mesa: updated comments and fix some formatting in texture storage code 2010-05-03 16:03:19 -06:00
Brian Paul
e79086865b st/mesa: rename srcImageStride -> srcRowStride and fix-up formatting 2010-05-03 15:51:00 -06:00
Brian Paul
c7d1d34c58 st/mesa: consolidate and clean-up texture memory allocation code 2010-05-03 15:48:00 -06:00
Brian Paul
fe3332da78 st/mesa: updated comments for st_texture_image_map() 2010-05-03 15:47:29 -06:00
Brian Paul
41b8a2e939 st/mesa: move some texture size calculation code 2010-05-03 15:39:40 -06:00
Brian Paul
682fec0dca st/mesa: remove old convolution-related vars and min pitch code 2010-05-03 15:35:21 -06:00
Brian Paul
b02619914e st/mesa: remove unsupported convolution code 2010-05-03 15:31:09 -06:00
Brian Paul
babd71ba45 progs/demos: check for GL_ARB_imaging if convolutions is requested 2010-05-03 15:29:02 -06:00
Brian Paul
4b7812919a st/mesa: updated comment 2010-05-03 15:17:38 -06:00
Brian Paul
a12614362a glsl: change variable declared assertion into conditional
The slang_variable::declared field originated as a debug field but
can be promoted for use during sematic error checking.

Fixes fd.o bug 27921.

NOTE: this is a candidate for back-porting to the 7.8 stable branch.
2010-05-03 13:58:53 -06:00
Brian Paul
6405ecb399 Revert "glapi: s/strcpy/strncpy/"
This reverts commit 9446fd8f69.

It doesn't make sense to replace strcpy(a,b) with strncpy(a,b,strlen(b)).
The preceeding code effectively does bounds checking, btw.
2010-05-03 13:16:11 -06:00
Brian Paul
cc67bd8799 st/mesa: remove dead code 2010-05-03 13:11:22 -06:00
Brian Paul
529b7b355d st/mesa: restore original last_layer comparison
Commit e648d4a1d1 changed the original
less-than test to a not-equal test.  This was an effort to save some
memory by switching the texture layout to a non-mipmapped layout when
we mis-guessed about the original layout (thus saving some memory).

However, this causes us to hit a new (apparently broken) code path
when copying the old texture's data to the new texture.  Simply
undo this change for the time being until the other/new bug is fixed.

Fixes fd.o bug 27933.
2010-05-03 13:10:27 -06:00
Marek Olšák
ac6a26b429 r300g: use util_format_short_name and util_format_is_plain 2010-05-03 20:39:43 +02:00
Marek Olšák
5a6b9f3855 util: add util_format_short_name 2010-05-03 20:39:43 +02:00
Marek Olšák
bc3d9a8b18 util: add util_format_is_plain 2010-05-03 20:39:43 +02:00
Marek Olšák
5cdedaaf29 r300g: refuse to create a texture with size 0 2010-05-03 20:39:40 +02:00
Marek Olšák
0bcb4f1001 r300g: improve texture debug output, split into TEX and TEXALLOC flags 2010-05-03 19:29:32 +02:00
Török Edwin
15af543f10 Reorder LLVM passes, running mem2reg earlier.
This gives a ~30% shader optimization time improvement on blender.
Tested by comparing the dumped LLVM modules.
Current ordering:
time ~/llvm-git/obj/Release-Asserts/bin/opt l.bc  -constprop -instcombine
-mem2reg -gvn  -simplifycfg
real    0m1.126s
user    0m1.108s
sys     0m0.012s

With this patch:
time ~/llvm-git/obj/Release-Asserts/bin/opt l.bc -mem2reg -constprop -instcombine   -gvn  -simplifycfg
real    0m0.885s
user    0m0.880s
sys     0m0.000s

The overall improvement in blender is ~15%.
Blender without the patch takes 1m13s:
edwin     5934 87.6 11.5 729440 458296 pts/5   SLl+ 17:35   1:13 blender

Blender with the patch takes 1m3s:
edwin     5726 94.2 11.2 716424 446168 pts/5   SLl+ 17:32   1:03 blender

It is still slow with the patch, but better (most of the optimization time is
taken up by GVN, see LLVM PR7023).

Signed-off-by: Török Edwin <edwintorok@gmail.com>
Signed-off-by: José Fonseca <jfonseca@vmware.com>
2010-05-03 17:01:20 +01:00
José Fonseca
723ab664f6 svga: Silent warning. 2010-05-03 17:01:20 +01:00
Kristian Høgsberg
723511bb32 Generate es glapi files when es1 or es2 is enabled 2010-05-03 08:33:23 -04:00
José Fonseca
9db4a211e9 gallivm: Display message instead of crashing when sampler generator was not supplied for tgsi translation. 2010-05-03 13:18:53 +01:00
Kristian Høgsberg
9ab3df4ebb driswrast: Fix more context creation breakage
Pointed out by Colin Harrison.
2010-05-03 08:01:24 -04:00
José Fonseca
4b891234f8 translate: Make translate_generic truly generic.
PIPE_FORMAT_R10G10B10X2_USCALED, half floats, were not supported, so
just rely on u_format for (almost) universal format support.
2010-05-03 12:18:55 +01:00
José Fonseca
caede7528d draw: Remove draw_pt_fetch_prepare call from llvm middle end.
Unneeded since we code generate the vertex fecthes.
2010-05-03 12:15:32 +01:00
José Fonseca
14a0328d4b tgsi: Parse and dump predicates. 2010-05-03 12:13:54 +01:00
José Fonseca
d288698a76 gallium: Remove loop register file.
It was only used for D3D's REP/END/BGNFOR/ENDFOR. D3D's aL register is
just like another address register now.
2010-05-03 10:53:32 +01:00
José Fonseca
e27983bc08 gallivm: Replace predicate assertion failure with warning message. 2010-05-03 09:54:01 +01:00
José Fonseca
d44c8ee568 draw: Disable rtasm compilation when using LLVM.
Saves time and trouble.
2010-05-03 09:53:12 +01:00
Dave Airlie
738cb50237 nouveau: fix nouveau_create_context decleration 2010-05-03 17:09:54 +10:00
Dave Airlie
e8f48b1dc9 softpipe: invalidate cache view when swizzles are different.
Current code only invalidated if the texture was different, however we
store swizzled values in the cache, so we need to invalidate in that case
also.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-05-03 16:27:42 +10:00
Dave Airlie
26a9b7e4c7 glx: fix regression with GLX_USE_GL
update for fbconfig_style_tags
2010-05-03 16:17:25 +10:00
Zack Rusin
d2b6ed7c4d gallivm: fix nested break and continue statements
we were resetting the mask on each new break/continue statement within
the same scope. we always need to and the current execution mask
with the current break/continue mask to get the correct result (the
masks are always ~1 initially)
2010-05-02 21:40:30 -04:00
Jakob Bornecrantz
c2c1f60391 identity: Move sampler view create and destroy to id_objects.c 2010-05-03 00:27:38 +01:00
Jakob Bornecrantz
59b160d286 identity: s/texture/resource/ 2010-05-03 00:27:37 +01:00
Jakob Bornecrantz
eda7c2506a identity: Whitespace & Style 2010-05-03 00:27:37 +01:00
Jakob Bornecrantz
83a1a0bc3e swrast: Correct include for mtypes.h 2010-05-03 00:27:37 +01:00
Luca Barbieri
d0f9e7521c gallium/util: print \n after DXTn printf
Re-add commit 2d65a7caf9

Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com>
Signed-off-by: José Fonseca <jfonseca@vmware.com>
2010-05-03 00:14:20 +01:00
Xavier Chantry
5362f77b47 llvmpipe: add lp_test_* to .gitignore
Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com>
Signed-off-by: José Fonseca <jfonseca@vmware.com>
2010-05-03 00:13:36 +01:00
José Fonseca
b84590994c svga: Remove the screen private context.
All affected operations have already been moved to context.

More cleanup work can be done, in particular with the buffer transfers.
2010-05-03 00:13:36 +01:00
José Fonseca
49e37469bd svga: Remove empty file. 2010-05-03 00:13:36 +01:00
José Fonseca
7e28479c3a svga: Update flags documentation. 2010-05-03 00:13:36 +01:00
José Fonseca
4885cd4ff7 softpipe: Fix alpha blending for formats without alpha channel.
Don't use the dst alpha channel from the tile cache when it does not
exist in the true format.
2010-05-03 00:13:36 +01:00
José Fonseca
59253a79d8 llvmpipe: Fix alpha blending for formats without alpha channel.
Don't use the dst alpha channel from the swizzled tile when it does not
exist in the true format.
2010-05-03 00:13:36 +01:00
Xavier Chantry
b44c52870d Update drisw state tracker to use new API aware context create
Even though swrast defines its own __DriverAPIRec it still shares the
driCreateNewContext() implementation from dri_util.c.  So the CreateContext
prototypes have to match in the two __DriverAPIRecs.

Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com>
2010-05-02 17:46:43 -04:00
Vinson Lee
6edb18ee35 svga: Include svga_surface.h in svga_screen.c.
Fixes svga_screen_init_surface_functions implicit declaration warning.
2010-05-02 13:34:50 -07:00
Vinson Lee
1a30d98159 r300g: Remove unnecessary header. 2010-05-02 13:30:40 -07:00
Xavier Chantry
38e3fb23da Update dri state tracker to use new API aware context create 2010-05-02 16:27:42 -04:00
Vinson Lee
801dcd9e8f mesa: Include api_exec.h in dlist.c.
Fixes _mesa_alloc_dispatch_table implicit declaration warning.
2010-05-02 13:22:37 -07:00
Marek Olšák
b08b7b7377 r300g: do not validate buffers in check_cs
It's already done in r300_emit_buffer_validate.
This also fixes Total Annihilation 3D on debug builds at least.
2010-05-02 20:59:47 +02:00
Marek Olšák
3b2cf97c5c r300g: fix surface_copy for compressed formats
No accelerated blitting for these, it's too messy.
2010-05-02 20:59:47 +02:00
Kristian Høgsberg
2df3c361ef configure.ac: Fix test for whether to build src/gles 2010-05-02 14:52:39 -04:00
Kristian Høgsberg
aa8606fb23 mesa: Include mfeatures.h before testing feature macros 2010-05-02 14:19:54 -04:00
Kristian Høgsberg
da76a4d845 mesa: Only compile ES files when ES1 or ES2 are selected
This still requieres manual generation of the es1 and es2 glapis and is
disabled by default.
2010-05-02 14:09:52 -04:00
José Fonseca
559d124ed3 mesa: #ifdef out more remap_table related code when disabled.
Seems to get everything building again here.
2010-05-02 16:10:40 +01:00
José Fonseca
316b6fa509 retrace: Add sampler_view_destroy 2010-05-02 15:32:09 +01:00
José Fonseca
db1ed3da6c trace: Fix typo in method name. 2010-05-02 15:32:09 +01:00
Kristian Høgsberg
0870e4a202 Merge branch 'gles2-2'
Conflicts:
	src/mesa/drivers/dri/common/dri_util.h
2010-05-02 10:17:07 -04:00
Kristian Høgsberg
9fd5fa0512 Hook in install rules for es1 and es2 2010-05-02 10:14:53 -04:00
Kristian Høgsberg
74399d4af5 Add glesv2.pc and glesv1_cm.pc pkg-config files for ES 1 and 2 2010-05-02 09:51:13 -04:00
Kristian Høgsberg
a804af2a1e st/mesa: Create context for API_OPENGL as first priority 2010-05-02 09:27:51 -04:00
Marek Olšák
9d33605673 r300g: always set the pitch of the first miplevel in the tiling flags
This further reduces the number of DRM calls and flushes.
2010-05-02 13:27:57 +02:00
Marek Olšák
82027b2027 Revert "r300g: disable point sprites (again)"
This reverts commit 3e0f1719d4.
2010-05-02 12:56:34 +02:00
Marek Olšák
68e720e12d r300g: merge VS output mapping state (VAP) to rasterizer block state (RS)
These two should be tied together because what's set in VAP or stuffed in GA
should be rasterized in RS. Not doing so causes a hardlock.

The reason for the merge is that if stuffed texture coordinates (e.g. point
sprite texgen) happen to occupy the texcoord slot dedicated to fog or wpos,
the two must be relocated to other free slots, which needs remapping the vertex
shader outputs.

The rasterizer code is now literally a sequence read-rasterize-write.
2010-05-02 12:56:34 +02:00
Marek Olšák
35232172db r300g: inline update_derived_shader_state 2010-05-02 12:56:34 +02:00
Marek Olšák
45d79af644 r300g: fix segfault when resizing a DRI2 framebuffer
Resetting tiling flags might happen after a texture is destroyed...
Looking at the kernel sources, we don't actually need to reset the tiling
flags.
2010-05-02 12:56:34 +02:00
Marek Olšák
5c6ea462be r300g: cache tiling flags to reduce the number of DRM calls 2010-05-02 12:56:33 +02:00
Vinson Lee
fc1be4a994 mesa: s/sprintf/_mesa_snprintf/ 2010-05-02 01:03:59 -07:00
Vinson Lee
3c86e2f1dc i965g: s/sprintf/util_snprintf/ 2010-05-02 00:21:04 -07:00
Vinson Lee
f4874705d9 glsl: s/sprintf/_mesa_snprintf/ 2010-05-01 22:01:28 -07:00
Vinson Lee
9446fd8f69 glapi: s/strcpy/strncpy/ 2010-05-01 15:34:47 -07:00
Vinson Lee
70c7531051 llvmpipe: Remove unused variable. 2010-05-01 15:12:45 -07:00
Vinson Lee
33c34c0806 progs/tests: Remove meaningless const qualifiers. 2010-05-01 15:07:45 -07:00
Jakob Bornecrantz
cd502e5f5c swrastg: Use trace 2010-05-01 11:31:59 +01:00
Vinson Lee
19aa77313c progs/demos: Remove meaningless const qualifier in vao_demo.c. 2010-05-01 01:28:06 -07:00
Christoph Bumiller
f5a4d70189 nv50: raise constant buffers size to maximum
Removed the param heaps, haven't been using them for a long
time now.
2010-04-30 22:57:23 +02:00
Christoph Bumiller
75ee309ca9 nv50: relax restriction on surface_copy format equality a bit 2010-04-30 22:50:42 +02:00
Christoph Bumiller
6df1e5c4aa nv50: don't segfault on OPCODE_END for empty programs 2010-04-30 22:50:31 +02:00
Brian Paul
d225221e70 llvmpipe: fix out-of-bounds texture sampling
If we're using a wrap mode in which border color sampling is possible
it means that texcoords may be outside of the texture image bounds.
Fetching the texel may result in a segfault.

Use the 'use_border' variable to catch such texcoords and replace
the texel offset with zero (which will be in bounds).

Fixes segfault in Lightsmark demo, fd.o bug 27877.
2010-04-30 13:59:07 -06:00
Brian Paul
3a757b722d llvmpipe: added lp_build_sample_nop() for debugging 2010-04-30 13:59:07 -06:00
Roland Scheidegger
7662e3519b Merge commit 'origin/master' into gallium-msaa 2010-04-30 15:27:13 +02:00
Brian Paul
7c769bef05 st/mesa: remove unused/disabled code 2010-04-29 15:50:30 -06:00
Brian Paul
421e9aa71c mesa: added _mesa_print_framebuffer() for debugging 2010-04-29 15:50:30 -06:00
Eric Anholt
438f38c55a ir_dead_code: Fix segfault on handling a return statement with no value. 2010-04-29 13:54:19 -07:00
Eric Anholt
ee29b86129 i965: Reject shaders with uninlined function calls instead of hanging.
Most of the failure from using uninlined function calls ends up being
just bad rendering, but nested function calls in the VS currently hang
the GPU, so reject them and explain why.
2010-04-29 13:37:27 -07:00
Eric Anholt
07a248a366 mesa: Don't overwrite a driver's shader infolog with generic failure message. 2010-04-29 13:37:27 -07:00
Jakob Bornecrantz
f7cf8b4658 util: Update caps after helpfull input
In no particular order:
* Make list const
* Add function comments
* Clearly state that demo lists are not complete
* Fix whitespace
* Use __FUNCTION__ instead of __func__
* Add unimplemented check which always fail

Thanks Brian and Keith.
2010-04-29 17:59:47 +01:00
Jakob Bornecrantz
110a956a64 util: Add small caps checker helper 2010-04-29 17:00:21 +01:00
Jakob Bornecrantz
3865e3abd4 util: Format error format string as the rest of the pipe formats 2010-04-29 17:00:21 +01:00
Jakob Bornecrantz
c4e89d130f softpipe & llvmpipe: Enable SM3 cap 2010-04-29 17:00:21 +01:00
Zack Rusin
b7618c89b1 draw llvm: stay in bounds even if fetch_count % 4 != 0
if fetch_count % 4 != 0 then on the last iteration we fetch garbage.
this patch makes sure we stay within bounds
2010-04-29 11:53:32 -04:00
Brian Paul
4ccee74725 cso: remove commented-out code, update function docs 2010-04-29 09:39:17 -06:00
Brian Paul
60a6bfefd1 gallivm: add some assertions in special-case sampler code 2010-04-29 09:39:17 -06:00
Eric Anholt
7d8f0fc282 i965: Fix cube map layouts on Ironlake.
We were doubling up the offsets for the mipmap levels for CPU access.
Instead of reimplementing i945_miptree_layout_2d with 6 cube images
separated by qpitch, share that function and provide the level offsets
later.

Fixes piglit cubemap and fbo-cubemap.
2010-04-29 08:34:15 -07:00
Eric Anholt
d05c35914d i965: Implement VS MAX in a more obvious way.
This should be functionally equivalent, with the possible exception of
NaN handling.
2010-04-29 08:34:14 -07:00
Eric Anholt
084d8fdd36 i965: Use immediate float operands for some VS instructions.
We could use this to reduce constant register pressure, but for now it
makes the resulting program assembly much more readable.
2010-04-29 08:34:14 -07:00
Brian Paul
ba6d8448e1 llvmpipe: fix texture/display target memory leak 2010-04-29 09:10:05 -06:00
Jakob Bornecrantz
366798ac6f st/xorg: Try hard to not touch hardware after dropping the master 2010-04-29 14:27:35 +01:00
Jakob Bornecrantz
d8f09ddf1e st/xorg: Remove save and restore hw state 2010-04-29 14:27:35 +01:00
Jakob Bornecrantz
71d3961a47 st/xorg: Get new connection status from kernel 2010-04-29 14:27:34 +01:00
Chia-I Wu
70ae8bf26f progs/egl: Fix building on cygwin.
Update the Makefiles to use variables such as EGL_LIB_NAME.  Define M_PI
if it hasn't been defined yet.
2010-05-19 13:39:40 -06:00
Chia-I Wu
bc73a6289f egl: Link drivers back to libEGL.
Drivers need symbols from libEGL.  Without back-linking, the build fails
on Cygwin.
2010-05-19 13:38:57 -06:00
Mathias Fröhlich
7f19b65b1a gallium/docs: s/milli/nano/ 2010-05-19 08:48:28 -06:00
Vinson Lee
da34757cd7 graw: Disable build of tests/graw.
The SCons build is failing in src/gallium/tests/graw.
2010-05-19 07:40:57 -07:00
Alan Coopersmith
beb5e1c807 fpclassify is available on C99-compliant Solaris releases too
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2010-05-19 08:29:12 -06:00
Vinson Lee
c85aa99904 util: Remove unused imports from Python scripts. 2010-05-19 06:53:49 -07:00
Vinson Lee
82049b9595 util: Remove unnecessary semicolons in Python scripts. 2010-05-19 06:43:14 -07:00
Keith Whitwell
431a51b9af Merge commit 'origin/graw-tests' 2010-05-19 14:04:16 +01:00
Keith Whitwell
a536c204e2 scons: don't set default_llvm on windows unles LLVM is defined
Otherwise we'll raise an error later in llvm.py
2010-05-19 13:36:05 +01:00
Michal Krol
5a5a82d7e8 softpipe: Calculate slice_stride field in get_transfer(). 2010-05-19 08:23:33 +02:00
Michal Krol
83826dac9b tgsi: Implement OPCODE_DIV. 2010-05-19 08:23:33 +02:00
Kristian Høgsberg
4cd259ca59 dri2_glx: Put the invalidate b/c code back in
The backwards compatibility code calls the DRI driver invalidate hook
on swap buffer and flush front buffer.  This lets the DRI driver rely
on invalidate callbacks and drop the glViewport() hack, even if the
server doesn't send invalidate events.  This is essentially a revert
of 2d00d16da7, except that we now also
pass the __DRI_USE_INVALIDATE extension even when the server doesn't
have DRI2 invalidate events.
2010-05-18 22:58:01 -04:00
Kristian Høgsberg
c8f407bcec dri2_glx: Terminate loader extension list outside #ifdef 2010-05-18 22:58:01 -04:00
Nicolai Hähnle
1712643a29 r300/compiler: Implement constant folding
Signed-off-by: Nicolai Hähnle <nhaehnle@gmail.com>
2010-05-19 03:15:25 +02:00
Tom Stellard
19ea2eae91 r300/compiler: Emit 0.5 swizzle when necessary.
Signed-off-by: Marek Olšák <maraeo@gmail.com>
2010-05-19 03:08:50 +02:00
Eric Anholt
81951393e1 i965: Remove constant or ignored-by-hw args from FF sync message setup. 2010-05-18 15:08:17 -07:00
Eric Anholt
dfb7b86e63 i965: Revert accidental debug change in 562e2d114e 2010-05-18 10:12:20 -07:00
Michel Dänzer
b0ba8d6f80 st/xorg: Don't advertise DRI2 version we don't actually support yet.
Fixes DRI2 initialization with current xserver Git.
2010-05-18 17:14:47 +02:00
Zou Nan hai
0f88ce1b0a gen6 fix: fix a wrong bit in binding_table_pointer 2010-05-18 16:07:03 +08:00
Eric Anholt
64f5e9059b i965: Fix point coordinate replacement after airlied's ffvertex changes.
This basically restores the previous state, where a vertex result slot
is set up for the texcoord to be replaced with point coord.  Fixes
piglit point-sprite test.

Bug #27625
2010-05-17 17:47:07 -07:00
Eric Anholt
b8b2670fef i965: Add SF program disasm under INTEL_DEBUG=sf. 2010-05-17 17:47:07 -07:00
Jakob Bornecrantz
b3f625f5e4 llvmpipe: Fix link order for test apps
When linking with --as-needed libgallium.a can't find the dl* symbols from
-ldl since order matters more with --as-needed.

Thanks to Nirbheek Chauhan and Adam Jackson
2010-05-17 22:33:35 +01:00
Kristian Høgsberg
2386d41648 intel: Call intel_draw_buffer() again after _mesa_make_current()
The initial call to intel_draw_buffers() happens when
intel->ctx.DrawBuffer is still NULL.  Call it again after
calling _mesa_make_current().

https://bugs.freedesktop.org/show_bug.cgi?id=28112
2010-05-17 16:50:44 -04:00
Corbin Simpson
bb81f65b18 gallium/docs: Fix missing ref.
Can't ref in the middle of a paragraph.
2010-05-17 12:58:29 -07:00
Corbin Simpson
f1cf6b0d37 gallium/docs: Update for timer queries. 2010-05-17 12:05:18 -07:00
Mathias Fröhlich
cdbd5f4203 gallium: EXT_timer_query support.
Signed-off-by: Corbin Simpson <MostAwesomeDude@gmail.com>
2010-05-17 12:05:18 -07:00
Corbin Simpson
fea91ee22d r300g: Add RS block dump.
Shows what's actually going on in the RS block.
2010-05-17 12:01:16 -07:00
Brian Paul
ddf09d20df st/mesa: call st_flush_bitmap_cache() from st_readpixels()
Fixes regression from commit b0427bedde.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2010-05-17 12:43:50 -06:00
Brian Paul
92f88c746c rbug: remove extra semicolon 2010-05-17 12:43:50 -06:00
Eric Anholt
f0fb3aa5d4 i965: Make rasterization of single and multiple quad prims match.
This is trying to follow the spirit of the invariance rules, though
they're not specific on this point.  Fixes quad-invariance piglit test
while retaining the 22s -> 18s win on glean blendFunc.

This was a regression in c67d9d84f5.
2010-05-17 10:42:25 -07:00
José Fonseca
32a7209c0a gallivm: Tweak ret_mask handling. 2010-05-17 15:22:48 +01:00
Zack Rusin
0b7ca2f8fc gallivm: implement function calls by inlining
with this approach we inline the entire function body in the caller
2010-05-17 09:55:23 +01:00
José Fonseca
7234dc19af i965g: Fix printf format specifier. 2010-05-17 09:54:28 +01:00
Eric Anholt
df3590f570 i965: Remove the half-baked code for multiple OQs at the same time.
GL doesn't actually let you begin an OQ while one is active, so the
extra work was pointless.
2010-05-16 15:34:37 -07:00
Eric Anholt
3d8ed332df i965: Remove unused occlusion query struct field. 2010-05-16 15:34:36 -07:00
Tom Stellard
9d3c57281e r300/compiler: fix peephole optimizer
Tested-by: Marek Olšák <maraeo@gmail.com>
2010-05-16 20:20:55 +02:00
Nicolai Hähnle
997f2eac5e r300/compiler: Implement simple peephole optimizer
Signed-off-by: Nicolai Hähnle <nhaehnle@gmail.com>
2010-05-16 20:15:53 +02:00
Marek Olšák
0b94c05c28 r300g: implement flush+sync (AKA glFinish)
See comments in the code.
2010-05-16 19:31:23 +02:00
Marek Olšák
581be86342 r300g: expose radeon_bo_wait to the driver 2010-05-16 19:18:10 +02:00
Marek Olšák
06d4339716 r300g: remove unused winsys entrypoints 2010-05-16 19:18:10 +02:00
Jakob Bornecrantz
c882c310cc sw/wrapper: Implement dt_get_handle 2010-05-16 12:22:19 +01:00
Jakob Bornecrantz
d294c349d5 sw/wrapper: Make sure targets are textures 2010-05-16 12:22:19 +01:00
Jakob Bornecrantz
2db4ee0438 i965g: Fix return for resource_get_handle 2010-05-16 12:22:19 +01:00
Marek Olšák
c1ef21833a r300g/swtcl: put emitting max index to the right place
This fixes CS rejections in openarena.
2010-05-16 05:29:58 +02:00
Marek Olšák
412cdcd479 r300g/swtcl: flush draw to avoid the rejection of CS 2010-05-16 04:10:50 +02:00
Marek Olšák
01e5a73b57 r300g/swtcl: update PSC only once when a shader is changed 2010-05-16 04:10:00 +02:00
Marek Olšák
dca9624201 r300g/swtcl: call update_derived_state only once per draw-call 2010-05-16 04:10:00 +02:00
Vinson Lee
7672305da5 st/xlib: Remove unnecessary header. 2010-05-15 18:48:53 -07:00
Vinson Lee
e9072dcd31 st/xorg: Remove unnecessary header. 2010-05-15 18:44:58 -07:00
Vinson Lee
1d6a6d96ae mesa: Remove unnecessary header. 2010-05-15 18:41:52 -07:00
Vinson Lee
b224264c9d r300g: Move code after declarations.
Fixes SCons build.
2010-05-15 17:44:08 -07:00
Marek Olšák
ee6255052c r300g/swtcl: fix provoking vertex 2010-05-16 00:35:51 +02:00
Marek Olšák
87547ac70c r300g/swtcl: fix point sprite texgen (do it in HW) 2010-05-16 00:21:53 +02:00
Marek Olšák
6a0ec833e4 r300g/swtcl: disable converting points/lines to triangles 2010-05-16 00:06:21 +02:00
Marek Olšák
0ab72a5a0a r300/compiler: silence a warning 2010-05-15 23:53:04 +02:00
Marek Olšák
f86ac27bf9 r300g: fix psychedelic colors with SWTCL
r300_vertex_shader::outputs was uninitialized.
Also remove the tokens parameter.
2010-05-15 22:55:17 +02:00
Marek Olšák
cf5dff1f23 r300g: the vertex_stream_state atom for SWTCL should be static
plus whitespace and comment fixes.
2010-05-15 22:27:27 +02:00
Marek Olšák
04882a2947 r300g: remove unused struct r300_vertex_info 2010-05-15 22:15:56 +02:00
Marek Olšák
95ba021105 r300g: fix emission of some non-CSO atoms at the beginning of CS 2010-05-15 21:22:23 +02:00
Marek Olšák
af87ef10dc r300g: remove unused r300_query::active 2010-05-15 19:39:57 +02:00
Marek Olšák
251fae69e5 r300g: fix BO space accounting for occlusion queries 2010-05-15 19:39:57 +02:00
Marek Olšák
00704370e4 r300g: forbid overlapping queries and print error messages 2010-05-15 19:39:11 +02:00
Marek Olšák
16690366e6 r300g: rename a few emit_query functions 2010-05-15 19:38:28 +02:00
Marek Olšák
6c3afad62b r300g: silence warnings 2010-05-15 19:33:39 +02:00
Vinson Lee
6440dcea21 llvmpipe: Remove unnecessary headers. 2010-05-15 08:38:00 -07:00
José Fonseca
55b5806e36 util: Remove unused cruft. 2010-05-15 11:52:03 +01:00
José Fonseca
8a3bcba12c llvmpipe: Use GALLIVM_DEBUG opt where applicable. 2010-05-15 11:48:39 +01:00
José Fonseca
e7c0b4de17 draw: Use GALLIVM_DEBUG opt. 2010-05-15 11:43:16 +01:00
José Fonseca
145fd48b37 gallivm: Centralize some of the LLVM debugging options. 2010-05-15 11:42:02 +01:00
José Fonseca
263e038431 gallivm: Temporarily remove function call support
Commits moved to the gallivm-call feature branch for further
experimentation and stabilization.
2010-05-15 11:31:10 +01:00
Zack Rusin
af75bb4c98 gallivm: use our util_snprintf 2010-05-15 01:24:00 -04:00
Zack Rusin
7458928370 gallivm: implement function calls 2010-05-15 00:58:57 -04:00
Zack Rusin
b93fa7e2e8 vpglsl: add some simple tests with function calls 2010-05-15 00:58:43 -04:00
Eric Anholt
4e84dc8729 i965: Set the correct provoking vertex for clipped first-mode trifans.
Bug #24470: glean clipFlat test.
2010-05-14 15:37:24 -07:00
Brian Paul
18ed479119 gallivm: added some vector length sanity checks 2010-05-14 13:23:41 -06:00
Brian Paul
11b7c4b1ac gallivm: added lp_sizeof_llvm_type() 2010-05-14 13:23:41 -06:00
Brian Paul
9a0ff95425 gallivm: comments, const qualifiers 2010-05-14 13:23:41 -06:00
Brian Paul
85c6799f6e tgsi: clean up in emit_fetch() 2010-05-14 13:23:41 -06:00
Brian Paul
16f8df893c mesa: more info in glUniform error messages 2010-05-14 13:23:41 -06:00
Brian Paul
e22e65d223 mesa: silence void * / func * conversion warnings 2010-05-14 13:23:41 -06:00
Brian Paul
d1f76b1d85 tgsi: add a dummy function to silence warning 2010-05-14 13:23:41 -06:00
Brian Paul
48d3988b82 mesa: enum bitfields are a gcc-only feature, use GLubyte 2010-05-14 13:23:41 -06:00
Kristian Høgsberg
5dc0f49084 egl: Implement EGL_NOK_texture_from_pixmap
This extension allows a color buffer to be used for both rendering and
texturing.  EGL allows the use of color buffers of pbuffer drawables
for texturing, this extension extends this to allow the use of color
buffers of pixmaps too.
2010-05-14 14:47:54 -04:00
Kristian Høgsberg
554e4fc26a egl: Only allow valid config attributes in _eglParseConfigAttribList()
Passing 0x3030, 0 in the chooser list didn't get caught.
2010-05-14 14:47:54 -04:00
Eric Anholt
c1423e34f9 i965: Add program dumping for INTEL_DEBUG=gs. 2010-05-14 11:27:59 -07:00
Eric Anholt
1c25353bc6 i965: Parse the ff_sync URB send opcode on Ironlake disasm. 2010-05-14 11:27:59 -07:00
Eric Anholt
f5bd48cf67 i965: Use R16G16B16A16_FLOAT for 3-component half-float.
The RGBX version isn't supported as a vertex input type, but since we
force the last channel's value anyway, this should be fine.  The only
potential risk I see is in the limiter on VBO reads past the end of
the buffer forcing the whole vertex to 0 when the A channel lands past
the end.

Fixes piglit draw-vertices-half-float.
2010-05-14 11:27:59 -07:00
Eric Anholt
36eda76fea i965: Dump out the correct shared function for SEND on Ironlake. 2010-05-14 11:27:59 -07:00
Eric Anholt
562e2d114e i965: Support INTEL_DEBUG=clip to dump the clip program. 2010-05-14 11:27:59 -07:00
Eric Anholt
7554b83a21 intel: Handle arbitrary compressed formats in intel_compressed_num_bytes.
Note that we don't support arbitrary block size for compressed quite
yet -- block height of 4 is hard-coded all over the place.

Bug #27098 (srgb dxt1 producing a bytes per pixel of 0).
2010-05-14 11:27:59 -07:00
Marek Olšák
07ff65925f gallium: remove forward declarations of non-existent objects 2010-05-14 19:00:56 +02:00
Marek Olšák
93c997a914 r300g: do not abort if a constant buffer is too large
What else can we do with misbehaving apps?
2010-05-14 19:00:55 +02:00
Marek Olšák
fc11653c2b r300g: add framebuffer state debug logging 2010-05-14 19:00:55 +02:00
Marek Olšák
5a397d8e9f r300g: sort out debug flags 2010-05-14 19:00:55 +02:00
Brian Paul
e6a7ee7fbb egl: remove duplicate ARRAY_SIZE() macro declaration 2010-05-14 10:55:19 -06:00
Brian Paul
ffae54ec15 glxinfo: add queries and reporting for float and sRGB buffer types
Check for the GLX_ARB_fbconfig_float and GLX_NV_float_buffer extensions
to determine if color bufs are floating point.

Check for the GLX_EXT_framebuffer_sRGB extension to determine if the
framebuffer is sRGB capable.

Increase field size for some attribs (visual ID and buffer size) to
accomodate today's larger values.

Also print missing caveats info in verbose mode.
2010-05-14 10:55:19 -06:00
Patrice Mandin
33c08202a1 nouveau/nvfx: Define some capabilities for shaders
Signed-off-by: Patrice Mandin <patmandin@gmail.com>
2010-05-14 18:53:05 +02:00
Vinson Lee
12297f1f98 egl: Silence uninitialized variable warnings. 2010-05-14 08:59:42 -07:00
Brian Paul
1fbb50b740 mesa: print enum name instead of hexadecimal value in glGet errors 2010-05-14 08:25:25 -06:00
Brian Paul
39c13a115e mesa: another transform feedback error check, 80-col wrapping 2010-05-14 08:17:02 -06:00
Alex Kozlov
34c20fd4f5 mesa: fpclassify dummy definition is not needed on FreeBSD. 2010-05-14 06:16:14 -07:00
Keith Whitwell
c7ac03d396 graw: add quad-tex graw test for basic texturing 2010-05-14 12:19:57 +01:00
Keith Whitwell
15321a55e5 graw: combine graw_init and graw_create_window functions
Different environments seem to want to create these in different
orders.  Abstract over this by combining the calls.
2010-05-14 12:19:57 +01:00
Keith Whitwell
c267514470 graw: split util code into new file 2010-05-14 12:19:57 +01:00
Keith Whitwell
7375d7a5c9 graw: move towards glut-like interface, add tri.c 2010-05-14 12:19:57 +01:00
Keith Whitwell
39087f636a scons: add 'targets' variable, for specifying ... targets
Ideally scons should be able to work backwards from the list of
targets to figure out which drivers, state trackers and other
convenience libraries need to be built.
2010-05-14 12:19:57 +01:00
Michel Dänzer
7327a84b18 gallium/draw: Fix PPC compiler warning. 2010-04-29 10:05:49 +02:00
Michel Dänzer
63d1134c86 gallium/draw: Fix PPC build failure. 2010-04-29 10:05:48 +02:00
Marek Olšák
9be226c8b5 r300g: fix compiler error
Ouch.
2010-04-29 07:32:56 +02:00
Marek Olšák
18a5da7a65 r300g: use the enum for color swizzles in the rasterizer 2010-04-29 07:18:37 +02:00
Marek Olšák
04c1536bf7 r300g: rasterizer debug logging 2010-04-29 06:57:08 +02:00
Marek Olšák
9dd06b8da4 r300g: fix tests/yuvrect and possibly even rendering to YUV textures 2010-04-29 05:26:41 +02:00
Marek Olšák
2ba0c64c26 r300g: enable the RGBA16F renderbuffer too 2010-04-29 05:07:23 +02:00
Marek Olšák
195160f8e9 r300g: enable float textures
We still need to wait for state tracker support.
2010-04-29 05:00:17 +02:00
Marek Olšák
3b667700a5 r300g: compose swizzles from texture formats and sampler views 2010-04-29 04:39:19 +02:00
Ian Romanick
a2c6df5566 Track and print user defined structure types 2010-04-28 18:22:54 -07:00
Ian Romanick
36d8a64a95 IR print visitor: Move logic for printing the whole program to _mesa_print_ir 2010-04-28 18:22:54 -07:00
Ian Romanick
7d82c765a8 IR print visitor: Just print the name of structures
Treat structure types like other non-array types.  We'll have to print
the structure defintion elsewhere.
2010-04-28 18:22:54 -07:00
Eric Anholt
35e8e461ca ir_function_inlining: Handle inlining of structure dereferences. 2010-04-28 18:22:54 -07:00
Eric Anholt
c0bfe8723e Correctly handle remapping of array dereferences if ->var is a variable. 2010-04-28 18:22:54 -07:00
Ian Romanick
c824e35dd0 Begin handling some varieties of invalid declarations 2010-04-28 18:22:54 -07:00
Ian Romanick
ab89927a91 Reject conflicting struct declarations, generate struct constructor 2010-04-28 18:22:54 -07:00
Ian Romanick
82baaf4283 glsl_type::generate_constructor_prototype now generates the function too
Also, change the name of the method to generate_constructor.
2010-04-28 18:22:54 -07:00
Ian Romanick
85ba37b97d Always return a value from ast_type_specifier::hir 2010-04-28 18:22:54 -07:00
Ian Romanick
8bec5e92e0 Support structures in glsl_type::generate_constructor_prototype 2010-04-28 18:22:54 -07:00
Ian Romanick
ae000fcb2e Implement structures and arrays in ir_dereference::is_lvalue 2010-04-28 18:22:54 -07:00
Ian Romanick
73986a7a26 Ensure that structure fields have non-NULL types 2010-04-28 18:22:54 -07:00
Ian Romanick
1d28b617ba Ensure that anonymous structures have non-NULL names 2010-04-28 18:22:54 -07:00
Ian Romanick
6efaeeea44 Convert structure field dereferences to HIR 2010-04-28 18:22:54 -07:00
Ian Romanick
7ee79fb6b7 Add ir_dereference constructor for structure field dereferences 2010-04-28 18:22:54 -07:00
Ian Romanick
8f755dcb67 Add glsl_type::field_type
Query the type of a structure field
2010-04-28 18:22:54 -07:00
Ian Romanick
3455ce6144 Begin converting structure definitions to IR 2010-04-28 18:22:53 -07:00
Ian Romanick
1f959ab4d6 Use IDENTIFIER instead of TYPE_NAME for structure names
Since there is no track of which names are structure names during parsing,
TYPE_NAME cannot be produced by the lexer.  Use IDENTIFIER and let the AST
processor sort it out.
2010-04-28 18:22:47 -07:00
Marek Olšák
95bfc8f325 r300g: init s3tc fetching functions 2010-04-29 03:18:42 +02:00
Kenneth Graunke
bf783ecea6 ir_reader: Slightly better error message when failing to read swizzles. 2010-04-28 18:14:54 -07:00
Kenneth Graunke
92eb64cd33 ir_reader: Don't print out the S-Expression.
It's no longer useful for debugging.
2010-04-28 18:14:54 -07:00
Kenneth Graunke
b51557fbe2 ir_reader: Read function calls. 2010-04-28 18:14:54 -07:00
Kenneth Graunke
b142aeeb20 ir_reader: Replace function prototypes with the definition.
Previously, we just created a new one, which was wrong.
2010-04-28 18:14:54 -07:00
Kenneth Graunke
21128c23c6 ir_reader: Fix incorrect error message for expressions. 2010-04-28 18:14:54 -07:00
Kenneth Graunke
46a223224c Make ir_read_error print out the given S-Expression, for context. 2010-04-28 18:14:54 -07:00
Kenneth Graunke
951632253f ir_reader: Fix for swizzles. 2010-04-28 18:14:54 -07:00
Kenneth Graunke
8df335d7f9 ir_reader: Preliminary work toward reading functions. 2010-04-28 18:14:54 -07:00
Kenneth Graunke
09cad1339d ir_reader: Perform a preliminary pass to scan for function prototypes. 2010-04-28 18:14:54 -07:00
Kenneth Graunke
ddf5a011e2 ir_reader: Don't initialize globals, builtins, or constructors.
All of these are currently emitted as part of the IR, so by initializing
them, we actually end up with two copies.  For constructors, we may
eventually wish to avoid emitting them as part of the IR output.
2010-04-28 18:14:54 -07:00
Kenneth Graunke
4ec982fb86 Make ir_read_error set state->error. 2010-04-28 18:14:54 -07:00
Kenneth Graunke
396fa9eba6 ir_reader: Add support for "break" and "continue" in loops.
Includes threading the ir_loop * context through various functions.
2010-04-28 18:14:54 -07:00
Kenneth Graunke
32b305207c ir_reader: Add initial loop support; doesn't yet support break/continue. 2010-04-28 18:14:54 -07:00
Kenneth Graunke
451381c220 ir_reader: Add support for reading (var_ref ...) and (array_ref ...) 2010-04-28 18:14:54 -07:00
Kenneth Graunke
46ef8f19d7 ir_reader: rvalues are instructions too! 2010-04-28 18:14:54 -07:00
Kenneth Graunke
3ea0582803 ir_reader: Add support for reading conditionals: (if ...) 2010-04-28 18:14:54 -07:00
Kenneth Graunke
5794497542 ir_reader: Add support for reading array types.
Also, constify glsl_type pointers; this was necessary to use
glsl_type::get_array_instance.
2010-04-28 18:14:54 -07:00
Kenneth Graunke
9d2ff7617a ir_reader: Add support for reading (return ...) 2010-04-28 18:14:54 -07:00
Kenneth Graunke
d1d2ada3c6 ir_reader: Add support for reading variable declarations.
It also now reads a list of instructions, as it should, rather than a
single rvalue.
2010-04-28 18:14:54 -07:00
Kenneth Graunke
f955649af3 Partial IR reader.
Currently reads assignments, constants, expressions, and swizzles.
2010-04-28 18:14:53 -07:00
Kenneth Graunke
e8b399270d Set language_version to 130 (the max currently supported) when reading IR.
This is necessary so _mesa_glsl_initialize_types can create appropriate
glsl_types and add them to the symbol table.

In the future, we'll want to set it to the max GLSL version supported by
the current driver.
2010-04-28 18:14:53 -07:00
Kenneth Graunke
34350be2cd Add stub ir_reader and new 'i' mode for reading IR rather than GLSL. 2010-04-28 18:14:53 -07:00
Kenneth Graunke
1bfe1c3fdd Add a simple S-Expression reader and printer. 2010-04-28 18:14:36 -07:00
Kenneth Graunke
9d290d786d Use "neg" when printing/reading unary negation rather than "-".
"-" is now only used for binary subtraction.
2010-04-28 15:42:07 -07:00
Kenneth Graunke
3b96996b7e Move array of operator strings out of ir_print_visitor.cpp.
Also implement a reverse-lookup function for use in the IR reader.
2010-04-28 15:42:07 -07:00
Kenneth Graunke
bff6013d46 Factor out parameter list replacement for later reuse. 2010-04-28 15:34:52 -07:00
Kenneth Graunke
0d605cb97c Factor out parameter list matching from ast_function::hir for later reuse.
Unfortunately, we still have two kinds of matching - one, with implicit
conversions (for use in calls) and another without them (for finding a
prototype to overwrite when processing a function body).  This commit
does not attempt to coalesce the two.
2010-04-28 15:34:52 -07:00
Kenneth Graunke
abd40b1521 Factor out qualifier checking code for later reuse. 2010-04-28 15:34:52 -07:00
Kenneth Graunke
0e385196f6 ir_print_visitor: Re-parenthesize ir_call output. 2010-04-28 15:34:52 -07:00
Kenneth Graunke
dde9678162 ir_print_visitor: Print return type of ir_function_signatures. 2010-04-28 15:34:52 -07:00
Kenneth Graunke
405e122a47 ir_print_visitor: Print (constant bool (1)) instead of "true"
It might be better to simply handle "true" in the reader, but since
booleans normally aren't printed as "true" or "false", we may as well go
for consistency.
2010-04-28 15:34:52 -07:00
Kenneth Graunke
2bc582d265 ir_print_visitor: Remove unnecessary parens around expression operands. 2010-04-28 15:34:52 -07:00
Kenneth Graunke
668d0a992a ir_print_visitor: Remove unnecessary parens around array size in types. 2010-04-28 15:34:52 -07:00
Kenneth Graunke
aecdefa8c0 ir_print_visitor: Fix unclosed parenthesis in (call... 2010-04-28 15:34:52 -07:00
Kenneth Graunke
c84f636c97 ir_print_visitor: Fix unclosed parenthesis in (assign ...
Also remove useless parens around subexpressions.
2010-04-28 15:34:52 -07:00
Kenneth Graunke
a02c5afce8 Add parens around printed IR so it's an official list of instructions. 2010-04-28 15:34:52 -07:00
Kenneth Graunke
1168d95109 ir_print_visitor: Remove unnecessary parenthesis around variable names. 2010-04-28 15:34:52 -07:00
Kenneth Graunke
7dd6adbe2e Refactor ir_expression::get_num_operands.
A new static version takes an ir_expression_operation enum, and the
original non-static version now uses it.  This will make it easier to
read operations (where the ir_expression doesn't yet exist).
2010-04-28 15:34:52 -07:00
Kenneth Graunke
1a3a096bf5 ir_print_visitor: print the type of expressions.
This can be useful for debugging - it allows us to see that the inferred
type is what we think it should be.  Furthermore, it will allow the IR
reader to avoid complex, operator-specific type inference.
2010-04-28 15:34:52 -07:00
Kenneth Graunke
295bb7ff8d ir_print_visitor: Remove unnecessary parenthesis around type names.
Parenthesis should only be present for compound types (i.e. arrays
or structures).  For atomic types, simply print the symbol.
2010-04-28 15:34:52 -07:00
Kenneth Graunke
1f0cb24f8b Print full type for ir_constant instead of base and component count.
vec4 and mat2x2 have the same base type and number of components;
printing the full type allows us to distinguish the two.
2010-04-28 15:34:52 -07:00
Kristian Høgsberg
9339c1291d gles: Build libGLESv1_CM.so and libGLESv2.so from glapi files 2010-04-28 14:41:21 -04:00
Kristian Høgsberg
a5107b0a5c intel: Only register ES2 extensions for ES2 contexts 2010-04-28 14:36:45 -04:00
Kristian Høgsberg
0f68032a7c configure.ac: Add options to enable GLES1/2 API support 2010-04-28 14:36:28 -04:00
Kristian Høgsberg
5efee4d4e6 intel: Advertise GLES1/2 for i915+ when enabled 2010-04-28 14:05:22 -04:00
Kristian Høgsberg
4b69100bdc dri: Add DRI entrypoints to create a context for a given API 2010-04-28 14:05:21 -04:00
Kristian Høgsberg
e2fd98d794 egl_dri2: Use new DRI API to create a GLES1/2 context when asked to 2010-04-28 14:05:21 -04:00
Kristian Høgsberg
a7a9a91d7b dri: Add DRI entrypoints to create a context for a given API 2010-04-28 14:05:21 -04:00
Kristian Høgsberg
0f5e8f7702 st/mesa: Move st_cb_drawtex.c to the mesa state tracker 2010-04-28 14:05:20 -04:00
Kristian Høgsberg
3bd6e00346 es: Drop es specific enums.c 2010-04-28 14:05:20 -04:00
Kristian Høgsberg
21ad81727c glapi: Regenerate enums.c for all APIs 2010-04-28 14:05:20 -04:00
Kristian Høgsberg
9664f10023 glapi: Update gl_enum.py to generate enum tables for multiple APIs 2010-04-28 14:05:19 -04:00
Kristian Høgsberg
12c46b15d7 mesa: Drop unused _mesa_init_drawtex_dispatch() 2010-04-28 14:05:19 -04:00
Kristian Høgsberg
1904ba7936 mesa: Move drawtex functionality to main/ 2010-04-28 14:05:19 -04:00
Kristian Høgsberg
87eb667759 mesa: Move glQueryMatrixxOES() implementation to core mesa 2010-04-28 14:05:19 -04:00
Kristian Høgsberg
a73eff645f mesa: Move GLES1 texgen functions to texgen.c 2010-04-28 14:05:18 -04:00
Kristian Høgsberg
7179a82262 mesa: Move support for paletted textures to main/teximage.c 2010-04-28 14:05:18 -04:00
Kristian Høgsberg
08fae07f52 mesa: Handle GL_TEXTURE_GEN_STR_OES in _mesa_Enable() 2010-04-28 14:04:49 -04:00
Kristian Høgsberg
7aae8a592a mesa: Move get_es*.c to main/ 2010-04-27 19:28:11 -04:00
Kristian Høgsberg
0034339895 es: Prefix the get* functions with _es1/2 so they don't conflict 2010-04-27 19:28:11 -04:00
Kristian Høgsberg
61d94dd207 mesa: Move GL_RGB565 workaround into fbobject.c 2010-04-27 19:28:10 -04:00
Kristian Høgsberg
44f9aef9ee mesa: Move GLES1/2 vbo entrypoints to vbo_exec_api.c
This let's us drop stubs.c.
2010-04-27 19:28:10 -04:00
Kristian Høgsberg
c90166fd4f mesa: Move GLES2 shader stubs to main/shaders.c 2010-04-27 19:28:10 -04:00
Kristian Høgsberg
ea0c7e7163 mesa: Move api_exec_es*.c into mesa/main
This requires renaming a few functions to have unique names so that
they can all live within the same driver.
2010-04-27 19:27:49 -04:00
Kristian Høgsberg
1741ddb747 mesa: Move references to main/remap_helper.h to api_exec.c 2010-04-27 13:09:31 -04:00
Roland Scheidegger
9a966b93c0 gallium: fix glaring bugs in last commit 2010-04-27 16:25:50 +02:00
Ian Romanick
3eba593f35 Implement gl_TextureMatrix built-in uniform 2010-04-26 14:59:32 -07:00
Ian Romanick
230ade93a6 Make private glsl_type singletons public 2010-04-26 14:59:16 -07:00
Ian Romanick
c11f1a4fb0 Initial implementation of #line
Does not handle comments in #line or line continuation characters, but
it should be good enough for now.
2010-04-26 14:19:49 -07:00
Roland Scheidegger
aac2cccccf gallium: interface changes for multisampling
add function to set sample mask, and state for alpha-to-coverage and
alpha-to-one. Also make it possible to query for supported sample count
with is_msaa_supported().

Use explicit resource_resolve() to resolve a resource. Note that it is illegal
to bind a unresolved resource as a sampler view, must be resolved first (as per
d3d10 and OGL APIs, binding unresolved resource would mean that special texture
fetch functions need to be used which give explicit control over what samples
to fetch, which isn't supported yet).

Also change surface_fill() and surface_copy() to operate directly on resources.
Blits should operate directly on resources, most often state trackers just used
get_tex_surface() then did a blit. Note this also means the blit bind flags are
gone, if a driver implements this functionality it is expected to handle it for
all resources having depth_stencil/render_target/sampler_view bind flags (might
even require it for all bind flags?).

Might want to introduce quality levels for MSAA later.
Might need to revisit this for hw which does instant resolve.
2010-04-26 19:51:25 +02:00
Alan Hourihane
06574e45b4 gallivm: BGNFOR/ENDFOR fallthrough to BGNLOOP/ENDLOOP 2010-04-26 17:42:51 +01:00
José Fonseca
6ecbbc3c05 draw: Always use the llvm middle end when available & enabled. 2010-04-26 16:05:06 +01:00
José Fonseca
7fd9e3cfb0 svga: Pass-through max_index to translate. 2010-04-26 16:05:06 +01:00
José Fonseca
2a30d3d74a draw: Pass-through pipe_buffer::max_index to translate.
max_index must be observed to prevent crashes due to bad index data.

I've been using this patch for some time without regressions.

Some places, where we use internal vertex buffer, it is not entirely
clear what max_index should be, so passing just ~0 to avoid regressions
for now.
2010-04-26 16:05:06 +01:00
José Fonseca
fc431a58dc translate: Take and respect a max_index argument. 2010-04-26 16:05:06 +01:00
Corbin Simpson
b02f1c86f5 r300g: Rudimentary stats, printed on exit.
Whoo!
2010-04-26 07:13:51 -07:00
Corbin Simpson
bf98d61708 r300g: Add stats debug flag. 2010-04-26 07:13:51 -07:00
Andre Maasikas
12172071b5 r600: enable VERT_RESULT_PSIZ - makes point size & attenuation work
doc additions: shader export ARRAY_BASE for EXPORT_POS: 60 is position,
61 is misc vec(VS_OUT_MISC_VEC - used here),
62, 63 are clip distance vectors(VS_OUT_CCDIST#)

sorry for formating - there seem to be so many different styles in r600
2010-04-26 13:30:01 +03:00
Andre Maasikas
04a148629f r600: adjust point sprites after 911fa4a4a1
there's no more vp results for point coords so we cannot iterate
over vp outputs. Use only Point.CoordReplace[i]
2010-04-26 13:30:01 +03:00
Vinson Lee
5fd97573e3 scons: Include headers from the local include directory first.
Certain headers, such as GL/glew.h, are in both the Mesa include and the
default installed include directories. On recent distros the needed
symbols can be found in both places. On older distros the installed
headers could be lacking symbols, so for a header that exists in both
places, the local one should be found first.
2010-04-26 01:08:34 -07:00
Vinson Lee
31db310be4 os: Check for spurious wakeups in pipe_barrier_wait.
The POSIX function pthread_cond_wait can have spurious wakeups when
waiting on a condition variable.

Add a 64-bit counter that is incremented whenever the barrier becomes
full. A woken thread checks the counter. If the counter has not changed
then it has been spuriously woken and goes back to sleep. If the counter
has changed then it was properly signaled and exits the barrier.

Tested on Mac OS X.

This patch was based on ideas from Luca Barbieri.
2010-04-26 00:31:20 -07:00
Corbin Simpson
59fcbc0ac5 r300g: Use table CS writing when applicable.
I just broke the 2000 fps barrier on glxgears. Yay?
2010-04-26 00:24:26 -07:00
Corbin Simpson
c53142c3f4 r300g: Add CS table writing. 2010-04-26 00:24:26 -07:00
Vinson Lee
2d1b95477f et/egl: Remove dead code.
proc_name cannot be NULL after the switch statement. proc_name is
assigned a value or the function has already returned.
2010-04-26 00:19:14 -07:00
Vinson Lee
310ec9a17c nvfx: Add include path to SCons build. 2010-04-25 22:51:14 -07:00
Marek Olšák
671f1e1229 r300g: support index bias on r500 and DRM 2.3.0 2010-04-26 07:22:00 +02:00
Marek Olšák
54bcee1e40 r300g: support rendering more than 65535 vertices in one batch on r500
and disable batch splitting on these chipsets.
2010-04-26 07:22:00 +02:00
Marek Olšák
2579fe4044 r300g: emit MSPOS regs 2010-04-26 07:22:00 +02:00
Marek Olšák
b9e637e8cf r300g: force prefetch for non-indexed vertices 2010-04-26 07:22:00 +02:00
Marek Olšák
537d117ed5 r300g: use the dummy FS shader for shaders with zero instructions 2010-04-26 07:22:00 +02:00
Marek Olšák
52e591383b r300g: allow unaligned vertex formats if the stride is dword-aligned 2010-04-26 07:22:00 +02:00
Marek Olšák
824e2afea0 r300g: abort on unsupported vertex formats 2010-04-26 07:21:59 +02:00
Marek Olšák
d00b2560d5 r300g: abort if a vertex buffer offset is not dword-aligned 2010-04-26 07:21:59 +02:00
Vinson Lee
210218bb96 st/wgl: s/st_manager_create_api/st_gl_api_create/
commit 0c572c6828 replaced
st_manager_create_api with st_gl_api_create.

Fixes MSVC build.
2010-04-25 21:42:19 -07:00
Vinson Lee
78b47c337f nvfx: Add missing header. 2010-04-25 21:22:40 -07:00
Jakob Bornecrantz
1372a8f90d st/dri: Refactor dri_st_api into other files 2010-04-26 00:40:17 +01:00
Jakob Bornecrantz
27779ddad5 st/dri: Make st_framebuffer_iface the base for dri_drawable 2010-04-26 00:40:17 +01:00
Jakob Bornecrantz
a66b391edf st/dri: Make st_manager the base for dri_screen 2010-04-26 00:40:17 +01:00
Jakob Bornecrantz
ea6a52a1f8 st/dri: Add hooks for framebuffer functions 2010-04-26 00:40:17 +01:00
Jakob Bornecrantz
ab12d4f647 st/dri: Make lookup_egl_image a hook 2010-04-26 00:40:17 +01:00
Jakob Bornecrantz
0c572c6828 st_api: Remove st_module
The struct st_module isn't needed as it is the same thing as the st_api
struct. That is they both represent the API. Instead just use a single
function entry point to the the API.
2010-04-26 00:40:17 +01:00
José Fonseca
81ab19de04 llvmpipe: Respect pipe_sampler_view::swizzle_r/g/b/a
This allows u_sampler_view_default_dx9_template to do its magic on DX9.
2010-04-26 00:32:13 +01:00
José Fonseca
4dd1a56840 draw: Respect pipe_vertex_buffer::max_index in llvm generated code.
Everybody should respect max_index, specially llvm generated code, which
likes to eat vertices 4 at a time, so it may end up chew a bit a bit more
than actually exists.
2010-04-25 23:41:49 +01:00
José Fonseca
2cd128ab44 llvmpipe: No need to flush the caches for buffers. 2010-04-25 23:41:48 +01:00
José Fonseca
53e94bd4ad softpipe: Make softpipe transfers in-order.
Transfer, being now a context operation, should happen in order with
all other contexts operations. If there is rendering pending on the
resource then the driver must flush and potentially wait itself
internally.

Instead of avoiding using transfers internally (as done in llvmpipe) I've
opted to simply pass PIPE_TRANSFER_UNSYNCHRONIZED in all internal
transfers, to avoid infinite recursion.
2010-04-25 23:41:48 +01:00
José Fonseca
43b85af56e llvmpipe: Cleanup/improve llvmpipe_flush_resource usage.
Recognize PIPE_TRANSFER_UNSYNCHRONIZED and PIPE_TRANSFER_DONTBLOCK.
2010-04-25 23:41:48 +01:00
Vinson Lee
8352983e2a llvmpipe: Remove unused variable. 2010-04-25 13:10:02 -07:00
José Fonseca
7951630d08 llvmpipe: llvmpipe_flush_texture -> llvmpipe_flush_resource 2010-04-25 15:54:32 +01:00
José Fonseca
5745bcb2db llvmpipe: Fix buffer overflow unswizzling several formats.
Array formats without for channels were being advanced as four channels,
causing buffer overflows.
2010-04-25 15:54:32 +01:00
José Fonseca
89f244931f softpipe: Hardcode TILE_CLEAR_OPTIMIZATION to 1.
The un-optimized path relies on surface_fill which can only handle formats
with depth <= 32, so it is pointless to keep it around.
2010-04-25 15:54:32 +01:00
José Fonseca
23df86d851 llvmpipe: Replace tile_read/write with more descriptive swizzle/unswizzle verbs. 2010-04-25 15:54:31 +01:00
José Fonseca
adc7cd6240 llvmpipe: Cleanup llvmpipe_is_format_supported().
It should be just cosmetic.
2010-04-25 15:54:31 +01:00
José Fonseca
7e4ce65d71 softpipe: More accurate softpipe_is_format_supported().
Unfortunately there are some heavy limitations on supported render target
formats due to the way clear values are used internally.
2010-04-25 15:54:31 +01:00
José Fonseca
8a70c47c4c llvmpipe: Remove sp2lp.sh.
Irrelevant now that llvmpipe and softpipe grew so far apart.
2010-04-25 15:54:30 +01:00
José Fonseca
7cebd16fbb llvmpipe: lp_tex_sample_llvm.c -> lp_tex_sample.c
'llvm' suffix unnecessary now that the C sampling version disappeared.
2010-04-25 15:54:30 +01:00
Vinson Lee
7b7a9e8927 st/dri: Add missing header.
Add GL/internal/dri_interface.h for __DRI_TEXTURE_FORMAT_RGB.
2010-04-25 02:18:52 -07:00
Vinson Lee
5d37cebc1b gallivm: Rename variable info to opcode_info.
Avoid hiding existing variable already named info in outer scope.
2010-04-25 02:04:13 -07:00
Vinson Lee
d69ed3a96e radeon: Remove NULL check of bo_legacy->tobj.
bo_legacy->tobj cannot be NULL before the call to driUpdateTextureLRU.
There is a NULL check earlier in the routine, and if bo_legacy->tobj is
NULL, memory is allocated.
2010-04-24 23:44:56 -07:00
Vinson Lee
a1a7738223 gallivm: Remove NULL check of pointer that can't be NULL.
info cannot be NULL at the call to debug_printf. emit_instruction
dereferences info, so at debug_printf it is either not NULL or the
program has already crashed.
2010-04-24 23:31:35 -07:00
Vinson Lee
9bc54ca991 dri: Remove unnecessary header. 2010-04-24 23:14:27 -07:00
Vinson Lee
bd93670bfd nvfx: Add to SCons build. 2010-04-24 16:22:47 -07:00
Dave Airlie
22e8ddc748 llvm: fix configure.ac harder 2010-04-25 07:55:15 +10:00
Vinson Lee
ac942f5aa2 nv50: Add to SCons build. 2010-04-24 14:38:48 -07:00
Vinson Lee
b147aaea4d llvmpipe: Remove unused variable. 2010-04-24 14:29:08 -07:00
Vinson Lee
c7bb271f0d llvmpipe: Remove unnecessary header. 2010-04-24 14:19:47 -07:00
José Fonseca
e54a86c677 llvmpipe: Implement shader bias.
Fixes glean glsl1 test: texture2D(), with bias.
2010-04-24 21:00:45 +01:00
José Fonseca
cca8abe20e mesa: Eliminate multiple va_list usage.
va_list is a mutable iterator. When passed to a function it will likely
point to somewhere else.

This fixes segmentation fault in glean vertProg1 on Ubuntu 9.10.
2010-04-24 20:31:30 +01:00
José Fonseca
1eeae05441 util: Add missing static keyword. 2010-04-24 16:13:54 +01:00
José Fonseca
ee15d5a0c4 util: Fix unsigned <-> ptr conversions. 2010-04-24 16:13:41 +01:00
José Fonseca
aa7a47dcbd llvmpipe: Initialize dummy variable. 2010-04-24 16:13:18 +01:00
José Fonseca
bd6e9e3350 llvmpipe: Don't use fences when not using threads.
lp_setup_flush has effect immediately.
2010-04-24 16:13:04 +01:00
José Fonseca
39be50dcde llvmpipe: Move the determination of the number of threads to the screen. 2010-04-24 13:20:39 +01:00
José Fonseca
e7a8cfc877 gallivm: Centralize the cpu caps detection. 2010-04-24 13:19:10 +01:00
José Fonseca
30a1c36dc8 llvmpipe: Pass flatshade_first to setup.
Fixes piglit provoking-vertex.
2010-04-24 12:00:06 +01:00
José Fonseca
e94a092437 svga: D3DCOLOR actually stands for B8G8R8A8. 2010-04-24 11:39:12 +01:00
José Fonseca
e6c3f594e9 svga: Translate recently added vertex formats. 2010-04-24 11:39:09 +01:00
José Fonseca
53499c64b2 cso_cache: Ensure irrelevant state of the blend state is zeroed.
Otherwise drivers that bake the full blend state in a key end up having
uninitialized memory in their key.

Courtesy of valgrind.
2010-04-24 11:39:09 +01:00
Jakob Bornecrantz
a523b62203 st/dri: DRI2 give proper binding to depth buffer 2010-04-24 11:24:26 +01:00
José Fonseca
94b04d3d1c sw/xlib: Fix bad logic in shm allocation.
Fixes fdo 27823.
2010-04-24 10:15:09 +01:00
José Fonseca
35a920e83b gallivm: LLVMConstBitCast -> LLVMBuildBitCast
As the argument in general might not be a constant.
2010-04-24 10:06:27 +01:00
Dave Airlie
81fe19843a llvmpipe: add initial autoconf support.
allows the swrastg_dri.so to be built with llvmpipe, also links llvm
to all dri drivers

use --enable-gallium-llvm to use it.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-04-24 18:55:50 +10:00
Vinson Lee
e3eed8bf21 nouveau: Add to SCons build. 2010-04-24 01:15:00 -07:00
Vinson Lee
dda8046a64 gallium/docs: Update Gallium version number to 0.4. 2010-04-24 00:21:34 -07:00
Vinson Lee
3ee4ec99ea llvmpipe: Remove unused variable. 2010-04-24 00:02:48 -07:00
Vinson Lee
c3c920ee2c gallium: In option helpers, move assignment outside of if clause.
This silences Coverity assign_where_compare_meant warnings.
2010-04-23 22:06:19 -07:00
Brian Paul
4ff354f281 st/mesa: checkpoint WIP: mipmap generation for compressed textures
Something is wrong with the images strides when compressing/decompressing
images...
2010-04-23 18:12:45 -06:00
Brian Paul
63c9b4f3d2 xlib/sw: remove stray semicolon 2010-04-23 18:12:27 -06:00
Brian Paul
1a4383cd42 softpipe: compressed formats can't be render targets 2010-04-23 18:12:24 -06:00
Brian Paul
b806f2a239 gallium/util: document that pack/unpack strides are in bytes 2010-04-23 18:12:19 -06:00
Eric Anholt
25ebc0459f builtin_functions: Clean up compiler warning about unused name, instructions. 2010-04-23 16:12:44 -07:00
Eric Anholt
d7f6f346be De-obfuscate some of builtin_types.h. 2010-04-23 16:12:44 -07:00
Eric Anholt
e8e9748722 ir_function_inlining: Implement inlining in many more cases.
We still don't inline for control flow in the inlined function, and we
don't have any limits on what we will inline.
2010-04-23 16:12:44 -07:00
Eric Anholt
ec9e73870c Put static pointers to vec[234]_types along with the static float_type.
Otherwise you have to type a lot of get_instance.
2010-04-23 16:12:44 -07:00
Eric Anholt
8d3e59f1f3 Replace builtin_types.h generation with the generated output.
The script to generate it was longer and more obfuscated than the output.
2010-04-23 16:12:44 -07:00
Eric Anholt
82ad90f8cf Fix the swizzling of vector constructors from scalars.
A refactor turned 'i' into '1', meaning everything writemasked into
the y component.
2010-04-23 16:12:44 -07:00
Eric Anholt
22147be898 ir_function_inlining: Avoid NULL dereference on assignment conditions. 2010-04-23 16:12:44 -07:00
Brian Paul
394ff065f3 st/mesa: minor improvements in fallback_generate_mipmap() 2010-04-23 16:04:55 -06:00
Brian Paul
51523f1144 st/mesa: remove unneeded #includes and add/update comments 2010-04-23 15:41:49 -06:00
Brian Paul
76c7ad2e7d st/mesa: clean-up: use st_context() everywhere 2010-04-23 15:41:49 -06:00
Brian Paul
57fc2e7802 mesa: simplify some code in _mesa_generate_mipmap() 2010-04-23 15:41:49 -06:00
Brian Paul
67f928eef3 gallium/failover: include u_memory.h for MALLOC, FREE 2010-04-23 15:39:43 -06:00
Brian Paul
06441af657 gallium/draw: remove old comment 2010-04-23 15:36:14 -06:00
Jakob Bornecrantz
1820d240cd gallium: Convert some uses of get option to static 2010-04-23 21:57:49 +01:00
Jakob Bornecrantz
89aaaab79f gallium: Add static get option helpers 2010-04-23 21:57:49 +01:00
Jakob Bornecrantz
7159303dbf gallium: Add option to not print options 2010-04-23 21:57:49 +01:00
José Fonseca
2ce1d6696b gallium: s/free/FREE/ and same for friends.
Based on Stephen Johnson's feedback.
2010-04-23 21:53:08 +01:00
Ian Romanick
6aeada7966 Zero-out the entire parser state structure at initialization
Among other things, this ensures that all of the extension flags are
initially disabled.

This causes the following tests to pass:

    glslparsertest/glsl2/draw_buffers-02.frag
2010-04-23 13:37:47 -07:00
Ian Romanick
eb56cea3b3 Add missing 'else's to fix extension processing
The missing else-statements caused all of the extensions execpt
GL_ARB_texture_rectangle to be unsupported.

This causes the following tests to pass:

     glslparsertest/glsl2/draw_buffers-04.frag
2010-04-23 13:32:23 -07:00
Brian Paul
4aa4fe8e21 st/mesa: re-do binding flags in st_ChooseTextureFormat(), again
Try to specify render target bindings flags first.  If that fails, try
again with just sampler view binding.  Note that we try to create the
texture resource with render target binding flags later when we allocate
the texture.  Then, in FBO validation, we check if we can actually render
to the textures.  If that fails, we generate GL_FRAMEBUFFER_UNSUPPORTED_EXT.

Changes suggested by Jose.
2010-04-23 13:16:37 -06:00
Brian Paul
8283db8841 st/mesa: replace 'usage' with 'bindings' 2010-04-23 13:16:37 -06:00
Brian Paul
eb2bd2158e st/mesa: replace 'usage' with 'bindings' to be consistent
Plus, update comments and formatting.
2010-04-23 13:16:37 -06:00
Ian Romanick
e4c54d4049 Merge branch '7.8' 2010-04-23 11:52:14 -07:00
Aaron Plattner
ad7d36e919 Fix __glXInitializeVisualConfigFromTags's handling of unrecognized fbconfig tags.
__glXInitializeVisualConfigFromTags doesn't skip the payload of
unrecognized tags.  Instead, it treats the value as if it were the
next tag, which can happen if the server's GLX extension is not
Mesa's.  For example, this falls down when NVIDIA sends a
GLX_FLOAT_COMPONENTS_NV = 0 pair, causing
__glXInitializeVisualConfigFromTags to bail out early.

Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2010-04-23 11:48:11 -07:00
Stephen Johnson
c09f370519 draw: use FREE() instead of free() 2010-04-23 19:34:55 +01:00
Brian Paul
70df04404b st/mesa: don't set RENDER_TARGET/DEPTH_STENCIL flag for compressed textures 2010-04-23 12:29:31 -06:00
Brian Paul
a8c78f3aa1 st/mesa: get rid of default_deep_rgba_format()
This special-case code used to be used for the accum buffer but
the accum buffer implementation was changed some time ago.
2010-04-23 12:29:31 -06:00
Brian Paul
c34feadd1c mesa: make is_compressed_format() non-static 2010-04-23 12:29:31 -06:00
Brian Paul
3643841079 mesa: faster, simpler is_compressed_format() 2010-04-23 12:29:31 -06:00
Brian Paul
f855193796 llvmpipe: rename texture refs to resource refs 2010-04-23 12:29:31 -06:00
Alan Hourihane
00f8e5764d llvmpipe: update for half float formats 2010-04-23 19:26:03 +01:00
José Fonseca
f73feb9cd6 st/xlib: Try to propagate failure to create framebuffer.
Doesn't help much, since it is ignored by st_framebuffer_validate.
2010-04-23 17:08:11 +01:00
José Fonseca
d7996beb4c softpipe: YUV textures should be supported. 2010-04-23 17:08:11 +01:00
José Fonseca
99bee1570b mesa/st: Remove dead members. 2010-04-23 17:08:11 +01:00
José Fonseca
405f925d4e sw/xlib: Fallback to XPutImage when shmget fails.
After continuously running regression tests on Ubuntu for 2 days, shmget
mysteriously starts to fail. Even when the X server is reset.

This allow rendering to proceed, albeit using a slower presentation path.
2010-04-23 17:08:11 +01:00
Brian Paul
158f9d56e0 llvmpipe: increase max 2D texture / surface size to 4K x 4K 2010-04-23 09:13:27 -06:00
Brian Paul
4a72ec49f6 llvmpipe: rename MAXWIDTH, MAXHEIGHT 2010-04-23 09:13:26 -06:00
Brian Paul
2de31f2bf2 llvmpipe: rename lp_tile_size.h to lp_limits.h
Collect the various driver limits in one place since.
2010-04-23 09:13:26 -06:00
Brian Paul
71dfbb608a llvmpipe: move LP_MAX_TEXTURE_x_LEVELS, etc to lp_tile_size.h 2010-04-23 09:13:26 -06:00
Jerome Glisse
ccd13da0fc Merge remote branch 'origin/7.8' 2010-04-23 12:08:36 +02:00
Jerome Glisse
eb4dc54788 r600: don't enable depth test if there is no depth buffer
If there is no depth buffer bound to current context don't
enable depth test. GL states that if depth test is enabled
without depth buffer it's as if depth buffer always pass.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-04-23 11:56:06 +02:00
Michel Dänzer
ff20543c81 Merge branch '7.8' 2010-04-23 11:18:29 +02:00
Michel Dänzer
c37e275e77 glx/dri2: Fix build with dri2proto which doesn't define X_DRI2SwapInterval. 2010-04-23 11:16:03 +02:00
Vinson Lee
749a8825a0 llvmpipe: Remove unused variable. 2010-04-23 00:59:12 -07:00
Eric Anholt
b2e52e7278 i965: Fix assertion for surface tile offset usage on Ironlake.
Fixes assertion failure in fbo-generatemipmap-npot.
2010-04-22 15:37:33 -07:00
Eric Anholt
64516430be i965: Fix scissoring when width or height is 0.
We would run into trouble due to the hardware using inclusive numbers
and the subtraction to handle that producing negative (meaning large
positive) coordinates.

Bug #27643.
2010-04-22 15:37:33 -07:00
Zack Rusin
021e0dc78b gallivm: implement indirect addressing over temporaries
a bit more involved than indirect addressing over consts, but still
fairly reasonable. we allocate an array instead of individual alloca's,
and we do it only if the shader does indirect addressing.
2010-04-22 18:36:07 -04:00
Zack Rusin
ded2374e67 gallivm: implement indirect addressing over constants
implement indirect addressing (ARL and ARR instructions) when used
with CONST's. indirect addressing over other vars (temps, inputs, outputs)
is not supported yet.
2010-04-22 17:33:14 -04:00
Tormod Volden
355370e30b radeon: 9800 SE has only one quadpipe
Although these cards have 2 pipelines on the silicon only
the first passed the QA and the other should be disabled.

http://www.digital-daily.com/video/ati-radeon9800se/
http://www.rojakpot.com/showarticle.aspx?artno=101&pgno=1

Signed-off-by: Tormod Volden <debian.tormod@gmail.com>
2010-04-22 17:14:15 -04:00
Brian Paul
d888812324 gallium: use better param name 2010-04-22 14:39:12 -06:00
Brian Paul
19b26cb0a2 gallivm: remove Z/stencil special case code in lp_build_sample_offset()
Fixes progs/tests/zreaddraw.c and progs/demos/shadowtex.c
2010-04-22 14:37:50 -06:00
Brian Paul
17249ae8e0 st/mesa: assert that binding flags are properly set for drawing surfaces 2010-04-22 14:37:50 -06:00
Brian Paul
e9bcad4c33 st/mesa: fix binding flags in st_ChooseTextureFormat()
See comment for more info.
2010-04-22 14:37:50 -06:00
Brian Paul
9f74fa111b progs/tests: asst. improvements to zreaddraw.c 2010-04-22 14:37:50 -06:00
Jesse Barnes
45e2b51c85 DRI2/GLX: check for vblank_mode in DRI2 GLX code
Re-add support for the vblank_mode environment and configuration
variable.  Useful for benchmarking and app control.
2010-04-22 12:49:45 -07:00
Jesse Barnes
234286c0f8 DRI2: add config query extension
Add a new DRI2 configuration query extension.  Allows for DRI2 client
code to query for common DRI2 configuration options.
2010-04-22 12:49:45 -07:00
José Fonseca
c059565054 llvmpipe: Undo zs tiling changes.
tile_w/tile_h have different meaning there.

This partialy reverts commit ccdc6b5913.
2010-04-22 20:38:36 +01:00
José Fonseca
cb384ae8b2 gallium/docs: Unswap PIPE_BIND_SHARED's comment. 2010-04-22 19:51:10 +01:00
Brian Paul
f836a5f60b gallium/docs: many updates to screen.rst
Put PIPE_BIND_ and PIPE_TEXTURE_GEOM_ prefixes on token names so
that they can be found with grep.  This needs to be done in more places.

Corrected/improved a lot of information and grammer.

I don't know how to properly format everything - someone else can take
care of that.
2010-04-22 12:47:10 -06:00
José Fonseca
cdaceaafee llvmpipe: Portability fixes. 2010-04-22 19:25:00 +01:00
José Fonseca
ccdc6b5913 llvmpipe: Fix rendering to non 32bpp formats.
Tiled layout always used 32bpp, therefore linear/tiled strides are not
related.
2010-04-22 19:25:00 +01:00
Zack Rusin
18a4a83dda gallivm: update comments 2010-04-22 13:57:18 -04:00
Zack Rusin
6d2e09fdc2 gallivm: fix nested cont statements 2010-04-22 13:57:18 -04:00
Zack Rusin
3a423dcf9d gallivm: fix nested break statemants 2010-04-22 13:57:18 -04:00
Zack Rusin
63aa9b505a gallivm: make sure we return the correct type when approximating log's 2010-04-22 13:57:18 -04:00
Kristian Høgsberg
fa41610630 mesa: Move struct _glapi_table allocation out of context.c
We now allocate the table from api_exec.c and dlist.c where we fill out
the table.  This way, context.c doesn't need to know the actual contents
of struct _glapi_table.
2010-04-22 13:43:28 -04:00
José Fonseca
8bee4c7718 llvmpipe: Use resource_is_texture() consistently.
Otherwise slightly difference order causes assertion failures.

Also remove mentions of PIPE_BIND_SCANOUT/PIPE_BIND_SHARED. They are not
propoer bind flags and will likely be deprecated. If surfaces should
be passed to the winsys then they should have the DISPLAY_TARGET flag
set, which is a proper bind flag.
2010-04-22 18:42:03 +01:00
Brian Paul
50d77c79fb gallium: fix comment language, remove dangling comment 2010-04-22 11:33:26 -06:00
Brian Paul
1143221cfd st/mesa: consolidate code for finding supported formats 2010-04-22 11:11:26 -06:00
Brian Paul
e65b11525a st/mesa: refactor depth/stencil format selection code 2010-04-22 11:11:26 -06:00
Brian Paul
446062b834 mesa: sort texel fetch/store table by format index 2010-04-22 11:10:42 -06:00
Brian Paul
b4a191e351 Merge branch '7.8'
Conflicts:

	src/mesa/state_tracker/st_format.c
2010-04-22 11:10:19 -06:00
Brian Paul
b1a9c76b57 st/mesa: add cases for MESA_FORMAT_Z24_X8, MESA_FORMAT_X8_Z24 2010-04-22 11:06:19 -06:00
Brian Paul
4d7ef6e06b mesa: fix conversion errors in signed_rgba8888[rev] texel fetch
Without the cast the returned texel colors were wrong.
Also, we don't need the "& 0xff" part anymore.
Bug found by Vinson Lee.
2010-04-22 11:06:19 -06:00
José Fonseca
2eea1714fd llvmpipe: Fix resource_is_texture.
It was missing PIPE_BIND_RENDER_TARGET, causing assertion failures for
pure render targets.

Also bind flags are too variable and complex for a good assessment for
whether the resource is a texture or not. Target is more concise.
2010-04-22 18:06:05 +01:00
Kristian Høgsberg
ade150d667 mesa: Compute extension string according to API
We can now stop special casing glGetString() and drop specials_es*.c.
2010-04-22 12:42:23 -04:00
Kristian Høgsberg
18f7e118a5 es2: Move over es2 code to compute extensions 2010-04-22 12:42:23 -04:00
Kristian Høgsberg
04bf868ad9 main: Report GL_SHADING_LANGUAGE_VERSION according to API 2010-04-22 12:42:23 -04:00
Kristian Høgsberg
29107d4e07 mesa: Compute GL version according to API 2010-04-22 12:42:22 -04:00
Kristian Høgsberg
218ceb3e18 mesa: Move API specific context intialization into context.c 2010-04-22 12:42:17 -04:00
Kristian Høgsberg
38d771c053 st/mesa: Use API-aware context constructor
The mesa state tracker is currently the only place where we create a
context and expect it to implement GLES1/2.  Use the API-aware constructor
to communicate this to core mesa.
2010-04-22 11:44:13 -04:00
José Fonseca
510669cd87 llvmpipe: Do not advertise S3TC rendering support. 2010-04-22 15:12:30 +01:00
José Fonseca
6ae9975ea0 llvmpipe: Fix typo in assert. 2010-04-22 15:11:57 +01:00
José Fonseca
52bc90caa8 u_format: Reduce code duplication. 2010-04-22 15:11:34 +01:00
Kristian Høgsberg
2ab18d63cb mesa: Track the OpenGL API we're implementing in the context
This introduces a new way to create or initialize a context:

  _mesa_create_context_for_api and
  _mesa_initialize_context_for_api

which in addition to the current arguments take an api enum to indicate
which OpenGL API the context should implement.  At this point the
API field in GLcontext isn't used anywhere, but later commits will
key certain functionality off of it.

The _mesa_create_context and _mesa_initialize_context functions are
kept in place as wrappers around the *_for_api versions, passing in
API_OPENGL to get the same behavior as before.
2010-04-22 09:25:51 -04:00
Vinson Lee
bd91f665a7 gallivm: Remove unused variable. 2010-04-22 00:45:27 -07:00
Kenneth Graunke
25851a8d87 Fix illegal (var_ref (array_ref ...)) in matrix constructors. 2010-04-22 00:25:55 -07:00
Kenneth Graunke
67029b13b7 Actually emit temp declaration in vector comparison builtins. 2010-04-21 23:58:13 -07:00
Alex Deucher
48a1806126 r300g: fix vertex unit setup
RV3xx is 2, RV560,RV570 is 8

Noticed by Tormod Volden.
2010-04-22 02:37:34 -04:00
Alex Deucher
986eb4b99f r300: fix vertex unit setup
RV3xx is 2, RV560,RV570 is 8

Noticed by Tormod Volden.
2010-04-22 02:33:10 -04:00
Vinson Lee
7a0b48e349 gallium/util: Fix deviation calculation in u_cache.
The approximate deviation calculation was using the entire cache's total
instead of each cache entry's total.
2010-04-21 18:45:44 -07:00
Vinson Lee
393009a939 gallium/tests: Add test case for u_cache. 2010-04-21 18:31:01 -07:00
Brian Paul
7fe93f831d gallivm: added some assertions in loop-gen code
We're hitting these assertions with nested loops...
2010-04-21 18:22:18 -06:00
Aaron Plattner
2e995cdf25 progs/demos: Fix the progs/demos/rain help text
Signed-off-by: Brian Paul <brianp@vmware.com>
2010-04-21 18:13:19 -06:00
Brian Paul
bba6a196bb gallivm: fix copy&paste error: s/cont_stack_size/break_stack_size/ 2010-04-21 17:58:32 -06:00
Brian Paul
fc9b8cd9dd gallivm: emit_instruction() is boolean 2010-04-21 17:57:44 -06:00
Kenneth Graunke
6202cbfe36 Fix ir_dead_code for function refactoring. 2010-04-21 16:02:15 -07:00
Kenneth Graunke
7bcd5bedcc Emit body for constructors in the right place.
Previously, the body of some vector constructors were added to the wrong
function signature, and the body of matrix constructors were just being
dumped in the main instruction stream.
2010-04-21 15:37:10 -07:00
Kenneth Graunke
3289886688 Remove ir_label since it is no longer used. 2010-04-21 15:37:10 -07:00
Kenneth Graunke
9fa99f3b6c Refactor IR function representation.
Now, ir_function is emitted as part of the IR instructions, rather than
simply existing in the symbol table.  Individual ir_function_signatures
are not emitted themselves, but only as part of ir_function.
2010-04-21 15:36:36 -07:00
Kenneth Graunke
f96c52ba2e Use ir_function_signature::function_name() rather than direct access. 2010-04-21 15:36:36 -07:00
Kenneth Graunke
67a092ae09 Ensure that both parameter lists are the same length in function overloading.
Fixes new test function-05.glsl, where the second function has matching
parameter types, but less of them.
2010-04-21 15:36:36 -07:00
Brian Paul
5b639cdc3e progs/glsl: better comments 2010-04-21 16:30:13 -06:00
Brian Paul
04c136d5c2 llvmpipe: add missing dependency in Makefile 2010-04-21 16:30:13 -06:00
Brian Paul
feffd259da gallivm: implement TGSI KILP
As in tgsi_exec.c we don't actually rely on condition codes; we do
an unconditional kill.  The only predication comes from the execution
mask which applies inside loops/conditionals.
2010-04-21 16:30:13 -06:00
Ian Romanick
ff236fa9b6 Add missing break statement 2010-04-21 15:08:08 -07:00
José Fonseca
5c364b3ef7 draw: Make LLVM integration work without llvmpipe too (e.g. sofptipe).
Prevents the assertion failure.
2010-04-21 22:58:41 +01:00
Marek Olšák
dab8f6b1d9 radeon: fix warning 2010-04-21 22:57:01 +02:00
Marek Olšák
dd029dcb14 r300g: raise the max index for generic varyings to 32
This should fix an assertion failure in the game Heroes of Newearth.
Yes, the game seems to generate semantic indices greater than 15.
2010-04-21 22:57:01 +02:00
Brian Paul
01c12ed60c softpipe: call draw_wide_point_sprites() 2010-04-21 14:25:28 -06:00
Brian Paul
8cb223eb02 gallium/draw: fix point sprite handling
New draw API function to indicate whether or not to convert points to
quads for sprite rasterization.

Fix point-to-quad conversion regression in the wide-point stage.  We
need to check the pipe_rasterizer_state::point_quad_rasterization flag.
2010-04-21 14:25:28 -06:00
Brian Paul
d30ab4394e gallium/draw: use local var to simplify code 2010-04-21 14:25:28 -06:00
Brian Paul
15d60294d6 llvmpipe: consolidate texture memory allocation code
And fix incorrect allocation of linear memory for display targets.
This fixes fd.o bugs 27761 and 27762.
2010-04-21 10:30:57 -06:00
Brian Paul
867109f311 st/glx: variable 'i' is an enum
Now we can get see 'i' as an enum name instead of a plain integer in gdb.
2010-04-21 09:58:17 -06:00
Jakob Bornecrantz
f9f06f68fb targets: Don't check if we should use trace
Trace does its own checking, and it used the GALLIUM_TRACE variable
as well, but expected a file and not a bool argument.
2010-04-21 14:50:25 +01:00
José Fonseca
86d2383e77 mesa/st: Translate a few more mesa/gallium formats.
These endup used by Xvnc.
2010-04-21 11:19:39 +02:00
Vinson Lee
a85afb9177 llvmpipe: Remove unused variable. 2010-04-20 22:56:39 -07:00
Brian Paul
736a2f2f95 mesa: do version checking for GL 3.x queries 2010-04-20 21:17:35 -06:00
Brian Paul
a40e6f220a mesa: API and state for GL 3.1 primitive restart 2010-04-20 21:02:09 -06:00
Brian Paul
bd1d35fb5d mesa: add GL 3.2 GL_CONTEXT_PROFILE_MASK query 2010-04-20 20:52:56 -06:00
Brian Paul
d3e2f4fa18 mesa: remove some comments 2010-04-20 20:44:54 -06:00
Zhenyu Wang
82abbca692 intel: Add Sandybridge mobile chipset id
Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
2010-04-21 10:11:31 +08:00
Zhenyu Wang
cdcef6cbf4 intel: Clean up chipset name and gen num for Ironlake
Rename old IGDNG to Ironlake, and set 'gen' number for
Ironlake as 5, so tracking the features with generation num
instead of special is_ironlake flag.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
2010-04-21 10:11:02 +08:00
Vinson Lee
9e258fc2bd gallivm: Remove unnecessary headers. 2010-04-20 18:48:04 -07:00
Vinson Lee
83353e3070 i965g: s/inttypes.h/stdint.h/
MSVC doesn't have either but Mesa has stdint.h at include/c99.
2010-04-20 17:22:26 -07:00
Jakob Bornecrantz
58590a112a svga: Fix index offset 2010-04-21 01:14:03 +01:00
Brian Paul
e648d4a1d1 st/mesa: ignore gl_texture_object::BaseLevel when allocating gallium textures
Previously, when we created a gallium texture for a corresponding Mesa
texture we'd only allocate space for mipmap levels >= BaseLevel.

This patch undoes that mechanism.  This fixes a render-to-texture bug
when rendering to level 0 when BaseLevel=1.

Also, it makes sense to allocate the whole texture object memory when
BaseLevel > 0 since a common use of GL_TEXTURE_BASE_LEVEL is to
progressively load/render mipmaps.  Eventually, the app almost always
fills in the level=0 mipmap image.

Finally, the texture image code is bit easier to understand now.
2010-04-30 12:33:40 -06:00
José Fonseca
e9bf09a98a draw: Fix memory leaks in llvm code. 2010-04-30 19:32:20 +01:00
Adam Jackson
124ef03223 x86-64: Make assembly routines .hidden like on x86 2010-04-30 14:09:57 -04:00
Vinson Lee
32f344f443 i965g: Remove unnecessary header. 2010-04-20 17:02:03 -07:00
Vinson Lee
a5460dc6d7 llvmpipe: Change return type of declaration to match code.
Commit 2142108e0e changed the return type
of llvmpipe_get_texture_image_address function but didn't change the
declaration.

Fixes build.
2010-04-20 16:40:55 -07:00
Brian Paul
2142108e0e llvmpipe: code consolidation 2010-04-20 17:28:33 -06:00
Brian Paul
1cb80d31d3 llvmpipe: remove debug code and simplify 2010-04-20 17:19:30 -06:00
Brian Paul
7688a4749e llvmpipe: fix cube face addressing bug
Fixes fd.o bug 27760 (pigit fbo-cubemap).
2010-04-20 17:15:33 -06:00
Brian Paul
c668a97ad5 llvmpipe: whitespace fix 2010-04-20 17:15:33 -06:00
Jakob Bornecrantz
71901594ed gallium: Fix copy typo 2010-04-20 23:59:38 +01:00
Jakob Bornecrantz
b88ba89397 svga: Minor clean up of winsys 2010-04-20 23:53:59 +01:00
Jakob Bornecrantz
997969b067 radeong: Minor clean up of winsys
Also try to wrap trace around driver on non-debug builds, its free.
2010-04-20 23:53:59 +01:00
Jakob Bornecrantz
1d98ce511d nouveau: Minor clean up of winsys 2010-04-20 23:53:59 +01:00
Jakob Bornecrantz
c408942c9c i965g: Minor clean up of winsys 2010-04-20 23:53:59 +01:00
Jakob Bornecrantz
1c68d1aa4c i915g: Minor clean up of winsys 2010-04-20 23:53:59 +01:00
Jakob Bornecrantz
fa2d84d2f7 st/egl: No need to use drm_api argument struct 2010-04-20 23:53:59 +01:00
Jakob Bornecrantz
71595a5f3f st/egl: Use correct driver_name field to get kernel driver name 2010-04-20 23:53:59 +01:00
Jakob Bornecrantz
8a0c99b379 st/egl: Check for null destroy callback on api struct 2010-04-20 23:53:58 +01:00
Brian Paul
395cec966b mesa: better, smaller error handling code for glGet*()
get.o is about 17% smaller.
2010-04-20 16:17:09 -06:00
Brian Paul
f4dcb5de4e mesa: better, smaller error handling code for glEnable/Disable/IsEnabled()
Use a goto instead of replicating the _mesa_error() call many times.
enable.o is about 15% smaller.
2010-04-20 16:17:09 -06:00
Brian Paul
f86d7af4a0 mesa: raise GL_INVALID_OPERATION for glReadPixels(GL_COLOR_INDEX)
We no longer support CI-mode color buffers so this is always an error.
2010-04-20 16:17:08 -06:00
Jakob Bornecrantz
ed94c26ce8 svga: Init surface functions 2010-04-20 23:16:20 +01:00
Jakob Bornecrantz
f86def5e74 util: Add missing break statement in u_caps.c
Thanks Vinson.
2010-04-30 14:46:18 +01:00
Jakob Bornecrantz
cebfd1a0cf targets: Use a valid winsys include path in Makefile.dri 2010-04-20 22:49:51 +01:00
Corbin Simpson
73c0f9f0f4 r300g: Spill a bit more info about implementation errors in surface_copy.
compiz appears to hit this. Weird.
2010-04-20 13:10:27 -07:00
Christoph Bumiller
3a5b82f335 nv50: make a working check for user memory vertex/index buffers 2010-04-20 22:08:10 +02:00
Christoph Bumiller
03e97e7f8d nv50: fix FP result counting for depth output 2010-04-20 22:08:04 +02:00
Christoph Bumiller
3c9df0bda6 nv50: support vertex index bias 2010-04-20 22:07:58 +02:00
Brian Paul
caa05ef419 llvmpipe: fix depth+stencil logic error
If both Z-test and stencil-test were enabled, we were mis-computing
the vector of updated Z buffer values.
Fixes Z testing bug in progs/demos/fbotexture.c
2010-04-20 13:51:52 -06:00
Brian Paul
48f54ecb0c llvmpipe: fix comment/typo 2010-04-20 13:51:52 -06:00
Eric Anholt
1407daf9bc i915: Map sampler indices to texture units correctly for fragment shaders.
Fixes hang with "gst-launch-0.10 videotestsrc ! video/x-raw-rgb !
glupload !  gleffects effect=heat ! glimagesink" which uses 2 samplers
pointing at GL_TEXTURE1 and GL_TEXTURE2, and piglit
glsl-fs-sampler-numbering.
2010-04-20 12:46:23 -07:00
Eric Anholt
ac3529eec4 i915: Add missing break; after handling the stub NOISE instructions.
Bug #27348
2010-04-20 12:46:23 -07:00
Brian Paul
db4ccc004a llvmpipe: fix incorrect front-facing value for fragment shader
The TGSI convention is +1 for front-facing, -1 for back-facing
Fixes glean glsl1 gl_FrontFacing tests.
2010-04-20 11:44:01 -06:00
Brian Paul
ab065b933b llvmpipe: rename mode -> interp 2010-04-20 11:23:53 -06:00
Brian Paul
3acb2b6b2f llvmpipe: remove dead code/comment 2010-04-20 10:56:01 -06:00
Brian Paul
117bf856d8 nv50: move declaration before code 2010-04-20 10:10:48 -06:00
Brian Paul
4d2804791a nv50: fixed void pointer arithment warning 2010-04-20 10:10:48 -06:00
Brian Paul
d022bddf24 gallium/util: remove bogus return statement
util_surfaces_do_detach() is a void-valued function.
2010-04-20 10:10:48 -06:00
Brian Paul
94c07b1320 progs/tests: asst. changes to antialias.c 2010-04-20 10:01:52 -06:00
Brian Paul
a2a01853f3 gallium: replace pipe_resource::_usage with pipe_resource::usage 2010-04-20 10:00:03 -06:00
Brian Paul
36c9557cae nv50: add missing idxbias param to nv50_push_elements_instanced() 2010-04-20 09:43:45 -06:00
Brian Paul
a00f4e864c llvmpipe: remove call to llvmpipe_set_texture_image_layout()
This would seem to be needed but caused some regressions.
More investigation will be done.
2010-04-20 08:42:32 -06:00
José Fonseca
cc822705e5 llvmpipe: Re-enable half float formats.
They should be working now, both textures and vertex/index/buffers.

This reverts commit efc69ca61c.
2010-04-20 16:27:42 +02:00
José Fonseca
ec8d9523d4 gallivm: Universal format support on lp_build_fetch_rgba_aos via util_format_description::fetch_rgba_float
This therefore adds support to half float vertex buffers.
2010-04-20 16:21:08 +02:00
José Fonseca
fe5a483328 gallivm: Cleanups and bugfixes to aos format translation. 2010-04-20 15:09:02 +02:00
José Fonseca
2cb0a20f67 draw: Fallback to gallivm for translation of A8R8G8B8/B8G8R8A8/R10G10B10X2/R10G10B10X2 and other formats.
These need swizzles, and bitshifts.
2010-04-20 14:02:05 +02:00
José Fonseca
e08d0cc165 gallivm: New function to fetch a pixel into a 4xfloat AoS vector. 2010-04-20 13:58:45 +02:00
José Fonseca
b29fcc7b3a gallivm: Bring aos format back to life.
Useful for fetching vertices for formats that are straight arrays.

This reverts commit aa364d091e.
2010-04-20 13:41:10 +02:00
José Fonseca
a55ead9d01 nvfx: Fix typo. 2010-04-20 13:26:59 +02:00
José Fonseca
373f03efe7 draw: Remove draw_vs_llvm.c.
To silence some warnings.

Super-seeded by Zack's new llvm middle end.
2010-04-20 13:26:59 +02:00
Alan Hourihane
17c560d1a4 llvmpipe: silence warning 2010-04-20 10:33:56 +01:00
José Fonseca
a6171a9dd9 Merge branch 'gallium-index-bias' 2010-04-20 11:07:08 +02:00
José Fonseca
3dcdca433a draw: No need to rebase for elt_bias.
As we are rebasing to min_index + elt_bias, and the vertex buffer has no
elt_bias.

I still don't know how to exercise this code. I hope this is now right.
2010-04-20 11:06:47 +02:00
José Fonseca
4e8154e866 draw: Fix cache elt_bias implementation. 2010-04-20 10:32:06 +02:00
José Fonseca
493a1bb822 gallium/docs: Make it clear that minIndex, maxIndex is exclusively a index buffer characteristic.
Unlike the indexBias which is specific to a draw call.

This are the semantics of both D3D and GL ARB_draw_elements_base_vertex
extension.
2010-04-20 10:22:28 +02:00
José Fonseca
f1d3f42c47 draw: Fix typo resulting from bad regular expression in index bias addition. 2010-04-20 10:19:42 +02:00
Vinson Lee
49ba607aba draw llvm: Move dereference of pointer after NULL check. 2010-04-20 00:00:52 -07:00
Vinson Lee
11913e9798 draw llvm: Remove unnecessary header. 2010-04-19 23:58:23 -07:00
Dan Nicholson
a69ef34640 egl: Fix demos to build with user specified Xlib
Commit 88be2171e7 fixed the egl demos on the stable branch, but now
they're spread out across multiple subdirectories.

Signed-off-by: Dan Nicholson <dbn.lists@gmail.com>
2010-04-19 20:25:17 -07:00
Dan Nicholson
02224ec4e0 Merge branch '7.8'
Conflicts:
	progs/egl/Makefile

progs/egl/Makefile is gone on master with the egl demos split into
subdirectories. Will require an additional commit.
2010-04-19 20:22:48 -07:00
Dan Nicholson
88be2171e7 egl: Pass flags to locate Xlib headers and libraries
eglplatform.h pulls in Xlib.h on X11 platforms. Likewise, the egl glx
driver and egl programs needs to link to libX11. Make sure we use the
locations the user told us about.

Signed-off-by: Dan Nicholson <dbn.lists@gmail.com>
2010-04-19 20:21:57 -07:00
Dan Nicholson
8e5effefc7 progs: Fix linking of Xlib demos for non-autoconf builds
The Xlib demos were fixed to use $(X11_LIBS) so that configure could
detect the proper directory to link the library from, but this broke
the non-autoconf builds. Give X11_LIBS a default value to fallback on.
(cherry picked from commit e40fce13e1)
2010-04-19 20:21:57 -07:00
Dan Nicholson
4e7a4bed37 Change libX11 variables to not conflict with AC_PATH_XTRA
The variable X_LIBS from AC_PATH_XTRA contains only the -L searchdir
parameter and not the -lX11 to link to Xlib. Use X11 prefixed build vars
for linking with Xlib to avoid the conflict.

Signed-off-by: Dan Nicholson <dbn.lists@gmail.com>
(cherry picked from commit e725ef171b)
2010-04-19 20:21:57 -07:00
Dan Nicholson
4f8bf353bd gallium: Respect user's CFLAGS for including X headers
This can break on systems that don't have a system X installation.

Signed-off-by: Dan Nicholson <dbn.lists@gmail.com>
(cherry picked from commit de4ee20578)

Conflicts:

	src/gallium/winsys/xlib/Makefile
2010-04-19 20:21:57 -07:00
Jeff Smith
3b693fd93f Use X_LIBS from pkg-config, instead of libdir, for locating libX11
Signed-off-by: Jeff Smith <whydoubt@yahoo.com>
Signed-off-by: Dan Nicholson <dbn.lists@gmail.com>
(cherry picked from commit 8d86d395dc)
2010-04-19 20:21:57 -07:00
Brian Paul
35e60aed0b glapi: GL 3.x xml file
Some of the entrypoints defined in other .xml files will need to
be removed in favor of these...
2010-04-19 20:43:00 -06:00
Brian Paul
4c93cd13ba llvmpipe: remove dead code 2010-04-19 17:16:15 -06:00
Brian Paul
bd329d42e8 llvmpipe: use llvmpipe_resource_stride() 2010-04-19 17:15:25 -06:00
Brian Paul
079081222a gallivm: pass 3D texture stride as an array
This should have been included with the previous commit.
2010-04-19 17:14:57 -06:00
Brian Paul
f4071e55db llvmpipe: get 3D texture image stride from an array rather than computing it
This fixes broken 3D texture indexing when the height of the 3D texture
was less than 64 (the tile size).  It's simpler to pass this as an array
(as we do with the row stride) than to compute it on the fly.
2010-04-19 17:07:25 -06:00
Brian Paul
2cad62475b llvmpipe: consolidate some code in llvmpipe_set_texture_image_layout() 2010-04-19 17:07:25 -06:00
Brian Paul
202ff7db49 llvmpipe: fix rendering to 3D textures
Treat cube faces and 3D texture slices in the same manner (they're layed
out out continuously in memory).  Additional clean-ups and improvements
coming.
2010-04-19 17:07:25 -06:00
Brian Paul
ee7cf9d80f llvmpipe: checkpoint: fixes for render to 3D texture 2010-04-19 17:07:25 -06:00
Brian Paul
254dd0c23f llvmpipe: another fix for surface memory allocation
The previous patch broke cube maps.
The logic is a bit clearer now.
2010-04-19 17:07:25 -06:00
Marek Olšák
f189caeed0 r300g: add is_rv350 flag 2010-04-20 00:50:39 +02:00
Eric Anholt
7d21104a8b Remove dead code assignments and variable declarations.
This pass only works on assignments where the variable is never
referenced.  There is no code flow analysis, so it can't do a better
job of avoiding redundant assignments.

For now, the optimizer only does do_dead_code_unlinked(), so it won't
trim the builtin variable list or initializers outside of the scope of
functions.  This is because we don't have the visibility into other
functions that might get linked in in order to eliminate work on
global variables.
2010-04-19 15:33:52 -07:00
Jesse Barnes
35489ef285 Merge branch '7.8' 2010-04-19 14:20:58 -07:00
Jesse Barnes
0a18cdb0ed DRI2: check for swapAvailable before using swap interval protocol
This should have been part of the last change...
2010-04-19 14:20:21 -07:00
Jakob Bornecrantz
35d960cc74 svga: More don't recurse 2010-04-19 21:42:49 +01:00
Jakob Bornecrantz
aa857509bd svga: Translate svga reloc flags to pb flags 2010-04-19 21:42:49 +01:00
Jakob Bornecrantz
2a5667a008 svga: Don't recurse 2010-04-19 21:42:49 +01:00
Brian Paul
0e4f0e8725 draw: remove extra semicolons 2010-04-28 15:27:08 -06:00
Brian Paul
aac6d84056 llvmpipe: free vertex buffer memory in lp_setup_vbuf_destroy() 2010-04-28 15:25:50 -06:00
Brian Paul
bdf753a858 llvmpipe: fix scene queue memory leak 2010-04-28 15:25:50 -06:00
Brian Paul
0728db86bc llvmpipe: fix scene queue memory leak 2010-04-28 15:25:50 -06:00
Brian Paul
7dd44ca5f6 llvmpipe: fix mem leak in llvmpipe_resource_destroy() 2010-04-28 15:25:50 -06:00
Brian Paul
5f53ecb97f llvmpipe: fix surface memory leak during tear-down 2010-04-28 15:25:50 -06:00
Brian Paul
1550de98e6 llvmpipe: remove unused psize_slot field 2010-04-28 15:25:50 -06:00
Brian Paul
3a749b5c09 llvmpipe: move/rename llvmpipe_init_surface_functions() 2010-04-28 15:25:50 -06:00
Brian Paul
8975ade13b llvmpipe: make rasterizer-related functions static, clean-up initializations 2010-04-28 15:25:50 -06:00
Brian Paul
965a604306 llvmpipe: update comments, fix formatting 2010-04-28 15:25:50 -06:00
Brian Paul
dd2fd8ae03 llvmpipe: remove old prototypes, fix-up formatting 2010-04-28 15:25:50 -06:00
Brian Paul
9523d78dde llvmpipe: make shader-related functions static, clean-up initializations 2010-04-28 15:25:50 -06:00
Brian Paul
2176cad7dc llvmpipe: make clip-related functions static, clean-up initializations 2010-04-28 15:25:50 -06:00
Brian Paul
f7885f8f1f llvmpipe: make draw-related functions static, clean-up initializations 2010-04-28 15:25:50 -06:00
Brian Paul
e351e82869 llvmpipe: make vertex-related functions static, clean-up initializations 2010-04-28 15:25:50 -06:00
Brian Paul
8fd794db9e llvmpipe: make blend-related functions static, clean-up initializations 2010-04-28 15:25:50 -06:00
Brian Paul
bfd81b4ebb llvmpipe: make sampler-related functions static, clean-up initializations 2010-04-28 15:25:50 -06:00
Brian Paul
a7e2470843 llvmpipe: remove some unneeded shader structure fields 2010-04-28 15:25:50 -06:00
Brian Paul
ac6725b8f9 llvmpipe: dump shaders if LP_DEBUG=tgsi 2010-04-28 15:25:50 -06:00
Brian Paul
18d1d59484 draw: use a cast wrapper 2010-04-28 15:25:50 -06:00
Brian Paul
35883f4296 draw: put 'create' in the vs varient create function names 2010-04-28 15:25:50 -06:00
Joakim Sindholt
2c512085ab radeong: fix scons build 2010-04-28 21:09:30 +02:00
Brian Paul
dd3b98bdf6 draw: add missing function parameter 2010-04-28 11:43:54 -06:00
Brian Paul
2479c3f3ee softpipe: consolidate tex image offset code 2010-04-28 11:37:51 -06:00
Brian Paul
b73c9ba919 llvmpipe: remove unused write_depth 2010-04-28 11:26:37 -06:00
Brian Paul
ce0844b44c st/mesa: move/improve Mesa GPU program debugging
Print the program (plus its parameters) before calling
st_translate_mesa_program() in case we die in that function.
2010-04-28 10:24:58 -06:00
Brian Paul
e0383d7bb6 st/mesa: add missing debug entry for DEBUG_CONSTANTS 2010-04-28 10:23:47 -06:00
Brian Paul
c7f5c9a3dc Merge branch '7.8'
Conflicts:

	src/mesa/state_tracker/st_gen_mipmap.c
2010-04-28 10:10:51 -06:00
Brian Paul
40dcbb87a9 softpipe: use consistant names for local vars 2010-04-28 10:07:23 -06:00
Brian Paul
331c01ea4d progs/demos: added code to test compressed mipmap generation (disabled) 2010-04-28 10:07:23 -06:00
Brian Paul
347f783606 gallium: remove trailing comma 2010-04-28 10:07:23 -06:00
Brian Paul
608cf0c9f7 gallium/util: convert //-style comments 2010-04-28 10:07:23 -06:00
Brian Paul
443fe5e57c gallium/util: convert //-style comments 2010-04-28 10:07:23 -06:00
Brian Paul
7b640f9f70 st/mesa: fix incorrect RowStride computation
Fixes incorrect stride when getting a compressed tex image.
2010-04-28 10:06:08 -06:00
Brian Paul
56f99ee640 st/mesa: fill in stImage->level in st_generate_mipmap()
Before, this field was always zero for all the new mipmap levels.
Fixes problems with glGetTexImage() from a generated mipmap.
2010-04-28 10:05:06 -06:00
Jakob Bornecrantz
6fc532ae05 Merge branch '7.8' 2010-04-28 16:27:51 +01:00
Jakob Bornecrantz
ef9a8fcb1b glx: Fix build 2010-04-28 16:25:28 +01:00
Jakob Bornecrantz
e42d84eaba glx: Fix build 2010-04-28 16:19:41 +01:00
Jakob Bornecrantz
fe0fe67aaf configure.ac: Print some llvm info 2010-04-28 16:06:17 +01:00
Micah Fedke
9cfaaa291f egl: dri2 driver error output
This patch amends the error output string for the case where the
dri2 egl driver could not open the dri dev node.

Signed-off-by: Brian Paul <brianp@vmware.com>
2010-04-28 07:26:01 -06:00
Brian Paul
1fa7789e82 Merge branch '7.8'
Conflicts:

	src/glx/dri2_glx.c
	src/glx/glx_pbuffer.c
2010-04-28 07:21:25 -06:00
Vinson Lee
37e98e5cd2 llvmpipe: Remove unnecessary header. 2010-04-28 00:14:39 -07:00
Pierre Willenbrock
2787a2e731 Disable scissor when begining meta operations
Signed-off-by: Eric Anholt <eric@anholt.net>
2010-04-27 17:12:39 -07:00
Pierre Willenbrock
6ef6cdec2e Don't set srcLevel on GL_TEXTURE_RECTANGLE_ARB targets
Signed-off-by: Eric Anholt <eric@anholt.net>
2010-04-27 17:12:39 -07:00
Pierre Willenbrock
da498ef41e Fill the padding between entrys in the sampler key
This struct is used to generate a hash, ignoring the entry boundaries.

Signed-off-by: Eric Anholt <eric@anholt.net>
2010-04-27 17:12:39 -07:00
Pierre Willenbrock
d20fce057e Initialize have_back.
There is a user somewhere that tests it before its initial set.

Signed-off-by: Eric Anholt <eric@anholt.net>
2010-04-27 17:12:39 -07:00
Eric Anholt
edad36cff9 i915: Add debugging for just prorgam compile under INTEL_DEBUG=wm 2010-04-27 17:12:38 -07:00
Eric Anholt
891ad6ec1a i915: Provide counts in the error messages for program limits. 2010-04-27 17:12:38 -07:00
Brian Paul
eecd2a59c1 osmesa: update SRC_DIRS to fix build 2010-04-27 17:06:17 -06:00
Brian Paul
29fc97606b osdemos: replace assertion with error handler 2010-04-27 17:05:56 -06:00
Marek Olšák
20c9675994 r300g: move ZTOP to separate file
Ideally, HiZ should go in r300_hyperz.c next to ZTOP.
2010-04-28 01:05:42 +02:00
Brian Paul
c5bf13c537 osmesa: don't need to link with -lGL
The gl entrypoints are in libOSMesa.so
2010-04-27 16:57:43 -06:00
Marek Olšák
7440fd89b4 radeon: fix warnings 2010-04-28 00:38:27 +02:00
Pierre Willenbrock
c0b41116f1 mesa: Disable scissor when begining meta operations
Signed-off-by: Brian Paul <brianp@vmware.com>
2010-04-27 15:58:58 -06:00
Ian Romanick
aa6489bce9 Add missing _ in extension category name 2010-04-27 14:54:32 -07:00
Pierre Willenbrock
717e86738f mesa: Don't set srcLevel on GL_TEXTURE_RECTANGLE_ARB targets
Signed-off-by: Brian Paul <brianp@vmware.com>
2010-04-27 15:54:24 -06:00
Pierre Willenbrok
cc806f70b2 glx: Initialize have_back.
Signed-off-by: Brian Paul <brianp@vmware.com>
2010-04-27 15:53:28 -06:00
José Fonseca
a5e032853a gallium: Drop BGNFOR, ENDFOR, REP, and ENDREP opcodes.
Arcane DX9 opcodes that never were emitted by Mesa and have no DX10
counterpart. Slated for removal for quite some time now.
2010-04-27 21:51:45 +01:00
José Fonseca
84b5f59c97 gallium/docs: Drop BGNFOR, ENDFOR, REP, and ENDREP opcodes. 2010-04-27 21:51:45 +01:00
José Fonseca
73e1405de0 tgsi: Drop BGNFOR, ENDFOR, REP, and ENDREP opcodes. 2010-04-27 21:51:45 +01:00
José Fonseca
ec4e67999c r300: Drop BGNFOR, ENDFOR, REP, and ENDREP opcodes. 2010-04-27 21:51:44 +01:00
José Fonseca
42c9137042 cell: Drop BGNFOR, ENDFOR, REP, and ENDREP opcodes. 2010-04-27 21:51:44 +01:00
José Fonseca
e5395f3359 svga: Drop BGNFOR, ENDFOR, REP, and ENDREP opcodes. 2010-04-27 21:51:44 +01:00
José Fonseca
b3ba54a01a gallivm: Drop BGNFOR, ENDFOR, REP, and ENDREP opcodes. 2010-04-27 21:51:44 +01:00
Jeremy Huddleston
a1cb3babbe Buildfixes to work around issues in OpenGL.framework
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2010-04-27 12:37:16 -07:00
Jeremy Huddleston
f64773010d Update OpenGL specs
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2010-04-27 11:26:51 -07:00
Jeremy Huddleston
f5aa5377a5 apple: Use mesa gl.h rather than generating one.
Signed-off-by: Jeremy Huddleston <jeremyhu@freedesktop.org>
2010-04-27 11:26:51 -07:00
Jeremy Huddleston
de96d063b1 apple: Integrate our libGL into the existing build system better
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2010-04-27 11:26:51 -07:00
Jeremy Huddleston
163901bc7f darwin: Use clientattrib
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2010-04-27 11:26:51 -07:00
Jeremy Huddleston
80b280db88 apple: Change ifdefs for DRI to be DRI && !APPLE
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2010-04-27 11:26:51 -07:00
Jeremy Huddleston
77dc40b289 apple: Remove duplicate headers that already exist in mesa.
Signed-off-by: Jeremy Huddleston <jeremyhu@freedesktop.org>
2010-04-27 11:26:50 -07:00
Jeremy Huddleston
ad503c4155 apple: Initial import of libGL for OSX from AppleSGLX svn repository.
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2010-04-27 11:26:50 -07:00
Brian Paul
ab3e7861ec llvmpipe: remove lp_scene_map_buffers(), lp_scene_unmap_buffers() 2010-04-27 11:50:23 -06:00
Brian Paul
bb527c0af6 llvmpipe: implement max scene size
When the size of the scene (binned data plus referenced resources/textures)
exceeds LP_MAX_SCENE_SIZE flush/render the scene.  This could be improved
in various ways but is a good start.

Fixes piglit streaming-texture-leak test.
2010-04-27 11:44:36 -06:00
Brian Paul
1db3a55b9c llvmpipe: added llvmpipe_resource_size() 2010-04-27 11:32:25 -06:00
Brian Paul
85ab6d2447 llvmpipe: comment-out unused field for now 2010-04-27 11:31:45 -06:00
Brian Paul
d2f0acc2fb llvmipe: update comments 2010-04-27 10:55:51 -06:00
Brian Paul
e485af774e mesa: move/rename is_depth_or_stencil_format()
Put it with other, similar functions.
2010-04-27 09:31:22 -06:00
Brian Paul
f62c738c62 st/mesa: rename var and update st_choose_format() comments 2010-04-27 09:27:00 -06:00
Chia-I Wu
f1381880a8 glapi: Fix loading of old DRI drivers.
The removal of _glapi_noop_enable_warnings and _glapi_set_warning_func
in e4f168a6f4 prevents DRI drivers built
before the commit from loading.  Add stub versions of the functions to
make them load again.
2010-04-27 23:19:27 +08:00
Brian Paul
a965ef59b5 st/mesa: call is_format_supported() for compressed formats
These compressed format switch cases shouldn't be hit if we don't
support the compressed texture extensions, but let's be safe and
ask the driver if they're supported as we do in other cases.
2010-04-27 09:19:02 -06:00
Brian Paul
85d3687ee7 st/mesa: 80-column wrapping 2010-04-27 09:14:32 -06:00
Brian Paul
29edc2a8b5 st/mesa: try to get actual compressed format for GL_COMPRESSED_RGB[A] formats 2010-04-27 09:11:53 -06:00
Brian Paul
7567f05199 Merge branch '7.8'
Conflicts:

	src/gallium/drivers/nv30/nv30_context.c
	src/gallium/drivers/nv40/nv40_context.c
	src/gallium/drivers/nv40/nv40_state_emit.c
2010-04-27 08:34:06 -06:00
Brian Paul
db14a8022a st/mesa: fix strides in (de)compress_image() functions
Mipmap generation for compressed textures works now.
2010-04-27 08:28:55 -06:00
Brian Paul
15c53d1245 util: fix assorted problems in the image packing functions 2010-04-27 08:28:22 -06:00
Pedro Maia
ea373df069 nv30/40g: fix calls to draw_create(), draw_set_rasterizer_state()
Signed-off-by: Brian Paul <brianp@vmware.com>
2010-04-27 08:22:11 -06:00
José Fonseca
992fc62d59 gallivm: Disable llvm.cos.v4f32 and llvm.sin.v4f32 instrinsics on Windows.
Runtime linking doesn't quite work.

Just comment then out for now to prevent crashes. These will go away in
the future because calling 4 times CRT's cosf()/sinf() is over-precise
and under-performing.
2010-04-27 14:27:24 +01:00
José Fonseca
a18c210a95 gallivm: Ensure all allocas are in the first block.
Refactor the code to make this easier.
2010-04-27 13:20:51 +01:00
Jakob Bornecrantz
96df6064b5 i965g: Fix scons build of winsys 2010-04-27 12:17:11 +01:00
Jakob Bornecrantz
8fbd66d75a st/dri: Don't check for null when user ensures non-null 2010-04-27 12:17:11 +01:00
Jakob Bornecrantz
64fa717b18 dri_util: Assume error checking is done properly in glXMakeCurrent
In short what the code did before:

    __DRIscreen *psp = NULL;
    if (pcp)
       psp = pcp->psb;

    assert(psp);
    if (psp->stuff)
       other_stuff();

    return psb->even_more(pcp);

Remove all that stupid checking which still segfaults/asserts later on and
just do what we do in driUnbindContext. Also limited testing show libGL never
call driUnbindContext or driBindContext with cPriv == NULL.
2010-04-27 12:17:11 +01:00
Jakob Bornecrantz
ae79e778f7 st/dri: Use flush function of old context not new 2010-04-27 12:17:11 +01:00
Marek Olšák
b7fa7e8da6 r300g: fix mipmapped texture3D size calculation
I accidentally inverted the condition. :(
Broken since the commit 2579fe4044.
FDO bug #27851.
2010-04-27 12:25:23 +02:00
Marek Olšák
847a24c011 r300g: compensate for non-atomized emit_query_end in the CS
And reserve a little more space just in case.
2010-04-27 12:25:22 +02:00
Vinson Lee
35d52a0626 progs/tests: Remove meaningless const qualifier in arraytexture.c. 2010-04-27 01:22:26 -07:00
Vinson Lee
a7b6a06bf1 nvfx: Move src/gallium/drivers to beginning of SCons include path.
libdrm-2.4.20 and earlier include the nouveau/nouveau_class.h header. A
later version of libdrm will not ship this header. Mesa also has this
header at src/gallium/drivers.

The symbol NV34TCL_VTXFMT_TYPE_HALF is needed by nvfx_vbo.c. This symbol
is not in the libdrm copy of the header but is in the Mesa copy of the
header. This patch moves src/gallium/drivers to the beginning of the
include paths such that when building on hosts with libdrm-2.4.20 or
ealier the build uses the copy in Mesa.
2010-04-27 00:46:00 -07:00
Chia-I Wu
fbfecda6ae progs/egl: Add egl/eglut to PROGRAM_DIRS.
Make sure eglut is built before the demos.  This should work more
reliably with make -j<N>.
2010-04-27 14:19:24 +08:00
Brian Paul
0fcea8a411 docs: update some GL3 status 2010-04-26 20:35:55 -06:00
Brian Paul
84407d7365 mesa: start adding GL 3.1 signed normalized texture formats 2010-04-26 20:35:19 -06:00
Brian Paul
b0e2c5f8aa docs: document updated glext.h and glxext.h files 2010-04-26 20:32:24 -06:00
Brian Paul
4eb803975d glxext.h: upgraded to 2010/02/10 version 2010-04-26 20:32:02 -06:00
Brian Paul
273058b677 glext: upgraded to version 61 2010-04-26 20:31:19 -06:00
Marek Olšák
b1ceadf2ee r300g: reserve CS space for index offset
This has caused CS overflow since the commit
671f1e1229.

TA3D works here again.
2010-04-27 02:45:51 +02:00
Vinson Lee
03b3c10774 llvmpipe: Remove unused variable. 2010-04-26 16:31:05 -07:00
Marek Olšák
307f28cf1e r300g: add support for more unaligned vertex formats
An aligned stride is still needed for it to work.

I am slowly approaching the Sauerbraten milestone!
2010-04-27 00:14:58 +02:00
Marek Olšák
a961431285 r300g: setup PSC first, then align vertex formats
This allows us to put correct swizzles for undefined components in PSC.
2010-04-27 00:06:07 +02:00
Marek Olšák
83b76657b3 r300g: set undefined vertex swizzles to (0,0,0,1) respectively 2010-04-27 00:01:03 +02:00
Zack Rusin
52f145a186 draw/llvm: implement fetch elts paths
we were only running the llvm paths when the input elts were linear,
now we can handle abritrary fetch elts arrays. we do this by generating
two paths - linear and fetch_elts one and just selecting the right one
at run time.
2010-04-26 15:34:16 -04:00
Alex Deucher
3a9717f7c2 r600: add support for more rendering formats 2010-04-26 15:02:13 -04:00
Marek Olšák
3e0f1719d4 r300g: disable point sprites (again)
They cause lockups. The users doesn't seem to like them.
2010-04-26 20:53:17 +02:00
Marek Olšák
304b9e2ccc r300g: fix warnings when printing uint64_t
Though not nice, this is the correct way.
2010-04-26 20:32:38 +02:00
Marek Olšák
7d164fc359 r300g: fix warnings by using the const qualifier
See also the libdrm commit af98ccf4dd5dcb1b904ec32b9bd1521e6bf7dda5.
2010-04-26 20:31:17 +02:00
Matt Turner
30c9bca502 r300g: use CS_OUT_TABLE better
Reviewed-by: Corbin Simpson <MostAwesomeDude@gmail.com>
Signed-off-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Marek Olšák <maraeo@gmail.com>
2010-04-26 20:30:37 +02:00
Alex Deucher
a53e8b7def r600: avoid setting invalid bit on r7xx for blits 2010-04-26 13:45:01 -04:00
Brian Paul
b695cbd57c docs: add links to old mailing list archives 2010-04-23 15:36:40 -06:00
Eric Anholt
71df19f5ef Mark some variables as having usage beyond the shader's scope.
This will be important to optimization passes.  We don't want to
dead-code eliminate writes to out varyings, or propagate uninitialized
values of uniforms.
2010-04-19 11:13:20 -07:00
Zack Rusin
7dfde3aadc draw llvm: make sure use_llvm isn't used when not defined 2010-04-19 13:33:49 -04:00
Zack Rusin
e3e5faba89 draw llvm: fix typo (boolean, not bool) 2010-04-19 13:30:36 -04:00
Brian Paul
05bf77a2da llvmpipe: fix surface memory allocation bug
We weren't always allocating the right amount of memory for image tiles
for some formats (those < 32bpp).

Fixes fd.o bug 27712.
2010-04-19 11:18:51 -06:00
Jesse Barnes
64644ec3b2 Merge branch '7.8' 2010-04-19 09:56:49 -07:00
Jesse Barnes
385e2896eb DRI2: synchronize swap interval with server at startup time
In the direct rendered case, we need to tell the server our initial swap
interval.  If we don't, the local and server values will be out of sync,
since the server and client defaults may be different (as they were
before this patch).
2010-04-19 09:56:32 -07:00
Zack Rusin
4df3e76949 draw llvm: allow runtime switching of pipelines (yes/no to llvm)
use DRAW_USE_LLVM to disable or enable (default) llvm
2010-04-19 12:53:27 -04:00
Zack Rusin
7c4208c3a0 draw llvm: fix constructor mess
use just one constructor to figure out whether to use llvm.
2010-04-19 12:53:27 -04:00
Zack Rusin
deee152363 llvmpipe: enable draw llvm by default 2010-04-19 12:53:27 -04:00
Brian Paul
653c681ce8 gallium/util: specify binding type for blit src texture
Fixes fd.o bug 27711.
2010-04-19 10:32:25 -06:00
Brian Paul
96b0807253 mesa: unmap the immediate mode VB before destroying it
Fixes failed assertion from fd.o bug 27713.

The assertion was added with the new resource/transfer changes.
This patch could apply to the 7.8 branch but it's not essential.
2010-04-19 10:27:57 -06:00
José Fonseca
dfadf5a579 r300g: Adapt for index bias interface change. 2010-04-19 18:18:45 +02:00
José Fonseca
7c785c0d2c nvfx: Adapt for index bias interface change. 2010-04-19 18:18:28 +02:00
José Fonseca
f6f7324bbf nv50: Adapt for index bias interface change. 2010-04-19 18:17:45 +02:00
José Fonseca
583f51ba4b retrace: Support index bias. 2010-04-19 18:17:11 +02:00
José Fonseca
17a43c1718 mesa/st: Update for index bias interface change. 2010-04-19 18:16:57 +02:00
José Fonseca
5620216c98 st/python: Use index bias. 2010-04-19 18:16:34 +02:00
José Fonseca
8b658580ee trace: Implement index bias. 2010-04-19 18:16:20 +02:00
José Fonseca
9515b78859 svga: Implement index bias.
Untested.
2010-04-19 18:16:08 +02:00
José Fonseca
989861fc5e softpipe: Implement index bias. 2010-04-19 18:15:39 +02:00
José Fonseca
d27a53d469 llvmpipe: Implement index bias. 2010-04-19 18:15:11 +02:00
José Fonseca
382e9cc07b identity: Implement index bias. 2010-04-19 18:15:05 +02:00
José Fonseca
9ca0f45d8a i965g: Implement index bias. 2010-04-19 18:14:58 +02:00
José Fonseca
1e7facdd8f i915: Implement index bias. 2010-04-19 18:14:48 +02:00
José Fonseca
f8d4638a09 failover: Implement index bias. 2010-04-19 18:14:35 +02:00
José Fonseca
150d12679d cell: Implement index bias. 2010-04-19 18:14:23 +02:00
José Fonseca
2197fac47c draw: Implement index bias. 2010-04-19 18:14:04 +02:00
Brian Paul
c060265bdb st/mesa: invert scissor rect depending on FB orientation
Fixes fd.o bug 27715
2010-04-19 10:10:47 -06:00
Matthieu Herrb
cf7d08b443 mesa: Fix build with gcc 3.3.
Signed-off-by: Brian Paul <brianp@vmware.com>
2010-04-19 09:33:53 -06:00
Matthieu Herrb
f4553d99c6 radeon: Let this build with gcc 3.3
Declaring the loop index inside for () is not supported by this version.

Signed-off-by: Brian Paul <brianp@vmware.com>
2010-04-19 09:33:53 -06:00
Owain Ainsworth
c39ab02ae9 radeon: Fix command type for DRM_RADEON_IRQ_EMIT ioctl.
This should be drmCommandWriteRead to avoid an EINVAL error on systems
that strictly check ioctl args. This command has been r/w for ever.
Discussion with airlied agreed that this was the correct course.

Signed-off-by: Brian Paul <brianp@vmware.com>
2010-04-19 09:33:50 -06:00
Matthieu Herrb
7f1ae3a94d mesa: Use __OpenBSD__ to check for OpenBSD.
Signed-off-by: Brian Paul <brianp@vmware.com>
2010-04-19 09:33:42 -06:00
Brian Paul
a59771fb53 llvmpipe: triangle function comments 2010-04-19 08:53:13 -06:00
Brian Paul
62c9587385 gallium/draw: use a local var to simplify some code 2010-04-19 08:53:13 -06:00
Brian Paul
44519e18a4 softpipe: add option to do polygon stipple in softpipe vs. draw module
For debugging purposes.
2010-04-19 08:51:07 -06:00
Brian Paul
8f3bdeaad6 Merge branch '7.8'
Conflicts:

	src/gallium/auxiliary/draw/draw_context.c
	src/gallium/auxiliary/draw/draw_pipe_aaline.c
	src/gallium/drivers/llvmpipe/lp_context.c
2010-04-19 08:45:20 -06:00
Brian Paul
e3a34cc7f6 gallium/draw: use correct rasterization state for wide/AA points/lines
When points or lines are decomposed into triangles, we need to be sure
to disable polygon culling, stippling, "un-filled" modes, etc.

This patch sets the rasterization state to disable those things prior to
drawing points/lines with triangles, then restores the previous state
afterward.

The new piglit point-no-line-cull test checks this problem & solution.
2010-04-19 08:35:53 -06:00
José Fonseca
857c7c7ca2 docs: Document indexBias. 2010-04-19 15:08:14 +02:00
Dave Airlie
f7c2d4fee3 r300c/r300g: add 3155 rv380 pci id 2010-04-19 19:23:19 +10:00
Vinson Lee
7f8676c0b0 gallivm: Remove redundant initialization of dst_vec_type.
dec_vec_type is already initialized to lp_build_vec_type(dst_type) at
its declaration.
2010-04-19 00:35:02 -07:00
Vinson Lee
57e71b8502 nv50: Fix include recursion.
Don't include nv50_context.h and use a forward declaration instead.
nv50_context.h includes nv50_screen.h (itself).
2010-04-19 00:05:57 -07:00
José Fonseca
c184da9505 gallium: Add index bias parameter to draw_elements and friends.
indexBias corresponds to:
- BaseVertexIndex parameter of D3D9's
  IDirect3DDevice9::DrawIndexedPrimitive method
- BaseVertexLocation parameter of ID3D10Device::DrawIndexed

Although a positive indexBias can be easily be implemented in Gallium by
adding indexBias*stride to each vertex buffer base offset, a negative
indexBias cannot, as the final vertex buffer offset could be negative.

I'm not aware of this functionality being exposed to GL drivers, so for
now all hardware drivers will just assert(indexBias == 0).

See also:
- http://msdn.microsoft.com/en-us/library/bb174369.aspx (D3D9)
- http://msdn.microsoft.com/en-us/library/ff556126.aspx (D3D10 DDI)
2010-04-19 08:56:46 +02:00
Vinson Lee
11cea8196c nvfx: Fix include recursion.
Don't include nvfx_context.h and use a forward reference instead.
nvfx_context.h includes nvfx_screen.h (itself).
2010-04-18 23:44:24 -07:00
Vinson Lee
478f19ff49 auxiliary: Move loop variable declaration outside for loop.
Fixes MSVC build.
2010-04-18 23:21:07 -07:00
Vinson Lee
c628a2e0c7 nvfx: Add missing header and forward declaration. 2010-04-18 23:09:31 -07:00
Vinson Lee
b2fc623497 nouveau: Add missing header. 2010-04-18 23:00:45 -07:00
Vinson Lee
5b83e0ea04 r300g: Remove unnecessary headers. 2010-04-18 22:51:35 -07:00
Vinson Lee
c61db7d200 i915g: Remove unnecessary header. 2010-04-18 22:49:55 -07:00
Vinson Lee
aa5be94139 auxiliary: Initialize variable. 2010-04-18 22:45:18 -07:00
Vinson Lee
349c168a6e auxiliary: Add util/u_surfaces.c to SCons build.
This was missed in commit ac4b8db62d.
2010-04-18 22:38:53 -07:00
Brian Paul
1aaf41fd8a st/mesa: s/st_get_stobj_texture/st_get_stobj_resource/ 2010-04-18 18:02:42 -06:00
Brian Paul
c3016dcee5 st/mesa: s/st_get_texobj_texture/st_get_texobj_resource/ 2010-04-18 18:02:42 -06:00
Brian Paul
5d3d63d45a st/mesa: remove st_texture_object::pipe field
Just pass the pipe context to st_get_texture_sampler_view()
as is done for st_get_renderbuffer_sampler_view().
2010-04-18 18:02:42 -06:00
Brian Paul
073048c872 st/mesa: s/st_renderbuffer_get_sampler_view/st_get_renderbuffer_sampler_view/ 2010-04-18 18:02:42 -06:00
Brian Paul
ef9a619ba9 st/mesa: s/st_sampler_view_from_texture/st_create_texture_sampler_view/ 2010-04-18 18:02:42 -06:00
Brian Paul
8a7ea577ac st/mesa: s/st_get_stobj_sampler_view/st_get_texture_sampler_view/ 2010-04-18 18:02:42 -06:00
Marek Olšák
ec719ae199 r300g: implement TRUNC as floor 2010-04-19 00:36:20 +02:00
Marek Olšák
394803b2cd r300/compiler: lower CEIL 2010-04-19 00:36:20 +02:00
Marek Olšák
e53a1576dd r300/compiler: enable branch emulation for vertex shaders 2010-04-19 00:36:19 +02:00
Marek Olšák
ebd05a798e r300/compiler: optimize CMP for vertex shaders a bit 2010-04-19 00:35:26 +02:00
Nicolai Hähnle
65fd6fb204 r300/compiler: Use memory_pool_array_reserve in deadcode elimination
Signed-off-by: Nicolai Hähnle <nhaehnle@gmail.com>
2010-04-19 00:34:02 +02:00
Nicolai Hähnle
0321f9c6f1 r300/compiler: Use memory_pool_array_reserve in r500-fragprog_emit
Signed-off-by: Nicolai Hähnle <nhaehnle@gmail.com>
2010-04-19 00:34:02 +02:00
Marek Olšák
340e5e65dc r300/compiler: enable branch emulation for R500 fragment programs 2010-04-19 00:34:02 +02:00
Nicolai Hähnle
4d7ed84431 r300/compiler: Implement branch emulation for R300 fragment programs
Signed-off-by: Nicolai Hähnle <nhaehnle@gmail.com>
2010-04-19 00:34:02 +02:00
Luca Barbieri
eeabe9d179 u_inlines: split pipe_surface_init in pipe_surface_reset and *_init 2010-04-18 22:58:09 +02:00
Brian Paul
0490116f96 tgsi: add comment about potential code removal 2010-04-18 10:02:11 -06:00
Brian Paul
8fd0e453d7 softpipe: new comment and assertion for face value 2010-04-18 10:02:11 -06:00
Brian Paul
1673bb38bb tgsi: replace 0xf with TGSI_WRITEMASK_XYZW 2010-04-18 10:02:11 -06:00
Brian Paul
10e4ec448e softpipe: fix computation of fragment[FACE] attribute
In TGSI, front facing is +1 and back-facing is -1.  We were computing
this attribute as +1 and 0 before.  However, the value isn't actually
used anywhere because we machine->Face attribute overrides it in
tgsi_exec.c.  That could be changed, removing some special-case code...
2010-04-18 10:02:11 -06:00
Brian Paul
6756c07b66 softpipe: clean-up and comments 2010-04-18 10:02:11 -06:00
Brian Paul
b806c3056f softpipe: document MAX_QUADS 2010-04-18 10:02:11 -06:00
Marek Olšák
24ceef7a69 r300g: more solid is_buffer_referenced implementation
This fixes crash from 7a1b5c937f,
and also removes the unused "map" pointer.
2010-04-18 17:49:12 +02:00
Luca Barbieri
cea7b9f937 u_surfaces: silence warning 2010-04-18 17:35:17 +02:00
Marek Olšák
69d8b6d5fb Revert "r300g: save vertex buffers around u_blitter calls"
Not sure why it crashes.
2010-04-18 17:02:39 +02:00
Brian Paul
5acee66023 nvfx: move declarations before code 2010-04-18 08:43:42 -06:00
Brian Paul
27322eeb73 nvfx: fix void * arithmetic warning 2010-04-18 08:41:51 -06:00
Brian Paul
b74f4bc6b8 nvfx: move declarations before code 2010-04-18 08:41:25 -06:00
Brian Paul
d84b8cb1a8 llvmpipe: update comment 2010-04-18 08:38:19 -06:00
Brian Paul
d7c336dc49 nvfx: move declarations before code to silence warnings 2010-04-18 08:38:03 -06:00
Luca Barbieri
f9ea7a2ea9 auxiliary: add util_dirty_surfaces to track dirty render temporaries 2010-04-18 16:23:11 +02:00
Luca Barbieri
ac4b8db62d auxiliary: add util_surfaces to track a resource's pipe_surface structs 2010-04-18 16:23:11 +02:00
Luca Barbieri
24af25df2b u_inlines: add function to initialize pipe_surface 2010-04-18 16:23:11 +02:00
Luca Barbieri
2ac088141a nvfx: fix fragment program constant updates 2010-04-18 16:23:11 +02:00
Marek Olšák
7a1b5c937f r300g: do not tell st that a buffer is referenced by hw
It saves a few libdrm calls and unnecessary flushes.
2010-04-18 16:09:21 +02:00
Luca Barbieri
bc8fa67926 r300g: save vertex buffers around u_blitter calls
Not strictly needed by the Mesa state tracker, but needed in general.

Only compile tested.
2010-04-18 15:29:23 +02:00
Luca Barbieri
64aa67a360 u_blitter: add support for saving vertex buffers
Currently r300g does not save vertex buffer on blitter calls.

It gets away with it because the current Mesa state tracker usually
resets vertex buffers on every draw calls.

However, this is wrong.

nvfx won't be lucky because it needs to use the blitter inside draw
calls.
2010-04-18 15:29:23 +02:00
Luca Barbieri
5df6c43061 p_compiler: add likely/unlikely macros
Defined like the Linux kernel.

A explanatory comment is included.
2010-04-18 15:29:21 +02:00
Dave Airlie
851edfe3c9 r300g: fixup 0 stride buffer properly.
Just set the max index to 1, this lets doom3 run and seems correct,
though it would be better to just emit a constant like SVGA does.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-04-18 18:51:10 +10:00
José Fonseca
4b148bcf5e llvmpipe: Emit only the vertex attributes necessary for the FS, and ensure the first one is always position.
With this we correctly handle vertex shaders whose output position is not
in index zero.
2010-04-18 10:36:28 +02:00
José Fonseca
4272c01fbf softpipe: Preserve/check the signal of the number of scanlines in an edge.
It can become negative in some weird triangles.
2010-04-18 10:36:28 +02:00
José Fonseca
b609cfc7c9 draw: Cosmetic cleanups and comments. 2010-04-18 10:36:28 +02:00
José Fonseca
d036e9312f retrace: Fix vertex/index/constant buffer dumping. 2010-04-18 10:36:28 +02:00
José Fonseca
53c3c914a7 trace: Handle transfers with zero strides correctly. 2010-04-18 10:36:28 +02:00
José Fonseca
4b95c9549d st/python: Set the bind flag for the default texture. 2010-04-18 10:36:28 +02:00
José Fonseca
5c898af870 retrace: Remove deprecated code. 2010-04-18 10:36:28 +02:00
José Fonseca
6aae062bdf mesa: Restore comment too. 2010-04-18 10:36:28 +02:00
Vinson Lee
4e98116c23 glsl: Fix handling of OPCODE_PRINT for no registers case.
A register file value is unsigned so could never be -1. A
value of 0 also aliased to PROGRAM_TEMPORARY.

If an OPCODE_PRINT has no registers to print, set the register
file value to PROGRAM_UNDEFINED and check for that value when
executing this instruction.
2010-04-18 00:11:49 -07:00
Vinson Lee
4485dd8a3e i965: Assert that an OPCODE_IF was seen before an OPCODE_ELSE. 2010-04-17 23:48:37 -07:00
Vinson Lee
010f81f32b st/dri: Check for NULL before dereference and assignment. 2010-04-17 23:40:14 -07:00
Vinson Lee
63c6d6add1 nvfx: Initialize variables. 2010-04-17 23:25:47 -07:00
Vinson Lee
0268e8984c r300g: Cast rbuf->user_buffer to 'uint8_t *' before arithmetic.
Fixes this SCons build error.
"pointer of type 'void *' uses in arithmetic"
2010-04-17 22:44:35 -07:00
Vinson Lee
fe52b585f2 nvfx: Remove unused variables. 2010-04-17 22:23:25 -07:00
Vinson Lee
891e9d6f3f nv50: Initialize variables.
Silences GCC uninitialized variable warnings.
2010-04-17 21:21:31 -07:00
Vinson Lee
b054d7912d nv50: Remove unused variable. 2010-04-17 20:39:03 -07:00
Jakob Bornecrantz
5db285b742 i915g: Remove broken power of two function 2010-04-18 02:50:35 +01:00
Jakob Bornecrantz
d14c4ca209 i915g: Add some helper functions
Mostly to make the lines not so long.
2010-04-18 02:50:35 +01:00
Jakob Bornecrantz
ed94e744d3 i915g: Fix cubemap layouts 2010-04-18 02:50:35 +01:00
Jakob Bornecrantz
762ed4db47 i915g: Clean and add some debug printing
Disabled by default
2010-04-18 02:50:35 +01:00
Jakob Bornecrantz
29ff6e87f5 gallium/tests: Make trivial apps depend on libs 2010-04-18 02:50:35 +01:00
Marek Olšák
0b4df63609 r300g: various other cleanups
It seems to me that the resource management code is the most blurry.

Also some of my notes about fastfill are wrong, removing them too.
2010-04-18 02:56:09 +02:00
Marek Olšák
d3e7dfc1fd r300g: inline screen_buffer functions 2010-04-18 02:56:09 +02:00
Marek Olšák
9f2f6096a8 r300g: remove unused declarations 2010-04-18 02:56:09 +02:00
Marek Olšák
5b609badf7 r300g: add debugging options "notiling" and "noimmd" (for testing)
notiling = Disable texture tiling
noimmd = Disable immediate mode (this optimization was really worth it!)
2010-04-18 02:56:09 +02:00
Marek Olšák
4185d9770f r300g: remove r300_transfer::ctx 2010-04-18 02:56:09 +02:00
Marek Olšák
bb4f5fff0c r300g: remove use of c++ keywords 2010-04-18 02:56:09 +02:00
Marek Olšák
c383defdaa r300g: always create microtiled zbuffer regardless of texture dimensions 2010-04-18 02:56:09 +02:00
Vinson Lee
65a3c316ba i915g: Remove unnecessary headers. 2010-04-17 15:47:45 -07:00
Vinson Lee
e68c6be2f6 nvfx: Remove unnecessary headers. 2010-04-17 15:14:47 -07:00
Vinson Lee
c5e4a6dc9d nv50: Remove redundant assignment. 2010-04-17 14:49:40 -07:00
Vinson Lee
f426295521 i965g: Remove redundant assert. 2010-04-17 14:45:49 -07:00
Vinson Lee
35aae6839e os: Implement pipe_barrier for POSIX platforms without pthread_barrier_t.
This patch was tested on Mac OS X.
2010-04-17 14:24:23 -07:00
Jakob Bornecrantz
44bafca1a0 i915g: Add a software only debuging winsys 2010-04-17 21:13:23 +01:00
Jakob Bornecrantz
3e3d6864da gallium/tests: Fix trivial examples 2010-04-17 21:13:23 +01:00
Jakob Bornecrantz
08f2a6cad1 gallium/util: Ignores 2010-04-17 21:13:22 +01:00
Jakob Bornecrantz
a656f2f0f3 progs/tests: Ignores 2010-04-17 21:13:22 +01:00
Vinson Lee
0a2ae64b77 r300/compiler: Remove unnecessary header. 2010-04-17 12:13:19 -07:00
Vinson Lee
f6f78fac9e draw llvm: Remove unnecessary header. 2010-04-16 23:25:25 -07:00
Vinson Lee
d6c024ea3f llvmpipe: Remove unnecessary header. 2010-04-16 23:08:52 -07:00
Vinson Lee
6be186a6fa r300/compiler: Add radeon_program_tex.c to SCons build.
This was missed in commit f8a1418680.
2010-04-16 22:58:49 -07:00
Marek Olšák
411d506332 r300/compiler: add emulation of all mirrored-clamp wrap modes for NPOT textures 2010-04-17 02:43:47 +02:00
Marek Olšák
f91a06eed2 r300/compiler: replace mirrored-repeat emulation with a faster version
Also, the Negate bitfield was 1 instead of RC_MASK_XYZ in the previous
version, causing incorrect rendering.
2010-04-17 02:11:46 +02:00
Ian Romanick
484606610e While-loops also start a new scope. 2010-04-16 16:42:43 -07:00
Marek Olšák
a94942e379 r300/compiler: add handy definitions for XYZ0 and smeared half swizzling 2010-04-17 01:31:25 +02:00
Eric Anholt
44b694e1f6 Avoid generating ir_if for &&, || short-circuiting with constant LHS.
It was breaking constant expression detection for constant
initializers, i.e. CorrectParse2.frag, CorrectParse2.vert.
2010-04-16 13:49:04 -07:00
Marek Olšák
47265e69c8 r300/compiler: make ARB_shadow_ambient optional
This saves constant register space for r300g, which doesn't need
this feature.
2010-04-16 22:35:56 +02:00
Brian Paul
862d014ba9 llvmpipe: fix color masking 2010-04-16 14:08:26 -06:00
Eric Anholt
0d42321ec1 Add support for inlining calls done inside of expressions. 2010-04-16 12:56:18 -07:00
Marek Olšák
b2c1b944c9 r300/compiler: restore r500-specific bits of TEX transformations 2010-04-16 21:55:00 +02:00
Brian Paul
056df21cb1 llvmpipe: fix linking for lp_test_blend 2010-04-16 13:34:41 -06:00
Brian Paul
a57e762c90 llvmpipe: work-around an LLVM bug
The blend combinations ZERO,DST_ALPHA and ZERO,INV_DST_ALPHA seem to
generate bad code which leads to a segfault.
2010-04-16 13:34:28 -06:00
Brian Paul
1a44ec5e36 llvmpipe: clean-up lp_surface_copy()
Remove unreachable code, etc from previous revisions.
2010-04-16 13:07:17 -06:00
Brian Paul
1c4415ddf4 llvmpipe: remove unneeded declaration (which caused a warning) 2010-04-16 13:01:51 -06:00
Brian Paul
4593e0c85e llvmpipe: use unsigned type to avoid warnings 2010-04-16 13:01:18 -06:00
Brian Paul
b7c5e9b336 gallium/draw: fix breakage from moving lp_bld_* files 2010-04-16 12:58:40 -06:00
Brian Paul
23a2166bc5 llvmpipe: remove unneeded break stmt 2010-04-16 12:20:27 -06:00
Brian Paul
92b2af5f9a llvmpipe: fix compilation, linking of lp_test_blend 2010-04-16 11:14:43 -06:00
Brian Paul
39a12a7326 llvmpipe: updated #includes 2010-04-16 10:34:32 -06:00
Brian Paul
d75129dd13 gallivm/llvmpipe: move lp_bld_blend* files to llvmpipe/ directory 2010-04-16 10:28:21 -06:00
Brian Paul
7a05161278 gallivm/llvmpipe: move lp_bld_alpha.c to llvmpipe/ directory 2010-04-16 10:22:33 -06:00
Brian Paul
f17d1513ac gallivm/llvmpipe: move lp_bld_depth.[ch] to llvmpipe/ directory
This is specific to the llvmpipe driver and not re-usable.
2010-04-16 10:20:32 -06:00
Brian Paul
cf88dcf731 gallivm/llvmpipe: move lp_bld_interp.c to llvmpipe/ directory
This file is specific to the llvmpipe driver and not re-usable.
2010-04-16 10:17:38 -06:00
Brian Paul
d293c43c9a llvmpipe: rename vars, update comments for texture->resource changes 2010-04-16 10:01:32 -06:00
Brian Paul
cbe1145011 gallivm: init some vars to silence warnings 2010-04-16 09:56:38 -06:00
Brian Paul
ce4f4d6b2c llvmpipe: plug in draw's polygon stipple stage 2010-04-16 09:49:52 -06:00
Brian Paul
9fae289fcd llvmpipe: check for dirty context state in lp_setup_update_state()
This fixes problems with the draw module's aaline, aapoint and
pstipple stages where we change some driver state after the call
to the draw module's draw_arrays() function.
2010-04-16 09:49:33 -06:00
Brian Paul
b387f74c38 llvmpipe: flush upon PIPE_FLUSH_TEXTURE_CACHE too 2010-04-16 09:43:32 -06:00
Brian Paul
b7bd4b85f3 llvmpipe: make sure state is up to date before getting vertex layout/info
Some of the draw pipeline stages emit additional vertex attributes.
Without this change, we were getting stale vertex info that didn't
include the extra attributes.
2010-04-16 09:43:32 -06:00
Brian Paul
7d5da2370b llvmpipe: additional texture assertion 2010-04-16 09:27:58 -06:00
Brian Paul
8ba14fab9a llvmpipe: print_triangle() func (disabled) 2010-04-16 09:27:58 -06:00
Brian Paul
e960dd7b30 softpipe: rename vars, update comments, etc
Use 'resource' instead of 'texture', etc.
2010-04-16 09:27:58 -06:00
Brian Paul
1f67782afa st/mesa: add prototype for st_bufferobj_validate_usage() 2010-04-16 09:27:58 -06:00
Brian Paul
08e91bbfa1 softpipe: s/template/templat/ to avoid potential C++ issues 2010-04-16 09:27:58 -06:00
Brian Paul
0639765b28 Merge the lp-surface-tiling branch into master.
This branch implemented dual representations of texture/drawing surfaces:
one in the conventional linear layout and the other the tiled layout which
is used by the fragment shader pipe.  Per-tile flags indicate the layout
of each image tile.  In many situations this lets us avoid converting
image data between the two layouts.

Squashed commit of the following:

commit 563a7e3cc552fdcfcaf9ac0d4b1683c3ba2ae732
Author: Brian Paul <brianp@vmware.com>
Date:   Thu Apr 8 14:48:21 2010 -0600

    llvmpipe: convert points/lines to triangles with draw module

    This isn't the most efficient way to render points/lines but it allows us
    to run more tests.

commit a8aa763e8a717533f2b13bb6ea53cbccbede68c9
Author: Brian Paul <brianp@vmware.com>
Date:   Thu Apr 8 14:47:28 2010 -0600

    llvmpipe: call llvmpipe_get_texture_tile() for depth/stencil

    The returned pointer isn't used, but the tile status/layout info
    gets updated.  Helps to fix glReadPixels(DEPTH / STENCIL).

commit 463bc64af266194acbea71cd52e26a79b8c8a260
Author: Brian Paul <brianp@vmware.com>
Date:   Thu Apr 8 10:58:48 2010 -0600

    llvmpipe: add store_color to debug cmd_names list

commit 784cc73fb334a9d7b7c93cbd8a1445cdf742ff58
Author: Brian Paul <brianp@vmware.com>
Date:   Thu Apr 8 10:57:43 2010 -0600

    llvmpipe: fix debug build

commit 792c93171ec075664f55720ffed397ac2834a4fc
Author: Brian Paul <brianp@vmware.com>
Date:   Thu Apr 8 10:49:01 2010 -0600

    llvmpipe: fix cube mapping

commit 882b1035db88c3dd8aebe28dc971ac30a9ee39e3
Author: Brian Paul <brianp@vmware.com>
Date:   Thu Apr 8 09:53:30 2010 -0600

    llvmpipe: remove some older/unused code

commit b807d32b23145301e8842824664d9f06b9c5502e
Author: Brian Paul <brianp@vmware.com>
Date:   Thu Apr 8 09:29:50 2010 -0600

    llvmpipe: silence warning

commit 7b337e64fec92836ccdf9d96216289dd58418e35
Author: Brian Paul <brianp@vmware.com>
Date:   Wed Apr 7 17:06:08 2010 -0600

    llvmpipe: clean-up, comments in lp_surface_copy()

commit c52fa36f249cc652fa8d5fdd94d6574127c08c41
Author: Brian Paul <brianp@vmware.com>
Date:   Wed Apr 7 16:51:42 2010 -0600

    llvmpipe: overhaul tiled/linear memory management

    Now we keep per-tile layout info (linear vs. tiled (or neither or both)
    and convert from one layout to the other on demand.

commit 4a50ccfd470547c9be0704005818a87014e9c0e9
Author: Brian Paul <brianp@vmware.com>
Date:   Wed Apr 7 16:51:27 2010 -0600

    llvmpipe: added tile read/write counters

commit b7d0ea9c687ac8773b083791623826fa604adf21
Author: Brian Paul <brianp@vmware.com>
Date:   Mon Apr 5 14:54:04 2010 -0600

    llvmpipe: rename some functions

commit ee45c6e5b95cbd3c8cccc9aa4d45d8aef11e20c4
Author: Brian Paul <brianp@vmware.com>
Date:   Mon Apr 5 14:42:15 2010 -0600

    llvmpipe: re-org some get block/tile pointer code

commit 26ce97c16c0b6520ff1538803baa772d8c3b1280
Author: Brian Paul <brianp@vmware.com>
Date:   Mon Apr 5 14:34:13 2010 -0600

    llvmpipe: disable bad assertions

commit 5c670481248c4d46f87f13bf3af5655925e7002d
Author: Brian Paul <brianp@vmware.com>
Date:   Fri Apr 2 16:36:11 2010 -0600

    llvmpipe: add a special-case optimization to lp_surface_copy()

    Be more efficient when copying tiled image to linear image.
    Before, the fallback path was always converting the whole source image
    to linear.  Now we can convert just a sub region.

commit faa684645e64d6024b3a11e4e08da825e8220b2e
Author: Brian Paul <brianp@vmware.com>
Date:   Fri Apr 2 16:15:16 2010 -0600

    llvmpipe: assorted texture and tile/line conversion code change s

    The tiled/linear conversion functions take x/y positions now to
    allow converting only sub-regions.

    More texture-related helper functions.

commit baad81ec5318d44bfac1e37c7643afc0836607bb
Author: Brian Paul <brianp@vmware.com>
Date:   Tue Mar 30 13:18:40 2010 -0600

    llvmpipe: convert tiled->linear upon PIPE_FLUSH_SWAPBUFFERS

    If we know we're about to do a swapbuffers we should immediately
    convert the tiled color tiles to linear instead of later in
    llvmpipe_texture_unmap() since we can take advantage of threading/
    parallelism here.

commit 928dd41256811daeddb7506a49a34dbad04beaf8
Author: Brian Paul <brianp@vmware.com>
Date:   Tue Mar 30 09:16:58 2010 -0600

    llvmpipe: polish-up the llvmpipe_flush() code

commit dd6014abcf86c517d159b8175e0eaeb167ea2ef6
Author: Brian Paul <brianp@vmware.com>
Date:   Tue Mar 30 09:15:17 2010 -0600

    llvmpipe: SETUP_x enum clean-up

commit 0b1ce6da2b28a41f3389685ab93e10b43c950f5d
Author: Brian Paul <brianp@vmware.com>
Date:   Fri Mar 26 10:43:37 2010 -0600

    llvmpipe: remove unused vars

commit 4562663480f88162ed4452cb05569eecb67f9f39
Author: Brian Paul <brianp@vmware.com>
Date:   Fri Mar 26 10:31:55 2010 -0600

    llvmpipe: cope with non-existant color/depth buffers

    The fragment jit functions always grab these pointers, even if they're
    not used.

commit df4329edbaf204ed501f1eac0698b8198178f9af
Author: Brian Paul <brianp@vmware.com>
Date:   Thu Mar 25 15:20:15 2010 -0600

    llvmpipe: do all render target surface mapping/unmapping in the rast code

commit 3d0c25d5ba8b8f61e8366d4c97324e45d526ff41
Author: Brian Paul <brianp@vmware.com>
Date:   Thu Mar 25 14:31:21 2010 -0600

    llvmpipe: map z/stencil buffer on demand like color buffers

    Plus lots of code clean-up and loose ends taken care of.

commit c3b6fddd788aef09b4b84b843b7b1272231151e8
Author: Brian Paul <brianp@vmware.com>
Date:   Thu Mar 25 13:15:03 2010 -0600

    llvmpipe: remove unused write_zstencil field

commit 63374d97836926a6357e9d6dd24a509a8e155c56
Author: Brian Paul <brianp@vmware.com>
Date:   Thu Mar 25 09:45:59 2010 -0600

    llvmpipe: add missing lp_rast_end() call

    Fixes crash on window resize when LP_NUM_THREADS=0.

commit 92fe9952161cc06f6edc58778e9e5a8b9ea447dc
Author: Brian Paul <brianp@vmware.com>
Date:   Wed Mar 24 10:15:19 2010 -0600

    llvmpipe: add tiled/linear conversion for 16-bit Z images

commit 6605fa28c147f30df351da0e4413cab33e4db5da
Author: Brian Paul <brianp@vmware.com>
Date:   Tue Mar 23 16:06:41 2010 -0600

    llvmpipe: implement tiled/linear conversion for Z/stencil images

commit 804528d84ffa292ef9d49d3666cdd3fa099ff3ff
Author: Brian Paul <brianp@vmware.com>
Date:   Tue Mar 23 16:05:45 2010 -0600

    llvmpipe: added texture stride comment

commit 66a88c012edf670c4ac887a912f02dcff93266dd
Author: Brian Paul <brianp@vmware.com>
Date:   Tue Mar 23 16:04:07 2010 -0600

    llvmpipe: remove unused vars

commit e2ca8d1328316dc8b36d5f688c16d109e49a6870
Author: Brian Paul <brianp@vmware.com>
Date:   Mon Mar 22 18:53:11 2010 -0600

    llvmpipe: checkpoint WIP: overhaul texture/surface mapping

    Conversion between tiled and linear surfaces is working everywhere now.
    The LP_TEXTURE_READ/READ_WRITE/WRITE_ALL flags let us avoid unnecessary
    image layout conversions.

    Still some loose ends, temporary/debug code, etc.
    Need to implement tiled/linear conversion for depth/stencil images.

commit f2730a03839ee8984c1f537b7cbebba24961397a
Author: Brian Paul <brianp@vmware.com>
Date:   Mon Mar 22 14:41:58 2010 -0600

    llvmpipe: rename/repurpose lp_rast_store_color()

commit e192a47552c5d20d2caef452ca7697e2cd852c9b
Author: Brian Paul <brianp@vmware.com>
Date:   Mon Mar 22 14:38:51 2010 -0600

    llvmpipe: remove lp_rast_load_color()

commit 3cff0bde4b4ab980e1c3e812700419091527c76b
Author: Brian Paul <brianp@vmware.com>
Date:   Mon Mar 22 14:11:38 2010 -0600

    llvmpipe: remove/consolidate texture image code

commit 3a2f08b6a550c69ef5e874f482be30252cbf8bfa
Author: Brian Paul <brianp@vmware.com>
Date:   Fri Mar 19 17:03:14 2010 -0600

    llvmpipe: checkpoint WIP: directly render to tiled texture buffers

    We're now directly writing colors into the tiled texture image buffers.

    This is a checkpoint commit with lots of dead code and temporary hacks.
    Everything will get cleaned up eventually.

commit c5ca987e03870849514d4e3c99af143722a09695
Author: Brian Paul <brianp@vmware.com>
Date:   Fri Mar 19 16:41:14 2010 -0600

    llvmpipe: refactor code, create tile_pixel_offset()

commit 2133e8273e937cbac09cd7264d6ce53af9764ddb
Author: Brian Paul <brianp@vmware.com>
Date:   Fri Mar 19 14:55:11 2010 -0600

    llvmpipe: pass LP_TEXTURE_LINEAR/TILED flags around

commit b9b9d4b82b01f4588721fdc8444740f859b4a021
Author: Brian Paul <brianp@vmware.com>
Date:   Fri Mar 19 14:51:05 2010 -0600

    llvmpipe: checkpoint WIP: hanlde co-existing tiled/linear texture data

    Cube maps are temporarily broken, maybe other things.

commit 4cd322e6889940b5f155fcb69041b685b9ef9273
Author: Brian Paul <brianp@vmware.com>
Date:   Fri Mar 19 11:34:43 2010 -0600

    progs/demos: add other modes/patterns to dissolve demo
2010-04-16 09:25:44 -06:00
Brian Paul
97831efdb0 gallium: comments and whitespace fixes 2010-04-16 08:21:49 -06:00
Brian Paul
826f552188 softpipe: formatting fixes and comments 2010-04-16 08:21:49 -06:00
Brian Paul
fe6237719d gallivm: remove some old stuff 2010-04-16 08:21:49 -06:00
Jakob Bornecrantz
53c57191c5 st/drisw: Stop pretending to be drm_api
Reviewed-by: George Sapountzis <gsapountzis@gmail.com>
2010-04-16 10:18:05 +01:00
Jakob Bornecrantz
39c81dada0 st/dri: Refactor init code a bit
Reviewed-by: George Sapountzis <gsapountzis@gmail.com>
2010-04-16 10:17:31 +01:00
Eric Anholt
4950a68bf2 Make && and || only evaluate the RHS when the LHS requires it. 2010-04-16 01:10:32 -07:00
Vinson Lee
6c954dd128 st/mesa: Remove NULL check of pointer that could not be NULL.
cbuf has been dereferenced twice earlier in the same if-block. It is
either not NULL or a crash has already occurred.
2010-04-16 00:55:35 -07:00
Corbin Simpson
b1a89ea1ab r300/compiler: Fix texture instruction readmasks.
No immediate benefit, it was just bugging me.
2010-04-16 00:43:18 -07:00
Corbin Simpson
2c5b35807e r300/compiler: Fix magic numbers in readmasks. 2010-04-16 00:43:17 -07:00
Corbin Simpson
a089fe2816 r300/compiler: Oops, this slipped through. 2010-04-16 00:43:17 -07:00
Corbin Simpson
2e74bc440e r300/compiler: Save Q for mirror and repeat. 2010-04-16 00:43:17 -07:00
Corbin Simpson
f8a1418680 r300/compiler: Split off texture fixes to their own file.
Yes, I'm fully aware this generates subpar code on r500.
2010-04-16 00:43:17 -07:00
Vinson Lee
8c45677588 drisw: Move pointer dereferences to after NULL checks. 2010-04-16 00:36:50 -07:00
Vinson Lee
e0543599b5 st/egl: Remove unnecessary header. 2010-04-16 00:23:25 -07:00
Vinson Lee
c0301af883 st/dri: Remove unnecessary header. 2010-04-16 00:16:08 -07:00
Vinson Lee
7b8c4f22d4 st/mesa: Move dereference and assignment to after NULL check. 2010-04-15 23:15:05 -07:00
Vinson Lee
8978e45e50 mesa: Add missing format specifiers in error strings. 2010-04-15 17:17:29 -07:00
Marek Olšák
80d89aa0d2 r300/compiler: fix repeat wrap mode for TXP and NPOTs
No idea why st/mesa unnecessarily inserts TXP where TEX is sufficient.
Also re-enabling the NPOT fallback for repeat in r300g.
2010-04-16 02:04:18 +02:00
Jakob Bornecrantz
4855b568ba i915g: Create a special 2D layout helper 2010-04-15 23:52:55 +01:00
Jakob Bornecrantz
97c326417c i915g: Fix 2D layouts
This should fix 2D compressed layouts
2010-04-15 23:52:54 +01:00
Jakob Bornecrantz
e17324372b i915g: Remove unused args 2010-04-15 23:52:54 +01:00
Marek Olšák
17b41f80bd r300/compiler: kill off RC_WRAP_CLAMP
A variant thereof might be later reintroduced for the mirrored-clamp modes.
2010-04-15 23:58:38 +02:00
Marek Olšák
85cbff5b60 r300g: mask out the mirrored bit correctly in the registers
It was previously done wrong + now it shouldn't render garbage,
so that the NPOT fallback can get in.
2010-04-15 23:17:35 +02:00
Marek Olšák
a28ee4aa02 r300g: fix the MIRROR_CLAMP_TO_BORDER wrap mode
I guess this was a typo.
2010-04-15 22:06:10 +02:00
Marek Olšák
eee220d65d r300g: add missing r300_state.h
I am very bad at this.
2010-04-15 10:24:06 +02:00
Marek Olšák
6b46df9616 r300g: disable the REPEAT NPOT fallback until it works
It causes regressions. I haven't tested the MIRROR wrap modes,
so not sure about that..
2010-04-15 10:15:42 +02:00
Marek Olšák
948ce60a26 r300g: do not use NPOT fallback for CLAMP wrap modes
These work just fine.
2010-04-15 10:15:34 +02:00
Marek Olšák
6bd6f4cd49 r300g: pick a new fragment shader when either a sampler state or view is changed 2010-04-15 10:10:28 +02:00
Vinson Lee
ebf765a324 st/mesa: Remove unnecessary headers. 2010-04-14 23:49:31 -07:00
Xavier Chantry
a1fdf12160 nvfx: dont swizzle stuff into GART
swzsurf doesn't support GART

Thanks to Marcin Kościelnicki <koriakin@0x04.net> for spotting that !

This fixes corruption in etracer and the following related errors :
[14381.551927] [drm] nouveau 0000:01:00.0: PGRAPH_ERROR - nSource:
PROTECTION_ERROR, nStatus: INVALID_STATE
[14381.551945] [drm] nouveau 0000:01:00.0: PGRAPH_ERROR - Ch 2/2 Class
0x039e Mthd 0x0184 Data 0x00001cd9:0x00001cd9

Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com>

Adapted by Luca Barbieri for mesa master.
2010-04-15 08:15:22 +02:00
Luca Barbieri
42d9f2bb7b nouveau: replace vtxbuf/idxbuf caps with BO_ flags in nouveau_screen and fix uncached reads on nv3x
Faster, simpler and more flexible.

Also, we set those flags properly on nv3x so that we don't allocate buffers in GART.

Since on AGP GART is uncached, OpenGL doesn't distinguish between vertex and index buffers, and we don't support hardware index buffers for now, this caused uncached reads.

Also check bind and not usage for PIPE_BIND_* flags, got broken in the gallium-resources transition.
2010-04-15 08:13:12 +02:00
Vinson Lee
18dc0f0b1c i915g: Remove unnecessary header. 2010-04-14 22:59:37 -07:00
Dave Airlie
7d93f2bf84 r300g: fix regression in texdepth.
texdepth stopped working when npot went in, this brings it back
to life.

< MostAwesomeDude> That looks like what I was going to do.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-04-15 14:56:20 +10:00
Vinson Lee
c8efed89ba gallium/tests: Add test case for pipe_barrier. 2010-04-14 18:06:54 -07:00
Eric Anholt
5ba9420608 Add an ir_if simplification pass.
This is relatively simple at the moment, recognizing only constant
values, and not (for example) values that are restricted to a range
that make the branching constant.  However, it does remove 59 lines
from the printout of CorrectParse2.vert.
2010-04-14 17:05:13 -07:00
Eric Anholt
60be7626b8 Check that the return type of function definition matches its prototype.
Doesn't fix any testcases, but fixes a FINISHME.
2010-04-14 16:19:19 -07:00
Eric Anholt
1e7ec3ce12 Check that function definition parameter qualifiers match proto qualifiers.
Fixes function9.frag.
2010-04-14 16:18:19 -07:00
Eric Anholt
8558459512 Return the rvalue of a variable decl to fix while (bool b = condition) {} 2010-04-14 15:38:52 -07:00
Eric Anholt
3b8d2cd779 Fix the type of gl_FogFragCoord. 2010-04-14 15:28:01 -07:00
Jakob Bornecrantz
cb56b31f84 swrastg: Fix defines to be able to load more then one sw driver 2010-04-14 23:10:17 +01:00
Brian Paul
8239fd4baa llvmpipe: comments for fence functions 2010-04-14 14:32:09 -06:00
Brian Paul
4d8f34e909 progs/tests: added stencilreaddraw to SConscript, Makefile 2010-04-14 14:32:09 -06:00
Brian Paul
205253b015 progs/tests: new stencilreaddraw.c test
Based on the zreaddraw.c test.
2010-04-14 14:32:09 -06:00
Brian Paul
816fe9dd09 mesa: add -D__STDC_CONSTANT_MACROS to linux-llvm
This is needed in more places (st_cb_feedback.c) since the new LLVM
code has been added to the gallium/draw module.
2010-04-14 14:32:09 -06:00
Kristian Høgsberg
3a82c8c562 egl_dri2: Enable KHR_gl_texture_2D_image
Forgot to set the enabled bit when I implemented the extension.
2010-04-14 16:22:48 -04:00
Marek Olšák
d72f1c3b80 r300g: fix possible crash when shader compilation fails
This hopefully fixes the crash in the FDO bug #27634, not the bug itself.
2010-04-14 20:29:42 +02:00
Michael Schmidt
0863c7e499 Initialize DRI2 swap interval to 0
https://bugs.freedesktop.org/show_bug.cgi?id=27628
2010-04-14 10:12:42 -04:00
Kristian Høgsberg
a30f7eb064 glxinfo: Print drawable type in verbose mode 2010-04-14 10:07:15 -04:00
Marek Olšák
ef19b2fbab r300g: simplify get_shader_constant to be rc-constant-state specific 2010-04-14 13:25:51 +02:00
Marek Olšák
116c863892 st/mesa: put ATI_texture_mirror_once in the right place 2010-04-14 12:55:25 +02:00
Vinson Lee
30d99ff7e0 progs/gallium: Fix relative path in Makefile. 2010-04-14 01:17:24 -07:00
Corbin Simpson
2ee0d19ccf u_blitter: Coords are normalized.
Thanks to Luca Barbieri for spotting this one.
2010-04-13 23:29:03 -07:00
Marek Olšák
ef745cf95d r300g: remove the CS compenstation for non-atomized states
Now there aren't any. If CS overflow occurs, the fix should go directly
before the problematic BEGIN_CS.
2010-04-14 04:48:19 +02:00
Marek Olšák
905fa3a07b r300g: remove always_dirty flag and correct leftovers 2010-04-14 04:48:19 +02:00
Marek Olšák
eb4e399ef0 r300g: atomize beginning occlusion query 2010-04-14 04:48:19 +02:00
Marek Olšák
3da70606b3 r300g: atomize VS constant buffer 2010-04-14 04:48:19 +02:00
Marek Olšák
abc2f29dd2 r300g: emit VS immediates along with VS code 2010-04-14 04:48:19 +02:00
Marek Olšák
6793506faa r300g: make setting up fragment depth output less hackish 2010-04-14 04:48:19 +02:00
Marek Olšák
075d9698ed st/mesa: trivially enable ATI_texture_mirror_once
This is a strict subset of already-advertised EXT_texture_mirror_clamp and
shares the same enumerants.
2010-04-14 04:48:19 +02:00
Marek Olšák
36e0100e9e r300g: kill off r300_fragment_shader::shadow_samplers and friends 2010-04-14 04:48:19 +02:00
José Fonseca
c57bac1f13 retrace: Update for recent interface changes. 2010-04-14 10:22:57 +09:00
José Fonseca
d2c5a3093f trace: Ignore transfer_flush_region too. 2010-04-14 10:22:57 +09:00
Vinson Lee
ee9ee03cab i915g: Fix winsys SCons build. 2010-04-13 17:17:15 -07:00
Jakob Bornecrantz
4e20781bac i915g: Whitespace & formating 2010-04-13 23:57:43 +01:00
Jakob Bornecrantz
136bcf6cee i915g: Mark shared layouts more clearly 2010-04-13 23:52:26 +01:00
Jakob Bornecrantz
2b64883269 i915: Fix comments about cube layouts 2010-04-13 23:52:26 +01:00
Jesse Barnes
1318848f78 Merge branch '7.8' 2010-04-13 09:40:14 -07:00
Alan Hourihane
efc69ca61c llvmpipe: disable half float formats 2010-04-13 15:40:49 +01:00
Chia-I Wu
1e7f191d3a gallium: Remove pipe_screen::update_buffer.
It has no user after the removal of st_public.  Plus, it has never been
implemented by a pipe driver or winsys.
2010-04-13 21:47:23 +08:00
Alan Hourihane
cd834499eb gallium: disable tests when using embedded build 2010-04-13 12:54:36 +01:00
José Fonseca
cd4e5879eb scons: Fix exception when llvm-config is not present. 2010-04-13 19:42:29 +09:00
Michal Krol
ddc42b6380 util: Fix util_dynarray_trim(). 2010-04-13 09:00:39 +01:00
Luca Barbieri
a79521d497 nvfx: use dynamically sized rotating BO pool for fragment programs
Currently we used a single buffer for each fragment programs, leading to
rendering synchronization. This patch uses a doubly linked list of BOs,
which is dynamically resized if all the BOs are busy.

Note that inline image transfers could be an alternative option: this
will be explored later.

This removes one of the big performance limitations of the current
driver.

We also stop using pipe_resource internally in favor of using nouveau_bo
directly.
2010-04-13 09:55:49 +02:00
Vinson Lee
9f39d3240b draw llvm: Initialize variable. 2010-04-13 00:49:58 -07:00
Vinson Lee
8316da7cd2 r300g: Silence uninitialized variable warning. 2010-04-13 00:35:10 -07:00
Vinson Lee
833e6f0524 st/mesa: Remove state_tracker/st_framebuffer.c from SConscript.
This was missed in commit da8412ec19.
Fixes SCons build.
2010-04-13 00:29:33 -07:00
Chia-I Wu
da8412ec19 st/mesa: Drop st_public support.
There is no user of st_public now.
2010-04-13 15:15:43 +08:00
Chia-I Wu
a1dbd009d4 st/vega: Drop st_public support.
There is no user of st_public now.
2010-04-13 15:15:43 +08:00
Chia-I Wu
76708c665c st/vega: Do not rely on st_resize_framebuffer.
Add vg_context_update_draw_buffer (and helpers) that duplicates the
logic of st_resize_framebuffer.  Use the new function instead of
st_resize_framebuffer in vg_manager.c.
2010-04-13 15:15:43 +08:00
Luca Barbieri
50409dd71b nvfx: fix for 64-bit systems
Thanks to Patrice Mandin for debugging this.
2010-04-13 09:03:15 +02:00
Luca Barbieri
bf7e0e839f gallium/auxiliary: make util_dynarray_trim do nothing if size == capacity 2010-04-13 08:26:00 +02:00
Luca Barbieri
6c31dd1198 gallium/auxiliary: add util_dynarray_resize 2010-04-13 08:25:39 +02:00
Luca Barbieri
c572619817 gallium/auxiliary: fix util_dynarray_trim to 0 to free the data
This works better and preserves the
data != 0 if and only if capacity != 0 invariant.
2010-04-13 08:18:59 +02:00
Luca Barbieri
5f968a64dc util: implement Jose Fonseca's suggestions for u_buffer.h -> u_dynarray.h
Also describe invariants explicitly and use char* for arithmetic.
2010-04-13 06:10:31 +02:00
Corbin Simpson
c2e804a7e1 r300/compiler: Hax around instructions limits in mirroring code.
Stuff's starting to show up in arbnpot.
2010-04-12 18:24:05 -07:00
Dave Airlie
911fa4a4a1 ffvertex: don't touch tex coords if coord replace is enabled.
The fixed function vertex program shouldn't need to deal or touch tex coords
if stuffing is enabled.

Though I'm not 100% this won't break assumption made elsewhere it seems like
the correct thing to do, and makes r300g point sprites a lot easier to implement.

draw: fix point-sprite when vertex program is used.

This commit regressed draw, so fix it as well to help bisection.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-04-13 09:19:39 +10:00
Marek Olšák
745c4b5685 r300g: add generating texture coordinates for point sprites
[airlied -
	Convert sprite coord index to a per-coord enable bit
	set the rasteriser block up correctly for point sprites.

The inputs to the RS hw block change for sprite coords, so fix them up
properly - this fixes piglit point-sprite test.
]

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-04-13 09:18:47 +10:00
José Fonseca
6917ef10f2 progs/gallium: Move into src/gallium/tests
Two reasons:
- progs will eventually have its own repository
- it is just to easy to forget updating the
  code for interface changes when it is outside of src
2010-04-13 07:05:46 +09:00
Luca Barbieri
6cd82eb399 gallium/auxiliary: add dynamically sized buffer/array/vector 2010-04-12 23:50:37 +02:00
Luca Barbieri
70fe9fd007 nvfx: add LRP in vertprog
glsl generates these.
2010-04-12 23:43:40 +02:00
Luca Barbieri
b385a31452 nvfx: add SIN and COS in vertprog 2010-04-12 23:43:39 +02:00
Luca Barbieri
d2e3942531 nvfx: add missing vertprog setcond instructions
Trivially adds SEQ, SGT, SLE, SNE, SFL, STR and SSG which were missing.
2010-04-12 23:43:22 +02:00
Luca Barbieri
6f65dcfb9f nvfx: allocate a bigger block for queries
This patch allocates a bigger chunk of memory to store queries in,
increasing the (hidden) outstanding query limit.
2010-04-12 23:36:21 +02:00
Luca Barbieri
9ad385fef9 nvfx: support an unlimited number of occlusion queries
Currently on nv30/nv40 an assert will be triggered once 32 queries are
outstanding.

This violates the OpenGL/Gallium interface, which requires support for
an unlimited number of fences.

This patch fixes the problem by putting queries in a linked list and
waiting on the oldest one if allocation fails.

nVidia seems to use a similar strategy, but with 1024 instead of 32 fences.
The next patch will improve this.
2010-04-12 23:36:21 +02:00
Vinson Lee
202760b437 r300g: Move declaration before code.
Fixes SCons build.
2010-04-12 12:50:41 -07:00
Luca Barbieri
31268d2107 nvfx: fix TXL opcode value
Was broken during unification
2010-04-12 20:48:52 +02:00
Luca Barbieri
7fc7b75995 nvfx: Add support for two sided color
This patch adds support for two-sided vertex color to nv30/nv40.

When set, the COLOR0/1 fs inputs on back faces will be wired to vs outputs BCOLOR0/1.
This makes OpenGL two sided lighting work, which can be tested with progs/demos/projtex.
2010-04-12 20:46:18 +02:00
Luca Barbieri
a2ddae0fc3 nvfx: fix compile error 2010-04-12 20:43:26 +02:00
Luca Barbieri
6d6acaebad nvfx: don't use hw index buffers on nv3x and nv44
They only apparently work on nv40 grclass cards, and this was the
previous behavior of the driver.

This really needs to be investigated more.
2010-04-12 20:39:09 +02:00
Luca Barbieri
f9397f34b6 nvfx: expose PIPE_FORMAT_B8G8R8X8_UNORM support
This is implemented in nvfx_state_fb and fragtex but was missing
in nvfx_screen.

This allows to avoid glCopyTexSubImage CPU fallbacks and makes Doom 3
much faster as a result.
2010-04-12 20:23:02 +02:00
Luca Barbieri
44ef1577be nvfx: add support for ARB_half_float_vertex 2010-04-12 20:20:02 +02:00
Luca Barbieri
d5dcd4ee35 st/mesa: half float vertex support (unexposed)
This was proposed by Marek Olšák and no one objected, so just
pushing it.

The extension is currently not exposed, because the mechanism to
discover if the driver actually supports this is missing.

We probably should change is_format_supported to handle this too.

This will allow to test Gallium drivers anyway in the meantime.

Based on work by Dave Airlie.

Changes by me:
1. Fix assertion in st
2. Change to use unpadded Gallium formats
2010-04-12 20:19:56 +02:00
Luca Barbieri
f9c665e9e6 nvfx: allocate buffers in GART if !NOUVEAU_SWTNL
Should improve performance and fix serious regressions on AGP cards.
2010-04-12 18:53:30 +02:00
Luca Barbieri
8f0d5382e3 nvfx: move check for NOUVEAU_SWTNL 2010-04-12 18:06:06 +02:00
Luca Barbieri
f647f46e03 nvfx: remove #include "nouveau_stateobj.h"
No longer used, finally!
2010-04-12 12:21:25 +02:00
Luca Barbieri
330925d911 nvfx: rework validation logic to use code and avoid stateobjs
This makes the code faster due to the lack of indirect calls and also
makes it much easier to understand what is actually going on.
2010-04-12 12:21:25 +02:00
Luca Barbieri
26e40448be nvfx: add NVFX_NEW_{FRAG,VERT}CONST 2010-04-12 12:13:23 +02:00
Luca Barbieri
5eb6b1a981 nvfx: so->RING_3D: vertprog
We could use an sb here instead, but there is no obvious performance
advantage, and perhaps there could be a disadvantage.
2010-04-12 12:13:23 +02:00
Luca Barbieri
f768528af5 nvfx: so->RING_3D: sr 2010-04-12 12:13:17 +02:00
Luca Barbieri
4b3b54d746 nvfx: so->sb: blend 2010-04-12 12:13:17 +02:00
Luca Barbieri
180654d2bb nvfx: so->sb: zsa 2010-04-12 12:13:17 +02:00
Luca Barbieri
cbe8ed435a nvfx: so->sb: rasterizer 2010-04-12 12:13:17 +02:00
Luca Barbieri
c8201c833c nvfx: so->RING_3D: screen 2010-04-12 12:13:17 +02:00
Luca Barbieri
4dbd029a76 nvfx: so->RING_3D: viewport 2010-04-12 12:13:17 +02:00
Luca Barbieri
f8f29e6191 nvfx: so->RING_3D: stipple 2010-04-12 12:13:17 +02:00
Luca Barbieri
5c89cb0f6c nvfx: so->RING_3D: scissor 2010-04-12 12:13:16 +02:00
Luca Barbieri
6558797f99 nvfx: so->RING_3D: blend 2010-04-12 12:13:16 +02:00
Luca Barbieri
f320176b71 nvfx: so->RING_3D: fb 2010-04-12 12:13:16 +02:00
Luca Barbieri
b3cc1adc14 nvfx: so->RING_3D: fragprog 2010-04-12 12:13:16 +02:00
Luca Barbieri
631f6f5616 nvfx: so->RING_3D: fragtex 2010-04-12 12:13:16 +02:00
Luca Barbieri
f5b6cc6699 nvfx: so->RING_3D: vbo 2010-04-12 12:13:16 +02:00
Luca Barbieri
c0341b22ca nvfx: stop using flush_notify
Rather than emitting relocations on flush notifications, emit them
in nvfx_state_start.
2010-04-12 12:13:16 +02:00
Luca Barbieri
188b579e30 nouveau: add state buffers, lightweight replacement for state objects
Just a dumb buffer, allowed by the RING_3D/fixed subchannel binding and
no support for relocations.

This is *much* faster than state objects.
2010-04-12 12:13:16 +02:00
Luca Barbieri
d75f99ab0c nouveau: don't autobind in state objects relocations
Autobinding creates additional pushbuffer usage which may not be
accounted in callers, and is also slow.

The next relocations patch depends on this for correctness.

Assert instead if the objects are not bound, which should happen at
screen creation time.
2010-04-12 12:13:15 +02:00
Luca Barbieri
e0af5c9b54 nouveau: bind the 3D engine to subchannel 7 and add RING_3D
RING_3D creates a method start for subchannel 7.

Bind the 3D engine to a fixed subchannel to make it work

This is much faster than the old BEGIN_RING, since we don't need
to waste cycles trying to "autobind" stuff, when a fast static binding
is perfectly good.

Subchannel 7 is chosen because the kernel takes up the lowest ones.
2010-04-12 12:13:15 +02:00
Luca Barbieri
507dc546c3 nvfx: avoid flushes in primitives
Currently we miscalculate the space needed to push vertices, causing
flushes where they should not happen.

Use a much more conservative estimate to fix it.

It will be done better in the future (e.g. using the nv50 primitive
splitter).
2010-04-12 12:13:15 +02:00
Corbin Simpson
f0b8677d57 r300/compiler: Comment code, add much better mirror maths. 2010-04-12 03:03:37 -07:00
Luca Barbieri
a57dcef636 nvfx: fix bind flags 2010-04-12 11:49:09 +02:00
Corbin Simpson
d5af1dce8f r300/compiler: Implement texcoord repeat and mirror for NPOT. 2010-04-11 23:39:24 -07:00
Corbin Simpson
f95ff1cf48 r300g: Setup external state for wrap modes. 2010-04-11 23:39:24 -07:00
Corbin Simpson
8f37f910bf r300g: Cleanup fragment program external state setup. 2010-04-11 23:39:23 -07:00
Corbin Simpson
484079d724 r300/compiler: Add NPOT compatibility fields to external state.
Completely unused for now.
2010-04-11 23:38:24 -07:00
José Fonseca
d67e3487ac llvmpipe: Respect pipe_sampler_view::format. 2010-04-12 15:32:23 +09:00
José Fonseca
cd70b6bd9e progs/gallium/raw: Update symbols.
Untested -- just the same changes done to progs/gallium/python.
2010-04-12 15:32:23 +09:00
José Fonseca
19211bb5b8 progs/gallium/python: Try to fix most regressions.
Not enough for retrace to work again though.
2010-04-12 15:32:23 +09:00
José Fonseca
c48f21ea7c st/python: Fix regressions. 2010-04-12 15:32:23 +09:00
José Fonseca
b77583203e trace: Fix several regressions introduced by recent interface changes. 2010-04-12 15:32:22 +09:00
José Fonseca
5a549d8b48 llvmpipe: pipe_target needs now 3 bits to be represented. 2010-04-12 15:32:21 +09:00
José Fonseca
0bddb58d2f stw: Update for pipe_resource interface changes. 2010-04-12 15:32:21 +09:00
José Fonseca
1dc8e08e84 stw: Fix minor st_api migration glitches. 2010-04-12 15:32:21 +09:00
Chia-I Wu
192f06adca st/wgl: Switch from st_public.h to st_api.h. [V2]
This is only compile tested with crossmingw.

V2:
 - reference count stw_framebuffer
2010-04-12 15:32:20 +09:00
Török Edwin
bddb6c7a38 Fix build with --enable-32-bit.
CFLAGS needs to be passed, as you already know.
Commit 3e17a5b047 broke this by adding a new link
command without CFLAGS.

Signed-off-by: Török Edwin <edwintorok@gmail.com>
Signed-off-by: Dan Nicholson <dbn.lists@gmail.com>
2010-04-11 20:57:28 -07:00
Dan Nicholson
4ebed86386 Revert "dri/drivers: fix 32bit builds on 64bit systems"
This reverts commit bd09fce271. Török
Edwin sent the correct fix to the list a couple days ago in
<1270832747-15611-1-git-send-email-edwintorok@gmail.com>.
2010-04-11 20:57:28 -07:00
Luca Barbieri
930bba24e5 nvfx: make NOUVEAU_NO_TRANSFER default off
Otherwise, we read from VRAM...

Yes, again, it should be fixed to tell whether the buffer is in
VRAM or not and behave appropriately.

But this should be in pipebuffer/a generic layer; revisit this later
too.
2010-04-12 05:46:04 +02:00
Luca Barbieri
aa985f339d nvfx: always use M2MF instead of the blitter
Currently we are relocating transfers to VRAM to use the blitter,
which is terrible.

Maybe for ->VRAM the blitter could be better, but we can't be
perfectly sure of that due to relocations.

In other words, just do the simple thing, and defer fine-tuning the
transfer hardware method to a later stage, while making it work
decently now.
2010-04-12 05:46:04 +02:00
Chia-I Wu
927e576284 st/egl: Request the front buffer as needed.
The front buffer is added to support old X servers.  Check the version
of the server so that it can be added as needed.
2010-04-12 11:44:35 +08:00
Luca Barbieri
5060b99418 nvfx: add missing vtbl for shared textures 2010-04-12 04:40:03 +02:00
Marek Olšák
136bd184a2 r300g: atomize FS constant buffer 2010-04-12 04:16:08 +02:00
Marek Olšák
5633392966 r300g: atomize compiler's state variables for fragment shader 2010-04-12 04:16:08 +02:00
Marek Olšák
34092c55d6 r300g: atomize fragment shader 2010-04-12 04:16:08 +02:00
Marek Olšák
13b86fe207 r300g: remove a false comment 2010-04-12 04:16:08 +02:00
Marek Olšák
78257f3e8c r300g: emit FS depth output config with FS code 2010-04-12 04:16:08 +02:00
Marek Olšák
953a309de9 r300g: FS constants emission rework
* The constant buffer emission is separated from RC state variables emission.
* The immediates are emitted with FS code.
2010-04-12 04:16:08 +02:00
Vinson Lee
132a590d5e r300g: Remove unnecessary headers. 2010-04-11 18:27:04 -07:00
Vinson Lee
c7dda49aff r300g: Initialize base.bind member variable.
The base.bind member variable was never initialized.
2010-04-11 18:19:24 -07:00
Vinson Lee
8033d7542b i915g: Fix possible null pointer deference in debug builds.
i915_buffer deferences buf in debug builds. Move declaration and
assignment to inside NULL check of buf.
2010-04-11 18:07:41 -07:00
Vinson Lee
039e77a7d1 progs/trivial: Update .gitignore. 2010-04-11 17:30:44 -07:00
Jakob Bornecrantz
36667036e8 progs/egl: Add lib directories to OpenVG demos 2010-04-12 01:50:52 +02:00
Jakob Bornecrantz
d93c34cf70 st/egl: Fix DRI2 on old X servers 2010-04-12 01:50:52 +02:00
Jakob Bornecrantz
cefe2a1dc2 winsys/sw: Fix error paths 2010-04-12 01:50:52 +02:00
Jakob Bornecrantz
c81f049794 llvmpipe: Fix transfers after resource change 2010-04-12 01:50:51 +02:00
Vinson Lee
b132265f50 util: Remove unnecessary header. 2010-04-11 15:06:07 -07:00
Vinson Lee
3d9199ebf2 i965g: Remove unnecessary header. 2010-04-11 14:59:09 -07:00
Vinson Lee
3601b20c9b r300g: Add r300_resource.c to SCons build.
This was missed in commit 287c94ea49,
the gallium-resources branch merge.
2010-04-11 14:51:14 -07:00
Vinson Lee
0ebf7e34b4 svga: Remove unnecessary headers. 2010-04-11 14:27:16 -07:00
Vinson Lee
e188d1e632 trace: Remove unnecessary header. 2010-04-11 14:03:57 -07:00
Marek Olšák
db1b3e714c r300g: a fix for piglit/texrect-many
Broken since 146879284c.
2010-04-11 19:30:09 +02:00
Marek Olšák
6eae8e4482 r300g: use a dummy replacement vertex shader if the shader compilation fails 2010-04-11 19:29:31 +02:00
Marek Olšák
69019afa67 r300g: use a dummy replacement fragment shader if the shader compilation fails
Better than killing an application.
2010-04-11 19:29:30 +02:00
Maciej Cencora
bd09fce271 dri/drivers: fix 32bit builds on 64bit systems 2010-04-11 16:33:55 +02:00
Maciej Cencora
0203136e69 Merge commit 'origin/7.8' 2010-04-11 14:12:13 +02:00
Christoph Bumiller
948e9f7c88 nv50: fix texture relocs
The new address should go to TIC entries 1, 2 instead of entry 0.
Also, using PIPE_SHADER_* for the program type was wrong, they're
ordered like the tesla method now, sorry for the confusion.
2010-04-11 11:44:12 +02:00
Chia-I Wu
870a9d643b st/egl: Follow the portability guide.
Avoid including standard library headers and use MALLOC/FREE if
possible.
2010-04-11 17:12:42 +08:00
Chia-I Wu
5ec4b636c4 st/egl: Factor driver callbacks to a new file.
Factor all callbacks other than Initialize, Terminate, and GetProcAddress
to egl_g3d_api.c.
2010-04-11 17:12:42 +08:00
José Fonseca
47a89e9255 scons: Always build softpipe and llvmpipe (when llvm available).
These are our reference software rasterizers. They can build everywhere
and are a precious debugging tool.

Making them always present immensily simplifies the scons logic.

If people want to avoid building it is still possible to pass
direcotries and target names to scons to narrow the build.
2010-04-11 17:17:35 +09:00
José Fonseca
21780adc2e scons: Make debug build default.
I've been back and forth on this, but I believe it's worth to have debug
by default.

Most humans (developers, testers) will want to use the debug version  by
default.  Many build bots want release but they are bots, and humans >
bots, so I don't care that much.

This is part of my initiative of minimizing the scons option mess many
complain about.
2010-04-11 17:17:34 +09:00
José Fonseca
ea532f0e72 scons: Make LLVM a black-white dependency.
Now that draw depends on llvm it is very difficult to correctly handle
broken llvm installations. Either the user requests LLVM and it needs to
supply a working installation. Or it doesn't, and it gets no LLVM
accelerate pipe drivers.
2010-04-11 17:17:34 +09:00
José Fonseca
9fc93b8041 scons: Use libdrm options only where needed.
Prevents needless recompiles when switching dri=yes to no.
2010-04-11 17:17:34 +09:00
José Fonseca
9faf9529f3 scons: Build glapi regardless of the dri option. 2010-04-11 17:17:34 +09:00
Marek Olšák
146879284c r300g: revisit some assertions and fix potential failures
* Turn some assertions to error messages.
* At most 16 vertex elements can be set, others are ignored.
* Rasterize at most 8 vertex-shader generic outputs, others are ignored.
  This includes fog and WPOS.
* Unknown shader semantic names are ignored.
2010-04-11 10:15:50 +02:00
Marek Olšák
08afcaa56e r300g: use cliprects for scissoring
Cliprects can be disabled, scissors can't. It maps nicely to hardware.
2010-04-11 10:15:50 +02:00
Vinson Lee
f39dcdc70c st/egl: Remove unnecessary header. 2010-04-10 22:20:10 -07:00
Vinson Lee
5c28928c92 i965: Remove unnecessary header. 2010-04-10 22:14:06 -07:00
Vinson Lee
e13e1c068d r300: Remove unnecessary header. 2010-04-10 22:03:29 -07:00
Vinson Lee
68341dcfc0 mach64: Remove unnecessary header. 2010-04-10 21:51:24 -07:00
Vinson Lee
6bd99f1130 radeon: Remove unnecessary header. 2010-04-10 21:43:16 -07:00
Marek Olšák
2e7785be22 r300g: fix mipmapped 3D textures
This is a bug in the CS checker causing CS being rejected.
2010-04-11 06:40:46 +02:00
Marek Olšák
e1208bbeae r300g: support some exotic sampler formats 2010-04-11 06:40:46 +02:00
Vinson Lee
93a6db0779 st/mesa: Silence uninitialized variable warning. 2010-04-10 21:05:40 -07:00
Vinson Lee
8369f2005b nvfx: Silence uninitialized variable warning. 2010-04-10 20:45:03 -07:00
Vinson Lee
ac18b8c44c nvfx: Silence uninitialized variable warnings. 2010-04-10 20:28:24 -07:00
Vinson Lee
95d3bdd338 r300/compiler: Remove unused variable. 2010-04-10 20:12:32 -07:00
Vinson Lee
e19ea63b80 svga: Silence uninitialized variable warnings. 2010-04-10 20:05:10 -07:00
Vinson Lee
a060194519 progs/glsl: Update .gitignore. 2010-04-10 19:51:55 -07:00
Marek Olšák
1c356ac95b r300g: cleanup handling of sampler views
The evolution of TX_FORMAT bits is as follows:
* When a texture is created, set bits independent of pipe_format.
* When a sampler view is created, add format-specific bits.
* When sampler states and views are getting merged, add min/max LOD.
2010-04-11 01:32:15 +02:00
Marek Olšák
26a54ed6fd r300g: pick up some new colorbuffer formats 2010-04-11 01:32:15 +02:00
Dave Airlie
21ba2cd632 r300g: hack around issue with doom3 and 0 stride
This is most likely a bug in the mesa state tracker, but do the quick hack
for now to avoid the divide by 0.

reported and hack generated by almos on #radeon

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-04-11 08:08:49 +10:00
Chia-I Wu
9b3df661bd st/egl: Remove depth/stencil format from the native interface.
A native display has no interest in depth/stencil format.  Remove it
from the interface and let the common code derive the supported
depth/stencil formats from the pipe screen.
2010-04-11 01:17:47 +08:00
Chia-I Wu
5fdda9d78d st/vega: Require both depth and stencil.
The implementation requires not only a depth buffer, but also a stencil
buffer.
2010-04-11 01:17:47 +08:00
Chia-I Wu
f7730c0740 st/egl: Remove __GLcontextModes from the native interface.
Replace __GLcontextModes by a subset of its attributes that makes sense
to EGL.  This also gets rid of GL headers from the common code.
2010-04-11 01:17:47 +08:00
Christoph Bumiller
51430c21ff nv50: plug in miptree resource vtbl 2010-04-10 19:08:45 +02:00
Marek Olšák
cd499e7612 r300g: use clamp-to-edge instead of repeat/mirrored-repeat for NPOT textures 2010-04-10 19:00:10 +02:00
Keith Whitwell
287c94ea49 Squashed commit of the following:
commit 0189cb2fde9f5d7326fd4bfbc2e52db4cce73b3e
Author: Keith Whitwell <keithw@vmware.com>
Date:   Sat Apr 10 12:48:43 2010 +0100

    gallium: don't use generic get_transfer func for textures

    It doesn't know and can't fill in the stride value.

commit 65bc6f88fd9ce8ff90175b250e580bef2739ea35
Author: Chia-I Wu <olv@lunarg.com>
Date:   Sat Apr 10 13:49:34 2010 +0800

    i915g: Initialize screen surface function.

commit eb56e64986790aa2fa35534ce652b78656b0c3c5
Merge: f8b0a7f e7f1e5c
Author: Keith Whitwell <keithw@vmware.com>
Date:   Sat Apr 10 00:38:43 2010 +0100

    Merge commit 'origin/master' into gallium-resources

    Conflicts:
    	src/gallium/drivers/r300/r300_texture.c

commit f8b0a7f6a3a98fd36ce90a81073ec8c8f09b684c
Merge: a3c9980 f43c679
Author: Keith Whitwell <keithw@vmware.com>
Date:   Sat Apr 10 00:35:09 2010 +0100

    Merge commit 'origin/master' into gallium-resources

    Conflicts:
    	src/gallium/drivers/r300/r300_texture.c

commit a3c99807de37dc2c072f1d75ed3a11da333bc9a1
Author: unknown <michal@.(none)>
Date:   Fri Apr 9 18:51:39 2010 +0200

    scons: Add missing sources.

commit 927cec79cedb457efa9e6f335727cfcb8e4908e2
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Fri Apr 9 18:07:56 2010 +0200

    gallium: fix another compile warning after merge. Hmpf.

commit 52953cd7b0e51deafecb812bdc40f9e45f9ac62a
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Fri Apr 9 18:02:11 2010 +0200

    gallium: fix comment

commit 7c8763aa6cfc74adf1ea49c2bab25ca17b32575f
Author: unknown <michal@.(none)>
Date:   Fri Apr 9 18:05:20 2010 +0200

    util: Fix type cast.

commit 9d0086411a104b7cc9297aac0d1f82853118d7bf
Author: unknown <michal@.(none)>
Date:   Fri Apr 9 18:04:33 2010 +0200

    libgl-gdi: Use proper unwrap functions for resources.

commit 251a5cdd18ba31c690ef61f133dfc65cd4a45cf8
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Fri Apr 9 17:51:23 2010 +0200

    gallium: more comments fixup

commit 8f3f9d5e1e9c0de98a3dfb19e81250d2c32ee4e9
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Fri Apr 9 17:48:18 2010 +0200

    gallium: another fix after merge

commit 41f00a32ee5be91512c048bacb89ede0e04bc08d
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Fri Apr 9 17:44:30 2010 +0200

    gallium: more pipe_texture/resource fixes after merge

commit faf53328d1154c51d8a59513f2bfcae62272b0bf
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Fri Apr 9 17:44:24 2010 +0200

    gallium: fix comments for changed USAGE flags

commit fdcb17bea4b0798d316b56deea69832f41142adf
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Fri Apr 9 16:40:07 2010 +0200

    gallium/pb: pb uses PB_USAGE_ flags, not PIPE_TRANSFER_ (same value anyway)

commit c95f7278ecc6db417ec1053279f2a8172c47aee9
Author: Keith Whitwell <keithw@vmware.com>
Date:   Fri Apr 9 13:44:35 2010 +0100

    llvmpipe: fix merge glitches

commit 28f8b8683175149a381be5eff263d4c20568bce7
Author: Keith Whitwell <keithw@vmware.com>
Date:   Fri Apr 9 13:41:39 2010 +0100

    r300g: update after merge for pipe_resources

commit 248c93cbc066ba6e3fadd94c5fcf3bdbb373d8fd
Author: Keith Whitwell <keithw@vmware.com>
Date:   Fri Apr 9 13:41:20 2010 +0100

    st/mesa: fix old pipe_texture usages

commit a563b1c5c2cb57b3ef28a3654d9b477460d13ced
Author: Keith Whitwell <keithw@vmware.com>
Date:   Fri Apr 9 13:40:56 2010 +0100

    r300g: remove unused variable

commit 734500131d828c9dfd68c5fa26b3e6b07e086d2d
Author: Keith Whitwell <keithw@vmware.com>
Date:   Fri Apr 9 13:40:36 2010 +0100

    nv50: fix compiler warning

commit efd402e13037e5c3e29759fa5b1c754c6d65d0e2
Merge: fec8a1d 5452615
Author: Keith Whitwell <keithw@vmware.com>
Date:   Fri Apr 9 13:33:57 2010 +0100

    Merge commit 'origin/master' into gallium-resources

    Conflicts:
    	src/gallium/drivers/cell/ppu/cell_screen.c
    	src/gallium/drivers/cell/ppu/cell_texture.c
    	src/gallium/drivers/llvmpipe/lp_screen.c
    	src/gallium/drivers/r300/r300_context.c
    	src/gallium/drivers/r300/r300_render.c
    	src/gallium/drivers/r300/r300_screen.c
    	src/gallium/drivers/r300/r300_state.c
    	src/gallium/drivers/r300/r300_texture.c
    	src/gallium/drivers/r300/r300_transfer.c
    	src/gallium/state_trackers/egl/common/egl_g3d.h
    	src/gallium/state_trackers/egl/kms/native_kms.c
    	src/gallium/state_trackers/egl/x11/native_dri2.c
    	src/gallium/state_trackers/egl/x11/native_ximage.c

commit fec8a1db13fac04ef56f6ece799d1f20aa3011db
Author: Marek Olšák <maraeo@gmail.com>
Date:   Sat Apr 3 07:58:34 2010 +0200

    util: fix assertion failures in pipe_buffer_flush_mapped_range

commit 1ff3984c2edce9927744f3cce3e7b07778990170
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Thu Apr 8 17:44:54 2010 +0200

    docs: fix transfer_map description

commit 20bf14be8ac6438cb1afa38212e306fc06a5ed40
Author: Keith Whitwell <keithw@vmware.com>
Date:   Thu Apr 8 14:39:13 2010 +0100

    util: fix up several uses of pipe_map_buffer_range

    This function used to return a pointer to where the start of the
    actual buffer would have been, even though only the requested range is
    being mapped.

    In the resources change, the function was modified to use a transfer
    internally, and started returning the pointer to the beginning of the
    transfer, ie the mapped range.

    Some users of the function were changed to reflect this new behaviour,
    some were not.  Since then the function has reverted to its original
    behaviour, matching master.

    This change restores some of the users of the map_buffer_range helper
    to expect the old/original behaviour.

commit 33179a86058b68b518f40971030db337dc26fe6e
Author: Keith Whitwell <keithw@vmware.com>
Date:   Thu Apr 8 14:38:54 2010 +0100

    mesa/st: fix up several uses of pipe_map_buffer_range

    This function used to return a pointer to where the start of the
    actual buffer would have been, even though only the requested range is
    being mapped.

    In the resources change, the function was modified to use a transfer
    internally, and started returning the pointer to the beginning of the
    transfer, ie the mapped range.

    Some users of the function were changed to reflect this new behaviour,
    some were not.  Since then the function has reverted to its original
    behaviour, matching master.

    This change restores some of the users of the map_buffer_range helper
    to expect the old/original behaviour.

commit 3f5363d4dc9d7ad48467ae82d58d5f3d9bd10698
Author: Keith Whitwell <keithw@vmware.com>
Date:   Wed Apr 7 17:26:52 2010 +0100

    util: map_range and flush_range have offsets relative to start of buffer

commit 7eb1bfb97a790c73188d6b616d54fb3849e69b1e
Author: Keith Whitwell <keithw@vmware.com>
Date:   Wed Apr 7 17:26:08 2010 +0100

    nv50: fix compiler warning

commit d040daff0642dd791ac38e9b353dc251b03fc873
Author: Keith Whitwell <keithw@vmware.com>
Date:   Wed Apr 7 17:25:58 2010 +0100

    nvfx: fix compiler warning

commit 49ec01dffb8e99ab3ff8f856287db7b4df3efed6
Author: Chia-I Wu <olv@lunarg.com>
Date:   Mon Apr 5 11:58:53 2010 +0800

    mesa/es: Fixes for gallium-resources.

commit 47c87ada452be45766928a01b6d69da63e3a5f5e
Author: Marek Olšák <maraeo@gmail.com>
Date:   Sat Apr 3 05:19:20 2010 +0200

    r300g: fix transfers for textures created from winsys handles

commit 5f2701fddaef9c18d85c049311c2819c49cc1ae0
Author: Luca Barbieri <luca@luca-barbieri.com>
Date:   Sat Apr 3 03:52:38 2010 +0200

    nouveau: don't use the staging usage

    Maybe it could make sense, but for now dynamic is enough.

    None of these avoid uncached reads from GART on AGP cards.

commit 0db20fa49e008f35911007fa7ed9be1d678a2161
Author: Luca Barbieri <luca@luca-barbieri.com>
Date:   Sat Apr 3 03:27:19 2010 +0200

    i965: add brw_resource.c to Makefile

commit b94f3e7389cbd1b6465de3c04e8059ce73f1ea1f
Author: Luca Barbieri <luca@luca-barbieri.com>
Date:   Sat Apr 3 01:48:33 2010 +0200

    nouveau: fix for gallium-resources

commit a01ff99a19986e6beb7903431e60a074945b09bc
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Thu Apr 1 19:26:35 2010 +0200

    gallium: fix missing includes

commit 26aeded562ce947a6deeb867fe22bf8daf7b1a1a
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Thu Apr 1 19:19:18 2010 +0200

    gallium: remove video interface and related stuff

    These interfaces weren't quite was needed, and building disabled for a while.
    Some code actually build since some branch merge, and were now not fully
    converted to gallium-resources.
    See http://www.mail-archive.com/mesa3d-dev@lists.sourceforge.net/msg09619.html
    for a discussion of this. Video related work is done in origin/pipe-video
    branch.

commit c64285aea45997a276fb141d7badc8a04f617c7c
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Thu Apr 1 18:45:54 2010 +0200

    python: fixes for resource changes

    doesn't look quite ok yet, but sort of compiles.

commit 03d4d5a41f5cf158a358fd705c695e1c987a328f
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Thu Apr 1 18:34:46 2010 +0200

    gallium: s/u_box_orgin_2d/u_box_origin_2d

commit 2444f023142bcaf7bd310b44794580f273254408
Author: Marek Olšák <maraeo@gmail.com>
Date:   Thu Apr 1 03:26:50 2010 +0200

    r300g: fix segfault when the transfers functions are used

    Still broken.

commit 6f09bf4066ab651b323c131bb07978e700519805
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Thu Apr 1 00:05:12 2010 +0200

    r300g: compile fixes

commit 76711ff40d2092f9ef03d452de7458c4e76d9246
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Thu Apr 1 00:04:47 2010 +0200

    nvfx: more compile fixes

commit c5d2e90c9cc119447a447dc04a4bce4ab91fc671
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Wed Mar 31 23:18:50 2010 +0200

    gallium: more mostly merge fallout fixes...

commit fbc3722696790857f4adc936190406e74dffd969
Merge: 86d9225 d97f696
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Wed Mar 31 22:09:35 2010 +0200

    Merge commit 'origin/master' into gallium-resources

    Conflicts:
    	src/gallium/drivers/cell/ppu/cell_screen.c
    	src/gallium/drivers/i915/i915_buffer.c
    	src/gallium/drivers/i915/i915_context.h
    	src/gallium/drivers/i915/i915_resource_texture.c
    	src/gallium/drivers/i915/i915_screen.c
    	src/gallium/drivers/i915/i915_state_emit.c
    	src/gallium/drivers/i965/brw_resource_texture.c
    	src/gallium/drivers/llvmpipe/lp_screen.c
    	src/gallium/drivers/llvmpipe/lp_setup.c
    	src/gallium/drivers/nvfx/nv30_fragtex.c
    	src/gallium/drivers/nvfx/nv40_fragtex.c
    	src/gallium/drivers/nvfx/nvfx_miptree.c
    	src/gallium/drivers/nvfx/nvfx_screen.c
    	src/gallium/drivers/nvfx/nvfx_transfer.c
    	src/gallium/drivers/r300/r300_state.c
    	src/gallium/drivers/svga/svga_screen_texture.c
    	src/gallium/state_trackers/dri/common/dri_drawable.c
    	src/gallium/state_trackers/dri/common/dri_screen.c
    	src/gallium/state_trackers/dri/common/dri_st_api.h
    	src/gallium/state_trackers/dri/drm/dri1.c
    	src/gallium/state_trackers/dri/drm/dri1.h
    	src/gallium/state_trackers/dri/drm/dri2.c
    	src/gallium/state_trackers/python/st_device.c
    	src/gallium/state_trackers/python/st_sample.c
    	src/mesa/state_tracker/st_cb_clear.c
    	src/mesa/state_tracker/st_cb_drawpixels.c
    	src/mesa/state_tracker/st_cb_readpixels.c
    	src/mesa/state_tracker/st_cb_texture.c
    	src/mesa/state_tracker/st_extensions.c

commit 86d9225d19d194eebbbe95b059695697c3307d15
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Wed Mar 31 19:06:06 2010 +0200

    gallium: more fixes for bind changes

commit a215ef0606347e34669a580ec8df93ede7e46399
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Wed Mar 31 18:48:36 2010 +0200

    gallium/docs: some updates for bind changes

commit c6c7e6746cbc7af59f7972719ed76f43e8ac16fc
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Tue Mar 30 20:24:26 2010 +0200

    gallium: more bind change compile fixes

commit a83fa1504b78180524a5eb454ae186741a27cdf8
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Tue Mar 30 17:37:13 2010 +0200

    compile fixes

commit 30dc8afcd243d6a160571bac5f06d773e54a4196
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Tue Mar 30 16:56:28 2010 +0200

    fix some merge issues

commit 30aa617fee11fe50c0a9c2f33fcd120a474f5e34
Merge: 1dde609 3a830bc
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Tue Mar 30 16:09:45 2010 +0200

    Merge commit 'origin/gallium-buffer-usage-cleanup' into gallium-resources

    Conflicts:
    	src/gallium/drivers/nouveau/nouveau_screen.c
    	src/gallium/drivers/nvfx/nvfx_transfer.c
    	src/gallium/winsys/drm/radeon/core/radeon_drm_buffer.c

commit 1dde609ad6c9d2dfa0a5f7167f3c5bcf023b7c4d
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Wed Mar 24 02:35:00 2010 +0100

    docs: some updates for pipe_resource

commit f236f9660d31b936f54b64ae07e569f8637067bd
Author: Luca Barbieri <luca@luca-barbieri.com>
Date:   Wed Mar 24 01:31:28 2010 +0100

    nvfx: fix for gallium-resources

    It seems to work with basic applications but almost surely needs more work.

    In particular, it probably shouldn't use PIPE_BUFFER_USAGE_* flags
    and should use PIPE_TRANSFER_* in several places.

    Also, we probably don't want the vtable indirect calls and that ought
    to be replaced with something better instead.

commit 5a136ad7b63768cb9a753eff8686c44592e62325
Author: Luca Barbieri <luca@luca-barbieri.com>
Date:   Wed Mar 24 01:31:19 2010 +0100

    nv50: fix build in gallium-resources

    Not actually tested.

    Also needs next patch tee to actually build, this is just the nv50 part
    split from the rest.

commit 3a830bc4a3f0f60c925b9434845a6bcad9a913c5
Author: Keith Whitwell <keithw@vmware.com>
Date:   Tue Mar 23 14:00:52 2010 -0700

    st/egl: fix up for binding flags

commit c6a80dc32ef17bc972d4137ce7444ebed4d28ebb
Author: Keith Whitwell <keithw@vmware.com>
Date:   Tue Mar 23 13:52:15 2010 -0700

    r300: restore 4k alignment for oqbo buffers

commit e75a8d5ea9e0ffcf67bc858e08937e10b4fc74ba
Author: Keith Whitwell <keithw@vmware.com>
Date:   Tue Mar 23 13:00:07 2010 -0700

    gallium: bind flags

commit 1f5b509543a7f399835fd9edf27c18e1643fab7d
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Tue Mar 23 19:32:21 2010 +0100

    i965g: scons compile fixes

commit 2c385f8f905ec794d9119c05c6293e0b1b9b565a
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Tue Mar 23 19:20:33 2010 +0100

    nouveau: drm compile fix

commit b285086ebd5132b47c340897c4622cc9fbd286cb
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Tue Mar 23 18:36:19 2010 +0100

    r300g: pipe_resource compile fixes

    bring back mistakenly deleted radeon_buffer.h
    plus some more

commit 7810606f423ef2f51f0a14b919640c2fd2c931aa
Author: Michal Krol <michal@vmware.com>
Date:   Tue Mar 23 16:21:03 2010 +0100

    softpipe: Map GS constants, too.

commit 366f1176fb89d2b1978da6cfe60000b76bbc7338
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Tue Mar 23 15:51:52 2010 +0100

    failover: update for pipe_resources

commit 615f44d70d293704ed821bc0b21fcfe6e363895d
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Tue Mar 23 15:51:02 2010 +0100

    identity: remove double is_resource_reference assignment

commit 7008586020395905ddfff333d02b3893de369796
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Tue Mar 23 15:50:32 2010 +0100

    trace: compile fix

commit 058c5697bda4c9cf7b49d26ee27a34586544efaa
Merge: dd7ba13 b33fd3c
Author: Keith Whitwell <keithw@vmware.com>
Date:   Tue Mar 23 06:40:39 2010 -0700

    Merge commit 'origin/gallium-resources' into gallium-buffer-usage-cleanup

    Conflicts:
    	src/gallium/state_trackers/vega/api_filters.c
    	src/mesa/state_tracker/st_cb_drawpixels.c

commit b33fd3ce3daf2921a895367d0ed3fd9c718a8575
Author: Michal Krol <michal@vmware.com>
Date:   Mon Mar 22 21:03:26 2010 +0100

    gallium: Usage parameter of get_transfer/transfer_inline_write is a bitfield.

commit 9c1162d9d656062a490a529997def3f674cc61fc
Author: Michal Krol <michal@vmware.com>
Date:   Mon Mar 22 20:50:49 2010 +0100

    scons: Update file lists after gallium-resources changes.

commit af9793ab9e5386b150d6b25c0d1978fdc67172e4
Author: Michal Krol <michal@vmware.com>
Date:   Mon Mar 22 20:04:39 2010 +0100

    gallium: Do not use `template` for formal parameter names.

commit dc2e12d714c444af9ff1acdd5a7e91408b116c99
Author: Keith Whitwell <keithw@vmware.com>
Date:   Sun Mar 21 22:41:34 2010 +0000

    ws/nouveau: remove pipe_texture reference

commit b94c72329f1be85887d40d49b0586979da469d77
Author: Keith Whitwell <keithw@vmware.com>
Date:   Sun Mar 21 22:40:41 2010 +0000

    ws/xlib: remove pipe_buffer reference in comment

commit 0a2af3eeae7de1d1cb433f0a2c35136b115f9920
Author: Keith Whitwell <keithw@vmware.com>
Date:   Sun Mar 21 22:39:34 2010 +0000

    st/vega: clean up reference to pipe_texture

commit 437ce98daae46be5d532fbb04c7cbf4a503c1623
Author: Keith Whitwell <keithw@vmware.com>
Date:   Sun Mar 21 22:39:02 2010 +0000

    st/python: begin conversion to pipe_resources, much more to do

commit 1b02e1ee3e5e87774f0c9e5f0e1898b7f8de1b16
Author: Keith Whitwell <keithw@vmware.com>
Date:   Sun Mar 21 22:29:34 2010 +0000

    st/xorg: update for pipe_resources

commit eb39977fe7a1d9f0c3f4f2d4303a93c2c613cc3b
Author: Keith Whitwell <keithw@vmware.com>
Date:   Sun Mar 21 22:23:51 2010 +0000

    st/dri: update for pipe_resources

commit e447aeff597a4d8c0f5de25854c14c99f2cc138c
Author: Keith Whitwell <keithw@vmware.com>
Date:   Sun Mar 21 22:23:36 2010 +0000

    st/egl: update for pipe_resources

commit e4cc48da8fdbd7d521257a6d7cd10e6fc5aa1a65
Author: Keith Whitwell <keithw@vmware.com>
Date:   Sun Mar 21 22:08:44 2010 +0000

    r300: drop use of R300 DONT SYNC flag

commit 129a83ab4d32e44ded5faea3f86ae5e1e62cddb6
Author: Keith Whitwell <keithw@vmware.com>
Date:   Sun Mar 21 22:08:17 2010 +0000

    pipebuffer: use transfer flag

commit 575b35ee6b683d77095ef21c573c1de207107e79
Merge: f29ac73 9fc6c8b
Author: Keith Whitwell <keithw@vmware.com>
Date:   Sun Mar 21 22:03:25 2010 +0000

    Merge commit 'origin/master' into gallium-resources

    Conflicts:
    	src/gallium/drivers/llvmpipe/lp_texture.c
    	src/gallium/drivers/r300/r300_context.c
    	src/gallium/drivers/r300/r300_texture.c
    	src/gallium/winsys/drm/radeon/core/radeon_buffer.h

commit f29ac73f3f626d5779a627b7fa6fecdb60a35aab
Author: Keith Whitwell <keithw@vmware.com>
Date:   Sun Mar 21 18:37:25 2010 +0000

    cell: attempt to convert to pipe_resources

    Can't even compile test this driver.

commit 484b1947f4af81bab60b41f21c3c23ea6f67488c
Author: Keith Whitwell <keithw@vmware.com>
Date:   Sun Mar 21 17:25:50 2010 +0000

    nvfx: restore usage of pipe_winsys

    The interface that cannot be killed...

commit ac76ac6eb30f4f9aa9f5733d60358b357925953a
Author: Keith Whitwell <keithw@vmware.com>
Date:   Sun Mar 21 17:25:10 2010 +0000

    nv50: fix warning

commit 9683f4423449fa5acf6c019c571223650473bd82
Author: Keith Whitwell <keithw@vmware.com>
Date:   Sun Mar 21 17:14:31 2010 +0000

    util: restore u_simple_screen, nouveau still relies on it

commit 961cbcb62232689c959965384c6aa9b8eca697c1
Author: Keith Whitwell <keithw@vmware.com>
Date:   Sun Mar 21 16:51:54 2010 +0000

    nouveau: convert nvfx and nv50 to pipe_resources

    Compile tested only.

    This was a deeper change than I was hoping for, due to the
    layering of the pipe_texture implementation in each driver on
    top of a shared pipe_buffer implementation in the shared code.

    Have modified the shared code to act as a set of convenience
    routines operating on nouveau_bo objects.

    Each driver now uses the u_resource_vtbl technique to split the
    implementation of pipe_resources between the existing miptree code
    for textures and a new, minimal buffer implementation in each
    driver.

    Eventually these should be combined, not least because APIs are now
    allowing things like binding buffer resources as textures and render
    targets.

commit 18ba74016db13b23282f5033ee37b628a12ee566
Author: Keith Whitwell <keithw@vmware.com>
Date:   Sun Mar 21 10:02:54 2010 +0000

    r300: fix compilation after merge

    Also build r300 by default.

commit eb9c0175c8e4baca3fcb0b8364f83ceba9d74e0d
Author: Keith Whitwell <keithw@vmware.com>
Date:   Sun Mar 21 09:59:49 2010 +0000

    st/vega: fix up after merge

commit ea8dd1d4ae7b58c9315c3491046ef3852ddd3377
Author: Keith Whitwell <keithw@vmware.com>
Date:   Sun Mar 21 09:59:44 2010 +0000

    aux: remove unused piperesource helpers

commit be7af29d3ad1a10409b0ea689d882cf30a4e1d62
Merge: d22c2c6 12deb9e
Author: Keith Whitwell <keithw@vmware.com>
Date:   Sun Mar 21 09:54:53 2010 +0000

    Merge commit 'origin/master' into gallium-resources

    Conflicts:
    	src/gallium/auxiliary/cso_cache/cso_context.c
    	src/gallium/auxiliary/cso_cache/cso_context.h
    	src/gallium/drivers/r300/r300_context.c
    	src/gallium/drivers/r300/r300_render.c
    	src/gallium/drivers/r300/r300_state.c
    	src/gallium/drivers/r300/r300_state_derived.c
    	src/gallium/state_trackers/vega/api_filters.c
    	src/gallium/state_trackers/vega/image.c
    	src/gallium/state_trackers/vega/image.h
    	src/gallium/state_trackers/vega/mask.c
    	src/gallium/state_trackers/vega/mask.h
    	src/gallium/state_trackers/vega/paint.c
    	src/gallium/state_trackers/vega/paint.h
    	src/gallium/state_trackers/vega/renderer.c
    	src/gallium/state_trackers/vega/renderer.h
    	src/gallium/state_trackers/vega/shader.c
    	src/gallium/state_trackers/vega/vg_context.h
    	src/gallium/state_trackers/vega/vg_tracker.c
    	src/mesa/state_tracker/st_manager.c

commit d22c2c6cb23a063e3334a165d0c5c3d73f05d234
Author: Keith Whitwell <keithw@vmware.com>
Date:   Sat Mar 20 11:48:54 2010 +0000

    drm/r300: update for r300g pipe_resources conversion

    Remove old files that related to pipe_buffers but weren't being
    built.  Hopefully this is correct.

commit f07b2c836958bee5796899123eca4ed05ac6242b
Author: Keith Whitwell <keithw@vmware.com>
Date:   Sat Mar 20 11:47:03 2010 +0000

    r300: convert to pipe_resources

    Do a very shallow conversion - basically keeping the existing
    buffer and texture code intact and using a vtbl struct
    inside our resource struct to select between the two implementations.

    The buffer and texture treatments could be further merged without
    much effort, but try to keep the existing code working at this point.

commit feca9c3ca62daaf0d8745370106d4e3b22340c49
Author: Keith Whitwell <keithw@vmware.com>
Date:   Thu Mar 18 06:00:34 2010 +0000

    gallium: update new merges to pipe_resource

commit 1cad983eac77a0c5333e6a3ce92b90ac87407714
Author: Keith Whitwell <keithw@vmware.com>
Date:   Thu Mar 18 06:00:19 2010 +0000

    drm/sw: update new merges to pipe_resource

commit 191d39490ed792c569f98d42cf05891b264f71f8
Author: Keith Whitwell <keithw@vmware.com>
Date:   Thu Mar 18 06:00:01 2010 +0000

    vg: update new merges to pipe_resource

commit b727c59bc44812ad503d9390505c92b738a5b8b0
Author: Keith Whitwell <keithw@vmware.com>
Date:   Thu Mar 18 05:59:38 2010 +0000

    llvmpipe: update new merges to pipe_resource

commit 5f4b64b37fdcd70162c382b2ebbd494bef751dbd
Author: Keith Whitwell <keithw@vmware.com>
Date:   Thu Mar 18 05:59:23 2010 +0000

    brw: pipe_resource fixes

commit d4aca209f531f1b65bf706ce1e5fc0375b587eb6
Author: Keith Whitwell <keithw@vmware.com>
Date:   Thu Mar 18 05:59:06 2010 +0000

    util: update new merges to pipe_resource

commit cf6bef0afee10763c78509a3d17e9a6e49bcd3c8
Merge: 1997231 6de8e56
Author: Keith Whitwell <keithw@vmware.com>
Date:   Thu Mar 18 05:38:50 2010 +0000

    Merge commit 'origin/master' into gallium-resources

commit 1997231916144485c3c4a36f53eda39fce460272
Merge: ad88ac7 e1ee3ea
Author: Keith Whitwell <keithw@vmware.com>
Date:   Wed Mar 17 08:46:38 2010 +0000

    Merge commit 'origin/master' into gallium-resources

    Conflicts:
    	src/gallium/auxiliary/Makefile
    	src/gallium/auxiliary/util/u_blit.c
    	src/gallium/auxiliary/util/u_blit.h
    	src/gallium/auxiliary/util/u_gen_mipmap.c
    	src/gallium/auxiliary/util/u_gen_mipmap.h
    	src/mesa/state_tracker/st_cb_texture.c
    	src/mesa/state_tracker/st_gen_mipmap.c

commit ad88ac79034a91670940276e722bdd398d5c9023
Merge: 77bc770 8cdfd12
Author: Keith Whitwell <keithw@vmware.com>
Date:   Tue Mar 16 09:13:07 2010 +0000

    Merge branch 'gallium-sampler-view' into gallium-resources

    Conflicts:
    	src/gallium/auxiliary/cso_cache/cso_context.c
    	src/gallium/auxiliary/util/u_blit.c
    	src/gallium/drivers/llvmpipe/lp_texture.c
    	src/gallium/drivers/softpipe/sp_texture.c
    	src/mesa/state_tracker/st_cb_fbo.c
    	src/mesa/state_tracker/st_framebuffer.c
    	src/mesa/state_tracker/st_texture.c

commit 77bc770c991ea025c82eaa4e0e2390efd825d96d
Author: Keith Whitwell <keithw@vmware.com>
Date:   Mon Mar 15 22:21:48 2010 +0000

    util: missing file

commit f83c91db8ae63a3c3a34ff21492427a5663fb760
Merge: c1d4774 42910eb
Author: Keith Whitwell <keithw@vmware.com>
Date:   Mon Mar 15 09:48:58 2010 +0000

    Merge commit 'origin/gallium-sampler-view' into gallium-resources

    Conflicts:
    	src/gallium/drivers/nv40/nv40_transfer.c
    	src/gallium/drivers/nvfx/nvfx_transfer.c
    	src/gallium/drivers/trace/tr_drm.c

commit dd7ba1378fc50710667724d30d6d4cf1125ad61e
Author: Keith Whitwell <keithw@vmware.com>
Date:   Sun Mar 14 23:54:36 2010 +0000

    gallium: start a cleanup of buffer_usage

    Remove fairly meaningless CPU/GPU READ/WRITE flags and
    replace with proper usages.

commit c1d4774187189f4af8ff421b210824f3d53ceefb
Author: Keith Whitwell <keithw@vmware.com>
Date:   Sun Mar 14 23:05:45 2010 +0000

    llvmpipe: don't FREE userbuffer data

commit 9bfa07afe179f8060e7beefb754a29c4d9c6e349
Merge: 65757a1 08cddfe
Author: Keith Whitwell <keithw@vmware.com>
Date:   Sun Mar 14 22:54:51 2010 +0000

    Merge commit 'origin/master' into gallium-resources

    Conflicts:
    	src/gallium/drivers/llvmpipe/lp_rast.c
    	src/gallium/drivers/llvmpipe/lp_scene.c
    	src/gallium/drivers/llvmpipe/lp_texture.c
    	src/gallium/drivers/llvmpipe/lp_texture.h
    	src/gallium/drivers/softpipe/sp_texture.c
    	src/gallium/drivers/svga/svga_screen_texture.c

commit 65757a143f8e3fcd7afbc1ff92db44a823edf46c
Author: Keith Whitwell <keithw@vmware.com>
Date:   Sun Mar 14 22:41:17 2010 +0000

    svga: build fixes

commit 2f5435220501d4b3050cab2bb1dce6174cd13ff6
Author: Keith Whitwell <keithw@vmware.com>
Date:   Sun Mar 14 22:39:25 2010 +0000

    gallivm: build fix

commit 42642ec0984107d82b740711f2debbf38457a06e
Author: Keith Whitwell <keithw@vmware.com>
Date:   Sun Mar 14 22:38:33 2010 +0000

    llvmpipe: convert to pipe_resources

commit 7bbcb21e20cb545ef8dd5fc61d67ed931c69e813
Author: Keith Whitwell <keithw@vmware.com>
Date:   Sun Mar 14 22:19:30 2010 +0000

    gallivm: convert to pipe_resources

commit 88ae0d04610ca52649b42e32141a52af6d5a739b
Author: Keith Whitwell <keithw@vmware.com>
Date:   Sun Mar 14 21:01:22 2010 +0000

    configs: build svga

commit 0e112bc69828e65085ebfaef895ecd78fe53f1c4
Author: Keith Whitwell <keithw@vmware.com>
Date:   Sun Mar 14 21:01:17 2010 +0000

    gallium: restore PIPE_BUFFER_USAGE_CUSTOM

commit 102aca688b95c976b7178b84092fba7d041ff9d2
Author: Keith Whitwell <keithw@vmware.com>
Date:   Sun Mar 14 21:00:41 2010 +0000

    util: more transfer helpers

commit a79f6a4a0836fc64c07f9aeec21d914474fe3649
Author: Keith Whitwell <keithw@vmware.com>
Date:   Sun Mar 14 20:59:36 2010 +0000

    svga: convert to use pipe_resrource

    As with others so far, a fairly shallow conversion.

commit 087fb54492fa5e3baf040c5efbf7dacd98a8849b
Author: Keith Whitwell <keithw@vmware.com>
Date:   Sun Mar 14 18:38:08 2010 +0000

    brw: fix function name

commit cfc9dd707d16e06fd23b6926da3a6e2269f31dc8
Author: Keith Whitwell <keithw@vmware.com>
Date:   Sun Mar 14 18:19:06 2010 +0000

    gallium: enable brw compile

commit 8a5b86d76bdd3c7de63322423f59940a4dc2ee25
Author: Keith Whitwell <keithw@vmware.com>
Date:   Sun Mar 14 18:18:50 2010 +0000

    brw: compiles with pipe_resource

commit 563ca458b548c41ca4dca559354c16ca1a80d009
Author: Keith Whitwell <keithw@vmware.com>
Date:   Sun Mar 14 18:18:42 2010 +0000

    i915: hook up userbuffer create

commit b5095b48247b6020e36cc942ac145c3fccbe9a19
Author: Keith Whitwell <keithw@vmware.com>
Date:   Sun Mar 14 17:20:51 2010 +0000

    i915: use helpers for is_resource_referenced

commit d5392bdc6d70002acf9c5bac0fde14ba405c4d84
Author: Keith Whitwell <keithw@vmware.com>
Date:   Sun Mar 14 17:20:38 2010 +0000

    util: helpers for is_resource_referenced

commit 2f3492a5aefbb2e745f6700d8e910ebb5cbb98cf
Author: Keith Whitwell <keithw@vmware.com>
Date:   Sun Mar 14 17:08:50 2010 +0000

    i915: remove buffer.c again

commit 1373a35b65fcc25ec6cdfea2703bbb3417de2c6d
Author: Keith Whitwell <keithw@vmware.com>
Date:   Sun Mar 14 17:08:34 2010 +0000

    i915: add new files to scons

commit 0251612d70e57fe38e10e75915b394631d224f2c
Author: Keith Whitwell <keithw@vmware.com>
Date:   Sun Mar 14 16:38:29 2010 +0000

    i915: compiling with pipe_resources

commit 9a0235864252929a8eedd44dbd2fe30fe54c531d
Author: Keith Whitwell <keithw@vmware.com>
Date:   Sun Mar 14 13:51:16 2010 +0000

    gallium: remove inline_read transfer

commit a6ba315e25793e0c228d3a4ae2f8201634dc9ff0
Author: Keith Whitwell <keithw@vmware.com>
Date:   Sun Mar 14 13:50:32 2010 +0000

    trace: get running

    Some dumping will be incorrect or disabled, but it runs without
    crashing

commit 2133f1d90aa919662a8420a0cf3b4557e6ec1afd
Author: Keith Whitwell <keithw@vmware.com>
Date:   Sun Mar 14 13:49:42 2010 +0000

    gallium: remove the inline_read transfer

    There aren't enough users of this to justify it.

commit bccaf1fa30881f6b4fb189a9b74fc7af79c3b481
Author: Keith Whitwell <keithw@vmware.com>
Date:   Sun Mar 14 12:30:37 2010 +0000

    identity: hook up inline transfer operations

commit e4c152a344f2f53c842b810724a2ae7cb4554f58
Author: Keith Whitwell <keithw@vmware.com>
Date:   Sun Mar 14 12:21:54 2010 +0000

    gallium: build trace and identity

commit 0b5a311db78852fa9fd021e17b5968a1e0436b49
Author: Keith Whitwell <keithw@vmware.com>
Date:   Sun Mar 14 12:21:36 2010 +0000

    gallium: add more of the transfer state to pipe_transfer

    Not really sure if recording all the arguments to the
    create_{transfer,texture,surface,etc} functions in the result of those
    calls is a great idea, but it seems we're fairly dependent on it
    throughout the code.

commit a23985c26eafe76b0a7dacc892e50cb589f211fe
Author: Keith Whitwell <keithw@vmware.com>
Date:   Sun Mar 14 12:19:46 2010 +0000

    identity: compiles with pipe_resources

commit d0d630944304c208f6dade6ef8836763ee2bc7b4
Author: Keith Whitwell <keithw@vmware.com>
Date:   Sun Mar 14 12:13:02 2010 +0000

    trace: compiles with pipe_resources

commit a4451ea459cc8bfc915fe6aed2891b90854b6c9d
Author: Keith Whitwell <keithw@vmware.com>
Date:   Sun Mar 14 11:39:50 2010 +0000

    softpipe: give userbuffers a format other than NONE

    Most mesa demos working

commit 32bb1bd4ba29884a4ecfa11c8441d33dfceabcef
Author: Keith Whitwell <keithw@vmware.com>
Date:   Sun Mar 14 11:39:21 2010 +0000

    util: correct argument order in pipe_buffer_map

commit 7e2696c06445282feb781047277b260308760a33
Author: Keith Whitwell <keithw@vmware.com>
Date:   Sun Mar 14 11:32:55 2010 +0000

    softpipe: transfer flush

commit a0543b13c042e3c1142522d9d136f16fd4cabf78
Author: Keith Whitwell <keithw@vmware.com>
Date:   Sun Mar 14 11:32:13 2010 +0000

    util: noop implementation of transfer_flush_region

commit ce418533be752dbeb164e7ff82a99483048e482b
Author: Keith Whitwell <keithw@vmware.com>
Date:   Sun Mar 14 11:26:07 2010 +0000

    gallium: softpipe runs gears with pipe_resources

commit bfda4f2eb34498e4b7f3c608d30fccff6bb9651b
Author: Keith Whitwell <keithw@vmware.com>
Date:   Sun Mar 14 11:25:48 2010 +0000

    util: get clip_tile working again

commit f5ef219c3bed62b6a0da842e675fae16268e0fbe
Author: Keith Whitwell <keithw@vmware.com>
Date:   Sun Mar 14 09:43:20 2010 +0000

    softpipe: use u_transfer helpers

commit 072957aab25affecf0702e925310e46c694a5ee4
Author: Keith Whitwell <keithw@vmware.com>
Date:   Sun Mar 14 09:42:46 2010 +0000

    util: helpers for inline transfers

commit 9c45561fb0d7a52400093bcb2ce5f727fafd7777
Author: Keith Whitwell <keithw@vmware.com>
Date:   Sun Mar 14 09:42:25 2010 +0000

    util: fix typo calculating transfer box

commit f3e98fd47f36804d019a684d49ff230df3ab0cf5
Author: Keith Whitwell <keithw@vmware.com>
Date:   Sun Mar 14 09:25:46 2010 +0000

    st/vega: convert to pipe_resource

commit d1b7b00afc944f6499c83d676c7642115d62a62c
Author: Keith Whitwell <keithw@vmware.com>
Date:   Sun Mar 14 08:37:56 2010 +0000

    gallium: begin converting drivers to pipe_resource

    Work in progress...

commit 51c25117f5d6da1926a2be5ecc66677952a8abf0
Author: Keith Whitwell <keithw@vmware.com>
Date:   Sat Mar 13 20:16:27 2010 +0000

    gallium: work in progress on layering resources on top of old textures

    Helper code in an aux module to avoid rewriting all the drivers.

commit fb6764d3ce95c55aa78af2f1c8cbb17b79ce1ba2
Author: Keith Whitwell <keithw@vmware.com>
Date:   Sat Mar 13 19:19:09 2010 +0000

    heaps of wip

commit ee6b3bc730fcdaf8da3646d62f04578ec06d36a1
Author: Keith Whitwell <keithw@vmware.com>
Date:   Sat Mar 13 16:38:02 2010 +0000

    wip2

commit 1830880212445189fe267d615075239ed17c7cc0
Merge: 90b4045 47bfbd4
Author: Keith Whitwell <keithw@vmware.com>
Date:   Sat Mar 13 15:14:03 2010 +0000

    Merge branch 'gallium-sampler-view' into gallium-resources

    Conflicts:
    	src/gallium/include/pipe/p_context.h
    	src/mesa/state_tracker/st_atom_texture.c
    	src/mesa/state_tracker/st_cb_bitmap.c
    	src/mesa/state_tracker/st_cb_drawpixels.c
    	src/mesa/state_tracker/st_cb_texture.c
    	src/mesa/state_tracker/st_context.c
    	src/mesa/state_tracker/st_context.h
    	src/mesa/state_tracker/st_texture.h

commit 90b4045fbc0a093fcd04efba7e045ec259c490b8
Author: Keith Whitwell <keithw@vmware.com>
Date:   Sat Mar 13 14:52:43 2010 +0000

    wip
2010-04-10 16:05:54 +01:00
Marek Olšák
e7f1e5ca64 r300g: align the height of NPOT textures to POT
Needed by the CS checker.
2010-04-10 01:09:40 +02:00
Marek Olšák
f43c679c0b r300g: do not use tiling for scanout buffers 2010-04-10 00:20:52 +02:00
Kristian Høgsberg
5a43dbac68 glx: Support direct rendering pbuffers
We've supported indirect rendering pbuffers for a while, but not direct
rendering pbuffers.  The way we do this is by creating a hidden pixmap
and wrap that in a GLX pbuffer.  This only works when we have DRI2 on
the server, but if the server doesn't have DRI2, it won't expose configs
with pbuffer bits enabled.
2010-04-09 17:16:33 -04:00
Kristian Høgsberg
edb5253dfa glx: Fix config chooser logic for 'mask' matching
When matching attributes using the 'mask' matching criteria, the spec
says that

  "Only GLXFBConfigs for which the set bits of attribute include all
   the bits that are set in the requested value are
   considered. (Additional bits might be set in the attribute)."

The current test returns true if the two bit masks have bits in
common, specifically it matches even if the requested value has bits
set that are not set in the fbconfig attribute.  For example, an
application asking for

  GLX_DRAWABLE_TYPE, GLX_PIXMAP_BIT | GLX_PBUFFER_BIT,

as glxpbdemo does, will match fbconfigs that don't support pbuffer
rendering, as long as they support pixmap rendering.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2010-04-09 15:15:28 -04:00
Chia-I Wu
ba81b0743e Fix copyright headers.
Update the warranty disclaimer to use the more general "THE AUTHORS OR
COPYRIGHT HOLDERS".  This is done manually on files created by me.  Hope
that I do not miss anything.
2010-04-10 01:20:57 +08:00
Chia-I Wu
ad1edb053a st/egl: Fix a typo in determining the render buffer. 2010-04-10 01:19:53 +08:00
Brian Paul
7a01b13324 llvmpipe: fix transposed stencil ref / values comparison 2010-04-09 10:52:51 -06:00
Brian Paul
75b8c4a8f8 Merge branch '7.8' 2010-04-09 10:09:24 -06:00
Brian Paul
4ae2bdcb15 st/mesa: new assertions to check array indexes 2010-04-09 10:08:27 -06:00
José Fonseca
c2e87d7f07 util: Fix typo in earlier commit. 2010-04-09 16:56:18 +01:00
José Fonseca
142fb27c3b util: ubyte_to_float and float_to_ubyte whenever possible.
More accurate results.

We should probably generalize these functions for more cases.
2010-04-09 16:53:07 +01:00
José Fonseca
866d22ccce util: Get all depth stencil tests passing.
Note the tests don't test all the paths, in particular stride, and
ensuring the old value is preserved.
2010-04-09 16:32:48 +01:00
José Fonseca
f9a0d1e234 util: Add missing break statement. 2010-04-09 16:32:48 +01:00
José Fonseca
7603173774 util: Use consistent symbols in pack generator. 2010-04-09 16:32:48 +01:00
José Fonseca
b1cfc195bb util: Reorder format tests -- group by format. 2010-04-09 16:32:47 +01:00
José Fonseca
d3808b1b1f util: Add dedicated depth-stencil packing/unpacking functions.
Depth-stencil manually written given that each one is very close to
be a special case.

u_format_zs.c's still untested.
2010-04-09 16:32:47 +01:00
José Fonseca
efae8f33f2 gallium/unit: Silence warnings. 2010-04-09 16:32:47 +01:00
José Fonseca
1f014a36f7 scons: Set -gstabs for C++ too. 2010-04-09 16:32:47 +01:00
Corbin Simpson
51c4068051 st/xorg: Fix thinko. 2010-04-09 06:52:18 -07:00
Ben Skeggs
54526154c5 nouveau: Import latest nouveau_class.h from renouveau
And fix nv50_screen.c to compile against the updated header.
2010-04-09 20:59:36 +10:00
Corbin Simpson
8ddb4e2c81 st/xorg: Fix bad paramf.
Should be an integer param, according to docs.
2010-04-09 03:40:11 -07:00
Corbin Simpson
d2cf1e85c8 r300g: Fill out dummy fence functions.
xorg st needs them.
2010-04-09 03:40:11 -07:00
Corbin Simpson
9c2efb071f util: Include u_debug for debug_print_format.
Caused fun linker errors on r600g.
2010-04-09 03:40:11 -07:00
Chia-I Wu
b80b817195 st/egl: Move probe interface to native_probe.h.
native.h is getting a little messy over time.
2010-04-09 17:52:37 +08:00
Chia-I Wu
f69b35fa15 st/egl: Remove pbuffer from the native interface.
A pbuffer is an EGL resource.  It does not need a native display to
create.
2010-04-09 17:52:37 +08:00
Vinson Lee
08100aa444 util: Set DXTN_LIBNAME to libtxc_dxtn.dylib on Mac OS X. 2010-04-09 00:40:15 -07:00
Eric Anholt
a3fa3fbf76 Add an implementation of gentype-only clamp(). 2010-04-08 16:08:15 -07:00
Eric Anholt
cc4ef154e6 Add builtin implementations of vector comparison functions.
Fixes CorrectFunction1.vert, glsl-fs-notequal.frag.
2010-04-08 15:35:34 -07:00
Eric Anholt
cc49cea9ea Add support for builtin gentype mix(gentype a, gentype b)
Fixes glsl-fs-mix.frag, glsl-fs-mix-constant.frag.
2010-04-08 15:10:37 -07:00
Eric Anholt
feeb43b829 Add buitlin functions for any(), all(), not(). 2010-04-08 15:02:59 -07:00
Eric Anholt
925759283a Add builtin normalize() functions.
Fixes CorrectSqizzle2.vert.
2010-04-08 14:38:32 -07:00
Eric Anholt
2a7b2b22f4 Repeat the optimization passes until we stop making progress. 2010-04-08 13:43:56 -07:00
Eric Anholt
6192434ac3 Add inlining support for array dereferences. 2010-04-08 13:42:41 -07:00
José Fonseca
c6781e9c78 util: Support PIPE_FORMAT_B4G4R4X4_UNORM and PIPE_FORMAT_R8G8B8X8_UNORM. 2010-04-08 19:48:02 +01:00
José Fonseca
4459a21e07 gallium: Add a couple more of D3D9 formats forgotten earlier. 2010-04-08 19:47:40 +01:00
Eric Anholt
cad9766118 Inline functions consisting of a return of an expression. 2010-04-08 11:24:06 -07:00
José Fonseca
89ceb2f3c7 util: (Almost) universal format translation function.
Untested.
2010-04-08 19:03:41 +01:00
José Fonseca
956b2f74d8 util: Describe, implement, and test the new D3D9 color formats. 2010-04-08 19:03:41 +01:00
José Fonseca
1320017049 gallium: Add missing D3D9 color formats. 2010-04-08 19:03:40 +01:00
José Fonseca
948ac63112 util: is_array/mixed/etc is only meaningful for plain formats. 2010-04-08 19:03:40 +01:00
José Fonseca
350bbc946a util: Keep const keyword when unpacking formats. 2010-04-08 19:03:40 +01:00
José Fonseca
3f62664679 util: Reorder the code generated function so that they are grouped by format.
Makes it easier to copy and paste.
2010-04-08 19:03:40 +01:00
Li Peng
9599da3374 intel: Call intel_prepare_render() in intelClear()
Make sure we have up to date buffers before we start looking at
the tiling bits to determine how to clear.
2010-04-08 13:52:55 -04:00
Zack Rusin
074084d563 draw llvm: hook up the generated function into the draw elts path
we were only using the jited function in the linear case, now drawelts
correctly uses the same path. it results in a significant gain in
real world apps (openarena went from 23fps to 29fps)
2010-04-08 10:53:21 -04:00
José Fonseca
3ceafcf143 draw: Fix vertex buffer indexation. 2010-04-08 11:00:42 +01:00
José Fonseca
d2f8162f91 util: Don't call util_dl_close(library) when util_format_s3tc_init is successful."
Otherwise the library will be unloaded and function pointers become invalid.

This reverts commit bc2bc0306e.
2010-04-08 10:36:16 +01:00
Vinson Lee
bc2bc0306e util: util_dl_close(library) before exiting util_format_s3tc_init. 2010-04-08 00:55:16 -07:00
Vinson Lee
01ec162d53 draw llvm: Remove unnecessary header. 2010-04-08 00:30:40 -07:00
Vinson Lee
94e5bc23e7 llvmpipe: Remove unnecessary header. 2010-04-08 00:18:46 -07:00
Dave Airlie
dff50ff592 Merge remote branch 'origin/7.8'
Conflicts:
	Makefile
	configs/default
	src/mesa/main/version.h
2010-04-08 16:48:41 +10:00
Chia-I Wu
968bf9634e st/dri: Fix setTexBuffer2 with __DRI_TEXTURE_FORMAT_RGB.
When the format is __DRI_TEXTURE_FORMAT_RGB, the texture should be
treated as if there is no alpha channel.
2010-04-08 16:47:11 +10:00
Ian Romanick
b427c917ce Remove extraneous base-class constructor calls 2010-04-07 18:03:50 -07:00
Eric Anholt
fbc7c0b8f2 Make function bodies rely on the parameter variable declarations.
Previously, generating inlined function bodies was going to be
difficult, as there was no mapping between the body's declaration of
variables where parameter values were supposed to live and the
parameter variables that a caller would use in paramater setup.
Presumably this also have been a problem for actual codegen.
2010-04-07 17:23:23 -07:00
Eric Anholt
6173312d84 Make dot() take the right number of args. 2010-04-07 17:23:23 -07:00
Eric Anholt
7e78e07ddb Fix the returns of builtin functions to actually return. 2010-04-07 17:23:23 -07:00
Eric Anholt
894ea972a4 Put function bodies under function signatures, instead of flat in the parent.
This will let us know the length of function bodies for the purpose of
inlining (among other uses).
2010-04-07 17:23:23 -07:00
Eric Anholt
f1ddca9f21 Clarify the types of various exec_list in ir.h 2010-04-07 17:23:23 -07:00
Ian Romanick
0c82465395 Treat texture rectangles as an extension that is enabled be default 2010-04-07 17:13:44 -07:00
Ian Romanick
c77b257094 Add support for GL_ARB_draw_buffers extension 2010-04-07 16:59:46 -07:00
Ian Romanick
887a8b07de Clean up error reporting in _mesa_glsl_process_extension 2010-04-07 16:57:56 -07:00
Ian Romanick
c178c74c27 Add tracking for extension based warnings
Using '#extension foo: warn' instructs the compiler to generate a
warning when some feature of the extension 'foo' is used.  This patch
adds some infrastructure needed to support that for variables.

Similar changes will be needed for types and built-in functions.
2010-04-07 16:53:54 -07:00
Ian Romanick
1799a0cd41 Emit a warning when an unknown extension is used with #extension 2010-04-07 16:49:25 -07:00
Ian Romanick
56b8b21410 Add _mesa_glsl_warning to emit warnings to the shader log 2010-04-07 16:49:25 -07:00
Ian Romanick
e701761cc8 Begin processing #extension directive
Nowhere near complete.  It just parses correctly at this point.
2010-04-07 16:49:25 -07:00
Ian Romanick
ae4c4c0795 Use _mesa_glsl_shader_target_name 2010-04-07 16:49:25 -07:00
Ian Romanick
5bfe30a02b Add utility function to get the name of a shader target 2010-04-07 16:49:25 -07:00
Ian Romanick
1b3f47fd36 Call glsl_type::get_instance correctly: the number of rows must be at least 1
This causes the following tests to pass:

    shaders/glsl-tex-mvp.vert
2010-04-07 16:49:25 -07:00
Ian Romanick
b0b8fa4885 Eat whitespace while in the PP state 2010-04-07 16:49:25 -07:00
Ian Romanick
62f62ca3b3 Partially fix comment handling in preprocessor directives.
Multi-line /* */ comments are still broken.  I think this will wait to
be fixed until we have a real preprocessor.
2010-04-07 16:49:25 -07:00
Ian Romanick
77cce649c9 Add support for bool to ir_equal and ir_nequal constant handling 2010-04-07 16:49:25 -07:00
Ian Romanick
8645a955fc Add gl_ClipDistance in fragment shader 2010-04-07 16:49:25 -07:00
Zack Rusin
821abff8c0 draw llvm: highly reduce the compilation times for draw llvm
our code resets pipe_vertex_buffer's with different offsets when rendering
vbo, meaning that we kept creating insane number of shaders even for simple
apps e.g. geartrain had 54 shaders and it was taking almost 27 seconds just to
compile them. this patch passes pipe_vertex_buffer's to the jit function and lets
it to the stride/buffer_offset computation at run time. the slowdown at runtime
is largely unnoticable but the we go from 54 shaders to 3, and from 27 seconds to less
than 1.
2010-04-07 17:50:11 -04:00
José Fonseca
40bac07f9b gallivm: Get the format translation logic write. 2010-04-07 22:17:07 +01:00
José Fonseca
2c06fa4682 util: Support fixed formats conversion. 2010-04-07 22:16:18 +01:00
José Fonseca
783e94243a util: Add copyright header to u_half.h 2010-04-07 21:00:18 +01:00
José Fonseca
f15469039a util: Remove the half typedef from p_compiler.h.
Unnecessary, and doesn't even guarantee size.
2010-04-07 21:00:05 +01:00
José Fonseca
68df294997 llvmpipe: Add missing include. 2010-04-07 20:55:31 +01:00
José Fonseca
d96e87c3c5 util: Use stubs for the dynamically loaded S3TC functions.
Loosely based on Luca Barbieri's commit
52e9b990a1.
2010-04-07 20:47:38 +01:00
José Fonseca
a46ca64562 draw: Fix MSVC build (snprintf->util_snprintf). 2010-04-07 20:41:09 +01:00
José Fonseca
ecdd6bc3e2 util: Remove u_tile.c YCbCr's.
Superseded by u_format_yuv.c. Also PIPE_FORMAT_YUYV's interpretation was
inconsistent: it was being interpreted as VYUY.
2010-04-07 19:58:18 +01:00
José Fonseca
7f9444050f util: Implement YUV and subsampled RGB format conversion. 2010-04-07 19:47:24 +01:00
Ian Romanick
8c46ed2490 Generate correct IR for do-while loops
Previously the same code was generated for a while loop and a do-while
loop.  This pulls the code that generates the conditional break into a
separate method.  This method is called either at the beginning or the
end depending on the loop type.

Reported-by: Kenneth Graunke <kenneth@whitecape.org>
2010-04-07 11:42:36 -07:00
Ian Romanick
4cf20cd37c Process ast_jump_statement into ir_loop_jump
Specifically, handle 'break' and 'continue' inside loops.

This causes the following tests to pass:

    glslparsertest/shaders/break.frag
    glslparsertest/shaders/continue.frag
2010-04-07 11:42:36 -07:00
Ian Romanick
01f8de4a87 Add dynamic cast for ir_loop 2010-04-07 11:42:36 -07:00
Ian Romanick
e9d0f265aa Begin tracking the nesting of loops and switch-statements 2010-04-07 11:42:36 -07:00
Ian Romanick
c0e76d8352 Use switch based on mode in ast_jump_statement::hir 2010-04-07 11:42:36 -07:00
Ian Romanick
d6313d7a01 Add some newlines when printing ir_loop instructions 2010-04-07 11:42:36 -07:00
Ian Romanick
9e7d010ee0 Process ast_iteration_statement into ir_loop
This causes the following tests to pass:
     glslparsertest/shaders/dowhile.frag
     glslparsertest/shaders/while.frag
     glslparsertest/shaders/while1.frag
     glslparsertest/shaders/while2.frag
2010-04-07 11:42:36 -07:00
Ian Romanick
f8e31e00b1 Add ir_loop_jump to represent 'break' and 'continue' in loops 2010-04-07 11:42:30 -07:00
Ian Romanick
fad607a9be Add ir_loop to represent loops
This touches a lot of files because everything derived from ir_visitor
has to be updated.  This is the primary disadvantage of the visitor pattern.
2010-04-07 11:41:50 -07:00
Brian Paul
78fd65fd2c draw: init draw->pt.middle.general = NULL just to be safe
This field should be null from the initial calloc() of the draw context,
but let's be safe (and improve understanding of the code).
2010-04-07 07:09:57 -06:00
José Fonseca
da17623c33 llvmpipe: Fix USE_DRAW_LLVM build. Use lp_build_engine. 2010-04-07 13:49:29 +01:00
Michel Dänzer
765dc9fc32 r300: Initialize compiler.max_temp_regs for blits.
Blits were broken since commit e41a64591b
('r300/compiler: make the max number of fragment shader temporaries
adjustable').
2010-04-07 11:21:15 +02:00
Vinson Lee
95bfd0067c draw llvm: Remove unnecessary headers. 2010-04-07 01:04:45 -07:00
Vinson Lee
1e51bbf77f gallium: Add files to Makefile.
This was missed in commit ae69f9fbf0.
New files from the gallium_draw_llvm merge were added to SCons but
not make.
2010-04-07 00:45:40 -07:00
Vinson Lee
88a0d7e1bf llvmpipe: Remove unused variable. 2010-04-06 23:48:00 -07:00
Ben Skeggs
2d606c13ff nouveau: allow multiple simultaneous maps of a pipe_transfer
I'm not entirely convinced we want this behaviour (the underlying nouveau_bo
doesn't support it either), but since certain parts of the mesa state
tracker appear to require it lets make it work for now.
2010-04-07 15:51:13 +10:00
Ben Skeggs
841b327a51 nv50: fix assertion that caused piglit texturing/texrect-many to fail 2010-04-07 15:06:59 +10:00
Zack Rusin
c60a161cc5 scons: define DRAW_LLVM if we're building it 2010-04-06 22:41:11 -04:00
Zack Rusin
1570760a97 draw llvm: disable printing of the LLVM ir 2010-04-06 22:30:22 -04:00
Marc Dietrich
0963099d5e cell: fix build
compile fix for cell driver.

Signed-off-by: Brian Paul <brianp@vmware.com>
2010-04-06 20:23:21 -06:00
Brian Paul
45c8909148 gallium/draw: add additional DRAW_LLVM check
Fixes build breakage.
2010-04-06 20:20:17 -06:00
Zack Rusin
ae69f9fbf0 Merge branch 'gallium_draw_llvm' 2010-04-06 20:09:08 -04:00
José Fonseca
fe130a7e5e llvmpipe: Support S3TC when util_format_s3tc_enabled is set. 2010-04-06 22:52:33 +01:00
José Fonseca
728741a3bd gallivm: Fallback to calling util_format_description::fetch_float for any format we can't code LLVM IR directly. 2010-04-06 22:52:33 +01:00
José Fonseca
306835cc0f gallivm: Move the global LLVM objects (module, engine, provider, target) into here. 2010-04-06 22:52:33 +01:00
Zack Rusin
695a029e9b llvmpipe: use a define to decide whether to use draw llvm paths
right now disabled by default
2010-04-06 17:15:03 -04:00
Zack Rusin
06bda76c08 draw llvm: disable debugging output 2010-04-06 17:14:13 -04:00
Zack Rusin
323fdd8ae5 draw llvm: implement simple pipeline caching using variants 2010-04-06 16:28:48 -04:00
Eric Anholt
b94e402cff Add some linebreaks in the ir_print_visitor of if statement bodies. 2010-04-06 12:13:02 -07:00
Eric Anholt
70b74928a2 Make constant folding descend into if statements. 2010-04-06 11:52:09 -07:00
Eric Anholt
e5a9e70cde Descend down the tree in more locations in constant folding. 2010-04-06 11:42:34 -07:00
Eric Anholt
bae5be356e Perform constant folding on array indices.
Replaces a constant var deref with a constant value in CorrectParse1.frag.
2010-04-06 11:42:34 -07:00
Eric Anholt
af18641f0a Add float/int conversion to ir_constant_expression.cpp.
Gives CorrectParse2.frag one more constant folding.
2010-04-06 11:42:34 -07:00
Eric Anholt
326c676236 Handle constant expressions using derefs of const values.
Fixes CorrectParse1.frag and makes for a ton of folding in
CorrectParse2.frag.
2010-04-06 11:42:34 -07:00
Eric Anholt
3fff009af1 Fold constant expressions in if conditionals.
Fixes up 3 more expressions in CorrectParse2.frag.
2010-04-06 11:42:34 -07:00
Eric Anholt
ec1949e804 Add support for =, != to ir_constant_expresion.cpp
This results in constant folding of one more expression in CorrectParse2.frag.
2010-04-06 11:42:34 -07:00
Eric Anholt
85171c2dd8 Add ir_constant_expression.cpp support for <, >, <=, >=.
This results in folding one more constant expression in CorrectParse2.frag.
2010-04-06 11:42:34 -07:00
Eric Anholt
62735694a1 Add a constant folding optimization pass. 2010-04-06 11:42:31 -07:00
Zack Rusin
1e0bf24139 draw llvm: fix iteration for larger vertex arrays
we were trying to store the outputs starting at the same offset we
were using for the input arrays, which was writing beyond the end of
the output array.
2010-04-06 12:37:31 -04:00
Zack Rusin
de0647dbad draw llvm: iterate with the correct stop over the outputs
it's whatever the var step is (4 usually) not an unconditional 1
2010-04-06 12:07:33 -04:00
Michal Krol
859642c655 util: Respect destination stride in pipe_get_tile_swizzle(). 2010-04-06 17:20:09 +02:00
Zack Rusin
aeaf2cf18f draw llvm: fix draw arrays
we don't index within the outputs but only within the inputs
2010-04-06 11:00:35 -04:00
José Fonseca
04ea6f5dd8 util: Make half float lookup tables constant. 2010-04-06 15:38:21 +01:00
José Fonseca
05b494c101 util: Remove the hand written SRGB format support code. 2010-04-06 15:38:21 +01:00
José Fonseca
10dd0cad67 util: Support all SRGB formats.
Based on code from Brian Paul and Michal Krol.
2010-04-06 15:38:21 +01:00
Chia-I Wu
d18d0fdcd8 egl_dri2: Flush before context switch and swap buffers.
DRI does not define any callback to flush the current context.  GLX
loader simply calls glFlush.  Follow the GLX loader here.
2010-04-06 19:54:06 +08:00
Chia-I Wu
7915151f2d st/dri: Implement DRI image extension. 2010-04-06 19:32:27 +08:00
Chia-I Wu
216c76c820 progs/egl: Correctly check GL_OES_EGL_image.
The hack was added because GL_OES_EGL_image was not exported in the
extension string.
2010-04-06 18:54:23 +08:00
Chia-I Wu
2002e4d06e mesa: Add OES_EGL_image to extension list. 2010-04-06 18:01:41 +08:00
Chia-I Wu
0942ed45b3 progs/egl: Fix the blank window in pbuffer demo.
EGL requires eglSwapBuffers to be called on the current surface.
2010-04-06 13:48:59 +08:00
Chia-I Wu
f51f62e8ed progs/egl: Port drawtex and torus to eglut.
This brings the demos also to KMS and removes about 400 duplicated lines
of code.
2010-04-06 13:48:59 +08:00
Brian Paul
7d2db19fe5 st/mesa: reformatting 2010-04-05 22:19:11 -06:00
Brian Paul
489eced800 st/mesa: put fragment wpos code into separate function 2010-04-05 22:19:11 -06:00
Zack Rusin
9dd70e7b85 draw llvm: fix loop iteration and vertex header offsets
the loop was doing a NE comparison which we could have skipped if the prim
was triangles (3 verts) and our step was 4 verts. also fix offsets in conversion
to aos.
2010-04-06 00:13:20 -04:00
Chia-I Wu
848945e5d6 egl: Unbind the old context in _eglBindContext.
The last commit incorrectly moved the code under an "else".
2010-04-06 11:55:40 +08:00
Chia-I Wu
bbe459b14d egl: Fix eglMakeCurrent with different surfaces.
0a82fadcdd seems to trigger a bug in
_eglBindContext.  Rework the logics yet again.  It is simpler, and
hopefully correct this time.
2010-04-06 11:37:58 +08:00
Chia-I Wu
ffb6a8f552 st/es: Remove unnedded --whole-archive.
All public functions in the archives are either directly referenced or
indirectly referenced by _glapi_get_proc_address.  There is no need for
--whole-archive.
2010-04-06 11:19:49 +08:00
Vinson Lee
4b5d488bc2 scons: Link expat in dri builds.
Fixes this i915g error.
i915_dri.so: undefined symbol: XML_ParserCreate
2010-04-05 18:13:09 -07:00
Eric Anholt
271e199673 Add definition of gl_ClipDistance[] 2010-04-05 16:45:02 -07:00
Brian Paul
1fdedf067d mesa: added Makefile.egl to GALLIUM_FILES 2010-04-05 17:33:12 -06:00
Thierry Vignaud
7fc3a766c0 mesa: add missing file to GALLIUM_FILES
Signed-off-by: Brian Paul <brianp@vmware.com>
2010-04-05 17:31:28 -06:00
Ian Romanick
63f394203a Set lower bound on size implied by whole-array assignment
When an unsized array is accessed with a constant extension index this
sets a lower bound on the allowable sizes.  When the unsized array
gets a size set due to a whole-array assignment, this size must be at
least as large as the implied lower bound.

This causes the following tests to pass:

    glslparsertest/glsl2/array-16.vert
2010-04-05 14:35:47 -07:00
Zack Rusin
1b0bab167c draw llvm: when generating the vertex_header struct adjust its name
change the name to not clash and accuretly represent the number of inputs
we store in the data member
2010-04-05 16:43:53 -04:00
Ian Romanick
63038e18ad Allow dereference of vectors and matrices with []
This causes the following tests to pass:
     glslparsertest/glsl2/matrix-11.vert
     glslparsertest/glsl2/matrix-12.vert
     glslparsertest/shaders/CorrectParse2.vert
     glslparsertest/shaders/CorrectSwizzle2.frag
2010-04-05 13:16:00 -07:00
Marek Olšák
50074ecd3a st/mesa: trivially enable GL_EXT_gpu_program_parameters 2010-04-05 19:52:16 +02:00
Marek Olšák
b05ada76a5 r300g: enforce microtiled zbuffer from X server
This should be relatively safe, I think.
2010-04-05 19:51:11 +02:00
Ian Romanick
b2deb19dc3 Set correct type for ir_dereference of a matrix or a vector 2010-04-05 10:30:15 -07:00
Marek Olšák
a1f85cf689 r300g: typecast using the r300_texture function 2010-04-05 19:21:09 +02:00
Brian Paul
df65e64c29 mesa: remove unused var
Fixes a coverity warnings.
2010-04-05 08:10:01 -06:00
Brian Paul
51e6c57054 i965g: change value of VERT_RESULT_PSIZ hack to avoid warnings 2010-04-05 08:01:29 -06:00
Brian Paul
557c8bb748 mesa: check for _NEW_BUFFERS for color read format queries 2010-04-05 08:01:05 -06:00
Brian Paul
3258058d3b util: added util_dl_error() 2010-04-05 07:47:23 -06:00
Ian Romanick
ee30e24f5f Merge branch '7.8' 2010-04-04 23:07:30 -07:00
Marek Olšák
bba6957da3 r300g: enable OpenGL 2.1 on r3xx-r4xx chipsets 2010-04-05 07:09:46 +02:00
Marek Olšák
a955f86b31 r300g: add fallback for back stencil reference value and masks for r3xx-r4xx
This splits rendering into two passes when front and back stencil
reference value, value mask, or write mask don't match.

The advantages of doing it in the driver instead of in st are:
* SWTCL is executed just once and the resulting vertex buffer is reused
  in the second pass.
* Lower driver overhead due to the fallback being very close to
  the actual draw emission with minimum state change.
2010-04-05 07:09:46 +02:00
Marek Olšák
b71bfc4400 r300g: simplify accessing screen from context 2010-04-05 07:09:46 +02:00
Marek Olšák
32327196f7 r300g: remove some XXXs
We can't have more than 8 texcoord outputs in VS.
2010-04-05 07:09:45 +02:00
Marek Olšák
d2686cdb23 r300g: raise the number of texture units to 16 for all supported chipsets
As per Radeon 9700 Opengl Programming and Optimization Guide [1], there are
16 texture units even on the first r300 chipsets. If you think I am wrong,
feel free to propose a patch.

[1] Here's PDF: http://people.freedesktop.org/~mareko/
2010-04-05 07:09:45 +02:00
Marek Olšák
e41a64591b r300/compiler: make the max number of fragment shader temporaries adjustable 2010-04-05 07:09:45 +02:00
Marek Olšák
4e949271c2 r300g: is_npot -> uses_pitch 2010-04-05 07:09:45 +02:00
Marek Olšák
0179c5a95b r300g: enable conditional rendering also for SWTCL 2010-04-05 07:09:45 +02:00
Vinson Lee
5399c6dfa1 progs: Include X11 headers and libraries in SCons build.
Fixes Mac OS X SCons build.
2010-04-04 19:15:01 -07:00
Vinson Lee
940098e925 glut: Include X11 headers and libraries in SCons build.
Fixes Mac OS X SCons build.
2010-04-04 18:28:03 -07:00
Vinson Lee
efdd33985c glew: Include X11 headers and libraries in SCons build.
Fixes Mac OS X SCons build.
2010-04-04 18:10:20 -07:00
Brian Paul
a437601bee docs: update status of transform feedback and instanced drawing 2010-04-04 19:08:21 -06:00
Brian Paul
bf4c4479dd mesa: don't turn on GL_EXT_transform_feedback yet 2010-04-04 19:05:39 -06:00
Brian Paul
528d100b80 st/mesa: call pipe_context::draw_arrays/elements_instanced() 2010-04-04 19:05:39 -06:00
Brian Paul
3b7ac45162 mesa: implement core Mesa support for GL_ARB_draw_instanced 2010-04-04 19:05:38 -06:00
Brian Paul
cf3193ad1c mesa: new validation functions for GL_ARB_draw_instanced 2010-04-04 19:05:38 -06:00
Brian Paul
3258dfbbbd mesa: new extension flag for GL_EXT/ARB_draw_instanced 2010-04-04 19:05:38 -06:00
Brian Paul
61b21f0c83 glapi: regenerated files for GL_ARB_draw_instanced 2010-04-04 19:05:38 -06:00
Brian Paul
736846b22f glapi: plug in ARB_draw_instanced.xml 2010-04-04 19:05:37 -06:00
Brian Paul
a4e1abd487 glapi: ARB_draw_instanced.xml file 2010-04-04 19:05:37 -06:00
Ian Romanick
4fb2daf42c Merge branch '7.8' 2010-04-04 16:54:00 -07:00
Chia-I Wu
ad3575e2dd progs/egl: Add an OpenGL ES demo for EGL_OES_image_pixmap.
The demo uses a Pixmap as its drawing area, and whatever is drawn on the
pixmap will be used as a texture to draw a cube.
2010-04-04 22:07:20 +08:00
Chia-I Wu
a1aa53b2a9 st/mesa: Implement GL_OES_EGL_image driver hooks.
Use st_manager::get_egl_image to look up GLeglImageOES and implement
EGLImageTargetTexture2D and EGLImageTargetRenderbufferStorage.
2010-04-04 21:58:32 +08:00
Chia-I Wu
776dc53f62 st/egl: Implement get_egl_image hook.
This hook may be used by rendering state trackers to implement EGLImage
extensions.
2010-04-04 21:49:24 +08:00
Dave Airlie
d605b0db4d r300g: fix TFP stride override.
We should use pitch for the overriden state, fixes one half of the tfp test.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-04-04 20:31:42 +10:00
Marek Olšák
655fe28155 r300g: add conditional rendering 2010-04-04 08:59:09 +02:00
Marek Olšák
116c99768e r300g: add r4xx fragment shader registers
In case anyone needs it, it's here.
2010-04-04 05:27:12 +02:00
Marek Olšák
6eb892cc12 r300g: do not use the c++ template keyword
It makes life for some code browsing utilites easier.
2010-04-04 03:54:09 +02:00
Marek Olšák
e0848bd903 r300g: properly setup textures from X server
The setup needs be done after querying tiling flags.
2010-04-04 02:46:12 +02:00
Dave Airlie
4c26cdbe01 r300g: fix color tiling for buffer from X server.
The tiling setup needs a bit of work, but this should be good enough for now,
when we get buffers from the kernel we need to store their tiling properties.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-04-03 21:54:49 +10:00
Brian Paul
f618867645 mesa: display list support for GL_EXT_transform_feedback 2010-04-02 22:40:19 -06:00
Brian Paul
808c424b67 mesa: plug in GL_EXT_transform_feedback functions into dispatch 2010-04-02 22:40:19 -06:00
Brian Paul
d2f5d056d8 glapi: regenerated files for EXT_transform_feedback 2010-04-02 22:40:18 -06:00
Brian Paul
0101507ff0 glapi: include/build EXT_transform_feedback.xml 2010-04-02 22:40:18 -06:00
Brian Paul
9bfdd88ac2 glapi: new EXT_transform_feedback.xml file 2010-04-02 22:40:18 -06:00
Brian Paul
d661931fbc glapi: fix error message 2010-04-02 22:40:18 -06:00
Dave Airlie
073bae1ce4 r300 compiler: add target output debugging.
print the output target in the FP debug.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-04-03 12:19:13 +10:00
Ian Romanick
0157f41e5e Propagate sizes when assigning a whole array to an unsized array 2010-04-02 17:44:39 -07:00
Ian Romanick
9d975377ca Track whether whole-arrays are assignable
In GLSL 1.10 this was not allowed, but in GLSL 1.20 and later it is.

This causes the following tests to pass:

    glslparsertest/glsl2/array-09.vert
    glslparsertest/glsl2/array-13.vert
2010-04-02 17:17:47 -07:00
Ian Romanick
2d946634eb Whole structures are assignable
Whole arrays are assignable in GLSL 1.20 and later, but it's not clear
how to handle that within the IR because the IR is supposed to be
shading language version agnostic.
2010-04-02 17:06:57 -07:00
José Fonseca
47e6142658 util: Revert unsolicited, untested, unreviewed, and broken changes to format support.
Not all is bad, but I'm afraid I'll have to throw the baby with the water
given they are all tied to together.
2010-04-03 00:51:19 +01:00
José Fonseca
dd194b6932 python/tests: Output test results in a format that Hudson CI can understand. 2010-04-03 00:20:58 +01:00
Ian Romanick
cb9cba20a0 Use glsl_type::element_type to get the type of array elements 2010-04-02 16:08:44 -07:00
Zack Rusin
cb31d3b5fe draw llvm: fix storing of outputs for the rest of the pipeline
there's no good way of aligning the output's, and since the vertex_header
is variable sized in the first place we need to extract elements from a vector
and store them individually into an array. this gets the basic examples working
again
2010-04-02 18:52:32 -04:00
Ian Romanick
c35bb00130 Ensure that 'in' and 'inout' formal parameters are valid lvalues
This causes the following tests to pass:

    glslparsertest/shaders/function10.frag
2010-04-02 15:51:02 -07:00
Ian Romanick
cf37c9e8da Additional void parameter checks
If there is a void parameter it must not have a name, and it must be
the only parameter.
2010-04-02 15:30:45 -07:00
Ian Romanick
45d8a70c12 Require that function formal parameters have names 2010-04-02 15:09:33 -07:00
Corbin Simpson
73cd1cf7c1 gallium/docs: Dithering might not actually do anything. 2010-04-02 14:25:38 -07:00
Corbin Simpson
21961f6e96 r300g: Expound on dithering comment. 2010-04-02 14:21:50 -07:00
Dave Airlie
f6c7b91165 r300g: make dithering work like fglrx.
From fglrx traces the dithering is never enabled.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-04-03 07:03:01 +10:00
Yann Droneaud
1d11ba0ba3 gallium: fix dri_destroy_option_cache() when optionCache.info is NULL
With an Intel 855GM handled by intel_drv, there's a crash with Gallium3D
enabled DRI driver for Intel i915 (--enable-gallium-intel).
The Gallium3D driver doesn't support the 855GM as expected by
intel_drv, it failed to open the screen and give an half
initialized screen structure to dri_destroy_option_cache():
optionCache.info is NULL, so it's crashing while trying
to free array content. This patch at least fix the crash in the function.

Here's some logs of the fixed version:

[ 16274.137] LoaderOpen(/opt/mesa/lib/xorg/modules/drivers/intel_drv.so)
[ 16274.139] (II) Loading /opt/mesa/lib/xorg/modules/drivers/intel_drv.so
[ 16274.183] (II) Module intel: vendor="X.Org Foundation"
[ 16274.183]    compiled for 1.8.0, module version = 2.11.0
[ 16274.183]    Module class: X.Org Video Driver
[ 16274.183]    ABI class: X.Org Video Driver, version 7.0
[ 16274.183] (II) intel: Driver for Intel Integrated Graphics Chipsets: i810,
        i810-dc100, i810e, i815, i830M, 845G, 852GM/855GM, 865G, 915G,
        E7221 (i915), 915GM, 945G, 945GM, 945GME, Pineview GM, Pineview G,
        965G, G35, 965Q, 946GZ, 965GM, 965GME/GLE, G33, Q35, Q33, GM45,
        4 Series, G45/G43, Q45/Q43, G41, B43, Clarkdale, Arrandale
[ 16274.382] (II) intel(0): Integrated Graphics Chipset: Intel(R) 855GME
[ 16274.382] (--) intel(0): Chipset: "852GM/855GM"
[ 16276.675] (II) intel(0): [DRI2] Setup complete
[ 16276.675] (II) intel(0): [DRI2]   DRI driver: i915
debug_get_option: GALLIUM_TRACE = (null)
debug_get_bool_option: GALLIUM_RBUG = FALSE
debug_get_bool_option: INTEL_DUMP_CMD = FALSE
i915_create_screen: unknown pci id 0x3582, cannot create screen
dri_init_screen_helper: failed to create pipe_screen
[ 16276.794] (EE) AIGLX error: Calling driver entry point failed
[ 16276.794] (EE) AIGLX: reverting to software rendering
[ 16276.794] (II) AIGLX: Screen 0 is not DRI capable
[ 16276.796] (II) AIGLX: Loaded and initialized /opt/mesa/lib/dri/swrast_dri.so
[ 16276.796] (II) GLX: Initialized DRISWRAST GL provider for screen 0

Signed-off-by: Yann Droneaud <yann@droneaud.fr>
Reviewed-by: Corbin Simpson <MostAwesomeDude@gmail.com>
2010-04-02 13:44:31 -07:00
Zack Rusin
557b75248a draw llvm: fix translation of formats with variable components 2010-04-02 15:56:34 -04:00
Ian Romanick
3f9a73d121 Make built-in gl_TexCoord available in vertex and fragment shaders 2010-04-02 11:59:57 -07:00
Ian Romanick
fe1c7ff6c6 Fix matching of integer function parameters
This causes the following tests to pass:

    glslparsertest/shaders/function10.frag
2010-04-02 11:45:06 -07:00
Eric Anholt
c2cb84e17b Add bool/int conversion as IR operations.
Fixes constructor-09.glsl and CorrectParse2.frag.
2010-04-02 11:22:41 -07:00
Eric Anholt
dc58b3f8cc Add conversion of bool to float as an IR operation to match int to float. 2010-04-02 11:22:41 -07:00
Eric Anholt
106d122318 Add PASS / FAIL annotations to tests missing them.
This tricked my import of the tests into piglit.
2010-04-02 11:22:41 -07:00
Eric Anholt
3f15150932 Test that invalid quailfiers aren't used on variables in GLSL 1.10. 2010-04-02 11:22:41 -07:00
Eric Anholt
c7da28b4be Allow array dereferences to be considered as lvalues.
Fixes glsl-vs-arrays.vert and glsl-vs-mov-after-deref.vert.
Regresses parser3.frag which was failing for the wrong reason.
2010-04-02 11:22:41 -07:00
Eric Anholt
5150c567a0 Test for the type being different in parameter_lists_match.
Fixes CorrectFuncOverload.frag.
2010-04-02 11:22:41 -07:00
Eric Anholt
d251b92f8d Add some more operations to ir_constant_expression.cpp. 2010-04-02 11:22:41 -07:00
Eric Anholt
d98da9738e Make ir_constant_expression.cpp support multi-component types. 2010-04-02 11:22:41 -07:00
Eric Anholt
160d092507 Simplify ir_constant_expression.cpp by factoring operand computation out. 2010-04-02 11:22:41 -07:00
Eric Anholt
90b7825b0e Reject non-float varyings.
Fixes varying2.frag.
2010-04-02 11:22:41 -07:00
Eric Anholt
aeab105342 Remove fake ir_binop_logic_not. I think you meant ir_unop_logic_not. 2010-04-02 11:22:41 -07:00
Eric Anholt
528bb85359 Handle logic not in constant expression evaluation. 2010-04-02 11:22:41 -07:00
Eric Anholt
ebbf14b980 Fix error handling of logic operators.
They were always throwing a type error because type wasn't being set.
2010-04-02 11:22:41 -07:00
Eric Anholt
183d8c6394 Emit errors for unfinished ast_to_hir expression operations. 2010-04-02 11:22:41 -07:00
Eric Anholt
a5827fe8d0 Fix ast_logic_not handling to be unary, not binary. 2010-04-02 11:22:41 -07:00
Eric Anholt
65e1a7ac6a Add errors for type results of other expressions. 2010-04-02 11:22:41 -07:00
Eric Anholt
a13bb1490c Emit errors from failure in arithmetic_result_type.
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2010-04-02 11:22:35 -07:00
Eric Anholt
a576f9d84c Start trying to fill in a few bits of ir_constant_expression.cpp
This makes a little progress on CorrectParse2.frag.
2010-04-02 11:05:16 -07:00
Eric Anholt
307c71bf24 Compute the constant value of a constant initializer.
Fixes constFunc.frag.
2010-04-02 11:05:16 -07:00
Eric Anholt
ac3af37d27 Allow initializers of constant values to succeed.
This regresses constFunc.frag, but that's just unexpectedly passing
because of the FINISHME just above.
2010-04-02 11:05:16 -07:00
Eric Anholt
068c80cfe0 Don't create a parameter declaration for a (void) parameter.
Fixes segfaults in a shader consisting of just:

    void main(void) { }

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2010-04-02 11:05:16 -07:00
Ian Romanick
03d3f3ab71 Remove ast_node::type
It isn't a type (is was enum specifying the kind of node), it was
unused, and it was easily confused with actual type fields.  Kill with fire.
2010-04-02 11:05:16 -07:00
Brian Paul
bc50336b6a llvmpipe: limit max texture size to 2Kx2K for now
MAXWIDTH/HEIGHT were 2048 but the max texture size was 4096.
This caused a crash if a 4Kx4K texture was created and rendered to.
See comment about max framebuffer size in lp_scene.h.

Also added assertions to catch this inconsistancy in the future.
2010-04-02 09:20:05 -06:00
Vinson Lee
82e289d355 gallivm: Add fallthrough comment at end of case statement.
The code is correct. Tell Coverity that the fallthrough case is
intentional.
2010-04-02 01:16:13 -07:00
Vinson Lee
c87e6e50ee progs/gallium/unit: Silence uninitialized variable warnings. 2010-04-02 01:08:31 -07:00
Luca Barbieri
2d65a7caf9 gallium/util: print \n after DXTn printf 2010-04-02 07:33:12 +02:00
Luca Barbieri
f50247c9aa softpipe: remove S3TC init, since it's done on-demand now 2010-04-02 07:33:12 +02:00
Vinson Lee
36ed9a7f13 progs/gallium/unit: Move declaration before code.
Fixes SCons build.
2010-04-01 22:29:23 -07:00
Brian Paul
3e1a3923f4 glsl: fix bad return value in link_transform_feedback() 2010-04-01 22:32:46 -06:00
Brian Paul
e47d7e8790 gallium/util: remove extraneous semicolon 2010-04-01 22:19:52 -06:00
Brian Paul
361b179720 gallium: remove old comment about return values 2010-04-01 22:17:14 -06:00
Brian Paul
30b9ead229 glsl: remove obsolete comment 2010-04-01 22:17:14 -06:00
Brian Paul
107c72f355 glsl: do extra link checking for transform feedback 2010-04-01 22:17:14 -06:00
Brian Paul
50a75a0b4a docs: update GL3 / GL_ARB_fragment_coord_conventions status 2010-04-01 22:17:14 -06:00
Brian Paul
3100f31b74 mesa: minor fixes in _mesa_GetTransformFeedbackVarying() 2010-04-01 22:17:14 -06:00
Brian Paul
3b49437372 glsl: append built-in, used varying vars to the varying vars list 2010-04-01 22:17:14 -06:00
Brian Paul
1a14866689 mesa: make _mesa_copy_string() non-static 2010-04-01 22:17:13 -06:00
Brian Paul
038aba1f08 glsl: pass datatype to _mesa_add_varying()
Will be needed later for transform feedback support.
2010-04-01 22:17:13 -06:00
Brian Paul
ee91c1e367 glsl: add more vertex/fragment output info helpers 2010-04-01 22:17:13 -06:00
Luca Barbieri
2a090ae80a gallium/util: revert util_format_init addition
Putting calls to util_format_init all over the codebase is infeasible.

Instead, half float tables are pregenerated, and the s3tc library is
loaded on demand.

I believe this is a solution that combines performance, cleanliness,
flexibility and portability.
2010-04-02 06:16:30 +02:00
Luca Barbieri
5126683e3b gallium/util: add util_format_is_supported to check for pack/unpack
This improves the code by making it more readable, and removes
special knowledge of S3TC and other formats from softpipe.
2010-04-02 06:16:30 +02:00
Luca Barbieri
52e9b990a1 gallium/util: load s3tc on demand
This changes the S3TC function pointers to be initialized to stubs
that load the S3TC library and then delegate to the real functions.

If the S3TC library fails to load, the function pointers are replaced
with a "nop" function.

The code is also changed to attempt to load the library only one time.c

Note that unlike checking for a flag, this method has no performance
cost at all.

The use of the "nop" functions also allows to avoid most checks, that
are only preserved when the function does non-trivial work.
2010-04-02 06:16:30 +02:00
Luca Barbieri
6259264c57 progs/gallium: add unit test for u_half 2010-04-02 06:16:30 +02:00
Luca Barbieri
c476305cde gallium/util: pregenerate half float tables
This solution avoids the issue of how to run the initializers and
also allows those pages (and the parts of them in processor caches)
to be shared between multiple processes.

The drawback is slightly higher library size.
2010-04-02 06:16:18 +02:00
Chia-I Wu
2ae66e9b97 st/egl: Add a missing break.
The swtich in egl_g3d_st_framebuffer_validate misses a break.
2010-04-02 10:20:24 +08:00
Chia-I Wu
c36d15d158 progs/egl: Update .gitignore. 2010-04-02 10:03:31 +08:00
Chia-I Wu
1054f22e48 progs/egl: Link to eglut first.
This moves eglut before EGL so that the symbols can be resolved.
2010-04-02 10:01:00 +08:00
Vinson Lee
87275e8fab gallium/util: s/inline/INLINE/
Fixes MSVC build.
2010-04-01 18:50:31 -07:00
Ian Romanick
b8a21cc6df Track max accessed array element, reject additional out-of-bounds accesses
For unsized arrays, we can't flag out-of-bounds accesses until the
array is redeclared with a size.  Track the maximum accessed element
and generate an error if the declaration specifies a size that would
cause that access to be out-of-bounds.

This causes the following tests to pass:

    glslparsertest/shaders/array10.frag
2010-04-01 18:35:08 -07:00
Ian Romanick
27e3cf8c0d Begin processing ast_array_index nodes
This causes the following tests to pass:

    glslparsertest/shaders/parser3.frag
    glslparsertest/shaders/varying3.frag (also generates spurious error)
2010-04-01 18:34:56 -07:00
Ian Romanick
63af4b0e99 Fix type handling in ir_dereference array dereference constructor 2010-04-01 18:02:48 -07:00
Luca Barbieri
cbf4097b8d nv50: call util_format_init
Needed to fetch static vertex attributes.
2010-04-02 02:36:59 +02:00
Luca Barbieri
aee5bb5b8a gallium/util: add util_format_init that inits s3tc and util_half
Switch from auto-init to explicit init for util_half per Brian Paul's
indication.

NOTE: this is probably broken because not enough things call util_format_init.
Will be fixed shortly
2010-04-02 02:31:43 +02:00
Ian Romanick
a4f308f066 Allow unsized arrays to be redeclared with a size
Test glslparsertest/shaders/array11.frag now passes for the right reason.
2010-04-01 17:25:11 -07:00
Ian Romanick
00e517616b Add glsl_type::element_type and glsl_type::array_size queries
The former gets the type of elements in an array, and the later gets
the declared size, if any, of the array.
2010-04-01 17:17:34 -07:00
Luca Barbieri
ecaaf8c15f gallium/util: add one-time initialization helper 2010-04-02 02:01:25 +02:00
Zack Rusin
ab5c097387 draw llvm: a lot better storing implementation 2010-04-01 18:58:51 -04:00
Luca Barbieri
3040462c10 gallium/util: use #pragma section instead of #pragma data_seg
They apparently both declare the section, but #pragma data_seg
also puts all subsequent definitions in the section, which is
undesirable.

This should be the correct solution, and is actually used by the
reference I cited (but I forgot to do it in my code).

Untested, let me know if it doesn't work.
2010-04-02 00:48:27 +02:00
Luca Barbieri
6c5f444f59 gallium/util: reindent u_half.c and u_half.h with Mesa coding style
Sorry, forgout about that.
2010-04-02 00:48:27 +02:00
Luca Barbieri
7bb54c99a4 Revert "util: Init half-float tables on demand."
This reverts commit 950300eb25.
2010-04-02 00:47:11 +02:00
Dan Nicholson
e40fce13e1 progs: Fix linking of Xlib demos for non-autoconf builds
The Xlib demos were fixed to use $(X11_LIBS) so that configure could
detect the proper directory to link the library from, but this broke
the non-autoconf builds. Give X11_LIBS a default value to fallback on.
2010-04-01 15:03:33 -07:00
Corbin Simpson
950300eb25 util: Init half-float tables on demand.
Gets rid of unnecessary delays on startup and compiler-specific hax.
2010-04-01 14:41:18 -07:00
José Fonseca
7e1aceaf0a llvmpipe: Support sampling from PIPE_FORMAT_R32_FLOAT. 2010-04-01 19:01:46 +01:00
Michal Krol
13d2f3c738 util: Declare .CRT$XCU data segment. 2010-04-01 19:25:25 +02:00
Michal Krol
8c519e5f87 scons: Remove `util/u_gctors.cpp'. 2010-04-01 19:06:05 +02:00
Luca Barbieri
4edffe026e gallium/util: rewrite global constructor system for half floats (GCC/MSVC only!)
NOTE: this commit will cause Gallium to fail to build on any compiler
      except GCC, the Microsoft C compiler and compatible compilers that
      claim to be one of those.

This commit removes the u_gctors.cpp mechanism, in favor of using
compiler-specific syntax to add global constructors from C files.

This solves the problem of u_gctors.o not being pulled from static
libraries and avoids using C++.

However, it needs compiler-specific support for every compiler.

The Microsoft C compiler support has not been tested.
2010-04-01 18:52:02 +02:00
José Fonseca
8f38135e28 llvmpipe: Support sampling from signed and mixed siged formats. 2010-04-01 17:46:59 +01:00
José Fonseca
675fcb6cae python/tests: We're using a rgba8 rendertarget so sample only in the [0, 1] range. 2010-04-01 17:46:59 +01:00
José Fonseca
f14c5adbc7 st/python: Allow to sample only in the [0,1] range. 2010-04-01 17:46:59 +01:00
José Fonseca
811e602954 python/tests: Several cleanups. 2010-04-01 17:46:59 +01:00
José Fonseca
e011272fa3 st/python: Always use softpipe as reference driver. 2010-04-01 17:46:58 +01:00
Luca Barbieri
38afd1e445 gallium/util: add copyright header to u_half.c 2010-04-01 17:31:31 +02:00
Chia-I Wu
a49db89326 Update DEMO_FILES for demos using EGL.
Reflect the recent addtion of eglut and reorganization of the EGL demos.
This helps remove ~2k lines of duplicated code

$ git diff --shortstat -M 57cc1db87b
 18 files changed, 298 insertions(+), 2178 deletions(-)
2010-04-01 22:29:48 +08:00
Chia-I Wu
532b7400fd progs/egl: Port OpenVG lion and sp to eglut. 2010-04-01 22:25:50 +08:00
Chia-I Wu
7b48d88407 progs/egl: Port ES1 gears to eglut.
As gears in the last demo under "screen" subdirectory, this also removes
the directory.
2010-04-01 22:25:49 +08:00
Chia-I Wu
dd7276f494 progs/egl: Port ES1 tri to eglut.
This also removes EGL_MESA_screen_surface version of ES1 tri as eglut
supports the extension.
2010-04-01 22:25:49 +08:00
Chia-I Wu
765b30849c progs/egl: Replace egltri by xegl_tri.
With the switch to eglut, xegl_tri supports both X11 and
EGL_MESA_screen_surface.  Have it replace egltri.
2010-04-01 22:25:49 +08:00
Chia-I Wu
02551cab47 progs/egl: Porg xegl_tri to eglut. 2010-04-01 22:25:49 +08:00
Chia-I Wu
589f6740ea progs/egl: Port eglgears to eglut. 2010-04-01 22:25:49 +08:00
Chia-I Wu
57cc1db87b progs/egl: Add eglut.
eglut is a simple library with GLUT-like API.  It is intended to be used
by simple EGL demos.
2010-04-01 22:25:48 +08:00
Chia-I Wu
fc3ddd4b56 progs/openvg: Move OpenVG demos to a subdirectory of progs/egl.
That is, move

  progs/openvg/demos to progs/egl/openvg,
  progs/openvg/trivial to progs/egl/openvg/trivial.
2010-04-01 22:25:48 +08:00
Chia-I Wu
7f231cab2b progs/es: Move OpenGL ES demos to subdirectories of progs/egl.
Move

  progs/es1/xegl -> progs/egl/opengles1,
  progs/es1/screen -> progs/egl/opengles1/screen,
  progs/es2/xegl -> progs/egl/opengles2.
2010-04-01 22:25:48 +08:00
Chia-I Wu
c727ef0108 progs/egl: Move demos a level deeper.
Move the demos to "opengl" subdirectory.
2010-04-01 22:25:48 +08:00
José Fonseca
2da7ef077a llvmpipe: More tweaks to the supported texture formats. 2010-04-01 15:16:26 +01:00
José Fonseca
6b1a8e0f87 gallium/unit: Invoke util_half_init_tables().
half float formats now pass the tests.
2010-04-01 15:15:57 +01:00
José Fonseca
89034b8ae7 util: Declare util_half_init_tables only once. 2010-04-01 15:15:28 +01:00
José Fonseca
982d36667d util: Use u_math.h's union fi instead of redefining it. 2010-04-01 15:11:05 +01:00
José Fonseca
08eb07bc83 util: Add support for other DXTn RGBA formats. 2010-04-01 15:07:14 +01:00
José Fonseca
8548efbe1d util: Get DXT1_RGB format working correctly. 2010-04-01 14:43:35 +01:00
José Fonseca
ca6aacf842 util: Add test case for PIPE_FORMAT_DXT1_RGB. 2010-04-01 13:34:24 +01:00
José Fonseca
9899ebd2fc llvmpipe: Fix build... 2010-04-01 13:20:00 +01:00
José Fonseca
d099554492 util: Allow to have block format test cases 2010-04-01 13:12:43 +01:00
Michal Krol
943408533d util: Generate correct format conversions for half floats. 2010-04-01 13:56:03 +02:00
Michal Krol
b7bca4b28c util: Use u_half to perform half <--> float conversions. 2010-04-01 13:33:08 +02:00
Michal Krol
5a359df219 gallium: Integrate util_half with scons. 2010-04-01 13:33:08 +02:00
Luca Barbieri
3ff175d6de gallium/util: add fast half float conversion functions
This adds a fast half float conversion facility to Gallium.

Mesa already contains such a facility, but using a much worse algorithm.

This one is an implementation of
www.fox-toolkit.org/ftp/fasthalffloatconversion.pdf
and uses a branch-less algorithm with some lookup tables small enough
to fit in the L1 cache.

Ideally, Mesa should start using these functions too, but I'm not sure
how to arrange that with the current build system.

A new "u_gctors.cpp" is added that defines a global C++ constructor
allowing to initialize to conversion lookup tables at library init.
2010-04-01 13:33:07 +02:00
José Fonseca
110e039d0d gallium/unit: Install test in build/xxx/bin 2010-04-01 11:52:54 +01:00
José Fonseca
f706f12bbf util: Add half float test cases. 2010-04-01 11:52:00 +01:00
José Fonseca
898ddd6b00 llvmpipe: Fix (un)swizzling, broken due to use of VOID channels. 2010-04-01 11:31:27 +01:00
Vinson Lee
bef912abd3 mesa: Remove unnecessary header. 2010-03-31 23:44:29 -07:00
Vinson Lee
e6be593fbf r300g: Remove unnecessary header. 2010-03-31 23:36:06 -07:00
Luca Barbieri
7326851757 util/format: fix big endian compilation by not trying to byteswap single bytes
Conceivably, we could also have a dummy util_bswap8, but it seems better
to not emit it in the first place.
2010-04-01 06:23:30 +02:00
Zack Rusin
b6d052e4fd Merge remote branch 'origin/master' into gallium_draw_llvm 2010-03-31 22:16:09 -04:00
Zack Rusin
ae5487d427 draw llvm: fix iteration over buffers
fetching was converting garbage
2010-03-31 22:15:12 -04:00
Zack Rusin
2fb655d1db gallivm: convert floats to doubles
printf can't handle floats, convert them to doubles so that we can
actually print floats.
2010-03-31 21:30:37 -04:00
Kenneth Graunke
ebfdef7a83 Set source locations on AST nodes so error messages print locations.
I haven't verified that these are all correct, but it's still a lot
better than not having anything.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2010-03-31 18:26:27 -07:00
Ian Romanick
92318a9479 Add ast_function::hir
ast_function::hir consists of bits pulled out of
ast_function_definition::hir.  In fact, the later uses the former to
do a lot of its processing.  Several class private data fields were
added to ast_function to facilitate communicate between the two.

This causes the following tests to pass:

    glslparsertest/shaders/CorrectModule.frag

This causes the following tests to fail.  These shaders were
previously failing to compile, but they were all failing for the wrong
reasons.

    glslparsertest/shaders/function9.frag
    glslparsertest/shaders/function10.frag
2010-03-31 18:23:21 -07:00
Ian Romanick
acce380a3f Fix exec_list::move_nodes_to when the source list is empty 2010-03-31 18:15:50 -07:00
Ian Romanick
e29a585989 Use ir_variable::clone to copy parameters to the function body
Several other code movements were also done.  This partitions this
function into two halves.  The first half processes the prototype
part, and the second have processes the actual function definition.
The coming patch series will parition ast_function_definition::hir
into (at least) two separate functions.
2010-03-31 17:54:26 -07:00
Ian Romanick
2d394d4877 Add ir_variable::clone 2010-03-31 17:52:44 -07:00
Ian Romanick
25711a85c2 Minor cleanups in ast_function_definition::hir 2010-03-31 17:43:33 -07:00
Marek Olšák
2ab7375572 r300g: add RGBA16F colorbuffer support
Disabled by default due to unresolved IP issues.
2010-04-01 02:21:06 +02:00
Marek Olšák
3252651fb2 r300g: add RGTC texture support
The CS checker already knows about this.
2010-04-01 02:14:52 +02:00
Ian Romanick
00aa173c9c Generate array constructor calls 2010-03-31 16:48:48 -07:00
Ian Romanick
0f0ea58264 Add ir_function_signature::function_name 2010-03-31 16:44:12 -07:00
Ian Romanick
a4775823b0 Make ir_function::signatures private 2010-03-31 16:40:58 -07:00
Ian Romanick
95cd6cc195 Add ir_function::iterator to iterate over function signatures 2010-03-31 16:40:26 -07:00
Ian Romanick
6a15d5b514 Use ir_function::add_signature to create link between function and signature
ir_function_signature now has a pointer back to the ir_function that owns it.
2010-03-31 16:37:10 -07:00
Ian Romanick
4ef183e51d Add glsl_type::generate_constructor_prototype
Generates a symbol table entry and the IR approximation of a prototype for a
type's constructor.  Currently only arrays are supported.
2010-03-31 16:30:56 -07:00
Ian Romanick
68515ee6c2 Refactor parts of match_function_by_name into process_parameters and process_call
These will be used in the functions that implement calls to array constructors.
2010-03-31 16:28:51 -07:00
Ian Romanick
b6326abb85 Reject array constructor calls in GLSL 1.10 2010-03-31 16:25:21 -07:00
Ian Romanick
3e0ef5f81b Use ast_type_specifier::glsl_type to get the type of a constructor
This is the first baby step towards getting array constructors working.
2010-03-31 16:22:56 -07:00
Ian Romanick
d612a127cc Move type_specifier_to_glsl_type to ast_type_specifier::glsl_type
This make is easily accessible from other modules.
2010-03-31 16:22:06 -07:00
Ian Romanick
615adcda8a More array declaration tests 2010-03-31 16:16:54 -07:00
Ian Romanick
299ed08a68 Fix big dumbness in glsl_type::get_array_instance
hash_table_insert needs to keep the key so that it compare keys on a
following hash_table_find call.  Since key was allocated on the stack,
it disappeared out from under the hash table.
2010-03-31 16:13:38 -07:00
Marek Olšák
39e116e3a0 r300g: format handling cleanup 2010-04-01 01:13:26 +02:00
José Fonseca
f45d43a17f softpipe: Use S3TC when avaiilable, 2010-03-31 22:47:11 +01:00
José Fonseca
9388ce4191 util: Hook into libtxc_dxtn.so (WIP). 2010-03-31 22:46:42 +01:00
Ian Romanick
0bf3810165 glsl_type array constructor generate a real name for the type 2010-03-31 14:37:42 -07:00
José Fonseca
b5d073b39d llvmpipe: Don't call unused generate_clamp(). 2010-03-31 21:37:57 +01:00
José Fonseca
36e92a0494 libgl-xlib: Fix missing X11 symbols. 2010-03-31 21:27:47 +01:00
José Fonseca
018aae950d util: Make the accessors bidimensional again.
Otherwise there's no way to unpack blocks with height >1
2010-03-31 21:27:47 +01:00
Eric Anholt
0ed6125725 Test that const declarations include initializers.
Fixes dataType6.frag, and also array2.frag for an unexpected but valid
reason.
2010-03-31 13:17:23 -07:00
Ian Romanick
e0800062da Reject declarations with 'in' or 'out' qualifiers
'in' and 'out' can only be used in function parameter lists or at
global scope (1.30 and later).  This change enforces this.
2010-03-31 13:15:23 -07:00
Ian Romanick
a705d65ccd Add 'in' to some parameters of the function
This goes along with the qualifier-?? tests.
2010-03-31 13:14:37 -07:00
Ian Romanick
d8a2133887 Add some variable declaration qualifier tests 2010-03-31 13:13:12 -07:00
Ian Romanick
d8065d86e8 Fix comment bug and printf bug in previous commit 2010-03-31 13:03:56 -07:00
Michal Krol
b8012643e1 util: First stab at half-float conversion. 2010-03-31 21:55:31 +02:00
Ian Romanick
b168e53452 Require that 'uniform' and 'varying' variables be declared at global scope
This causes the following tests to pass:

    glslparsertest/shaders/uniform.frag
    glslparsertest/shaders/varying.frag
2010-03-31 12:31:18 -07:00
Ian Romanick
e1c1a3f3bd Slightly refector checks for declarations that must be at global scope 2010-03-31 12:26:03 -07:00
José Fonseca
329814c6ee util: Describe PIPE_FORMAT_NONE as PIPE_FORMAT_R8_USCALED.
Avoids the need to special case PIPE_FORMAT_NONE so often.

Conflicts:

	src/gallium/auxiliary/util/u_format_table.py
2010-03-31 20:19:14 +01:00
Eric Anholt
b82c0c31ae Implement logical operators.
Fixes parser9.frag.
2010-03-31 09:17:39 -10:00
Eric Anholt
b97ee2e260 Test that variable names don't use the reserved gl_ prefix.
Fixes identifier2.frag.
2010-03-31 09:17:35 -10:00
José Fonseca
9fcf2b87b3 util: Silence pointer to integer size mismatch errors. 2010-03-31 20:16:15 +01:00
José Fonseca
69895725cf util: Add callback to fetch a single pixel. 2010-03-31 20:15:17 +01:00
José Fonseca
3200e70858 python/tests: Read the number of tests to execute from command line. 2010-03-31 20:05:10 +01:00
José Fonseca
96548d80e5 mesa: Use a consistent name of the external s3tc library for all windows compilers. 2010-03-31 19:53:25 +01:00
José Fonseca
93eee0537f scons: Force to consider the util/u_format_pack.py for util/u_format_table.c. 2010-03-31 19:43:57 +01:00
José Fonseca
cf5cd836de scons: Don't always include/links X11 headers/libs.
Move it into a separate tool.

TODO: Needs to be "tooled" in each SConscript that uses it.
2010-03-31 18:40:10 +01:00
José Fonseca
6047c89a23 scons: Don't always link expat.
Only needed for DRI. Should be linked in DRI specific subdirectories.
2010-03-31 18:38:23 +01:00
José Fonseca
e1c1911435 llvmpipe: Disable threads by default on embedded. 2010-03-31 18:38:12 +01:00
Kurt Daverman
730cd1baaa os: Temporarily use posix thread for embedded too. 2010-03-31 18:38:07 +01:00
José Fonseca
711f6428bc scons: Allow any toolchain to be specified in the command line. 2010-03-31 18:37:38 +01:00
José Fonseca
f1f6370eb4 util: Remove the hand written u_tile.c functions for the ones that are code generated correctly.
Not that the code generated are any better, but to quickly detect any regression
in the code generated ones from now on.
2010-03-31 17:31:14 +01:00
José Fonseca
c5d4a44f44 util: Use u_format_pack.py's code instead of u_format_access.py. 2010-03-31 17:31:14 +01:00
José Fonseca
8e833c7988 llvmpipe: Don't rely on u_format_access.py 2010-03-31 17:30:12 +01:00
Roland Scheidegger
d97f6963ae Merge branch 'gallium-new-formats'
Conflicts:
	src/gallium/auxiliary/util/u_format.csv
	src/gallium/auxiliary/util/u_format_access.py
	src/gallium/auxiliary/util/u_format_pack.py
2010-03-31 16:57:05 +02:00
José Fonseca
96bf4aff5b util: Put the format pack/unpack functions in the description table. 2010-03-31 15:32:16 +01:00
José Fonseca
e245ca74e1 util: Make pack/unpack operate on spans. 2010-03-31 15:32:16 +01:00
Ben Skeggs
b46750d601 st/mesa: use BITFIELD64_BIT to access shader OutputsWritten in more places 2010-03-31 23:34:30 +10:00
José Fonseca
325d55303d util: Make util_format_xxx_pack_xxx take pointer as arguments. 2010-03-31 14:31:29 +01:00
José Fonseca
bce109c944 util: Fix PIPE_FORMAT_B5G5R5X1_UNORM test case. 2010-03-31 14:28:54 +01:00
José Fonseca
338b9d71df util: Use VOID type for X channels in format descriptions. 2010-03-31 14:28:34 +01:00
José Fonseca
d0258ca59d python/tests: Run trhough tests randomly. 2010-03-31 14:05:55 +01:00
José Fonseca
213e6584ed gallivm: Fix USCALED translation. Minor Cleanups. 2010-03-31 14:05:21 +01:00
José Fonseca
ead8f82eeb llvmpipe: More accurate format capability exporting. 2010-03-31 14:00:46 +01:00
José Fonseca
aa364d091e llvmpipe: Drop the aos format conversion.
It's unused and incomplete. Still in git history if necessary in future.
2010-03-31 13:59:59 +01:00
José Fonseca
7a26c875a9 util: Generalize lp_format_is_rgba8 into util_format_is_rgba8_variant. 2010-03-31 13:55:12 +01:00
José Fonseca
e566046efc python/tests: Rename test name.
We only test blitting from a surface -- we don't test any sampler state.
2010-03-31 13:28:36 +01:00
José Fonseca
6de8f86ab4 python/tests: Test all existing gallium formats. 2010-03-31 13:27:08 +01:00
José Fonseca
aae63a7109 python/tests: Speed up the tests by reusing the same pipe context. 2010-03-31 13:12:24 +01:00
José Fonseca
fceee46022 python/tests: Get the tests running again. 2010-03-31 13:12:24 +01:00
José Fonseca
52b4691518 st/python: Generate binding for u_format utility functions too. 2010-03-31 13:12:24 +01:00
Eric Anholt
b980207707 Test that discard only appears in the fragment shader.
Fixes fragmentOnly4.vert.
2010-03-30 23:40:14 -10:00
Eric Anholt
174cc03edc Test that main doesn't take any parameters.
Fixes main2.vert.
2010-03-30 23:37:51 -10:00
Eric Anholt
aad7c77937 Test that a non-void function returns a value. 2010-03-30 23:30:11 -10:00
Eric Anholt
ab79d4ec6e Test that a void function doesn't return a value.
Fixes function1.frag.
2010-03-30 23:28:17 -10:00
Vinson Lee
f2463eaccf i965g: Fix assertion that was always true.
surface_format field is a 9-bit field and the value of
BRW_SURFACEFORMAT_INVALID exceeds 9 bits.
2010-03-30 23:46:51 -07:00
Vinson Lee
5123e33863 st/dri: Remove unnecessary header. 2010-03-30 23:35:32 -07:00
Vinson Lee
9b6285c052 identity: Remove unnecessary header. 2010-03-30 22:42:45 -07:00
Vinson Lee
91454fb94d st/dri: Remove unnecessary header. 2010-03-30 22:35:23 -07:00
Eric Anholt
794ea61006 Fix unused variable warning. 2010-03-30 18:31:32 -10:00
Brian Paul
539d03ff36 mesa: added glGet queries for transform_feedback 2010-03-30 20:04:05 -06:00
Brian Paul
86a1ea31ed mesa: added glEnable/Disable state for transform feedback 2010-03-30 20:04:04 -06:00
Brian Paul
423860ac78 mesa: add new query/buffer targets for transform feedback 2010-03-30 20:04:04 -06:00
Brian Paul
a5d7ee929e mesa: plug in transform feedback functions, set limits 2010-03-30 20:04:04 -06:00
Brian Paul
e443d13ab6 mesa: add transformfeedback.c to build 2010-03-30 20:04:04 -06:00
Brian Paul
de8530e154 mesa: initial check-in of transform feedback functions 2010-03-30 20:04:04 -06:00
Brian Paul
e5c69647b0 mesa: add transform feedback queries
And make _mesa_copy_string() non-static.
2010-03-30 20:04:04 -06:00
Brian Paul
4e9f075448 mesa: add EXT_transform_feedback to extension list 2010-03-30 20:04:04 -06:00
Brian Paul
066f009795 mesa: initial data structures for transform feedback 2010-03-30 20:04:03 -06:00
Brian Paul
ed17446d80 mesa: simplify query code with get_query_binding_point() 2010-03-30 20:04:03 -06:00
Zack Rusin
880e3fb09b Merge remote branch 'origin/master' into gallium_draw_llvm 2010-03-30 21:10:33 -04:00
Zack Rusin
93e342574f draw llvm: fix a warning 2010-03-30 21:09:51 -04:00
Ian Romanick
a80cbd6d82 Forbid array comparisons in GLSL 1.10
This causes the following tests to pass:

    glslparsertest/shaders/array3.frag
2010-03-30 17:04:48 -07:00
Ian Romanick
28009cd75c Begin handling array declarations
This causes the following tests to pass:

    glslparsertest/shaders/array4.frag
    glslparsertest/shaders/array5.frag

This causes the following tests to fail.  These shaders were
previously failing to compile, but they were all failing for the wrong
reasons.

    glslparsertest/shaders/array3.frag
2010-03-30 16:59:47 -07:00
Ian Romanick
548a1b5ab7 Implement array type handling
Since all glsl_type objects are flyweights, support is added to track all
known array types.  This accounts for most of the changes.
2010-03-30 16:58:19 -07:00
Ian Romanick
066304679c Add proper wrappers so that C++ code can use hash_table type 2010-03-30 16:57:29 -07:00
Ian Romanick
1cf43a4331 Initial bits of constant expression evaluator
Currently only works for constants.  The rest will be added later.
2010-03-30 16:56:50 -07:00
Ian Romanick
84960f01cb Add some array declaration tests 2010-03-30 16:56:22 -07:00
Ian Romanick
4afed821ba intel: Bump intel driver date to later than the date on the 7.8 branch 2010-03-30 15:38:03 -07:00
Zack Rusin
b0f946e900 draw llvm: actually set the constant buffers on the context 2010-03-30 17:21:11 -04:00
Kristian Høgsberg
94264994b1 dri: Drop another unused __DRIscreen field 2010-03-30 16:48:51 -04:00
Kristian Høgsberg
4251076590 dri: Drop the unused dummyContext 2010-03-30 16:48:51 -04:00
Kristian Høgsberg
221bc02d29 dri: Drop an unused __DRIcontext field 2010-03-30 16:48:51 -04:00
Kristian Høgsberg
ff6bce552a intel: Remove redundant fields from struct intel_context
All these pointers are in the __DRIcontext struct, which we point to.
2010-03-30 16:48:51 -04:00
Kristian Høgsberg
581c773e81 intel: Use fb->Height when flipping read buffer orientation
With DRI2, x and y are always zero and fb->Height is always up to date
with the drawable height.
2010-03-30 16:48:51 -04:00
Zack Rusin
8bc07fc83e draw llvm: fix some silly mistakes
the vs_type selection isn't ideal, but for now both llvmpipe's fs and vs
do the same thing which is operate on 4xfloat vector as the base type
2010-03-30 16:16:36 -04:00
Corbin Simpson
3623202834 r300/compiler: Unbreak DDX/DDY.
Fixes progs/glsl/deriv.
2010-03-30 10:43:51 -07:00
Zack Rusin
6f34339af4 draw llvm: we translate between pointers, not values directly 2010-03-30 12:52:09 -04:00
Zack Rusin
1963112f9d draw llvm: various fixes for the translation code
the from translation isn't quite right yet
2010-03-30 12:35:40 -04:00
Zack Rusin
dc886ba139 gallivm: cleanup the code (found by coverity)
the condition can't be false, declerations are ok even if we don't
emit any.
2010-03-30 08:55:17 -04:00
George Sapountzis
5cc9387d0d drisw: fix use after free (bug 27370) 2010-03-30 13:10:36 +03:00
Michel Dänzer
e5c7d1e1c8 Merge branch '7.8'
Conflicts:
	Makefile
	src/mesa/main/version.h

Resolved by keeping version strings from master (also in the intel driver).
2010-03-30 12:01:31 +02:00
Chia-I Wu
aa1a790360 st/dri: Fix a memory leak in dri1_init_screen.
Free the returned configs upon errors.
2010-03-30 15:41:50 +08:00
Chia-I Wu
f6f5cba9a6 mesa/es: Use core mesa's mfeatures.h.
Remove mfeatures_es1.h and mfeatures_es2.h.  Build the overlay with
either FEATURE_ES1 or FEATURE_ES2 defined.
2010-03-30 15:39:17 +08:00
Chia-I Wu
066477ab22 mesa: Add missing features.
Add features tested in the code but missing from mfeatures.h.

This also fixes some tests of features.  They should be tested with
"#if", not "#ifdef".
2010-03-30 15:39:17 +08:00
Chia-I Wu
9f0e1be2de mesa: Add umbrella features.
Add FEATURE_GL, FEATURE_ES1, and FEATURE_ES2 for OpenGL, OpenGL ES 1.x,
and OpenGL ES 2.x respectively.  Define individual features through the
new umbrella features.  There is no real change introduced by this
commit.
2010-03-30 15:39:17 +08:00
Vinson Lee
49289007c1 drisw: Remove unnecessary header. 2010-03-29 23:11:26 -07:00
Vinson Lee
f2c55566ee swrastg: Silence unused value warning. 2010-03-29 22:54:35 -07:00
Vinson Lee
ba43b74967 r300g: Remove unused variable. 2010-03-29 22:19:28 -07:00
Vinson Lee
9dc51ad4f7 r300g: Remove unnecessary header. 2010-03-29 22:11:37 -07:00
Corbin Simpson
587c5ef01f r300g: Bind constantbuf to Draw immediately, don't wait for render.
Doesn't hurt, and reduces code duplication.
2010-03-29 21:33:19 -07:00
Chia-I Wu
c1a392ac4c st/glx: Remove a wrong assertion in choose_pixel_format.
There are X visuals that Gallium or the code does not support.  We could
not assert the color format to be supported.  Return PIPE_FORMAT_NONE in
such cases and let the caller handle it.
2010-03-30 11:20:53 +08:00
Ian Romanick
2d816204c8 Arrays are not allowed as vertex shader inputs in GLSL 1.30 either 2010-03-29 17:42:43 -07:00
Ian Romanick
8901eeefc9 Add several tests for vertex shader attributes 2010-03-29 17:19:13 -07:00
Ian Romanick
fb9f5b0675 Add some checking for vertex shader inputs / attributes
This causes the following tests to pass:

     glslparsertest/shaders/attribute.vert
     glslparsertest/shaders/attribute1.vert
     glslparsertest/shaders/attribute2.vert
2010-03-29 17:16:35 -07:00
Brian Paul
8c6f71e01e gallivm: use constant size array, added assertion check 2010-03-29 18:13:31 -06:00
Roland Scheidegger
56b34e54f2 gallium/util: use other layout instead of the old compressed 2010-03-30 02:01:11 +02:00
Roland Scheidegger
733df0059f Merge branch 'master' into gallium-new-formats
Conflicts:
	src/gallium/auxiliary/util/u_format.csv
2010-03-30 01:52:13 +02:00
Ian Romanick
06e5308e29 Add parser support for texture rectangle types 2010-03-29 16:44:29 -07:00
Roland Scheidegger
6fb364a171 gallium: adapt all code to the renamed depth/stencil formats 2010-03-30 01:35:49 +02:00
Roland Scheidegger
4e9690f00c gallium: make the python scripts for format parsing not fail on new formats
they won't generate any useful conversion code for some of the new formats
but at least don't assert. Also needed some more hacks so they don't generate
code for some of the new formats, as gcc was not impressed.
Also declare unused channels as void, and change the scripts to not fail if
the first channel happened to be unused.
Needs serious fixing.
2010-03-30 01:33:28 +02:00
Ian Romanick
bfb09c2a94 Use call-by-reference for apply_implicit_conversion
I'm not sure if this is a win or not.  It makes the code in
apply_implicit_conversion more clear, but it obscures the fact that it
may change the pointers.
2010-03-29 16:32:55 -07:00
Ian Romanick
db9be2e7aa Apply implicit conversions to ?: operator 2010-03-29 16:29:26 -07:00
Ian Romanick
212b0327b4 Apply implicit conversions to equality operators 2010-03-29 16:29:26 -07:00
Ian Romanick
0150f5f20e Apply implicit conversions to relational operators 2010-03-29 16:29:26 -07:00
Ian Romanick
0104536568 Apply implicit conversions to arithmetic operators 2010-03-29 16:29:21 -07:00
Ian Romanick
70348543ac Add glsl_type::is_array and glsl_type::is_float queries 2010-03-29 16:17:15 -07:00
Chris Li
5fa0984661 Add test case for lp_bld_printf() 2010-03-29 16:09:27 -07:00
Chris Li
3b1a8d9d5b gallivm: added lp_bld_printf() function 2010-03-29 16:09:27 -07:00
Ian Romanick
8a24cd5cea Allow single-component constructors
This causes the following tests to pass:

    glslparsertest/shaders/CorrectVersion.V110.frag
    shaders/glsl-vs-sqrt-zero.frag
    shaders/glsl-vs-sqrt-zero.vert

This causes the following tests to fail.  These shaders were
previously failing to compile, but they were all failing for the wrong
reasons.

    glslparsertest/shaders/attribute1.vert
    glslparsertest/shaders/attribute2.vert
    glslparsertest/shaders/main2.vert
2010-03-29 16:07:34 -07:00
Ian Romanick
32a494586f Add tests for :? operator 2010-03-29 15:34:21 -07:00
Ian Romanick
96f9cea116 Implement HIR conversion for ?: operator 2010-03-29 15:33:54 -07:00
Ian Romanick
5185a5f7d5 Add generate_temporary to generate an anonymous temporary 2010-03-29 15:20:42 -07:00
Ian Romanick
6e659caaa9 Implement HIR conversion for ast_nequal and ast_equal
The following tests now pass:

    shaders/glsl-unused-varying.frag
    shaders/glsl-fs-sqrt-branch.frag
2010-03-29 15:18:31 -07:00
Ian Romanick
251eb75318 Add missing break-statements in ast_expression::hir
The ast_conditional case was flowing right into ast_pre_inc.
2010-03-29 15:17:16 -07:00
Ian Romanick
3c6fea3048 Implement ir_if (for if-statments) and conversion from AST
The following tests now pass:

    glslparsertest/shaders/if1.frag
    glslparsertest/shaders/if2.frag

The following tests that used to pass now fail.  It appears that most
of these fail because ast_nequal and ast_equal are not converted to HIR.

    shaders/glsl-unused-varying.frag
    shaders/glsl-fs-sqrt-branch.frag
2010-03-29 15:17:11 -07:00
Vinson Lee
90075f34e2 progs/glsl: Add workarounds for Apple GLSL compiler crash.
fsraytrace and vsraytrace were crashing on Mac OS X 10.6.3 in the Apple
GLSL compiler function TPPStreamCompiler::assignOperands. Removing some
const qualifers made the crashes go away.
2010-03-29 14:56:12 -07:00
Ian Romanick
721efc04da Add several simple if-statement tests 2010-03-29 14:11:10 -07:00
Vinson Lee
52f7289215 progs/glsl: Remove inline keyword.
Fixes MSVC build.
2010-03-29 13:58:39 -07:00
José Fonseca
bbe6788807 progs/gallium/python: Get tri.py sample working again. 2010-03-29 21:22:23 +01:00
José Fonseca
d0e7aa25a9 st/python: Update for util_draw_vertex_buffer changes. 2010-03-29 21:22:23 +01:00
José Fonseca
69492c3aca st/python: Move surface read/write methods to context. 2010-03-29 21:22:23 +01:00
Zack Rusin
012fabca72 gallivm: make sure that the alloca's are the very first thing in the function
otherwise mem2reg can't put them in registers
2010-03-29 16:18:16 -04:00
Ian Romanick
17d86f4371 Add a variable to the symbol table after processing the initializer 2010-03-29 12:59:02 -07:00
Ian Romanick
521c2983b4 Trivial code cleanup in ir_dereference::is_lvalue 2010-03-29 12:52:00 -07:00
Eric Anholt
d1e31952ed Add support for builtin radians() and degrees(). 2010-03-29 12:48:45 -07:00
Eric Anholt
78fe3c9150 Add definitions for 1.10 built-in uniforms for ff state. 2010-03-29 12:48:45 -07:00
Eric Anholt
a9fafc6504 Don't let swizzles with duplicated components be considered as lvalues.
Fixes swizzle2.frag.
2010-03-29 12:48:45 -07:00
Eric Anholt
ab372dab2a Reject main() declarations with a non-void return value.
Fixes main3.vert.
2010-03-29 12:48:45 -07:00
Eric Anholt
2e063f1adf Reject variables marked with attribute in the fragment shader.
Fixes attribute.frag.
2010-03-29 12:48:45 -07:00
Eric Anholt
3cb4358f38 Add the instruction for the parameter variable declarations of builtin funcs.
Matches constructor setup, but I'm not really sure why we make the
variable twice.
2010-03-29 12:48:45 -07:00
Eric Anholt
76a91e1afb Implement dot() builtin. 2010-03-29 12:48:45 -07:00
Eric Anholt
01665262e5 Implement exp2() and log2(), and make ir_unop_exp and ir_unop_log be base e.
Making the base e functions IR operations is not a clear win.  i965
doesn't support it, it doesn't look like r600 supports it, but r500
does. It should be easily supportable as a lowering pass, though.
2010-03-29 12:48:45 -07:00
Eric Anholt
53afc3609d Implement builtin length() function. 2010-03-29 12:48:45 -07:00
Eric Anholt
44d68fd06f Add sqrt() builtin as an IR operation.
Following a discussion in #dri-devel, I think this makes more sense
than implementing it as RSQ RCP CMP as Mesa did.  The i965 has a
hardware sqrt that should work, and AMD is suppposed to be able to
implement it as RSQ RCP with an alternate floating point mode so that
the 0.0 case is handled like we want.
2010-03-29 12:48:45 -07:00
Eric Anholt
ddd2e83db2 Add builtin pow() function. 2010-03-29 12:48:45 -07:00
Eric Anholt
0f09aea3bf Add support for builtin deprecated fs varyings.
Fixes glsl-color.frag.
2010-03-29 12:48:45 -07:00
Eric Anholt
bfe380a721 Implement some binary gentype builtin functions. 2010-03-29 12:48:45 -07:00
Eric Anholt
2eec73f735 Implement additional unary gentype builtins. 2010-03-29 12:48:45 -07:00
Eric Anholt
c22c40015d Implement the first builtin function: exp(). 2010-03-29 12:48:45 -07:00
George Sapountzis
625e024b18 st/dri/sw: add drisw_api similarly to dri1_api
I am pretty sure that this is in gallium spirit, so commit. Thanks to Chia-I
for suggesting this.
2010-03-29 21:06:54 +03:00
George Sapountzis
6cc5fbd76b ws/sw/dri: s/xm/dri_sw/ 2010-03-29 21:06:53 +03:00
Roland Scheidegger
9de2ee646a gallium: fix bogus depth/stencil format names (and channel descriptions)
only the depth part is normalized, stencil part isn't.
2010-03-29 20:00:41 +02:00
Roland Scheidegger
d9eae63792 gallium: add new texture formats
These are needed for DX10 and/or OGL3.3.

This just adds the formats nothing handles them yet.
PIPE_FORMAT_R1_UNORM can't be used currently as it requires special filter.
Need to reclassify compressed formats at some point.
2010-03-29 19:52:29 +02:00
Brian Paul
909f0b356e progs/glsl: improve the mouse drag/rotate code a little 2010-03-29 11:47:38 -06:00
RALOVICH, Kristóf
8ca937fc3b progs/glsl: let the mouse rotate the scene 2010-03-29 11:47:38 -06:00
Brian Paul
1cbd510688 glsl: avoid using rcp in length() functions
See prev commit for related info.
2010-03-29 11:47:38 -06:00
Brian Paul
ab0b9f80f4 glsl: remove rcp from sqrt()
Per a patch from Marek Olšák, we can simply multiply the incoming
value by 1/sqrt(x) instead of using rcp.

We're keeping the x==0 check to avoid generating NaN for sqrt(0).
2010-03-29 11:47:38 -06:00
Zack Rusin
f44af927ff draw llvmpipe: lots of fixes for fetch/emit
the values passed are still not right, but the general scheme
is looking good.
2010-03-29 13:19:16 -04:00
Roland Scheidegger
e96147e744 gallium/docs: minor fixes 2010-03-29 19:12:14 +02:00
José Fonseca
588dd187c4 Revert "python: Temporarily disable python state tracker until transfers are done by contexts"
This reverts commit 50a7786619.
2010-03-29 17:52:10 +01:00
José Fonseca
f3cb08f3dd i965g: util_format_is_compressed() -> util_format_is_s3tc(). 2010-03-29 17:31:34 +01:00
José Fonseca
cfbbe244d7 mesa/st: util_format_is_compressed() -> util_format_is_s3tc(). 2010-03-29 17:31:34 +01:00
José Fonseca
bade76191a svga: util_format_is_compressed() -> util_format_is_s3tc(). 2010-03-29 17:31:34 +01:00
José Fonseca
28cf5e1191 r300: UTIL_FORMAT_LAYOUT_COMPRESSED -> UTIL_FORMAT_LAYOUT_S3TC. 2010-03-29 17:31:34 +01:00
José Fonseca
b9ad95d3ee util: Distinguish between the different compression formats.
In particular, all current uses of util_format_is_compressed() actually
mean s3tc.
2010-03-29 17:31:34 +01:00
Michal Krol
37877b192e softpipe: Map GS constants, too. 2010-03-29 16:06:10 +02:00
Marek Olšák
1c2912ee7a r300g: print configurable debugging info on non-debug builds 2010-03-29 03:33:28 +02:00
Ian Romanick
43de172820 Generate more correctly diagnostics from some invalid initializers 2010-03-28 17:03:16 -07:00
Vinson Lee
5f1699e9d5 swrast: Remove unnecessary header. 2010-03-28 15:57:23 -07:00
Vinson Lee
21a96a55d6 progs: Comment out gallium/raw/SConscript from progs/SConscript.
Commit db5c2235d1 broke the default SCons
build.
NameError: name 'graw' is not defined:

This patch allows the default SCons build to work again until a proper
fix is available.
2010-03-28 13:52:11 -07:00
Keith Whitwell
1cf669db59 progs/raw: add note about accessing utility functions 2010-03-28 10:42:38 -07:00
Keith Whitwell
d0d73a38da ws/xlib: Call XFlush after PutImage
Want to see the results.
2010-03-28 10:42:38 -07:00
Keith Whitwell
db5c2235d1 gallium: new raw gallium interface to support standalone tests
Provides basic window system integration behind a simple interface,
allowing tests to be written without dependency on either the driver
or window system.

With a lot of work, could turn into something like glut for gallium.
2010-03-28 10:42:38 -07:00
Keith Whitwell
f97f46f269 aux/tgsi: fix some minor glitches in string routines
Not sure why we are open-coding these rather than using standard
library functions.
2010-03-28 10:42:38 -07:00
Keith Whitwell
42ab3f6fd2 st/python: updates for recent interface changes
Still problems at runtime with vertex elements, etc.

Building still disabled.
2010-03-28 10:42:38 -07:00
George Sapountzis
a24fc90703 drisw: probably better hack for stride and some comments 2010-03-28 19:30:54 +03:00
José Fonseca
c42fe8cd27 util: Update MSDN links. 2010-03-28 17:16:34 +01:00
Luca Barbieri
add226ea44 gallium/docs: fix formatting mistakes in d3d11ddi.txt 2010-03-28 16:41:54 +02:00
Ian Romanick
66faec4895 Initial bits to process initializers in variable declarations
As a result, the following tests pass:

    glslparsertest/array3.frag
    glslparsertest/CGStandardLibrary.frag
    glslparsertest/ConstantConversions.frag
    glslparsertest/constructor1.frag
    glslparsertest/constructor2.frag
    glslparsertest/constructor3.V110.frag
    glslparsertest/dataType4.frag
    glslparsertest/dataType5.frag
    glslparsertest/dataType13.frag
    glslparsertest/dataType19.frag
    glslparsertest/matrix.V110.frag
    glslparsertest/parser7.frag
    glslparsertest/swizzle3.frag

The following tests also pass, but it is just by dumb luck.  In these
cases the shader fails to compile, but it fails for the wrong reason:

    glslparsertest/array6.frag
    glslparsertest/comma2.frag
    glslparsertest/conditional1.frag
    glslparsertest/conditional2.frag
    glslparsertest/conditional3.frag
    glslparsertest/constFunc.frag
    glslparsertest/ParseTest3.frag
    glslparsertest/ParseTest4.frag
    glslparsertest/varying3.frag
    glslparsertest/parser8.frag (also segfaults)
    glslparsertest/parser9.frag (also segfaults)

The following tests now fail.  As far as I can tell, these are all
cases where the shader was failing to compile, but it was failing for
the wrong reason.

    glslparsertest/CorrectMatComma.frag
    glslparsertest/CorrectModule.frag
    glslparsertest/CorrectSwizzle2.vert
    glslparsertest/shaders/glsl-fs-bug25902.frag
2010-03-27 18:56:53 -07:00
Luca Barbieri
d142e8f9d3 gallium/docs: add comparison between Gallium and Direct3D 11 DDI interfaces
Feel free to check it and improve it if necessary.
2010-03-28 01:28:24 +01:00
Marek Olšák
4a16d325eb r300g: handle TGSI_OPCODE_RET as END 2010-03-28 00:07:45 +01:00
Marek Olšák
feb8d99593 r300g: disable cliprects
Thanks to Nicolai Hähnle for explaining this register!
2010-03-27 22:41:42 +01:00
George Sapountzis
a7109625aa drisw: update comment 2010-03-27 23:36:18 +02:00
Marek Olšák
4b8d348076 r300g: print errors even on non-debug builds
We really need to get these into bug reports.
2010-03-27 22:28:25 +01:00
Chia-I Wu
0a82fadcdd egl: Make _eglBindContextToSurfaces more readable.
There is no effective changes given how the function is called.  It is
still not trivial, but it should be more readable and resemble
_eglBindContextToThread a lot.
2010-03-28 03:37:28 +08:00
Chia-I Wu
551bfe7a09 egl: Always return the previously bound context.
When a newly bound context is the same as the previously bound one,
_eglBindContextToThread should still return the context instead of NULL.
This gives the driver a chance to flush the context.
2010-03-28 03:37:28 +08:00
George Sapountzis
3bfa23317c drisw: add comment to libGL about stride 2010-03-27 21:35:25 +02:00
George Sapountzis
f4e561ce12 drisw: make stride issue profound 2010-03-27 20:56:36 +02:00
Vinson Lee
02ee7c2950 identity: Add id_drm.c to SCons build.
This was missed in commit f7cbaae13d.
2010-03-27 10:08:54 -07:00
Chia-I Wu
077570c12b st/egl: Fix missing symbols.
ximage backend calls gallium_wrap_screen, which requires libidentity.a
and libtrace.a.  There are also some missing symbols in i965 due to the
use of sw wrapper.
2010-03-27 23:54:24 +08:00
Mathias Fröhlich
a43618fdc4 r300g: fix macrotiling for non-square textures
FDO bug #27338.

Signed-off-by: Marek Olšák <maraeo@gmail.com>
2010-03-27 14:06:41 +01:00
George Sapountzis
29ec84b0a8 glx: try swrastg_dri, if swrast_dri fails
This needs a patch for xserver/glx also. An enviroment variable will be added
at some point, it chould be for swrastg only or all gallium drivers.
2010-03-27 14:06:05 +02:00
Corbin Simpson
c8844c5549 r300g: Make SWTCL clear work again.
Kind of surprised that this was as little as it took. Worrying.
2010-03-27 01:13:48 -07:00
Vinson Lee
42f14a76a6 r300g: Remove unnecessary header. 2010-03-26 23:54:16 -07:00
Vinson Lee
9503006285 gallium: Fix Windows SCons build. 2010-03-26 18:58:44 -07:00
Ian Romanick
19360152f5 Reject uniform initializers in GLSL 1.10 mode
Now both glslparsertest/dataType3.frag and glslparsertest/dataType2.frag pass.
2010-03-26 18:05:27 -07:00
Vinson Lee
0383288132 st/dri: Fix SCons build.
This was missed in commit 4b722bf9fd.
dri_extensions.c was removed from Makefile but not from SConscript.
2010-03-26 17:56:13 -07:00
Eric Anholt
72fc47f0b0 Set variables with the sampler base type to read only.
Fixes increment3.frag.
2010-03-26 17:51:41 -07:00
Eric Anholt
8518e75d28 Set the var_type for arrays to error_type until it's implemented.
"Fixes" segfaults in array tests.
2010-03-26 17:51:41 -07:00
Eric Anholt
76ea56c007 Add support for ast_to_hir of pre inc/dec. 2010-03-26 17:51:41 -07:00
Eric Anholt
de38f0ed53 Add support for ast_to_hir of post inc/dec. 2010-03-26 17:51:41 -07:00
Eric Anholt
c4f86d3b80 Make read-only variables not be considered lvalues.
This should fix tests trying to assign to builtin "in" variables, and
will also be relied on for post_inc/dec handling.
2010-03-26 17:51:41 -07:00
Eric Anholt
3c36b2df7c Add constructors for immediate hir constants.
This will make ast_to_hir for inc/dec easier.
2010-03-26 17:51:41 -07:00
Eric Anholt
48a0e64b7d Add support for %= in ast_to_hir. 2010-03-26 17:51:41 -07:00
Eric Anholt
10a6852186 Factor out assignment setup in ast_to_hir. 2010-03-26 17:51:40 -07:00
Eric Anholt
e65e12fdbc IR print visitor: Print out something for the operator. 2010-03-26 17:51:40 -07:00
Ian Romanick
d1dfe8b994 IR print visitor: Print expressions a little better 2010-03-26 17:42:10 -07:00
Ian Romanick
0b7dcc80eb Initial implementation of constructor handling code
All of the scalar, vector, and matrix constructors *except* "from
bool" constructors should be handled.  Array and structure
constructors are also not yet handled.
2010-03-26 17:38:58 -07:00
Ian Romanick
5508129fd8 IR print visitor: print function calls 2010-03-26 17:30:30 -07:00
Ian Romanick
93614bc4b9 Add hack ir_call::callee_name to get the name of the called function 2010-03-26 17:29:29 -07:00
Ian Romanick
9f93d24050 Be sure to set ir_function_signature::definition for constructors 2010-03-26 17:28:52 -07:00
Ian Romanick
9878c6518f Add ir_call::iterator to iterate over actual parameters 2010-03-26 17:20:31 -07:00
Ian Romanick
605ff69b0d Add missing parenthesis in foreach_iter
This allows uses like 'foreach_iter(exec_list_iterator, iter, *list_ptr)'.
2010-03-26 17:17:41 -07:00
Ian Romanick
8343550b42 Add some simple constructor tests 2010-03-26 16:47:06 -07:00
Ian Romanick
6c86ea8adc Add unary operator to convert unsigned integer to float 2010-03-26 16:11:48 -07:00
Chris Li
8260e9a821 gallium/llvmpipe: add PROGS target/rule to Makefile.template
So other directory can share it.
Also remove the libllvmpipe.a dependency from test
programs. It is not needed any more.

Signed-Off-By: Christopher Li <chrisl@vmware.com>
2010-03-26 15:56:02 -07:00
Chris Li
d4b103e031 auto detect llvm version 2010-03-26 15:56:02 -07:00
Vinson Lee
e9a25089f9 rtasm: Silence gnu_printf format warnings. 2010-03-26 14:59:06 -07:00
Ian Romanick
738c183cc9 Slightly change the representation of numeric types
For numeric types, vector_elements and matrix_columns must be at least
1.  Previously matrix_columns was 0 for vectors, and both were 0 for
scalars.  This change simplifies things in some places.
2010-03-26 14:43:16 -07:00
Ian Romanick
d811d47609 Add glsl_type::components to query total number of components in a type 2010-03-26 14:43:11 -07:00
Ian Romanick
cef3baecf6 Replace remaining use of is_error_type with glsl_type::is_error 2010-03-26 14:41:32 -07:00
Ian Romanick
a6d653dcbb Replace remaining uses of is_numeric_base_type with glsl_type::is_numeric 2010-03-26 14:40:37 -07:00
Ian Romanick
40176e249f Replace is_integer_base_type macro with glsl_type::is_integer method 2010-03-26 14:38:37 -07:00
Ian Romanick
0471e8b089 Make glsl_*_type glsl_type class static data 2010-03-26 14:33:41 -07:00
Ian Romanick
a43817a483 Use glsl_type::is_error instead of comparison with glsl_error_type pointer 2010-03-26 14:27:23 -07:00
Kenneth Graunke
affc1413ac Move swizzles out of ir_dereference and into their own class.
Also turn generate_swizzle into a static "create" method of the new
class; we'll want to use it for the IR reader as well.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2010-03-26 14:00:59 -07:00
Kenneth Graunke
fb9fb5f51d Add new abstract ir_rvalue class; rework accordingly.
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2010-03-26 13:58:48 -07:00
Kenneth Graunke
44e1dfa2df Replace "mode" type tag with virtual as_foo() downcasting functions.
These should work well even in a non-flat IR hierarchy.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2010-03-26 12:50:40 -07:00
Michel Dänzer
feb619b770 Merge branch '7.8'
Conflicts:
	src/mesa/drivers/dri/intel/intel_mipmap_tree.c - left what was in master
2010-03-26 18:42:16 +01:00
George Sapountzis
3ae082f00c swrastg: allow for any of the software rasterizers.
This function should be put in targets/common or winsys/sw/common and shared
with targers/libgl-xlib and winsys/sw/drm.

For targets/common, you get layering violations in the build system unless
all of drm_api's are moved under targets.
2010-03-26 18:44:40 +02:00
George Sapountzis
d9b6552d85 dri/common: add comment about DRISW wrt DRI1 / DRI2 2010-03-26 18:44:40 +02:00
George Sapountzis
fc35d203c7 st/dri: add comment about the ifdef in dri_screen.c 2010-03-26 18:44:39 +02:00
George Sapountzis
5b07257fdb st/dri: factor out common init_screen code 2010-03-26 18:44:39 +02:00
George Sapountzis
1fbfc22d85 st/dri mv __driDriverExtensions to drisw.c and dri2.c 2010-03-26 18:44:39 +02:00
George Sapountzis
4b722bf9fd st/dri: fold dri_extensions.c into dri_context.c 2010-03-26 18:44:39 +02:00
Brian Paul
22cd6f2cb4 mesa: only call _mesa_update_state() when necessary in glGet functions
Only a few state vars require state validation before querying them.
This potentially speeds up state queries.
Encode that info into the state tuple table.

Also, use the new tuple field to indicate when FLUSH_CURRENT() must
be called to validate other state vars.

Based on a patch submitted by Robert Bragg on Feb 12, 2010.
2010-03-26 10:14:00 -06:00
Jakob Bornecrantz
e57405e8d5 swrastg: Use llvmpipe if built but only on scons 2010-03-26 14:56:26 +01:00
Jakob Bornecrantz
7f91f2efb5 swrastg: Build with scons 2010-03-26 14:48:36 +01:00
Jakob Bornecrantz
711529153c gallium: Fix DRI driver build warnings under scons
When building more then one dri driver we would get warnings because
we where defining the same build target multiple times.

Also move all the dri scons targets related code into its own file.
2010-03-26 14:48:35 +01:00
Jakob Bornecrantz
fb70f456fc svga/drm: Fix build under scons 2010-03-26 14:48:35 +01:00
Xavier Chantry
ff0987a15d svga: Fix typo in configure script
Introduced in a82e37b9e9
2010-03-26 13:28:29 +01:00
Corbin Simpson
b6df7aed60 r300/compiler: Lower CMP for vertex programs.
I think my maths is right?
2010-03-26 05:24:44 -07:00
Corbin Simpson
38c7a01b6c Revert "r300g: add generating texture coordinates for point sprites (WIP)"
This reverts commit cba6430524.

Breaks celestia with a hardlock. :T

We really need to sit down and study texture stuffing further.
2010-03-26 04:15:53 -07:00
Christoph Bumiller
1f19aba1ea nv50: fix FACE semantic check in FP input slot assignments
Fixes for instance noise with material shaders in FlightGear.
2010-03-26 11:13:01 +01:00
Vinson Lee
b1e3e03d67 rtasm: Fix typos in comments. 2010-03-25 22:51:08 -07:00
Vinson Lee
8edf085c77 identity: Remove unnecessary header. 2010-03-25 22:40:03 -07:00
Ian Romanick
b7592c362b Merge branch 'anholt' 2010-03-25 18:41:41 -07:00
Ian Romanick
7954922473 IR print visitor: Finish printing constants 2010-03-25 18:40:48 -07:00
Ian Romanick
d14642739e IR print visitor: Remove most of the newlines from the printed output
This makes it a lot easier to read... if you have a really wide display.
2010-03-25 18:40:48 -07:00
Ian Romanick
d7388f389d IR print visitor: print expressions
Not quite complete.  The operator is not yet printed.
2010-03-25 18:40:48 -07:00
Ian Romanick
8c70a62193 IR print visitor: print ir_dereference instructions
Also make a slight change to ir_variable.  The ir_dereference tracks
the number of nested dereferences.  If an ir_variable is visited and
the count is non-zero, just print the name of the variable.
2010-03-25 18:40:36 -07:00
Ian Romanick
6e7c278e24 IR print visitor: Less newlines when printing ir_variables 2010-03-25 18:39:59 -07:00
Jakob Bornecrantz
87ac117d67 progs/gallium: Add trivial gallium demos 2010-03-26 01:36:45 +01:00
Jakob Bornecrantz
fe306e7ea5 draw: Add EMIT_4UB_BGRA format
Needed for i915g, also fixed swizzle in draw_vs_aos_io.
2010-03-26 01:21:52 +01:00
Jakob Bornecrantz
84a8347b9f draw: Use translate function instead of switch cases 2010-03-26 01:21:52 +01:00
Eric Anholt
ece0a51160 Fix assignment operators: *=, /=, +=, -=.
Basically, replace everything different from operator_assign other
than the creation of the rhs value from the lvalue and rvalue with the
contents of operator_assign.  Fixes a segfault in
CorrectSwizzle1.frag, and fixes parser10.frag.
2010-03-25 17:10:44 -07:00
Ian Romanick
a4e92c4b26 Before generating HIR for user code, generate constructors for built-in types 2010-03-25 17:02:22 -07:00
Ian Romanick
9546997736 Add dereference constructor for array element dereferences
This should have gone in before the previous commit.
2010-03-25 17:01:15 -07:00
Ian Romanick
720c88eab9 Add functions to generate constructors for built-in types.
Currently only vector and matrix types are supported.  Structure types will be
added later.
2010-03-25 16:58:45 -07:00
Eric Anholt
2f9ca7dce2 Fix up the operator printing for the logic or and beyond, check array bounds. 2010-03-25 16:47:49 -07:00
Jakob Bornecrantz
bc88c95990 i915g: Rename winsys prefix to i915_ from intel_
Since the winsys isn't shared with i965 and never will be
2010-03-26 00:38:17 +01:00
Jakob Bornecrantz
80672e84cf st/dri: Move common files to common directory
27 files changed, 15 insertions(+), 15 deletions(-)
 rename src/gallium/state_trackers/dri/{ => common}/dri1_helper.c (100%)
 rename src/gallium/state_trackers/dri/{ => common}/dri1_helper.h (100%)
 rename src/gallium/state_trackers/dri/{ => common}/dri_context.c (100%)
 rename src/gallium/state_trackers/dri/{ => common}/dri_context.h (100%)
 rename src/gallium/state_trackers/dri/{ => common}/dri_drawable.c (100%)
 rename src/gallium/state_trackers/dri/{ => common}/dri_drawable.h (100%)
 rename src/gallium/state_trackers/dri/{ => common}/dri_extensions.c (100%)
 rename src/gallium/state_trackers/dri/{ => common}/dri_screen.c (100%)
 rename src/gallium/state_trackers/dri/{ => common}/dri_screen.h (100%)
 rename src/gallium/state_trackers/dri/{ => common}/dri_st_api.c (100%)
 rename src/gallium/state_trackers/dri/{ => common}/dri_st_api.h (100%)
 rename src/gallium/state_trackers/dri/{ => common}/dri_wrapper.h (100%)
2010-03-26 00:37:54 +01:00
Jakob Bornecrantz
5b1fc14627 st/dri: Reshuffle files and make it obvious which files are shared
In short:
git mv ../drisw/Makefile dri/sw
git mv drisw.[c|h] sw
git mv dri2.[c|h] dri1.[c|h] Makefile drm
git rm ../drisw
ln -s <common files> drm/*
ln -s <common files> sw/*
2010-03-26 00:37:52 +01:00
Ian Romanick
acb36240e5 Merge branch 'anholt' 2010-03-25 16:02:41 -07:00
Brian Paul
a6fecdff3e Merge branch '7.8' 2010-03-25 16:12:01 -06:00
Brian Paul
8814bb652a Revert "llvmpipe: optimize the lp_setup_fence() function"
This reverts commit a9063cad0f.

Not too surprisingly, this change caused some regressions.
Revert it for the time being.
See fd.o bug 27320.
2010-03-25 16:10:25 -06:00
Brian Paul
67e377bda6 llvmpipe: disable an assertion
We shouldn't try to clear a non-existant z/stencil buffer, so there's
probably a bug elsewhere.  Disable the assertion for now to allow things
to at least run.
2010-03-25 16:10:25 -06:00
Jakob Bornecrantz
a82e37b9e9 gallium: Add propper sanity checks in configure.ac 2010-03-25 22:54:56 +01:00
Eric Anholt
b3f743ab0b Set up fragment shader builtin variables. 2010-03-25 14:48:25 -07:00
Eric Anholt
7c15bb2465 Make the standalone parser return an exit code so we can automate testing. 2010-03-25 14:37:25 -07:00
Ian Romanick
68507eceea More matrix compilation tests 2010-03-25 13:41:32 -07:00
Ian Romanick
3d303eb59f Merge branch 'kwg' 2010-03-25 13:22:19 -07:00
Ian Romanick
1b4f04124a Fix matrix dimensioning
Newb GL mistake: matrices in GL are column-major.  This means that
vector_elements is the number of rows.  Making these changes causes
matrix-08.glsl to pass.
2010-03-25 13:19:13 -07:00
Ian Romanick
c1bd3a1a61 Use glsl_type::row_type and glsl_type::column type in arithmetic_result_type
This substantially clarifies the code for matching matrix types.  It
also eliminates some uses of glsl_type member data.
2010-03-25 13:06:58 -07:00
Ian Romanick
80b5ed6e63 Replace several glsl_type field comparisons with a single pointer comparison
This simplifies the process of matching function parameter types.
More simplifications are probably possible here, but arrays and
structures need to be implemented first.
2010-03-25 13:05:43 -07:00
Ian Romanick
252127c379 Add queries to get the glsl_type of a row or column of a matrix 2010-03-25 11:42:45 -07:00
Kenneth Graunke
f25a5ad939 Widen num_components to handle vec4 correctly. 2010-03-25 11:22:42 -07:00
Jakob Bornecrantz
9eaadfeaa5 st/dri: Don't include sw vs drm dri headers 2010-03-25 18:28:31 +01:00
Kenneth Graunke
904872372e Typo fixes: de/re/ference. 2010-03-25 10:18:40 -07:00
Jakob Bornecrantz
8f47f5320f st/dri: Add dri2 prefix for all dri2.c functions 2010-03-25 17:55:59 +01:00
George Sapountzis
7b333298fc configure:ac add swrastg_dri 2010-03-25 17:01:54 +02:00
George Sapountzis
1570e30b48 st/dri: add TODO list for DRISW 2010-03-25 17:01:54 +02:00
George Sapountzis
bb289a8a70 swrastg_dri: hack for loader hardcoded stride 2010-03-25 17:01:54 +02:00
George Sapountzis
007e0e3ef9 swrastg_dri: add winsys and target 2010-03-25 17:01:54 +02:00
George Sapountzis
992e9572bd swrastg_dri: add state_tracker 2010-03-25 17:01:53 +02:00
George Sapountzis
5b75e12f91 st/dri: add drisw 2010-03-25 17:01:53 +02:00
George Sapountzis
1bed0eb98e st/dri: add dri_wrapper.h 2010-03-25 17:01:53 +02:00
George Sapountzis
4ce16e13ce st/dri: export DRI1 surface / pipe
They will be used by DRISW. Also, add destroy functions.
2010-03-25 17:01:53 +02:00
George Sapountzis
6a7bd8eb95 st/dri: split out DRI2 code 2010-03-25 17:01:53 +02:00
George Sapountzis
96c152b4b0 st/dri: make get_texture into validate_att
This is a wrapper around dri_st_framebuffer_validate for a single attachment.
Also, call validate through hook to make it more generic.
2010-03-25 17:01:52 +02:00
George Sapountzis
a21c30308d st/dri: flush_frontbuffer, allocate_textures for dri2
dri_st_framebuffer functions just forward to dri1/dri2 functions.
2010-03-25 17:01:52 +02:00
George Sapountzis
24056e7663 st/dri: flush_frontbuffer, allocate_textures for dri1
* ptex is get by flush_frontbuffer, similar to swap_buffers
* comment for allocate_textures
* texture_mask is managed at the st_fb level
2010-03-25 17:01:52 +02:00
George Sapountzis
03c4573eca st/dri: minor cosmetic for buffers 2010-03-25 17:01:52 +02:00
George Sapountzis
c049d58a22 st/dri: minor cosmetic for screen
- put extensions above init_screen
- split out destroy_option_cache
2010-03-25 17:01:52 +02:00
George Sapountzis
d7f78065ac st/dri: add inline for dri2 check done in multiple places 2010-03-25 17:01:51 +02:00
George Sapountzis
20755c5c4c drisw_util: add fields for gallium swrast_dri 2010-03-25 17:01:51 +02:00
Joakim Sindholt
204c88014b r300g/radeong: fix scons build 2010-03-25 15:51:23 +01:00
Jakob Bornecrantz
7d17de4b47 Merge branch 'gallium-targets' 2010-03-25 14:48:41 +01:00
Jakob Bornecrantz
0d0220fedc gallium: Fix libgl-xlib path to sw xlib winsys 2010-03-25 14:43:37 +01:00
Vinson Lee
8b12c58ce4 r300g: Remove unnecessary header. 2010-03-25 00:20:05 -07:00
Vinson Lee
3fcfd69fec progs/glsl: Fix vsraytrace GLSL compilation error.
Fixes the following GLSL error on Mac OS X.
'=' :  assigning non-constant to 'const 3-component vector of float'
2010-03-24 22:53:23 -07:00
Vinson Lee
3bccb5447b progs/glsl: Add raytracing demos to SCons build. 2010-03-24 22:36:49 -07:00
Brian Paul
9a52417582 llvmpipe: fix up some questionable fence code
Jose should probably review this since he wrote the original code.
2010-03-24 20:49:54 -06:00
Brian Paul
a9063cad0f llvmpipe: optimize the lp_setup_fence() function
Avoid emitting fences when not needed.
Speeds up glReadPixels quite a bit when reading image row by row.
2010-03-24 20:49:39 -06:00
Brian Paul
d7ddb589f4 llvmpipe: call lp_fence_signal() 2010-03-24 19:30:32 -06:00
Brian Paul
331729c8c8 llvmpipe: added lp_fence_signal() 2010-03-24 19:30:27 -06:00
Ian Romanick
664da2510a Replace several field comparisons with a single pointer comparison
The only way the specified type fields can match is if the types are the
same.  Previous tests (and assertions) have filtered away all other possible
cases.
2010-03-24 17:53:53 -07:00
Ian Romanick
532edd9bc4 Remove unused _mesa_glsl_get_vector_type
This function has been completely replaced by glsl_type::get_instance.
2010-03-24 17:47:20 -07:00
Ian Romanick
c4e2627045 Use glsl_type::get_instance instead of _mesa_glsl_get_vector_type 2010-03-24 17:46:39 -07:00
Ian Romanick
d2b6bc651a Use glsl_type::get_instance instead of symbol table look-up 2010-03-24 17:45:14 -07:00
Ian Romanick
e4fca97afd Add some matrix math tests 2010-03-24 17:42:59 -07:00
Ian Romanick
3209c4e369 Add glsl_type::get_instance method
Gets the singleton corresponding to a particular scalar, vector, or
matrix type.
2010-03-24 17:11:30 -07:00
Ian Romanick
60b54d977a Replace accesses to glsl_type data with query functions
In these particular cases, using the query functions makes it more obvious
what is happening.
2010-03-24 17:08:13 -07:00
Ian Romanick
9ff8f3777e Add class-private handles to matrix types in glsl_type 2010-03-24 17:05:09 -07:00
Jakob Bornecrantz
b4b4ac6681 i915g: Correct and add supperted texture formats 2010-03-25 00:45:31 +01:00
Jakob Bornecrantz
372011bc89 st/dri: Fix for X server 1.6.0 (DRI2 version 1) 2010-03-25 00:45:28 +01:00
Brian Paul
2ad8692aad llvmpipe: fix texture reference counting bug
We weren't saving the per-scene texture references at the right point.

Fixes piglit cubemap segfault.  The segfault resulted from referencing
texture memory which was prematurely freed because of a missed reference
count.

Fixes fd.o bug 27276.
2010-03-24 16:29:17 -06:00
Brian Paul
f0e04b0944 progs/demos: add other modes/patterns to dissolve demo 2010-03-24 16:29:17 -06:00
Ian Romanick
4d184a1d02 Fix typo in swizzle processing loop
One of the accesses to str in the loop used str[0] instead of str[i].

Reported-by: Kenneth Graunke
2010-03-24 15:27:50 -07:00
Ian Romanick
9e97ffb754 Trivial cleanups in generate_swizzle
Add 'const' and 'static const' in a couple of places.
2010-03-24 15:27:04 -07:00
Ian Romanick
afbe26fd61 Use ir_dereference::set_swizzle 2010-03-24 15:25:23 -07:00
Ian Romanick
2f4240fb02 Add method to set the swizzle of an ir_dereference 2010-03-24 15:12:21 -07:00
Ian Romanick
44bb1a62f9 Allow duplicate symbols at the same scope that are in different name spaces 2010-03-24 14:56:36 -07:00
Alex Deucher
d9a19d8649 r100/r200/r300/r600: enable accel for Copy/DrawPixels without kms
meta ops should work ok without kms.
2010-03-24 15:42:13 -04:00
Ian Romanick
d00b7958c0 Merge branch 'anholt' 2010-03-24 12:10:39 -07:00
Ian Romanick
7d9bce3551 Add (negative) test for constructing samplers 2010-03-24 12:08:46 -07:00
Jakob Bornecrantz
f5ae5b5396 gallium: Add warnings incase pipe drivers are not built in targets 2010-03-24 19:16:29 +01:00
Jakob Bornecrantz
738850e522 gallium: Make scons build dri/xorg drivers again 2010-03-24 18:42:35 +01:00
Eric Anholt
3695cdd606 i965: Handle the negate and abs swizzles on brw_wm_glsl.c immediate args.
Fixes piglit glsl-orangebook-ch06-bump, regressed with
4fc5732225
2010-03-24 10:27:30 -07:00
Jakob Bornecrantz
42a1bcc22f radeong: Fix scons build 2010-03-24 18:09:19 +01:00
Jakob Bornecrantz
c9f98673c5 gallium: Reorg winsys directories
Attached output from commit.
 delete mode 100644 src/gallium/winsys/drm/SConscript
 delete mode 100644 src/gallium/winsys/drm/i965/SConscript
 delete mode 100644 src/gallium/winsys/drm/intel/Makefile
 delete mode 100644 src/gallium/winsys/drm/intel/SConscript
 delete mode 100644 src/gallium/winsys/drm/nouveau/Makefile
 delete mode 100644 src/gallium/winsys/drm/radeon/Makefile
 delete mode 100644 src/gallium/winsys/drm/radeon/SConscript
 delete mode 100644 src/gallium/winsys/drm/vmware/Makefile
 delete mode 100644 src/gallium/winsys/drm/vmware/SConscript
 rename src/gallium/winsys/{drm/intel/gem => i915/drm}/Makefile (82%)
 rename src/gallium/winsys/{drm/intel/gem => i915/drm}/SConscript (100%)
 rename src/gallium/winsys/{drm/intel/gem => i915/drm}/intel_drm_api.c (100%)
 rename src/gallium/winsys/{drm/intel/gem => i915/drm}/intel_drm_batchbuffer.c (100%)
 rename src/gallium/winsys/{drm/intel/gem => i915/drm}/intel_drm_buffer.c (100%)
 rename src/gallium/winsys/{drm/intel/gem => i915/drm}/intel_drm_fence.c (100%)
 rename src/gallium/winsys/{drm/intel/gem => i915/drm}/intel_drm_winsys.h (100%)
 rename src/gallium/winsys/{drm/i965/gem => i965/drm}/Makefile (78%)
 rename src/gallium/winsys/{drm/i965/gem => i965/drm}/SConscript (100%)
 rename src/gallium/winsys/{drm/i965/gem => i965/drm}/i965_drm_api.c (98%)
 rename src/gallium/winsys/{drm/i965/gem => i965/drm}/i965_drm_buffer.c (100%)
 rename src/gallium/winsys/{drm/i965/gem => i965/drm}/i965_drm_winsys.h (100%)
 rename src/gallium/winsys/{drm => }/i965/xlib/Makefile (97%)
 rename src/gallium/winsys/{drm => }/i965/xlib/xlib_i965.c (100%)
 rename src/gallium/winsys/{drm => }/nouveau/drm/Makefile (79%)
 rename src/gallium/winsys/{drm => }/nouveau/drm/nouveau_dri.h (100%)
 rename src/gallium/winsys/{drm => }/nouveau/drm/nouveau_drm_api.c (100%)
 rename src/gallium/winsys/{drm => }/nouveau/drm/nouveau_drm_api.h (100%)
 rename src/gallium/winsys/{drm/radeon/core => radeon/drm}/Makefile (79%)
 rename src/gallium/winsys/{drm/radeon/core => radeon/drm}/SConscript (100%)
 rename src/gallium/winsys/{drm/radeon/core => radeon/drm}/radeon_buffer.h (100%)
 rename src/gallium/winsys/{drm/radeon/core => radeon/drm}/radeon_drm.c (100%)
 rename src/gallium/winsys/{drm/radeon/core => radeon/drm}/radeon_drm.h (100%)
 rename src/gallium/winsys/{drm/radeon/core => radeon/drm}/radeon_drm_buffer.c (100%)
 rename src/gallium/winsys/{drm/radeon/core => radeon/drm}/radeon_r300.c (100%)
 rename src/gallium/winsys/{drm/radeon/core => radeon/drm}/radeon_r300.h (100%)
 rename src/gallium/winsys/{drm/radeon/core => radeon/drm}/radeon_winsys.h (100%)
 rename src/gallium/winsys/{drm/vmware/core => svga/drm}/Makefile (63%)
 rename src/gallium/winsys/{drm/vmware/core => svga/drm}/SConscript (100%)
 rename src/gallium/winsys/{drm/vmware/core => svga/drm}/vmw_buffer.c (100%)
 rename src/gallium/winsys/{drm/vmware/core => svga/drm}/vmw_buffer.h (100%)
 rename src/gallium/winsys/{drm/vmware/core => svga/drm}/vmw_context.c (100%)
 rename src/gallium/winsys/{drm/vmware/core => svga/drm}/vmw_context.h (100%)
 rename src/gallium/winsys/{drm/vmware/core => svga/drm}/vmw_fence.c (100%)
 rename src/gallium/winsys/{drm/vmware/core => svga/drm}/vmw_fence.h (100%)
 rename src/gallium/winsys/{drm/vmware/core => svga/drm}/vmw_screen.c (100%)
 rename src/gallium/winsys/{drm/vmware/core => svga/drm}/vmw_screen.h (100%)
 rename src/gallium/winsys/{drm/vmware/core => svga/drm}/vmw_screen_dri.c (100%)
 rename src/gallium/winsys/{drm/vmware/core => svga/drm}/vmw_screen_ioctl.c (100%)
 rename src/gallium/winsys/{drm/vmware/core => svga/drm}/vmw_screen_pools.c (100%)
 rename src/gallium/winsys/{drm/vmware/core => svga/drm}/vmw_screen_svga.c (100%)
 rename src/gallium/winsys/{drm/vmware/core => svga/drm}/vmw_surface.c (100%)
 rename src/gallium/winsys/{drm/vmware/core => svga/drm}/vmw_surface.h (100%)
 rename src/gallium/winsys/{drm/vmware/core => svga/drm}/vmwgfx_drm.h (100%)
 rename src/gallium/winsys/{drm/i965 => sw}/Makefile (61%)
 copy src/gallium/winsys/{drm/sw => sw/drm}/Makefile (73%)
 rename src/gallium/winsys/{drm/sw => sw/drm}/sw_drm_api.c (98%)
 rename src/gallium/winsys/{drm/sw => sw/drm}/sw_drm_api.h (100%)
 rename src/gallium/winsys/{ => sw}/gdi/SConscript (100%)
 rename src/gallium/winsys/{ => sw}/gdi/gdi_sw_winsys.c (100%)
 rename src/gallium/winsys/{ => sw}/gdi/gdi_sw_winsys.h (100%)
 rename src/gallium/winsys/{ => sw}/null/Makefile (78%)
 rename src/gallium/winsys/{ => sw}/null/SConscript (100%)
 rename src/gallium/winsys/{ => sw}/null/null_sw_winsys.c (100%)
 rename src/gallium/winsys/{ => sw}/null/null_sw_winsys.h (100%)
 rename src/gallium/winsys/{drm/sw => sw/wrapper}/Makefile (65%)
 rename src/gallium/winsys/{drm/sw => sw/wrapper}/wrapper_sw_winsys.c (100%)
 rename src/gallium/winsys/{drm/sw => sw/wrapper}/wrapper_sw_winsys.h (100%)
 rename src/gallium/winsys/{ => sw}/xlib/Makefile (79%)
 rename src/gallium/winsys/{ => sw}/xlib/SConscript (100%)
 rename src/gallium/winsys/{ => sw}/xlib/xlib_sw_winsys.c (100%)
2010-03-24 17:02:17 +01:00
Jakob Bornecrantz
43218a45a4 gallium: Move xorg drivers to targets
Attached output from git commit:
 rename src/gallium/{winsys/drm/intel/xorg => targets/xorg-i915}/Makefile (95%)
 rename src/gallium/{winsys/drm/intel/xorg => targets/xorg-i915}/intel_xorg.c (98%)
 rename src/gallium/{winsys/drm/i965/xorg => targets/xorg-i965}/Makefile (78%)
 rename src/gallium/{winsys/drm/i965/xorg => targets/xorg-i965}/intel_xorg.c (98%)
 rename src/gallium/{winsys/drm/nouveau/xorg => targets/xorg-nouveau}/Makefile (96%)
 rename src/gallium/{winsys/drm/nouveau/xorg => targets/xorg-nouveau}/nouveau_xorg.c (98%)
 rename src/gallium/{winsys/drm/radeon/xorg => targets/xorg-radeon}/Makefile (73%)
 rename src/gallium/{winsys/drm/radeon/xorg => targets/xorg-radeon}/radeon_xorg.c (98%)
 rename src/gallium/{winsys/drm/vmware/xorg => targets/xorg-vmwgfx}/Makefile (97%)
 rename src/gallium/{winsys/drm/vmware/xorg => targets/xorg-vmwgfx}/SConscript (100%)
 rename src/gallium/{winsys/drm/vmware/xorg => targets/xorg-vmwgfx}/vmw_driver.h (100%)
 rename src/gallium/{winsys/drm/vmware/xorg => targets/xorg-vmwgfx}/vmw_hook.h (100%)
 rename src/gallium/{winsys/drm/vmware/xorg => targets/xorg-vmwgfx}/vmw_ioctl.c (99%)
 rename src/gallium/{winsys/drm/vmware/xorg => targets/xorg-vmwgfx}/vmw_screen.c (100%)
 rename src/gallium/{winsys/drm/vmware/xorg => targets/xorg-vmwgfx}/vmw_video.c (99%)
 rename src/gallium/{winsys/drm/vmware/xorg => targets/xorg-vmwgfx}/vmw_xorg.c (100%)
2010-03-24 17:02:17 +01:00
Jakob Bornecrantz
f5ba2cdeb9 gallium: Move egl drivers to targets
Atteched output from git commit:
 rename src/gallium/{winsys/drm => targets}/Makefile.egl (100%)
 rename src/gallium/{winsys/drm/intel/egl => targets/egl-i915}/Makefile (86%)
 rename src/gallium/{winsys/drm/i965/egl => targets/egl-i915}/dummy.c (100%)
 rename src/gallium/{winsys/drm/i965/egl => targets/egl-i965}/Makefile (86%)
 rename src/gallium/{winsys/drm/intel/egl => targets/egl-i965}/dummy.c (100%)
 rename src/gallium/{winsys/drm/nouveau/egl => targets/egl-nouveau}/Makefile (88%)
 rename src/gallium/{winsys/drm/nouveau/egl => targets/egl-nouveau}/dummy.c (100%)
 rename src/gallium/{winsys/drm/radeon/egl => targets/egl-radeon}/Makefile (87%)
 rename src/gallium/{winsys/drm/radeon/egl => targets/egl-radeon}/dummy.c (100%)
 create mode 100644 src/gallium/targets/egl-swrast/Makefile
 create mode 100644 src/gallium/targets/egl-swrast/swrast_glue.c
 rename src/gallium/{winsys/drm/vmware/egl => targets/egl-vmwgfx}/Makefile (86%)
 rename src/gallium/{winsys/drm/swrast/egl => targets/egl-vmwgfx}/dummy.c (100%)
 delete mode 100644 src/gallium/winsys/drm/swrast/Makefile
 delete mode 100644 src/gallium/winsys/drm/swrast/core/Makefile
 delete mode 100644 src/gallium/winsys/drm/swrast/core/swrast_drm_api.c
 delete mode 100644 src/gallium/winsys/drm/swrast/egl/Makefile
 delete mode 100644 src/gallium/winsys/drm/vmware/egl/dummy.c
2010-03-24 17:02:17 +01:00
Jakob Bornecrantz
be38b32531 gallium: Move dri drivers to targets
Attached output from git commit:
 rename src/gallium/{winsys/drm/Makefile.template => targets/Makefile.dri} (100%)
 rename src/gallium/{winsys/drm/intel/dri => targets/dri-i915}/Makefile (75%)
 rename src/gallium/{winsys/drm/intel/dri => targets/dri-i915}/SConscript (100%)
 rename src/gallium/{winsys/drm/i965/dri => targets/dri-i965}/Makefile (76%)
 rename src/gallium/{winsys/drm/i965/dri => targets/dri-i965}/SConscript (100%)
 rename src/gallium/{winsys/drm/nouveau/dri => targets/dri-nouveau}/Makefile (86%)
 rename src/gallium/{winsys/drm/radeon/dri => targets/dri-radeong}/Makefile (85%)
 rename src/gallium/{winsys/drm/radeon/dri => targets/dri-radeong}/SConscript (100%)
 rename src/gallium/{winsys/drm/vmware/dri => targets/dri-vmwgfx}/Makefile (85%)
 rename src/gallium/{winsys/drm/vmware/dri => targets/dri-vmwgfx}/SConscript (100%)
2010-03-24 17:02:17 +01:00
Jakob Bornecrantz
41d2ebf202 gallium: Remove GALLIUM_WINSYS_DRM_DIRS 2010-03-24 17:02:17 +01:00
Brian Paul
01f7acb700 progs/glsl: remove/replace //-style comments 2010-03-24 09:08:24 -06:00
Brian Paul
79394f0267 progs/glsl: silence warnings, remove debug code, adjust window size, etc 2010-03-24 09:04:17 -06:00
RALOVICH, Kristóf
4e328774d4 demos: import GLSL raytracing demos 2010-03-24 09:04:14 -06:00
Brian Paul
e71c1589d8 st/mesa: fix typo in prev commit 2010-03-24 09:04:10 -06:00
Brian Paul
2d6befd9d1 st/mesa: fix sampler_view destruction bug when texture is shared
Since texture's can be shared by many contexts, the texture's sampler
view's context pointer might be invalid by time we delete the texture.

Prevent crashes/etc by setting the sampler view's context to be the
calling context before deleting it.  This should be safe as long as
all contexts which share the texture are using the same gallium driver.
That's a reasonable assumption since pipe_texture objects aren't
compatible between different drivers anyway.
2010-03-24 08:34:37 -06:00
Brian Paul
ab93f8d067 st/mesa: code clean-ups, formatting fixes, comments, etc 2010-03-24 08:25:24 -06:00
Brian Paul
3374b26f52 st/mesa: rename st_clear() to st_Clear()
To be consistent with other Mesa driver functions.
2010-03-24 08:18:21 -06:00
Brian Paul
f66d70b930 st/mesa: return GL_TRUE/GL_FALSE if return type is GLboolean
Just to be consistent.
2010-03-24 08:16:27 -06:00
Chia-I Wu
99386921e7 progs/egl: Link xeglthreads to libpthread.
This should hopefully fix a build failure reported by Chris Ball when
binutils-gold is used.
2010-03-24 08:46:10 +08:00
Ian Romanick
882dad7540 ir_function constructor now takes the function name as a parameter 2010-03-23 17:42:04 -07:00
Ian Romanick
bb7e00a1cd Add glsl_type::get_base_type query
Retreives the glsl_type that corresponds to the base type of a numeric scalar /
vector / matrix type.  So vec4 returns float, etc.
2010-03-23 17:31:39 -07:00
Ian Romanick
7aeb6abda7 Add glsl_type::is_numeric and glsl_type::is_boolean queries 2010-03-23 17:31:03 -07:00
Brian Paul
2b5de09b3e swrast: improve depth texture mipmap selection
We still don't do proper min/mag filtering but this is better than just
sampling the base mipmap level all the time.

Fixes piglit depth-level-clamp test.  Fixes fd.o bug 27256.
2010-03-23 17:55:43 -06:00
Brian Paul
8ba47561dd st/glx: add support for multiple displays
This is a quick & dirty solution, but it works.  See comments in
the code for other ideas.

Fixes regressions/breakage seen in progs/xdemos/glxheads, etc. from commit
6632915e95.
2010-03-23 17:24:54 -06:00
Brian Paul
2d84d58975 glslcompiler: added option to do linking of vert/frag shaders 2010-03-23 16:20:02 -06:00
Ian Romanick
abef955764 Begin processing constructors
Right now, reject constructors for samplers because the are illegal.
2010-03-23 15:08:30 -07:00
Ian Romanick
cb7d066967 Add query to determine whether a type is a sampler 2010-03-23 15:03:46 -07:00
Luca Barbieri
3790199e04 dri: fix dri_test.c for non-TLS build
_glapi_Context and _glapi_Dispatch have different constness between
TLS and non-TLS builds.
2010-03-23 22:59:44 +01:00
Luca Barbieri
5f229547a5 dri: add _glthread_GetID to dri_test.c dummy glapi 2010-03-23 22:57:25 +01:00
Luca Barbieri
7e246e6aa6 dri: make unresolved symbol test link work even without a libGL.so
Currently the test link uses -lGL to define the glapi symbols.

This makes it impossible to build DRI drivers on systems without
Mesa installed and without building the libGL from the Mesa tree
first.

Some automated build systems trigger this problem.

This commit removes -lGL and instead adds a dummy implementation of
glapi to dri_test.c

This, along with Kristian's commit, should fix all known regressions
due to the addition of unresolved symbol checking.
2010-03-23 21:32:09 +01:00
Dan Nicholson
e725ef171b Change libX11 variables to not conflict with AC_PATH_XTRA
The variable X_LIBS from AC_PATH_XTRA contains only the -L searchdir
parameter and not the -lX11 to link to Xlib. Use X11 prefixed build vars
for linking with Xlib to avoid the conflict.

Signed-off-by: Dan Nicholson <dbn.lists@gmail.com>
2010-03-23 13:26:50 -07:00
Ian Romanick
1e5cd2b05b Add test for invalid assignment of function return value 2010-03-23 13:23:53 -07:00
Ian Romanick
0bb1c3c153 Add *some* type checking for assignments 2010-03-23 13:23:31 -07:00
Ian Romanick
71d0bbfcb2 Disallow passing NULL for state to _mesa_glsl_error
The two places that were still passing NULL had a state pointer to
pass.  Not passing it in these places prevented termination of
compilation of erroneous programs.
2010-03-23 13:21:19 -07:00
Ian Romanick
f3f111eac4 Fix typographical errors of "FINISHME" 2010-03-23 13:04:19 -07:00
Kristian Høgsberg
ba5a53edd1 dri: Add $(DRI_LIB_DEPS) when linking the test binary
This will make sure we pick up libdrm_$(chipset).so from the right place.
2010-03-23 15:50:23 -04:00
Eric Anholt
f41fc53728 Include other generated sources in BUILT_SOURCES.
Otherwise, having cleaned glsl_parser.h, we'd never regenerate it because
glsl_parser.cpp was already right where it needed to be.
2010-03-23 12:32:25 -07:00
Eric Anholt
e5ba18083b Use bash for the built file generation since builtin_types.sh requires it. 2010-03-23 12:32:25 -07:00
Eric Anholt
6985a43832 Clean the built sources with make clean. 2010-03-23 12:32:25 -07:00
Eric Anholt
3d99e990c0 i965: Stop abusing ctx->NewState flags for storing driver internal changes.
We're still abusing the flags by putting them where our driver stores
ctx->NewState changes.  Making them into more restricted state change
flags would be a project for later.

Fixes a failure where calling intel_draw_buffer() too often would trip
up Mesa assertions about when Mesa state could get changed, when it hadn't.

Bug #27034.
2010-03-23 15:29:54 -04:00
Kristian Høgsberg
57edf6b1fc mesa: Also print _NEW_STENCIL in _mesa_print_state() 2010-03-23 15:29:05 -04:00
Ian Romanick
cec65a6b76 Generate an error for variables declared with type void 2010-03-23 12:28:44 -07:00
Ian Romanick
8400bc4d35 Add is_error and is_void type queries 2010-03-23 12:28:28 -07:00
Ian Romanick
9e7c34b865 Set the type of a function call to be the return type of the callee 2010-03-23 12:21:18 -07:00
Ian Romanick
e39cc69fa3 Set, and require, a return type for function signatures 2010-03-23 12:19:13 -07:00
Ian Romanick
7563b50075 Add `void' type to table of available types
This will make void-01.glsl test fail, so I may regret this later.
However, this will make supporting functions that return void or
functions that have a void parameter list easier to handle.
2010-03-23 12:11:50 -07:00
Ian Romanick
693bb11b5f Rename test GLSL sources from .txt to .glsl 2010-03-23 11:57:24 -07:00
Ian Romanick
f8f1085e5e Add test for declaring variables of type void. 2010-03-23 11:54:03 -07:00
Luca Barbieri
3428a30515 nvfx: add NOUVEAU_VTXIDX_IN_VRAM variable to put vertex/index buffers in VRAM
On some systems, putting vertex and index buffers in VRAM instead of GART
memory eliminates massive graphics corruption which is otherwise present,
due to unclear causes.

This patch adds an environment variable that does that, along with helpful
messages.

It turns it on by default on G7x, as it is what I am seeing corruption
on and some other reports also seemed to pinpoint these cards.
2010-03-23 18:11:25 +01:00
Luca Barbieri
208f5bf3cd nvfx: delay allocation of buffers in GART/VRAM to validation time
Currently we allocate buffers in GART or VRAM at creation time.

However, when using swtnl, this results in reads from uncached
memory, which drastically impair performance.

So, for now, cause nouveau_screen.c to not pass any placement flags
to buffer creation, so that the buffers are moved later.

Previously libdrm itself did this, but was changed to not to do it.

This may introduce an extra copy in normal usage, but this currently
does not seem to introduce significant performance degradation.

This will be revisited when pipebuffer is integrated.

Note that for AGP systems, properly solving this may be complex
since currently there is no fast way of reading from GART/VRAM.

We will probably need to try mapping AGP as writethrough and, in
addition, make buffer creation more aware of future buffer usage.
2010-03-23 18:10:59 +01:00
Luca Barbieri
9f0e302cc7 st/mesa: make st_manager.c set have[Stencil|Depth]Buffer only if bits > 0
Fixes a segfault when clearing a non-existent stencil buffer.
2010-03-23 18:02:51 +01:00
Luca Barbieri
fff86eb0aa dri: use mv -f instead of mv to ensure no prompting occurs
Using just mv may cause prompts on some systems/configurations.
2010-03-23 17:57:59 +01:00
Brian Paul
2689dd304c Merge branch '7.8'
Conflicts:

	Makefile
	src/gallium/state_trackers/glx/xlib/xm_api.c
	src/mesa/drivers/dri/intel/intel_blit.c
	src/mesa/drivers/dri/intel/intel_pixel_copy.c
	src/mesa/main/version.h
2010-03-23 09:14:17 -06:00
Luca Barbieri
83f4c444f4 nvfx: don't crash on empty fragment program 2010-03-23 15:41:10 +01:00
Luca Barbieri
e14d812e15 nvfx: fix coding style in nvfx_transfer.c 2010-03-23 15:41:04 +01:00
Luca Barbieri
a6cc9cf38d nvfx: stop incessantly spewing debug messages on the terminal
Currently we are continuously spewing messages about these variables
since we call debug_get_bool_option everytime we want to check their value.

This is annoying, slows things down due to terminal rerendering
and obscures useful messages.

This patch only calls debug_get_bool_option once and caches the result in a
static variable.
2010-03-23 15:40:41 +01:00
Luca Barbieri
c652ad907f nvfx: fix/workaround nv3x hwtnl issues
This patch re-emits the viewport state on framebuffer or rasterizer
change.

This seems to be necessary on nv3x, but the reason is not fully
understood.

It is quite likely that this isn't really the correct fix, but seems
to work, and makes nv3x much better.
2010-03-23 15:40:34 +01:00
Luca Barbieri
3e17a5b047 dri: test whether the built drivers have unresolved symbols
This is a different approach to solving this problem that the patch
I previously posted, and unlike that, should not cause any problems.

Right now undefined symbols in DRI drivers will still allow the
build to succeed.

As a result, people modifying drivers they cannot test risk creating
unloadable drivers with no easy way of automatically avoiding it.

For instance, the modifications to nv50 for context transfers caused
such an issue recently.

Unfortunately, just adding -Wl,--no-undefined doesn't work, because
the DRI drivers depend on glapi symbols, but do not depend on
libGL.so.1

Adding -lGL is not the correct solution since DRI drivers are not loaded
just by libGL, but also by X and possibly by other clients.

So, this patch simply tries to build an executable linked to the DRI
driver and to libGL.
If the DRI driver contains any undefined symbols not satisfied by its
dependencies or by libGL, this will fail.

This solution does not alter the built drivers, and does not significantly
slow down the build process.

All classic DRI drivers as well as all the Gallium drivers with configure
options compiled successfully with this change.

Thanks to Xavier Chantry <chantry.xavier@gmail.com> and
Michel Daenzer <michel@daenzer.net> for helping with this.

Signed-off-by: Luca Barbieri <luca@luca-barbieri.com>
Acked-by: Brian Paul <brian.e.paul@gmail.com>
2010-03-23 15:28:59 +01:00
Marek Olšák
1f25eca311 radeong: fix build issue with libdrm < 2.4.19 2010-03-23 13:34:31 +01:00
Dave Airlie
2a3accbc00 r300g: fix glean occlusion query test 2010-03-23 19:12:33 +10:00
Kristian Høgsberg
7a0bcba9f9 glx: Suppress BadDrawable from DRI2CopyRegion
This can happen when an X window is destroyed behind our back.  We use
DRI2CopyRegion behind the scenes in many places (like flushing the fake
front to the real front) so we have to ignore X errors triggered in that
case.

The glean test cases trigger this consistently as they don't destroy the
GLX drawable nicely, they just destroy the X window.
2010-03-22 22:03:38 -04:00
Corbin Simpson
d5b2cecb03 gallium/docs: Cleanup and clarify point ras info.
...This state's interdependent? Really? Needs moar cleanup.
2010-03-22 18:42:42 -07:00
Corbin Simpson
ed61faec7e radeong: Always initialize this variable.
May or may not be responsible for slight increases in ipers FPS.
2010-03-22 18:42:42 -07:00
Corbin Simpson
ca49a72a55 r300g: Cleanup a few old warnings.
Those paths aren't important anymore, and a debugging warning won't stop
a hardlock anyway.
2010-03-22 18:42:42 -07:00
Jesse Barnes
8f4f2a0c36 GLX/OML: honor OML semantics even if target, divisor and remainder are 0
This change passes a remainder of 1 to the server with the
DRI2SwapBuffers request, causing it to honor the OML semantics for the
swap rather than falling through to glXSwapBuffers behavior.  The
remainder actually ends up ignored since the divisor is 0, but we need
to differentiate the OML and standard behavior somehow.

Reported-by: Mario Kleiner <mario.kleiner@tuebingen.mpg.de>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2010-03-22 16:41:17 -07:00
Eric Anholt
d9ea1af82c i965: Add disasm for SNB MATH opcode. 2010-03-22 15:04:47 -07:00
Eric Anholt
10069916c7 i965: Enable normal clipping on SNB.
Rejecting all doesn't seem to be helping get the pipeline lit up.
2010-03-22 15:04:47 -07:00
Eric Anholt
7319b19fc9 i965: Force single program flow in SNB GS, to match gen4 GS. 2010-03-22 15:04:46 -07:00
Eric Anholt
073f8d1c00 i965: Correct copy and wasted field shifts for SNB GS URB. 2010-03-22 15:04:46 -07:00
Eric Anholt
edc8a99d1d i965: Enable VS on SNB.
It appears that the thing that was killing VS threads was the
gratuitous NOP that replaced the gratuitous jump from OPCODE_END to
the nearby OPCODE_END implementation.  With that gone, we can move on
to the rest of the pipeline.
2010-03-22 15:04:46 -07:00
Eric Anholt
d163d5fac0 i965: Remove gratuitous jump or nop from OPCODE_END to vertex emit.
Just emit the URB write at END time.  Subroutine code that sits after
OPCODE_END won't be executed since we've ended the thread at the point
that the URB write is done.
2010-03-22 15:04:46 -07:00
Eric Anholt
a9acde6a72 i965: Ignore execution mask for the mov(m0, g0) of VS URB write header on SNB.
Otherwise, we may not get the FFTID set up which would break freeing
of resources.
2010-03-22 15:04:46 -07:00
Eric Anholt
4fc5732225 i965: Allow FS constants to be used as immediates instead of push/pull.
The hope is to later take advantage of the reduced constant usage to
free up regs.  This only covers the GLSL path at the moment, because
the brw_wm_emit path doesn't get the information as to whether a float
value is a constant or a uniform.
2010-03-22 15:04:46 -07:00
Eric Anholt
864f2bd61d i965: Add INTEL_DEBUG=glsl_force to force brw_wm_glsl.c.
I keep finding the desire to force this path to debug it instead of
cooking up goofy-looking testcases to do so.
2010-03-22 15:04:46 -07:00
Eric Anholt
8a998342c6 i965: Optimize OPCODE_CMP by using BRW_SEL to choose results.
Tested with piglit glsl-fs-sqrt-branch, fp-cmp.vpfp.
2010-03-22 15:04:46 -07:00
Brian Paul
ef2664da6c st/glx: fix depth/stencil format selection code
This fixes a pretty big performance regression caused by commit
3475e88442.

When the user does not request a stencil buffer it's important that we
don't use a depth/stencil format (or at least make it our last choice).
If the user calls glClear(GL_DEPTH_BUFFER_BIT) when we have a combined
depth/stencil buffer, that causes us to hit the clear_with_quad() path
which can be much, much slower than calling pipe_context::clear().

Also, try to use a shallower depth format before a deeper one.
2010-03-22 16:01:15 -06:00
Brian Paul
af0b0e1172 st/mesa: rename st_framebuffer() to st_ws_framebuffer()
Be clear that this function is not just a cast wrapper.
2010-03-22 16:01:15 -06:00
Kristian Høgsberg
6422cf387b intel: Call intel_prepare_render() before looking up regions.
Fixes #27213.
2010-03-22 17:55:05 -04:00
Vinson Lee
262961ef69 st/mesa: Remove unnecessary headers. 2010-03-22 13:02:09 -07:00
Brian Paul
f42acbeebf glslcompiler: fix build again
Simply use the libglapi.a archive instead of individual .o files.
Fixes the non-debug build.
2010-03-22 13:36:30 -06:00
Vinson Lee
45d1dc2607 cso: Remove unnecessary header. 2010-03-22 11:34:18 -07:00
Francisco Jerez
fc14fb9d1a dri/nouveau: Rectangle texture fixes. 2010-03-22 18:41:23 +01:00
Francisco Jerez
bfdea90f25 dri/nouveau: Some render to texture fixes. 2010-03-22 18:41:23 +01:00
Francisco Jerez
199fab25b7 dri/nouveau: Fix swrast fallbacks when the read and draw buffers aren't the same. 2010-03-22 18:41:23 +01:00
Francisco Jerez
fe7d0e6dc8 dri/nouveau: Expose EXT_framebuffer_blit. 2010-03-22 18:41:22 +01:00
Francisco Jerez
fc7890dc6c dri/nouveau: Plug in some mesa_meta functions instead of the swrast variants. 2010-03-22 18:41:22 +01:00
Francisco Jerez
c695e80017 dri/nouveau: Emit dirty states on nouveau_validate_framebuffer.
Fixes broken intermediate frames when a window is being resized
(regression caused by 878eef8c4).
2010-03-22 18:41:22 +01:00
Luca Barbieri
4e3b950c70 nvfx: fix sampler views support
The code was half converted, resulting in texturing being totally broken.
2010-03-22 18:36:16 +01:00
Brian Paul
98b4e7aee8 glslcompiler: fix build breakage 2010-03-22 09:08:09 -06:00
Brian Paul
182c42c8da Merge branch '7.8'
Conflicts:

	src/gallium/drivers/cell/ppu/cell_screen.c
	src/mesa/state_tracker/st_cb_drawpixels.c
2010-03-22 09:07:46 -06:00
Brian Paul
5cb4a3524b mesa: remove return, do as the comment says 2010-03-22 08:23:14 -06:00
Chia-I Wu
904d129322 docs: Update the path to build libgl-xlib. 2010-03-22 13:32:08 +08:00
Marek Olšák
9fc6c8b831 r300g: disable tiling for YUV formats 2010-03-21 22:17:14 +01:00
Marek Olšák
8bf9842fac r300g: fix scons build 2010-03-21 22:05:27 +01:00
Marek Olšák
7733bac66c r300g: accelerate blitting for all 64-bit texture formats 2010-03-21 21:54:07 +01:00
Marek Olšák
12dc497173 r300g: add and enable square microtiling
It requires DRM 2.1.0 (e.g. kernel 2.6.34) and is disabled on older ones.

Finally, the texture tiling implementation is now complete. Uff.
2010-03-21 21:54:07 +01:00
Marek Olšák
33d2349119 r300g: cleanup tiling flags propagation 2010-03-21 21:54:06 +01:00
Marek Olšák
d0d3abd360 r300g: put common defines into one file 2010-03-21 21:54:06 +01:00
Marek Olšák
bc5778e202 r300g: remove unused code 2010-03-21 21:54:02 +01:00
George Sapountzis
a0ce955764 Revert "drm/sw: does not need sw_winsys"
This reverts commit 97a694e221.
2010-03-21 19:36:28 +02:00
George Sapountzis
15c7fa460b Revert "gallium: add soft screen helper"
This reverts commit f87a5f6499.
2010-03-21 19:33:17 +02:00
George Sapountzis
f9c0cbd1ad Revert "drm/sw: just s/softpipe_create_screen/gallium_soft_create_screen/"
This reverts commit 5d524cce9c.
2010-03-21 19:33:09 +02:00
George Sapountzis
63aa8a39c4 Revert "fix scons build"
This reverts commit 29ec051648.
2010-03-21 19:32:40 +02:00
George Sapountzis
29ec051648 fix scons build 2010-03-21 19:20:15 +02:00
George Sapountzis
dd120776d1 Merge branch 'master' of git+ssh://git.freedesktop.org/git/mesa/mesa 2010-03-21 15:37:40 +02:00
George Sapountzis
59629b413a Revert "Makefile.template: respect LIBRARY_DEFINES in mkdep"
This reverts commit 9ec29e3191.
2010-03-21 15:32:50 +02:00
Christoph Bumiller
f7273f2a27 nv50: report driver as GLSL capable
There's still no hint of optimization in the shaders, but
we support conditionals, loops and even integer opcodes so
it isn't that big a lie.
2010-03-21 14:11:59 +01:00
George Sapountzis
f2fa4a1888 Merge branch 'master' of git://anongit.freedesktop.org/git/mesa/mesa 2010-03-21 15:05:21 +02:00
George Sapountzis
5d524cce9c drm/sw: just s/softpipe_create_screen/gallium_soft_create_screen/
This partially reverts commit f87a5f6499.
2010-03-21 15:03:13 +02:00
Christoph Bumiller
1afda5303d nv50: don't validate arrays on clear
The vertex elements and buffers might not be valid anymore.
2010-03-21 13:23:53 +01:00
Christoph Bumiller
272bbbffb0 nv50: get rid of the static_init stateobj
Relocations of per-screen buffers are now emitted directly,
and include the necessary method to get changes in constbuf
addresses committed to the hw.

It should also be a bit cheaper than the way stateobjs emit
relocation markers, use a little less pushbuf space.
2010-03-21 13:23:47 +01:00
George Sapountzis
f87a5f6499 gallium: add soft screen helper 2010-03-21 13:21:46 +02:00
George Sapountzis
c28f5f98d6 dri1_api: need not include drm.h 2010-03-21 13:21:46 +02:00
George Sapountzis
97a694e221 drm/sw: does not need sw_winsys 2010-03-21 13:21:46 +02:00
George Sapountzis
016c5c953f drm/sw: llvmpipe texture_from_handle
Not sure, but judging by softpipe, this hook was forgotten.
2010-03-21 13:21:46 +02:00
George Sapountzis
9ec29e3191 Makefile.template: respect LIBRARY_DEFINES in mkdep 2010-03-21 13:21:45 +02:00
George Sapountzis
a13bcf945f rename dri_sw to drisw_util for consistency 2010-03-21 13:21:45 +02:00
George Sapountzis
0b932284f2 dri_inteface: add define for checking presence of drm.h
__NOT_HAVE_DRM_H is a like a feature, defined by default on specific platforms
and allows to be defined externally as well.

__NOT_HAVE_DRM_H should only be used by xserver and mesa swrast_dri drivers
2010-03-21 13:21:45 +02:00
George Sapountzis
2b5a6e083c glx: minor cosmetic 2010-03-21 13:21:45 +02:00
George Sapountzis
2d1641b191 glx: swapBuffers prototype has changed 2010-03-21 13:21:45 +02:00
Francisco Jerez
c48226e81d dri/nouveau: Reemit the light model state when lighting goes on/off. 2010-03-21 11:49:46 +01:00
Francisco Jerez
7f1f4c14ec dri/nouveau: Random cleanups. 2010-03-21 11:49:20 +01:00
Dave Airlie
bb324182fc r300g: fix occlusion query hangs.
Okay need to revist the whole OQ stuff anyways, glean test asserts
which is never good.

I'm liking the cached bufmgr restrictions less and less, I think I'll
probably play with the fence and/or busy stuff ASAP and try and clean it up.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-03-21 19:39:28 +10:00
Dave Airlie
ff1c7baad2 r300g: add bufmgr cached for vertex/index buffers.
This adds the cached bufmgr for vertex/index buffers on top of the kernel
manager.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-03-21 19:39:28 +10:00
Dave Airlie
0dab3189e1 gallium: cached bufmgr add map busy check
Suggested by Jose on the list, probably not perfect but will let me get
past this for now, testing with a fenced bufmgr on top of this, was slower,

Also this doesn't let you do the busy early exit optimisation either from
what I can see.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-03-21 19:38:41 +10:00
Chia-I Wu
12deb9e6ca Merge remote branch 'origin/gallium-st-api-dri' 2010-03-21 16:32:34 +08:00
Marek Olšák
162bc831c9 r300g: align misaligned ushort vertex indices 2010-03-21 05:42:50 +01:00
Marek Olšák
53ca4f8401 r300g: fix misaligned generated offset for ubyte vertex indices 2010-03-21 05:42:49 +01:00
Marek Olšák
04de5f4b8b r300g: split the vertex buffer alignment validation 2010-03-21 02:19:55 +01:00
Marek Olšák
951d89ae3a r300g: skip null vertex buffers 2010-03-21 02:19:55 +01:00
Marek Olšák
7b38f946a0 r300/compiler: fix assertion failure in the r500-fragprog emission path 2010-03-21 02:06:44 +01:00
Corbin Simpson
44cfc4ad74 r300g: Bump immediate limits.
Seems like a decent idea, especially since the big barrier now is
getting the VBOs back from the VRAM boundary.
2010-03-20 17:18:22 -07:00
Corbin Simpson
4711aa089e r300g: Correctly hax max_index on pipe_vertex_buffers.
Still not happy with this, but at least things seem to work.
2010-03-20 17:16:46 -07:00
Corbin Simpson
7c8221b460 radeong: Use TRUE and FALSE. 2010-03-20 16:16:11 -07:00
Corbin Simpson
20dedcca3c radeong: Test the BO ptr for NULL instead of using a bool.
Slight memory savings, but more importantly also avoids a potential NULL
dereference.
2010-03-20 16:16:11 -07:00
Dave Airlie
c2d17dce27 r300g: winsys fix tiling change flushes.
If we change the tiling on a buffer we need to flush it, the old
radeon_buffer.c code had this but it crossed streams when I ported to
radeon_drm_buffer.c and I missed it. Should fix some piglit regressions.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-03-21 06:56:49 +10:00
Dave Airlie
03f1896304 r300g: add buffer/texture referenced checks.
I've no idea about the comments that were in there, just pass
this down to the winsys.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-03-21 06:56:49 +10:00
Brian Paul
449721a3d0 docs: note GL_EXT_packed_float, GL_EXT_shared_exponent extensions 2010-03-20 12:06:36 -06:00
Brian Paul
61753c4bf7 mesa: added GL3 query for GL_TEXTURE_SHARED_SIZE 2010-03-20 12:06:36 -06:00
Brian Paul
9fca5d2e39 mesa: added missing glGet query for GL_MAX_ARRAY_TEXTURE_LAYERS_EXT 2010-03-20 12:06:36 -06:00
Brian Paul
d6a9f5b3da mesa: added new GL3 buffer object queries
And clean up the error checking code.
2010-03-20 12:06:35 -06:00
Brian Paul
8829e063aa mesa: added GL3 buffer attachment aliases 2010-03-20 12:06:35 -06:00
Brian Paul
00225af999 mesa: added GL3 ContextFlags field and query code 2010-03-20 12:06:35 -06:00
George Sapountzis
fe5f070ef9 st/dri: fix bug in make_current 2010-03-20 12:59:58 +08:00
George Sapountzis
92827cd451 st/dri: fix bug in allocate_textures 2010-03-20 12:59:58 +08:00
Ian Romanick
41ec6a47ab Track the function that is currently being defined
Later this will allow type checking for return statements.
2010-03-19 17:08:05 -07:00
Ian Romanick
16a246c049 Initial bits for converting AST return nodes to IR return instructions 2010-03-19 16:51:16 -07:00
Ian Romanick
9578c87ce2 Implement IR return instructions 2010-03-19 16:44:52 -07:00
Ian Romanick
3359e58eac Use glsl_symbol_table::name_declared_this_scope
Prevent most illegal name reuse.
2010-03-19 15:38:52 -07:00
Ian Romanick
ac4fdc255b Add query to determine whether a name was declared at this scope
This will be used to prevent a variable and a function with the same
name from being declared.  As a side effect, the calls to
add_{type,name,function} should never fail.
2010-03-19 15:37:01 -07:00
Ian Romanick
38395c1aad Use separate namespaces for types, variables, and functions
This will allow types and their constructors to be easily stored in
the same symbol table.  This does add a potential problem that a
shader could declare a variable and a function with the same name.
This appears to be forbidden by the GLSL spec.
2010-03-19 15:34:13 -07:00
Ian Romanick
95517faf69 Add function to determine the scope where a variable is declared 2010-03-19 15:32:57 -07:00
Ian Romanick
8bde4cec6b Use glsl_symbol_table instead of using _mesa_symbol_table directly 2010-03-19 11:57:24 -07:00
Ian Romanick
82de85e264 Add a GLSL-specific facade to _mesa_symbol_table
This adds some type saftey and will enable elimination of a bunch of
type casts and other ugly crap in the code.
2010-03-19 11:43:36 -07:00
Ian Romanick
b0bb781e1d Don't track new type names during pass-1 parsing
This implementation was wrong anyway because it did not respect
scoping rules.  This will need to be revisited soon.  The most likely
result is that the grammar is going to need some significant re-work
to be able to use a IDENTIFIER in all the places where a TYPE_NAME is
currently used.
2010-03-19 11:12:33 -07:00
Brian Paul
05c03c6a1b gallivm: simplify and clean-up Z/stencil bit mask/shift code
Refactor the code into two helper functions which compute the bit mask
and shift terms for Z and stencil.  Plus add a bunch of new comments to
explain everything.
2010-03-19 10:03:41 -06:00
Roland Scheidegger
3b9555094d cso: remove cso_set/save/restore_sampler_textures
no longer used after all statetrackers have been converted.
2010-03-19 16:30:47 +01:00
Roland Scheidegger
e5f0384ad0 st/vega: fix up vega state tracker to use cso changes
use cso fragment sampler views instead of sampler textures.
since we don't really change views, try to store sampler views instead
of the textures to avoid having to recreate views most of the time.
2010-03-19 16:29:22 +01:00
Brian Paul
8221a0e7f7 es: added -I$(TOP)/include path 2010-03-19 07:37:18 -06:00
Michal Krol
980da4aed2 gallium/docs: Clarify sampler view descriptions. 2010-03-19 09:08:33 +01:00
Corbin Simpson
8e1768cfd3 gallium/docs: Fix a couple ReST errors. 2010-03-19 00:07:55 -07:00
Marek Olšák
12a40dda39 r300g: lod min/max clamping should be relative to the base level 2010-03-19 04:46:15 +01:00
Marek Olšák
afae089194 r300g: fix breakage after the gallium-sampler-view merge 2010-03-19 04:09:07 +01:00
Marek Olšák
f6e987ce78 r300g: add PIPE_FORMAT_B5G5R5X1_UNORM colorbuffer support, cleanups 2010-03-19 01:18:19 +01:00
Marek Olšák
0c81739528 r300g: mark SRGB colorbuffers as unsupported
I can't find the register bits for SRGB-aware blending and it's not even
exposed by fglrx so it's most probably not supported by hw.
2010-03-19 01:18:19 +01:00
Marek Olšák
cba6430524 r300g: add generating texture coordinates for point sprites (WIP) 2010-03-19 01:18:18 +01:00
Brian Paul
8df65e9899 gallivm: support PIPE_FORMAT_Z24S8_UNORM in depth/stencil code 2010-03-18 17:27:46 -06:00
Brian Paul
c9c0baabdc progs/tests: also test stencil INCR_WRAP mode if supported 2010-03-18 15:04:39 -06:00
Brian Paul
66b6676d14 gallivm: fix broken INCR/DECR stencil modes
We were mistakenly using the wrong data type for stencil values before.
2010-03-18 15:02:15 -06:00
Brian Paul
705ed3326c progs/tests: comments and clean-ups 2010-03-18 14:53:43 -06:00
Brian Paul
22e6dc3870 gallivm/llvmpipe: added lp_rast_shader_inputs::facing and pass through
The triangle rasterizer sets this field to indicate front/back-facing.
It gets passed into the generated fragment code as another parameter.
Used now for stencil front/back selection but will also be used for
fragment shaders in general (see TGSI_SEMANTIC_FACE).

With this commit two-sided stenciling mostly works but there's
still a bug or two...
2010-03-18 13:06:32 -06:00
Brian Paul
d219b8a022 llvmpipe: defines for RAST_WHOLE, RAST_EDGE_TEST 2010-03-18 13:06:32 -06:00
Alan Hourihane
94abc4b51e Add format B5G5R5X1 2010-03-18 18:01:41 +00:00
Brian Paul
521c61ff01 gallivm/llvmpipe: simplify front/back stencil ref value handling
Instead of passing an array, just pass two scalar values.
2010-03-18 11:31:38 -06:00
Brian Paul
ecf85c7d75 gallivm: checkpoint WIP two-sided stencil test 2010-03-18 11:18:01 -06:00
Brian Paul
a1e7aeecc2 llvmpipe: set opaque = FALSE if stencil enabled
Fixes occasional bad tiles seen in some demos like progs/demos/reflect.c
2010-03-18 09:30:15 -06:00
Francisco Jerez
3c0eab7148 dri/nouveau: Flush after texture validation.
Swizzling needs the destination surface in VRAM, but the subsequent
rendering operations making use of it are likely to not care. Fire the
ring after validation to leave the memory manager more room for
maneuvering.
2010-03-18 15:02:37 +01:00
Francisco Jerez
6193c41bcd dri/nouveau: Avoid pushbuf flushes in the middle of LMA setup. 2010-03-18 15:02:37 +01:00
Francisco Jerez
c944fb5ffe dri/nouveau: Implement texcoord generation. 2010-03-18 15:02:36 +01:00
Francisco Jerez
1a812ab57a dri/nouveau: Implement texture matrices. 2010-03-18 15:02:36 +01:00
Francisco Jerez
d475eae50b dri/nouveau: Some minor vertex submission fixes. 2010-03-18 15:02:35 +01:00
Xavier Chantry
50be9bc6ce dri/nouveau: only reallocate texture when needed
nouveau reallocated the mipmap tree on every MIN_FILTER call to account
for mipmap change. We only need to do this if the texture does not fit
in the existing mipmap tree. This gives a big performance boost for a
game like bzflag which changes MIN_FILTER all the time for its font
rendering.

Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com>
Signed-off-by: Francisco Jerez <currojerez@riseup.net>
2010-03-18 15:02:34 +01:00
José Fonseca
9d48a621d2 llvmpipe: Fix crashes when there is no depth buffer bound. 2010-03-18 10:24:10 +00:00
Kristian Høgsberg
6de8e563ac intel: Call _mesa_make_current() after getting initial buffers
The default viewport is the window rectangle, which is set up by
_mesa_make_current().  To be able to do that we need to get the
window dimension (and buffers) first, so we have to call
intel_prepare_render() before we can call into _mesa_make_current().

Fixes #26676 and #26678.
2010-03-17 22:45:21 -04:00
Chia-I Wu
a0d615fd97 st/mesa: Set the pipe context of the texture object.
The field was added in b8030c6561.  This
fixes a NULL dereference in xdemos/texture_from_pixmap.
2010-03-18 09:43:23 +08:00
Chia-I Wu
bd1ce87472 st/dri: Switch from st_public.h to st_api.h.
This is tested with demos found in progs/demos.  However, only the DRI2
path is tested.
2010-03-18 09:43:22 +08:00
Chia-I Wu
5ff21634f3 st/dri: Implement st_api.h callbacks.
This commit adds dri_st_api.c that implements st_api.h callbacks.  A
following commit will switch st/dri from st_public.h to st_api.h.
2010-03-18 09:34:37 +08:00
Chia-I Wu
903b90926c st/dri: Headers and public symbols clean up.
Remove unused headers and stop marking driDriverAPI as PUBLIC.
2010-03-18 08:48:13 +08:00
Chia-I Wu
61631a89a3 st/dri: Move DRI1 bits in dri_context.c to dri1.c. 2010-03-18 08:48:13 +08:00
Chia-I Wu
a437bc50f2 st/dri: Move DRI1 bits in dri_drawable.c to dri1.c. 2010-03-18 08:48:13 +08:00
Chia-I Wu
ca69249f25 st/dri: Move DRI1 bits in dri_screen.c to dri1.c. 2010-03-18 08:48:12 +08:00
Brian Paul
0557d0a4b2 progs/trivial: added comments 2010-03-17 16:29:34 -06:00
Brian Paul
fecd4cde50 gallivm/llvmpipe: basic stencil testing works
Most stencil demos look OK (modulo some unrelated rendering glitches).
Only single-sided stencil test works at this point.
There are probably some bugs to be found...
2010-03-17 16:29:34 -06:00
Brian Paul
227824ac69 llvmpipe: remove incorrect depth test check 2010-03-17 16:29:34 -06:00
Brian Paul
2b8db4ce15 gallivm: added lp_build_andc() 2010-03-17 16:29:34 -06:00
Brian Paul
8dc8c3f5b1 llvmpipe: silence some pointer/casting warnings 2010-03-17 16:29:34 -06:00
Brian Paul
d1c9e59883 gallivm/llvmpipe: more asst changes for stencil testing 2010-03-17 16:29:34 -06:00
Brian Paul
67b82fc395 gallivm/llmvpipe: pass stencil refs state into z/stencil build code 2010-03-17 16:29:34 -06:00
Brian Paul
b8b1bb946f llvmpipe: use new LP_JIT_CTX_ enums for jit context field positions
Use the new enum values rather than integers in a few places.
2010-03-17 16:29:34 -06:00
Brian Paul
eee5114797 llvmpipe: added stencil ref values to jit context state 2010-03-17 16:29:34 -06:00
Brian Paul
6379e47ebd llvmpipe: break lines 2010-03-17 16:29:34 -06:00
Eric Anholt
362c1bf75e intel: Replace mt->pitch with mt->region->pitch.
The pitch is not really an inherent part of the miptree, since it's
not part of any of the layout calculations, and it's dictated by the
libdrm-allocated region pitch now.
2010-03-17 11:24:01 -07:00
Eric Anholt
30446f8a70 intel: Return false like other blit failure paths if out of aperture.
The primary consumer of this (miptree relayout) already has this code
for handling failure, and the other paths want to know if failure
actually occurs and do something appropriate, which may not include
memcpy.
2010-03-17 11:24:01 -07:00
Eric Anholt
e1e48ea15c intel: Respect src pitch in _mesa_copy_rect().
If a non-zero src_y was used, this would break piglit
depth-level-clamp.
2010-03-17 11:24:01 -07:00
Eric Anholt
da011faf48 intel: Rely on allocated region pitch for the miptree pitch.
Bug #26966: 945 miptree pitch disagreement with libdrm.
2010-03-17 11:23:43 -07:00
Eric Anholt
1a77f8af9b intel: Assert that the linear blits succeed.
We don't have any fallback code here, and we want to avoid this path
if failure would happen, so just assert.
2010-03-17 11:12:36 -07:00
Eric Anholt
0c51390e4b intel: Remove level_offset now that it's unused.
This is the last pitch-dependent part of miptree setup.
2010-03-17 11:12:36 -07:00
Eric Anholt
32f143b432 intel: Remove extra tiling setting after allocating a tiled region. 2010-03-17 11:12:36 -07:00
Eric Anholt
c479a20fce intel: Rename the z24_x8 depth spans to z24_s8 since they do stencil too. 2010-03-17 11:12:36 -07:00
Brian Paul
b22bb34533 llvmpipe: remove -m32 flag from linux-llvm config 2010-03-17 10:53:55 -06:00
Brian Paul
c11d582411 st/mesa: plug in default for pipe_context::surface_copy() if needed
This lets us avoid conditionals and duplicated code in several places.
2010-03-17 10:31:59 -06:00
Brian Paul
a196a5d330 progs/samples: improve copy.c demo
If the test image was larger than the window, nothing was drawn because
of invalid raster position.  Use glWindowPos instead of glRasterPos.
Also, use integer src/dst coordinates to avoid grabbing black pixels
outside of the src image region.
2010-03-17 10:17:06 -06:00
Brian Paul
ef92fe85de Merge branch '7.8'
Conflicts:

	src/mesa/state_tracker/st_cb_drawpixels.c
2010-03-17 10:13:51 -06:00
Brian Paul
bf1974b37d progs/samples: silence warnings 2010-03-17 10:11:09 -06:00
Brian Paul
59e743b8d3 glapi: fix assorted warnings
And replace some instances of GLuint with unsigned int to avoid pulling in
GL/gl.h
2010-03-17 08:44:54 -06:00
Corbin Simpson
90fe8c39f1 st/mesa: Fix build breakage.
Nearly certain this is what was intended; it compiles, but I'm not sure
this path is ever hit in my tests.
2010-03-17 04:35:14 -07:00
Pauli Nieminen
f0f04cd12d Merge branch '7.8' into master
Conflicts:
	Makefile
	src/mesa/main/version.h
2010-03-17 11:26:48 +02:00
Brian Paul
e1ee3eaf6d cell: build identity driver too 2010-03-16 16:47:02 -06:00
Brian Paul
a9a1b52f95 cell: add missing semicolon 2010-03-16 16:47:02 -06:00
Christoph Bumiller
e548babb1f nv50: support more formats in surface_copy,fill
Fixes corrupted fonts in bzFlag, where we've been silently
failing to copy I8 mipmaps to a new miptree.

Print an error message on unsupported format now, since we
can't return failure.
2010-03-16 22:47:24 +01:00
Eric Anholt
5782b2a968 i965: Fix readpixels from ReadBuffer != DrawBuffer.
Fixes piglit fbo-readdrawpix.
2010-03-16 13:23:35 -07:00
Eric Anholt
a589da14de i965: Fix inversion for glCopyPixels to/from FBOs.
fixes piglit fbo-copypix.
2010-03-16 13:18:54 -07:00
Eric Anholt
800a4b202f intel: Remove more code for x8z24 visuals, since we only do s8z24. 2010-03-16 13:18:54 -07:00
Eric Anholt
25becb8a7a Revert "i965: Do VS SGT, SLT, and friends using CMP, SEL instead of CMP, MOV, MOV."
This reverts commit 8ef3b1834a.  Fixes
piglit glsl-vs-if.
2010-03-16 13:18:54 -07:00
Eric Anholt
ba208604ea Revert "i965: Do FS SLT, SGT, and friends using CMP, SEL instead of CMP, MOV, MOV."
This reverts commit 46450c1f3f.  I was
wrong about null reg behavior -- it reads undefined, not 0.  And
they're not kidding.
2010-03-16 13:18:54 -07:00
Eric Anholt
7cbb7051f4 meta: Fix up restoration of state if _mesa_map_pbo_source() fails. 2010-03-16 13:18:54 -07:00
Eric Anholt
541c9c08e5 meta: Properly refcount our saved programs and texobjs.
Found while debugging bug #24119.
2010-03-16 13:18:53 -07:00
Brian Paul
7c45710859 gallium: add target-helpers/wrap_screen.c to C_SOURCES
Was commented out before.
2010-03-16 13:31:46 -06:00
Michal Krol
40c3861e1e st/mesa: Invalidate sampler view when texture object changes. 2010-03-16 19:40:15 +01:00
Roland Scheidegger
ac8662c29d st/xorg: fix up xorg state tracker to use cso changes
use cso_set_fragment_sampler_views instead of cso_set_sampler_textures
2010-03-16 16:24:27 +01:00
Brian Paul
e1a4bb2370 regenerate gl_mangle.h to get new EGLImage functions 2010-03-16 07:56:56 -06:00
José Fonseca
759c1c287c libgl-xlib: Use a simple GALLIUM_DRIVER env var to select the pipe driver.
GALLIUM_DRIVER is being used in many other places, and it easier to
memorizing and understand than all the GALLIUM_NO_XXX.
2010-03-16 13:48:09 +00:00
José Fonseca
d731190ec3 gallium: Silence warning. 2010-03-16 13:46:10 +00:00
Roland Scheidegger
8f55a95178 gallium: change remaining util functions to use cso sampler views
changes arguments of util_blit_pixels_tex and util_gen_mipmap to
struct pipe_sampler_view * instead of struct pipe_texture *.
2010-03-16 11:25:12 +01:00
Michal Krol
e4b8a307b2 gallium/docs: Create a separate section for Sampler Views. 2010-03-16 10:58:33 +01:00
Keith Whitwell
8cdfd1219a Merge commit 'origin/master' into gallium-sampler-view
This branch already seems to have the nv50_tex.c fix.

Conflicts:
	src/gallium/drivers/nv50/nv50_tex.c
2010-03-16 09:02:38 +00:00
Chia-I Wu
e0ce4a4a09 i965g: Fix use of an uninitialized variable. 2010-03-16 15:51:17 +08:00
Chia-I Wu
9d3a873f42 Merge remote branch 'origin/gallium-st-api' 2010-03-16 15:12:46 +08:00
Ben Skeggs
95d43bccde nv50: fix texturing from >=4GiB mark 2010-03-16 13:18:39 +10:00
Jakob Bornecrantz
b586774016 llvmpipe: Fix rebase typo 2010-03-16 01:17:33 +00:00
Jakob Bornecrantz
8b63f9b497 winsys/sw: Add a software winsys layered on a pipe 2010-03-16 01:06:46 +00:00
Jakob Bornecrantz
eaee22ac88 i965g: Fix after context transfers 2010-03-16 01:06:46 +00:00
Brian Paul
cb1b0b4bec gallivm: checkpoint: stencil test code 2010-03-15 18:19:04 -06:00
Brian Paul
185be3a87a gallivm/llvmpipe: rename some constant building functions 2010-03-15 18:16:56 -06:00
Brian Paul
c86a499769 gallivm: fix up some #includes 2010-03-15 18:16:56 -06:00
Brian Paul
0d71ba46e6 gallivm/llvmpipe: rename os_llvm.h to lp_bld.h
The llvm wrapper wasn't really an OS thing.

Use lp_bld.h for now but we eventually should rename/re-prefix all the
files/functions in the gallivm/ directory.
2010-03-15 18:16:56 -06:00
Ian Romanick
e309a6051d Add multiple include protection to ir.h 2010-03-15 15:20:15 -07:00
Ian Romanick
5c2bd09888 Trivial clean-ups to ast_type_specifier(int) constructor 2010-03-15 14:31:48 -07:00
Ian Romanick
ed85a5dd4b Add new constructors for ast_type_specifier
Add a constructor that uses an ast_struct_specifier and one that uses
a type name.  This saves a (trivial) bit of code, but it also ensures
some of the class invariants (i.e., type_name != NULL) are met.
2010-03-15 14:28:17 -07:00
Ian Romanick
7f9d309743 Ensure that ast_type always has type_name set
For built-in types, type_name would be NULL.  This ensures that
type_name is set even for the built-in types.  This simplifies code in
a few places and centralizes the name setting code.
2010-03-15 14:18:32 -07:00
Ian Romanick
bbddcb3092 Factor ast_type_specifier code out to ast_type.cpp 2010-03-15 14:09:23 -07:00
José Fonseca
3eb4b7bbec libgl-xlib: Obey GALLIUM_SOFTPIPE define. 2010-03-15 21:04:58 +00:00
Dave Airlie
8e848d682e gallium: fix frontbuffer rendering with r300g
No idea if this is the correct fix, but it makes it work again at least.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-03-16 06:51:04 +10:00
Ian Romanick
f4749610ed Factor guts of function matching code out to match_function_by_name
This function will be used for matching some types of constructors as well.
2010-03-15 13:26:02 -07:00
Ian Romanick
548fa293a3 Move ast_function_expression::hir to ast_function.cpp 2010-03-15 13:04:13 -07:00
Ian Romanick
728330e3b2 Remove DOA hir_function.c file 2010-03-15 13:02:08 -07:00
Zack Rusin
275c4bd364 Merge remote branch 'origin/master' into gallium_draw_llvm 2010-03-15 15:24:38 -04:00
Brian Paul
d0b35352ed llvmpipe: updated status in README file 2010-03-15 11:46:41 -06:00
Brian Paul
aa3cdb712f progs/objviewer: remove debug code 2010-03-15 11:31:59 -06:00
Brian Paul
d25d3cc008 gallivm: fix typo/bug in lp_build_sgn()
We were never returning -1 as a result.  This fixes some inverted/flipped
faces with cube mapping.
2010-03-15 11:30:05 -06:00
Keith Whitwell
6420aca08b cso: Do not hold references to bound textures.
Sampler views already hold references to those.
2010-03-15 17:56:19 +01:00
Brian Paul
1d6d51413e gallivm: add min_lod==max_lod special-case code in lp_build_lod_selector()
When min_lod==max_lod we don't need to go through all the work of
computing the lod from partial derivatives.  This is hit by the mipmap
generation utility code.
2010-03-15 10:51:58 -06:00
Brian Paul
b9a81b626a gallivm: asst clean-ups, comments, etc. 2010-03-15 10:43:05 -06:00
Brian Paul
eecf9c85b0 gallivm: implement minification/magnification selection
Use the LOD value to determine whether to use the minification vs.
magnification filter.

All mipmap sampling modes work now.
2010-03-15 10:36:58 -06:00
Brian Paul
e0f7c3cbf0 gallivm: fix incorrect clamp in lp_build_linear_mip_levels() 2010-03-15 10:31:20 -06:00
Brian Paul
f9d753787e gallivm: fix incorrect floor(), itrunc()
LLVMBuildFPTrunc() should be used for double->float conversion, not
float->int conversion.

There should be a better way to compute floor(), ceil(), etc that doesn't
involve float->int->float conversion.
2010-03-15 10:29:10 -06:00
Michal Krol
3949388ca3 st/mesa: Fix a call to st_get_stobj_sampler_view(). 2010-03-15 15:04:12 +01:00
Michal Krol
6b60820fde st/mesa: Pass in correct sampler view object to blitter. 2010-03-15 15:03:44 +01:00
Michal Krol
df65fc8100 util: Fix nil pointer reference. 2010-03-15 14:42:44 +01:00
Luca Barbieri
50d96f741e nv40: remove leftover nv40_transfer.c from unification into nvfx 2010-03-15 08:47:03 -04:00
Michal Krol
f2bc089d14 gallium: util_blit_pixels() takes source sampler view as argument. 2010-03-15 13:22:40 +01:00
Michal Krol
dbf20a1f0f st/mesa: Cache FBO texture's sampler view object. 2010-03-15 13:22:40 +01:00
Chia-I Wu
a66d008104 st/mesa: Update the comments in st_manager.c. 2010-03-15 19:15:43 +08:00
Keith Whitwell
08189e6391 nvfx: fix up after merge 2010-03-15 10:27:25 +00:00
Keith Whitwell
506130fff5 r300g: fix up after merge 2010-03-15 10:24:55 +00:00
Keith Whitwell
42910ebe7b Merge commit 'origin/master' into gallium-sampler-view
Conflicts:
	src/gallium/drivers/nv30/nv30_context.h
	src/gallium/drivers/nv30/nv30_state.c
	src/gallium/drivers/nv40/nv40_context.h
	src/gallium/drivers/nv40/nv40_state.c
	src/gallium/drivers/r300/r300_emit.c
2010-03-15 09:44:52 +00:00
Dave Airlie
68e58a96e8 r300g: rebuild screen/winsys interface
This creates a cleaner winsys and drop the simple screen stuff.

It makes r300g use pb_bufmgr structs.

It also tries to avoid overheads from mapping too often.

v5: clean warnings

v6: break out of cache check on first buffer - since most likely
the first busy one implies all after it are busy.

v7: cleanup a bit

v8-merged: drop cman for now to just get all the interface changes in first.
rework to changes that happened upstream

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-03-15 18:36:47 +10:00
Ben Skeggs
a899c5a76e nv50: reset vbo_fifo before each validate 2010-03-15 16:53:46 +10:00
Luca Barbieri
9b3a908736 nvfx: remove src_native_swz, which was a no-op
src_native_swz was used to translate 0/1 swizzles back when Gallium
supported them.

That support was later removed from Gallium, and the function currently
always returns true.

Remove it.
2010-03-15 00:03:05 -04:00
Luca Barbieri
49f2a89956 nvfx: clean up shader header
Currently the behavior of shader.h depends on some constants that
are defined differently in vertex and fragment programs.

This patch cleans that up by splitting the relevant symbols in
vertex program and fragment program variants
2010-03-15 00:03:05 -04:00
Luca Barbieri
a174db480b nvfx: draw: make swtnl draw_elements actually work.
It was totally broken: the index buffer was passed as NULL!
2010-03-15 00:03:04 -04:00
Luca Barbieri
152dffd3e1 nvfx: draw: emit color as floating point
Don't lose precision by converting to u8.
2010-03-15 00:03:04 -04:00
Luca Barbieri
ac7ae8bc6a nvfx: draw: make perspective corrective texturing work
We must divide everything in the position by w, and emit position as
a 4-component vector.

Not sure why we must divide, but it works (see progs/redbook/checker).
2010-03-15 00:03:04 -04:00
Luca Barbieri
ad2d0c2639 nvfx: draw: create draw vp with ureg
This avoids duplicating the vertex program generation logic and
makes the same code work for both nv30 and nv40.
2010-03-15 00:03:04 -04:00
Luca Barbieri
d40a069206 nvfx: add NOUVEAU_SWTNL to force swtnl at runtime
Replace the FORCE_SWTNL macro with a NOUVEAU_SWTNL environment variable.
2010-03-15 00:03:04 -04:00
Luca Barbieri
dbe63ed3b6 nvfx: move nv04_surface_2d.c into nvfx directory
It is only used on pre-nv50 and nvfx is the only Gallium pre-nv50 driver.
2010-03-15 00:03:04 -04:00
Luca Barbieri
e1580ce4c9 nvfx: fix quads drawing
The primitive splitting code is totally broken and will be rewritten.

Fix the most important bug now though.
2010-03-15 00:03:04 -04:00
Luca Barbieri
0192a4a825 nvfx: fix viewport state after bypass removal for swtnl
The adjustment of nv30/nv40 after the removal of bypass incorrectly
removed the hardware viewport bypass code, which we still need for
swtnl and also forgot to remove NVFX_NEW_RAST from pipe.
2010-03-15 00:03:04 -04:00
Luca Barbieri
f9d09a2e78 nv30, nv40: move last files to nvfx/ and rm -rf nv30 nv40
This is the last nvfx unification patch.

nv[34]0_fragtex.c are moved to the common directory
nv[34]0_shader.h are renamed to nv[34]0_vertprog.h and moved to
the common directory

The separate nv30 and nv40 directories are removed from the build
system
2010-03-15 00:03:04 -04:00
Luca Barbieri
7d210fa05f nv30, nv40: partially non-trivially unify sampler state in nv[34]0_state.c
Many things, like texture wrap modes and min/mag filters are common.

Some others, like annisotropy and lod settings, are not.
2010-03-15 00:03:03 -04:00
Luca Barbieri
5bb68e5d17 nv30, nv40: partially non-trivially unify nv[34]0_fragtex.c
The bulk files cannot be unified, but the frontend can and allows to
share some code and simplify state_emit.c
2010-03-15 00:03:03 -04:00
Luca Barbieri
da5103c3b3 nv30, nv40: unify nv[34]0_context.c
They are now almost identical, except for nv30 vs nv40 fragtex
initialization.
2010-03-15 00:03:03 -04:00
Luca Barbieri
6992be5433 nv30, nv40: fully unify nv[34]0_context.h
Move the remaining content to the common header.
2010-03-15 00:03:03 -04:00
Luca Barbieri
10f464fc10 nv30, nv40: non-trivially unify nv[34]0_screen.c
The files have the same structure but are substantially different.

They are unified with appropriate conditionals.
2010-03-15 00:03:03 -04:00
Luca Barbieri
840c36f5e6 nv30, nv40: non-trivially unify nv[34]0_vertprog.c
vertprog.c is similar but has substantial differences:
1. nv40 supports clip planes
2. nv40 uses a more advanced register allocator
3. Some register setup is different
4. Constants with the same name have different values

This patch unifies the two files.
nv30 gains clip plane support and the nv40 register allocator.

A new NVFX_VP(x) macro is introduced that at runtime resolved to
either the nv30 or the nv40 constant value.

nv30 clip planes are not tested and might not work
2010-03-15 00:03:03 -04:00
Luca Barbieri
c65a8f3ed2 nv30, nv40: partially unify nv[34]0_state.c
state.c is identical except for:
1. Sampler state creation is different
2. nv40 swtnl support
3. Separate blend equations on nv40

This patch unifies nv[34]0_state.c, except the sampler state creation code.
2010-03-15 00:03:03 -04:00
Luca Barbieri
6e1d0fc5eb nv30, nv40: unify nv[34]0_vbo.c
The files are identical, except for swtnl support which is commented
out on nv30 and restart being initialized on nv30 to avoid a compiler
warning.
2010-03-15 00:03:03 -04:00
Luca Barbieri
f9eafeca29 nv30, nv40: non-trivially unify nv[34]0_draw.c
nv30_draw.c is a stub.

This patch makes both nv30 and nv40 use the nv40 swtnl path.

Note that this doesn't actually work on nv30 because the vertex program is
encoded in the nv40-only layout.

However, swtnl was unimplemented before on nv30, so this is not a regression.
Furthermore, a patch to fix this is available near the end of the patchset.
2010-03-15 00:03:03 -04:00
Luca Barbieri
bcb37411fc nv30, nv40: non-trivially unify nv[34]0_fragprog.c
The files are mostly the same except:
1. On NV40, some TGSI instructions are emulated with several hardware ones
2. Some instructions such as DDX/DDY, and STR were missing from nv30
3. NV40 has more sophisticated register management

nv30 now supports all instructions and uses the nv40 register management.
2010-03-15 00:03:02 -04:00
Luca Barbieri
d9e396ce4a nv30, nv40: non-trivially partially unify nv[34]0_shader.h
shader.h is similar, except for the following differences:
1. The instruction sets are not exactly the same, but mostly similar
2. Vertex program fields are in different bit positions

This patch unifies all parts of nv[34]0_shader.h except the vertex
program fields.

Vertex opcodes are also changed so that the constant names includes
SCA if it is a scalar opcode and VEC if it is a vector opcode.
2010-03-15 00:03:02 -04:00
Luca Barbieri
cd0d03adab nv30, nv40: non-trivially unify nv[34]0_state_fb.c
The files are significantly different due to:
1. nv30 support 2 render targets, nv40 4
2. z-buffer pitch is set differently
3. nv30 has a limitation of colour_bits >= zeta_bits. This may not
   actually exist in the driver though
4. nv30 points color0 at depth in the depth-only case
5. nv30 sets NV34TCL_VIEWPORT_TX_ORIGIN to 0. This is probably
   unnecessary

This patch attempts to unify the two files and preserve the existing
behavior.
2010-03-15 00:03:02 -04:00
Luca Barbieri
4d93ef1a01 nv30, nv40: unify nv[34]0_state_viewport.c
The files are identical, except for an extra comment in nv30.
2010-03-15 00:03:02 -04:00
Luca Barbieri
9937116c7b nv30, nv40: unify nv[34]0_query.c
The files are identical except formatting.
2010-03-15 00:03:02 -04:00
Luca Barbieri
8611a31bb4 nv30, nv40: unify nv[34]0_miptree.c
The only difference between nv30 and nv40 is that nv30 allowed swizzling
for more texture types.

This patch preserves the existing behavior, using conditional code.

Note however that this does not make sense, since all texture types can
be swizzled on nv40 and probably on nv30 too.

However, the handling of swizzled surfaces in the current 2D code is
partially broken, so it's best not to touch this.

A whole rewrite of the 2D code will be submitted, which will solve this
problem.
2010-03-15 00:03:02 -04:00
Luca Barbieri
e392e0b148 nv30, nv40: unify nv[34]0_state_stipple.c
The files are identical, except for the fact that the nv40 version
forgets to unreference the stateobj.

Unified to the correct nv30 version.
2010-03-15 00:03:02 -04:00
Luca Barbieri
64d882637d nv30, nv40: unify identical nv[34]0_state_zsa.c 2010-03-15 00:03:02 -04:00
Luca Barbieri
938c6905cf nv30, nv40: unify identical nv[34]0_state_scissor.c 2010-03-15 00:03:02 -04:00
Luca Barbieri
ada801222b nv30, nv40: unify identical nv[34]0_state_rasterizer.c 2010-03-15 00:03:01 -04:00
Luca Barbieri
0b55e1cd17 nv30, nv40: unify identical nv[34]0_state_blend.c 2010-03-15 00:03:01 -04:00
Luca Barbieri
778c64da97 nv30, nv40: non-trivially unify nv[34]0_state_emit.c
The files are the same except for swtnl support on nv40 and for
texture cache flushing on nv40.

Unify them, and use a macro to define 4 versions of render_states,
for all combinations of nvfx and hwtnl/swtnl.
2010-03-15 00:03:01 -04:00
Luca Barbieri
d084d189d0 nv30, nv40: unify identical nv[34]0_transfer.c 2010-03-15 00:03:01 -04:00
Luca Barbieri
c5c7b69bda nv30, nv40: unify identical nv[34]0_clear.c 2010-03-15 00:03:01 -04:00
Luca Barbieri
6321a18331 nvfx: add nvfx directory to build system
Will be used to hold source files unified between nv30 and nv40.

Eventually all nv30 and nv40 code will be moved there and the
nv30 and nv40 directories will be removed.
2010-03-15 00:03:01 -04:00
Luca Barbieri
6518a1c853 nv30, nv40: add is_nv4x member to context and screen structs
This will make it faster to check for nv40.
2010-03-15 00:03:01 -04:00
Luca Barbieri
b8e56d4cdd nv30, nv40: unify all structures and headers, except shaders
This patch unifies nv[34]0_screen.h, nv[34]0_context.h and
nv[34]0_state.h

The unified files are put in a new "nvfx" directory.

nv30_context.h and nv40_context.h still exist to hold the function
prototypes and include nvfx_context.h

nv[34]0_screen.h and nv[34]0_state.h are deleted, replaced by the
unified versions.

nv40 includes some extra fields for swtnl and user clip planes
support.

These fields will be unused on nv30 until that functionality gets
added to it too (by unification with nv40).
2010-03-15 00:03:01 -04:00
Luca Barbieri
d673c92810 nouveau: s/rankine/eng3d/g; s/curie/eng3d/g
Result of running:
perl -i -p -e 's/rankine/eng3d/g; s/curie/eng3d/g;' nv[34]0/*.[ch]

This will allow to more easily unify nv30 and nv40.
2010-03-15 00:03:01 -04:00
Luca Barbieri
1771d8f8f4 nv30: remove unused on_hw field and constant fp_reg_control field
This makes nv30_state.h equivalent to nv40_state.h
2010-03-15 00:03:00 -04:00
Luca Barbieri
5f71414fc9 nv40: use NV34TCL_ constants where available
It was decided to just use the NV34TCL_ constants for constants
common between nv30 and nv40, and deprecate the NV40TCL_ versions.

This patch changes the nv40 driver to use NV34TCL_ constants for
common functionality.

This reduces differences between nv30 and nv40 to ease further
unification.
2010-03-15 00:03:00 -04:00
Vinson Lee
883aa5974b r300g: Remove unnecessary headers. 2010-03-14 16:43:01 -07:00
George Sapountzis
631a1a9ac8 dri/common: mv __driUtilMessage to utils.c
allows to link with xmlconfig without dri_util, and has nothing drm-specific.
2010-03-15 01:17:18 +02:00
George Sapountzis
7a62c60ca9 dri/swrast: add comment in case it's not clear 2010-03-15 01:17:18 +02:00
George Sapountzis
e557c2e14f dri/swrast: drop mtypes.h from dri_sw 2010-03-15 01:17:18 +02:00
George Sapountzis
e60693efda dri/swrast: update copyright email 2010-03-15 01:17:17 +02:00
George Sapountzis
c1bde79359 dri/swrast: port to dri_sw (drawable) 2010-03-15 01:17:17 +02:00
George Sapountzis
cf8a1caa23 dri/swrast: port to dri_sw (context) 2010-03-15 01:17:17 +02:00
George Sapountzis
6e376485c1 dri/swrast: port to dri_sw 2010-03-15 01:17:17 +02:00
George Sapountzis
06ebc46e65 dri: add dri_sw.c helper
This is dri_util.c stripped from the drm-specific bits and will be used for
both classic and gallium swrast_dri.so
2010-03-15 01:17:16 +02:00
Vinson Lee
725d77a6b5 trace: Remove unnecessary headers. 2010-03-14 15:47:05 -07:00
Vinson Lee
08cddfe291 svga: Remove unnecessary header. 2010-03-14 15:38:04 -07:00
George Sapountzis
41eab95b3b glapi: exec_malloc for dispatch stubs 2010-03-14 22:24:27 +02:00
George Sapountzis
8fd7ee1815 glapi: this one should be by THREAD 2010-03-14 22:24:26 +02:00
George Sapountzis
9a649c8eaa glapi: more organize code by arch
It seems that x86-64 with tls will fail to compile or load due to a missining
gl_dispatch_functions_start symbol. Not changing though, since this is how it
used to be and cannot test.
2010-03-14 22:24:25 +02:00
George Sapountzis
0ed0114de9 glapi: organize arch-specific code by arch (2) 2010-03-14 22:24:25 +02:00
George Sapountzis
6c8e5151f1 glapi: organize arch-specific code by arch 2010-03-14 22:24:24 +02:00
Marek Olšák
6e4b05637f r300g: remove pipe_context from r300_screen 2010-03-14 14:40:38 +01:00
Chia-I Wu
23e9a25e1f st/glx: Fix glXCopySubBufferMESA.
Honor the (x, y) and (width, height) pairs.
2010-03-14 14:59:55 +08:00
Chia-I Wu
d6262bdcfb st/glx: Sync the back buffer to the front buffer.
Consider this rendering sequence

  * render to the back buffer
  * swap buffers
  * read from the front buffer

The front buffer is expected to have the contents of the back buffer.
2010-03-14 13:16:24 +08:00
Chia-I Wu
48bc3cca89 st/glx: Add support for GLX_MESA_copy_sub_buffer.
Create a per-display pipe_context as needed to copy the contents between
framebuffer attachments.  This allows us to support
GLX_MESA_copy_sub_buffer.
2010-03-14 13:16:21 +08:00
Chia-I Wu
6632915e95 st/glx: Add xmesa_display to hold per-display variables.
This basically adds a static xmesa_display to collect per-display static
variables in xm_api.c.  Multiple display support is still missing, but
this is a step forward.
2010-03-14 11:27:53 +08:00
Chia-I Wu
4a30330b26 st/mesa: Fix handling of FBO.
FBOs are created by st_new_framebuffer and cannot be casted to
st_framebuffer.
2010-03-14 10:23:51 +08:00
Vinson Lee
2615bba182 softpipe: Remove unnecessary header. 2010-03-13 18:05:39 -08:00
Dan Nicholson
de4ee20578 gallium: Respect user's CFLAGS for including X headers
This can break on systems that don't have a system X installation.

Signed-off-by: Dan Nicholson <dbn.lists@gmail.com>
2010-03-13 11:56:59 -08:00
Jeff Smith
8d86d395dc Use X_LIBS from pkg-config, instead of libdir, for locating libX11
Signed-off-by: Jeff Smith <whydoubt@yahoo.com>
Signed-off-by: Dan Nicholson <dbn.lists@gmail.com>
2010-03-13 11:42:24 -08:00
José Fonseca
392d37609d llvmpipe: Switch to PIPE_TEX_MIPFILTER_NONE when texture has no mipmaps. 2010-03-13 19:11:33 +00:00
Marek Olšák
3996e49369 r300g: add high quality anisotropic filtering for R5xx (disabled by default)
Oh look, an undocumented feature. It's a nice tool for benchmarking
texturing.
2010-03-13 18:23:27 +01:00
Marek Olšák
d5749fb6fc r300g: fix anisotropic filtering, fix macrotiling
Two bug fixes at the same time. :)
2010-03-13 18:23:27 +01:00
Marek Olšák
bcec6d851c r300g: refrain from using immediate mode if it causes slowdown
E.g. when mapping buffers could flush CS or cause waiting
for a busy buffer.

The side effect of this is it also fixes progs/demos/arbocclude however
a separate fix should be proposed to address this issue in other cases
it might occur.
2010-03-13 18:23:27 +01:00
Marek Olšák
e31bca139f r300g: fix up function names 2010-03-13 18:23:26 +01:00
Maciej Cencora
abc847c20d radeon: add some debuging info for glCopyTex(Sub)Image 2010-03-13 17:33:48 +01:00
Maciej Cencora
18ecf41835 r300: blits for small dst pitch work just fine 2010-03-13 17:30:19 +01:00
Maciej Cencora
aba40bd434 radeon: fix gl format to mesa format mapping and add GL_BGRA formats 2010-03-13 17:30:19 +01:00
Maciej Cencora
1a8a230a61 radeon: fix glCopyTex(Sub)Image
Fallback to swrast for software renderbuffers
2010-03-13 17:30:19 +01:00
José Fonseca
bf40c34663 llvmpipe: Ensure the context is flushed before modifying textures. 2010-03-13 16:13:26 +00:00
José Fonseca
3abc7b985c llvmpipe: Don't use texture transfer internally.
Now that transfers are context objects their sideeffects must happen in
order when used by the state tracker, but that synchronization must be
bypassed when used inside the driver, or it would cause infinite
recursion.
2010-03-13 16:04:06 +00:00
Keith Whitwell
47bfbd452c Merge commit 'origin/master' into gallium-sampler-view
Conflicts:
	src/gallium/auxiliary/util/u_tile.c
	src/gallium/auxiliary/util/u_tile.h
	src/gallium/drivers/identity/id_context.c
	src/gallium/drivers/llvmpipe/lp_setup.c
	src/gallium/drivers/llvmpipe/lp_setup.h
	src/gallium/drivers/softpipe/sp_tex_tile_cache.c
	src/gallium/include/pipe/p_context.h
	src/mesa/state_tracker/st_cb_bitmap.c
	src/mesa/state_tracker/st_cb_drawpixels.c
2010-03-13 15:06:35 +00:00
Chia-I Wu
8c210c1b3b st/mesa: Validate the state in st_readpixels.
The front renderbuffer of a framebuffer is usually added as needed when
glReadBuffer(GL_FRONT) is called.  When the call is followed by
glReadPixels, we should validate the state before reading from the
renderbuffer.
2010-03-13 20:34:45 +08:00
José Fonseca
a80e33f407 llvmpipe: Obey rasterization rules.
Replicates softpipe.
2010-03-13 11:23:52 +00:00
José Fonseca
3160cbabcc llvmpipe: setup_context -> lp_setup_context
Otherwise IDEs and debuggers have trouble distinguishing from softpipe's
setup_context.
2010-03-13 11:23:52 +00:00
Xavier Chantry
83fe7149ea nv50: fixup after gallium-context-transfers merge 2010-03-13 11:33:27 +01:00
José Fonseca
50a7786619 python: Temporarily disable python state tracker until transfers are done by contexts
It requires changes not ony to the state tracker but to the python
scripts too.
2010-03-13 10:26:28 +00:00
Chia-I Wu
66cd38f465 st/glx: Fix framebuffer validation.
When xmesa_st_framebuffer_validate was called twice with different sets
of attachments, the second call was ignored.  Add a texture_mask to
remember which textures have been requested to make sure the missing
ones get created.
2010-03-13 17:41:45 +08:00
Chia-I Wu
418b9ac299 st/glx: Correctly set buffer_mask of a visual.
Stupid typos again..
2010-03-13 17:40:05 +08:00
Chia-I Wu
f91d8c6885 st/mesa: Set revalidate in st_framebuffer_update_attachments.
There are two conditions that a validation is required.  One is when the
the framebuffer becomes invalid.  The other is when we request for
textures that we did not request before.
2010-03-13 17:01:27 +08:00
Chia-I Wu
813c58d77e st/glx: Make xmesa_create_st_api a callback of xm_driver.
Instead of guessing the API in st/glx, let the target decide how to
create st_api.
2010-03-13 16:05:09 +08:00
Chia-I Wu
fecb97aab4 st/egl: Fix eglCopyBuffers.
Use a (real) pipe context to copy between pipe surfaces.  Fix a NULL
dereference of the temporary native surface created for copying.
2010-03-13 15:14:56 +08:00
Chia-I Wu
495bfb0ad2 st/glx: Fix leaks in xmesa_st_framebuffer.
The textures and surface of a framebuffer should be unreferenced when
the framebuffer is destroyed.
2010-03-13 13:06:00 +08:00
Chia-I Wu
9222c09349 st/egl: Cache the pipe surface used in flush_frontbuffer.
It is very likely that the same surface will be flushed again and again.
Caching the surface should reduce the overhead of surface creation.
2010-03-13 13:05:21 +08:00
Alan Coopersmith
5d66fc6e3a mklib: Fix amd64 builds on Solaris when using Sun compilers
Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
2010-03-12 19:04:19 -08:00
Corbin Simpson
2764a5191f r300g: Forcibly sanitize max index.
Not perfect, but the kernel should shut up now.
2010-03-12 18:13:18 -08:00
Corbin Simpson
ecfcb1466a Revert "st/mesa: Always recalculate invalid index bounds."
This reverts commit 50876ddaaf.

Per ML discussion.
2010-03-12 17:58:59 -08:00
Brian Paul
3c80e52541 gallivm: cube map sampling works now 2010-03-12 16:55:28 -07:00
Brian Paul
e910c0ba9e gallivm: fix bugs in nested if/then/else codegen
Quite a bit a hair pulling was involved...
2010-03-12 16:55:28 -07:00
Brian Paul
a6196ce8be gallivm: support non-vector float in lp_build_sgn() 2010-03-12 16:55:28 -07:00
Eric Anholt
f1d6baee0b i965: Clarify the roles of emit_pixel_xy(), emit_delta_xy(), emit_wpos_xy(). 2010-03-12 15:12:02 -08:00
Eric Anholt
f4f2737e87 i965: Clarify that DELTAXY always occurs for both X and Y. 2010-03-12 15:12:02 -08:00
Eric Anholt
46450c1f3f i965: Do FS SLT, SGT, and friends using CMP, SEL instead of CMP, MOV, MOV. 2010-03-12 15:12:01 -08:00
Eric Anholt
8ef3b1834a i965: Do VS SGT, SLT, and friends using CMP, SEL instead of CMP, MOV, MOV. 2010-03-12 15:12:01 -08:00
Eric Anholt
512d8ca2f3 i965: Fix up VS DP4 sequences to avoid dependency control.
This is recommended by the B-Spec.  I wasn't able to measure any
difference in ETQW.
2010-03-12 15:12:01 -08:00
Eric Anholt
52cea5090c i965: When doing a swizzled kill pixel, don't do redundant channel compares.
This was obvious when looking at the compiled output of ETQW's
shaders.
2010-03-12 15:12:01 -08:00
Eric Anholt
ba541b0769 i965: Use the SEL instruction to implement MIN and MAX.
Saves an instruction over doing conditional moves.
2010-03-12 15:12:01 -08:00
Michel Dänzer
13a13fcb80 svga: Fix up for context transfers. 2010-03-12 19:52:24 +01:00
Michel Dänzer
59d6f3eb4a st/xorg: Remove flushes no longer necessary thanks to context transfers. 2010-03-12 19:52:24 +01:00
Alan Coopersmith
57c378a531 glx/single2.c: Don't call __builtin_expect on non-gnu compilers
Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
2010-03-12 10:28:13 -08:00
Michel Dänzer
b13e305ee1 Merge branch '7.8' 2010-03-12 19:00:47 +01:00
Alex Deucher
d1ca1599f0 r100/r200/r300/r300: only enable accelerated pixel ops with kms
fixes fdo bug 27043
2010-03-12 11:19:36 -05:00
Michal Krol
faa1481885 cso: Remove set/save/restore_vertex_sampler_textures(). 2010-03-12 14:43:11 +01:00
Michal Krol
b8030c6561 st/mesa: Associate a sampler view with an st texture object.
Lazily create a sampler view when the texture is being bound
for the first time.
2010-03-12 14:38:23 +01:00
Michal Krol
08f89988c8 cso: Add entry points for vertex/fragment sampler views. 2010-03-12 14:38:23 +01:00
Keith Whitwell
475ab3b5af st/xorg: context transfers 2010-03-12 12:15:09 +00:00
Marek Olšák
c16d04bd29 gallium: fix BGRA vertex color swizzles
The mapping for vertex_array_bgra:
(gl -> st -> translate)
GL_RGBA -> PIPE_FORMAT_R8G8B8A8 (RGBA) -> no swizzle (XYZW)
GL_BGRA -> PIPE_FORMAT_A8R8G8B8 (ARGB) -> ZYXW (BGRA again??)

Iẗ́'s pretty clear that PIPE_FORMAT_A8R8G8B8 here is wrong. This commit
fixes the pipe format and removes obvious workarounds in util/translate.

Tested with: softpipe, llvmpipe, r300g.

Signed-off-by: José Fonseca <jfonseca@vmware.com>
2010-03-12 12:00:27 +00:00
Corbin Simpson
50876ddaaf st/mesa: Always recalculate invalid index bounds.
These should always be sanitized before heading towards the pipe driver,
and if the calling function explicitly marked them as invalid, we need
to regenerate them.

Allows r300g to properly pass a bit more of Wine's d3d9 testing without
dropping stuff on the floor.
2010-03-12 02:54:10 -08:00
Corbin Simpson
a48e17ccb0 st/mesa: Update debug infos.
Still commented out, of course.
2010-03-12 02:54:10 -08:00
Corbin Simpson
e42b2f7685 r300g: Properly clamp index limits.
Make the kernel even less likely to barf on us.
2010-03-12 02:54:10 -08:00
Keith Whitwell
915b3529b9 Merge commit 'origin/gallium-context-transfers-2' 2010-03-12 09:08:40 +00:00
Keith Whitwell
51bff09f72 mesa: fix linux-dri and autogen builds since sw-api-2 merge 2010-03-12 09:05:59 +00:00
Chia-I Wu
9dae0e0ff8 st/glx: Add xm_st.c to SConscript. 2010-03-12 13:26:18 +08:00
Vinson Lee
e4d10dada0 llvmpipe: Remove unnecessary header. 2010-03-11 20:52:38 -08:00
Chia-I Wu
543a29f1a1 st/mesa: Check the format before adding depth/stencil buffers.
The format might have depth bits, stencil bits, or both.  Add the
renderbuffers as needed.
2010-03-12 11:30:46 +08:00
Chia-I Wu
3475e88442 st/glx: Return a better format in choose_depth_stencil_format.
Return a better format instead of an exact format in
choose_depth_stencil_format.  Also, prefer formats with stencil bits.
2010-03-12 11:20:57 +08:00
Chia-I Wu
72ed7eb15a st/glx: Fix an infinite recursion in flush_front.
It was a stupid typo by me when I refactored the code.
2010-03-12 10:05:39 +08:00
Chia-I Wu
576d9af505 st/glx: Use st_api.h instead of st_public.h. 2010-03-12 09:57:11 +08:00
Chia-I Wu
a924dd18c3 st/egl: Use st_api.h instead of st_public.h.
Switch from st_public.h to st_api.h.  The latter has intrinsic multiple
APIs support and allows various EGLImage extensions to be supported.
2010-03-12 09:57:07 +08:00
Chia-I Wu
3a3a31bf88 winsys/xlib, st/es: Advertise st_api.h support.
This is done by defining one of st_module_OpenGL_ES1,
st_module_OpenGL_ES2, and st_module_OpenGL.
2010-03-12 09:57:07 +08:00
Chia-I Wu
de8a879f5c st/mesa: Implement st_api.h.
There is currently no user of this new interface.  As the inteface can
coexist with st_public.h, everthing should work as before.

ST_TEXTURE_2D is both defined by st_public.h and st_api.h.  Reorder the
headers in st/dri to avoid conflicts.
2010-03-12 09:57:07 +08:00
Chia-I Wu
8bcd616a3f st/vega: Implement st_api.h.
There is currently no user of this new interface.  As the inteface can
coexist with st_public.h, everthing should work as before.
2010-03-12 09:57:03 +08:00
Chia-I Wu
d2083056d5 gallium: Add st_api.h.
This is a new interface to be implemented by st/mesa, st/vesa, and the
window system APIs such as EGL or GLX.
2010-03-12 09:49:55 +08:00
Ian Romanick
f13d4295f9 Change type of function_identifier to silence bison warning
When the implementation of function_call_header and
function_identifier were changed a few commits ago, the types of the
production changed.  This just updates the types specified for the
productions to match reality.
2010-03-11 16:12:25 -08:00
Ian Romanick
44eb13d0b5 Add parameters to function declarations in the correct order 2010-03-11 16:11:07 -08:00
Brian Paul
e574b79485 gallivm: checkpoint WIP cubemap code 2010-03-11 16:26:52 -07:00
Brian Paul
0b3bb6318e gallivm: added lp_build_sum_vector() 2010-03-11 16:26:12 -07:00
Brian Paul
c72a3b4f2f softpipe: further tighen up sample_cube()
The code can fairly easily be translated to llvm...
2010-03-11 16:23:37 -07:00
Ian Romanick
471471f834 Initial pass at resolving function calls
The code is still really rough and *REALLY* incomplete.  This at least
passes the first few trivially simple test cases.
2010-03-11 14:57:26 -08:00
Ian Romanick
cdb8d54b68 Default function parameters to 'in' instead of auto 2010-03-11 14:48:51 -08:00
Ian Romanick
7e3ed40200 Add a handful of simple tests for function calls in constructors 2010-03-11 14:46:19 -08:00
Brian Paul
9ffdc78d1a softpipe: tighten up the code in sample_cube() 2010-03-11 15:37:35 -07:00
Ian Romanick
ed45ec6a51 Add ir_call call to represent function calls. 2010-03-11 14:35:37 -08:00
Ian Romanick
d27ec2461b Fix broken constructor of ir_instruction base class
Make the constructor inline-able, and don't try to initialize it as a
simple_node.  It hasn't been derived from simple_node in a long time.
2010-03-11 14:23:41 -08:00
Ian Romanick
1f58518059 Track generation of errors and halt compilation appropriately 2010-03-11 14:08:33 -08:00
Brian Paul
26ae4aab6a gallivm: enable 3D texture sampling 2010-03-11 14:49:01 -07:00
Brian Paul
e9f654d2fb progs/demos: added 'f' key to toggle filtering mode in stex3d.c 2010-03-11 14:49:01 -07:00
Brian Paul
53efb634a0 gallivm/llvmpipe: replace 'int stride' with 'int row_stride[MAX_LEVELS]'
The stride depends on the mipmap level.  Rename to row_stride to
distinguish from img_stride for 3D textures.

Fixes incorrect texel addressing in small mipmap levels.
2010-03-11 14:49:01 -07:00
Brian Paul
272f399434 llvmpipe: fix comment typo 2010-03-11 14:49:00 -07:00
Brian Paul
489af2a3ba gallivm/llvmpipe: include os_llvm.h instead of llvm-c/Core.h 2010-03-11 14:49:00 -07:00
Brian Paul
4833b0f199 gallium/os: wrapper for llvm-c/Core.h and #define HAVE_LLVM if needed 2010-03-11 14:49:00 -07:00
Alex Deucher
644a05c6cb r200: support additional blit formats
swizzle in the pixel shader
2010-03-11 13:49:57 -05:00
Brian Paul
d645119098 gallivm: fix some bugs on the 1D texture paths 2010-03-11 11:17:37 -07:00
Roland Scheidegger
ed1c69710c st/mesa: don't enable extensions which aren't actually supported
don't enable APPLE_client_storage, TDFX_texture_compression_FXT1,
EXT_cull_vertex, NV_vertex_program, NV_vertex_program1_1 -
the latter two might work somewhat with some luck.
Also don't enable ARB_imaging.
2010-03-11 18:54:14 +01:00
Roland Scheidegger
dfeab49a96 cell: adapt to context texture transfers (untested) 2010-03-11 18:40:25 +01:00
Christoph Bumiller
a671a9eed0 nv50: take format from sampler view, not the referenced texture 2010-03-11 17:31:51 +01:00
Christoph Bumiller
9e9839bd04 nv50: put correct value into the TIC MAX_LEVEL field 2010-03-11 17:31:49 +01:00
Christoph Bumiller
4da5d369fb nv50: fix damage from merging master into sampler-view
Fixed the state array sizes at 3 (instead of PIPE_SHADER_TYPES)
because we'll never have domain and hull shaders on nv50; also
the numbering doesn't correspond to the hw numbering.
2010-03-11 17:27:12 +01:00
Keith Whitwell
d35ecca5ee gallium: remove pipe_context member from pipe_transfer
There was very little use for this beyond permitting the
pipe_context::tex_transfer_destroy() function to omit the pipe_context
argument.

This change adds the pipe_context argument into tex_transfer_destroy()
so that it looks like other pipe_context functions, and removes the
pipe_context pointer from pipe_transfer.
2010-03-11 16:18:50 +00:00
Karl Schultz
560d375006 windows: Add new file to project file. 2010-03-11 09:17:30 -07:00
Brian Paul
2410125d07 gallivm: include tgsi_dump.h to silence warning 2010-03-11 08:52:03 -07:00
Brian Paul
7b42379b71 gallivm: move declarations to silence unused var warnings 2010-03-11 08:51:44 -07:00
Brian Paul
0c92dfe7f3 gallium/util: use memset() to initialize vars to avoid warnings 2010-03-11 08:51:18 -07:00
Brian Paul
25ba04c891 svga: use memset() to initialize u to avoid warnings 2010-03-11 08:50:39 -07:00
José Fonseca
e24e5324ed gallivm: Use bitmasks for scalar masks.
We could use single 1 bit conditions for scalar masks, but a lot of code
expects masks. The compiler easily optimzes away masks
extensions/truncations so consistency is preferable.

We can revisit this when LLVM backends have more support for vector
conditions.
2010-03-11 15:42:41 +00:00
José Fonseca
99f11f6530 gallivm: Handle scalar types in lp_build_*_type. 2010-03-11 15:42:41 +00:00
Chia-I Wu
021cdd698b mesa/es: Validate the state in st_DrawTex.
Without the validation, the function might draw with outdated textures.
2010-03-11 23:31:18 +08:00
Chia-I Wu
9f5de23d0a mesa/es: Fix GL_OES_draw_texture support.
st_DrawTex calls util_draw_vertex_buffer.  Since
ac4abaecd5, the caller is expected to set
vertex elements before calling.
2010-03-11 23:31:11 +08:00
Keith Whitwell
b43c182f19 Squashed commit of gallium-context-transfers:
commit 7a2ee04629681e59ea147b440856c4f9a33ae9f8
Author: Keith Whitwell <keithw@vmware.com>
Date:   Thu Mar 11 14:19:17 2010 +0000

    nv: convert to context transfers

commit 188a3f5331c8e5966729fd59d02975afb7324adc
Author: Keith Whitwell <keithw@vmware.com>
Date:   Thu Mar 11 14:11:10 2010 +0000

    nouveau: remove unused variable

commit 5c8e880ab4dc020358c08728b8adb1637d2dc5bc
Author: Keith Whitwell <keithw@vmware.com>
Date:   Thu Mar 11 12:31:21 2010 +0000

    mesa/st: fix compilation after merge

commit c552595333f860c2a4807e195596acdf5d6a5ef8
Author: Keith Whitwell <keithw@vmware.com>
Date:   Thu Mar 11 12:31:06 2010 +0000

    util: fix compilation after merge

commit e80836878a3617b0e350d2a8f92311832a1476cb
Author: Keith Whitwell <keithw@vmware.com>
Date:   Thu Mar 11 12:30:47 2010 +0000

    r300g: fix compilation after merge

commit 0e4883e9511b9db4e75a4dbc78d7bb970badc15d
Author: Keith Whitwell <keithw@vmware.com>
Date:   Thu Mar 11 12:18:45 2010 +0000

    i965g: fix incorrect merge

commit 17d74133d8168eebf93bf1390de79930fc8da231
Merge: cb81c79 aa311ae
Author: Keith Whitwell <keithw@vmware.com>
Date:   Thu Mar 11 12:08:32 2010 +0000

    Merge commit 'origin/master' into gallium-context-transfers

    Conflicts:
    	src/gallium/drivers/i965/brw_screen_texture.c
    	src/gallium/drivers/r300/r300_screen.c
    	src/gallium/drivers/softpipe/sp_texture.c
    	src/gallium/drivers/svga/svga_screen_texture.c
    	src/gallium/state_trackers/egl/x11/native_ximage.c

commit cb81c79098bc3a92a4d2a3dcc0edc972dfb407be
Author: Keith Whitwell <keithw@vmware.com>
Date:   Tue Mar 2 16:04:01 2010 +0000

    egl/x11: hack for context transfers

    There is a better approach to this in the winsys-handle branch, but
    for now avoid using transfers at all by always allocating our own
    backing store directly.

commit f44a24e1d4ad7563f3eedd6b3a5688f53a36265c
Author: Keith Whitwell <keithw@vmware.com>
Date:   Tue Mar 2 16:03:16 2010 +0000

    llvmpipe: context transfers

commit 4d7475ef8104b3b478c7c6ce77cd3506c57e25d1
Author: Keith Whitwell <keithw@vmware.com>
Date:   Tue Mar 2 16:02:50 2010 +0000

    llvmpipe: disable testprogs build

    Not working.

commit a9bf98c4d36bd92a76f81e83747eb9b8f0a0515f
Merge: ee0f97e 0c616da
Author: Keith Whitwell <keithw@vmware.com>
Date:   Tue Mar 2 15:28:25 2010 +0000

    Merge commit 'origin/master' into gallium-context-transfers

    Conflicts:
    	src/mesa/state_tracker/st_cb_accum.c
    	src/mesa/state_tracker/st_cb_bitmap.c

commit ee0f97e8d9fd5ef57211a8e1268f505c9829e246
Merge: a7f078e 828f545
Author: Keith Whitwell <keithw@vmware.com>
Date:   Fri Feb 19 13:00:29 2010 +0000

    Merge commit 'origin/master' into gallium-context-transfers

    Conflicts:
    	src/gallium/auxiliary/util/u_debug.h
    	src/gallium/drivers/i915/i915_context.h
    	src/gallium/drivers/llvmpipe/lp_flush.c
    	src/gallium/drivers/nv30/nv30_screen.h
    	src/gallium/drivers/nv40/nv40_context.h
    	src/gallium/drivers/nv40/nv40_screen.h
    	src/gallium/drivers/nv50/nv50_context.h
    	src/gallium/drivers/r300/r300_screen.c
    	src/gallium/drivers/r300/r300_winsys.h
    	src/gallium/drivers/softpipe/sp_context.c
    	src/gallium/drivers/trace/tr_context.c
    	src/gallium/state_trackers/dri/dri_context.c
    	src/gallium/state_trackers/egl/common/egl_g3d.c
    	src/gallium/state_trackers/python/st_device.c
    	src/gallium/winsys/drm/radeon/core/radeon_drm.c

commit a7f078e16d851b53ef316066dcced46eb39ebe24
Author: Keith Whitwell <keithw@vmware.com>
Date:   Fri Feb 5 14:16:11 2010 +0000

    gallium: move texture transfers to pipe_context

commit 7b2ffc2019d72e833afea7eebf3e80121187375d
Merge: 51e190e c036d13
Author: Keith Whitwell <keithw@vmware.com>
Date:   Fri Feb 5 09:55:02 2010 +0000

    Merge commit 'origin/master' into gallium-screen-context

    Conflicts:
    	src/gallium/winsys/drm/nouveau/drm/nouveau_drm_api.c

    This branch has got a pretty tortured history now, I expect
    a squash merge will be appropriate when it is done.

commit 51e190e95acf120f72768fafb29e9721e358df1b
Author: Keith Whitwell <keithw@vmware.com>
Date:   Thu Feb 4 17:58:02 2010 +0000

    gallium: fix some build issues

commit f524bdaa723fb181637ad30c6ad708aeedabe25b
Merge: f906212 3aba0a2
Author: Keith Whitwell <keithw@vmware.com>
Date:   Thu Feb 4 17:51:32 2010 +0000

    Merge commit 'origin/master' into gallium-screen-context

commit f9062126883199eabf045714c717cd35f4b7b313
Author: Keith Whitwell <keithw@vmware.com>
Date:   Thu Feb 4 17:17:12 2010 +0000

    gallium/docs: small description of screen::create_context

commit efcb37bd3d5ed37f06c6105bd2d750b374ec0927
Author: Keith Whitwell <keithw@vmware.com>
Date:   Thu Feb 4 16:42:42 2010 +0000

    drm/radeon: more dead create_context wrapper removal

commit 6badc0dd9e06cf2ec936940bcf12b9ef5324b301
Author: Keith Whitwell <keithw@vmware.com>
Date:   Thu Feb 4 16:42:30 2010 +0000

    drm/i965: more dead create_context wrapper removal

commit cf04ebd5a54b18b2d894cfdab2b0f2fd55626ffc
Author: Keith Whitwell <keithw@vmware.com>
Date:   Thu Feb 4 16:42:05 2010 +0000

    st/python: more dead create_context wrapper removal

commit 444f114c3516abf71c430e6e9d0d2ae3b80679d3
Author: Keith Whitwell <keithw@vmware.com>
Date:   Thu Feb 4 16:37:58 2010 +0000

    idenity: wrapped context creation

commit 5a6d09cb9e468d1ee6c8d54b887618819d8d94f2
Author: Keith Whitwell <keithw@vmware.com>
Date:   Thu Feb 4 16:28:47 2010 +0000

    ws/gdi: remove dead context_create wrapper

commit 132b55f4bec39386ac625f09aaa11f609664024c
Author: Keith Whitwell <keithw@vmware.com>
Date:   Thu Feb 4 16:27:52 2010 +0000

    ws/gdi: remove dead context_create wrapper

commit 56d2d21a0cdcb197a364049d354c2f15a4fc026a
Author: Keith Whitwell <keithw@vmware.com>
Date:   Thu Feb 4 16:25:38 2010 +0000

    st/xorg: use screen::context_create

commit 838c5cfe56b2af6c644909bed3c5e7cdd64c336a
Author: Keith Whitwell <keithw@vmware.com>
Date:   Thu Feb 4 16:23:20 2010 +0000

    glx/xlib: simplify creation of trace-wrapped contexts

    Trace screen knows how to properly wrap context creation in the
    wrapped screen, so nothing special to do here.

commit c99404c03ebaec4175f08a2f363e43c9085f2635
Author: Keith Whitwell <keithw@vmware.com>
Date:   Thu Feb 4 16:18:24 2010 +0000

    st/python: no need to special case context creation for trace

commit 193a527a682b6877bb1faecd8092df4dfd055a18
Author: Keith Whitwell <keithw@vmware.com>
Date:   Thu Feb 4 16:15:30 2010 +0000

    drm/radeon: remove dead create_context declaration

commit bb984eecc25cf23bc77e1c818b81165ba1a07c9a
Author: Keith Whitwell <keithw@vmware.com>
Date:   Thu Feb 4 16:14:58 2010 +0000

    nv/drm: remove dead create_context ref

commit e809313a44287dc4e16c28e9e74ef3b2b5271aa1
Author: Keith Whitwell <keithw@vmware.com>
Date:   Thu Feb 4 16:12:51 2010 +0000

    st/egl: remove a layer of wrappers around screen::create_context

commit 39caa6672a04122f185c22e17aab86d1c40938bf
Author: Keith Whitwell <keithw@vmware.com>
Date:   Thu Feb 4 16:05:28 2010 +0000

    r300g: fill in screen::context_create

commit 407f12556d16ba0656774d8a1d9ebda22f82f473
Author: Keith Whitwell <keithw@vmware.com>
Date:   Thu Feb 4 16:04:04 2010 +0000

    cell: adapt for screen::create_context, untested

commit d02b0c6ce321a04c76fdabb09e0e4380ce1c1376
Author: Keith Whitwell <keithw@vmware.com>
Date:   Thu Feb 4 15:50:24 2010 +0000

    drm/nv: adapt for screen::create_context

    All contexts now created directly through the screen, so remove
    equivalent code here.

    Remove apparently un-needed array of contexts in the winsys.

commit 53eec5b1349aa1b6892a75a7bff7e7530957aeae
Author: Keith Whitwell <keithw@vmware.com>
Date:   Thu Feb 4 15:50:08 2010 +0000

    stw: adapt for screen::create_context, untested

commit c6a64de3eb381bc9a88e9fbdecbf87d77925aaf5
Author: Keith Whitwell <keithw@vmware.com>
Date:   Thu Feb 4 15:49:20 2010 +0000

    trace: expose the wrapped context's priv data

    If we are going to keep this priv idea, really want an accessor
    function for it so that trace and other drivers can wrap that.

commit 75d6104e11d86ec2b0749627ed58e35f856ee6eb
Author: Keith Whitwell <keithw@vmware.com>
Date:   Thu Feb 4 15:47:55 2010 +0000

    nv30: adapt to screen::context_create

commit 12f5deb6ed9723e9b5d34577052b8365813ca14e
Author: Keith Whitwell <keithw@vmware.com>
Date:   Thu Feb 4 15:44:47 2010 +0000

    nv40: adapt to screen::context_create

commit 14baccaa3b6bbb3b91056126f6521828e786dc62
Author: Keith Whitwell <keithw@vmware.com>
Date:   Thu Feb 4 15:35:27 2010 +0000

    nv50: adapt to screen::create_context

    Not build tested.  Need to figure out how to build nouveau.

commit a0e94505ccd2d7f3e604465a2ac302f1286b73b6
Author: Keith Whitwell <keithw@vmware.com>
Date:   Thu Feb 4 15:22:27 2010 +0000

    llvmpipe: update for screen::create_context, untested

commit 0eae17107c950346030e4f7e0ec232f868d3893d
Author: Keith Whitwell <keithw@vmware.com>
Date:   Thu Feb 4 15:16:57 2010 +0000

    xlib/llvmpipe: remove dead winsys context creation path

commit 2f69f9ffaa7e2a01d2483277246ed13051ae4ca3
Author: Keith Whitwell <keithw@vmware.com>
Date:   Thu Feb 4 14:58:27 2010 +0000

    gallium: convert most code to use screen::create_context

    I wish I could build all of gallium at once to find breakages.

commit d7b57f4061b82322cbcae176125913d9f0dea6c1
Author: Keith Whitwell <keithw@vmware.com>
Date:   Thu Feb 4 12:46:21 2010 +0000

    glx: permit building with older protocol headers

    I'd like to be able to build mesa on current distro releases without
    having to upgrade from the standard dri2proto and glproto headers.  With
    this change I'm able to build on ancient releases such as Ubuntu 9-10...

    In general, it would be nice to be able to build-test mesa to check for
    unintended breakages without having to follow the external dependencies
    of every group working on the codebase.

commit 57adedd6fb06c98572ed8d4aef19203df4c4eea2
Merge: da71847 e1906ae
Author: Keith Whitwell <keithw@vmware.com>
Date:   Thu Feb 4 11:38:15 2010 +0000

    Merge commit 'origin/master' into gallium-screen-context

    Conflicts:
    	src/gallium/drivers/softpipe/sp_video_context.h
    	src/gallium/drivers/trace/tr_context.c
    	src/gallium/state_trackers/wgl/shared/stw_context.c
    	src/gallium/winsys/gdi/gdi_softpipe_winsys.c

commit da71847ea6414d7e352c6094f8963bb4eda344dc
Author: José Fonseca <jfonseca@vmware.com>
Date:   Sat May 2 08:57:39 2009 +0100

    wgl: Use pipe_screen::context_create.

commit 2595a188f93fd903600ef5d8517737ee0592035d
Author: José Fonseca <jfonseca@vmware.com>
Date:   Sat May 2 08:56:47 2009 +0100

    trace: Implement pipe_screen::context_create.

commit f3640e4ae37a5260cbfba999d079f827de0a313a
Author: José Fonseca <jfonseca@vmware.com>
Date:   Sat May 2 08:56:17 2009 +0100

    softpipe: Implement pipe_screen::context_create.

commit 347266bddc8bd39c711bacb2193793759d0f3696
Author: José Fonseca <jfonseca@vmware.com>
Date:   Sat May 2 08:55:31 2009 +0100

    gallium: New pipe_screen::context_create callback.
2010-03-11 15:23:16 +00:00
Michal Krol
530b9910c2 gallium: Check for OOM condition when creating a sampler view. 2010-03-11 15:30:21 +01:00
Michal Krol
252dc5f897 gallium: Use last_level for pipe_sampler_view instead of num_levels.
It's more consistent with the rest of the interfaces.
2010-03-11 15:25:52 +01:00
José Fonseca
4c5c442f12 softpipe: Dummy fence functions. 2010-03-11 12:24:56 +00:00
Marek Olšák
a0ae2ca033 st/dri: move extension initilization to st/mesa completely
Extensions were enabled in both st/mesa and st/dri, with st/dri completely
overriding the decisions of st/mesa and exposing even the extensions claimed
to be unsupported by a pipe driver.

This commit moves the differences between the two to st/mesa and removes
the responsibilty of advertising extensions from st/dri.
2010-03-11 12:28:51 +01:00
Michel Dänzer
fc1dd5ce1d Merge remote branch 'origin/7.8' 2010-03-11 12:14:05 +01:00
Vinson Lee
aa311ae616 winsys/xlib: Fix memory leak.
Memory for xm_dt was allocated twice.
2010-03-11 00:18:09 -08:00
Vinson Lee
8f7e06ddf6 progs/fpglsl: Fix GLSL compilation failures on Mac OS X. 2010-03-11 00:10:26 -08:00
Marek Olšák
40adcd611f st/mesa: always advertise texture_rectangle 2010-03-11 02:32:08 +01:00
Brian Paul
67a2f98be7 gallivm: overhaul of texture sampling code
The new lp_build_sample_general() function will handle all sampling
modes for all texture types.  Still incomplete, but a few additional
sampling modes are now supported.

1D textures should work and most of the code for 3D textures is in place.
No support for cube maps yet.  No support for different min/mag filters.
2010-03-10 18:09:49 -07:00
Brian Paul
a599f552f2 gallivm: handle scalar floats in lp_build_floor() and lp_build_iround() 2010-03-10 18:09:49 -07:00
Brian Paul
22bb7ffd04 gallivm: constant building for scalar zero 2010-03-10 18:09:49 -07:00
Brian Paul
a75254dda9 gallivm: implement bilinear sampling with nearest mipmapping
Time to start consolidating some code...
2010-03-10 18:09:49 -07:00
Brian Paul
dd67103d86 gallivm: remove debug code. nearest minification works now. 2010-03-10 18:09:49 -07:00
Brian Paul
19371fb60d llvmpipe: fix loop over mipmap levels 2010-03-10 18:09:49 -07:00
Francisco Jerez
878eef8c40 dri/nouveau: Just reemit the BO state on pushbuf flush.
Reemitting dirty states on flush causes problems if the GL context
isn't fully consistent when we get to it. It didn't serve any specific
purpose, so, use nouveau_bo_state_emit instead.
2010-03-11 00:59:59 +01:00
Eric Anholt
56ff30a9f9 i965: Use the PLN instruction when possible in interpolation.
Saves an instruction in PINTERP, LINTERP, and PIXEL_W from
brw_wm_glsl.c For non-GLSL it isn't used yet because the deltas have
to be laid out differently.
2010-03-10 15:18:19 -08:00
Eric Anholt
dc8c035944 i965: Set up the execution size before relying on it.
Fixes hangs with texturing in the non-GLSL path since
f6d210c284
2010-03-10 15:17:47 -08:00
Jose Fonseca
d42229707a gallivm: simplify conditional branching
Instead of testing each component individually, we can test the entire
vector at once.
2010-03-10 17:22:30 -05:00
Ian Romanick
3821761e45 Differentiate in ast_function_expression between constructors and func. calls 2010-03-10 14:12:22 -08:00
Ian Romanick
986b8f7982 Tell emacs that C++ .h files are C++ 2010-03-10 13:58:12 -08:00
Zack Rusin
ac33e7752d gallivm: properly test the if condition and branch to the proper label
makes loops work
2010-03-10 16:56:42 -05:00
Zack Rusin
18d406e8a8 gallivm: implement loops 2010-03-10 16:56:42 -05:00
Karl Schultz
242893cce2 windows: Quiet warning by not defining YY_NO_UNISTD_H. 2010-03-10 14:40:32 -07:00
Brian Paul
c7be039fad progs/trivial: use -c option to use glCopyPixels()
Otherwise we use glRead/DrawPixels to copy the off-screen FBO image
into the window.

Looks like NVIDIA's broken when using -c (the image is upside down),
but OK with -c -t.
2010-03-10 14:37:05 -07:00
Brian Paul
d5ccbea63c progs/trivial: make clear-fbo-scissor.c work with other GL drivers
NVIDIA's driver requires that the texture that we're going to render into
be complete.  Need to set min/mag filters to non-mipmap modes.

Plus added other error/debug checks.
2010-03-10 14:37:05 -07:00
Maciej Cencora
3198cd4a65 radeon: fallback to sw ReadPixels if color logicop is enabled
Fixes glean/logicOp (regressed after introducing hw accelerated support for ReadPixels)
2010-03-10 22:33:40 +01:00
Maciej Cencora
addedd091e r300: enable depth test only if depth buffer is available
Fixes #23532 and piglit/fbo-nodepth-test piglit/fbo-nostencil-test
2010-03-10 22:33:29 +01:00
Maciej Cencora
a68e8a4eaa radeon: fix glCopyTex(Sub)Image if user FBO is bound
Fixes piglit/fbo-blit and wine d3d9 unit test.
2010-03-10 22:33:29 +01:00
Zack Rusin
a44f362567 fpglsl: a few more useful glsl tests 2010-03-10 16:32:07 -05:00
Ian Romanick
7cfddf1941 Make ast_function_expression subclass of ast_expression 2010-03-10 13:26:52 -08:00
Ian Romanick
d10fe19495 Simplified constructor for identifier expressions 2010-03-10 13:25:56 -08:00
José Fonseca
a75519cb43 llvmpipe: Finally found a way to do vector comparisons without using intrinsics.
Only works well with LLVM >= 2.7
2010-03-10 20:50:01 +00:00
Zack Rusin
1ad0a0fd8f fpglsl: set an integer uniform required by the loop example 2010-03-10 15:42:26 -05:00
Zack Rusin
5f80dad7fd fpglsl: add some for and while loops 2010-03-10 15:37:18 -05:00
Brian Paul
7069dff80f softpipe: fix memcpy params to avoid static analysis warnings
See fd.o bug 26970.  Also added sanity check assertions.
2010-03-10 13:09:03 -07:00
Brian Paul
3c48f40f61 progs/trivial: add -t (RTT) option for clear-fbo-scissor.c 2010-03-10 12:19:41 -07:00
Eric Anholt
48dca99feb i965: Add support for the CMP opcode in the GLSL path.
This would be triggered by use of sqrt() along with control flow.
Fixes piglit-fs-sqrt-branch and a bug in Yo Frankie!.
2010-03-10 11:18:21 -08:00
Eric Anholt
f77c1cd7df i965: Print the opcode name for unrecognized opcodes in the GLSL path. 2010-03-10 11:18:21 -08:00
Brian Paul
9a7ba79b2b progs/trivial: added clear-fbo-scissor.c to test scissored clear of FBO 2010-03-10 11:52:07 -07:00
Eric Anholt
f6d210c284 i965: Fix the response len of masked sampler messages for 8-wide dispatch.
The bad response length would hang the GPU with a masked sample in a
shader using control flow.  For 8-wide, the response length is always
4, and masked slots are just not written to.  brw_wm_glsl.c already
allocates registers in the right locations.

Fixes piglit glsl-fs-bug25902 (fd.o bug #25902).
2010-03-10 10:44:08 -08:00
Eric Anholt
c8ef7a0966 i965: Print the offset for IFF in disasm 2010-03-10 10:44:08 -08:00
Ian Romanick
adfb0cd740 IR variable: Initial work to support GLSL built-in variables 2010-03-10 10:43:54 -08:00
Ian Romanick
f52888fac0 Include cstdlib to be sure size_t is available 2010-03-10 10:42:37 -08:00
José Fonseca
ddb081e3ed Revert "scons: Refuse to use LLVM 2.7 for now."
This reverts commit 44703217f7.

http://www.llvm.org/bugs/show_bug.cgi?id=6429 has been fixed now. Things
appear to be working reasonably so far.
2010-03-10 18:09:33 +00:00
Brian Paul
daad54f6ce progs/tests: add additional FBO->window test paths (disabled)
Normally use glReadPixels + glDrawPixels.  Add debug/test paths for
glCopyPixels and glBlitFramebuffer.
2010-03-10 10:59:06 -07:00
Ian Romanick
d949a9afb0 Move top-level AST to HIR conversion to _mesa_ast_to_hir 2010-03-10 09:55:22 -08:00
Brian Paul
7a2e32d684 mesa: raise an error when trying to bind non-existant texture to FBO
If the user calls glRenderBufferTexture(texture=N) but texture N
doesn't name an existing texture, raise GL_INVALID_ENUM.

Plus, add a comment about some questionable error checking code in
framebuffer_texture().  Ian?
2010-03-10 10:54:29 -07:00
Brian Paul
b318039e9a mesa: added new function comments 2010-03-10 10:53:21 -07:00
Brian Paul
06c44e852f st/mesa: set strb->format field in st_render_texture()
This fixes a problem in glReadPixels when reading from an FBO's texture
attachment.  We have a better chance at hitting a fast path for
glReadPixels now.
2010-03-10 10:50:19 -07:00
Brian Paul
9543b0a1ea st/mesa: add some comments in glReadPixels code 2010-03-10 10:49:18 -07:00
Brian Paul
a2fe774e09 st/mesa: consolidate duplicated texture allocation code 2010-03-10 10:48:10 -07:00
Brian Paul
f60524938e Merge branch '7.8' 2010-03-10 10:44:12 -07:00
Michel Dänzer
a56da1005d Merge branch '7.8' 2010-03-10 18:33:17 +01:00
Ian Romanick
8e6cd3bf54 Require the shader target be specified to the driver program 2010-03-10 09:31:30 -08:00
Ian Romanick
1c4156ffac Use ir_print_visitor to dump IR tree 2010-03-10 09:27:03 -08:00
Alex Deucher
a840bf4146 r200: add additional blit formats 2010-03-10 11:58:07 -05:00
Alex Deucher
cc1464cce9 r100: add additional blit formats 2010-03-10 11:58:07 -05:00
Alex Deucher
e167403e58 radeon/r200/r600: enable HW accelerated gl(Read/Copy/Draw)Pixels 2010-03-10 11:58:07 -05:00
George Sapountzis
7cd8f0ef9d glapi: fix bug with tls and relocs
add_dispatch (driver) and maybe get_proc_address (client) may be called before
set_dispatch is called, which results in generate_entrypoint using an unreloced
function template.
2010-03-10 18:44:47 +02:00
George Sapountzis
bae3135515 glapi: these two should be ok for add_dispatch ...
- a function cannot be both static and extension, right ?

- we should be setting the offset only if not already set, right ?
2010-03-10 18:44:47 +02:00
George Sapountzis
0d1dde5b01 glapi: comments for _glapi_add_dispatch 2010-03-10 18:44:46 +02:00
George Sapountzis
c4b630efdb glapi: minor cosmetic for _glapi_add_dispatch 2010-03-10 18:44:46 +02:00
George Sapountzis
3833a76eef glapi: add function set_entry_info 2010-03-10 18:44:46 +02:00
George Sapountzis
cae4fdda8d glapi: parameter checking, failure paths, ... for add_function_name 2010-03-10 18:44:45 +02:00
George Sapountzis
ddabf0a151 glapi: cosmetic for _glapi_add_dispatch
- static vs. extension
- indent
- s/new_offset/static_offset/
- ...
2010-03-10 18:44:45 +02:00
George Sapountzis
f9cc6b3ee7 glapi: use get_extension_proc in _glapi_add_dispatch 2010-03-10 18:44:45 +02:00
George Sapountzis
f0c18da2cf glapi: cosmetic for functions for static table
make similar to functions for extensions table
2010-03-10 18:44:45 +02:00
George Sapountzis
5b2340c493 glapi: add function to find extension by name 2010-03-10 18:44:44 +02:00
George Sapountzis
58985c36be glapi: functions for extensions table similar to static table 2010-03-10 18:44:44 +02:00
Roland Scheidegger
8c34437ded cell: handle NULL cso vertex_elements state object on bind
drivers need to handle NULL cso vertex elements (and others) objects.
It is possible the cso code saves/restores NULL objects (if no normal
cso object was bound before this was invoked).
This led to segfaults (for example demos/cubemap) for apps which were using
things like creating mipmaps before drawing anything.
2010-03-10 16:53:07 +01:00
Michal Krol
5d4360d10c gallium: pipe_get_tile_swizzle() accepts format parameter.
Enables casting of texture data.
2010-03-10 16:32:34 +01:00
Chia-I Wu
c47c73293d i915g: Prevent NULL dereference.
bind_vertex_elements_state may be called with NULL velems.  Do nothing
if that is the case.
2010-03-10 23:00:09 +08:00
Michal Krol
3ce4375912 Merge branch 'master' into gallium-sampler-view
Conflicts:
	src/gallium/auxiliary/Makefile
	src/gallium/auxiliary/SConscript
	src/gallium/auxiliary/tgsi/tgsi_exec.c
	src/gallium/auxiliary/util/u_blitter.c
	src/gallium/drivers/i915/i915_context.h
	src/gallium/drivers/i965/brw_context.h
	src/gallium/drivers/llvmpipe/lp_context.h
	src/gallium/drivers/nv50/nv50_context.h
	src/gallium/drivers/nv50/nv50_state_validate.c
	src/gallium/drivers/nv50/nv50_tex.c
	src/gallium/drivers/r300/r300_blit.c
	src/gallium/drivers/r300/r300_context.h
	src/gallium/drivers/r300/r300_emit.c
	src/gallium/drivers/r300/r300_state.c
	src/gallium/drivers/softpipe/sp_context.h
	src/gallium/drivers/svga/svga_context.h
	src/gallium/drivers/svga/svga_pipe_sampler.c
2010-03-10 15:49:30 +01:00
Chia-I Wu
e4848d21e8 gallium: Do not mix winsys-drawable-handle and context-private.
update_buffer should be called with context-private, not
winsys-drawable-handle.
2010-03-10 22:21:08 +08:00
Michal Krol
9b348d0ed1 svga: Disable debug message. 2010-03-10 14:16:40 +01:00
Michal Krol
504ad3606d svga: Check if vertex elements has been bound before using it. 2010-03-10 14:16:40 +01:00
José Fonseca
c282c0b6e4 softpipe: Prevent NULL dereference. 2010-03-10 12:24:03 +00:00
José Fonseca
c4e0ae3907 docs: Update new opengl32.dll target location. 2010-03-10 12:09:16 +00:00
José Fonseca
986ce8f1c1 python: Remove broken link hack. 2010-03-10 12:05:10 +00:00
José Fonseca
7b8641bbba python: More build fixes. 2010-03-10 12:00:13 +00:00
José Fonseca
fc08d13fdc trace: Make tr_public.h c++ friendly. 2010-03-10 11:53:15 +00:00
Keith Whitwell
0731d14a43 target-helpers: remove swrast_xlib.c helper
This was a good idea, but ended up tying the build systems in knots.
We can revisit this later, in particular if we can put in place dummy
implementations of cell_create_screen(), llvmpipe_create_screen()
which just return NULL if the driver isn't available.

In the meantime, just duplicate this smallish function in the two
places it was being called.
2010-03-10 11:52:04 +00:00
Keith Whitwell
e47a619ea2 ws/xlib: remove dead lines 2010-03-10 11:52:03 +00:00
José Fonseca
e8d884eab9 scons: Fixup the libgl-gdi build. 2010-03-10 11:34:09 +00:00
José Fonseca
6b707667c8 python: Handle the possibility that no driver is selected. 2010-03-10 11:10:58 +00:00
Keith Whitwell
de27e272f4 gallium: remove trace module injection from various state trackers
Components such as state trackers, drivers, etc, should be free to be
recombined in arbtrary ways to build driver stacks.  They should not
be reaching out and trying to build the stack themselves - this is now
expected to be handled by the "target" abstraction.
2010-03-10 10:43:00 +00:00
Keith Whitwell
7e29bef7dc ws/gdi: add include 2010-03-10 10:39:37 +00:00
Keith Whitwell
431a2f99bc target-helpers: helper for injecting common debug layers
Add a helper gallium_wrap_screen() for injecting the commonly
used extra layers into a gallium stack.  Currently that's just the
trace module and identity layer, but there could be more in the
future, eg. a validation layer.
2010-03-10 10:37:57 +00:00
José Fonseca
601bfb5951 python: Fix up state tracker for sw api. 2010-03-10 10:34:29 +00:00
José Fonseca
5235c5aac7 Revert "r300-gallium: Skeleton for integrating into the python statetracker."
This reverts commit 2d56d0839e.

Never actually used.
2010-03-10 10:02:03 +00:00
Keith Whitwell
80f86d22b2 st/wgl: add missing paramter 2010-03-10 09:52:25 +00:00
Keith Whitwell
7ce6b31306 trace: include tr_public.h 2010-03-10 09:51:41 +00:00
Keith Whitwell
3e38dbe3d3 gallium: plumb winsys-drawable-handle through to state tracker
The state trackers need this value so that they can supply it
as the "void *" argument to flush_frontbuffer.

Fixes single-buffer rendering.
2010-03-10 09:22:02 +00:00
Ian Romanick
02ae68f496 Fix typeo in gl_FogParameters.scale (was scalre) 2010-03-10 00:52:39 -08:00
Keith Whitwell
155fbcb0ed Merge commit 'origin/master' into gallium-sw-api-2 2010-03-10 08:29:27 +00:00
Ian Romanick
0b67823462 AST to IR: Mark 'varying' in a vertex shader as 'out' 2010-03-10 00:28:59 -08:00
Ian Romanick
654c057257 ir_variable: Initialize all attribute bits to reasonable defaults
This prevents variables from randomly having their 'invariant' or
'read_only' bits set, for example.
2010-03-10 00:21:27 -08:00
José Fonseca
eeaa0861bf llvmpipe: Cope with null Vertex element cso.
CSO can often be null.

For example:
1. at initialization
2. using an util module (u_blit) right after initialization (it will push
   state and pop the previous null state)
3. at shutdown time (state shouldn't be bound when being destroyed)

Glean was hitting 2.
2010-03-10 07:23:29 +00:00
Ben Skeggs
ed7f73e161 nouveau: translate PIPE_BUFFER_USAGE_UNSYNCHRONIZED 2010-03-10 16:30:03 +10:00
Ben Skeggs
139062946d nv50: inline nv50_state_flush_notify()
It's (rightly) not called from anywhere else now
2010-03-10 16:30:03 +10:00
Ben Skeggs
7b7fcb0854 nv50: remove nv50_context.state.instbuf 2010-03-10 16:30:02 +10:00
Ben Skeggs
9b233ce7de nv50: remove unnecessary macro 2010-03-10 16:30:02 +10:00
Ben Skeggs
3f93fa6010 nv50: move nv50_prim() into a header file rather than duplicating 2010-03-10 16:30:01 +10:00
Ben Skeggs
4796986c98 nv50: add option to force immediate-mode submission, disable by default 2010-03-10 16:30:01 +10:00
Ben Skeggs
160bda24ed nv50: re-add immediate mode vertex submission paths 2010-03-10 16:30:00 +10:00
Ben Skeggs
0842829c18 nv50: when doing inline indices, split elt lists so they fit into pushbuf 2010-03-10 16:30:00 +10:00
Ben Skeggs
d8a415425e nv50: reimplement draw_elements_instance(), use for draw_elements() too
This makes draw_elements()/draw_elements_instanced() do the right thing
for the non-inline elements cases, and not require flush_notify().
2010-03-10 16:30:00 +10:00
Ben Skeggs
621c4609f8 nv50: reimplement draw_arrays_instanced(), do draw_arrays() in terms of it
This makes draw_arrays()/draw_arrays_instanced() do the right thing and
not require the (probably broken anyway) flush_notify() usage.

It also fixes a potential bug in the behaviour of reading InstanceID from
shaders, where 0 should be read for non-instanced drawing, previously it
was possible to read non-0 ids if mixing instanced/non-instanced.
2010-03-10 16:30:00 +10:00
Ben Skeggs
a527716e81 nv50: rip out inline push draw paths temporarily 2010-03-10 16:30:00 +10:00
Ben Skeggs
2b8c0cf169 nv50: make use of scissor enable/disable method 2010-03-10 16:29:59 +10:00
Ben Skeggs
885d2eceb1 nv50: move magic 0x142c stuff to after state emission 2010-03-10 16:29:59 +10:00
Ben Skeggs
0e6af1fcaa nv50: avoid unnecessary vp/gp/fp state changes 2010-03-10 16:29:59 +10:00
Ben Skeggs
2a84db24b3 nv50: remove pre_pipebuffer_map hack.... 2010-03-10 16:29:59 +10:00
Ben Skeggs
3f804b0f19 nv50: remove horrific abuse of nouveau_channel.flush_notify
Really though, using this at all is just not a good idea in the 3D driver.
I'm almost certain the hardware will not like a reloc appearing between
begin()/end().. Anyways, this is still better than before, more fixes
to come..
2010-03-10 16:29:59 +10:00
Ben Skeggs
c926ed0e76 nv50: always emit dummy relocs for all still-referenced buffers 2010-03-10 16:29:59 +10:00
Ben Skeggs
e1d015fe22 nv50: ensure enough room for state changes in current pushbuf
Also allows the nv50_state_validate() caller to request a minimum amount
of space that itself requires, not all callers accurately use this yet
but the simple cases are now accounted for.

Rendering will also be dropped on the floor if validate fails now.
2010-03-10 16:29:58 +10:00
Ben Skeggs
62ab89785b nv50: rework state emission 2010-03-10 16:29:58 +10:00
Ben Skeggs
ac2b35fd2d nv50: use relocs rather than re-uploading TIC all the time 2010-03-10 16:29:58 +10:00
Ian Romanick
fe10250355 IR print visitor: Add some support for printing types and constants 2010-03-09 21:44:34 -08:00
Corbin Simpson
007f25b3bd r300g: Reorder regs, save one dword.
Or, put another way, save 10% on rendering calls.
2010-03-09 21:37:49 -08:00
Chia-I Wu
9a8342ebcd winsys/drm: Handle circular dependencies in Makefile.egl.
The libraries have circular dependencies.  Use --start-group and
--end-group when producing the final shared libraries.
2010-03-10 10:14:17 +08:00
Chia-I Wu
1f92cf55e1 st/egl: Fix build errors in ximage backend after merge.
This fixes assorted merge conflicts when master is merged to
gallium-sw-api-2 in 0c96690a5b.
2010-03-10 09:50:19 +08:00
Ian Romanick
6044ae79a0 IR print visitor: Print assignments 2010-03-09 16:40:45 -08:00
Ian Romanick
6652af36fe Add assignment side-effect to the instruction stream
The actual assignment is a side-effect of the assignment expression.
Add it to the instruction stream and return the LHS of the assignment
as its rvalue.
2010-03-09 16:38:02 -08:00
Ian Romanick
78b51b0fdd IR visitor: Add initial version of ir_visitor classes
The ir_visitor class is the abstract base class for all visitors.
ir_print_visitor contains the beginnings of a concrete visitor class
that will print out an IR sequence in a Lisp / Scheme-like syntax.
2010-03-09 16:26:15 -08:00
Ian Romanick
fce1150156 Convert is_glsl_type_matrix to glsl_type::is_matrix 2010-03-09 15:58:52 -08:00
Ian Romanick
a2dd22fb19 Convert is_glsl_type_vector to glsl_type::is_vector 2010-03-09 15:55:16 -08:00
Ian Romanick
cb36f8aaee Convert is_glsl_type_scalar to glsl_type::is_scalar 2010-03-09 15:51:22 -08:00
Ian Romanick
eccf0bf5f2 Make glsl_type a class
Among other benefits, this cleans up a the hackery invovled in
initializing the union field in builtin_types.h.
2010-03-09 15:49:31 -08:00
Eric Anholt
a81836ee2f i965: Fix ENDLOOP to only patch up this loop's BREAK and CONT.
Corresponds to d225a25e21a24508aea3b877c78beb35502e942d and fixes
piglit glsl-fs-loop-nested.  Bug #25173.
2010-03-09 14:42:17 -08:00
Eric Anholt
6b194dab6b i965: Unalias all GLSL source regs from the destination regs used.
We were doing it ad-hoc before, as instructions with potential
aliasing problems were identified.  But thanks to swizzling basically
anything can have aliasing, so just do it generally at source reg
setup time.  This is somewhat inefficient, because sometimes an
operation doesn't need unaliasing protection if the swizzling is safe,
but the unaliasing before didn't cover those cases either.

Fixes piglit glsl-fs-loop.
2010-03-09 14:42:17 -08:00
Eric Anholt
280abdacf9 i965: Print the offsets for WHILE and BREAK in disasm. 2010-03-09 14:42:17 -08:00
Eric Anholt
f6f547d87e i965: Fix nested loops in the VS.
We were patching up all the break and continues between the start of
our loop and the end of our loop, even if they were breaks/continues
for an inner loop.  Avoiding patching already patched breaks/continues
fixes piglit glsl-vs-loop-nested.
2010-03-09 14:42:17 -08:00
Eric Anholt
7f6d2754d5 i965: Fix up VP constbuf leak on program delete. 2010-03-09 14:42:17 -08:00
Maciej Cencora
eeaf1e0519 r300: don't crash if there's no colorbuffer 2010-03-09 23:13:19 +01:00
Maciej Cencora
b70dcabafc radeon: mark framebuffer as incomplete if renderbuffer format isn't supported by hw 2010-03-09 21:50:59 +01:00
Maciej Cencora
fd05067c99 r300: add support for more rendering formats 2010-03-09 21:50:30 +01:00
Maciej Cencora
a17563c7dd radeon/r200/r300/r600: add is_format_renderable function 2010-03-09 21:50:20 +01:00
Maciej Cencora
bd2239e497 progs/tests: use first color attachement
Allows the tests to be run on drivers that supports only one color attachement.
2010-03-09 21:46:14 +01:00
Maciej Cencora
67108b5d12 r300: enable HW accelerated gl(Read/Copy/Draw)Pixels 2010-03-09 21:46:14 +01:00
Maciej Cencora
ac2b7835d5 radeon: add hw accelerated glReadPixel support (not enabled yet) 2010-03-09 21:46:14 +01:00
José Fonseca
3355ae1925 glapi: Fix scons build -- list new file. 2010-03-09 20:43:13 +00:00
George Sapountzis
20ed2445b3 glapi: allow for any mangle prefix 2010-03-09 22:04:51 +02:00
George Sapountzis
54ba95a4de glapi: split out arch-specific code for entrypoints 2010-03-09 22:04:51 +02:00
George Sapountzis
2c8b5ffed9 glapi: mv table functions to glapi_getproc.c and add local header 2010-03-09 22:04:51 +02:00
George Sapountzis
fe14868d96 drop stray XFree86Server, XGLServer 2010-03-09 22:04:50 +02:00
Keith Whitwell
dc1e4cf87f svga: Don't do culling while the software pipeline is active.
It does it for us, and additionally introduces potentially
back-facing triangles.
2010-03-09 20:49:05 +01:00
José Fonseca
02716cf7d1 null: Add a null software winsys.
One where framebuffer data will be read via texture transfers.

Useful for e.g., python state tracker.
2010-03-09 19:47:56 +00:00
Roland Scheidegger
a673dee455 mesa/st: initialize velements state properly
one variable is a bitfield where the rest is never written to, which caused
valgrind to complain. Might have caused cso to not recognize an already stored
state. Reported by Christoph Bumiller.
2010-03-09 20:33:21 +01:00
Roland Scheidegger
0d6b0b0d9d cso: don't forget to release vertex elements state 2010-03-09 20:33:21 +01:00
Keith Whitwell
9cdaadc92f target-helpers: missing files 2010-03-09 19:15:28 +00:00
Marek Olšák
bf50d40f1b r300g: kill pf_component_count 2010-03-09 20:12:52 +01:00
Keith Whitwell
3cadd983e8 ws/gdi: fix typo 2010-03-09 18:01:47 +00:00
Keith Whitwell
0df858a8d5 gallium: create target for gdi libgl 2010-03-09 17:58:40 +00:00
Keith Whitwell
25b9aafbd2 ws/xlib: no dependency on mesa state tracker 2010-03-09 17:55:19 +00:00
Keith Whitwell
5e72b89b89 egl/x11: use swrast-xlib helper 2010-03-09 17:32:10 +00:00
Keith Whitwell
d0aea65032 gallium: create helper for swrast+xlib combination
Several targets may want to reuse this code.  It's pretty simple, not
sure if this is really a win.
2010-03-09 17:32:10 +00:00
José Fonseca
c27ffc5215 scons: Fix the libg-xlib Sconscript. 2010-03-09 17:08:36 +00:00
José Fonseca
78d8e6c98a scons: Always build the identity driver. 2010-03-09 17:08:16 +00:00
Brian Paul
2ccae040a4 gallivm: checkpoint: nearest mipmap filtering
The LOD is computed from texcoord partial derivatives and used to
select a mipmap level.  Still some bugs in texel fetching.  Lots of
rough edges and unfinished parts but the basics are in place.

Lots of changes to the lp_bld_arit.c code to support non-vector/scalar
datatypes.
2010-03-09 09:40:41 -07:00
Roland Scheidegger
e0f10a6fca util: simplify util_format_get_nr_components helper
since the number of components is now stored in the pipe format description,
we obviously no longer need to figure this out ourselves.
2010-03-09 17:28:27 +01:00
José Fonseca
09a7c25e76 util: Use bitshift arithmetic for pack too. 2010-03-09 15:59:01 +00:00
Keith Whitwell
999932bf1f targets/libgl-xlib: add code to inject trace and identity layers
Finally we can inject layers for debug, trace and "other" with
relative ease between state-tracker and driver.
2010-03-09 15:58:45 +00:00
Keith Whitwell
3c57c01a44 ws/xlib: remove self-knowledge about users of xlib winsys
Several software rasterizers can make use of this winsys, but there
isn't any reason why the winsys itself should know about them.

This change moves that information into the libgl-xlib target.

Need to fix up other targets making use of this winsys.
2010-03-09 15:33:21 +00:00
Corbin Simpson
a73fd447d4 cso: Fix typo in assert. 2010-03-09 07:31:27 -08:00
Corbin Simpson
141c7cb0d6 r300g: Precalculate and CSO-bind PSC state. 2010-03-09 07:31:27 -08:00
Corbin Simpson
9c8cb12388 r300g: Cleanup old PSC code a bit. 2010-03-09 07:30:49 -08:00
Roland Scheidegger
4d02534628 identity: fix copy & paste error 2010-03-09 16:28:59 +01:00
Roland Scheidegger
22812421b5 r300g: fix gallium-vertexlementcso merge damage 2010-03-09 16:24:47 +01:00
Brian Paul
27a7f9454f cell: fix up assorted compilation problems
The driver is pretty much totally broken though.
2010-03-09 08:14:06 -07:00
José Fonseca
ff407a117c gdi: Fixup llvmpipe gdi winsys too. 2010-03-09 15:12:19 +00:00
José Fonseca
706eda3057 scons: Add new targets option.
This will likely change. Most probably we'll just add an alias to indvidual
targets and use the regular scons targets arguments.
2010-03-09 15:09:32 +00:00
Keith Whitwell
b694f32170 winsys/gdi: get softpipe version compiling 2010-03-09 15:02:21 +00:00
Roland Scheidegger
685340a53e Merge branch 'gallium-vertexelementcso'
Conflicts:
	src/gallium/auxiliary/cso_cache/cso_context.c
	src/gallium/auxiliary/util/u_blit.c
	src/gallium/auxiliary/util/u_gen_mipmap.c
	src/gallium/drivers/i915/i915_context.h
	src/gallium/drivers/i965/brw_draw_upload.c
	src/gallium/drivers/r300/r300_blit.c
	src/gallium/drivers/r300/r300_context.h
	src/gallium/drivers/r300/r300_render.c
	src/gallium/drivers/r300/r300_state_derived.c
	src/mesa/state_tracker/st_cb_bitmap.c
	src/mesa/state_tracker/st_cb_clear.c
2010-03-09 15:59:40 +01:00
Keith Whitwell
73d9400ad6 softpipe: silence warning 2010-03-09 14:50:16 +00:00
Keith Whitwell
3db9644a9e ws/gdi: missing file 2010-03-09 14:49:39 +00:00
Keith Whitwell
ce30b5bf2c ws/gdi: sketch of gdi changes 2010-03-09 14:32:44 +00:00
Roland Scheidegger
ae7b7bf1ed st/mesa: fix clear/drawpixels/bitmap for new cso vertex elements interface
somehow those got lost...
2010-03-09 15:09:01 +01:00
Keith Whitwell
65233674d3 cell: untwiddle surface contents in flush_frontbuffer()
Don't make the shared software winsys rely on internal knowledge about
the cell driver's texture twiddling.

This is just a sketch and hasn't even been compile tested.
2010-03-09 14:03:41 +00:00
Roland Scheidegger
e8983f70b4 gallium: don't use flexible array members in drivers for vertex elements cso
While this c99 feature should work with most compilers, valgrind doesn't
really like it, and this only really saves some memory, we don't do this
in similar occasions (like the blend state) neither.
2010-03-09 14:23:00 +01:00
Roland Scheidegger
fe9f8536f1 auxiliary: fix vertex elements cso
potentially could have got a match even though the cso was different
(in case of different count and first few elements the same).
2010-03-09 14:19:29 +01:00
David Heidelberger
e497a58fad nv30: fix typo
Signed-off-by: David Heidelberger <d.okias@gmail.com>
2010-03-09 13:13:52 +00:00
Keith Whitwell
fe94a363e5 cell: attempt conversion to sw_winsys 2010-03-09 12:31:20 +00:00
Keith Whitwell
8ac10162f1 ws/xlib: remove USE_XSHM preprocessor macro 2010-03-09 11:48:57 +00:00
Keith Whitwell
d5bf9c0a5e ws/xlib: manage the GC internally
No need for the user of this winsys to supply/manage the x11 gc for
us.
2010-03-09 11:39:40 +00:00
Keith Whitwell
0c96690a5b Merge commit 'origin/master' into gallium-sw-api-2
Conflicts:
	src/gallium/drivers/llvmpipe/lp_setup.c
	src/gallium/drivers/softpipe/sp_texture.c
	src/gallium/drivers/softpipe/sp_winsys.h
	src/gallium/state_trackers/egl/common/egl_g3d.c
	src/gallium/state_trackers/egl/x11/native_x11.c
	src/gallium/state_trackers/egl/x11/native_x11.h
	src/gallium/state_trackers/egl/x11/native_ximage.c
2010-03-09 11:02:37 +00:00
Keith Whitwell
6f4ce4a4fe Squashed commit of gallium-no-texture-blanket
commit f90b3f01af82b9522067b1824e21709a6fb2d3af
Author: Keith Whitwell <keithw@vmware.com>
Date:   Mon Mar 8 14:39:44 2010 +0000

    gallium: remove p_screen::surface_buffer_create

    This isn't very useful without texture_blanket(), which has also been
    removed.

    Note that this function hasn't been removed from the old pipe_winsys
    (u_simple_screen) still used internally by some drivers (eg softpipe).

commit 6c462de39a4b9980a5f034a95e580efdfcb8173b
Author: Keith Whitwell <keithw@vmware.com>
Date:   Mon Mar 8 14:27:40 2010 +0000

    egl/x11: disable texture_blanket usage

commit b42da9160df9f47224e5b3291b972f41767aa6e5
Merge: 4be2436 3ca9336
Author: Keith Whitwell <keithw@vmware.com>
Date:   Mon Mar 8 14:27:24 2010 +0000

    Merge commit 'origin/master' into gallium-no-texture-blanket

    Conflicts:
    	src/gallium/drivers/svga/svga_screen_texture.c

commit 4be2436316929e3dfc55bc34d810920c06556b66
Author: Keith Whitwell <keithw@vmware.com>
Date:   Thu Mar 4 14:59:26 2010 +0000

    gallium: remove texture blanket call

    No longer needed, except for nouveau and egl/xll/native_ximage.c.

    Fix for nouveau is to keep the call, but move it to an internal
    function within nouveau.

    Fix for that egl/x11 relies on gallium-sw-api branch or its successor.

commit 69b6764330367d63c237d0bde9fb96435d0e0257
Author: Keith Whitwell <keithw@vmware.com>
Date:   Thu Mar 4 13:35:16 2010 +0000

    drm_api: wrap comment
2010-03-09 10:54:54 +00:00
Ian Romanick
3a9e989628 Remove unused function 2010-03-08 23:44:59 -08:00
Ian Romanick
0044e7edce Conver IR structures to use exec_list instead of simple_node 2010-03-08 23:44:54 -08:00
Ian Romanick
7e4ce71923 Add yet-another linked list type
The use of macros to access existing linked list type makes it
unsuitable for its current use as a base class.  Since this type and
the accompanying macros are used all over the place in Mesa, we can't
really change them.
2010-03-08 23:42:45 -08:00
Ian Romanick
61484ba188 Remove prototypes for *_to_hir functions that no longer exist 2010-03-08 23:06:48 -08:00
Chia-I Wu
95c5c69b50 st/egl: Use xlib_sw_winsys in ximage backend. 2010-03-09 12:56:47 +08:00
Chia-I Wu
da92f6db5b winsys/xlib: Fix a segfault when USE_XSHM is not defined. 2010-03-09 12:51:27 +08:00
Marek Olšák
821c830f11 r300g: remove hacks from translate_vertex_data_swizzle
The first part of the fix of BGRA vertex colors.
2010-03-09 04:56:11 +01:00
Marek Olšák
f3365bceb8 draw: quads never provoke the first vertex 2010-03-09 04:51:43 +01:00
Marek Olšák
558ce9964f softpipe: quads never provoke the first vertex 2010-03-09 04:51:43 +01:00
Marek Olšák
f2b8f14267 llvmpipe: quads never provoke the first vertex 2010-03-09 04:51:43 +01:00
Corbin Simpson
dd8f5c33f3 mesa/st: Gallium quads, by spec, never change provoking vertex.
Fixes glean/clipFlat for r300g.
2010-03-09 04:51:29 +01:00
Chia-I Wu
2b76e04a8c st/egl: Fix KMS build error after winsys handle change. 2010-03-09 11:34:37 +08:00
Brian Paul
4243ca1144 gallium: update some comments, remove others which are superfluous 2010-03-08 16:26:44 -07:00
Brian Paul
e799163dec vega: remove redundant DEFINES from .c.o rule 2010-03-08 16:26:44 -07:00
Brian Paul
f027d56129 llvmpipe/gallivm: checkpoint: array of pointers to mipmap levels
Change the texture data_ptr from just a single image pointer to an
array of image pointers, indexed by mipmap level.
We'll use this for mipmap filtering.
For now, the mipmap level is hard-coded to zero.
2010-03-08 16:26:44 -07:00
Brian Paul
891f7f4d52 nv: define NV30/40/50_MAX_TEXTURE_LEVELS 2010-03-08 16:26:44 -07:00
Brian Paul
ac2e849111 r300g: define R300_MAX_TEXTURE_LEVELS 2010-03-08 16:26:44 -07:00
Brian Paul
156585c12e svga: s/PIPE_MAX_TEXTURE_LEVELS/SVGA_MAX_TEXTURE_LEVELS/ 2010-03-08 16:26:44 -07:00
Brian Paul
e0d4f3202e i915g: define I915_MAX_TEXTURE_2D/3D_LEVELS 2010-03-08 16:26:44 -07:00
Brian Paul
e836f35369 i965g: define BRW_MAX_TEXTURE_2D/3D_LEVELS 2010-03-08 16:26:44 -07:00
Brian Paul
44eec28023 softpipe: define SP_MAX_TEXTURE_2D/3D_LEVELS 2010-03-08 16:26:43 -07:00
Brian Paul
d73fadf211 llvmpipe: define max texture levels 2010-03-08 16:26:43 -07:00
Brian Paul
e3b6f7b800 llvmpipe: rewrap for 80 columns 2010-03-08 16:26:43 -07:00
Eric Anholt
bc632d0437 i965: Fix up the handling of point sprite coordinate replacement.
The code was walking over the regs of pairs of attributes and checking
whether the attribute with a given reg index had point sprite enabled.
So the point sprite setup code was rarely even getting executed.
Instead, we need to determine which channels of a reg need point
sprite coordinate replacement.  In addition, it was multiplying the
attribute by 1/w, when it's supposed to cover (0, 1) in each direction
regardless of w, and it wasn't filling in the Z and W components of
the texcoord as specified.

Fixes piglit point-sprite and the spriteblast demo.  Bug #24431, #22245.
2010-03-08 14:23:18 -08:00
Ian Romanick
1e2e58c1f6 Set C++ indent too. 2010-03-08 13:02:58 -08:00
Zack Rusin
1d84808dc0 gallivm: fix a crash by making sure we set the has_mask flag correctly 2010-03-08 15:04:04 -05:00
Jesse Barnes
f2a035e5d8 xdemos/omlsync: improve OML WaitMsc test
Use the divisor/remainder for the WaitForMscOML call if a wait_interval
is passed.  Allows for testing of the WaitMSC paths in the server & DDX.
2010-03-08 11:31:26 -08:00
Keith Whitwell
3ab8211be4 gallium: remove xlib_driver::display_surface
Just use flush_frontbuffer directly.  The flush_frontbuffer routine has
been somewhat devalued recently, but it is actually just the right
interface for our needs.

It is in pipe_screen, meaning that any wrapping (eg trace module)
will get properly unwrapped before we try and use the pipe_surface
argument for real.

If a particular co-state-tracker needs to implement this itself, it
should organize a way to allow the winsys to call back up to its
level, rather than hijacking the driver-supplied implementation.
2010-03-08 19:23:10 +00:00
Keith Whitwell
c867c58c73 gallium: make it work 2010-03-08 19:21:27 +00:00
Keith Whitwell
99f11d0e18 gallium: introduce target directory
Currently there are still at least two functions bundled up inside the
winsys concept:

a) that of a backend resource manager, sometimes capable of performing
   present() operations,

b) the initialization code/routine for the whole driver stack.

The inclusion of (b) makes it difficult to share implementations of
(a) between different drivers.  For instance, a clean xlib winsys
could be of use for software-rasterized VG, GLES, EGL, etc, stacks.
But that is only true as long as there is no dependency from the
winsys to higher level code, as would be the case when we include (b)
in this component.

This change creates a new gallium/targets subtree, specifically for
implementing the glue needed to build individual driver stacks, and
moves that code out of a single example winsys, namely xlib.

Other drivers continue to build unchanged, but hopefully can migrate
to this structure over time.
2010-03-08 19:11:35 +00:00
Brian Paul
e5923a1240 Merge branch '7.8' 2010-03-08 11:43:20 -07:00
Keith Whitwell
90b3baf9b3 ws/xlib: remove dead files 2010-03-08 16:48:45 +00:00
Keith Whitwell
4350e025cf ws/xlib: fixup softpipe build 2010-03-08 16:48:39 +00:00
Keith Whitwell
1675d05f91 winsys/xlib: remove dependency on glx/x11 state tracker
Introduce xlib_drawable struct, pass this down to winsys instead of
having it use the internal data structures from glx/x11
2010-03-08 16:35:49 +00:00
Keith Whitwell
7f9a3959b0 ws/xlib: remove redundant declarations 2010-03-08 16:35:43 +00:00
Keith Whitwell
9b7c332d5f winsys/xlib: sketch of cell support 2010-03-08 16:35:37 +00:00
Alex Deucher
39ab5ae30c radeon/r200/r600: allow src and dst BOs to be placed in GTT during blit 2010-03-08 10:13:49 -05:00
Alex Deucher
7959274858 radeon/r200/r600: reset bos when validating buffers during blit 2010-03-08 10:04:02 -05:00
Alex Deucher
cbe28cb892 r600: recalculate point size, if point min/max size changes 2010-03-08 10:00:59 -05:00
Alex Deucher
97d40edb07 r600: no need to flush on context init 2010-03-08 09:57:26 -05:00
Keith Whitwell
3ca933623c Merge commit 'origin/gallium-winsys-handle-rebased' 2010-03-08 12:03:46 +00:00
Marek Olšák
9860f652e2 r300g: fix updating the tiling flags for the framebuffer state 2010-03-08 04:43:51 +01:00
Marek Olšák
6abe6145fb r300g: remove unnecessary state emissions and clean up 2010-03-08 04:34:27 +01:00
Francisco Jerez
ea027bda8e dri/nouveau: Split big client buffers in the indexed case too. 2010-03-07 22:40:11 +01:00
Francisco Jerez
75f52d1e52 dri/nouveau: Fix nv[12]x color sum. 2010-03-07 22:40:11 +01:00
Andrew Randrianasulu
6a15edfed3 dri/nv04: GL_EXT_secondary_color
Signed-off-by: Francisco Jerez <currojerez@riseup.net>
2010-03-07 22:40:10 +01:00
Andrew Randrianasulu
e64680bc1e dri/nouveau: Trivially add GL_NV_blend_square
Signed-off-by: Francisco Jerez <currojerez@riseup.net>
2010-03-07 22:40:10 +01:00
Francisco Jerez
5befb6f810 dri/nouveau: Check _ColorDrawBuffers[0] before emitting fb state. 2010-03-07 22:40:09 +01:00
Maciej Cencora
ba196a8318 radeon: handle compressed sRGB texture formats 2010-03-07 22:13:44 +01:00
Marek Olšák
6b39abb63a r300g: fix DRM errors 2010-03-07 16:24:17 +01:00
Marek Olšák
57a1395ec3 r300g: disable macrotiling when the texture height is smaller than a macrotile
Otherwise incorrect rendering occurs (no idea why).
2010-03-07 16:24:09 +01:00
Marek Olšák
b37d633375 r300g: enable micro- and macrotiling for all textures and renderbuffers 2010-03-07 16:23:42 +01:00
Marek Olšák
6c7fac846e r300g: add ability to tile/detile textures using blit during transfers 2010-03-07 15:39:37 +01:00
Marek Olšák
4012219f1f r300g: move r300_transfer to separate files 2010-03-07 15:39:37 +01:00
Maciej Cencora
ccbe3f0314 radeon: move glGetTexImage handlers to seperate file 2010-03-07 12:22:09 +01:00
Maciej Cencora
2b801066a1 radeon: Some possible improvements that I spoted in radeon_tiled_texture branch. 2010-03-07 12:21:30 +01:00
Maciej Cencora
d0ca5c3100 radeon: properly calculate rowstride for tiled images 2010-03-07 12:21:30 +01:00
Maciej Cencora
0d3835475f radeon: minor refactoring of mipmap code 2010-03-07 12:21:30 +01:00
Maciej Cencora
b078a613be radeon: add texture helper function 2010-03-07 12:21:30 +01:00
Maciej Cencora
8014b5f068 radeon: add some debugging info to sw tiling/untiling functions 2010-03-07 12:21:29 +01:00
Maciej Cencora
5fefca5dba radeon: add software untiling functions 2010-03-07 12:07:45 +01:00
Maciej Cencora
65faa27aa6 radeon: add tile size getter 2010-03-07 12:07:36 +01:00
Maciej Cencora
88a99bb305 radeon: added tiling functions 2010-03-07 12:07:29 +01:00
Maciej Cencora
9c0c6c26de r300: don't enable EXT_packed_depth_stencil
R300 hw doesn't support sampling from Z24_S8 or S8_Z24 formats.
2010-03-07 12:07:06 +01:00
Maciej Cencora
78eb4a2ea5 radeon: no need to emit full state twice after flush 2010-03-07 12:05:38 +01:00
Maciej Cencora
ea3494b98c r300: allow src and dst BOs to be placed in GTT during blit
Fixes some relocation failures
2010-03-07 12:05:01 +01:00
Maciej Cencora
c0a0a1933d r300: reset bos when validating buffers during blit 2010-03-07 12:04:44 +01:00
Maciej Cencora
9543f7f05f radeon: fallback to software in glCopyTexImage if blit isn't available 2010-03-07 12:04:30 +01:00
Maciej Cencora
042779dc85 r300: VAP flush is needed only when vertex program or constants are changed 2010-03-07 12:02:28 +01:00
Maciej Cencora
89ea402237 r300: recalculate point size, if point min/max size changes
Fixes two wine d3d9 unit tests
2010-03-07 12:00:48 +01:00
Maciej Cencora
e2d96b2bf8 r300: no need to flush on context init 2010-03-07 12:00:40 +01:00
Maciej Cencora
bbab68ae2d r300: remove unnecessary code
_tnl_UpdateFixedFunctionProgram is already called in r300_draw.c
2010-03-07 12:00:26 +01:00
Marek Olšák
690ded32cd r300g: disable emitting the HWTCL-related state when SWTCL is in use
Now SWTCL renders at least "something", we're close...
2010-03-07 03:41:00 +01:00
Marek Olšák
81992f37da r300g: resurrect r300_emit_vertex_buffer for SWTCL
Taken over from c9928ac3ee.
2010-03-07 03:33:41 +01:00
Marek Olšák
b03b70f658 r300g: validate buffers when using SWTCL 2010-03-07 02:44:57 +01:00
Marek Olšák
4f541db80c r300g: share the VS-output-mapping state with SWTCL
And associated cleanups.
2010-03-07 02:44:20 +01:00
Marek Olšák
6f4a19ca56 r300g: abort if FS compilation fails on non-debug builds 2010-03-07 01:12:57 +01:00
Marek Olšák
09653d65e9 r300g: minor cleanups after the no-rhw merge 2010-03-06 23:29:17 +01:00
Marek Olšák
c37a20416d r300g: clamp vertex max index according to currently bound buffers 2010-03-06 21:27:02 +01:00
José Fonseca
45ae4434b5 util: Use bitshift arithmetic to unpack pixels.
All test cases pass now.
2010-03-06 14:36:51 +00:00
José Fonseca
b999e9c03d progs/gallium/unit: Remove the test cases. 2010-03-06 14:36:51 +00:00
José Fonseca
212e7433db util: Move the format tests cases here so that they can be easily shared. 2010-03-06 14:36:51 +00:00
George Sapountzis
323238864f include/GL: drop more deprecated headers 2010-03-06 15:18:51 +02:00
José Fonseca
0869f0edf1 util: Several fixes to clamping and test.
All tests pass here except util_format_b5g5r5a1_unorm_unpack_4ub, due to
apparently a gcc 4.4.3 bug.
2010-03-06 12:50:47 +00:00
José Fonseca
f342ceca38 util: Fix the maximum value computation for SSCALED channels. 2010-03-06 12:49:14 +00:00
José Fonseca
cfde6c50ae util: Add a new flag, for formats that can be described as a bitmask. 2010-03-06 12:48:39 +00:00
José Fonseca
6718f03258 progs/gallium/unit: Skip test cases which cannot be represented in 4ub. 2010-03-06 12:47:49 +00:00
José Fonseca
709dffcd12 progs/gallium/unit: Use the shortened name to reconstruct the function being tested. 2010-03-06 12:47:01 +00:00
José Fonseca
4afae877e6 util: Add the shortened format name to the description. 2010-03-06 12:46:29 +00:00
José Fonseca
f133861a93 progs/gallium/unit: Cleanup/fix PIPE_FORMAT_R8SG8SB8UX8U_NORM test cases. 2010-03-06 12:45:36 +00:00
José Fonseca
69602b4dd3 gallivm: Add some notes about sampler static state construction.
Recover some logic to make state canonical, although it is admittedly very
shy compared with what could be done.

We really need an helper module to make state canonical.
2010-03-06 10:23:07 +00:00
José Fonseca
89258652b6 gallivm: Answer question/comment.
This reverts commit 71c0568952.
2010-03-06 09:45:05 +00:00
José Fonseca
44703217f7 scons: Refuse to use LLVM 2.7 for now.
LLVM's trunk is totally broken, at least for x86_64.

See http://www.llvm.org/bugs/show_bug.cgi?id=6429
2010-03-06 09:34:31 +00:00
José Fonseca
19a633310f scons: Fix version comparisons. 2010-03-06 09:34:31 +00:00
José Fonseca
ccf57af93f gallivm: Add a placeholder for TGSI_FILE_PREDICATE registers. 2010-03-06 09:34:31 +00:00
José Fonseca
32631b69f5 gallivm: Integrate udis86 on scons builds. 2010-03-06 09:34:31 +00:00
José Fonseca
9af74a38c7 gallivm: Generate valid IR for LLVM 2.7.
The signatures for pack intrinsics were made more consistent in this
version.
2010-03-06 09:34:31 +00:00
José Fonseca
8edc6b0bfc scons: Detect and support LLVM 2.7. 2010-03-06 09:34:31 +00:00
George Sapountzis
419f0f9d04 dri: drop MINIGLX_SOURCES (2) 2010-03-06 06:44:39 +02:00
George Sapountzis
8953bfce0e dri: drop MINIGLX_SOURCES 2010-03-06 06:44:38 +02:00
George Sapountzis
9009a854d1 config: drop WINDOW_SYSTEM var 2010-03-06 06:44:36 +02:00
Brian Paul
67277a6d11 docs: skeleton for 7.9 release notes 2010-03-05 17:36:34 -07:00
Brian Paul
6ce4a85e0b mesa: bump version to 7.9
Now that the 7.8 branch has been created Mesa/master will be version 7.9
2010-03-05 17:35:10 -07:00
Jon TURNEY
96ab4d2b84 glx: Move initialization of ext_list_first_time to where it's storage is allocated
Move the initialization of ext_list_first_time from all of the DRI loader's
CreateScreen routines, to where the storage for the screen config is
allocated.

It needs to get set in the screen-config even if DRI is forced off
using LIBGL_ALWAYS_INDIRECT, so that psc->direct_support is initialized
correctly, otherwise __glXExtensionBitIsEnabled() always returns FALSE

Specifically, this causes a problem with an X server which advertises
GLX<=1.2, and the GLX_SGIX_fbconfig extension.
glXGetFBConfigFromVisualSGIX() uses __glXExtensionBitIsEnabled() to
check if the GLX_SGIX_fbconfig extension is available, but that function
won't return correct information because that data has never been
initialized, because ext_list_first_time was never set...

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Signed-off-by: Brian Paul <brianp@vmware.com>
2010-03-05 17:11:23 -07:00
Christoph Bumiller
5024a39d11 nouveau: s/TEXTURE_USAGE_PRIMARY/TEXTURE_USAGE_SCANOUT 2010-03-05 18:18:49 +01:00
Keith Whitwell
3b6a991728 softpipe: fix constant buffer tracking after rework 2010-03-04 16:50:22 +00:00
Keith Whitwell
c549593931 gallium: remove redundant includes 2010-03-04 16:34:59 +00:00
Keith Whitwell
23e951d0da gallium: fix llvmpipe after winsys move 2010-03-04 16:23:05 +00:00
Keith Whitwell
94ce4eb3c2 softpipe: rework to use the llvmpipe winsys
Promote the llvmpipe winsys more or less unchanged to
state_trackers/sw_winsys.h.

Some minor breakages:
  - softpipe::texture_blanket is broken, but scheduled for removal anyway.
  - haven't fixed up g3vdl yet.
2010-03-04 16:09:33 +00:00
Jakob Bornecrantz
caa8a365c5 svga: Forgot one bit in rebase 2010-03-04 14:57:44 +00:00
Jakob Bornecrantz
3bd622d64e nouveau: Conversion to winsys handle
Not the best conversion that could be done.
2010-03-04 14:37:29 +00:00
Keith Whitwell
86e146df97 softpipe: remove dead get_texture_buffer function 2010-03-04 13:22:37 +00:00
Keith Whitwell
4b61fd22a8 r300g: remove dead r300_get_texture_buffer function 2010-03-04 13:22:21 +00:00
Corbin Simpson
4240987cec r300g: Make velem CSO actually work.
glxgears runs again.
2010-03-02 18:40:03 -08:00
Michal Krol
f59f28093e softpipe: Implement sampler view swizzling. 2010-03-02 12:03:24 +01:00
Michal Krol
5587097b53 util: Add pipe_get_tile_swizzle(). 2010-03-02 12:02:31 +01:00
Ian Romanick
18238de6c3 Make AST->HIR conversion a method of ast_node, re-enable 2010-03-01 13:49:10 -08:00
Roland Scheidegger
ddccf77974 nv40: adapt to vertex element cso 2010-03-01 20:11:47 +01:00
Roland Scheidegger
5bf4ff7dab nv30: adapt to vertex element cso 2010-03-01 20:11:36 +01:00
Roland Scheidegger
881be30836 identity: adapt to new vertex element cso 2010-03-01 18:48:05 +01:00
Roland Scheidegger
2918edb46a failover: adapt to new vertex element cso 2010-03-01 18:47:54 +01:00
Roland Scheidegger
470dbb84b8 i965g: adapt to new vertex element cso 2010-03-01 18:47:28 +01:00
Roland Scheidegger
8e2df0dcb9 i915g: adapt to new vertex element cso 2010-03-01 18:47:17 +01:00
Roland Scheidegger
4dfe2df629 cell: adapt to new vertex element cso 2010-03-01 18:47:04 +01:00
Roland Scheidegger
e9441e1f88 r300g: adapt to new vertex element cso 2010-03-01 18:46:49 +01:00
Roland Scheidegger
f897303855 llvmpipe: adapt to new vertex element cso 2010-03-01 18:46:39 +01:00
Roland Scheidegger
057427dd3e softpipe: adapt to new vertex element cso 2010-03-01 18:46:29 +01:00
Roland Scheidegger
b1676a953e svga: adapt to new vertex element cso 2010-03-01 18:46:12 +01:00
Roland Scheidegger
618e7e0c88 trace: adapt to new vertex element cso 2010-03-01 18:45:57 +01:00
Roland Scheidegger
9abef5ebfa vega: adapt to new vertex element cso 2010-03-01 18:45:46 +01:00
Roland Scheidegger
1f57069c68 vega: adapt to new vertex element cso 2010-03-01 18:45:25 +01:00
Roland Scheidegger
711476be29 xorg: adapt to new vertex element cso 2010-03-01 18:43:58 +01:00
Roland Scheidegger
8397c80646 gallium/docs: document new vertex element cso interface 2010-03-01 18:42:47 +01:00
Roland Scheidegger
49d3f662b6 vl: adapt to new vertex element cso interface 2010-03-01 18:41:03 +01:00
Roland Scheidegger
ac4abaecd5 util: adapt blitter code to new vertex element cso
The interface of util_draw_vertex_buffer looks a bit odd (calling code has to
set vertex elements but not vertex buffers) but due to the way cso state
handling generally works (can't re-bind original vertex element state easily
there) I guess that's ok for now.
2010-03-01 18:40:22 +01:00
Roland Scheidegger
18603a2f07 st/mesa: fix mesa statetracker adaption to new vertex elements interface 2010-03-01 18:36:19 +01:00
Jakob Bornecrantz
d160eed005 r300g: Conversion to to winsys handle 2010-03-01 16:05:59 +00:00
Jakob Bornecrantz
3a2358b6c6 svga: Conversion to winsys handle 2010-03-01 16:05:58 +00:00
Jakob Bornecrantz
45089784e3 i965g: Conversion to winsys handle 2010-03-01 16:05:48 +00:00
Jakob Bornecrantz
0e1eb1b876 i915g: Conversion to winsys handle 2010-03-01 16:05:40 +00:00
Jakob Bornecrantz
3f37f23d17 gallium: Reorg texture usage flags
Introduce a new shared usage and rename primary to scanout.
The display target usage is more of a windows concept and
doesn't mean the same thing as shared. Display target means
that the surface should be presentable, for softpipe this
means that it should be backed by a hardware buffer.
2010-03-01 16:05:35 +00:00
Jakob Bornecrantz
b2e94d05c9 gallium: Expose a opaque winsys handle and functions on pipe_screen
Instead of having these functions on a side interface like on
drm_api create a opaque winsys_handle that is to be passed down
into the winsys.

Currently the only thing ported to this new interface is drm_api,
and of that only the components that builds by default is ported.
All the drivers and any extra state trackers needs to be ported
before this can go into master.
2010-03-01 16:05:24 +00:00
Christoph Bumiller
f2656c3e3c nv50: adapt to vertex elements cso 2010-02-26 14:19:52 +01:00
Ian Romanick
d59673c9de autoconf for the ... 2010-02-25 17:17:23 -08:00
Ian Romanick
e41a1cd4d5 Replace tacky wrapper macros with tacky in-line type-casts 2010-02-25 12:49:55 -08:00
Ian Romanick
168890ce1b Convert to new interfaces so that it will compile
Convert TRUE and FALSE to true and false.  Convert
_mesa_ast_get_location to ast_node::get_location.
2010-02-25 12:24:40 -08:00
Christoph Bumiller
a69fdb84df nv30: function is called nv30_set_fragment_sampler_views, plural 2010-02-25 16:43:01 +01:00
Christoph Bumiller
44570063bf nv50: update to handle new sampler view state 2010-02-25 16:39:58 +01:00
Brian Paul
013dd29cca gallium/util: rewrap comment to fit in 80 columns 2010-02-25 08:05:53 -07:00
Brian Paul
9960b3ed4b gallium: added util/u_sampler.c to Makefile 2010-02-25 08:04:29 -07:00
Michal Krol
e81caade02 docs: Document sampler view entry points. 2010-02-25 15:33:15 +01:00
Michal Krol
9aeb206e17 cell: Fix after sampler view changes.
Did not test build.
2010-02-25 15:16:18 +01:00
Michal Krol
6a8961a247 nv50: Fix after sampler view changes.
Did not test build.
2010-02-25 14:56:19 +01:00
Michal Krol
512d3e691e nv40: Fix after sampler view changes.
Did not test build.
2010-02-25 14:46:31 +01:00
Michal Krol
e3c2a053cf nv30: Fix after sampler view changes.
Did not test build.
2010-02-25 14:40:56 +01:00
Michal Krol
06f6345790 docs: Update after sampler view changes. 2010-02-25 14:27:34 +01:00
Michal Krol
3e0181f473 python: Fix typo. 2010-02-25 14:21:50 +01:00
Michal Krol
92a8c42baa python: Fix after sampler view changes. 2010-02-25 14:19:54 +01:00
Ian Romanick
88349b22ca Add ast_expression_bin subclass of ast_expression
The ast_expression_bin subclass is used for all binary expressions
such as addition, subtraction, and comparisons.  Several other
subclasses are soon to follow.
2010-02-22 19:10:25 -08:00
Ian Romanick
89227f6ce4 Ignore all build products 2010-02-22 19:09:45 -08:00
Zack Rusin
c5c5cd7132 gallium/draw: initial code to properly support llvm in the draw module
code generate big chunks of the vertex pipeline in order to speed up
software vertex processing.
2010-02-22 22:02:58 -05:00
Ian Romanick
d5f4f09e76 Rename .cc files to .cpp 2010-02-22 18:43:08 -08:00
Ian Romanick
53d2774ee3 Initialize the node structure embedded in the ast_node 2010-02-22 13:22:10 -08:00
Ian Romanick
a87ac255cf Initial commit. lol 2010-02-22 13:19:34 -08:00
Roland Scheidegger
51d139f038 gallium: use cso state handling for pipe_vertex_element state 2010-02-18 16:36:25 +01:00
Roland Scheidegger
464a72dd41 gallium: remove redundant nr_components field from pipe_vertex_element
This is a property of the associated src_format pipe format.
Hence use util_format_get_nr_components to query this when necessary instead.
2010-02-17 16:44:38 +01:00
Roland Scheidegger
c2ad9e3801 util: new util_format_get_nr_components helper 2010-02-17 16:41:30 +01:00
michal
3a7314a78d gallium: Silence compiler warnings. 2009-12-10 09:29:15 +01:00
michal
1fb440beb9 llvmpipe: Fix after sampler view changes. 2009-12-10 09:23:15 +01:00
michal
3710a6f6cc r300: Fix after sampler view changes. 2009-12-10 08:46:19 +01:00
michal
875f6d20b1 i965: Fix after sampler view changes. 2009-12-10 08:05:45 +01:00
michal
1f5285f997 i915: Fix for sampler view changes. 2009-12-10 07:52:45 +01:00
Michal Krol
92b781c2dd trace: Fix after sampler view changes. 2010-02-23 19:18:27 +01:00
Michal Krol
ad230a1fb1 svga: Fix after sampler view changes. 2010-02-23 17:03:56 +01:00
Michal Krol
eb9c9efedf softpipe: Fix after sampler view changes. 2010-02-23 16:37:42 +01:00
Michal Krol
14a146c499 identity: Fix after sampler view changes. 2010-02-23 16:09:40 +01:00
Michal Krol
9187b25a15 failover: Fix after sampler view changes. 2010-02-23 16:09:10 +01:00
Michal Krol
f610656608 gallium: WIP: Introduce sampler views. 2010-02-19 19:00:26 +01:00
Michal Krol
3d0bfc6a4b tgsi: Make more exec opcodes look pretty. 2010-02-18 12:07:18 +01:00
Michal Krol
348d236afc tgsi: Change prototypes of micro opcodes to explicitly indicates number of args. 2010-02-18 12:07:15 +01:00
Michal Krol
9f952cceb4 tgsi: Rewrite exec implementations of NRM and NRM4. 2010-02-18 12:07:11 +01:00
4409 changed files with 629571 additions and 1349551 deletions

1
.gitignore vendored
View File

@@ -25,3 +25,4 @@ cscope*
.scon*
config.py
build
.dir-locals.el

228264
ChangeLog

File diff suppressed because it is too large Load Diff

281
Makefile
View File

@@ -2,10 +2,13 @@
TOP = .
SUBDIRS = src progs
SUBDIRS = src
# The git command below generates an empty string when we're not
# building in a GIT tree (i.e., building from a release tarball).
default: $(TOP)/configs/current
@$(TOP)/bin/extract_git_sha1
@for dir in $(SUBDIRS) ; do \
if [ -d $$dir ] ; then \
(cd $$dir && $(MAKE)) || exit 1 ; \
@@ -180,20 +183,29 @@ ultrix-gcc:
# Rules for making release tarballs
VERSION=7.8.1
VERSION=7.11-devel
DIRECTORY = Mesa-$(VERSION)
LIB_NAME = MesaLib-$(VERSION)
DEMO_NAME = MesaDemos-$(VERSION)
GLUT_NAME = MesaGLUT-$(VERSION)
# This is part of MAIN_FILES
MAIN_ES_FILES = \
$(DIRECTORY)/src/mesa/main/*.xml \
$(DIRECTORY)/src/mesa/main/*.py \
$(DIRECTORY)/src/mesa/main/*.dtd
MAIN_FILES = \
$(DIRECTORY)/Makefile* \
$(DIRECTORY)/configure \
$(DIRECTORY)/configure.ac \
$(DIRECTORY)/acinclude.m4 \
$(DIRECTORY)/aclocal.m4 \
$(DIRECTORY)/SConstruct \
$(DIRECTORY)/common.py \
$(DIRECTORY)/scons/*py \
$(DIRECTORY)/bin/config.guess \
$(DIRECTORY)/bin/config.sub \
$(DIRECTORY)/bin/extract_git_sha1 \
$(DIRECTORY)/bin/install-sh \
$(DIRECTORY)/bin/mklib \
$(DIRECTORY)/bin/minstall \
@@ -204,7 +216,6 @@ MAIN_FILES = \
$(DIRECTORY)/docs/README.* \
$(DIRECTORY)/docs/RELNOTES* \
$(DIRECTORY)/docs/*.spec \
$(DIRECTORY)/include/GL/internal/glcore.h \
$(DIRECTORY)/include/GL/gl.h \
$(DIRECTORY)/include/GL/glext.h \
$(DIRECTORY)/include/GL/gl_mangle.h \
@@ -215,37 +226,43 @@ MAIN_FILES = \
$(DIRECTORY)/include/GL/glx_mangle.h \
$(DIRECTORY)/include/GL/glfbdev.h \
$(DIRECTORY)/include/GL/mesa_wgl.h \
$(DIRECTORY)/include/GL/mglmesa.h \
$(DIRECTORY)/include/GL/osmesa.h \
$(DIRECTORY)/include/GL/vms_x_fix.h \
$(DIRECTORY)/include/GL/wglext.h \
$(DIRECTORY)/include/GL/wmesa.h \
$(DIRECTORY)/include/VG/*.h \
$(DIRECTORY)/include/KHR/*.h \
$(DIRECTORY)/include/pci_ids/*.h \
$(DIRECTORY)/include/c99/*.h \
$(DIRECTORY)/src/getopt/SConscript \
$(DIRECTORY)/src/getopt/getopt*.[ch] \
$(DIRECTORY)/src/glsl/Makefile \
$(DIRECTORY)/src/glsl/Makefile.template \
$(DIRECTORY)/src/glsl/SConscript \
$(DIRECTORY)/src/glsl/*/Makefile \
$(DIRECTORY)/src/glsl/*/*.[ch] \
$(DIRECTORY)/src/glsl/*.[ch] \
$(DIRECTORY)/src/glsl/*.ll \
$(DIRECTORY)/src/glsl/*.yy \
$(DIRECTORY)/src/glsl/*.[cly]pp \
$(DIRECTORY)/src/glsl/README \
$(DIRECTORY)/src/glsl/glcpp/*.[chly] \
$(DIRECTORY)/src/glsl/glcpp/README \
$(DIRECTORY)/src/glsl/builtins \
$(DIRECTORY)/src/Makefile \
$(DIRECTORY)/src/SConscript \
$(DIRECTORY)/src/mesa/Makefile* \
$(DIRECTORY)/src/mesa/SConscript \
$(DIRECTORY)/src/mesa/sources.mak \
$(DIRECTORY)/src/mesa/descrip.mms \
$(DIRECTORY)/src/mesa/gl.pc.in \
$(DIRECTORY)/src/mesa/osmesa.pc.in \
$(DIRECTORY)/src/mesa/depend \
$(MAIN_ES_FILES) \
$(DIRECTORY)/src/mesa/main/*.[chS] \
$(DIRECTORY)/src/mesa/main/*.cpp \
$(DIRECTORY)/src/mesa/main/descrip.mms \
$(DIRECTORY)/src/mesa/glapi/*.[chS] \
$(DIRECTORY)/src/mesa/math/*.[ch] \
$(DIRECTORY)/src/mesa/math/descrip.mms \
$(DIRECTORY)/src/mesa/shader/*.[chly] \
$(DIRECTORY)/src/mesa/shader/Makefile \
$(DIRECTORY)/src/mesa/shader/descrip.mms \
$(DIRECTORY)/src/mesa/shader/slang/*.[ch] \
$(DIRECTORY)/src/mesa/shader/slang/descrip.mms \
$(DIRECTORY)/src/mesa/shader/slang/library/*.gc \
$(DIRECTORY)/src/mesa/shader/slang/library/Makefile \
$(DIRECTORY)/src/mesa/program/*.[chly] \
$(DIRECTORY)/src/mesa/program/*.cpp \
$(DIRECTORY)/src/mesa/program/descrip.mms \
$(DIRECTORY)/src/mesa/swrast/*.[ch] \
$(DIRECTORY)/src/mesa/swrast/descrip.mms \
$(DIRECTORY)/src/mesa/swrast_setup/*.[ch] \
@@ -269,13 +286,14 @@ MAIN_FILES = \
$(DIRECTORY)/src/mesa/drivers/osmesa/descrip.mms \
$(DIRECTORY)/src/mesa/drivers/osmesa/osmesa.def \
$(DIRECTORY)/src/mesa/drivers/osmesa/*.[ch] \
$(DIRECTORY)/src/mesa/drivers/dri/r300/compiler/*.[ch] \
$(DIRECTORY)/src/mesa/drivers/dri/r300/compiler/Makefile \
$(DIRECTORY)/src/mesa/drivers/dri/r300/compiler/SConscript \
$(DIRECTORY)/src/mesa/drivers/windows/*/*.[ch] \
$(DIRECTORY)/src/mesa/drivers/windows/*/*.def \
$(DIRECTORY)/src/mesa/drivers/x11/Makefile \
$(DIRECTORY)/src/mesa/drivers/x11/descrip.mms \
$(DIRECTORY)/src/mesa/drivers/x11/*.[ch] \
$(DIRECTORY)/src/mesa/drivers/glslcompiler/Makefile \
$(DIRECTORY)/src/mesa/drivers/glslcompiler/glslcompiler.c \
$(DIRECTORY)/src/mesa/ppc/*.[ch] \
$(DIRECTORY)/src/mesa/sparc/*.[chS] \
$(DIRECTORY)/src/mesa/x86/Makefile \
@@ -283,31 +301,37 @@ MAIN_FILES = \
$(DIRECTORY)/src/mesa/x86/*.S \
$(DIRECTORY)/src/mesa/x86/rtasm/*.[ch] \
$(DIRECTORY)/src/mesa/x86-64/*.[chS] \
$(DIRECTORY)/src/mesa/x86-64/Makefile \
$(DIRECTORY)/progs/Makefile \
$(DIRECTORY)/progs/util/README \
$(DIRECTORY)/progs/util/*.[ch] \
$(DIRECTORY)/progs/util/sampleMakefile \
$(DIRECTORY)/windows/VC8/
$(DIRECTORY)/src/mesa/x86-64/Makefile
ES_FILES = \
MAPI_FILES = \
$(DIRECTORY)/include/GLES/*.h \
$(DIRECTORY)/include/GLES2/*.h \
$(DIRECTORY)/src/mesa/glapi/gen/*.xml \
$(DIRECTORY)/src/mesa/glapi/gen/*.py \
$(DIRECTORY)/src/mesa/glapi/gen/*.dtd \
$(DIRECTORY)/src/mesa/es/glapi/Makefile \
$(DIRECTORY)/src/mesa/es/glapi/*.xml \
$(DIRECTORY)/src/mesa/es/glapi/*.py \
$(DIRECTORY)/src/mesa/es/state_tracker/*.[ch] \
$(DIRECTORY)/src/mesa/es/main/*.[ch] \
$(DIRECTORY)/src/mesa/es/main/*.xml \
$(DIRECTORY)/src/mesa/es/main/*.py \
$(DIRECTORY)/src/mesa/es/main/*.dtd \
$(DIRECTORY)/src/mesa/es/Makefile \
$(DIRECTORY)/src/mesa/es/sources.mak \
$(DIRECTORY)/include/VG/*.h \
$(DIRECTORY)/src/mapi/es?api/Makefile \
$(DIRECTORY)/src/mapi/es?api/*.pc.in \
$(DIRECTORY)/src/mapi/glapi/gen/Makefile \
$(DIRECTORY)/src/mapi/glapi/gen/*.xml \
$(DIRECTORY)/src/mapi/glapi/gen/*.py \
$(DIRECTORY)/src/mapi/glapi/gen/*.dtd \
$(DIRECTORY)/src/mapi/glapi/gen-es/Makefile \
$(DIRECTORY)/src/mapi/glapi/gen-es/*.xml \
$(DIRECTORY)/src/mapi/glapi/gen-es/*.py \
$(DIRECTORY)/src/mapi/glapi/Makefile \
$(DIRECTORY)/src/mapi/glapi/SConscript \
$(DIRECTORY)/src/mapi/glapi/sources.mak \
$(DIRECTORY)/src/mapi/glapi/*.[chS] \
$(DIRECTORY)/src/mapi/mapi/mapi_abi.py \
$(DIRECTORY)/src/mapi/mapi/sources.mak \
$(DIRECTORY)/src/mapi/mapi/*.[ch] \
$(DIRECTORY)/src/mapi/shared-glapi/SConscript \
$(DIRECTORY)/src/mapi/shared-glapi/Makefile \
$(DIRECTORY)/src/mapi/vgapi/Makefile \
$(DIRECTORY)/src/mapi/vgapi/SConscript \
$(DIRECTORY)/src/mapi/vgapi/vgapi.csv \
$(DIRECTORY)/src/mapi/vgapi/vg.pc.in
EGL_FILES = \
$(DIRECTORY)/include/KHR/*.h \
$(DIRECTORY)/include/EGL/*.h \
$(DIRECTORY)/src/egl/Makefile \
$(DIRECTORY)/src/egl/*/Makefile \
@@ -315,47 +339,62 @@ EGL_FILES = \
$(DIRECTORY)/src/egl/*/*.[ch] \
$(DIRECTORY)/src/egl/*/*/Makefile \
$(DIRECTORY)/src/egl/*/*/*.[ch] \
$(DIRECTORY)/src/egl/wayland/wayland-drm/protocol/*.xml \
$(DIRECTORY)/src/egl/wayland/wayland-egl/*.pc.in \
$(DIRECTORY)/src/egl/main/SConscript \
$(DIRECTORY)/src/egl/main/*.pc.in \
$(DIRECTORY)/src/egl/main/*.def
GBM_FILES = \
$(DIRECTORY)/src/gbm/Makefile \
$(DIRECTORY)/src/gbm/main/*.pc.in \
$(DIRECTORY)/src/gbm/main/*.[ch] \
$(DIRECTORY)/src/gbm/main/Makefile \
$(DIRECTORY)/src/gbm/backends/Makefile \
$(DIRECTORY)/src/gbm/backends/Makefile.template \
$(DIRECTORY)/src/gbm/backends/*/*.[ch] \
$(DIRECTORY)/src/gbm/backends/*/Makefile \
GALLIUM_FILES = \
$(DIRECTORY)/src/mesa/state_tracker/*[ch] \
$(DIRECTORY)/src/gallium/Makefile \
$(DIRECTORY)/src/gallium/Makefile.template \
$(DIRECTORY)/src/gallium/SConscript \
$(DIRECTORY)/src/gallium/targets/Makefile.dri \
$(DIRECTORY)/src/gallium/targets/Makefile.xorg \
$(DIRECTORY)/src/gallium/targets/SConscript.dri \
$(DIRECTORY)/src/gallium/*/Makefile \
$(DIRECTORY)/src/gallium/*/SConscript \
$(DIRECTORY)/src/gallium/*/*/Makefile \
$(DIRECTORY)/src/gallium/*/*/Makefile.egl \
$(DIRECTORY)/src/gallium/*/*/Makefile.template \
$(DIRECTORY)/src/gallium/*/*/SConscript \
$(DIRECTORY)/src/gallium/*/*/*.[ch] \
$(DIRECTORY)/src/gallium/auxiliary/gallivm/*.cpp \
$(DIRECTORY)/src/gallium/*/*/*.py \
$(DIRECTORY)/src/gallium/*/*/*.csv \
$(DIRECTORY)/src/gallium/*/*/*/Makefile \
$(DIRECTORY)/src/gallium/*/*/*/SConscript \
$(DIRECTORY)/src/gallium/*/*/*/*.[ch] \
$(DIRECTORY)/src/gallium/*/*/*/*.py \
$(DIRECTORY)/src/gallium/*/*/*/*/Makefile \
$(DIRECTORY)/src/gallium/*/*/*/*/*.[ch] \
$(DIRECTORY)/src/gallium/*/*/*/*.py
APPLE_DRI_FILES = \
$(DIRECTORY)/src/glx/apple/Makefile \
$(DIRECTORY)/src/glx/apple/*.[ch]
DRI_FILES = \
$(DIRECTORY)/include/GL/internal/dri_interface.h \
$(DIRECTORY)/include/GL/internal/glcore.h \
$(DIRECTORY)/include/GL/internal/sarea.h \
$(DIRECTORY)/src/glx/Makefile \
$(DIRECTORY)/src/glx/Makefile \
$(DIRECTORY)/src/glx/*.[ch] \
$(DIRECTORY)/src/mesa/drivers/dri/Makefile \
$(DIRECTORY)/src/mesa/drivers/dri/Makefile.template \
$(APPLE_DRI_FILES) \
$(DIRECTORY)/src/mesa/drivers/dri/Makefile* \
$(DIRECTORY)/src/mesa/drivers/dri/dri.pc.in \
$(DIRECTORY)/src/mesa/drivers/dri/common/xmlpool/*.[ch] \
$(DIRECTORY)/src/mesa/drivers/dri/common/xmlpool/*.po \
$(DIRECTORY)/src/mesa/drivers/dri/*/*.[chS] \
$(DIRECTORY)/src/mesa/drivers/dri/*/*.cpp \
$(DIRECTORY)/src/mesa/drivers/dri/*/*/*.[chS] \
$(DIRECTORY)/src/mesa/drivers/dri/*/Makefile \
$(DIRECTORY)/src/mesa/drivers/dri/*/*/Makefile \
$(DIRECTORY)/src/mesa/drivers/dri/*/Doxyfile \
$(DIRECTORY)/src/mesa/drivers/dri/*/server/*.[ch]
$(DIRECTORY)/src/mesa/drivers/dri/*/Doxyfile
SGI_GLU_FILES = \
$(DIRECTORY)/src/glu/Makefile \
@@ -387,63 +426,11 @@ GLW_FILES = \
$(DIRECTORY)/src/glw/glw.pc.in \
$(DIRECTORY)/src/glw/depend
GLEW_FILES = \
$(DIRECTORY)/include/GL/glew.h \
$(DIRECTORY)/include/GL/glxew.h \
$(DIRECTORY)/include/GL/wglew.h \
$(DIRECTORY)/src/glew/*.c \
$(DIRECTORY)/src/glew/Makefile \
$(DIRECTORY)/src/glew/SConscript \
$(DIRECTORY)/src/glew/LICENSE.txt
DEMO_FILES = \
$(GLEW_FILES) \
$(DIRECTORY)/progs/beos/*.cpp \
$(DIRECTORY)/progs/beos/Makefile \
$(DIRECTORY)/progs/images/*.rgb \
$(DIRECTORY)/progs/images/*.rgba \
$(DIRECTORY)/progs/demos/Makefile* \
$(DIRECTORY)/progs/demos/descrip.mms \
$(DIRECTORY)/progs/demos/*.[ch] \
$(DIRECTORY)/progs/demos/*.cxx \
$(DIRECTORY)/progs/demos/*.dat \
$(DIRECTORY)/progs/demos/README \
$(DIRECTORY)/progs/egl/Makefile \
$(DIRECTORY)/progs/egl/*.[ch] \
$(DIRECTORY)/progs/es1/*/Makefile \
$(DIRECTORY)/progs/es1/*/*.[ch] \
$(DIRECTORY)/progs/es2/*/Makefile \
$(DIRECTORY)/progs/es2/*/*.[ch] \
$(DIRECTORY)/progs/openvg/*/Makefile \
$(DIRECTORY)/progs/openvg/*/*.[ch] \
$(DIRECTORY)/progs/fbdev/Makefile \
$(DIRECTORY)/progs/fbdev/glfbdevtest.c \
$(DIRECTORY)/progs/objviewer/*.[ch] \
$(DIRECTORY)/progs/objviewer/*.obj \
$(DIRECTORY)/progs/objviewer/*.mtl \
$(DIRECTORY)/progs/objviewer/*.rgb \
$(DIRECTORY)/progs/objviewer/Makefile \
$(DIRECTORY)/progs/objviewer/README.txt \
$(DIRECTORY)/progs/osdemos/Makefile \
$(DIRECTORY)/progs/osdemos/*.c \
$(DIRECTORY)/progs/xdemos/Makefile* \
$(DIRECTORY)/progs/xdemos/*.[chf] \
$(DIRECTORY)/progs/redbook/Makefile* \
$(DIRECTORY)/progs/redbook/README \
$(DIRECTORY)/progs/redbook/*.[ch] \
$(DIRECTORY)/progs/samples/Makefile* \
$(DIRECTORY)/progs/samples/README \
$(DIRECTORY)/progs/samples/*.c \
$(DIRECTORY)/progs/glsl/Makefile* \
$(DIRECTORY)/progs/glsl/*.c \
$(DIRECTORY)/progs/glsl/*.frag \
$(DIRECTORY)/progs/glsl/*.vert \
$(DIRECTORY)/progs/glsl/*.shtest
GLUT_FILES = \
$(DIRECTORY)/include/GL/glut.h \
$(DIRECTORY)/include/GL/glutf90.h \
$(DIRECTORY)/src/glut/glx/Makefile* \
$(DIRECTORY)/src/glut/glx/SConscript \
$(DIRECTORY)/src/glut/glx/depend \
$(DIRECTORY)/src/glut/glx/glut.pc.in \
$(DIRECTORY)/src/glut/glx/*def \
@@ -462,18 +449,32 @@ DEPEND_FILES = \
LIB_FILES = \
$(MAIN_FILES) \
$(MAPI_FILES) \
$(ES_FILES) \
$(EGL_FILES) \
$(GBM_FILES) \
$(GALLIUM_FILES) \
$(DRI_FILES) \
$(SGI_GLU_FILES) \
$(GLW_FILES)
# Everything for new a Mesa release:
tarballs: rm_depend configure aclocal.m4 lib_gz demo_gz glut_gz \
lib_bz2 demo_bz2 glut_bz2 lib_zip demo_zip glut_zip md5
parsers: configure
-@touch $(TOP)/configs/current
$(MAKE) -C src/glsl glsl_parser.cpp glsl_parser.h glsl_lexer.cpp
$(MAKE) -C src/glsl/glcpp glcpp-lex.c glcpp-parse.c glcpp-parse.h
$(MAKE) -C src/mesa/program lex.yy.c program_parse.tab.c program_parse.tab.h
# Everything for new a Mesa release:
ARCHIVES = $(LIB_NAME).tar.gz \
$(LIB_NAME).tar.bz2 \
$(LIB_NAME).zip \
$(GLUT_NAME).tar.gz \
$(GLUT_NAME).tar.bz2 \
$(GLUT_NAME).zip
tarballs: md5
rm -f ../$(LIB_NAME).tar
# Helper for autoconf builds
ACLOCAL = aclocal
@@ -482,7 +483,7 @@ AUTOCONF = autoconf
AC_FLAGS =
aclocal.m4: configure.ac acinclude.m4
$(ACLOCAL) $(ACLOCAL_FLAGS)
configure: configure.ac aclocal.m4 acinclude.m4
configure: rm_depend configure.ac aclocal.m4 acinclude.m4
$(AUTOCONF) $(AC_FLAGS)
rm_depend:
@@ -491,76 +492,46 @@ rm_depend:
touch $$dep ; \
done
rm_config:
rm_config: parsers
rm -f configs/current
rm -f configs/autoconf
lib_gz: rm_config
cd .. ; \
tar -cf $(LIB_NAME).tar $(LIB_FILES) ; \
gzip $(LIB_NAME).tar ; \
mv $(LIB_NAME).tar.gz $(DIRECTORY)
$(LIB_NAME).tar: rm_config
cd .. ; tar -cf $(DIRECTORY)/$(LIB_NAME).tar $(LIB_FILES)
demo_gz:
cd .. ; \
tar -cf $(DEMO_NAME).tar $(DEMO_FILES) ; \
gzip $(DEMO_NAME).tar ; \
mv $(DEMO_NAME).tar.gz $(DIRECTORY)
$(LIB_NAME).tar.gz: $(LIB_NAME).tar
gzip --stdout --best $(LIB_NAME).tar > $(LIB_NAME).tar.gz
glut_gz:
cd .. ; \
tar -cf $(GLUT_NAME).tar $(GLUT_FILES) ; \
gzip $(GLUT_NAME).tar ; \
mv $(GLUT_NAME).tar.gz $(DIRECTORY)
$(GLUT_NAME).tar: rm_depend
cd .. ; tar -cf $(DIRECTORY)/$(GLUT_NAME).tar $(GLUT_FILES)
lib_bz2: rm_config
cd .. ; \
tar -cf $(LIB_NAME).tar $(LIB_FILES) ; \
bzip2 $(LIB_NAME).tar ; \
mv $(LIB_NAME).tar.bz2 $(DIRECTORY)
$(GLUT_NAME).tar.gz: $(GLUT_NAME).tar
gzip --stdout --best $(GLUT_NAME).tar > $(GLUT_NAME).tar.gz
demo_bz2:
cd .. ; \
tar -cf $(DEMO_NAME).tar $(DEMO_FILES) ; \
bzip2 $(DEMO_NAME).tar ; \
mv $(DEMO_NAME).tar.bz2 $(DIRECTORY)
$(LIB_NAME).tar.bz2: $(LIB_NAME).tar
bzip2 --stdout --best $(LIB_NAME).tar > $(LIB_NAME).tar.bz2
glut_bz2:
cd .. ; \
tar -cf $(GLUT_NAME).tar $(GLUT_FILES) ; \
bzip2 $(GLUT_NAME).tar ; \
mv $(GLUT_NAME).tar.bz2 $(DIRECTORY)
$(GLUT_NAME).tar.bz2: $(GLUT_NAME).tar
bzip2 --stdout --best $(GLUT_NAME).tar > $(GLUT_NAME).tar.bz2
lib_zip: rm_config
$(LIB_NAME).zip: rm_config
rm -f $(LIB_NAME).zip ; \
cd .. ; \
zip -qr $(LIB_NAME).zip $(LIB_FILES) ; \
mv $(LIB_NAME).zip $(DIRECTORY)
demo_zip:
rm -f $(DEMO_NAME).zip ; \
cd .. ; \
zip -qr $(DEMO_NAME).zip $(DEMO_FILES) ; \
mv $(DEMO_NAME).zip $(DIRECTORY)
glut_zip:
$(GLUT_NAME).zip:
rm -f $(GLUT_NAME).zip ; \
cd .. ; \
zip -qr $(GLUT_NAME).zip $(GLUT_FILES) ; \
mv $(GLUT_NAME).zip $(DIRECTORY)
md5:
md5: $(ARCHIVES)
@-md5sum $(LIB_NAME).tar.gz
@-md5sum $(LIB_NAME).tar.bz2
@-md5sum $(LIB_NAME).zip
@-md5sum $(DEMO_NAME).tar.gz
@-md5sum $(DEMO_NAME).tar.bz2
@-md5sum $(DEMO_NAME).zip
@-md5sum $(GLUT_NAME).tar.gz
@-md5sum $(GLUT_NAME).tar.bz2
@-md5sum $(GLUT_NAME).zip
.PHONY: tarballs rm_depend rm_config md5 \
lib_gz demo_gz glut_gz \
lib_bz2 demo_bz2 glut_bz2 \
lib_zip demo_zip glut_zip
.PHONY: tarballs rm_depend rm_config md5

View File

@@ -3,14 +3,14 @@
#
# For example, invoke scons as
#
# scons debug=1 dri=0 machine=x86
# scons build=debug llvm=yes machine=x86
#
# to set configuration variables. Or you can write those options to a file
# named config.py:
#
# # config.py
# debug=1
# dri=0
# build='debug'
# llvm=True
# machine='x86'
#
# Invoke
@@ -30,31 +30,8 @@ import common
#######################################################################
# Configuration options
default_statetrackers = 'mesa'
if common.default_platform in ('linux', 'freebsd', 'darwin'):
default_drivers = 'softpipe,failover,svga,i915,i965,trace,identity,llvmpipe'
default_winsys = 'xlib'
elif common.default_platform in ('winddk',):
default_drivers = 'softpipe,svga,i915,i965,trace,identity'
default_winsys = 'all'
elif common.default_platform in ('embedded',):
default_drivers = 'softpipe,llvmpipe'
default_winsys = 'xlib'
else:
default_drivers = 'all'
default_winsys = 'all'
opts = Variables('config.py')
common.AddOptions(opts)
opts.Add(ListVariable('statetrackers', 'state trackers to build', default_statetrackers,
['mesa', 'python', 'xorg']))
opts.Add(ListVariable('drivers', 'pipe drivers to build', default_drivers,
['softpipe', 'failover', 'svga', 'i915', 'i965', 'trace', 'r300', 'identity', 'llvmpipe']))
opts.Add(ListVariable('winsys', 'winsys drivers to build', default_winsys,
['xlib', 'vmware', 'intel', 'i965', 'gdi', 'radeon']))
opts.Add(EnumVariable('MSVS_VERSION', 'MS Visual C++ version', None, allowed_values=('7.1', '8.0', '9.0')))
env = Environment(
options = opts,
@@ -63,137 +40,96 @@ env = Environment(
ENV = os.environ,
)
if os.environ.has_key('CC'):
env['CC'] = os.environ['CC']
if os.environ.has_key('CFLAGS'):
env['CCFLAGS'] += SCons.Util.CLVar(os.environ['CFLAGS'])
if os.environ.has_key('CXX'):
env['CXX'] = os.environ['CXX']
if os.environ.has_key('CXXFLAGS'):
env['CXXFLAGS'] += SCons.Util.CLVar(os.environ['CXXFLAGS'])
if os.environ.has_key('LDFLAGS'):
env['LINKFLAGS'] += SCons.Util.CLVar(os.environ['LDFLAGS'])
opts.Save('config.py', env)
# Backwards compatability with old target configuration variable
try:
targets = ARGUMENTS['targets']
except KeyError:
pass
else:
targets = targets.split(',')
print 'scons: warning: targets option is deprecated; pass the targets on their own such as'
print
print ' scons %s' % ' '.join(targets)
print
COMMAND_LINE_TARGETS.append(targets)
Help(opts.GenerateHelpText(env))
# replicate options values in local variables
debug = env['debug']
dri = env['dri']
machine = env['machine']
platform = env['platform']
drawllvm = 'llvmpipe' in env['drivers']
# LLVM support in the Draw module
if drawllvm:
env.Tool('llvm')
if not env.has_key('LLVM_VERSION'):
drawllvm = False
# derived options
x86 = machine == 'x86'
ppc = machine == 'ppc'
gcc = platform in ('linux', 'freebsd', 'darwin', 'embedded')
msvc = platform in ('windows', 'winddk')
Export([
'debug',
'x86',
'ppc',
'dri',
'drawllvm',
'platform',
'gcc',
'msvc',
])
# fail early for a common error on windows
if env['gles']:
try:
import libxml2
except ImportError:
raise SCons.Errors.UserError, "GLES requires libxml2-python to build"
#######################################################################
# Environment setup
# Always build trace driver
if 'trace' not in env['drivers']:
env['drivers'].append('trace')
# Includes
env.Append(CPPPATH = [
env.Prepend(CPPPATH = [
'#/include',
])
env.Append(CPPPATH = [
'#/src/gallium/include',
'#/src/gallium/auxiliary',
'#/src/gallium/drivers',
'#/src/gallium/winsys',
])
if env['msvc']:
env.Append(CPPPATH = ['#include/c99'])
# Embedded
if platform == 'embedded':
env.Append(CPPDEFINES = [
'_POSIX_SOURCE',
('_POSIX_C_SOURCE', '199309L'),
'_SVID_SOURCE',
'_BSD_SOURCE',
'_GNU_SOURCE',
'PTHREADS',
])
env.Append(LIBS = [
'm',
'pthread',
'dl',
])
# Posix
if platform in ('posix', 'linux', 'freebsd', 'darwin'):
env.Append(CPPDEFINES = [
'_POSIX_SOURCE',
('_POSIX_C_SOURCE', '199309L'),
'_SVID_SOURCE',
'_BSD_SOURCE',
'_GNU_SOURCE',
'PTHREADS',
'HAVE_POSIX_MEMALIGN',
])
if platform == 'darwin':
env.Append(CPPDEFINES = ['_DARWIN_C_SOURCE'])
env.Append(CPPPATH = ['/usr/X11R6/include'])
env.Append(LIBPATH = ['/usr/X11R6/lib'])
env.Append(LIBS = [
'm',
'pthread',
'expat',
'dl',
])
# DRI
if dri:
env.ParseConfig('pkg-config --cflags --libs libdrm')
env.Append(CPPDEFINES = [
('USE_EXTERNAL_DXTN_LIB', '1'),
'IN_DRI_DRIVER',
'GLX_DIRECT_RENDERING',
'GLX_INDIRECT_RENDERING',
])
# LLVM support in the Draw module
if drawllvm:
env.Append(CPPDEFINES = ['DRAW_LLVM'])
# libGL
if platform in ('linux', 'freebsd', 'darwin'):
env.Append(LIBS = [
'X11',
'Xext',
'Xxf86vm',
'Xdamage',
'Xfixes',
])
# for debugging
#print env.Dump()
Export('env')
#######################################################################
# Invoke host SConscripts
#
# For things that are meant to be run on the native host build machine, instead
# of the target machine.
#
# Create host environent
if env['crosscompile'] and not env['embedded']:
host_env = Environment(
options = opts,
# no tool used
tools = [],
toolpath = ['#scons'],
ENV = os.environ,
)
# Override options
host_env['platform'] = common.host_platform
host_env['machine'] = common.host_machine
host_env['toolchain'] = 'default'
host_env['llvm'] = False
host_env.Tool('gallium')
host_env['hostonly'] = True
assert host_env['crosscompile'] == False
if host_env['msvc']:
host_env.Append(CPPPATH = ['#include/c99'])
target_env = env
env = host_env
Export('env')
SConscript(
'src/SConscript',
variant_dir = host_env['build_dir'],
duplicate = 0, # http://www.scons.org/doc/0.97/HTML/scons-user/x2261.html
)
env = target_env
Export('env')
#######################################################################
# Invoke SConscripts
@@ -201,38 +137,24 @@ Export('env')
# TODO: Build several variants at the same time?
# http://www.scons.org/wiki/SimultaneousVariantBuilds
if env['platform'] != common.default_platform:
# GLSL code has to be built twice -- one for the host OS, another for the target OS...
host_env = Environment(
# options are ignored
# default tool is used
tools = ['default', 'custom'],
toolpath = ['#scons'],
ENV = os.environ,
)
host_env['platform'] = common.default_platform
host_env['machine'] = common.default_machine
host_env['debug'] = env['debug']
SConscript(
'src/glsl/SConscript',
variant_dir = os.path.join(env['build'], 'host'),
duplicate = 0, # http://www.scons.org/doc/0.97/HTML/scons-user/x2261.html
exports={'env':host_env},
)
SConscript(
'src/SConscript',
variant_dir = env['build'],
variant_dir = env['build_dir'],
duplicate = 0 # http://www.scons.org/doc/0.97/HTML/scons-user/x2261.html
)
env.Default('src')
SConscript(
'progs/SConscript',
variant_dir = os.path.join('progs', env['build']),
duplicate = 0 # http://www.scons.org/doc/0.97/HTML/scons-user/x2261.html
)
########################################################################
# List all aliases
try:
from SCons.Node.Alias import default_ans
except ImportError:
pass
else:
aliases = default_ans.keys()
aliases.sort()
env.Help('\n')
env.Help('Recognized targets:\n')
for alias in aliases:
env.Help(' %s\n' % alias)

20
bin/extract_git_sha1 Executable file
View File

@@ -0,0 +1,20 @@
#!/bin/sh
if [ ! -f src/mesa/main/git_sha1.h ]; then
touch src/mesa/main/git_sha1.h
fi
if [ ! -d .git ]; then
exit
fi
if which git > /dev/null; then
# Extract the 7-digit "short" SHA1 for the current HEAD, convert
# it to a string, and wrap it in a #define. This is used in
# src/mesa/main/version.c to put the GIT SHA1 in the GL_VERSION string.
git log -n 1 --oneline |\
sed 's/^\([^ ]*\) .*/#define MESA_GIT_SHA1 "git-\1"/' \
> src/mesa/main/git_sha1.h.tmp
if ! cmp -s src/mesa/main/git_sha1.h.tmp src/mesa/main/git_sha1.h; then
mv src/mesa/main/git_sha1.h.tmp src/mesa/main/git_sha1.h
fi
fi

View File

@@ -31,7 +31,7 @@ if [ $# -ge 2 ] ; then
# Last cmd line arg is the dest dir
for FILE in $@ ; do
DEST="$FILE"
DESTDIR="$FILE"
done
# Loop over args, moving them to DEST directory
@@ -42,6 +42,25 @@ if [ $# -ge 2 ] ; then
exit 0
fi
DEST=$DESTDIR
# On CYGWIN, because DLLs are loaded by the native Win32 loader,
# they are installed in the executable path. Stub libraries used
# only for linking are installed in the library path
case `uname` in
CYGWIN*)
case $FILE in
*.dll)
DEST="$DEST/../bin"
;;
*)
;;
esac
;;
*)
;;
esac
PWDSAVE=`pwd`
# determine file's type

View File

@@ -307,7 +307,7 @@ fi
#
case $ARCH in
'Linux' | 'OpenBSD' | 'DragonFly' | 'GNU' | GNU/*)
'Linux' | 'OpenBSD' | 'DragonFly' | 'GNU' | GNU/* | 'NetBSD')
# we assume gcc
if [ "x$LINK" = "x" ] ; then
@@ -494,13 +494,16 @@ case $ARCH in
OPTS="${OPTS} -Wl,-Mmapfile.scope"
fi
# Check if objects are SPARC v9
# Check if objects are 64-bit
# file says: ELF 64-bit MSB relocatable SPARCV9 Version 1
set ${OBJECTS}
if [ ${LINK} = "cc" -o ${LINK} = "CC" ] ; then
SPARCV9=`file $1 | grep SPARCV9`
if [ "${SPARCV9}" ] ; then
OPTS="${OPTS} -xarch=v9"
ABI64=`file $1 | grep "ELF 64-bit"`
if [ "${ABI64}" ] ; then
case `uname -p` in
sparc) OPTS="${OPTS} -xarch=v9" ;;
i386) OPTS="${OPTS} -xarch=amd64" ;;
esac
fi
fi
if [ "${ALTOPTS}" ] ; then
@@ -571,20 +574,6 @@ case $ARCH in
fi
;;
'NetBSD')
if [ $STATIC = 1 ] ; then
LIBNAME="lib${LIBNAME}_pic.a"
echo "mklib: Making NetBSD PIC static library: " ${LIBNAME}
FINAL_LIBS=`make_ar_static_lib cq 1 ${LIBNAME} ${OBJECTS}`
else
LIBNAME="lib${LIBNAME}.so.${MAJOR}.${MINOR}"
echo "mklib: Making NetBSD PIC shared library: " ${LIBNAME}
rm -f ${LIBNAME}
ld -x -Bshareable -Bforcearchive -o ${LIBNAME} ${OBJECTS}
FINAL_LIBS=${LIBNAME}
fi
;;
'IRIX' | 'IRIX64')
if [ $STATIC = 1 ] ; then
LIBNAME="lib${LIBNAME}.a"
@@ -778,9 +767,8 @@ case $ARCH in
OPTS="${OPTS} -exported_symbols_list ${EXPORTS}"
fi
LINKNAME="lib${LIBNAME}.${MAJOR}.${LIBSUFFIX}"
LINKNAME2="lib${LIBNAME}.${LIBSUFFIX}"
LIBNAME="lib${LIBNAME}.${MAJOR}.${MINOR}.${LIBSUFFIX}"
LINKNAME="lib${LIBNAME}.${LIBSUFFIX}"
LIBNAME="lib${LIBNAME}.${MAJOR}.${LIBSUFFIX}"
# examine first object to determine ABI
set ${OBJECTS}
@@ -793,9 +781,6 @@ case $ARCH in
OPTS=${ALTOPTS}
fi
# XXX can we always add -isysroot /Developer/SDKs/MacOSX10.4u.sdk
# to OPTS here?
# determine linker
if [ $CPLUSPLUS = 1 ] ; then
LINK="g++"
@@ -807,8 +792,7 @@ case $ARCH in
${LINK} ${OPTS} ${LDFLAGS} -o ${LIBNAME} ${OBJECTS} ${DEPS}
ln -s ${LIBNAME} ${LINKNAME}
ln -s ${LIBNAME} ${LINKNAME2}
FINAL_LIBS="${LIBNAME} ${LINKNAME} ${LINKNAME2}"
FINAL_LIBS="${LIBNAME} ${LINKNAME}"
fi
;;
@@ -927,6 +911,16 @@ case $ARCH in
CYGWIN*)
# GCC-based environment
if [ "x$LINK" = "x" ] ; then
# -linker was not specified so set default link command now
if [ $CPLUSPLUS = 1 ] ; then
LINK=g++
else
LINK=gcc
fi
fi
if [ $NOPREFIX = 1 ] ; then
# No "lib" or ".so" part
echo "mklib: Making CYGWIN shared library: " ${LIBNAME}
@@ -935,7 +929,7 @@ case $ARCH in
OPTS=${ALTOPTS}
fi
rm -f ${LIBNAME}
${LINK} ${OPTS} ${LDFLAGS} -o ${LIBNAME} ${OBJECTS} ${DEPS}
${LINK} ${OPTS} ${LDFLAGS} -o ${LIBNAME} ${OBJECTS} ${DEPS} || exit $?
FINAL_LIBS=${LIBNAME}
else
CYGNAME="cyg${LIBNAME}" # prefix with "cyg"
@@ -943,7 +937,7 @@ case $ARCH in
if [ $STATIC = 1 ] ; then
LIBNAME=${LIBNAME}.a
echo "mklib: Making" $ARCH "static library: " ${LIBNAME}
echo "mklib: Making CYGWIN static library: " ${LIBNAME}
OPTS="-ru"
if [ "${ALTOPTS}" ] ; then
OPTS=${ALTOPTS}
@@ -961,13 +955,7 @@ case $ARCH in
if [ "${ALTOPTS}" ] ; then
OPTS=${ALTOPTS}
fi
echo "mklib: Making" $ARCH "shared library: " ${CYGNAME}-${MAJOR}.dll
if [ $CPLUSPLUS = 1 ] ; then
LINK="g++"
else
LINK="gcc"
fi
echo "mklib: Making CYGWIN shared library: " ${CYGNAME}-${MAJOR}.dll
# rm any old libs
rm -f ${CYGNAME}-${MAJOR}.dll
@@ -976,12 +964,7 @@ case $ARCH in
rm -f ${LIBNAME}.a
# make lib
${LINK} ${OPTS} ${LDFLAGS} -o ${CYGNAME}-${MAJOR}.dll ${OBJECTS} ${DEPS}
# make build fail if link failed
es=$?
if [ "$es" -ne "0" ]; then
exit $es
fi
${LINK} ${OPTS} ${LDFLAGS} -o ${CYGNAME}-${MAJOR}.dll ${OBJECTS} ${DEPS} || exit $?
# make usual symlinks
ln -s ${LIBNAME}-${MAJOR}.dll.a ${LIBNAME}.dll.a
# finish up
@@ -1021,4 +1004,9 @@ if [ ${INSTALLDIR} != "." ] ; then
echo "mklib: Installing" ${FINAL_LIBS} "in" ${INSTALLDIR}
test -d ${INSTALLDIR} || mkdir -p ${INSTALLDIR}
mv ${FINAL_LIBS} ${INSTALLDIR}/
if [ "x${FINAL_BINS}" != "x" ] ; then
echo "mklib: Installing" ${FINAL_BINS} "in" ${INSTALLDIR}
mv ${FINAL_BINS} ${INSTALLDIR}/
fi
fi

View File

@@ -3,20 +3,27 @@
import os
import os.path
import re
import subprocess
import sys
import platform as _platform
import SCons.Script.SConscript
#######################################################################
# Defaults
_platform_map = {
'linux2': 'linux',
'win32': 'windows',
}
host_platform = _platform.system().lower()
if host_platform.startswith('cygwin'):
host_platform = 'cygwin'
default_platform = sys.platform
default_platform = _platform_map.get(default_platform, default_platform)
# Search sys.argv[] for a "platform=foo" argument since we don't have
# an 'env' variable at this point.
if 'platform' in SCons.Script.ARGUMENTS:
target_platform = SCons.Script.ARGUMENTS['platform']
else:
target_platform = host_platform
_machine_map = {
'x86': 'x86',
@@ -25,20 +32,37 @@ _machine_map = {
'i586': 'x86',
'i686': 'x86',
'ppc' : 'ppc',
'AMD64': 'x86_64',
'x86_64': 'x86_64',
}
if 'PROCESSOR_ARCHITECTURE' in os.environ:
default_machine = os.environ['PROCESSOR_ARCHITECTURE']
else:
default_machine = _platform.machine()
default_machine = _machine_map.get(default_machine, 'generic')
if default_platform in ('linux', 'freebsd'):
default_dri = 'yes'
elif default_platform in ('winddk', 'windows', 'wince', 'darwin'):
default_dri = 'no'
# find host_machine value
if 'PROCESSOR_ARCHITECTURE' in os.environ:
host_machine = os.environ['PROCESSOR_ARCHITECTURE']
else:
default_dri = 'no'
host_machine = _platform.machine()
host_machine = _machine_map.get(host_machine, 'generic')
default_machine = host_machine
default_toolchain = 'default'
if target_platform == 'windows' and host_platform != 'windows':
default_machine = 'x86'
default_toolchain = 'crossmingw'
# find default_llvm value
if 'LLVM' in os.environ:
default_llvm = 'yes'
else:
default_llvm = 'no'
try:
if target_platform != 'windows' and \
subprocess.call(['llvm-config', '--version'], stdout=subprocess.PIPE) == 0:
default_llvm = 'yes'
except:
pass
#######################################################################
@@ -53,14 +77,19 @@ def AddOptions(opts):
from SCons.Variables.EnumVariable import EnumVariable as EnumOption
except ImportError:
from SCons.Options.EnumOption import EnumOption
opts.Add(BoolOption('debug', 'debug build', 'no'))
opts.Add(BoolOption('profile', 'profile build', 'no'))
opts.Add(BoolOption('quiet', 'quiet command lines', 'yes'))
opts.Add(EnumOption('build', 'build type', 'debug',
allowed_values=('debug', 'checked', 'profile', 'release')))
opts.Add(BoolOption('verbose', 'verbose output', 'no'))
opts.Add(EnumOption('machine', 'use machine-specific assembly code', default_machine,
allowed_values=('generic', 'ppc', 'x86', 'x86_64')))
opts.Add(EnumOption('platform', 'target platform', default_platform,
allowed_values=('linux', 'cell', 'windows', 'winddk', 'wince', 'darwin', 'embedded')))
opts.Add(EnumOption('toolchain', 'compiler toolchain', 'default',
allowed_values=('default', 'crossmingw', 'winsdk', 'winddk')))
opts.Add(BoolOption('llvm', 'use LLVM', 'no'))
opts.Add(BoolOption('dri', 'build DRI drivers', default_dri))
opts.Add(EnumOption('platform', 'target platform', host_platform,
allowed_values=('linux', 'cell', 'windows', 'winddk', 'wince', 'darwin', 'cygwin', 'sunos', 'freebsd8')))
opts.Add(BoolOption('embedded', 'embedded build', 'no'))
opts.Add('toolchain', 'compiler toolchain', default_toolchain)
opts.Add(BoolOption('gles', 'EXPERIMENTAL: enable OpenGL ES support', 'no'))
opts.Add(BoolOption('llvm', 'use LLVM', default_llvm))
opts.Add(BoolOption('debug', 'DEPRECATED: debug build', 'yes'))
opts.Add(BoolOption('profile', 'DEPRECATED: profile build', 'no'))
opts.Add(BoolOption('quiet', 'DEPRECATED: quiet command lines', 'yes'))
if host_platform == 'windows':
opts.Add(EnumOption('MSVS_VERSION', 'MS Visual C++ version', None, allowed_values=('7.1', '8.0', '9.0')))

View File

@@ -14,18 +14,37 @@ ARCH_FLAGS = @ARCH_FLAGS@
ASM_FLAGS = @ASM_FLAGS@
PIC_FLAGS = @PIC_FLAGS@
DEFINES = @DEFINES@
CFLAGS = @CPPFLAGS@ @CFLAGS@ \
API_DEFINES = @API_DEFINES@
SHARED_GLAPI = @SHARED_GLAPI@
CFLAGS_NOVISIBILITY = @CPPFLAGS@ @CFLAGS@ \
$(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(ASM_FLAGS) $(DEFINES)
CXXFLAGS = @CPPFLAGS@ @CXXFLAGS@ \
CXXFLAGS_NOVISIBILITY = @CPPFLAGS@ @CXXFLAGS@ \
$(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES)
CFLAGS = $(CFLAGS_NOVISIBILITY) @VISIBILITY_CFLAGS@
CXXFLAGS = $(CXXFLAGS_NOVISIBILITY) @VISIBILITY_CXXFLAGS@
LDFLAGS = @LDFLAGS@
EXTRA_LIB_PATH = @EXTRA_LIB_PATH@
RADEON_CFLAGS = @RADEON_CFLAGS@
RADEON_LDFLAGS = @RADEON_LDFLAGS@
NOUVEAU_CFLAGS = @NOUVEAU_CFLAGS@
NOUVEAU_LIBS = @NOUVEAU_LIBS@
INTEL_LIBS = @INTEL_LIBS@
INTEL_CFLAGS = @INTEL_CFLAGS@
X11_LIBS = @X11_LIBS@
X11_CFLAGS = @X11_CFLAGS@
LLVM_CFLAGS = @LLVM_CFLAGS@
LLVM_LDFLAGS = @LLVM_LDFLAGS@
LLVM_LIBS = @LLVM_LIBS@
GLW_CFLAGS = @GLW_CFLAGS@
GLUT_CFLAGS = @GLUT_CFLAGS@
GLX_TLS = @GLX_TLS@
DRI_CFLAGS = @DRI_CFLAGS@
DRI_CXXFLAGS = @DRI_CXXFLAGS@
# Assembler
# dlopen
DLOPEN_LIBS = @DLOPEN_LIBS@
# Source selection
MESA_ASM_SOURCES = @MESA_ASM_SOURCES@
GLAPI_ASM_SOURCES = @GLAPI_ASM_SOURCES@
@@ -38,15 +57,25 @@ MKDEP_OPTIONS = @MKDEP_OPTIONS@
INSTALL = @INSTALL@
# Python and flags (generally only needed by the developers)
PYTHON2 = python
PYTHON2 = @PYTHON2@
PYTHON_FLAGS = -t -O -O
# Flex and Bison for GLSL compiler
FLEX = @FLEX@
BISON = @BISON@
# Library names (base name)
GL_LIB = GL
GLU_LIB = GLU
GLUT_LIB = glut
GLW_LIB = GLw
OSMESA_LIB = @OSMESA_LIB@
GLESv1_CM_LIB = GLESv1_CM
GLESv2_LIB = GLESv2
VG_LIB = OpenVG
GLAPI_LIB = glapi
WAYLAND_EGL_LIB = wayland-egl
GBM_LIB = gbm
# Library names (actual file names)
GL_LIB_NAME = @GL_LIB_NAME@
@@ -55,6 +84,12 @@ GLUT_LIB_NAME = @GLUT_LIB_NAME@
GLW_LIB_NAME = @GLW_LIB_NAME@
OSMESA_LIB_NAME = @OSMESA_LIB_NAME@
EGL_LIB_NAME = @EGL_LIB_NAME@
GLESv1_CM_LIB_NAME = @GLESv1_CM_LIB_NAME@
GLESv2_LIB_NAME = @GLESv2_LIB_NAME@
VG_LIB_NAME = @VG_LIB_NAME@
GLAPI_LIB_NAME = @GLAPI_LIB_NAME@
WAYLAND_EGL_LIB_NAME = @WAYLAND_EGL_LIB_NAME@
GBM_LIB_NAME = @GBM_LIB_NAME@
# Globs used to install the lib and all symlinks
GL_LIB_GLOB = @GL_LIB_GLOB@
@@ -63,6 +98,12 @@ GLUT_LIB_GLOB = @GLUT_LIB_GLOB@
GLW_LIB_GLOB = @GLW_LIB_GLOB@
OSMESA_LIB_GLOB = @OSMESA_LIB_GLOB@
EGL_LIB_GLOB = @EGL_LIB_GLOB@
GLESv1_CM_LIB_GLOB = @GLESv1_CM_LIB_GLOB@
GLESv2_LIB_GLOB = @GLESv2_LIB_GLOB@
VG_LIB_GLOB = @VG_LIB_GLOB@
GLAPI_LIB_GLOB = @GLAPI_LIB_GLOB@
WAYLAND_EGL_LIB_GLOB = @WAYLAND_EGL_LIB_GLOB@
GBM_LIB_GLOB = @GBM_LIB_GLOB@
# Directories to build
LIB_DIR = @LIB_DIR@
@@ -70,21 +111,22 @@ SRC_DIRS = @SRC_DIRS@
GLU_DIRS = @GLU_DIRS@
DRIVER_DIRS = @DRIVER_DIRS@
EGL_DRIVERS_DIRS = @EGL_DRIVERS_DIRS@
GBM_BACKEND_DIRS = @GBM_BACKEND_DIRS@
GALLIUM_DIRS = @GALLIUM_DIRS@
GALLIUM_DRIVERS_DIRS = @GALLIUM_DRIVERS_DIRS@
GALLIUM_WINSYS_DIRS = @GALLIUM_WINSYS_DIRS@
GALLIUM_WINSYS_DRM_DIRS = @GALLIUM_WINSYS_DRM_DIRS@
GALLIUM_TARGET_DIRS = @GALLIUM_TARGET_DIRS@
GALLIUM_STATE_TRACKERS_DIRS = @GALLIUM_STATE_TRACKERS_DIRS@
GALLIUM_AUXILIARIES = $(TOP)/src/gallium/auxiliary/libgallium.a
GALLIUM_DRIVERS = $(foreach DIR,$(GALLIUM_DRIVERS_DIRS),$(TOP)/src/gallium/drivers/$(DIR)/lib$(DIR).a)
# Which subdirs under $(TOP)/progs/ to enter:
PROGRAM_DIRS = @PROGRAM_DIRS@
# Driver specific build vars
DRI_DIRS = @DRI_DIRS@
WINDOW_SYSTEM = @WINDOW_SYSTEM@
EGL_DISPLAYS = @EGL_DISPLAYS@
DRI_DIRS = @DRI_DIRS@
DRICORE_GLSL_LIBS = @DRICORE_GLSL_LIBS@
DRICORE_LIBS = @DRICORE_LIBS@
DRICORE_LIB_DEPS = @DRICORE_LIB_DEPS@
EGL_PLATFORMS = @EGL_PLATFORMS@
EGL_CLIENT_APIS = @EGL_CLIENT_APIS@
# Dependencies
X11_INCLUDES = @X11_INCLUDES@
@@ -105,12 +147,20 @@ GLUT_LIB_DEPS = -L$(TOP)/$(LIB_DIR) @GLUT_MESA_DEPS@ \
GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) @GLW_MESA_DEPS@ \
$(EXTRA_LIB_PATH) @GLW_LIB_DEPS@
APP_LIB_DEPS = $(EXTRA_LIB_PATH) @APP_LIB_DEPS@
GLESv1_CM_LIB_DEPS = $(EXTRA_LIB_PATH) @GLESv1_CM_LIB_DEPS@
GLESv2_LIB_DEPS = $(EXTRA_LIB_PATH) @GLESv2_LIB_DEPS@
VG_LIB_DEPS = $(EXTRA_LIB_PATH) @VG_LIB_DEPS@
GLAPI_LIB_DEPS = $(EXTRA_LIB_PATH) @GLAPI_LIB_DEPS@
WAYLAND_EGL_LIB_DEPS = $(EXTRA_LIB_PATH) @WAYLAND_EGL_LIB_DEPS@
GBM_LIB_DEPS = $(EXTRA_LIB_PATH) @GBM_LIB_DEPS@
# DRI dependencies
MESA_MODULES = @MESA_MODULES@
DRI_LIB_DEPS = $(EXTRA_LIB_PATH) @DRI_LIB_DEPS@
LIBDRM_CFLAGS = @LIBDRM_CFLAGS@
LIBDRM_LIB = @LIBDRM_LIBS@
DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@
GLPROTO_CFLAGS = @GLPROTO_CFLAGS@
EXPAT_INCLUDES = @EXPAT_INCLUDES@
# Autoconf directories
@@ -153,6 +203,31 @@ GLW_PC_LIB_PRIV = @GLW_PC_LIB_PRIV@
GLW_PC_CFLAGS = @GLW_PC_CFLAGS@
OSMESA_PC_REQ = @OSMESA_PC_REQ@
OSMESA_PC_LIB_PRIV = @OSMESA_PC_LIB_PRIV@
GLESv1_CM_PC_LIB_PRIV = @GLESv1_CM_PC_LIB_PRIV@
GLESv2_PC_LIB_PRIV = @GLESv2_PC_LIB_PRIV@
EGL_PC_REQ_PRIV = @GL_PC_REQ_PRIV@
EGL_PC_LIB_PRIV = @GL_PC_LIB_PRIV@
EGL_PC_CFLAGS = @GL_PC_CFLAGS@
WAYLAND_EGL_PC_REQ_PRIV = @WAYLAND_EGL_PC_REQ_PRIV@
WAYLAND_EGL_PC_LIB_PRIV = @WAYLAND_EGL_PC_LIB_PRIV@
WAYLAND_EGL_PC_CFLAGS = @WAYLAND_EGL_PC_CFLAGS@
GBM_PC_REQ_PRIV = @GBM_PC_REQ_PRIV@
GBM_PC_LIB_PRIV = @GBM_PC_LIB_PRIV@
GBM_PC_CFLAGS = @GBM_PC_CFLAGS@
EGL_DRI2_CFLAGS = @EGL_DRI2_CFLAGS@
EGL_DRI2_LIBS = @EGL_DRI2_LIBS@
XCB_DRI2_CFLAGS = @XCB_DRI2_CFLAGS@
XCB_DRI2_LIBS = @XCB_DRI2_LIBS@
LIBUDEV_CFLAGS = @LIBUDEV_CFLAGS@
LIBUDEV_LIBS = @LIBUDEV_LIBS@
WAYLAND_CFLAGS = @WAYLAND_CFLAGS@
WAYLAND_LIBS = @WAYLAND_LIBS@
MESA_LLVM = @MESA_LLVM@
LLVM_VERSION = @LLVM_VERSION@
ifneq ($(LLVM_VERSION),)
HAVE_LLVM := 0x0$(subst .,0,$(LLVM_VERSION:svn=))
DEFINES += -DHAVE_LLVM=$(HAVE_LLVM)
endif
HAVE_XF86VIDMODE = @HAVE_XF86VIDMODE@

View File

@@ -90,10 +90,9 @@ else
endif
# Directories
SRC_DIRS = gallium mesa glu glut/beos glew
SRC_DIRS = gallium mesa glu glut/beos
GLU_DIRS = sgi
DRIVER_DIRS = beos
PROGRAM_DIRS = beos samples redbook demos tests
# Library/program dependencies
GL_LIB_DEPS =

View File

@@ -24,7 +24,6 @@ OSMESA_LIB_NAME = libOSMesa.a
# Directories
SRC_DIRS = mesa glu
DRIVER_DIRS = osmesa
PROGRAM_DIRS = osdemos
# Dependencies

View File

@@ -20,7 +20,6 @@ OSMESA_LIB_NAME = libOSMesa.a
# Directories
SRC_DIRS = mesa glu
DRIVER_DIRS = osmesa
PROGRAM_DIRS = osdemos
# Dependencies

View File

@@ -23,7 +23,6 @@ OSMESA_LIB_NAME = libOSMesa.a
# Directories
SRC_DIRS = mesa glu
DRIVER_DIRS = osmesa
PROGRAM_DIRS = osdemos
# Dependencies

View File

@@ -13,7 +13,10 @@ CC = gcc
CXX = g++
PIC_FLAGS = -fPIC
DEFINES = -D_DARWIN_C_SOURCE -DPTHREADS -D_GNU_SOURCE \
-DGLX_ALIAS_UNSUPPORTED -DGLX_INDIRECT_RENDERING
-DGLX_ALIAS_UNSUPPORTED \
-DGLX_DIRECT_RENDERING -DGLX_USE_APPLEGL
# -DGLX_INDIRECT_RENDERING \
# -D_GNU_SOURCE - for src/mesa/main ...
# -DGLX_DIRECT_RENDERING - pulls in libdrm stuff in glx
@@ -22,36 +25,39 @@ DEFINES = -D_DARWIN_C_SOURCE -DPTHREADS -D_GNU_SOURCE \
ARCH_FLAGS += $(RC_CFLAGS)
CFLAGS = -ggdb3 -Os -Wall -Wmissing-prototypes -std=c99 -ffast-math -fno-strict-aliasing \
CFLAGS = -ggdb3 -Os -Wall -Wmissing-prototypes -std=c99 -ffast-math -fno-strict-aliasing -fvisibility=hidden \
-I$(INSTALL_DIR)/include -I$(X11_DIR)/include $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(ASM_FLAGS) $(DEFINES)
CXXFLAGS = -ggdb3 -Os -Wall -fno-strict-aliasing \
CXXFLAGS = -ggdb3 -Os -Wall -fno-strict-aliasing -fvisibility=hidden \
-I$(INSTALL_DIR)/include -I$(X11_DIR)/include $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(ASM_FLAGS) $(DEFINES)
# Library names (actual file names)
GL_LIB_NAME = libGL.dylib
GLU_LIB_NAME = libGLU.dylib
GLUT_LIB_NAME = libglut.dylib
GLW_LIB_NAME = libGLw.dylib
OSMESA_LIB_NAME = libOSMesa.dylib
GL_LIB_NAME = lib$(GL_LIB).dylib
GLU_LIB_NAME = lib$(GLU_LIB).dylib
GLUT_LIB_NAME = lib$(GLUT_LIB).dylib
GLW_LIB_NAME = lib$(GLW_LIB).dylib
OSMESA_LIB_NAME = lib$(OSMESA_LIB).dylib
VG_LIB_NAME = lib$(VG_LIB).dylib
# globs used to install the lib and all symlinks
GL_LIB_GLOB = libGL.*dylib
GLU_LIB_GLOB = libGLU.*dylib
GLUT_LIB_GLOB = libglut.*dylib
GLW_LIB_GLOB = libGLw.*dylib
OSMESA_LIB_GLOB = libOSMesa.*dylib
GL_LIB_GLOB = lib$(GL_LIB).*dylib
GLU_LIB_GLOB = lib$(GLU_LIB).*dylib
GLUT_LIB_GLOB = lib$(GLUT_LIB).*dylib
GLW_LIB_GLOB = lib$(GLW_LIB).*dylib
OSMESA_LIB_GLOB = lib$(OSMESA_LIB).*dylib
VG_LIB_GLOB = lib$(VG_LIB).*dylib
GL_LIB_DEPS = -L$(INSTALL_DIR)/$(LIB_DIR) -L$(X11_DIR)/$(LIB_DIR) -lX11 -lXext -lm -lpthread
OSMESA_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB)
OSMESA_LIB_DEPS =
GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB)
GLUT_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -L$(INSTALL_DIR)/$(LIB_DIR) -L$(X11_DIR)/$(LIB_DIR) -lX11 -lXmu -lXi -lXext
GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -L$(INSTALL_DIR)/$(LIB_DIR) -L$(X11_DIR)/$(LIB_DIR) -lX11 -lXt
APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -L$(INSTALL_DIR)/$(LIB_DIR) -L$(X11_DIR)/$(LIB_DIR) -lX11 -lXmu -lXt -lXi -lm
# omit glw lib for now:
SRC_DIRS = glsl glx mesa gallium glu glut/glx glew
SRC_DIRS = glsl mapi/glapi mapi/vgapi glx/apple mesa gallium glu glut/glx
GLU_DIRS = sgi
DRIVER_DIRS = osmesa
#DRIVER_DIRS = dri
DRI_DIRS = swrast
PROGRAM_DIRS = xdemos
GALLIUM_DRIVERS_DIRS = softpipe trace rbug noop identity galahad failover
#GALLIUM_DRIVERS_DIRS += llvmpipe

View File

@@ -9,8 +9,8 @@ CONFIG_NAME = default
# Version info
MESA_MAJOR=7
MESA_MINOR=8
MESA_TINY=1
MESA_MINOR=11
MESA_TINY=0
MESA_VERSION = $(MESA_MAJOR).$(MESA_MINOR).$(MESA_TINY)
# external projects. This should be useless now that we use libdrm.
@@ -25,6 +25,7 @@ CXXFLAGS = -O
LDFLAGS =
HOST_CFLAGS = $(CFLAGS)
GLU_CFLAGS =
GLX_TLS = no
# Compiler for building demos/tests/etc
APP_CC = $(CC)
@@ -37,6 +38,8 @@ MKLIB_OPTIONS =
MKDEP = makedepend
MKDEP_OPTIONS = -fdepend
MAKE = make
FLEX = flex
BISON = bison
# Use MINSTALL for installing libraries, INSTALL for everything else
MINSTALL = $(SHELL) $(TOP)/bin/minstall
@@ -52,20 +55,29 @@ INDENT_FLAGS = -i4 -nut -br -brs -npcs -ce -T GLubyte -T GLbyte -T Bool
GL_LIB = GL
GLU_LIB = GLU
GLUT_LIB = glut
GLEW_LIB = GLEW
GLW_LIB = GLw
OSMESA_LIB = OSMesa
EGL_LIB = EGL
GLESv1_CM_LIB = GLESv1_CM
GLESv2_LIB = GLESv2
VG_LIB = OpenVG
GLAPI_LIB = glapi
WAYLAND_EGL_LIB = wayland-egl
GBM_LIB = gbm
# Library names (actual file names)
GL_LIB_NAME = lib$(GL_LIB).so
GLU_LIB_NAME = lib$(GLU_LIB).so
GLUT_LIB_NAME = lib$(GLUT_LIB).so
GLEW_LIB_NAME = lib$(GLEW_LIB).a
GLW_LIB_NAME = lib$(GLW_LIB).so
OSMESA_LIB_NAME = lib$(OSMESA_LIB).so
EGL_LIB_NAME = lib$(EGL_LIB).so
GLESv1_CM_LIB_NAME = lib$(GLESv1_CM_LIB).so
GLESv2_LIB_NAME = lib$(GLESv2_LIB).so
VG_LIB_NAME = lib$(VG_LIB).so
GLAPI_LIB_NAME = lib$(GLAPI_LIB).so
WAYLAND_EGL_LIB_NAME = lib$(WAYLAND_EGL_LIB).so
GBM_LIB_NAME = lib$(GBM_LIB).so
# globs used to install the lib and all symlinks
GL_LIB_GLOB = $(GL_LIB_NAME)*
@@ -74,6 +86,15 @@ GLUT_LIB_GLOB = $(GLUT_LIB_NAME)*
GLW_LIB_GLOB = $(GLW_LIB_NAME)*
OSMESA_LIB_GLOB = $(OSMESA_LIB_NAME)*
EGL_LIB_GLOB = $(EGL_LIB_NAME)*
GLESv1_CM_LIB_GLOB = $(GLESv1_CM_LIB_NAME)*
GLESv2_LIB_GLOB = $(GLESv2_LIB_NAME)*
VG_LIB_GLOB = $(VG_LIB_NAME)*
GLAPI_LIB_GLOB = $(GLAPI_LIB_NAME)*
WAYLAND_EGL_LIB_GLOB = $(WAYLAND_EGL_LIB_NAME)*
GBM_LIB_GLOB = $(GBM_LIB_NAME)*
DRI_CFLAGS = $(CFLAGS)
DRI_CXXFLAGS = $(CXXFLAGS)
# Optional assembly language optimization files for libGL
MESA_ASM_SOURCES =
@@ -86,26 +107,29 @@ MOTIF_CFLAGS = -I/usr/include/Motif1.2
# Directories to build
LIB_DIR = lib
SRC_DIRS = glsl mesa gallium egl gallium/winsys glu glut/glx glew glw
SRC_DIRS = glsl mapi/glapi mapi/vgapi mesa \
gallium egl gallium/winsys gallium/targets glu glut/glx glw
GLU_DIRS = sgi
DRIVER_DIRS = x11 osmesa
# Which subdirs under $(TOP)/progs/ to enter:
PROGRAM_DIRS = demos redbook samples glsl objviewer xdemos
# EGL drivers to build
EGL_DRIVERS_DIRS = glx
# gbm backends to build
GBM_BACKEND_DIRS = dri
# Gallium directories and
GALLIUM_DIRS = auxiliary drivers state_trackers
GALLIUM_AUXILIARIES = $(TOP)/src/gallium/auxiliary/libgallium.a
GALLIUM_DRIVERS_DIRS = softpipe failover svga i915 i965 r300 trace identity
GALLIUM_DRIVERS_DIRS = softpipe trace rbug noop identity galahad i915 i965 svga r300 nvfx nv50 failover
GALLIUM_DRIVERS = $(foreach DIR,$(GALLIUM_DRIVERS_DIRS),$(TOP)/src/gallium/drivers/$(DIR)/lib$(DIR).a)
GALLIUM_WINSYS_DIRS = drm xlib
GALLIUM_WINSYS_DRM_DIRS = swrast
GALLIUM_WINSYS_DIRS = sw sw/xlib
GALLIUM_TARGET_DIRS = libgl-xlib
GALLIUM_STATE_TRACKERS_DIRS = glx vega
# native displays EGL should support
EGL_DISPLAYS = x11
# native platforms EGL should support
EGL_PLATFORMS = x11
EGL_CLIENT_APIS = $(GL_LIB)
# Library dependencies
#EXTRA_LIB_PATH ?=
@@ -116,10 +140,18 @@ GLU_LIB_DEPS = $(EXTRA_LIB_PATH) -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -lm
GLUT_LIB_DEPS = $(EXTRA_LIB_PATH) -L$(TOP)/$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -lX11 -lXmu -lXi -lm
GLW_LIB_DEPS = $(EXTRA_LIB_PATH) -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -lXt -lX11
APP_LIB_DEPS = $(EXTRA_LIB_PATH) -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lm
GLESv1_CM_LIB_DEPS = $(EXTRA_LIB_PATH) -lpthread
GLESv2_LIB_DEPS = $(EXTRA_LIB_PATH) -lpthread
VG_LIB_DEPS = $(EXTRA_LIB_PATH) -lpthread
GLAPI_LIB_DEPS = $(EXTRA_LIB_PATH) -lpthread
WAYLAND_EGL_LIB_DEPS = $(EXTRA_LIB_PATH) -lwayland-client -ldrm
GBM_LIB_DEPS = $(EXTRA_LIB_PATH) -ludev -ldl
# Program dependencies - specific GL/glut libraries added in Makefiles
APP_LIB_DEPS = -lm
X11_LIBS = -lX11
DLOPEN_LIBS = -ldl
# Installation directories (for make install)
INSTALL_DIR = /usr/local
@@ -133,6 +165,9 @@ DRI_DRIVER_SEARCH_DIR = $(DRI_DRIVER_INSTALL_DIR)
# EGL driver install directory
EGL_DRIVER_INSTALL_DIR = $(INSTALL_LIB_DIR)/egl
# gbm backend install directory
GBM_BACKEND_INSTALL_DIR = $(INSTALL_LIB_DIR)/gbm
# Xorg driver install directory (for xorg state-tracker)
XORG_DRIVER_INSTALL_DIR = $(INSTALL_LIB_DIR)/xorg/modules/drivers
@@ -153,3 +188,18 @@ GLW_PC_LIB_PRIV =
GLW_PC_CFLAGS =
OSMESA_PC_REQ =
OSMESA_PC_LIB_PRIV =
GLESv1_CM_PC_REQ_PRIV =
GLESv1_CM_PC_LIB_PRIV =
GLESv1_CM_PC_CFLAGS =
GLESv2_PC_REQ_PRIV =
GLESv2_PC_LIB_PRIV =
GLESv2_PC_CFLAGS =
VG_PC_REQ_PRIV =
VG_PC_LIB_PRIV =
VG_PC_CFLAGS =
WAYLAND_EGL_PC_REQ_PRIV =
WAYLAND_EGL_PC_LIB_PRIV =
WAYLAND_EGL_PC_CFLAGS =
GBM_PC_REQ_PRIV =
GBM_PC_LIB_PRIV =
GBM_PC_CFLAGS =

View File

@@ -30,9 +30,11 @@ ASM_SOURCES =
MESA_ASM_SOURCES =
# Library/program dependencies
MESA_MODULES = $(TOP)/src/mesa/libmesa.a
LIBDRM_CFLAGS = `pkg-config --cflags libdrm`
LIBDRM_LIB = `pkg-config --libs libdrm`
DRI_LIB_DEPS = -L/usr/local/lib -lm -pthread -lexpat $(LIBDRM_LIB)
DRI_LIB_DEPS = $(MESA_MODULES) -L/usr/local/lib -lm -pthread -lexpat $(LIBDRM_LIB)
GL_LIB_DEPS = -L/usr/local/lib -lX11 -lXext -lXxf86vm -lXdamage -lXfixes \
-lm -pthread $(LIBDRM_LIB)
@@ -41,10 +43,8 @@ GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -L/usr/local/lib -lGL -lXt -lX11
# Directories
SRC_DIRS = glx gallium mesa glu glut/glx glew glw
SRC_DIRS = glx gallium mesa glu glut/glx glw
DRIVER_DIRS = dri
PROGRAM_DIRS =
WINDOW_SYSTEM=dri
DRM_SOURCE_PATH=$(TOP)/../drm

View File

@@ -6,7 +6,7 @@ CONFIG_NAME = linux-cell
# Omiting other gallium drivers:
GALLIUM_DRIVERS_DIRS = cell softpipe trace
GALLIUM_DRIVERS_DIRS = cell softpipe trace rbug identity
# Compiler and flags
@@ -37,7 +37,8 @@ CXXFLAGS = $(COMMON_C_CPP_FLAGS)
# Omitting glw here:
SRC_DIRS = glsl mesa gallium gallium/winsys glu glut/glx glew
SRC_DIRS = glsl mapi/glapi mapi/vgapi mesa \
gallium gallium/winsys gallium/targets glu glut/glx
# Build no traditional Mesa drivers:
DRIVER_DIRS =

View File

@@ -5,5 +5,5 @@ include $(TOP)/configs/linux
CONFIG_NAME = linux-debug
OPT_FLAGS = -g
CFLAGS += -pedantic
#CFLAGS += -pedantic
DEFINES += -DDEBUG -DDEBUG_MATH

View File

@@ -43,31 +43,36 @@ MESA_ASM_SOURCES =
# Library/program dependencies
EXTRA_LIB_PATH=-L/usr/X11R6/lib
MESA_MODULES = $(TOP)/src/mesa/libmesa.a
LIBDRM_CFLAGS = $(shell pkg-config --cflags libdrm)
LIBDRM_LIB = $(shell pkg-config --libs libdrm)
DRI_LIB_DEPS = $(EXTRA_LIB_PATH) -lm -lpthread -lexpat -ldl $(LIBDRM_LIB)
DRI_LIB_DEPS = $(MESA_MODULES) $(EXTRA_LIB_PATH) -lm -lpthread -lexpat -ldl $(LIBDRM_LIB)
GL_LIB_DEPS = $(EXTRA_LIB_PATH) -lX11 -lXext -lXxf86vm -lXdamage -lXfixes \
-lm -lpthread -ldl $(LIBDRM_LIB)
# Directories
SRC_DIRS := glx egl $(SRC_DIRS)
PROGRAM_DIRS := egl $(PROGRAM_DIRS)
# EGL directories
EGL_DRIVERS_DIRS = glx
DRIVER_DIRS = dri
WINDOW_SYSTEM = dri
GALLIUM_WINSYS_DIRS = drm
GALLIUM_WINSYS_DRM_DIRS = vmware intel i965
GALLIUM_WINSYS_DIRS = sw sw/xlib drm/vmware drm/intel drm/i965
GALLIUM_TARGET_DIRS =
GALLIUM_STATE_TRACKERS_DIRS = egl
DRI_DIRS = i810 i915 i965 mach64 mga r128 r200 r300 radeon \
DRI_DIRS = i810 i915 i965 mach64 mga nouveau r128 r200 r300 r600 radeon \
savage sis tdfx unichrome swrast
INTEL_LIBS = `pkg-config --libs libdrm_intel`
INTEL_CFLAGS = `pkg-config --cflags libdrm_intel`
INTEL_LIBS = $(shell pkg-config --libs libdrm_intel)
INTEL_CFLAGS = $(shell pkg-config --cflags libdrm_intel)
RADEON_LIBS = `pkg-config --libs libdrm_radeon`
RADEON_CFLAGS = `pkg-config --cflags libdrm_radeon`
NOUVEAU_LIBS = $(shell pkg-config --libs libdrm_nouveau)
NOUVEAU_CFLAGS = $(shell pkg-config --cflags libdrm_nouveau)
LIBDRM_RADEON_LIBS = $(shell pkg-config --libs libdrm_radeon)
LIBDRM_RADEON_CFLAGS = $(shell pkg-config --cflags libdrm_radeon)
RADEON_CFLAGS = "-DHAVE_LIBDRM_RADEON=1 $(LIBDRM_RADEON_CFLAGS)"
RADEON_LDFLAGS = $(LIBDRM_RADEON_LIBS)

View File

@@ -41,17 +41,16 @@ MESA_ASM_SOURCES =
# Library/program dependencies
EXTRA_LIB_PATH=$(shell pkg-config --libs-only-L x11)
MESA_MODULES = $(TOP)/src/mesa/libmesa.a
LIBDRM_CFLAGS = $(shell pkg-config --cflags libdrm)
LIBDRM_LIB = $(shell pkg-config --libs libdrm)
DRI_LIB_DEPS = $(EXTRA_LIB_PATH) -lm -lpthread -lexpat -ldl $(LIBDRM_LIB)
DRI_LIB_DEPS = $(MESA_MODULES) $(EXTRA_LIB_PATH) -lm -lpthread -lexpat -ldl $(LIBDRM_LIB)
GL_LIB_DEPS = $(EXTRA_LIB_PATH) -lX11 -lXext -lXxf86vm -lm -lpthread -ldl \
$(LIBDRM_LIB) $(shell pkg-config --libs xcb) $(shell pkg-config --libs x11-xcb) $(shell pkg-config --libs xcb-glx)
SRC_DIRS = glx gallium mesa glu glut/glx glew glw
PROGRAM_DIRS = xdemos
SRC_DIRS = glx gallium mesa glu glut/glx glw
DRIVER_DIRS = dri
WINDOW_SYSTEM=dri
DRI_DIRS = i810 i915 mach64 mga r128 r200 r300 radeon \
savage sis tdfx unichrome

View File

@@ -38,20 +38,21 @@ MESA_ASM_SOURCES =
# Library/program dependencies
EXTRA_LIB_PATH=-L/usr/X11R6/lib
MESA_MODULES = $(TOP)/src/mesa/libmesa.a
LIBDRM_CFLAGS = $(shell pkg-config --cflags libdrm)
LIBDRM_LIB = $(shell pkg-config --libs libdrm)
DRI_LIB_DEPS = $(EXTRA_LIB_PATH) -lm -lpthread -lexpat -ldl $(LIBDRM_LIB)
DRI_LIB_DEPS = $(MESA_MODULES) $(EXTRA_LIB_PATH) -lm -lpthread -lexpat -ldl $(LIBDRM_LIB)
GL_LIB_DEPS = $(EXTRA_LIB_PATH) -lX11 -lXext -lXxf86vm -lXdamage -lXfixes \
-lm -lpthread -ldl \
$(LIBDRM_LIB)
# Directories
SRC_DIRS = gallium mesa gallium/winsys glu egl
PROGRAM_DIRS = egl
SRC_DIRS = gallium mesa gallium/winsys gallium/targets glu egl
DRIVER_DIRS = dri
WINDOW_SYSTEM = dri
GALLIUM_WINSYS_DIRS = egl_drm
GALLIUM_TARGET_DIRS =
DRI_DIRS = intel

View File

@@ -4,14 +4,13 @@ include $(TOP)/configs/linux
CONFIG_NAME = linux-fbdev
CFLAGS = -O3 -ffast-math -ansi -pedantic -fPIC -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DPTHREADS -DUSE_GLFBDEV_DRIVER
CFLAGS += -DUSE_GLFBDEV_DRIVER
# Work around aliasing bugs - developers should comment this out
CFLAGS += -fno-strict-aliasing
SRC_DIRS = gallium mesa glu glut/fbdev glew
SRC_DIRS += glut/fbdev
DRIVER_DIRS = fbdev osmesa
PROGRAM_DIRS = fbdev demos redbook samples
GL_LIB_DEPS = $(EXTRA_LIB_PATH) -lm -lpthread
OSMESA_LIB_DEPS = -lm -lpthread

View File

@@ -6,3 +6,4 @@ CONFIG_NAME = linux-i965
GALLIUM_DRIVER_DIRS = i965
GALLIUM_WINSYS_DIRS = drm/i965/xlib
GALLIUM_TARGET_DIRS =

View File

@@ -42,12 +42,11 @@ MESA_ASM_SOURCES =
# Library/program dependencies
EXTRA_LIB_PATH=-L/usr/X11R6/lib
DRI_LIB_DEPS = $(EXTRA_LIB_PATH) -lm -lpthread -lexpat -ldl
MESA_MODULES = $(TOP)/src/mesa/libmesa.a
DRI_LIB_DEPS = $(MESA_MODULES) $(EXTRA_LIB_PATH) -lm -lpthread -lexpat -ldl
GL_LIB_DEPS = $(EXTRA_LIB_PATH) -lX11 -lXext -lXxf86vm -lm -lpthread -ldl
# Directories
SRC_DIRS = glx glu glut/glx glew glw
SRC_DIRS = glx glu glut/glx glw
DRIVER_DIRS =
PROGRAM_DIRS =
WINDOW_SYSTEM=dri

View File

@@ -10,9 +10,9 @@ CONFIG_NAME = linux-llvm
GALLIUM_DRIVERS_DIRS += llvmpipe
OPT_FLAGS = -O3 -ansi -pedantic
ARCH_FLAGS = -m32 -mmmx -msse -msse2 -mstackrealign
ARCH_FLAGS = -mmmx -msse -msse2 -mstackrealign
DEFINES += -DNDEBUG -DGALLIUM_LLVMPIPE -DDRAW_LLVM -DHAVE_UDIS86
DEFINES += -DNDEBUG -DGALLIUM_LLVMPIPE
# override -std=c99
CFLAGS += -std=gnu99
@@ -24,14 +24,16 @@ ifeq ($(LLVM_VERSION),)
MESA_LLVM=0
else
MESA_LLVM=1
HAVE_LLVM := 0x0$(subst .,0,$(LLVM_VERSION:svn=))
DEFINES += -DHAVE_LLVM=$(HAVE_LLVM)
# $(info Using LLVM version: $(LLVM_VERSION))
endif
ifeq ($(MESA_LLVM),1)
# LLVM_CFLAGS=`llvm-config --cflags`
LLVM_CXXFLAGS=`llvm-config --cxxflags backend bitreader engine ipo interpreter instrumentation` -Wno-long-long
LLVM_LDFLAGS = $(shell llvm-config --ldflags backend bitreader engine ipo interpreter instrumentation)
LLVM_LIBS = $(shell llvm-config --libs backend bitwriter bitreader engine ipo interpreter instrumentation)
LLVM_CFLAGS=`llvm-config --cppflags`
LLVM_CXXFLAGS=`llvm-config --cxxflags` -Wno-long-long
LLVM_LDFLAGS = $(shell llvm-config --ldflags)
LLVM_LIBS = $(shell llvm-config --libs)
MKLIB_OPTIONS=-cplusplus
else
LLVM_CFLAGS=
@@ -39,4 +41,4 @@ else
endif
LD = g++
GL_LIB_DEPS = $(LLVM_LDFLAGS) $(LLVM_LIBS) $(EXTRA_LIB_PATH) -lX11 -lXext -lm -lpthread -lstdc++ -ludis86
GL_LIB_DEPS = $(LLVM_LDFLAGS) $(LLVM_LIBS) $(EXTRA_LIB_PATH) -lX11 -lXext -lm -lpthread -lstdc++

View File

@@ -6,8 +6,8 @@ CONFIG_NAME = linux-opengl-es
# Directories to build
LIB_DIR = lib
SRC_DIRS = egl glsl mesa/es gallium gallium/winsys
PROGRAM_DIRS = es1/screen es1/xegl es2/xegl
SRC_DIRS = egl glsl mapi/es1api mapi/es2api mesa/es \
gallium gallium/winsys gallium/targets
# egl st needs this
DEFINES += -DGLX_DIRECT_RENDERING
@@ -22,7 +22,7 @@ GALLIUM_DRIVERS_DIRS = softpipe
GALLIUM_STATE_TRACKERS_DIRS = es
# build egl_x11_{swrast,i915}.so
GALLIUM_DRIVERS_DIRS += trace i915
GALLIUM_DRIVERS_DIRS += trace rbug i915
GALLIUM_STATE_TRACKERS_DIRS += egl
GALLIUM_WINSYS_DIRS += drm
GALLIUM_WINSYS_DRM_DIRS += intel swrast
GALLIUM_WINSYS_DIRS += drm/intel
GALLIUM_TARGET_DIRS += egl-swrast egl-i915

View File

@@ -9,7 +9,7 @@ CONFIG_NAME = linux-osmesa
# Compiler and flags
CC = gcc
CXX = g++
CFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DPTHREADS
CFLAGS = -g -ansi -pedantic -fPIC -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -D_GNU_SOURCE -DPTHREADS
CXXFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE
# Work around aliasing bugs - developers should comment this out
@@ -17,12 +17,11 @@ CFLAGS += -fno-strict-aliasing
CXXFLAGS += -fno-strict-aliasing
# Directories
SRC_DIRS = gallium mesa glu
SRC_DIRS = mapi/glapi glsl mesa glu
DRIVER_DIRS = osmesa
PROGRAM_DIRS = osdemos
# Dependencies
OSMESA_LIB_DEPS = -lm -lpthread
OSMESA_LIB_DEPS = -lm -lpthread -ldl
GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(OSMESA_LIB)
APP_LIB_DEPS = -lm -lpthread

View File

@@ -24,7 +24,6 @@ OSMESA_LIB_NAME = libOSMesa.a
# Directories
SRC_DIRS = mesa glu
DRIVER_DIRS = osmesa
PROGRAM_DIRS = osdemos
# Dependencies

View File

@@ -20,9 +20,8 @@ OSMESA_LIB_NAME = libOSMesa16.so
# Directories
SRC_DIRS = gallium mesa glu
SRC_DIRS = mapi/glapi glsl mesa glu
DRIVER_DIRS = osmesa
PROGRAM_DIRS =
# Dependencies

View File

@@ -24,7 +24,6 @@ OSMESA_LIB_NAME = libOSMesa16.a
# Directories
SRC_DIRS = gallium mesa glu
DRIVER_DIRS = osmesa
PROGRAM_DIRS =
# Dependencies

View File

@@ -20,9 +20,8 @@ OSMESA_LIB_NAME = libOSMesa32.so
# Directories
SRC_DIRS = gallium mesa glu
SRC_DIRS = mapi/glapi glsl mesa glu
DRIVER_DIRS = osmesa
PROGRAM_DIRS =
# Dependencies

File diff suppressed because it is too large Load Diff

39
debian/README.source vendored
View File

@@ -1,39 +0,0 @@
------------------------------------------------------
Quick Guide To Patching This Package For The Impatient
------------------------------------------------------
1. Make sure you have quilt installed
2. Unpack the package as usual with "dpkg-source -x"
3. Run the "patch" target in debian/rules
4. Create a new patch with "quilt new" (see quilt(1))
5. Edit all the files you want to include in the patch with "quilt edit"
(see quilt(1)).
6. Write the patch with "quilt refresh" (see quilt(1))
7. Run the "clean" target in debian/rules
Alternatively, instead of using quilt directly, you can drop the patch in to
debian/patches and add the name of the patch to debian/patches/series.
The X Strike Force team maintains X packages in git repositories on
git.debian.org in the pkg-xorg subdirectory. Most upstream packages
are actually maintained in git repositories as well, so they often
just need to be pulled into git.debian.org in a "upstream-*" branch.
The .orig.tar.gz upstream source file could be generated this
"upstream-*" branch in the Debian git repository but it is actually
generated from upstream tarballs directly.
Upstream ships Mesa as 3 different tarballs (MesaLib, MesaGLUT and
MesaDemos) which are re-bundled together into a single .orig.tar.gz.
The Debian packaging is added by creating the "debian-*" git branch
which contains the aforementioned "upstream-*" branch plus the debian/
repository files.
When a patch has to be applied to the Debian package, two solutions
are involved:
* If the patch is available in one of the upstream branches, it
may be git'cherry-picked into the Debian repository. In this
case, it appears directly in the .diff.gz.
* Otherwise, the patch is added to debian/patches/ which is managed
with quilt as documented in /usr/share/doc/quilt/README.source.
Thus, the patching system requires a build dependency on quilt.

1559
debian/changelog vendored

File diff suppressed because it is too large Load Diff

1
debian/compat vendored
View File

@@ -1 +0,0 @@
5

355
debian/control vendored
View File

@@ -1,355 +0,0 @@
Source: mesa
Section: graphics
Priority: optional
Maintainer: Debian X Strike Force <debian-x@lists.debian.org>
Uploaders: David Nusinow <dnusinow@debian.org>, Brice Goglin <bgoglin@debian.org>
Standards-Version: 3.8.4
Build-Depends: debhelper (>= 6.0.7), quilt (>= 0.40), pkg-config,
libdrm-dev (>= 2.4.19) [!hurd-i386], libx11-dev, xutils-dev,
x11proto-gl-dev (>= 1.4.11), libxxf86vm-dev,
libexpat1-dev, lesstif2-dev, dpkg-dev (>= 1.13.19), libxfixes-dev,
libxdamage-dev, libxext-dev, autoconf, automake, x11proto-dri2-dev (>= 2.1),
linux-libc-dev (>= 2.6.31) [!hurd-i386 !kfreebsd-amd64 !kfreebsd-i386]
Vcs-Git: git://git.debian.org/git/pkg-xorg/lib/mesa
Vcs-Browser: http://git.debian.org/?p=pkg-xorg/lib/mesa.git
Homepage: http://mesa3d.sourceforge.net/
Package: libgl1-mesa-swx11
Section: libs
Priority: extra
Architecture: any
Depends: ${shlibs:Depends}, libosmesa6 (>= 6.5.2-1)
Conflicts: mesag3-glide, mesag3-glide2, mesag3+ggi, libgl1, nvidia-glx, mesag3, libgl1-mesa-swrast
Provides: libgl1, mesag3, libgl1-mesa-swrast
Replaces: libgl1, mesag3, libgl1-mesa-swrast
Description: A free implementation of the OpenGL API -- runtime
Mesa is a 3-D graphics library with an API which is very similar to
that of OpenGL. To the extent that Mesa utilizes the OpenGL command
syntax or state machine, it is being used with authorization from
Silicon Graphics, Inc. However, the author makes no claim that Mesa
is in any way a compatible replacement for OpenGL or associated with
Silicon Graphics, Inc.
.
This library provides a pure software rasteriser; it does not provide
a direct rendering-capable library, or one which uses GLX. For that,
please see libgl1-mesa-glx.
.
On Linux, this library is also known as libGL or libGL.so.1.
Package: libgl1-mesa-swx11-dbg
Section: debug
Priority: extra
Architecture: any
Depends: libgl1-mesa-swx11 (= ${binary:Version})
Conflicts: libgl1-mesa-swrast-dbg
Provides: libgl1-mesa-swrast-dbg
Replaces: libgl1-mesa-swrast-dbg
Description: A free implementation of the OpenGL API -- debugging symbols
Mesa is a 3-D graphics library with an API which is very similar to
that of OpenGL. To the extent that Mesa utilizes the OpenGL command
syntax or state machine, it is being used with authorization from
Silicon Graphics, Inc. However, the author makes no claim that Mesa
is in any way a compatible replacement for OpenGL or associated with
Silicon Graphics, Inc.
.
This library provides a pure software rasteriser; it does not provide
a direct rendering-capable library, or one which uses GLX. For that,
please see libgl1-mesa-glx.
.
On Linux, this library is also known as libGL or libGL.so.1.
.
This package contains debugging symbols for the software rasterization GL
library.
Package: libgl1-mesa-swx11-i686
Section: libs
Priority: extra
Architecture: i386 kfreebsd-i386 hurd-i386
Depends: libgl1-mesa-swx11 (= ${binary:Version}), ${shlibs:Depends}
Description: Mesa OpenGL runtime [i686 optimized]
Mesa is a 3-D graphics library with an API which is very similar to
that of OpenGL. To the extent that Mesa utilizes the OpenGL command
syntax or state machine, it is being used with authorization from
Silicon Graphics, Inc. However, the author makes no claim that Mesa
is in any way a compatible replacement for OpenGL or associated with
Silicon Graphics, Inc.
.
This library provides a pure software rasteriser; it does not provide
a direct rendering-capable library, or one which uses GLX. For that,
please see libgl1-mesa-glx.
.
On Linux, this library is also known as libGL or libGL.so.1.
.
This set of libraries is optimized for i686 machines and will only be used if
you are running a 2.6 kernel on an i686 class CPU. This includes Pentium Pro,
Pentium II/II/IV, Celeron CPU's and similar class CPU's (including clones
such as AMD Athlon/Opteron, VIA C3 Nehemiah, but not VIA C3 Ezla).
Package: libgl1-mesa-swx11-dev
Section: libdevel
Priority: extra
Architecture: any
Depends: libgl1-mesa-swx11 (= ${binary:Version}), libc6-dev, libx11-dev, libxext6, mesa-common-dev (= ${binary:Version})
Provides: libgl-dev, mesag-dev, libgl1-mesa-swrast-dev
Conflicts: mesa-dev, libgl-dev, mesag3 (<< 3.1-1), nvidia-glx-dev, mesag-dev, libgl1-mesa-swrast-dev
Replaces: libgl-dev, mesag-dev, libgl1-mesa-swrast-dev
Description: A free implementation of the OpenGL API -- development files
This package provides the development environment required for
compiling programs with Mesa. For a complete description of Mesa,
please look at the libgl1-mesa-swx11 package.
.
This library provides a pure software rasteriser; it does not provide
a direct rendering-capable library, or one which uses GLX. For that,
please see libgl1-mesa-dev.
Package: libgl1-mesa-glx
Section: libs
Architecture: any
Depends: ${shlibs:Depends}
Recommends: libgl1-mesa-dri (>= 7.2)
Conflicts: libgl1, libgl1-mesa-dri (<< 6.4.0)
Replaces: libgl1, libgl1-mesa-dri (<< 6.4.0)
Provides: libgl1
Description: A free implementation of the OpenGL API -- GLX runtime
This version of Mesa provides GLX and DRI capabilities: it is capable of
both direct and indirect rendering. For direct rendering, it can use DRI
modules from the libgl1-mesa-dri package to accelerate drawing.
.
This package does not include the modules themselves: these can be found
in the libgl1-mesa-dri package.
.
For a complete description of Mesa, please look at the
libgl1-mesa-swx11 package.
Package: libgl1-mesa-glx-dbg
Section: debug
Priority: extra
Architecture: any
Depends: libgl1-mesa-glx (= ${binary:Version})
Description: Debugging symbols for the Mesa GLX runtime
This version of Mesa provides GLX and DRI capabilities: it is capable of
both direct and indirect rendering. For direct rendering, it can use DRI
modules from the libgl1-mesa-dri package to accelerate drawing.
.
This package does not include the modules themselves: these can be found
in the libgl1-mesa-dri package.
.
For a complete description of Mesa, please look at the
libgl1-mesa-swx11 package.
.
This package contains debugging symbols for the GL library with GLX and DRI
capabilities.
#Package: libgl1-mesa-glx-i686
#Section: libs
#Priority: extra
#Architecture: i386 kfreebsd-i386 hurd-i386
#Pre-Depends: libgl1-mesa-glx
#Description: A free implementation of the OpenGL API -- GLX runtime [i686 optimized]
# This version of Mesa provides GLX and DRI capabilities: it is capable of
# both direct and indirect rendering. For direct rendering, it can use DRI
# modules from the libgl1-mesa-dri package to accelerate drawing.
# .
# This package does not include the modules themselves: these can be found
# in the libgl1-mesa-dri package.
# .
# For a complete description of Mesa, please look at the
# libgl1-mesa-swx11 package.
# .
# This set of libraries is optimized for i686 machines and will only be used if
# you are running a 2.6 kernel on an i686 class CPU. This includes Pentium Pro,
# Pentium II/II/IV, Celeron CPU's and similar class CPU's (including clones
# such as AMD Athlon/Opteron, VIA C3 Nehemiah, but not VIA C3 Ezla).
Package: libgl1-mesa-dri
Section: libs
Priority: optional
Architecture: any
Depends: ${shlibs:Depends}
Suggests: libglide3
Conflicts: xlibmesa-dri (<< 1:7.0.0)
Replaces: xlibmesa-dri (<< 1:7.0.0)
Breaks: xserver-xorg-core (<< 2:1.5), libgl1-mesa-glx (<< 7.2)
Description: A free implementation of the OpenGL API -- DRI modules
This version of Mesa provides GLX and DRI capabilities: it is capable of
both direct and indirect rendering. For direct rendering, it can use DRI
modules from the libgl1-mesa-dri package to accelerate drawing.
.
This package does not include the OpenGL library itself, only the DRI
modules for accelerating direct rendering.
.
For a complete description of Mesa, please look at the
libgl1-mesa-swx11 package.
.
The tdfx DRI module needs libglide3 to enable direct rendering.
Package: libgl1-mesa-dri-dbg
Section: debug
Priority: extra
Architecture: any
Depends: libgl1-mesa-dri (= ${binary:Version})
Description: Debugging symbols for the Mesa DRI modules
This version of Mesa provides GLX and DRI capabilities: it is capable of
both direct and indirect rendering. For direct rendering, it can use DRI
modules from the libgl1-mesa-dri package to accelerate drawing.
.
This package does not include the OpenGL library itself, only the DRI
modules for accelerating direct rendering.
.
For a complete description of Mesa, please look at the
libgl1-mesa-swx11 package.
.
This package contains debugging symbols for the DRI modules.
#Package: libgl1-mesa-dri-i686
#Section: libs
#Priority: extra
#Architecture: i386 kfreebsd-i386 hurd-i386
#Pre-Depends: libgl1-mesa-dri
#Description: A free implementation of the OpenGL API -- DRI modules [i686 optimized]
# This version of Mesa provides GLX and DRI capabilities: it is capable of
# both direct and indirect rendering. For direct rendering, it can use DRI
# modules from the libgl1-mesa-dri package to accelerate drawing.
# .
# This package does not include the OpenGL library itself, only the DRI
# modules for accelerating direct rendering.
# .
# For a complete description of Mesa, please look at the
# libgl1-mesa-swx11 package.
# .
# This set of libraries is optimized for i686 machines and will only be used if
# you are running a 2.6 kernel on an i686 class CPU. This includes Pentium Pro,
# Pentium II/II/IV, Celeron CPU's and similar class CPU's (including clones
# such as AMD Athlon/Opteron, VIA C3 Nehemiah, but not VIA C3 Ezla).
Package: libgl1-mesa-dev
Section: libdevel
Architecture: any
Depends: libc6-dev, mesa-common-dev (= ${binary:Version}), libgl1-mesa-glx (= ${binary:Version})
Conflicts: libgl-dev, libgl1-mesa-dri-dev
Replaces: libgl-dev, libgl1-mesa-dri-dev
Provides: libgl-dev, libgl1-mesa-dri-dev
Description: A free implementation of the OpenGL API -- GLX development files
This version of Mesa provides GLX and DRI capabilities: it is capable of
both direct and indirect rendering. For direct rendering, it can use DRI
modules from the libgl1-mesa-dri package to accelerate drawing.
.
This package includes headers and static libraries for compiling
programs with Mesa.
.
For a complete description of Mesa, please look at the libgl1-mesa-swx11
package.
Package: mesa-common-dev
Section: libdevel
Architecture: any
Replaces: xlibmesa-gl-dev (<< 1:7), xlibosmesa-dev, libgl1-mesa-swx11-dev (<< 6.5.2), libgl1-mesa-dev (<< 7.5~rc4-2)
Depends: libx11-dev
Description: Developer documentation for Mesa
This package includes the specifications for the Mesa-specific OpenGL
extensions, the complete set of release notes and the development header
files common to all Mesa packages.
Package: libosmesa6
Section: libs
Architecture: any
Depends: ${shlibs:Depends}
Replaces: libgl1-mesa-swx11 (<< 6.5.2)
Description: Mesa Off-screen rendering extension
OSmesa is a Mesa extension that allows programs to render to an
off-screen buffer using the OpenGL API without having to create a
rendering context on an X Server. It uses a pure software renderer.
.
This package provides both 16-bit and 32-bit versions of the off-screen
renderer which do not require external libraries to work.
Package: libosmesa6-dev
Section: libdevel
Architecture: any
Depends: libosmesa6 (= ${binary:Version}), mesa-common-dev (= ${binary:Version}) | libgl-dev
Conflicts: xlibosmesa-dev, libosmesa4-dev, libosmesa-dev
Replaces: xlibosmesa-dev, libosmesa-dev, libgl1-mesa-swx11-dev (<< 6.5.2), mesa-common-dev (<< 6.5.2)
Provides: xlibosmesa-dev, libosmesa-dev
Description: Mesa Off-screen rendering extension -- development files
This package provides the required environment for developing programs
that use the off-screen rendering extension of Mesa.
.
For more information on OSmesa see the libosmesa6 package.
Package: libglu1-mesa
Section: libs
Architecture: any
Depends: ${shlibs:Depends}, libgl1-mesa-glx | libgl1
Provides: libglu1
Conflicts: mesag3 (<< 5.0.0-1), xlibmesa3, libglu1
Replaces: libglu1
Description: The OpenGL utility library (GLU)
GLU offers simple interfaces for building mipmaps; checking for the
presence of extensions in the OpenGL (or other libraries which follow
the same conventions for advertising extensions); drawing
piecewise-linear curves, NURBS, quadrics and other primitives
(including, but not limited to, teapots); tesselating surfaces; setting
up projection matrices and unprojecting screen coordinates to world
coordinates.
.
On Linux, this library is also known as libGLU or libGLU.so.1.
.
This package provides the SGI implementation of GLU shipped with the
Mesa package (ergo the "-mesa" suffix).
Package: libglu1-mesa-dev
Section: libdevel
Architecture: any
Depends: libglu1-mesa (= ${binary:Version}), libgl1-mesa-dev | libgl-dev
Provides: libglu-dev, xlibmesa-glu-dev
Conflicts: mesag-dev (<< 5.0.0-1), mesa-glide2-dev (<< 5.0.0-1), mesag3+ggi-dev (<< 5.0.0-1), xlibmesa-dev
Replaces: libglu-dev
Description: The OpenGL utility library -- development files
Includes headers and static libraries for compiling programs with GLU.
.
For a complete description of GLU, please look at the libglu1-mesa
package.
Package: libglw1-mesa
Section: libs
Architecture: any
Depends: ${shlibs:Depends}
Provides: libglw1
Description: A free implementation of the OpenGL API -- runtime
Mesa is a 3-D graphics library with an API which is very similar to
that of OpenGL. To the extent that Mesa utilizes the OpenGL command
syntax or state machine, it is being used with authorization from
Silicon Graphics, Inc. However, the author makes no claim that Mesa
is in any way a compatible replacement for OpenGL or associated with
Silicon Graphics, Inc.
.
This package provides a simple widgets library, libGLw, which
allows Motif-based applications to embed an OpenGL drawing context.
.
On Linux, this library is also known as libGLw or libGLw.so.1.
Package: libglw1-mesa-dev
Section: libdevel
Architecture: any
Depends: libglw1-mesa (= ${binary:Version}), libc6-dev, libx11-dev, libxext6, mesa-common-dev (= ${binary:Version})
Provides: mesag3-widgets, mesag-widgets-dev, libglw-dev
Conflicts: libglw-dev, libgl1-mesa-swx11-dev (<< 6.5.2-4)
Replaces: libglw-dev
Description: A free implementation of the OpenGL API -- development files
This package provides the development environment required for
compiling programs with the Mesa widgets library, libGLw, which
allows Motif-based applications to embed an OpenGL drawing context.
The headers and static libraries for compiling programs that use this
library are included.
Package: mesa-utils
Section: x11
Priority: optional
Architecture: any
Depends: ${shlibs:Depends}
Replaces: xbase-clients (<< 6.8.2-38)
Description: Miscellaneous Mesa GL utilities
This package provides several basic GL utilities built by Mesa, including
glxinfo and glxgears.
# vim: tw=0

193
debian/copyright vendored
View File

@@ -1,193 +0,0 @@
This package was debianized by James A. Treacy treacy@debian.org on Thu,
6 Jan 2000 01:11:34 -0500. It was newly debianized by Marcelo E.
Magallon <mmagallo@debian.org> on Sat, 25 Dec 2004 14:50:02 -0600. It was
again debianized by Thierry Reding <thierry@gilfi.de> on Sat, 14 Oct 2006
02:01:12 +0200.
It was downloaded from http://www.mesa3d.org/download.html
For more information see:
http://www.mesa3d.org/
Copyright:
Upstream Author: Brian Paul <brian.paul@tungstengraphics.com>
License:
License / Copyright Information
The Mesa distribution consists of several components. Different
copyrights and licenses apply to different components. For
example, GLUT is copyrighted by Mark Kilgard, some demo programs
are copyrighted by SGI, some of the Mesa device drivers are
copyrighted by their authors. See below for a list of Mesa's
components and the copyright/license for each.
The core Mesa library is licensed according to the terms of the
XFree86 copyright (an MIT-style license). This allows integration
with the XFree86/DRI project. Unless otherwise stated, the Mesa
source code and documentation is licensed as follows:
Copyright (C) 1999-2003 Brian Paul All Rights Reserved.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Attention, Contributors
When contributing to the Mesa project you must agree to relinquish
your work to the holder of the copyright for the particular
component you're contributing to. That is, you can't put your own
copyright on the code, unless it's a modular piece that can be
omitted from Mesa (like a new device driver). If for example, you
contribute a bug fix to Mesa's texture mapping code, your code
will become a part of the body of work which is copyrighted by
Brian Paul and licensed by the above terms.
----------------------------------------------------------------------
Some files, as listed below, are made available under the SGI Free B
license. This license is as follows:
SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008)
Copyright (C) [dates of first publication] Silicon Graphics, Inc. All Rights
Reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:
The above copyright notice including the dates of first publication and either
this permission notice or a reference to http://oss.sgi.com/projects/FreeB/
shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL SILICON GRAPHICS, INC. BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
IN THE SOFTWARE.
Except as contained in this notice, the name of Silicon Graphics, Inc. shall
not be used in advertising or otherwise to promote the sale, use or other
dealings in this Software without prior written authorization from Silicon
Graphics, Inc.
--------------------------------------------------------------------------
Some other files listed below are made available from Silicon Graphics,
Inc. under a more liberal, MIT-style license, as follows:
Permission to use, copy, modify, and distribute this software for
any purpose and without fee is hereby granted, provided that the above
copyright notice appear in all copies and that both the copyright notice
and this permission notice appear in supporting documentation, and that
the name of Silicon Graphics, Inc. not be used in advertising
or publicity pertaining to distribution of the software without specific,
written prior permission.
THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS"
AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE
INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR
FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT,
SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY
KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION,
LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF
THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC. HAS BEEN
ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE
POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE.
US Government Users Restricted Rights
Use, duplication, or disclosure by the Government is subject to
restrictions set forth in FAR 52.227.19(c)(2) or subparagraph
(c)(1)(ii) of the Rights in Technical Data and Computer Software
clause at DFARS 252.227-7013 and/or in similar or successor
clauses in the FAR or the DOD or NASA FAR Supplement.
Unpublished-- rights reserved under the copyright laws of the
United States. Contractor/manufacturer is Silicon Graphics,
Inc., 2011 N. Shoreline Blvd., Mountain View, CA 94039-7311.
--------------------------------------------------------------------------
Mesa Component Licenses:
Component Files Primary Author License
----------------------------------------------------------------------------
core Mesa code src/*.[ch] Brian Paul Mesa
include/GL/gl.h
GLX driver src/X/* Brian Paul Mesa
include/GL/glx.h
include/GL/xmesa.h
OS/Mesa driver src/OSmesa/* Brian Paul Mesa
include/GL/osmesa.h
3Dfx driver src/FX/* David Bucciarelli Mesa
include/GL/fxmesa.h
BeOS R4 driver mesa/drivers/beos/ Brian Paul Mesa
MGL driver include/GL/mglmesa.h SciTech, Inc GNU LGPL
Windows driver mesa/drivers/windows/ Li Wei GNU LGPL
include/GL/wmesa.h
SVGA driver mesa/drivers/svga/ Brian Paul GNU LGPL
include/GL/svgamesa.h
DOS driver mesa/drivers/dos/ Charlie Wallace GNU LGPL
include/GL/dosmesa.h
GGI driver mesa/drivers/ggi/ Uwe Maurer GNU LGPL
include/GL/ggimesa.h
GLUT src/glut/* Mark Kilgard Mark's copyright
include/GL/*glut*.h
GLU library src/glu/* Brian Paul GNU LGPL
SGI GLU library src/glu/sgi/* SGI SGI Free B
include/GL/glu.h
Ext registry include/GL/glext.h SGI SGI Free B
include/GL/glxext.h
demo programs progs/demos/* various see source files
X demos progs/xdemos/* Brian Paul see source files
SGI demos progs/samples/* SGI SGI MIT-style
RedBook demos progs/redbook/* SGI SGI MIT-style
On Debian systems the full text of the GNU LGPL license is found in
/usr/share/common-licenses/LGPL.
------------------------------------------------------------------------------
The Debian packaging is (C) 2006, Thierry Reding <thierry@gilfi.de> and
is licensed under the GPL, see `/usr/share/common-licenses/GPL'.

15
debian/glxdemo.1 vendored
View File

@@ -1,15 +0,0 @@
.TH glxdemo 1 "2006-11-29"
.SH NAME
glxdemo \- a demonstration of the GLX functions
.SH SYNOPSIS
.B glxdemo
.SH DESCRIPTION
The \fIglxdemo\fP program shows how to use the GLX functions in order to
create an OpenGL program running on top of an X server. This program is most
useful when studied in its source code form.
.SH AUTHOR
glxdemo was written by Brian Paul <brian.paul@tungstengraphics.com>.
.PP
This manual page was written by Thierry Reding <thierry@gilfi.de>, for the
Debian project (but may be used by others).

29
debian/glxgears.1 vendored
View File

@@ -1,29 +0,0 @@
.TH glxgears 1 "2006-11-29"
.SH NAME
glxgears \- ``gears'' demo for GLX
.SH SYNOPSIS
.B glxgears
.RI [ options ]
.SH DESCRIPTION
The \fIglxgears\fP program is a port of the ``gears'' demo to GLX. It displays
a set of rotating gears and prints out the frame rate at regular intervals. It
has become quite popular as basic benchmarking tool.
.SH OPTIONS
.TP 8
.B \-display \fIdisplay\fP
Specify which X display to run on.
.TP 8
.B \-info
Display OpenGL renderer information.
.TP 8
.B \-stereo
Use a stereo enabled GLX visual.
.TP 8
.B \-fullscreen
Run in fullscreen mode.
.SH AUTHOR
glxgears was written by Brian Paul <brian.paul@tungstengraphics.com>.
.PP
This manual page was written by Thierry Reding <thierry@gilfi.de>, for the
Debian project (but may be used by others).

30
debian/glxheads.1 vendored
View File

@@ -1,30 +0,0 @@
.TH glxheads 1 "2006-11-29"
.SH NAME
glxheads \- exercise multiple GLX connections
.SH SYNOPSIS
.B glxheads
[\fIdisplay\fP ...]
.SH DESCRIPTION
The \fIglxheads\fP program will try to open GLX connections on multiple X
displays as specified on the command-line. If a connection can be made it will
try to create a direct GLX context (and fallback to using indirect contexts if
that fails) and open a window displaying a spinning green triangle.
.PP
If no display names are specified, \fIglxheads\fP will default to opening a
single local connection on display 0.
.SH EXAMPLE
To open a local connection on display 0 and two remote connections to the
hosts \fImars\fP (display 0) and \fIvenus\fP (display 1), run glxheads with
the following command-line:
.PP
.RS 3n
.nf
$ glxheads :0 mars:0 venus:1
.fi
.RE
.SH AUTHOR
glxheads was written by Brian Paul <brian.paul@tungstengraphics.com>.
.PP
This manual page was written by Thierry Reding <thierry@gilfi.de> for the
Debian project (but may be used by others).

41
debian/glxinfo.1 vendored
View File

@@ -1,41 +0,0 @@
.TH glxinfo 1 "2006-11-29"
.SH NAME
glxinfo \- show information about the GLX implementation
.SH SYNOPSIS
.B glxinfo
.RI [ options ]
.SH DESCRIPTION
The \fIglxinfo\fP program shows information about the OpenGL and GLX
implementations running on a given X display.
.PP
The information includes details about the server- and client-side GLX
implementation, the OpenGL and GLU implementations as well as a list
of available GLX visuals.
.SH OPTIONS
.TP 8
.B \-v
Print visuals info in verbose form.
.TP 8
.B \-t
Print verbose table.
.TP 8
.B \-display \fIdisplay\fP
Specify the X display to interrogate.
.TP 8
.B \-h
Print usage information.
.TP 8
.B \-i
Force an indirect rendering context.
.TP 8
.B \-b
Find the "best" visual and print its number.
.TP 8
.B \-l
Print interesting OpenGL limits.
.SH AUTHOR
glxinfo was written by Brian Paul <brian.paul@tungstengraphics.com>.
.PP
This manual page was written by Thierry Reding <thierry@gilfi.de>, for the
Debian project (but may be used by others).

View File

@@ -1,2 +0,0 @@
usr/lib/libGL.so
usr/lib/pkgconfig/gl.pc

View File

@@ -1 +0,0 @@
usr/lib/dri/i686/cmov/*.so

View File

@@ -1 +0,0 @@
usr/lib/dri/*.so

View File

@@ -1 +0,0 @@
usr/lib/glx/i686/cmov/libGL.so.* usr/lib/i686/cmov

View File

@@ -1 +0,0 @@
usr/lib/glx/libGL.so.* usr/lib

View File

@@ -1 +0,0 @@
package-name-doesnt-match-sonames libGL1

View File

@@ -1 +0,0 @@
libGL 1 libgl1-mesa-glx | libgl1

View File

@@ -1,2 +0,0 @@
usr/lib/libGL.a
usr/lib/libGL.so

View File

@@ -1 +0,0 @@
usr/lib/i686/cmov/libGL.so.*

View File

@@ -1 +0,0 @@
libGL 1 libgl1-mesa-glx | libgl1

View File

@@ -1 +0,0 @@
usr/lib/libGL.so.*

View File

@@ -1 +0,0 @@
package-name-doesnt-match-sonames libGL1

View File

@@ -1 +0,0 @@
libGL 1 libgl1-mesa-glx | libgl1

View File

@@ -1,5 +0,0 @@
usr/include/GL/glu.h
usr/include/GL/glu_mangle.h
usr/lib/libGLU.a
usr/lib/libGLU.so
usr/lib/pkgconfig/glu.pc

View File

@@ -1 +0,0 @@
usr/lib/libGLU.so.*

View File

@@ -1 +0,0 @@
package-name-doesnt-match-sonames libGLU1

View File

@@ -1 +0,0 @@
libGLU 1 libglu1-mesa | libglu1

View File

@@ -1,4 +0,0 @@
usr/include/GL/GLw*A.h
usr/lib/libGLw.a
usr/lib/libGLw.so
usr/lib/pkgconfig/glw.pc

View File

@@ -1 +0,0 @@
usr/lib/libGLw.so.*

View File

@@ -1 +0,0 @@
package-name-doesnt-match-sonames libGLw1

View File

@@ -1 +0,0 @@
libGLw 1 libglw1-mesa | libglw1

View File

@@ -1,8 +0,0 @@
usr/include/GL/osmesa.h
usr/lib/libOSMesa.a
usr/lib/libOSMesa.so
usr/lib/libOSMesa16.a
usr/lib/libOSMesa16.so
usr/lib/libOSMesa32.a
usr/lib/libOSMesa32.so
usr/lib/pkgconfig/osmesa.pc

View File

@@ -1,3 +0,0 @@
usr/lib/libOSMesa.so.*
usr/lib/libOSMesa16.so.*
usr/lib/libOSMesa32.so.*

View File

@@ -1,3 +0,0 @@
libOSMesa 6 libosmesa6 (>= 6.5.2-1) | libgl1-mesa-glide3
libOSMesa16 6 libosmesa6 (>= 6.5.2-1)
libOSMesa32 6 libosmesa6 (>= 6.5.2-1)

View File

@@ -1,8 +0,0 @@
docs/bugs.html
docs/debugging.html
docs/envvars.html
docs/faq.html
docs/osmesa.html
docs/RELNOTES-*
docs/relnotes*
docs/*.spec

View File

@@ -1,8 +0,0 @@
usr/include/GL/gl.h
usr/include/GL/glext.h
usr/include/GL/gl_mangle.h
usr/include/GL/glx.h
usr/include/GL/glxext.h
usr/include/GL/glx_mangle.h
usr/include/GL/internal/dri_interface.h
usr/lib/glx/pkgconfig/dri.pc usr/lib/pkgconfig/

View File

@@ -1,4 +0,0 @@
usr/bin/glxdemo
usr/bin/glxgears
usr/bin/glxheads
usr/bin/glxinfo

View File

@@ -1,4 +0,0 @@
debian/glxdemo.1
debian/glxgears.1
debian/glxheads.1
debian/glxinfo.1

View File

@@ -1,21 +0,0 @@
Patch that fixes Debian bug #349437.
This patch by David Nusinow.
---
src/mesa/main/compiler.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
--- a/src/mesa/main/compiler.h
+++ b/src/mesa/main/compiler.h
@@ -353,8 +353,9 @@ static INLINE GLuint CPU_TO_LE32(GLuint
* USE_IEEE: Determine if we're using IEEE floating point
*/
#if defined(__i386__) || defined(__386__) || defined(__sparc__) || \
- defined(__s390x__) || defined(__powerpc__) || \
+ defined(__s390__) || defined(__s390x__) || defined(__powerpc__) || \
defined(__x86_64__) || \
+ defined(__m68k__) || \
defined(ia64) || defined(__ia64__) || \
defined(__hppa__) || defined(hpux) || \
defined(__mips) || defined(_MIPS_ARCH) || \

View File

@@ -1,56 +0,0 @@
Allow the programs that are to be built to be defined in the build
configuration.
Provide an install target for installing the programs in $(INSTALL_DIR)/bin.
This patch by Thierry Reding.
Not submitted to Mesa.
--
Also remove references to GLU library since it is not required
and we don't actually build it at this point.
---
progs/Makefile | 6 +++++-
progs/xdemos/Makefile | 7 ++++++-
2 files changed, 11 insertions(+), 2 deletions(-)
--- a/progs/xdemos/Makefile
+++ b/progs/xdemos/Makefile
@@ -13,7 +13,7 @@ APP_LIB_DEPS += -lX11 -lpthread
LIBS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -L$(libdir) $(APP_LIB_DEPS)
-PROGS = \
+PROGS ?= \
corender \
glsync \
glthreads \
@@ -68,6 +68,11 @@ default: $(PROGS)
extra: $(EXTRA_PROGS)
+install: $(PROGS)
+ $(INSTALL) -d $(DESTDIR)$(INSTALL_DIR)/bin
+ $(INSTALL) -m 755 $(PROGS) $(DESTDIR)$(INSTALL_DIR)/bin
+
+
clean:
-rm -f $(PROGS) $(EXTRA_PROGS)
-rm -f *.o *~
--- a/progs/Makefile
+++ b/progs/Makefile
@@ -21,8 +21,12 @@ subdirs:
fi \
done
-# Dummy install target
install:
+ @for dir in $(SUBDIRS) ; do \
+ if [ -d $$dir ] ; then \
+ (cd $$dir ; $(MAKE) install) ; \
+ fi \
+ done
clean:
@list='$(SUBDIRS)'; for dir in $$list tests ; do \

View File

@@ -1,15 +0,0 @@
---
src/mesa/drivers/osmesa/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/src/mesa/drivers/osmesa/Makefile
+++ b/src/mesa/drivers/osmesa/Makefile
@@ -43,7 +43,7 @@ default: $(TOP)/$(LIB_DIR)/$(OSMESA_LIB_
# -DCHAN_BITS=16/32.
$(TOP)/$(LIB_DIR)/$(OSMESA_LIB_NAME): $(OBJECTS) $(CORE_MESA)
$(MKLIB) -o $(OSMESA_LIB) -linker '$(CC)' -ldflags '$(LDFLAGS)' \
- -major $(MESA_MAJOR) -minor $(MESA_MINOR) -patch $(MESA_TINY) \
+ -major 6 -minor 5 -patch 3 \
-install $(TOP)/$(LIB_DIR) $(MKLIB_OPTIONS) \
-id $(INSTALL_LIB_DIR)/lib$(OSMESA_LIB).$(MESA_MAJOR).dylib \
$(OSMESA_LIB_DEPS) $(OBJECTS) $(CORE_MESA)

View File

@@ -1,57 +0,0 @@
From: Samuel Thibault <samuel.thibault@ens-lyon.org>
Subject: Fix build on GNU/Hurd
---
configure.ac | 27 +++++++++++++++------------
1 file changed, 15 insertions(+), 12 deletions(-)
--- a/configure.ac
+++ b/configure.ac
@@ -578,6 +578,13 @@ else
enable_xcb=no
fi
+dnl Direct rendering or just indirect rendering
+AC_ARG_ENABLE([driglx-direct],
+ [AS_HELP_STRING([--disable-driglx-direct],
+ [enable direct rendering in GLX for DRI @<:@default=enabled@:>@])],
+ [driglx_direct="$enableval"],
+ [driglx_direct="yes"])
+
dnl
dnl libGL configuration per driver
dnl
@@ -611,12 +618,14 @@ dri)
AC_MSG_ERROR([Can't use static libraries for DRI drivers])
fi
- # Check for libdrm
- PKG_CHECK_MODULES([LIBDRM], [libdrm >= $LIBDRM_REQUIRED])
- PKG_CHECK_MODULES([DRI2PROTO], [dri2proto >= $DRI2PROTO_REQUIRED])
- PKG_CHECK_MODULES([GLPROTO], [glproto >= $GLPROTO_REQUIRED])
- GL_PC_REQ_PRIV="libdrm >= $LIBDRM_REQUIRED dri2proto >= $DRI2PROTO_REQUIRED glproto >= $GLPROTO_REQUIRED"
- DRI_PC_REQ_PRIV="libdrm >= $LIBDRM_REQUIRED"
+ if test x"$driglx_direct" = xyes; then
+ # Check for libdrm
+ PKG_CHECK_MODULES([LIBDRM], [libdrm >= $LIBDRM_REQUIRED])
+ PKG_CHECK_MODULES([DRI2PROTO], [dri2proto >= $DRI2PROTO_REQUIRED])
+ PKG_CHECK_MODULES([GLPROTO], [glproto >= $GLPROTO_REQUIRED])
+ GL_PC_REQ_PRIV="libdrm >= $LIBDRM_REQUIRED dri2proto >= $DRI2PROTO_REQUIRED glproto >= $GLPROTO_REQUIRED"
+ DRI_PC_REQ_PRIV="libdrm >= $LIBDRM_REQUIRED"
+ fi
# find the DRI deps for libGL
if test "$x11_pkgconfig" = yes; then
@@ -690,12 +699,6 @@ AC_ARG_WITH([dri-searchpath],
[DRI_DRIVER_SEARCH_DIR="$withval"],
[DRI_DRIVER_SEARCH_DIR='${DRI_DRIVER_INSTALL_DIR}'])
AC_SUBST([DRI_DRIVER_SEARCH_DIR])
-dnl Direct rendering or just indirect rendering
-AC_ARG_ENABLE([driglx-direct],
- [AS_HELP_STRING([--disable-driglx-direct],
- [enable direct rendering in GLX for DRI @<:@default=enabled@:>@])],
- [driglx_direct="$enableval"],
- [driglx_direct="yes"])
dnl Which drivers to build - default is chosen by platform
AC_ARG_WITH([dri-drivers],
[AS_HELP_STRING([--with-dri-drivers@<:@=DIRS...@:>@],

View File

@@ -1,21 +0,0 @@
From: Aurelien Jarno <aurel32@debian.org>
mesa fails to build on GNU/kFreeBSD, since some parts are not enabled.
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=524690
---
configure.ac | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/configure.ac
+++ b/configure.ac
@@ -770,7 +770,7 @@ if test "$mesa_driver" = dri; then
;;
esac
;;
- freebsd* | dragonfly*)
+ freebsd* | dragonfly* | kfreebsd*-gnu*)
DEFINES="$DEFINES -DPTHREADS -DUSE_EXTERNAL_DXTN_LIB=1"
DEFINES="$DEFINES -DIN_DRI_DRIVER -DHAVE_ALIAS"
DEFINES="$DEFINES -DGLX_INDIRECT_RENDERING"

View File

@@ -1,5 +0,0 @@
02_use-ieee-fp-on-s390-and-m68k.patch
03_optional-progs-and-install.patch
04_osmesa_version.diff
05_hurd-ftbfs.diff
06_kfreebsd-ftbfs.diff

247
debian/rules vendored
View File

@@ -1,247 +0,0 @@
#!/usr/bin/make -f
# debian/rules for the Debian mesa package
# Copyright © 2006 Thierry Reding <thierry@gilfi.de>
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
CFLAGS = -Wall -g
ifneq (,$(filter noopt,$(DEB_BUILD_OPTIONS)))
CFLAGS += -O0
else
CFLAGS += -O2
endif
ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
MAKEFLAGS += -j$(NUMJOBS)
endif
DEB_BUILD_ARCH ?= $(shell dpkg-architecture -qDEB_BUILD_ARCH)
DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
DEB_HOST_ARCH_OS ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_OS)
DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
DEB_HOST_GNU_CPU ?= $(shell dpkg-architecture -qDEB_HOST_GNU_CPU)
DEB_BUILD_DIR ?= $(CURDIR)/build
ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
confflags += --build=$(DEB_HOST_GNU_TYPE)
else
confflags += --build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE)
endif
# choose which configurations to build
include debian/scripts/choose-configs
# build the following configurations by default
CONFIGS = $(SWX11_GLU_CONFIGS) \
dri \
osmesa \
osmesa-static \
osmesa16 \
osmesa16-static \
osmesa32 \
osmesa32-static
STAMP_DIR = debian/stamp
STAMP = $(STAMP_DIR)/$(DEB_BUILD_GNU_TYPE)
BUILD_STAMPS = $(addprefix $(STAMP)-build-, $(CONFIGS))
QUILT_STAMPFN = $(STAMP_DIR)/patch
include /usr/share/quilt/quilt.make
# temporary until we figure out what to build
confflags += --disable-gallium
confflags-common = \
--disable-egl \
--disable-glu \
--disable-glut \
--disable-glw \
CFLAGS="$(CFLAGS)"
DRI_DRIVERS = swrast
# hurd doesn't do direct rendering
ifeq ($(DEB_HOST_ARCH_OS), hurd)
DIRECT_RENDERING = --disable-driglx-direct
else
DIRECT_RENDERING = --enable-driglx-direct
ifeq ($(DEB_HOST_ARCH), lpia)
DRI_DRIVERS += i915 i965
else ifneq ($(DEB_HOST_ARCH), s390)
DRI_DRIVERS += mach64 mga r128 r200 r300 r600 radeon savage tdfx
ifeq ($(DEB_HOST_GNU_CPU), i486)
DRI_DRIVERS += i810 i915 i965 sis unichrome
else ifeq ($(DEB_HOST_GNU_CPU), x86_64)
DRI_DRIVERS += i915 i965 sis unichrome
else ifeq ($(DEB_HOST_ARCH), sparc)
DRI_DRIVERS += ffb
else ifeq ($(DEB_HOST_ARCH), sparc64)
DRI_DRIVERS += ffb
endif
endif
endif
confflags-dri = \
--with-driver=dri \
--with-dri-drivers="$(DRI_DRIVERS)" \
--with-demos=xdemos \
--libdir=/usr/lib/glx \
--with-dri-driverdir=/usr/lib/dri \
--enable-glx-tls \
$(DIRECT_RENDERING) \
$(confflags-common)
confflags-osmesa = \
--with-driver=osmesa \
--with-demos= \
$(confflags-common)
confflags-osmesa-static = \
--with-driver=osmesa \
--enable-static \
--with-demos= \
$(confflags-common)
confflags-osmesa16 = \
--with-driver=osmesa \
--with-osmesa-bits=16 \
--with-demos= \
$(confflags-common)
confflags-osmesa16-static = \
--with-driver=osmesa \
--with-osmesa-bits=16 \
--enable-static \
--with-demos= \
$(confflags-common)
confflags-osmesa32 = \
--with-driver=osmesa \
--with-osmesa-bits=32 \
--with-demos= \
$(confflags-common)
confflags-osmesa32-static = \
--with-driver=osmesa \
--with-osmesa-bits=32 \
--enable-static \
--with-demos= \
$(confflags-common)
confflags-swx11+glu = \
--with-driver=xlib \
--disable-gl-osmesa \
--with-demos= \
--disable-egl \
--disable-glut \
--enable-motif \
CFLAGS="$(CFLAGS)"
confflags-swx11+glu-static = \
--with-driver=xlib \
--disable-gl-osmesa \
--enable-static \
--with-demos= \
--disable-egl \
--disable-glut \
--enable-motif \
CFLAGS="$(CFLAGS)"
confflags-swx11+glu-i386-i686 = \
--with-driver=xlib \
--disable-gl-osmesa \
--with-demos= \
--disable-glut \
--disable-egl \
--enable-motif \
--libdir=/usr/lib/i686/cmov \
CFLAGS="$(CFLAGS) -march=i686"
configure: $(QUILT_STAMPFN) configure.ac
autoreconf -vfi
# list the configurations that will built
configs:
@echo Building the following configurations: $(CONFIGS)
$(STAMP_DIR)/stamp:
dh_testdir
mkdir -p $(STAMP_DIR)
>$@
$(QUILT_STAMPFN): $(STAMP_DIR)/stamp
build: $(BUILD_STAMPS)
$(STAMP)-build-%: configure
dh_testdir
mkdir -p $(DEB_BUILD_DIR)/$*
find $(CURDIR)/* -maxdepth 0 -not -path '$(DEB_BUILD_DIR)*' | \
xargs cp -rlf -t $(DEB_BUILD_DIR)/$*
cd $(DEB_BUILD_DIR)/$* && \
../../configure --prefix=/usr --mandir=\$${prefix}/share/man \
--infodir=\$${prefix}/share/info --sysconfdir=/etc \
--localstatedir=/var $(confflags) $(confflags-$*)
cd $(DEB_BUILD_DIR)/$* && $(MAKE)
touch $@
install: build
# Add here commands to install the package into debian/tmp
dh_testdir
dh_testroot
dh_clean -k
dh_installdirs
set -e; for config in $(CONFIGS); do \
$(MAKE) -C $(DEB_BUILD_DIR)/$$config DESTDIR=$(CURDIR)/debian/tmp install; \
done
clean: unpatch
dh_testdir
dh_testroot
rm -rf .pc
rm -f config.cache config.log config.status
rm -f */config.cache */config.log */config.status
rm -f conftest* */conftest*
rm -rf autom4te.cache */autom4te.cache
rm -rf build
rm -rf configure config.guess config.sub config.h.in
rm -rf $$(find -name Makefile.in)
rm -rf aclocal.m4 missing depcomp install-sh ltmain.sh
rm -rf $(STAMP_DIR)
dh_clean
# Build architecture-independent files here.
binary-indep: install
# Build architecture-dependent files here.
binary-arch: install
dh_testdir
dh_testroot
dh_installchangelogs -s
dh_installchangelogs -pmesa-common-dev ChangeLog
dh_installdocs -s
dh_installexamples -s
dh_install -s --sourcedir=debian/tmp --list-missing
dh_installman -s
dh_lintian -s
dh_link -s
dh_strip -plibgl1-mesa-swx11 --dbg-package=libgl1-mesa-swx11-dbg
dh_strip -plibgl1-mesa-glx --dbg-package=libgl1-mesa-glx-dbg
dh_strip -plibgl1-mesa-dri --dbg-package=libgl1-mesa-dri-dbg
dh_strip -s
dh_compress -s
dh_fixperms -s
dh_makeshlibs -s
dh_installdeb -s
dh_shlibdeps -s
dh_gencontrol -s
dh_md5sums -s
dh_builddeb -s
binary: binary-indep binary-arch
.PHONY: configs build clean binary-indep binary-arch binary install

View File

@@ -1,58 +0,0 @@
# Script to choose which configurations are to be built depending on the value
# of the DEB_BUILD_ARCH variable.
#
# Copyright © 2006 Thierry Reding <thierry@gilfi.de>
##############################################################################
## architecture-specific configurations ######################################
# choose an architecture-specific build of swx11 and GLU if a matching
# configuration exists
#ifneq ($(wildcard configs/debian-swx11+glu-$(DEB_BUILD_ARCH)),)
# SWX11_GLU_CONFIGS := debian-swx11+glu-$(DEB_BUILD_ARCH)
#else
# SWX11_GLU_CONFIGS := debian-swx11+glu-any
#endif
# same for static builds
#ifneq ($(wildcard configs/debian-swx11+glu-static-$(DEB_BUILD_ARCH)),)
# SWX11_GLU_CONFIGS += debian-swx11+glu-static-$(DEB_BUILD_ARCH)
#else
# SWX11_GLU_CONFIGS += debian-swx11+glu-static-any
#endif
SWX11_GLU_CONFIGS := swx11+glu swx11+glu-static
# and for the GLX/DRI-enabled libGL
ifneq ($(wildcard configs/debian-indirect-$(DEB_BUILD_ARCH)),)
DRI_CONFIGS := debian-indirect-$(DEB_BUILD_ARCH)
else
ifneq ($(wildcard configs/debian-dri-$(DEB_BUILD_ARCH)),)
DRI_CONFIGS := debian-dri-$(DEB_BUILD_ARCH)
else
DRI_CONFIGS := debian-dri-any
endif
endif
##############################################################################
## CPU-optimized configurations ##############################################
ifneq (,$(filter $(DEB_BUILD_ARCH), i386 kfreebsd-i386 hurd-i386))
SWX11_GLU_CONFIGS += swx11+glu-i386-i686
# DRI_CONFIGS += debian-dri-i386-i686
endif
#ifeq ($(DEB_BUILD_ARCH), alpha)
# SWX11_GLU_CONFIGS += debian-swx11+glu-alpha-ev5
#endif
#ifeq ($(DEB_BUILD_ARCH), powerpc)
# SWX11_GLU_CONFIGS += debian-swx11+glu-powerpc-603
#endif
#ifeq ($(DEB_BUILD_ARCH), sparc)
# SWX11_GLU_CONFIGS += debian-swx11+glu-sparc-ultrasparc
#endif
# vim: ft=make

6
debian/watch vendored
View File

@@ -1,6 +0,0 @@
version=3
opts="uversionmangle=s/-rc/~rc/" \
http://sf.net/mesa3d/MesaLib-(.*)\.tar\.gz
opts="uversionmangle=s/-rc/~rc/" \
ftp://freedesktop.org/pub/mesa/([\d\.]*)/ MesaLib-(.*)\.tar\.gz

View File

@@ -0,0 +1,4 @@
Known issues in the ARB_color_buffer_float implementation:
- Rendering to multiple render targets, some fixed-point, some floating-point, with FIXED_ONLY fragment clamping and polygon smooth enabled may write incorrect values to the fixed point buffers (depends on spec interpretation)
- For fragment programs with ARB_fog_* options, colors are clamped before fog application regardless of the fragment clamping setting (this depends on spec interpretation)

View File

@@ -12,41 +12,48 @@ Feature Status
GL 3.0:
GLSL changes (GL_EXT_gpu_shader4, etc) not started
Conditional rendering (GL_NV_conditional_render) DONE (swrast & softpipe)
Map buffer subranges (GL_APPLE_flush_buffer_range) not started
Float textures, renderbuffers some infrastructure done
GLSL 1.30 (GL_EXT_gpu_shader4, etc.) started
Conditional rendering (GL_NV_conditional_render) DONE (swrast, softpipe, i965)
Map buffer subranges (GL_ARB_map_buffer_range) DONE
Clamping controls (GL_ARB_color_buffer_float) DONE
Float textures, renderbuffers (GL_ARB_texture_float) DONE (gallium r300)
GL_EXT_packed_float DONE (gallium r600)
GL_EXT_texture_shared_exponent DONE (gallium, swrast)
Float depth buffers (GL_ARB_depth_buffer_float) not started
Framebuffer objects (GL_EXT_framebuffer_object) DONE
Half-float some infrastructure done
Half-float DONE
Multisample blit DONE
Non-normalized Integer texture/framebuffer formats not started
Non-normalized Integer texture/framebuffer formats ~50% done
1D/2D Texture arrays core Mesa, swrast done
Packed depth/stencil formats DONE
Per-buffer blend and masks (GL_EXT_draw_buffers2) DONE
GL_EXT_texture_compression_rgtc not started
Red and red/green texture formats Ian?
Transform feedback (GL_EXT_transform_feedback) not started
GL_EXT_texture_compression_rgtc DONE (swrast, gallium r600)
Red and red/green texture formats DONE (swrast, i965, gallium)
Transform feedback (GL_EXT_transform_feedback) ~50% done
glBindFragDataLocation, glGetFragDataLocation,
glBindBufferRange, glBindBufferBase commands
Vertex array objects (GL_APPLE_vertex_array_object) DONE
sRGB framebuffer format (GL_EXT_framebuffer_sRGB) not started
glClearBuffer commands DONE, except for dispatch
glGetStringi command DONE, except for dispatch
glTexParameterI, glGetTexParameterI commands DONE, except for dispatch
glVertexAttribI commands not started
glBindFragDataLocation, glGetFragDataLocation cmds not started
glBindBufferRange, glBindBufferBase commands not started
sRGB framebuffer format (GL_EXT_framebuffer_sRGB) core GL done (i965, gallium), GLX todo
glClearBuffer commands DONE
glGetStringi command DONE
glTexParameterI, glGetTexParameterI commands DONE
glVertexAttribI commands DONE (but converts int
values to floats)
Depth format cube textures 0% done
GL 3.1:
GLSL 1.30 and 1.40 not started
Instanced drawing (GL_ARB_draw_instanced) not started
GLSL 1.40 not started
Instanced drawing (GL_ARB_draw_instanced) DONE (gallium, swrast)
Buffer copying (GL_ARB_copy_buffer) DONE
Primitive restart (GL_NV_primitive_restart) not started
Primitive restart (GL_NV_primitive_restart) DONE (gallium)
16 vertex texture image units not started
Texture buffer objs (GL_ARB_textur_buffer_object) not started
Texture buffer objs (GL_ARB_texture_buffer_object) not started
Rectangular textures (GL_ARB_texture_rectangle) DONE
Uniform buffer objs (GL_ARB_uniform_buffer_object) not started
Signed normalized texture formats not started
Signed normalized textures (GL_EXT_texture_snorm) DONE (gallium)
GL 3.2:
@@ -56,14 +63,57 @@ GLSL 1.50 not started
Geometry shaders (GL_ARB_geometry_shader4) partially done (Zack)
BGRA vertex order (GL_ARB_vertex_array_bgra) DONE
Base vertex offset(GL_ARB_draw_elements_base_vertex) DONE
Frag shader coord (GL_ARB_fragment_coord_conventions) not started
Frag shader coord (GL_ARB_fragment_coord_conventions) DONE (swrast, gallium)
Provoking vertex (GL_ARB_provoking_vertex) DONE
Seamless cubemaps (GL_ARB_seamless_cube_map) DONE, mostly?
Seamless cubemaps (GL_ARB_seamless_cube_map) DONE
Multisample textures (GL_ARB_texture_multisample) not started
Frag depth clamp (GL_ARB_depth_clamp) DONE
Fence objects (GL_ARB_sync) DONE
GL 3.3:
GLSL 3.30 not started
GL_ARB_blend_func_extended not started
GL_ARB_explicit_attrib_location DONE (swrast, i915, i965)
GL_ARB_occlusion_query2 DONE (swrast, gallium)
GL_ARB_sampler_objects DONE (gallium)
GL_ARB_texture_rgb10_a2ui not started
GL_ARB_texture_swizzle DONE (same as EXT version)
GL_ARB_timer_query ~60% done (the EXT variant)
GL_ARB_instanced_arrays DONE (gallium)
GL_ARB_vertex_type_2_10_10_10_rev not started
GL 4.0:
GLSL 4.0 not started
GL_ARB_texture_query_lod not started
GL_ARB_draw_buffers_blend DONE (gallium softpipe)
GL_ARB_draw_indirect not started
GL_ARB_gpu_shader_fp64 not started
GL_ARB_sample_shading not started
GL_ARB_shader_subroutine not started
GL_ARB_tessellation_shader not started
GL_ARB_texture_buffer_object_rgb32 not started
GL_ARB_texture_cube_map_array not started
GL_ARB_texture_gather not started
GL_ARB_transform_feedback2 not started
GL_ARB_transform_feedback3 not started
GL 4.1:
GLSL 4.1 not started
GL_ARB_ES2_compatibility DONE (i965)
GL_ARB_get_program_binary not started
GL_ARB_separate_shader_objects some infrastructure done
GL_ARB_shader_precision not started
GL_ARB_vertex_attrib_64bit not started
GL_ARB_viewport_array not started
More info about these features and the work involved can be found at
http://dri.freedesktop.org/wiki/MissingFunctionality

View File

@@ -67,7 +67,7 @@ Additions to Chapter 3 the GLX 1.4 Specification (Functions and Errors)
On "PC" computers, AGP memory can be allocated with glXAllocateMemoryNV
and freed with glXFreeMemoryNV. Sometimes it's useful to know where a
block of AGP memory is located with respect to the start of the AGP
aperature. The function
aperture. The function
GLuint glXGetAGPOffsetMESA( const GLvoid *pointer )

153
docs/MESA_drm_image.spec Normal file
View File

@@ -0,0 +1,153 @@
Name
MESA_drm_image
Name Strings
EGL_MESA_drm_image
Contact
Kristian Høgsberg <krh@bitplanet.net>
Status
Proposal
Version
Version 2, August 25, 2010
Number
EGL Extension #not assigned
Dependencies
Requires EGL 1.4 or later. This extension is written against the
wording of the EGL 1.4 specification.
EGL_KHR_base_image is required.
Overview
This extension provides entry points for integrating EGLImage with the
Linux DRM mode setting and memory management drivers. The extension
lets applications create EGLImages without a client API resource and
lets the application get the DRM buffer handles.
IP Status
Open-source; freely implementable.
New Procedures and Functions
EGLImageKHR eglCreateDRMImageMESA(EGLDisplay dpy,
const EGLint *attrib_list);
EGLBoolean eglExportDRMImageMESA(EGLDisplay dpy,
EGLImageKHR image,
EGLint *name,
EGLint *handle,
EGLint *stride);
New Tokens
Accepted in the <attrib_list> parameter of eglCreateDRMImageMESA:
EGL_DRM_BUFFER_FORMAT_MESA 0x31D0
EGL_DRM_BUFFER_USE_MESA 0x31D1
Accepted as values for the EGL_IMAGE_FORMAT_MESA attribute:
EGL_DRM_BUFFER_FORMAT_ARGB32_MESA 0x31D2
Bits accepted in EGL_DRM_BUFFER_USE_MESA:
EGL_DRM_BUFFER_USE_SCANOUT_MESA 0x0001
EGL_DRM_BUFFER_USE_SHARE_MESA 0x0002
EGL_DRM_BUFFER_USE_CURSOR_MESA 0x0004
Accepted in the <target> parameter of eglCreateImageKHR:
EGL_DRM_BUFFER_MESA 0x31D3
Use when importing drm buffer:
EGL_DRM_BUFFER_STRIDE_MESA 0x31D4
EGL_DRM_BUFFER_FORMAT_MESA 0x31D0
Additions to the EGL 1.4 Specification:
To create a DRM EGLImage, call
EGLImageKHR eglCreateDRMImageMESA(EGLDisplay dpy,
const EGLint *attrib_list);
In the attribute list, pass EGL_WIDTH, EGL_HEIGHT and format and
use in the attrib list using EGL_DRM_BUFFER_FORMAT_MESA and
EGL_DRM_BUFFER_USE_MESA. The only format specified by this
extension is EGL_DRM_BUFFER_FORMAT_ARGB32_MESA, where each pixel
is a CPU-endian, 32-bit quantity, with alpha in the upper 8 bits,
then red, then green, then blue. The bit values accepted by
EGL_DRM_BUFFER_USE_MESA are EGL_DRM_BUFFER_USE_SCANOUT_MESA,
EGL_DRM_BUFFER_USE_SHARE_MESA and EGL_DRM_BUFFER_USE_CURSOR_MESA.
EGL_DRM_BUFFER_USE_SCANOUT_MESA requests that the created EGLImage
should be usable as a scanout buffer with the DRM kernel
modesetting API. EGL_DRM_BUFFER_USE_SHARE_MESA requests that the
EGLImage can be shared with other processes by passing the
underlying DRM buffer name. EGL_DRM_BUFFER_USE_CURSOR_MESA
requests that the image must be usable as a cursor with KMS. When
EGL_DRM_BUFFER_USE_CURSOR_MESA is set, width and height must both
be 64.
To create a process local handle or a global DRM name for a
buffer, call
EGLBoolean eglExportDRMImageMESA(EGLDisplay dpy,
EGLImageKHR image,
EGLint *name,
EGLint *handle,
EGLint *stride);
If <name> is non-NULL, a global name is assigned to the image and
written to <name>, the handle (local to the DRM file descriptor,
for use with DRM kernel modesetting API) is written to <handle> if
non-NULL and the stride (in bytes) is written to <stride>, if
non-NULL.
Import a shared buffer by calling eglCreateImageKHR with
EGL_DRM_BUFFER_MESA as the target, using EGL_WIDTH, EGL_HEIGHT,
EGL_DRM_BUFFER_FORMAT_MESA, EGL_DRM_BUFFER_STRIDE_MESA
in the attrib list.
Issues
1. Why don't we use eglCreateImageKHR with a target that
indicates that we want to create an EGLImage from scratch?
RESOLVED: The eglCreateImageKHR entry point is reserved for
creating an EGLImage from an already existing client API
resource. This is fine when we're creating the EGLImage from
an existing DRM buffer name, it doesn't seem right to overload
the function to also allocate the underlying resource.
2. Why don't we use an eglQueryImageMESA type functions for
querying the DRM EGLImage attributes (name, handle, and stride)?
RESOLVED: The eglQueryImage function has been proposed often,
but it goes against the EGLImage design. EGLImages are opaque
handles to a 2D array of pixels, which can be passed between
client APIs. By referencing an EGLImage in a client API, the
EGLImage target (a texture, a renderbuffer or such) can be
used to query the attributes of the EGLImage. We don't have a
full client API for creating and querying DRM buffers, though,
so we use a new EGL extension entry point instead.
Revision History
Version 1, June 3, 2010
Initial draft (Kristian Høgsberg)
Version 2, August 25, 2010
Flesh out the extension a bit, add final EGL tokens, capture
some of the original discussion in the issues section.

View File

@@ -0,0 +1,158 @@
Name
MESA_multithread_makecurrent
Name Strings
GLX_MESA_multithread_makecurrent
Contact
Eric Anholt (eric@anholt.net)
Status
Not shipping.
Version
Last Modified Date: 21 February 2011
Number
TBD
Dependencies
OpenGL 1.0 or later is required.
GLX 1.3 or later is required.
Overview
The GLX context setup encourages multithreaded applications to
create a context per thread which each operate on their own
objects in parallel, and leaves synchronization for write access
to shared objects up to the application.
For some applications, maintaining per-thread contexts and
ensuring that the glFlush happens in one thread before another
thread starts working on that object is difficult. For them,
using the same context across multiple threads and protecting its
usage with a mutex is both higher performance and easier to
implement. This extension gives those applications that option by
relaxing the context binding requirements.
This new behavior matches the requirements of AGL, while providing
a feature not specified in WGL.
IP Status
Open-source; freely implementable.
Issues
None.
New Procedures and Functions
None.
New Tokens
None.
Changes to Chapter 2 of the GLX 1.3 Specification (Functions and Errors)
Replace the following sentence from section 2.2 Rendering Contexts:
In addition, a rendering context can be current for only one
thread at a time.
with:
In addition, an indirect rendering context can be current for
only one thread at a time. A direct rendering context may be
current to multiple threads, with synchronization of access to
the context thruogh the GL managed by the application through
mutexes.
Changes to Chapter 3 of the GLX 1.3 Specification (Functions and Errors)
Replace the following sentence from section 3.3.7 Rendering Contexts:
If ctx is current to some other thread, then
glXMakeContextCurrent will generate a BadAccess error.
with:
If ctx is an indirect context current to some other thread,
then glXMakeContextCurrent will generate a BadAccess error.
Replace the following sentence from section 3.5 Rendering Contexts:
If ctx is current to some other thread, then
glXMakeCurrent will generate a BadAccess error.
with:
If ctx is an indirect context current to some other thread,
then glXMakeCurrent will generate a BadAccess error.
GLX Protocol
None. The GLX extension only extends to direct rendering contexts.
Errors
None.
New State
None.
Issues
(1) What happens if the app binds a context/drawable in multiple
threads, then binds a different context/thread in one of them?
As with binding a new context from the current thread, the old
context's refcount is reduced and the new context's refcount is
increased.
(2) What happens if the app binds a context/drawable in multiple
threads, then binds None/None in one of them?
The GLX context is unreferenced from that thread, and the other
threads retain their GLX context binding.
(3) What happens if the app binds a context/drawable in 7 threads,
then destroys the context in one of them?
As with GLX context destruction previously, the XID is destroyed
but the context remains usable by threads that have the context
current.
(4) What happens if the app binds a new drawable/readable with
glXMakeCurrent() when it is already bound to another thread?
The context becomes bound to the new drawable/readable, and
further rendering in either thread will use the new
drawable/readable.
(5) What requirements should be placed on the user managing contexts
from multiple threads?
The intention is to allow multithreaded access to the GL at the
minimal performance cost, so requiring that the GL do general
synchronization (beyond that already required by context sharing)
is not an option, and synchronizing of GL's access to the GL
context between multiple threads is left to the application to do
across GL calls. However, it would be unfortunate for a library
doing multithread_makecurrent to require that other libraries
share in synchronization for binding of their own contexts, so the
refcounting of the contexts is required to be threadsafe.
(6) Does this apply to indirect contexts?
This was ignored in the initial revision of the spec. Behavior
for indirect contexts is left as-is.
Revision History
20 November 2009 Eric Anholt - initial specification
22 November 2009 Eric Anholt - added issues from Ian Romanick.
3 February 2011 Eric Anholt - updated with resolution to issues 1-3
3 February 2011 Eric Anholt - added issue 4, 5
21 February 2011 Eric Anholt - Include glXMakeCurrent() sentence
along with glXMakeContextCurrent() for removal.

View File

@@ -48,7 +48,7 @@ IP Status
Issues
1. Should we also defined UNPACK_INVERT_MESA for glDrawPixels, etc?
1. Should we also define UNPACK_INVERT_MESA for glDrawPixels, etc?
Resolved: No, we're only concerned with pixel packing. There are other
solutions for inverting images when using glDrawPixels (negative Y pixel

View File

@@ -31,12 +31,12 @@ Overview
Mesa's implementation of GLX is entirely implemented on the client side.
Therefore, Mesa cannot immediately detect when an X window or pixmap is
destroyed in order to free any ancilliary data associated with the window
destroyed in order to free any ancillary data associated with the window
or pixmap.
The glxMesaReleaseBuffers() function can be used to explicitly indicate
when the back color buffer, depth buffer, stencil buffer, and/or accum-
ulation buffer associated with a drawable can be freed.
when the back color buffer, depth buffer, stencil buffer, and/or accumu-
lation buffer associated with a drawable can be freed.
IP Status
@@ -60,7 +60,7 @@ Additions to Chapter 3 of the GLX 1.3 Specification (Functions and Errors)
Bool glXReleaseBuffersMESA( Display *dpy, GLXDrawable d );
causes all software ancilliary buffers (back buffer, depth, stencil,
causes all software ancillary buffers (back buffer, depth, stencil,
accum, etc) associated with the named drawable to be immediately
deallocated. True is returned if <d> is a valid Mesa GLX drawable,
else False is returned. After calling glXReleaseBuffersMESA, the

View File

@@ -35,7 +35,7 @@ Overview
Mesa's glViewport command queries the current window size and updates
its internal data structors accordingly. This normally works fine
since most applications call glViewport in responce to window size
since most applications call glViewport in response to window size
changes.
In some situations, however, the application may not call glViewport
@@ -65,7 +65,7 @@ Additions to the AGL/GLX/WGL Specifications
Errors
INVALID_OPERATION is generated if ResizeBuffersMESA is called betweeen
INVALID_OPERATION is generated if glResizeBuffersMESA is called between
Begin and End.
New State

View File

@@ -88,8 +88,8 @@ Additions to the GLX 1.3 Specification
this is typically the time required to display both the even and odd
fields of a frame of video data.
If <interval> is set to a value of 0, buffer swaps are not synchron-
ized to a video frame. The <interval> value is silently clamped to
If <interval> is set to a value of 0, buffer swaps are not synchro-
nized to a video frame. The <interval> value is silently clamped to
the maximum implementation-dependent value supported before being
stored.

View File

@@ -328,7 +328,7 @@ Additions to Chapter 3 of the OpenGL 2.0 Specification (Rasterization)
-- Section 3.8.10 "Texture Completeness"
Change the second paragaph (page 177) to say (spec changes identical
Change the second paragraph (page 177) to say (spec changes identical
to EXT_texture_array):
"For one-, two-, or three-dimensional textures and one- or
@@ -443,10 +443,10 @@ Additions to Chapter 3 of the OpenGL 2.0 Specification (Rasterization)
Change second through fourth paragraphs (page 188) to say:
"Let D_t be the depth texture value, in the range [0, 1]. For
texture lookups from one- and two-dimesional, rectangle, and
texture lookups from one- and two-dimensional, rectangle, and
one-dimensional array targets, let R be the interpolated <r>
texture coordinate, clamped to the range [0, 1]. For texture lookups
from two-dimesional array texture targets, let R be the interpolated
from two-dimensional array texture targets, let R be the interpolated
<q> texture coordinate, clamped to the range [0, 1]. Then the
effective texture value L_t, I_t, or A_t is computed as follows:
@@ -604,7 +604,7 @@ Additions to Chapter 5 of the OpenGL 2.0 Specification (Special Functions)
-- Section 5.4 "Display Lists"
Change the first paragraphi on page 242 to say (spec changes
Change the first paragraph on page 242 to say (spec changes
identical to EXT_texture_array):
"TexImage3D, TexImage2D, TexImage1D, Histogram, and ColorTable are

View File

@@ -44,7 +44,7 @@ Overview
ARB_texture_compression_rgtc introduces some compressed red and
red_green signed formats but no uncompressed ones, which might
still be useful. NV_texture_shader adds signed texture formats,
but also a lot of functionality which has been superceded by fragment
but also a lot of functionality which has been superseded by fragment
shaders.
It is usually possible to get the same functionality
using a unsigned format by doing scale and bias in a shader, but this
@@ -105,7 +105,7 @@ Issues
This is also different to what NV_texture_shader used.
The above mapping should be considered the reference, but there
is some leeway so other mappings are allowed for implementations which
cannot do this. Particulary the mapping given in NV_texture_shader or
cannot do this. Particularly the mapping given in NV_texture_shader or
the standard OpenGL byte/float mapping is considered acceptable too, as
might be a mapping which represents -1.0 by -128, 0.0 by 0 and 1.0 by
127 (that is, uses different scale factors for negative and positive

View File

@@ -88,7 +88,7 @@ Additions to Chapter 2 of the OpenGL 1.2 Specification (OpenGL Operation)
WindosPos4MESA takes four values indicating x, y, z, and w.
WindowPos3MESA (or WindowPos2MESA) is analaguos, but sets only
x, y, and z with w implicitly set to 1 (or only x and y with z
implicititly set to 0 and w implicitly set to 1).
implicitly set to 0 and w implicitly set to 1).
WindowPosMESA operates like RasterPos except that the current modelview
matrix, projection matrix and viewport parameters are ignored and the
@@ -108,7 +108,7 @@ GLX Protocol
Errors
INVALID_OPERATION is generated if WindowPosMESA is called betweeen
INVALID_OPERATION is generated if WindowPosMESA is called between
Begin and End.
New State

View File

@@ -26,7 +26,7 @@ Number
Dependencies
OpenGL 1.0 or later is required
This extensions is written against the OpenGL 1.4 Specification.
This extension is written against the OpenGL 1.4 Specification.
NV_texture_rectangle effects the definition of this extension.
Overview
@@ -104,7 +104,7 @@ Additions to Chapter 3 of the OpenGL 1.4 Specification (Rasterization)
In section 3.6.4, Rasterization of Pixel Rectangles, on page 104,
add the following to Table 3.12 (Packed pixel fiedl assignments):
add the following to Table 3.12 (Packed pixel field assignments):
First Second Third Fourth
Format Element Element Element Element

View File

@@ -0,0 +1,230 @@
Name
MESA_packed_depth_stencil
Name Strings
GL_MESA_packed_depth_stencil
Contact
Keith Whitwell, VA Linux Systems Inc. (keithw 'at' valinux.com)
Brian Paul, VA Linux Systems Inc. (brianp 'at' valinux.com)
Status
Obsolete.
Version
Number
???
Dependencies
EXT_abgr affects the definition of this extension
SGIS_texture4D affects the definition of this extension
EXT_cmyka affects the definition of this extension
ARB_packed_pixels affects the definition of this extension
Overview
Provides a mechanism for DrawPixels and ReadPixels to efficiently
transfer depth and stencil image data. Specifically, we defined new
packed pixel formats and types which pack both stencil and depth
into one value.
Issues:
1. Is this the right way to distinguish between 24/8 and 8/24
pixel formats? Should we instead provide both:
GL_DEPTH_STENCIL_MESA
GL_STENCIL_DEPTH_MESA
And perhaps just use GL_UNSIGNED_INT, GL_UNSIGNED_SHORT ?
2. If not, is it correct to use _REV to indicate that stencil
preceeds depth in the 1_15 and 8_24 formats?
3. Do we really want the GL_UNSIGNED_SHORT formats?
New Procedures and Functions
None.
New Tokens
Accepted by the <format> parameter of ReadPixels and DrawPixels:
GL_DEPTH_STENCIL_MESA 0x8750
Accepted by the <type> parameter of ReadPixels and DrawPixels:
GL_UNSIGNED_INT_24_8_MESA 0x8751
GL_UNSIGNED_INT_8_24_REV_MESA 0x8752
GL_UNSIGNED_SHORT_15_1_MESA 0x8753
GL_UNSIGNED_SHORT_1_15_REV_MESA 0x8754
Additions to Chapter 2 of the 1.1 Specification (OpenGL Operation)
None
Additions to Chapter 3 of the 1.1 Specification (Rasterization)
One entry is added to table 3.5 (DrawPixels and ReadPixels formats).
The new table is:
Target
Format Name Buffer Element Meaning and Order
----------- ------ -------------------------
COLOR_INDEX Color Color index
STENCIL_INDEX Stencil Stencil index
DEPTH_COMPONENT Depth Depth component
RED Color R component
GREEN Color G component
BLUE Color B component
ALPHA Color A component
RGB Color R, G, B components
RGBA Color R, G, B, A components
BGRA Color B, G, R, A components
ABGR_EXT Color A, B, G, R components
CMYK_EXT Color Cyan, Magenta, Yellow, Black components
CMYKA_EXT Color Cyan, Magenta, Yellow, Black, A components
LUMINANCE Color Luminance component
LUMINANCE_ALPHA Color Luminance, A components
DEPTH_STENCIL Depth, Depth component, stencil index.
Stencil
Table 3.5: DrawPixels and ReadPixels formats. The third column
gives a description of and the number and order of elements in a
group.
Add to the description of packed pixel formats:
<type> Parameter Data of Matching
Token Name Type Elements Pixel Formats
---------------- ---- -------- -------------
UNSIGNED_BYTE_3_3_2 ubyte 3 RGB
UNSIGNED_BYTE_2_3_3_REV ubyte 3 RGB
UNSIGNED_SHORT_5_6_5 ushort 3 RGB
UNSIGNED_SHORT_5_6_5_REV ushort 3 RGB
UNSIGNED_SHORT_4_4_4_4 ushort 4 RGBA,BGRA,ABGR_EXT,CMYK_EXT
UNSIGNED_SHORT_4_4_4_4_REV ushort 4 RGBA,BGRA
UNSIGNED_SHORT_5_5_5_1 ushort 4 RGBA,BGRA,ABGR_EXT,CMYK_EXT
UNSIGNED_SHORT_1_5_5_5_REV ushort 4 RGBA,BGRA
UNSIGNED_INT_8_8_8_8 uint 4 RGBA,BGRA,ABGR_EXT,CMYK_EXT
UNSIGNED_INT_8_8_8_8_REV uint 4 RGBA,BGRA
UNSIGNED_INT_10_10_10_2 uint 4 RGBA,BGRA,ABGR_EXT,CMYK_EXT
UNSIGNED_INT_2_10_10_10_REV uint 4 RGBA,BGRA
UNSIGNED_SHORT_15_1_MESA ushort 2 DEPTH_STENCIL_MESA
UNSIGNED_SHORT_1_15_REV_MESA ushort 2 DEPTH_STENCIL_MESA
UNSIGNED_SHORT_24_8_MESA ushort 2 DEPTH_STENCIL_MESA
UNSIGNED_SHORT_8_24_REV_MESA ushort 2 DEPTH_STENCIL_MESA
UNSIGNED_INT_8_24:
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
+-----------------------+-----------------------------------------------------------------------+
| | |
+-----------------------+-----------------------------------------------------------------------+
first second
element element
UNSIGNED_INT_24_8:
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
+----------------------------------------------------------------------+------------------------+
| | |
+----------------------------------------------------------------------+------------------------+
first second
element element
UNSIGNED_SHORT_15_1:
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
+-----------------------------------------------------------+---+
| | |
+-----------------------------------------------------------+---+
first second
element element
UNSIGNED_SHORT_1_15_REV:
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
+---+-----------------------------------------------------------+
| | |
+---+-----------------------------------------------------------+
second first
element element
The assignment of elements to fields in the packed pixel is as
described in the table below:
First Second Third Fourth
Format Element Element Element Element
------ ------- ------- ------- -------
RGB red green blue
RGBA red green blue alpha
BGRA blue green red alpha
ABGR_EXT alpha blue green red
CMYK_EXT cyan magenta yellow black
DEPTH_STENCIL_MESA depth stencil
Additions to Chapter 4 of the 1.1 Specification (Per-Fragment Operations
and the Frame Buffer)
The new format is added to the discussion of Obtaining Pixels from the
Framebuffer. It should read " If the <format> is one of RED, GREEN,
BLUE, ALPHA, RGB, RGBA, ABGR_EXT, LUMINANCE, or LUMINANCE_ALPHA, and
the GL is in color index mode, then the color index is obtained."
The new format is added to the discussion of Index Lookup. It should
read "If <format> is one of RED, GREEN, BLUE, ALPHA, RGB, RGBA,
ABGR_EXT, LUMINANCE, or LUMINANCE_ALPHA, then the index is used to
reference 4 tables of color components: PIXEL_MAP_I_TO_R,
PIXEL_MAP_I_TO_G, PIXEL_MAP_I_TO_B, and PIXEL_MAP_I_TO_A."
Additions to Chapter 5 of the 1.1 Specification (Special Functions)
None
Additions to Chapter 6 of the 1.1 Specification (State and State Requests)
None
Additions to the GLX Specification
None
GLX Protocol
TBD
Errors
None
New State
None
Revision History
Version 1.0 - 23 Sep 2000
Keith's original version.
Version 1.1 - 3 Nov 2000
Brian's edits, assigned values to new enums.

View File

@@ -0,0 +1,356 @@
Name
MESA_program_debug
Name Strings
GL_MESA_program_debug
Contact
Brian Paul (brian.paul 'at' tungstengraphics.com)
Status
XXX - Not complete yet!!!
Version
Last Modified Date: July 20, 2003
Author Revision: 1.0
Number
TBD
Dependencies
OpenGL 1.4 is required
The extension is written against the OpenGL 1.4 specification.
ARB_vertex_program or ARB_fragment_program or NV_vertex_program
or NV_fragment_program is required.
Overview
The extension provides facilities for implementing debuggers for
vertex and fragment programs.
The concept is that vertex and fragment program debuggers will be
implemented outside of the GL as a utility package. This extension
only provides the minimal hooks required to implement a debugger.
There are facilities to do the following:
1. Have the GL call a user-specified function prior to executing
each vertex or fragment instruction.
2. Query the current program string's execution position.
3. Query the current values of intermediate program values.
The main feature is the ProgramCallbackMESA function. It allows the
user to register a callback function with the GL. The callback will
be called prior to executing each vertex or fragment program instruction.
From within the callback, the user may issue Get* commands to
query current GL state. The GetProgramRegisterfvMESA function allows
current program values to be queried (such as temporaries, input
attributes, and result registers).
There are flags for enabling/disabling the program callbacks.
The current execution position (as an offset from the start of the
program string) can be queried with
GetIntegerv(GL_FRAGMENT_PROGRAM_POSITION_MESA, &pos) or
GetIntegerv(GL_VERTEX_PROGRAM_POSITION_MESA, &pos).
IP Status
None
Issues
1. Is this the right model for a debugger?
It seems prudent to minimize the scope of this extension and leave
it up to the developer (or developer community) to write debuggers
that layer on top of this extension.
If the debugger were fully implemented within the GL it's not
clear how terminal and GUI-based interfaces would work, for
example.
2. There aren't any other extensions that register callbacks with
the GL. Isn't there another solution?
If we want to be able to single-step through vertex/fragment
programs I don't see another way to do it.
3. How do we prevent the user from doing something crazy in the
callback function, like trying to call glBegin (leading to
recursion)?
The rule is that the callback function can only issue glGet*()
functions and no other GL commands. It could be difficult to
enforce this, however. Therefore, calling any non-get GL
command from within the callback will result in undefined
results.
4. Is this extension amenable to hardware implementation?
Hopefully, but if not, the GL implementation will have to fall
back to a software path when debugging. This may be acceptable
for debugging.
5. What's the <data> parameter to ProgramCallbackMESA for?
It's a common programming practice to associate a user-supplied
value with callback functions.
6. Debuggers often allow one to modify intermediate program values,
then continue. Does this extension support that?
No.
New Procedures and Functions (and datatypes)
typedef void (*programcallbackMESA)(enum target, void *data)
void ProgramCallbackMESA(enum target, programcallbackMESA callback,
void *data)
void GetProgramRegisterfvMESA(enum target, sizei len,
const ubyte *registerName, float *v)
New Tokens
Accepted by the <cap> parameter of Enable, Disable, IsEnabled,
GetBooleanv, GetDoublev, GetFloatv and GetIntegerv:
FRAGMENT_PROGRAM_CALLBACK_MESA 0x8bb1
VERTEX_PROGRAM_CALLBACK_MESA 0x8bb4
Accepted by the <pname> parameter GetBooleanv, GetDoublev,
GetFloatv and GetIntegerv:
FRAGMENT_PROGRAM_POSITION_MESA 0x8bb0
VERTEX_PROGRAM_POSITION_MESA 0x8bb4
Accepted by the <pname> parameter of GetPointerv:
FRAGMENT_PROGRAM_CALLBACK_FUNC_MESA 0x8bb2
FRAGMENT_PROGRAM_CALLBACK_DATA_MESA 0x8bb3
VERTEX_PROGRAM_CALLBACK_FUNC_MESA 0x8bb6
VERTEX_PROGRAM_CALLBACK_DATA_MESA 0x8bb7
Additions to Chapter 2 of the OpenGL 1.4 Specification (OpenGL Operation)
None.
Additions to Chapter 3 of the OpenGL 1.4 Specification (Rasterization)
None.
Additions to Chapter 4 of the OpenGL 1.4 Specification (Per-Fragment
Operations and the Frame Buffer)
None.
Additions to Chapter 5 of the OpenGL 1.4 Specification (Special Functions)
In section 5.4 "Display Lists", page 202, add the following command
to the list of those that are not compiled into display lists:
ProgramCallbackMESA.
Add a new section 5.7 "Callback Functions"
The function
void ProgramCallbackMESA(enum target, programcallbackMESA callback,
void *data)
registers a user-defined callback function with the GL. <target>
may be FRAGMENT_PROGRAM_ARB or VERTEX_PROGRAM_ARB. The enabled
callback functions registered with these targets will be called
prior to executing each instruction in the current fragment or
vertex program, respectively. The callbacks are enabled and
disabled by calling Enable or Disable with <cap>
FRAGMENT_PROGRAM_ARB or VERTEX_PROGRAM_ARB.
The callback function's signature must match the typedef
typedef void (*programcallbackMESA)(enum target, void *data)
When the callback function is called, <target> will either be
FRAGMENT_PROGRAM_ARB or VERTEX_PROGRAM_ARB to indicate which
program is currently executing and <data> will be the value
specified when ProgramCallbackMESA was called.
From within the callback function, only the following GL commands
may be called:
GetBooleanv
GetDoublev
GetFloatv
GetIntegerv
GetProgramLocalParameter
GetProgramEnvParameter
GetProgramRegisterfvMESA
GetProgramivARB
GetProgramStringARB
GetError
Calling any other command from within the callback results in
undefined behaviour.
Additions to Chapter 6 of the OpenGL 1.4 Specification (State and
State Requests)
Add a new section 6.1.3 "Program Value Queries":
The command
void GetProgramRegisterfvMESA(enum target, sizei len,
const ubyte *registerName,
float *v)
Is used to query the value of program variables and registers
during program execution. GetProgramRegisterfvMESA may only be
called from within a callback function registered with
ProgramCallbackMESA.
<registerName> and <len> specify the name a variable, input
attribute, temporary, or result register in the program string.
The current value of the named variable is returned as four
values in <v>. If <name> doesn't exist in the program string,
the error INVALID_OPERATION is generated.
Additions to Appendix A of the OpenGL 1.4 Specification (Invariance)
None.
Additions to the AGL/GLX/WGL Specifications
None.
GLX Protocol
XXX TBD
Dependencies on NV_vertex_program and NV_fragment_program
If NV_vertex_program and/or NV_fragment_program are supported,
vertex and/or fragment programs defined by those extensions may
be debugged as well. Register queries will use the syntax used
by those extensions (i.e. "v[X]" to query vertex attributes,
"o[X]" for vertex outputs, etc.)
Errors
INVALID_OPERATION is generated if ProgramCallbackMESA is called
between Begin and End.
INVALID_ENUM is generated by ProgramCallbackMESA if <target> is not
a supported vertex or fragment program type.
Note: INVALID_OPERAION IS NOT generated by GetProgramRegisterfvMESA,
GetBooleanv, GetDoublev, GetFloatv, or GetIntegerv if called between
Begin and End when a vertex or fragment program is currently executing.
INVALID_ENUM is generated by ProgramCallbackMESA,
GetProgramRegisterfvMESA if <target> is not a program target supported
by ARB_vertex_program, ARB_fragment_program (or NV_vertex_program or
NV_fragment_program).
INVALID_VALUE is generated by GetProgramRegisterfvMESA if <registerName>
does not name a known program register or variable.
INVALID_OPERATION is generated by GetProgramRegisterfvMESA when a
register query is attempted for a program target that's not currently
being executed.
New State
XXX finish
(table 6.N, p. ###)
Initial
Get Value Type Get Command Value Description Sec. Attribute
--------- ---- ----------- ----- ----------- ---- ---------
FRAGMENT_PROGRAM_CALLBACK_MESA B IsEnabled FALSE XXX XXX enable
VERTEX_PROGRAM_CALLBACK_MESA B IsEnabled FALSE XXX XXX enable
FRAGMENT_PROGRAM_POSITION_MESA Z+ GetIntegerv -1 XXX XXX -
VERTEX_PROGRAM_POSITION_MESA Z+ GetIntegerv -1 XXX XXX -
FRAGMENT_PROGRAM_CALLBACK_FUNC_MESA P GetPointerv NULL XXX XXX -
VERTEX_PROGRAM_CALLBACK_FUNC_MESA P GetPointerv NULL XXX XXX -
FRAGMENT_PROGRAM_CALLBACK_DATA_MESA P GetPointerv NULL XXX XXX -
VERTEX_PROGRAM_CALLBACK_DATA_MESA P GetPointerv NULL XXX XXX -
XXX more?
New Implementation Dependent State
None.
Revision History
8 July 2003
Initial draft. (Brian Paul)
11 July 2003
Second draft. (Brian Paul)
20 July 2003
Third draft. Lots of fundamental changes. (Brian Paul)
23 July 2003
Added chapter 5 and 6 spec language. (Brian Paul)
Example Usage
The following is a very simple example of how this extension may
be used to print the values of R0, R1, R2 and R3 while executing
vertex programs.
/* This is called by the GL when the vertex program is executing.
* We can only make glGet* calls from within this function!
*/
void DebugCallback(GLenum target, GLvoid *data)
{
GLint pos;
GLuint i;
/* Get PC and current instruction string */
glGetIntegerv(GL_VERTEX_PROGRAM_POSITION_ARB, &pos);
printf("Current position: %d\n", pos);
printf("Current temporary registers:\n");
for (i = 0; i < 4; i++) {
GLfloat v[4];
char s[10];
sprintf(s, "R%d", i);
glGetProgramRegisterfvMESA(GL_VERTEX_PROGRAM_ARB, strlen(s), s, v);
printf("R%d = %g, %g, %g, %g\n", i, v[0], v[1], v[2], v[3]);
}
}
/*
* elsewhere...
*/
/* Register our debugger callback function */
glProgramCallbackMESA(GL_VERTEX_PROGRAM_ARB, DebugCallback, NULL);
glEnable(GL_VERTEX_PROGRAM_CALLBACK_MESA);
/* define/bind a vertex program */
glEnable(GL_VERTEX_PROGRAM);
/* render something */
glBegin(GL_POINTS);
glVertex2f(0, 0);
glEnd();

View File

@@ -0,0 +1,190 @@
Name
MESA_sprite_point
Name Strings
GL_MESA_sprite_point
Contact
Brian Paul, VA Linux Systems Inc. (brianp 'at' valinux.com)
Status
Obsolete - see GL_ARB_point_sprite.
Version
Number
???
Dependencies
GL_EXT_point_parameters effects the definition of this extension
GL_ARB_multitexture effects the definition of this extension
Overview
This extension modifies the way in which points are rendered,
specifically when they're textured. When SPRITE_POINT_MESA is enabled
a point is rendered as if it were a quadrilateral with unique texture
coordinates at each vertex. This extension effectively turns points
into sprites which may be rendered more easily and quickly than using
conventional textured quadrilaterals.
When using point size > 1 or attenuated points this extension is an
effective way to render many small sprite images for particle systems
or other effects.
Issues:
1. How are the texture coordinates computed?
The lower-left corner has texture coordinate (0,0,r,q).
The lower-right, (1,0,r,q). The upper-right, (1,1,r,q).
The upper-left, (0,1,r,q).
2. What about texgen and texture matrices?
Texgen and the texture matrix have no effect on the point's s and t
texture coordinates. The r and q coordinates may have been computed
by texgen or the texture matrix. Note that with a 3D texture and/or
texgen that the r coordinate could be used to select a slice in the
3D texture.
3. What about point smoothing?
When point smoothing is enabled, a triangle fan could be rendered
to approximate a circular point. This could be problematic to
define and implement so POINT_SMOOTH is ignored when drawing sprite
points.
Smoothed points can be approximated by using an appropriate texture
images, alpha testing and blending.
POLYGON_SMOOTH does effect the rendering of the quadrilateral, however.
4. What about sprite rotation?
There is none. Sprite points are always rendered as window-aligned
squares. One could define rotated texture images if desired. A 3D
texture and appropriate texture r coordinates could be used to
effectively specify image rotation per point.
5. What about POLYGON_MODE?
POLYGON_MODE does not effect the rasterization of the quadrilateral.
6. What about POLYGON_CULL?
TBD. Polygon culling is normally specified and implemented in the
transformation stage of OpenGL. However, some rasterization hardware
implements it later during triangle setup.
Polygon culling wouldn't be useful for sprite points since the
quadrilaterals are always defined in counter-clockwise order in
window space. For that reason, polygon culling should probably be
ignored.
7. Should sprite points be alpha-attenuated if their size is below the
point parameter's threshold size?
8. Should there be an advertisized maximum sprite point size?
No. Since we're rendering the point as a quadrilateral there's no
need to limit the size.
New Procedures and Functions
None.
New Tokens
Accepted by the <pname> parameter of Enable, Disable, IsEnabled,
GetIntegerv, GetBooleanv, GetFloatv and GetDoublev:
SPRITE_POINT_MESA 0x????
MAX_SPRITE_POINT_SIZE_MESA 0x???? (need this?)
Additions to Chapter 2 of the 1.1 Specification (OpenGL Operation)
None
Additions to Chapter 3 of the 1.1 Specification (Rasterization)
Section ???.
When SPRITE_POINT_MESA is enabled points are rasterized as screen-
aligned quadrilaterals. If the four vertices of the quadrilateral
are labeled A, B, C, and D, starting at the lower-left corner and moving
counter-clockwise around the quadrilateral, then the vertex and
texture coordinates are computed as follows:
vertex window coordinate texture coordinate
A (x-r, y-r, z, w) (0, 0, r, q)
B (x+r, y-r, z, w) (1, 0, r, q)
C (x+r, y+r, z, w) (1, 1, r, q)
D (x-r, y+r, z, w) (0, 1, r, q)
where x, y, z, w are the point's window coordinates, r and q are the
point's 3rd and 4th texture coordinates and r is half the point's
size. The other vertex attributes (such as the color and fog coordinate)
are simply duplicated from the original point vertex.
Point size may either be specified with PointSize or computed
according to the EXT_point_parameters extension.
The new texture coordinates are not effected by texgen or the texture
matrix. Note, however, that the texture r and q coordinates are passed
unchanged and may have been computed with texgen and/or the texture
matrix.
If multiple texture units are present the same texture coordinate is
used for all texture units.
The point is then rendered as if it were a quadrilateral using the
normal point sampling rules. POLYGON_MODE does not effect the
rasterization of the quadrilateral but POLYGON_SMOOTH does.
POINT_SMOOTH has no effect when SPRITE_POINT_MESA is enabled.
Additions to Chapter 4 of the 1.1 Specification (Per-Fragment Operations
and the Frame Buffer)
None.
Additions to Chapter 5 of the 1.1 Specification (Special Functions)
None
Additions to Chapter 6 of the 1.1 Specification (State and State Requests)
None
Additions to the GLX Specification
None
GLX Protocol
TBD
Errors
None
New State
Add boolean variable SPRITE_POINT_MESA to the point attribute group.
Revision History
Version 1.0 - 4 Dec 2000
Original draft.

359
docs/OLD/MESA_trace.spec Normal file
View File

@@ -0,0 +1,359 @@
Name
MESA_trace
Name Strings
GL_MESA_trace
Contact
Bernd Kreimeier, Loki Entertainment, bk 'at' lokigames.com
Brian Paul, VA Linux Systems, Inc., brianp 'at' valinux.com
Status
Obsolete.
Version
Number
none yet
Dependencies
OpenGL 1.2 is required.
The extension is written against the OpenGL 1.2 Specification
Overview
Provides the application with means to enable and disable logging
of GL calls including parameters as readable text. The verbosity
of the generated log can be controlled. The resulting logs are
valid (but possibly incomplete) C code and can be compiled and
linked for standalone test programs. The set of calls and the
amount of static data that is logged can be controlled at runtime.
The application can add comments and enable or disable tracing of GL
operations at any time. The data flow from the application to GL
and back is unaffected except for timing.
Application-side implementation of these features raises namespace
and linkage issues. In the driver dispatch table a simple
"chain of responsibility" pattern (aka "composable piepline")
can be added.
IP Status
The extension spec is in the public domain. The current implementation
in Mesa is covered by Mesa's XFree86-style copyright by the authors above.
This extension is partially inspired by the Quake2 QGL wrapper.
Issues
(1) Is this Extension obsolete because it can
be implemented as a wrapper DLL?
RESOLVED: No. While certain operating systems (Win32) provide linkers
that facilitate this kind of solution, other operating systems
(Linux) do not support hierarchical linking, so a wrapper solution
would result in symbol collisions.
Further, IHV's might have builtin support for tracing GL execution
that enjoys privileged access, or that they do not wish to separate
the tracing code from their driver code base.
(2) Should the Trace API explicitely support the notion of "frames?
This would require hooking into glXSwapBuffers calls as well.
RESOLVED: No. The application can use NewTraceMESA/EndTraceMESA
and TraceComment along with external parsing tools to split the
trace into frames, in whatever way considered adequate.
(2a) Should GLX calls be traced?
PBuffers and other render-to-texture solutions demonstrate that
context level commands beyond SwapBuffers might have to be
traced. The GL DLL exports the entry points, so this would not
be out of the question.
(3) Should the specification mandate the actual output format?
RESOLVED: No. It is sufficient to guarantee that all data and commands
will be traced as requested by Enable/DisableTraceMESA, in the order
encountered. Whether the resulting trace is available as a readable
text file, binary metafile, compilable source code, much less which
indentation and formatting has been used, is up to the implementation.
For the same reason this specification does not enforce or prohibit
additional information added to the trace (statistics, profiling/timing,
warnings on possible error conditions).
(4) Should the comment strings associated with names and pointer (ranges)
be considered persistent state?
RESOLVED: No. The implementation is not forced to use this information
on subsequent occurences of name/pointer, and is free to consider it
transient state.
(5) Should comment commands be prohibited between Begin/End?
RESOLVED: Yes, with the exception of TraceCommentMESA. TraceCommentMESA
is transient, the other commands might cause storage of persistent
data in the context. There is no need to have the ability mark names
or pointers between Begin and End.
New Procedures and Functions
void NewTraceMESA( bitfield mask, const ubyte * traceName )
void EndTraceMESA( void )
void EnableTraceMESA( bitfield mask )
void DisableTraceMESA( bitfield mask )
void TraceAssertAttribMESA( bitfield attribMask )
void TraceCommentMESA( const ubyte* comment )
void TraceTextureMESA( uint name, const ubyte* comment )
void TraceListMESA( uint name, const ubyte* comment )
void TracePointerMESA( void* pointer, const ubyte* comment )
void TracePointerRangeMESA( const void* first,
const void* last,
const ubyte* comment )
New Tokens
Accepted by the <mask> parameter of EnableTrace and DisableTrace:
TRACE_ALL_BITS_MESA 0xFFFF
TRACE_OPERATIONS_BIT_MESA 0x0001
TRACE_PRIMITIVES_BIT_MESA 0x0002
TRACE_ARRAYS_BIT_MESA 0x0004
TRACE_TEXTURES_BIT_MESA 0x0008
TRACE_PIXELS_BIT_MESA 0x0010
TRACE_ERRORS_BIT_MESA 0x0020
Accepted by the <pname> parameter of GetIntegerv, GetBooleanv,
GetFloatv, and GetDoublev:
TRACE_MASK_MESA 0x8755
Accepted by the <pname> parameter to GetString:
TRACE_NAME_MESA 0x8756
Additions to Chapter 2 of the OpenGL 1.2.1 Specification (OpenGL Operation)
None.
Additions to Chapter 3 of the OpenGL 1.2.1 Specification (OpenGL Operation)
None.
Additions to Chapter 4 of the OpenGL 1.2.1 Specification (OpenGL Operation)
None.
Additions to Chapter 5 of the OpenGL 1.2.1 Specification (Special Functions)
Add a new section:
5.7 Tracing
The tracing facility is used to record the execution of a GL program
to a human-readable log. The log appears as a sequence of GL commands
using C syntax. The primary intention of tracing is to aid in program
debugging.
A trace is started with the command
void NewTraceMESA( bitfield mask, const GLubyte * traceName )
<mask> may be any value accepted by PushAttrib and specifies a set of
attribute groups. The state values included in those attribute groups
is written to the trace as a sequence of GL commands.
<traceName> specifies a name or label for the trace. It is expected
that <traceName> will be interpreted as a filename in most implementations.
A trace is ended by calling the command
void EndTraceMESA( void )
It is illegal to call NewTraceMESA or EndTraceMESA between Begin and End.
The commands
void EnableTraceMESA( bitfield mask )
void DisableTraceMESA( bitfield mask )
enable or disable tracing of different classes of GL commands.
<mask> may be the union of any of TRACE_OPERATIONS_BIT_MESA,
TRACE_PRIMITIVES_BIT_MESA, TRACE_ARRAYS_BIT_MESA, TRACE_TEXTURES_BIT_MESA,
and TRACE_PIXELS_BIT_MESA. The special token TRACE_ALL_BITS_MESA
indicates all classes of commands are to be logged.
TRACE_OPERATIONS_BIT_MESA controls logging of all commands outside of
Begin/End, including Begin/End.
TRACE_PRIMITIVES_BIT_MESA controls logging of all commands inside of
Begin/End, including Begin/End.
TRACE_ARRAYS_BIT_MESA controls logging of VertexPointer, NormalPointer,
ColorPointer, IndexPointer, TexCoordPointer and EdgeFlagPointer commands.
TRACE_TEXTURES_BIT_MESA controls logging of texture data dereferenced by
TexImage1D, TexImage2D, TexImage3D, TexSubImage1D, TexSubImage2D, and
TexSubImage3D commands.
TRACE_PIXELS_BIT_MESA controls logging of image data dereferenced by
Bitmap and DrawPixels commands.
TRACE_ERRORS_BIT_MESA controls logging of all errors. If this bit is
set, GetError will be executed whereever applicable, and the result will
be added to the trace as a comment. The error returns are cached and
returned to the application on its GetError calls. If the user does not
wish the additional GetError calls to be performed, this bit should not
be set.
The command
void TraceCommentMESA( const ubyte* comment )
immediately adds the <comment> string to the trace output, surrounded
by C-style comment delimiters.
The commands
void TraceTextureMESA( uint name, const ubyte* comment )
void TraceListMESA( uint name, const ubyte* comment )
associates <comment> with the texture object or display list specified
by <name>. Logged commands which reference the named texture object or
display list will be annotated with <comment>. If IsTexture(name) or
IsList(name) fail (respectively) the command is quietly ignored.
The commands
void TracePointerMESA( void* pointer, const ubyte* comment )
void TracePointerRangeMESA( const void* first,
const void* last,
const ubyte* comment )
associate <comment> with the address specified by <pointer> or with
a range of addresses specified by <first> through <last>.
Any logged commands which reference <pointer> or an address between
<first> and <last> will be annotated with <comment>.
The command
void TraceAssertAttribMESA( bitfield attribMask )
will add GL state queries and assertion statements to the log to
confirm that the current state at the time TraceAssertAttrib is
executed matches the current state when the trace log is executed
in the future.
<attribMask> is any value accepted by PushAttrib and specifies
the groups of state variables which are to be asserted.
The commands NewTraceMESA, EndTraceMESA, EnableTraceMESA, DisableTraceMESA,
TraceAssertAttribMESA, TraceCommentMESA, TraceTextureMESA, TraceListMESA,
TracePointerMESA and TracePointerRangeMESA are not compiled into display lists.
Examples:
The command NewTraceMESA(DEPTH_BUFFER_BIT, "log") will query the state
variables DEPTH_TEST, DEPTH_FUNC, DEPTH_WRITEMASK, and DEPTH_CLEAR_VALUE
to get the values <test>, <func>, <mask>, and <clear> respectively.
Statements equivalent to the following will then be logged:
glEnable(GL_DEPTH_TEST); (if <test> is true)
glDisable(GL_DEPTH_TEST); (if <test> is false)
glDepthFunc(<func>);
glDepthMask(<mask>);
glClearDepth(<clear>);
The command TraceAssertAttribMESA(DEPTH_BUFFER_BIT) will query the state
variables DEPTH_TEST, DEPTH_FUNC, DEPTH_WRITEMASK, and DEPTH_CLEAR_VALUE
to get the values <test>, <func>, <mask>, and <clear> respectively.
The resulting trace might then look will like this:
{
GLboolean b;
GLint i;
GLfloat f;
b = glIsEnabled(GL_DEPTH_TEST);
assert(b == <test>);
glGetIntegerv(GL_DEPTH_FUNC, &i);
assert(i == <func>);
glGetIntegerv(GL_DEPTH_MASK, &i);
assert(i == <mask>);
glGetFloatv(GL_DEPTH_CLEAR_VALUE, &f);
assert(f == <clear>);
}
Additions to Chapter 6 of the OpenGL 1.2.1 Specification
(State and State Requests)
Querying TRACE_MASK_MESA with GetIntegerv, GetFloatv, GetBooleanv or
GetDoublev returns the current command class trace mask.
Querying TRACE_NAME_MESA with GetString returns the current trace name.
Additions to Appendix A of the OpenGL 1.2.1 Specification (Invariance)
The MESA_trace extension can be used in a way that does not affect data
flow from application to OpenGL, as well as data flow from OpenGL to
application, except for timing, possible print I/O. TRACE_ERRORS_BIT_MESA
will add additional GetError queries. Setting a trace mask with NewTraceMESA
as well as use of TraceAssertAttribMESA might cause additional state queries.
With the possible exception of performance, OpenGL rendering should not be
affected at all by a properly chosen logging operation.
Additions to the AGL/GLX/WGL Specifications
None.
GLX Protocol
None. The logging operation is carried out client-side, by exporting
entry points to the wrapper functions that execute the logging operation.
Errors
INVALID_OPERATION is generated if any trace command except TraceCommentMESA
is called between Begin and End.
New State
The current trace name and current command class mask are stored
per-context.
New Implementation Dependent State
None.
Revision History
* Revision 0.1 - Initial draft from template (bk000415)
* Revision 0.2 - Draft (bk000906)
* Revision 0.3 - Draft (bk000913)
* Revision 0.4 - Reworked text, fixed typos (bp000914)
* Revision 0.5 - Assigned final GLenum values (bp001103)
* Revision 0.6 - TRACE_ERRORS_BIT_MESA (bk000916)
* Revision 0.7 - Added MESA postfix (bk010126)

View File

@@ -1,110 +1,33 @@
File: docs/README.WIN32
Last updated: Apr 25, 2007 - Karl Schultz - kschultz@users.sourceforge.net
Last updated: 23 April 2011
Quick Start
----- -----
Unzip the MesaLib, MesaGLUT, and MesaDemos ZIP files into the same
directory. The libs and demos build separately, so if you do not care
about the demos or GLUT, you only need to unzip MesaLib. If you unzip
more than one ZIP file, they all need to be unzipped into the same
directory. Don't worry, you will not overwrite anything.
Windows drivers are build with SCons. Makefiles or Visual Studio projects are
no longer shipped or supported.
The Windows build system uses Microsoft Visual Studio. Project files
for a specific version of Visual Studio are in their own directory in
the top-level "windows" directory. For example, Visual Studio 8 files
are in windows/VC8.
Run
Support has been dropped for versions of Visual Studio prior to 8. The
main reason is because Microsoft now provides a free compiler and
developer environment. Visual Studio Express can be found at
scons osmesa mesagdi
http://msdn.microsoft.com/vstudio/express/visualc/default.aspx
to build classic mesa Windows GDI drivers; or
You'll also need the Platform SDK. Instructions for obtaining and
using the SDK with Visual Studio Express can be found at
scons libgl-gdi
http://msdn.microsoft.com/vstudio/express/visualc/usingpsdk/
The project files to build the core Mesa library, Windows Mesa
drivers, OSMesa, and GLU are in the mesa directory. The project files
to build GLUT and some demo programs are in the progs directory.
Makefiles are no longer shipped or supported, but can be generated
from the projects using Visual Studio.
to build gallium based GDI driver.
Windows Drivers
------- -------
At this time, only the GDI driver is known to work. Most of the demos
in progs/demos should work with this driver.
At this time, only the gallium GDI driver is known to work.
Source code also exists in the tree for other drivers in
src/mesa/drivers/windows, but the status of this code is unknown.
The GDI driver operates basically by writing pixel spans into a DIB
section and then blitting the DIB to the window. The driver was
recently cleaned up and rewitten and so may have bugs or may be
missing some functionality. The older versions of the CVS source may
be useful in figuring out any problems, or report them to me.
To build Mesa with the GDI driver, build the mesa, gdi, and glu
projects in the Visual Studio workspace found at
windows/VC8/mesa/mesa.sln
The osmesa DLL can also be built with the osmesa project.
The build system creates a lib top-level directory and copies
resulting LIB and DLL files to this lib directory. The files are:
OPENGL32.LIB, GLU32.LIB, OSMESA32.LIB
OPENGL32.DLL, GLU32.DLL, OSMESA32.DLL
If the MesaDemos ZIP file was extracted, the DLL files are also copied
to the demos directory. This facilitates running the demos as described
below.
GLUT and Demos
---- --- -----
A Visual Studio workspace can be found at
windows/VC8/progs/progs.sln
It can be used to build GLUT and a few demos. The GLUT lib and DLL
are copied to the top-level lib directory, along with the Mesa libs.
The demo build system expects to find the LIB files in the top level
lib directory, so you must build the Mesa libs first. The demo
executables are placed in the demos directory, because some of them
rely on data files found there. Also, the Mesa lib DLL's were copied
there by the Mesa lib build process. Therefore, you should be able to
simply run the demo executables from the demo directory.
If you want to run the demos from the Visual Studio, you may have to
change the startup directory and explicitly state where the executables are.
You may also build all the demo programs by using a makefile. Go to
the progs/demos directory and make sure you have executed VCVARS32.BAT
or whatever setup script is appropriate for your compiler. Then,
nmake -f Makefile.win
should build all the demos.
Build System Notes
----- ------ -----
VC8
---
No notes.
General
-------
@@ -124,17 +47,5 @@ the linker import files associated with the DLL files.
The si-glu sources are used to build the GLU libs. This was done
mainly to get the better tessellator code.
To build "mangled" Mesa, add the preprocessor define USE_MGL_NAMESPACE
to the project settings. You will also need to edit src/mesa.def to
change all the gl* symbols to mgl*. Because this is easy to do with a
global replace operation in a text editor, no additional mangled
version of mesa.def is maintained or shipped.
If you have a Windows-related build problem or question, it is
probably better to direct it to me (kschultz@users.sourceforge.net),
rather than directly to the other Mesa developers. I will help you as
much as I can. I also monitor the Mesa mailing lists and will answer
questions in this area there as well.
Karl Schultz
If you have a Windows-related build problem or question, please post
to the mesa-dev or mesa-users list.

View File

@@ -0,0 +1,92 @@
Name
WL_bind_wayland_display
Name Strings
EGL_WL_bind_wayland_display
Contact
Kristian Høgsberg <krh@bitplanet.net>
Benjamin Franzke <benjaminfranzke@googlemail.com>
Status
Proposal
Version
Version 1, March 1, 2011
Number
EGL Extension #not assigned
Dependencies
Requires EGL 1.4 or later. This extension is written against the
wording of the EGL 1.4 specification.
EGL_KHR_base_image is required.
Overview
This extension provides entry points for binding and unbinding the
wl_display of a Wayland compositor to an EGLDisplay. Binding a
wl_display means that the EGL implementation should provide one or
more interfaces in the Wayland protocol to allow clients to create
wl_buffer objects. On the server side, this extension also
provides a new target for eglCreateImageKHR, to create an EGLImage
from a wl_buffer
Adding an implementation specific wayland interface, allows the
EGL implementation to define specific wayland requests and events,
needed for buffer sharing in an EGL wayland platform.
IP Status
Open-source; freely implementable.
New Procedures and Functions
EGLBoolean eglBindWaylandDisplayWL(EGLDisplay dpy,
struct wl_display *display);
EGLBoolean eglUnbindWaylandDisplayWL(EGLDisplay dpy,
struct wl_display *display);
New Tokens
Accepted as <target> in eglCreateImageKHR
EGL_WAYLAND_BUFFER_WL 0x31D5
Additions to the EGL 1.4 Specification:
To bind a server side wl_display to an EGLDisplay, call
EGLBoolean eglBindWaylandDisplayWL(EGLDisplay dpy,
struct wl_display *display);
To unbind a server side wl_display from an EGLDisplay, call
EGLBoolean eglUnbindWaylandDisplayWL(EGLDisplay dpy,
struct wl_display *display);
eglBindWaylandDisplayWL returns EGL_FALSE when there is already a
wl_display bound to EGLDisplay otherwise EGL_TRUE.
eglUnbindWaylandDisplayWL returns EGL_FALSE when there is no
wl_display bound to the EGLDisplay currently otherwise EGL_TRUE.
Import a wl_buffer by calling eglCreateImageKHR with
wl_buffer as EGLClientBuffer, EGL_WAYLAND_BUFFER_WL as the target,
NULL context and an empty attribute_list.
Issues
Revision History
Version 1, March 1, 2011
Initial draft (Benjamin Franzke)

View File

@@ -62,6 +62,7 @@ a:visited {
<LI><A HREF="perf.html" target="MainFrame">Performance Tips</A>
<LI><A HREF="extensions.html" target="MainFrame">Mesa Extensions</A>
<LI><A HREF="mangling.html" target="MainFrame">Function Name Mangling</A>
<LI><A href="llvmpipe.html" target="MainFrame">Gallium llvmpipe driver</A>
</ul>
<b>Developer Topics</b>
@@ -69,7 +70,6 @@ a:visited {
<li><a href="http://sourceforge.net/projects/mesa3d" target="_parent">SourceForge homepage</a>
<li><a href="repository.html" target="MainFrame">Source Code Repository</a>
<li><a href="sourcetree.html" target="MainFrame">Source Code Tree</a>
<li><a href="memory.html" target="MainFrame">DRI Memory Management</a>
<li><a href="glu.html" target="MainFrame">SGI's GLU</a>
<li><a href="utilities.html" target="MainFrame">Utilities</a>
<li><a href="helpwanted.html" target="MainFrame">Help Wanted</a>

View File

@@ -12,12 +12,14 @@
Both professional and volunteer developers contribute to Mesa.
</p>
<p>
<a href="http://www.tungstengraphics.com/" target="_parent">Tungsten Graphics</a>
<a href="http://www.vmware.com/" target="_parent">VMware</a>
employs several of the main Mesa developers including Brian Paul
and Keith Whitwell.
Much of the on-going work in Mesa is done through Tungsten Graphics engineering
contracts.
Prominent examples of this work includes:
</p>
<p>
In the past, Tungsten Graphics contracts implemented many Mesa features
including:
</p>
<ul>
<li>DRI drivers for Intel i965, i945, i915 and other chips
@@ -29,7 +31,13 @@ Prominent examples of this work includes:
<p>
Other companies including
<a href="http://www.intellinuxgraphics.org/index.html" target="_parent">Intel</a>
and IBM also actively contribute to the project.
and RedHat also actively contribute to the project.
Intel has recently contributed the new GLSL compiler in Mesa 7.9.
</p>
<p>
<a href="http://www.lunarg.com/" target="_parent">LunarG</a> can be contacted
for custom Mesa / 3D graphics development.
</p>
<p>
@@ -37,15 +45,5 @@ Volunteers have made significant contributions to all parts of Mesa, including
complete device drivers.
</p>
<H1>Custom Development</H1>
<p>
Contact <a href="http://www.tungstengraphics.com/" target="_parent">
Tungsten Graphics</a>
for information about custom development in Mesa, OpenGL, X and other
graphics technologies.
</p>
</body>
</html>

View File

@@ -145,7 +145,7 @@ Make sure the values in src/mesa/main/version.h are correct.
</p>
<p>
Update the docs/news.html file and docs/download.html files.
Update docs/news.html.
</p>
<p>
@@ -208,10 +208,11 @@ sftp USERNAME,mesa3d@web.sourceforge.net
<p>
Make an announcement on the mailing lists:
<em>m</em><em>e</em><em>s</em><em>a</em><em>3</em><em>d</em><em>-</em><em>d</em><em>e</em><em>v</em><em>@</em><em>l</em><em>i</em><em>s</em><em>t</em><em>s</em><em>.</em><em>s</em><em>f</em><em>.</em><em>n</em><em>e</em><em>t</em>,
<em>m</em><em>e</em><em>s</em><em>a</em><em>3</em><em>d</em><em>-</em><em>u</em><em>s</em><em>e</em><em>r</em><em>s</em><em>@</em><em>l</em><em>i</em><em>s</em><em>t</em><em>s</em><em>.</em><em>s</em><em>f</em><em>.</em><em>n</em><em>e</em><em>t</em>
<em>m</em><em>e</em><em>s</em><em>a</em><em>-</em><em>d</em><em>e</em><em>v</em><em>@</em><em>l</em><em>i</em><em>s</em><em>t</em><em>s</em><em>.</em><em>f</em><em>r</em><em>e</em><em>e</em><em>d</em><em>e</em><em>s</em><em>k</em><em>t</em><em>o</em><em>p</em><em>.</em><em>o</em><em>r</em><em>g</em>,
<em>m</em><em>e</em><em>s</em><em>a</em><em>-</em><em>u</em><em>s</em><em>e</em><em>r</em><em>s</em><em>@</em><em>l</em><em>i</em><em>s</em><em>t</em><em>s</em><em>.</em><em>f</em><em>r</em><em>e</em><em>e</em><em>d</em><em>e</em><em>s</em><em>k</em><em>t</em><em>o</em><em>p</em><em>.</em><em>o</em><em>r</em><em>g</em>
and
<em>m</em><em>e</em><em>s</em><em>a</em><em>3</em><em>d</em><em>-</em><em>a</em><em>n</em><em>n</em><em>o</em><em>u</em><em>n</em><em>c</em><em>e</em><em>@</em><em>l</em><em>i</em><em>s</em><em>t</em><em>s</em><em>.</em><em>s</em><em>f</em><em>.</em><em>n</em><em>e</em><em>t</em>
<em>m</em><em>e</em><em>s</em><em>a</em><em>-</em><em>a</em><em>n</em><em>n</em><em>o</em><em>u</em><em>n</em><em>c</em><em>e</em><em>@</em><em>l</em><em>i</em><em>s</em><em>t</em><em>s</em><em>.</em><em>f</em><em>r</em><em>e</em><em>e</em><em>d</em><em>e</em><em>s</em><em>k</em><em>t</em><em>o</em><em>p</em><em>.</em><em>o</em><em>r</em><em>g</em>
</p>

Some files were not shown because too many files have changed in this diff Show More