Commit Graph

54822 Commits

Author SHA1 Message Date
Marek Olšák 5330c5a248 r300g: fix MSAA resolve to an untiled texture
RB3D_DEBUG_CTL doesn't help, so I resolve to a tiled temporary texture and
then blitting it to the destination one, which we also do in other situations.
2013-01-14 03:12:01 +01:00
Marek Olšák e102b665e6 r300g: advertise MSAA support for the RGB10_A2 format on r500
It seems to be working just fine.
2013-01-14 03:12:01 +01:00
Marek Olšák 5fc83101fb r300g: allow separate depth and stencil clear
The handling of the CAP is broken in st/mesa anyway. Let's just kill it.

This commit pretty much enables fast Z clear for FBOs with Z24S8.
The driver falls back to clearing with a quad if the fast clear cannot be
used. It can still do fast color clear, for example.
2013-01-14 03:11:43 +01:00
Marek Olšák e93a5c2b86 r300g: if both Z and stencil are present, they must be fast-cleared together 2013-01-14 03:11:42 +01:00
Marek Olšák 631c631cbf r300g: allow HiZ with a 16-bit zbuffer 2013-01-14 03:11:42 +01:00
Marek Olšák 3f584c211a r300g: random hyperz cleanups 2013-01-14 03:11:42 +01:00
Marek Olšák 4d6faf5175 r300g: kill the X.Org state tracker target
This won't ever be made default and we don't need it anyway.

We should also consider doing this for other drivers.
2013-01-14 03:11:41 +01:00
Johannes Obermayr 6acef6c5f7 xmlpool: Fix out-of-tree builds.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-13 12:38:50 +01:00
Johannes Obermayr 40a9b0f5d2 gtest: Build it only for 'make check'.
Reviewed-by: Andreas Boll <andreas.boll.dev@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-13 12:38:44 +01:00
Johannes Obermayr ebcabb88cf tests: AM_CPPFLAGS must include $(top_srcdir) instead of $(top_builddir).
Reviewed-by: Andreas Boll <andreas.boll.dev@gmail.com>
2013-01-13 12:38:38 +01:00
Adam Jackson 06f3a1f792 r200: Fix probable thinko in r200EmitArrays
Effectively this path would always assert.  Move the break statement to
the (probable) intended place.

Note: This is a candidate for the stable branches.

Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2013-01-13 12:38:31 +01:00
Nathan Schulte 1b8adabe2e target/dri-swrast: fix for nonstandard LLVM prefix
Include LLVM_LDFLAGS when building with LLVM.  Fixes the following build
errors:
  CXXLD  swrast_dri.la
  /usr/bin/ld: cannot find -lLLVMR600CodeGen
  /usr/bin/ld: cannot find -lLLVMR600Desc
  /usr/bin/ld: cannot find -lLLVMR600Info
  /usr/bin/ld: cannot find -lLLVMR600AsmPrinter

Reviewed-by: Andreas Boll <andreas.boll.dev@gmail.com>
2013-01-13 12:22:15 +01:00
Andreas Boll 9da454f295 targets/dri-r600: Force c++ linker in all cases
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=59282
2013-01-13 12:19:29 +01:00
Andreas Boll e09a5846cd glapi/gen: remove an obsolete comment from Makefile.am
Glapi gets generated at build time.

See commit:
0ce0f7c0c8
mesa: Remove the generated glapi from source control, and just build it.
2013-01-13 00:55:37 +01:00
Matt Turner 92ce9c38fd Remove hacks for static Makefiles
v2: Andreas Boll <andreas.boll.dev@gmail.com>
    - don't remove compatibility with scripts for the old build system

v3: Andreas Boll <andreas.boll.dev@gmail.com>
    - remove more obsolete hacks

v4: Andreas Boll <andreas.boll.dev@gmail.com>
    - add a previously removed TOP variable to fix vgapi build
2013-01-13 00:55:37 +01:00
Kenneth Graunke 8c80bdc4a8 i965: Move program_id to intel_screen instead of brw_context.
According to bug #54524, I regressed oglconform's multicontext test
when I reenabled the fragment shader precompile.

However, these test cases only passed by miraculous coincedence.  We
assign each fragment program a unique ID (brw_fragment_program::id which
becomes brw_wm_prog_key::program_string_id) which we obtain by storing a
per-context counter.

The test case uses GLX context sharing to access the same fragment
program from two different contexts.  This means that we share a program
cache.  Before the precompile, if both contexts happened to use the same
shaders in the same order, we'd obtain the same program_string_ids (by
virtue of doing the same computation twice).  However, the more likely
scenario is that they completely disagree on program_string_id.

This meant that we'd have two completely different fragment shaders in
the cache with the same ID, tricking us to think they were the same
(aside from NOS), so we'd render using the wrong program.

This patch implements a simple fix suggested by Eric: it moves the
global counter out of brw_context and into intel_screen, which is shared
across all contexts.  A mutex protects it from concurrent access.

This is also the first direct usage of pthreads in the i965 driver.

Fixes 10 subcases of oglconform's multicontext test.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54524
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-01-12 15:36:21 -08:00
Kenneth Graunke 2c4ad502ce i965: Fix build error with clang.
Technically, variable sized arrays are a required feature of C99,
redacted to be optional in C11, and not actually part of C++ whatsoever.

Gcc allows using them in C++ unless you specify -pedantic, and Clang
appears to allow them for simple/POD types.

exec_list is arguably POD, since it doesn't have virtual methods, but I
can see why Clang would be like "meh, it's a C++ struct, say no", seeing as
it's meant to support C99.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=58970
Reviewed-by: Matt Turner <mattst88@gmail.com>
2013-01-12 15:35:40 -08:00
Kenneth Graunke fea648db08 i965/fs: Don't mix integer/float immediates in i2b handling.
The simulator gets very angry about our i2b code:

cmp.ne(16)      g3<1>D          g2<0,1,0>D      0F

We can't mix integer DWord and float types.  The only reason to use 0F
here was to share code with f2b.  Split it and use 0D instead.

While we don't believe anything bad will actually happen because of
this, it's nice to fix the warnings and easy enough to do.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-01-12 15:35:38 -08:00
Kenneth Graunke 4a6753926f i965: Add an INTEL_DEBUG=no16 option.
Often when debugging, I don't want to see SIMD16 shaders.  It makes
INTEL_DEBUG=vs/fs output much easier to read, especially when a program
dumps many shaders.  Plus, I also want to verify that SIMD8 works before
even considering SIMD16.

v2: Fix the likeliness check (caught by Chris and Eric).

Reviewed-by: Eric Anholt <eric@anholt.net>
2013-01-12 15:35:38 -08:00
Alexandre Demers 67ef755908 configure.ac: Fixing common dri dependency when using dri state tracker
Fixes a regression caused by b587a7595e

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=59261
Reviewed-by: Andreas Boll <andreas.boll.dev@gmail.com>
2013-01-13 00:13:16 +01:00
Fredrik Höglund ac1c2b8238 st/mesa: set ctx->Const.UniformBufferOffsetAlignment
Reviewed-by: Marek Olšák <maraeo@gmail.com>
2013-01-12 22:08:09 +01:00
José Fonseca a3dd1ff45f scons: Update for xmlpool/options.h generation. 2013-01-12 19:00:04 +00:00
Johannes Obermayr 6bca283ad5 nv50/nvc0: Build codegen in nv50.
This is required to make libnv50 independent of libnvc0.
2013-01-12 17:14:04 +01:00
Pekka Vuorela 09a00a141f winsys/sw/wayland: Fix build to properly use wayland cflags
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=59281
Reviewed-by: Andreas Boll <andreas.boll.dev@gmail.com>
2013-01-12 16:02:30 +01:00
Jordan Justen 3c3a2b51b8 texformat: use MESA_FORMAT_ARGB2101010 with GL_UNSIGNED_INT_2_10_10_10_REV
Choose MESA_FORMAT_ARGB2101010 when storing
GL_RGBA + GL_UNSIGNED_INT_2_10_10_10_REV or
GL_RGB + GL_UNSIGNED_INT_2_10_10_10_REV.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-12 01:46:12 -08:00
Jordan Justen 53e0f32efe texstore argb2101010: merge GL_RGBA and GL_RGB cases
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-12 01:46:02 -08:00
Jordan Justen f1c5b5d15e glformats: support _mesa_bytes_per_pixel for 2101010+GL_RGB
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-12 01:45:01 -08:00
Jordan Justen 89e07ccf61 glformats: add _mesa_base_format_component_count
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-12 01:44:25 -08:00
Jordan Justen 6d63b6e503 glformats: add functions to detect signed/unsigned integer types
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-12 01:40:47 -08:00
Jordan Justen 2ace406b1f unpack: support unpacking MESA_FORMAT_ARGB2101010
Note: This is a candidate for the stable branches.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-12 01:40:01 -08:00
Ian Romanick 8af7d3ce9f mesa: Add extension tracking for {ARB,OES}_get_program_binary
The ARB_get_program_binary spec says "OpenGL 3.0 is required."  The
nearly identical OES_get_program_binary extension is available for
OpenGL ES 2.0, so I don't see how / why OpenGL 3.0 is a requirement for
the ARB version.  Let's just enable whenever GL_ARB_shader_objects is
available.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-11 18:13:53 -08:00
Ian Romanick 31ca0c8be3 mesa: Add GetProgramiv support for GL_PROGRAM_BINARY_LENGTH
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-11 18:13:53 -08:00
Ian Romanick 50c5fac4e2 mesa: Add Get support for PROGRAM_BINARY_FORMATS and NUM_PROGRAM_BINARY_FORMATS
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-11 18:13:53 -08:00
Ian Romanick fefd03e16c mesa: Add tracking for GL_PROGRAM_BINARY_RETRIEVABLE_HINT state
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-11 18:13:53 -08:00
Ian Romanick 8e2e670007 mesa: Emit errors for geometry shader enums when ARB_gs4 is not supported
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-11 18:13:53 -08:00
Ian Romanick e3f273e2f4 glapi: Emit dispatch for {ARB,OES}_get_program_binary
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-11 18:13:53 -08:00
Ian Romanick 11b49dbd05 glapi: Remove spurious space from end of extension name
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-11 18:13:52 -08:00
Ian Romanick 3fe747a0fe mesa: Add stub implementations of glGetProgramBinary and glProgramBinary
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-11 18:13:52 -08:00
Ian Romanick ec41349a78 mesa: Fix the naming of _mesa_ProgramParameteriARB
After recent changes in the XML, the dispatch generators will expect
this function to be named _mesa_ProgramParameteri.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-11 18:13:52 -08:00
Ian Romanick bb7f1a9ae8 glapi: Reorder and clean up some of the includes and comments
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-11 18:13:52 -08:00
Ian Romanick a002902168 mesa: Fix GL_SHADER_BINARY_FORMATS query
There were two bugs here.  First, this and several other queries were
not available in a desktop GL context with GL_ARB_ES2_compatibility.
Second, GL_NUM_SHADER_BINARY_FORMATS returns zero, but
GL_SHADER_BINARY_FORMATS writes one element of data to the buffer.  If
NUM is zero, no data should be written.

Fixes piglit test 'arb_get_program_binary-overrun shader'.

NOTE: This is a candidate for stable release branches.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-11 18:13:52 -08:00
Dave Airlie 4f1e037acf docs/GL3.txt: update GL3 status for r600g.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2013-01-12 00:19:18 +00:00
Dave Airlie 5039ad6bc5 r600g: fix warnings for htile va
This fixes a warning about mismatched types.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2013-01-11 23:19:11 +00:00
Dave Airlie d23aa65001 r600g: texture buffer object + glsl 1.40 enable support (v2)
This adds TBO support to r600g, and with GLSL 1.40 enabled,
we now get 3.1 core profiles advertised for r600g.

The r600/700 implementation is a bit different from the evergreen one,
as r6/7 hw lacks vertex fetch swizzles. So we implement it by passing 5
constants per sampler to the shader, the shader uses the first 4 as masks
for each component and the 5th as the alpha value to OR in.

Now TXQ is also broken so we have to pass a constant for the buffer size,
on evergreen we just pass this, on r6/7 we pass it as the 6th element
in the const info buffer.

v1.1: drop return as DDX doesn't use a texture type
v2: add r600/700 support.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2013-01-11 22:31:54 +00:00
Dave Airlie 77c10225ee r600g: uniform buffer object support
This adds 12 more constant buffers for use as UBOs,
along with adding relative constant fetching for 2D indices.

This with GLSL 1.40 enabled passes all the same tests as softpipe
on my evergreen system.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2013-01-11 22:31:54 +00:00
Dave Airlie 199eea4a4b r600: always export a position from vertex shader
This fixes piglit glsl-1.40-tf-no-position from gpu hanging on my rv635
at least.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2013-01-11 22:31:54 +00:00
Carl Worth cc5fc8bf2f glcpp: Add tests for line continuation
First we test that line continuations are honored within a comment, (as
recently changed in glcpp), then we test that line continuations can be
disabled via an option within the context. This is tested via the new support
for a test-specific command-line option passed to glcpp.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-11 13:55:41 -08:00
Carl Worth 2483039aca glcpp: Rewrite line-continuation support to act globally.
Previously, we were only supporting line-continuation backslash characters
within lines of pre-processor directives, (as per the specification). With
OpenGL 4.2 and GLES3, line continuations are now supported anywhere within a
shader.

While changing this, also fix a bug where the preprocessor was ignoring
line continuation characters when a line ended in multiple backslash
characters.

The new code is also more efficient than the old. Previously, we would
perform a ralloc copy at each newline. We now perform copies only at each
occurrence of a line-continuation.

This commit fixes the line-continuation.vert test in piglit.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-11 13:55:41 -08:00
Carl Worth 63d156900f glcpp: Add --disable-line-continuations argument to standalone glcpp
This will allow testing of disabled line-continuation on a case-by-case basis,
(with the option communicated to the preprocessor via the GL context).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-11 13:55:41 -08:00
Carl Worth 409dee5eac glcpp: Allow test-specific arguments for standalone glcpp tests
This will allow the test exercising disabled line continuations to arrange
for the --disable-line-continuations argument to be passed to the standalone
glcpp.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-11 13:55:41 -08:00