Commit Graph

45456 Commits

Author SHA1 Message Date
Marek Olšák 000896c0bb mesa: GLES2 should return different error enums for invalid fbo queries
ES 2.0.25 page 127 says:

  If the value of FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE is NONE, then
  querying any other pname will generate INVALID_ENUM.

See also:
b9e9df78a0

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

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-07-21 14:16:43 +02:00
Christoph Bumiller ea316c5e06 nouveau: hook up video decoding with nouveau_context
This doesn't include nvfx since its context struct is not derived
from common nouveau_context (yet).
2011-07-21 10:39:41 +02:00
Vinson Lee 76bccaff0c glsl: Add ir_function_detect_recursion.cpp to SConscript. 2011-07-20 20:16:27 -07:00
Ian Romanick 02c5ae1b3f glsl: Reject shaders that contain static recursion
The GLSL 1.20 and later specs say:

    "Recursion is not allowed, not even statically. Static recursion is
    present if the static function call graph of the program contains
    cycles."

Recursion is detected and rejected both a compile-time and at
link-time.  The complie-time check happens to detect some cases that
may be removed by various optimization passes.  The spec doesn't seem
to allow this, but other vendors (e.g., NVIDIA) appear to only check
at link-time after all optimizations.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=33885
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-07-20 18:20:59 -07:00
Ian Romanick 1ad3ba4ad9 glsl: Make prototype_string publicly available
Also clarify the documentation for one of the parameters.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-07-20 18:20:59 -07:00
Marek Olšák 2d960d3f4e g3dvl: remove unused vertex shader inputs
See also comments in the code.
2011-07-20 22:55:24 +02:00
Eric Anholt 3e5d36267d i965: Apply a homebrew workaround for GPU hang in OGLC api-texcoord.
The behavior of flushes in the hardware is a maze of twisty passages,
and strangely the VS constants appear to be loaded during a pipeline
flush instead of at the time of the packet emit according to the
simulator.  On moving the STATE_BASE_ADDRESS packet to where it really
needed to live (in order for data loads by other packets to be
correct), we sometimes no longer got a flush between those packets
where we apparently needed it.  This replicates the flushes implied by
a STATE_BASE_ADDRESS update, fixing the GPU hangs in OGLC and the
"engine" demo.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=36821
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=39257
Tested-by: Keith Packard <keithp@keithp.com> (bzflag and etracer fixed)
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2011-07-20 11:42:53 -07:00
Eric Anholt 407785d0e9 i965: Enable the PIPE_CONTROL workaround workaround out of paranoia.
There's scary stuff going on in PIPE_CONTROL internals, and if the
BSpec says to do this to make PIPE_CONTROL work, I'll go ahead and do
it because we'll probably never be able to debug it after the fact.

v2: Use stall at scoreboard instead of depth stall, as noted by Ken.
2011-07-20 11:12:38 -07:00
Eric Anholt dc7422405f i965: Avoid kernel BUG_ON if we happen to wait on the pipe_control w/a BO.
For this and occlusion queries, we're trying to avoid setting
I915_GEM_DOMAIN_RENDER for the write domain, because the data written
is definitely not going through the render cache, but we do need to
tell the kernel that the object has been written.  However, with using
I915_GEM_DOMAIN_GTT, the kernel on retiring the batchbuffer sees that
the w/a BO has a write domain of GTT, and puts it on the flushing
list.  If something tries to wait for that BO to finish rendering
(such as the AUB dumper reading the contents of BOs), we get into
wait_request (since obj->active) but with a 0 seqno (since the object
is on the flushing list, not actually on a ringbuffer), and BUG_ONs.

To avoid the kernel bug (which I'm hoping to delete soon anyway), just
use I915_GEM_DOMAIN_INSTRUCTION like occlusion queries do.  This
doesn't result in more flushing, because we invalidate INSTRUCTION on
every batchbuffer now that we're state streaming, anyway.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Kenneth Graunke <kenneth@whitecape.org>
2011-07-20 11:10:00 -07:00
Eric Anholt 540e66b3be intel: Use the GLSL-based meta clear when available.
Improves firefox-talos-gfx performance under GL when 3D clears are
enabled:
[  0]       gl-before     firefox-talos-gfx   20.193   20.251   0.27%    3/3
[  0]       gl-after      firefox-talos-gfx   18.013   18.040   0.19%    3/3
2011-07-20 11:03:26 -07:00
Eric Anholt eee570290a meta: Add a GLSL-based _mesa_meta_Clear() variant.
This cuts out a large portion of the overhead of glClear() from
resetting the texenv state and recomputing the fixed function
programs.  It also means less use of fixed function internally in our
GLES2 drivers, which is rather bogus.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-07-20 11:03:20 -07:00
Younes Manton b56daf71d2 g3dvl: Preserve previously rendered components for MC output.
Fixes xvmc-softpipe MC entrypoint, amongst others.
2011-07-20 13:52:45 -04:00
Younes Manton 8082816e27 g3dvl: Init/clean pipe fully when a shader-based decoder isn't used.
Fixes VDPAU CSC-only mode.
2011-07-20 13:52:45 -04:00
Kenneth Graunke 3875526926 glsl: Avoid massive ralloc_strndup overhead in S-Expression parsing.
When parsing S-Expressions, we need to store nul-terminated strings for
Symbol nodes.  Prior to this patch, we called ralloc_strndup each time
we constructed a new s_symbol.  It turns out that this is obscenely
expensive.

Instead, copy the whole buffer before parsing and overwrite it to
contain \0 bytes at the appropriate locations.  Since atoms are
separated by whitespace, (), or ;, we can safely overwrite the character
after a Symbol.  While much of the buffer may be unused, copying the
whole buffer is simple and guaranteed to provide enough space.

Prior to this, running piglit-run.py -t glsl tests/quick.tests with GLSL
1.30 enabled took just over 10 minutes on my machine.  Now it takes 5.

NOTE: This is a candidate for stable release branches (because it will
      make running comparison tests so much less irritating.)

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-07-20 10:42:43 -07:00
Brian Paul 8d044047f1 mesa: remove depend files from tarballs 2011-07-19 21:11:53 -06:00
Brian Paul 4470ff2ebf glsl: silence warning in linker.cpp 2011-07-19 21:10:25 -06:00
Brian Paul d5e3239776 st/mesa: get rid of redundant clipping code in st_copy_texsubimage() 2011-07-19 20:03:05 -06:00
Brian Paul 1c1fc62e38 mesa: remove unused dd_function_table::CopyTexImage1D/2D() hooks 2011-07-19 20:03:05 -06:00
Brian Paul 774311fb54 meta: remove _mesa_meta_CopyTexImage1D/2D() 2011-07-19 20:03:05 -06:00
Brian Paul 0823ef84a5 st/mesa: remove st_CopyTexImage1D/2D() 2011-07-19 20:03:05 -06:00
Brian Paul 9ed87c4463 radeon: remove radeonCopyTexImage2D() 2011-07-19 20:03:05 -06:00
Brian Paul fbe6836043 intel: remove intelCopyTexImage1D/2D() 2011-07-19 20:03:05 -06:00
Brian Paul 1da28fa959 mesa: remove comments referring to Driver.TexImage1D/2D 2011-07-19 20:03:05 -06:00
Brian Paul 5874890c26 mesa: stop using ctx->Driver.CopyTexImage1D/2D() hooks 2011-07-19 20:03:05 -06:00
Jørgen Lind 496bf3822a Make it possible to use gbm with c++
NOTE: This is a candiate for 7.11
2011-07-19 16:30:07 -07:00
Fredrik Höglund d84791a72b st/mesa: fix the texture format in st_context_teximage
Commit 1a339b6c71 made
st_ChooseTextureFormat map GL_RGBA with type GL_UNSIGNED_BYTE
to PIPE_FORMAT_A8B8G8R8_UNORM.

The image format for ARGB pixmaps is PIPE_FORMAT_B8G8R8A8_UNORM
however. This mismatch caused the texture to be recreated in
st_finalize_texture.

NOTE: This is a candidate for the 7.11 branch.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=39209
Signed-off-by: Fredrik Höglund <fredrik@kde.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-07-19 15:28:43 -06:00
Brian Paul f0e306c343 mesa: update, shorten some comments in dd.h 2011-07-19 15:28:43 -06:00
Henri Verbeet 0f20e2e18f glx: Avoid calling __glXInitialize() in driReleaseDrawables().
This fixes a regression introduced by commit
a26121f375 (fd.o bug #39219).

Since the __glXInitialize() call should be unnecessary anyway, this is
probably a nicer fix for the original problem too.

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

Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Tested-by: padfoot@exemail.com.au
2011-07-19 23:27:46 +02:00
Chad Versace f7dbcba280 intel: Fix stencil buffer to be W tiled
Until now, the stencil buffer was allocated as a Y tiled buffer, because
in several locations the PRM states that it is. However, it is actually
W tiled. From the PRM, 2011 Sandy Bridge, Volume 1, Part 2, Section
4.5.2.1 W-Major Format:
    W-Major Tile Format is used for separate stencil.

The GTT is incapable of W fencing, so we allocate the stencil buffer with
I915_TILING_NONE and decode the tile's layout in software.

This fix touches the following portions of code:
    - In intel_allocate_renderbuffer_storage(), allocate the stencil
      buffer with I915_TILING_NONE.
    - In intel_verify_dri2_has_hiz(), verify that the stencil buffer is
      not tiled.
    - In the stencil buffer's span functions, the tile's layout must be
      decoded in software.

This commit mutually depends on the xf86-video-intel commit
    dri: Do not tile stencil buffer
    Author: Chad Versace <chad@chad-versace.us>
    Date:   Mon Jul 18 00:38:00 2011 -0700

On Gen6 with separate stencil enabled, fixes the following Piglit tests:
    bugs/fdo23670-drawpix_stencil
    general/stencil-drawpixels
    spec/EXT_framebuffer_object/fbo-stencil-GL_STENCIL_INDEX16-copypixels
    spec/EXT_framebuffer_object/fbo-stencil-GL_STENCIL_INDEX16-drawpixels
    spec/EXT_framebuffer_object/fbo-stencil-GL_STENCIL_INDEX16-readpixels
    spec/EXT_framebuffer_object/fbo-stencil-GL_STENCIL_INDEX1-copypixels
    spec/EXT_framebuffer_object/fbo-stencil-GL_STENCIL_INDEX1-drawpixels
    spec/EXT_framebuffer_object/fbo-stencil-GL_STENCIL_INDEX1-readpixels
    spec/EXT_framebuffer_object/fbo-stencil-GL_STENCIL_INDEX4-copypixels
    spec/EXT_framebuffer_object/fbo-stencil-GL_STENCIL_INDEX4-drawpixels
    spec/EXT_framebuffer_object/fbo-stencil-GL_STENCIL_INDEX4-readpixels
    spec/EXT_framebuffer_object/fbo-stencil-GL_STENCIL_INDEX8-copypixels
    spec/EXT_framebuffer_object/fbo-stencil-GL_STENCIL_INDEX8-drawpixels
    spec/EXT_framebuffer_object/fbo-stencil-GL_STENCIL_INDEX8-readpixels
    spec/EXT_packed_depth_stencil/fbo-stencil-GL_DEPTH24_STENCIL8-copypixels
    spec/EXT_packed_depth_stencil/fbo-stencil-GL_DEPTH24_STENCIL8-readpixels
    spec/EXT_packed_depth_stencil/readpixels-24_8

Note: This is a candidate for the 7.11 branch.

Signed-off-by: Chad Versace <chad@chad-versace.us>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2011-07-19 13:12:19 -07:00
Eric Anholt fb5ff51f42 i965: Fix regression in 29a911c50e.
The previous define was the full 32-bit header, while the new define
was just the top 16 bits.
2011-07-19 12:20:14 -07:00
Brian Paul b38c26f19f llvmpipe: include LLVM version number in name string 2011-07-19 08:42:46 -06:00
Tobias Droste 3143e95353 llvmpipe: fix build with LLVM 3.0svn
LLVM 3.0svn introduced a new type system. It defines a new way to create
named structs and removes the (now not needed) LLVMInvalidateStructLayout
function.  See revision 134829 of LLVM.

Signed-off-by: Tobias Droste <tdroste@gmx.de>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-07-19 08:23:28 -06:00
Emil Velikov c2426bbf86 configure.ac: Check for the respective libdrm_* when building gallium drivers
In a rare case of building gallium only, we need to
check if the required packages are available

libdrm_[intel|nouveau] - gallium[i915 i965|nouveau]

v2: r300g and r600g do not need libdrm_radeon

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Marek Olšák <maraeo@gmail.com>
2011-07-19 03:13:35 +02:00
Marek Olšák 8c47a5da9f xvmc-softpipe: remove LLVM_LIBS
this is added conditionally in Makefile.xmvc

Spotted by Chris Rankin.
2011-07-18 23:41:45 +02:00
Kenneth Graunke 348bdaa529 i965: Rename CMD_VF_STATISTICS_(965|GM45) to include "3DSTATE".
Including the full "3DSTATE_VF_STATISTICS" should make it easier to
cross-reference the code and documentation.

Also, move the 965/GM45 suffix to the beginning for consistency with
newer #defines.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-07-18 14:14:36 -07:00
Kenneth Graunke 797522f1c9 i965: Rename CMD_VERTEX_(BUFFER|ELEMENT) to 3DSTATE_VERTEX_...S.
This makes our code use the same names as the documentation.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-07-18 14:14:36 -07:00
Kenneth Graunke 29a911c50e i965: Rename 3DSTATE_DRAWRECT_INFO_I965 to 3DSTATE_DRAWING_RECTANGLE.
The documentation uses 3DSTATE_DRAWING_RECTANGLE, and we already had it
defined in brw_defines.h; we were simply using an old #define from
intel_reg.h.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-07-18 14:14:36 -07:00
Eric Anholt cb5e0ba2aa i915: Simplify intel_wpos_* with a helper function. 2011-07-18 11:26:34 -07:00
Eric Anholt fceda4342c i915: Include gl_FragCoord.w data, not just xyz.
Fixes piglit fragcoord_w test.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=34323
2011-07-18 11:26:33 -07:00
Eric Anholt af9548d335 i915: Add support for HW rendering with no color draw buffer.
This is useful for shadow map generation.  Tested with glsl-bug-22603,
which rendered the depth textures with fallbacks before.

Acked-by: Chad Versace <chad@chad-versace.us>
2011-07-18 11:26:33 -07:00
Eric Anholt debf751aea i915: Fix incorrect depth scaling when enabling/disabling depth buffers.
We were updating our new viewport using the old buffers' _WindowMap.m.
We can do less math and avoid using that deprecated matrix by just
folding the viewport calculation right in to the driver.

Fixes piglit fbo-depthtex.
2011-07-18 11:26:33 -07:00
Eric Anholt 79fee3a76b i915: Make stencil test for no-stencil handling match depth test.
i915_update_draw_buffers() already handles the fallback bit for
missing stencil region, so here we just need to handle whether the GL
thinks we have stencil data or not (and disable the test if so).
2011-07-18 11:26:33 -07:00
Eric Anholt fc4fba52cf i915: Disable the depth test whenever we don't have a depth buffer.
We were disabling it once at the moment we changed draw buffers, but
later enabling of depth test could turn it back on.  Fixes
fbo-nodepth-test.

Note that ctx->DrawBuffer has to be checked because during context
create we get called while it's still unset.  However, we know we'll
get an intel_draw_buffer() after that, so it's safe to make a silly
choice at this point.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=30080
2011-07-18 11:26:33 -07:00
Eric Anholt 4c47fce92e i915: Remove i965 paths from i915_update_drawbuffer() and i830's too.
Reviewed-by: Chad Versace <chad@chad-versace.us>
2011-07-18 11:26:33 -07:00
Eric Anholt 94efc350b4 i965: Remove i915 paths from brw_update_draw_buffers().
Reviewed-by: Chad Versace <chad@chad-versace.us>
2011-07-18 11:26:33 -07:00
Eric Anholt c68270a26b i965: Remove unused region calculations in brw_update_draw_buffer().
Reviewed-by: Chad Versace <chad@chad-versace.us>
2011-07-18 11:26:33 -07:00
Eric Anholt 15af0f54b8 i965: Remove empty brw_set_draw_region.
Reviewed-by: Chad Versace <chad@chad-versace.us>
2011-07-18 11:26:33 -07:00
Eric Anholt dd898c3e89 i965: Remove FALLBACK() from brw_update_draw_region().
The 965 driver doesn't use these for deciding on fallbacks.

Reviewed-by: Chad Versace <chad@chad-versace.us>
2011-07-18 11:26:33 -07:00
Eric Anholt f34ec6169d intel: Move intel_draw_buffers() code into each driver.
The illusion of shared code here wasn't fooling anybody.  It was
tempting to keep i830 and i915 still shared, but I think I actually
want to make them diverge shortly.

Reviewed-by: Chad Versace <chad@chad-versace.us>
2011-07-18 11:26:33 -07:00
Eric Anholt 8cf2741d2b intel: Clarify the depthRb == stencilRb logic.
Reviewed-by: Chad Versace <chad@chad-versace.us>
2011-07-18 11:26:33 -07:00