mesa.git
11 years agodispatch: GLES1 fixes for _mesa_create_exec_table().
Paul Berry [Fri, 19 Oct 2012 13:31:49 +0000 (06:31 -0700)]
dispatch: GLES1 fixes for _mesa_create_exec_table().

Currently, _mesa_create_exec_table() (in api_exec.c) is used for all
APIs except GLES1.  In GLES1, _mesa_create_exec_table_es1() (a code
generated function) is used instead.

In principle, this shouldn't be necessary.  It should be possible for
api_exec.c to contain the logic for populating the dispatch table for
all API's.

This patch paves the way for using _mesa_create_exec_table() instead
of _mesa_create_exec_table_es1(), by making _mesa_create_exec_table()
(and the functions it calls) expose the correct subset of desktop GL
functions for GLES1.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
11 years agodispatch: Make a header to go along with querymatrix.c.
Paul Berry [Tue, 23 Oct 2012 21:31:27 +0000 (14:31 -0700)]
dispatch: Make a header to go along with querymatrix.c.

This patch creates a header querymatrix.h, to allow functions defined
in querymatrix.c to be used from other .c files.  It also switches
from the nonstandard GL_APIENTRY to GLAPIENTRY.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
v2: Don't declare _mesa_Get{Integer,Float}v in querymatrix.c.
Instead, just include main/get.h.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
11 years agodispatch: Add standard boilerplate and GL_APIENTRY to es1_conversion.h.
Paul Berry [Tue, 23 Oct 2012 21:23:36 +0000 (14:23 -0700)]
dispatch: Add standard boilerplate and GL_APIENTRY to es1_conversion.h.

This patch adds the usual boilerplate (copyright notice and guards
against redundant inclusion) to es1_conversion.h.  It also moves the
definition of GL_APIENTRY from es1_conversion.c.

This allows es1_conversion.h to be safely included from other .c files.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
v2: Use copyright notice from src/mesa/main/es_generator.py (the
script that used to generate this file).

11 years agodispatch: Include GLES1-only functions in dispatch table.
Paul Berry [Tue, 23 Oct 2012 20:46:04 +0000 (13:46 -0700)]
dispatch: Include GLES1-only functions in dispatch table.

Previously dispatch table-related code was generated from gl_API.xml,
so it did not include slots for GLES1-only functions (such as those
taking fixed-point arguments).

This patch generates dispatch table-related code from
gl_and_es_API.xml, so that GLES1-only functions are included.  This
paves the way for future patches that will unify the GLES1 dispatch
table with the dispatch tables for the other APIs.

The following generated files are affected:
- glapi_x86.S
- glapi_x86-64.S
- glapi_sparc.S
- glprocs.h
- glapitemp.h
- glapitable.h
- glapi_gentable.c
- dispatch.h
- remap_helper.h

Since this change affects makefiles, a full rebuild is required.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
v2: Adjust dependencies to ensure that generated files will be rebuilt
whenever any ES-related XML source files are changed.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
11 years agodispatch: properly handle parameter name mismatches in glapitemp.h.
Paul Berry [Tue, 30 Oct 2012 15:45:29 +0000 (08:45 -0700)]
dispatch: properly handle parameter name mismatches in glapitemp.h.

Previously, when code-generating aliased functions in glapitemp.h, we
weren't consistent about which function alias we used to obtain the
parameter names, with the risk that we would generate incorrect code
like this:

  KEYWORD1 void KEYWORD2 NAME(Foo)(GLint x)
  {
    (void) x;
    DISPATCH(Foo, (x), (F, "glFoo(%d);\n", x));
  }
  KEYWORD1 void KEYWORD2 NAME(FooEXT)(GLint y)
  {
    (void) x;
    DISPATCH(Foo, (x), (F, "glFooEXT(%d);\n", x));
  }

At the moment there are no aliased functions with mismatched parameter
names, so this isn't the problem.  But when we introduce GLES1
functions into the dispatch table, there will be
(MapBufferRange/MapBufferRangeEXT).  This patch paves the way for that
by fixing the code generation script to handle the mismatch correctly.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
11 years agodispatch: Include glheader.h in dispatch-related files.
Paul Berry [Tue, 23 Oct 2012 21:06:32 +0000 (14:06 -0700)]
dispatch: Include glheader.h in dispatch-related files.

This ensures that GLES1-only typedefs are available in these files.
In a future patch, this will allow us to expand the dispatch table to
include GLES1-only functions.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
11 years agodispatch: Update check_table.cpp to reflect recent aliasing changes.
Paul Berry [Mon, 29 Oct 2012 18:45:10 +0000 (11:45 -0700)]
dispatch: Update check_table.cpp to reflect recent aliasing changes.

In commits bad96f6 and e7dd2e5 I added the following aliases:
- ClampColor -> ClampColorARB
- VertexAttribDivisor -> VertexAttribDivisorARB

But I neglected to update check_table.cpp, causing "make check" to
fail for non-shared-glapi builds.

This patch removes the functions that are now aliased from
check_table.cpp, so that "make check" works correctly again.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
11 years agoi965/gen4: Fix assertion failures in depthstencil piglit tests.
Eric Anholt [Wed, 31 Oct 2012 19:58:49 +0000 (12:58 -0700)]
i965/gen4: Fix assertion failures in depthstencil piglit tests.

Don't forget to set depth_mt even if !hiz_mt.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
11 years agoi965: Add "alpha to coverage" to performance debug recompile messages.
Kenneth Graunke [Sat, 27 Oct 2012 07:05:31 +0000 (00:05 -0700)]
i965: Add "alpha to coverage" to performance debug recompile messages.

This was missing and got labeled "Something else".

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
11 years agoi965: Don't replicate data for zero-stride arrays when copying to VBOs.
Kenneth Graunke [Fri, 26 Oct 2012 22:48:00 +0000 (15:48 -0700)]
i965: Don't replicate data for zero-stride arrays when copying to VBOs.

When copy_array_to_vbo_array encountered an array with src_stride == 0
and dst_stride != 0, we would replicate out the single element to the
whole size (max - min + 1).  This is unnecessary: we can simply upload
one copy and set the buffer's stride to 0.

Decreases vertex upload overhead in an upcoming Steam for Linux title.
Prior to this patch, copy_array_to_vbo_array appeared very high in the
profile (Eric quoted 20%).  After the patch, it disappeared completely.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
11 years agoi965: Don't bother trying to extend the current vertex buffers.
Kenneth Graunke [Sat, 27 Oct 2012 03:36:50 +0000 (20:36 -0700)]
i965: Don't bother trying to extend the current vertex buffers.

This essentially reverts the following:

  commit c625aa19cb53ed27f91bfd16fea6ea727e9a5bbd
  Author: Chris Wilson <chris@chris-wilson.co.uk>
  Date:   Fri Feb 18 10:37:43 2011 +0000

      intel: extend current vertex buffers

While working on optimizing an upcoming Steam title, I broke this code.
Eric expressed his doubts about this optimization, and noted that the
original commit offered no performance data.

I ran before and after benchmarks on Xonotic and Citybench, and found
that this code made no difference.  So, remove it to reduce complexity
and make future work simpler.

Reviewed-by: Eric Anholt <eric@anholt.net>
11 years agor600g: re-enable handling of DISCARD_RANGE, improving performance
Marek Olšák [Thu, 1 Nov 2012 01:00:37 +0000 (02:00 +0100)]
r600g: re-enable handling of DISCARD_RANGE, improving performance

It seems to work for me now. Even the graphics corruption is gone.

This also boosts performance in Reaction Quake.

11 years agor600g: fix abysmal performance in Reaction Quake
Marek Olšák [Wed, 31 Oct 2012 23:52:19 +0000 (00:52 +0100)]
r600g: fix abysmal performance in Reaction Quake

The problem was we set VRAM|GTT for relocations of STATIC resources.
Setting just VRAM increases the framerate 4 times on my machine.

I rewrote the switch statement and adjusted the domains for window
framebuffers too.

NOTE: This is a candidate for the stable branches.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
11 years agogallium/u_vbuf: document how it works
Marek Olšák [Sun, 28 Oct 2012 20:31:12 +0000 (21:31 +0100)]
gallium/u_vbuf: document how it works

11 years agogallium/u_vbuf: optimize looping over the list of buffers to upload
Marek Olšák [Sun, 28 Oct 2012 19:11:32 +0000 (20:11 +0100)]
gallium/u_vbuf: optimize looping over the list of buffers to upload

11 years agogallium/u_vbuf: skip processing of buffers unused by the vertex element state
Marek Olšák [Sun, 28 Oct 2012 18:52:12 +0000 (19:52 +0100)]
gallium/u_vbuf: skip processing of buffers unused by the vertex element state

11 years agoswrast: remove explicit size from texfetch_funcs array
Brian Paul [Tue, 30 Oct 2012 15:39:20 +0000 (09:39 -0600)]
swrast: remove explicit size from texfetch_funcs array

By removing the array size, the static assertion to check for missing
elements can do its job properly.  This will catch cases where a new
Mesa format is added but the swrast texfetch code isn't updated.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
11 years agollvmpipe: Obey back writemask.
José Fonseca [Tue, 30 Oct 2012 19:45:25 +0000 (19:45 +0000)]
llvmpipe: Obey back writemask.

Tested with a modified glean tstencil2 test.

NOTE: This is a candidate for stable branches.

Reviewed-by: Brian Paul <brianp@vmware.com>
11 years agor600g: avoid shader needing too many gpr to lockup the gpu v2
Jerome Glisse [Fri, 26 Oct 2012 22:59:05 +0000 (18:59 -0400)]
r600g: avoid shader needing too many gpr to lockup the gpu v2

On r6xx/r7xx shader resource management need to make sure that the
shader does not goes over the gpr register limit. Each specific
asic has a maxmimum register that can be split btw shader stage.
For each stage the shader must not use more register than the
limit programmed.

v2: Print an error message when discarding draw. Don't add another
    boolean to context structure, but rather propagate the discard
    boolean through the call chain.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
11 years agodraw: fix assertion failure in draw_emit_vertex_attr
Marek Olšák [Tue, 30 Oct 2012 00:07:17 +0000 (01:07 +0100)]
draw: fix assertion failure in draw_emit_vertex_attr

This is a regression since b3921e1f53833420e0a0fd581f7417.

The array stores VS outputs, not FS inputs.
Now llvmpipe can do 32 varyings too.

NOTE: This is a candidate for the stable branches.

Reviewed-by: Brian Paul <brianp@vmware.com>
11 years agor600g: use SQ_VTX_SEMANTIC_CLEAR to clear the semantic registers
Marek Olšák [Mon, 29 Oct 2012 12:18:03 +0000 (13:18 +0100)]
r600g: use SQ_VTX_SEMANTIC_CLEAR to clear the semantic registers

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
11 years agomesa: remove NV_read_buffer extension enable flag
Marek Olšák [Sun, 28 Oct 2012 14:44:53 +0000 (15:44 +0100)]
mesa: remove NV_read_buffer extension enable flag

It's been enabled by default, so the flag isn't really useful.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
11 years agomesa: remove SGIS_texture_lod extension enable flag
Marek Olšák [Sun, 28 Oct 2012 13:24:53 +0000 (14:24 +0100)]
mesa: remove SGIS_texture_lod extension enable flag

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
11 years agomesa: remove NV_texgen_reflection extension enable flag
Marek Olšák [Sun, 28 Oct 2012 13:24:53 +0000 (14:24 +0100)]
mesa: remove NV_texgen_reflection extension enable flag

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
11 years agomesa: remove NV_light_max_exponent extension enable flag
Marek Olšák [Sun, 28 Oct 2012 13:24:53 +0000 (14:24 +0100)]
mesa: remove NV_light_max_exponent extension enable flag

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
11 years agomesa: remove IBM_rasterpos_clip extension enable flag
Marek Olšák [Sun, 28 Oct 2012 13:24:53 +0000 (14:24 +0100)]
mesa: remove IBM_rasterpos_clip extension enable flag

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
11 years agomesa: remove IBM_multimode_draw_arrays extension enable flag
Marek Olšák [Sun, 28 Oct 2012 13:24:53 +0000 (14:24 +0100)]
mesa: remove IBM_multimode_draw_arrays extension enable flag

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
11 years agomesa: remove APPLE_packed_pixels extension enable flag
Marek Olšák [Sun, 28 Oct 2012 13:24:53 +0000 (14:24 +0100)]
mesa: remove APPLE_packed_pixels extension enable flag

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
11 years agomesa: don't always enable OES_standard_derivatives
Marek Olšák [Sun, 28 Oct 2012 14:01:52 +0000 (15:01 +0100)]
mesa: don't always enable OES_standard_derivatives

For Intel, expose it only if gen >= 4.
For Gallium, expose it only if PIPE_CAP_SM3 is advertised.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
11 years agomesa: move EXT_texture3D enabling to _mesa_init_extensions
Marek Olšák [Wed, 31 Oct 2012 01:04:16 +0000 (02:04 +0100)]
mesa: move EXT_texture3D enabling to _mesa_init_extensions

11 years agomesa: remove EXT_separate_specular_color extension enable flag
Marek Olšák [Sun, 28 Oct 2012 13:24:53 +0000 (14:24 +0100)]
mesa: remove EXT_separate_specular_color extension enable flag

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
11 years agomesa: remove EXT_rescale_normal extension enable flag
Marek Olšák [Sun, 28 Oct 2012 13:24:53 +0000 (14:24 +0100)]
mesa: remove EXT_rescale_normal extension enable flag

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
11 years agomesa: remove EXT_packed_pixels extension enable flag
Marek Olšák [Sun, 28 Oct 2012 13:24:53 +0000 (14:24 +0100)]
mesa: remove EXT_packed_pixels extension enable flag

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
11 years agomesa: remove EXT_draw_range_elements extension enable flag
Marek Olšák [Sun, 28 Oct 2012 13:24:53 +0000 (14:24 +0100)]
mesa: remove EXT_draw_range_elements extension enable flag

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
11 years agomesa: remove EXT_compiled_vertex_array extension enable flag
Marek Olšák [Sun, 28 Oct 2012 13:24:53 +0000 (14:24 +0100)]
mesa: remove EXT_compiled_vertex_array extension enable flag

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
11 years agomesa: remove ARB_window_pos extension enable flag
Marek Olšák [Sun, 28 Oct 2012 13:24:53 +0000 (14:24 +0100)]
mesa: remove ARB_window_pos extension enable flag

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
11 years agomesa: remove ARB_transpose_matrix extension enable flag
Marek Olšák [Sun, 28 Oct 2012 13:24:53 +0000 (14:24 +0100)]
mesa: remove ARB_transpose_matrix extension enable flag

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
11 years agomesa: remove ARB_copy_buffer extension enable flag
Marek Olšák [Sun, 28 Oct 2012 13:24:53 +0000 (14:24 +0100)]
mesa: remove ARB_copy_buffer extension enable flag

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
11 years agogallium: expose ARB_map_buffer_alignment on Radeon
Marek Olšák [Sun, 28 Oct 2012 16:52:48 +0000 (17:52 +0100)]
gallium: expose ARB_map_buffer_alignment on Radeon

Reviewed-by: Brian Paul <brianp@vmware.com>
v2: update relnotes-9.1
v3: use align_malloc and align_free for malloced buffers in r300g
v4: document the new CAP in the docs

11 years agomesa: implement ARB_map_buffer_alignment
Marek Olšák [Sun, 28 Oct 2012 16:51:47 +0000 (17:51 +0100)]
mesa: implement ARB_map_buffer_alignment

Reviewed-by: Brian Paul <brianp@vmware.com>
11 years agost/mesa: don't use _NEW_PROGRAM where ST_NEW_xxx_PROGRAM is sufficient
Marek Olšák [Mon, 29 Oct 2012 02:09:50 +0000 (03:09 +0100)]
st/mesa: don't use _NEW_PROGRAM where ST_NEW_xxx_PROGRAM is sufficient

Reviewed-by: Brian Paul <brianp@vmware.com>
11 years agor600g: use better sample positions for 8x MSAA
Marek Olšák [Sat, 27 Oct 2012 14:31:19 +0000 (16:31 +0200)]
r600g: use better sample positions for 8x MSAA

Taken from the intel driver. The sample positions are actually a solution
to the 8 queens puzzle.  It gives more accurate and smoother AA.

11 years agogallium: add start_slot parameter to set_vertex_buffers
Marek Olšák [Thu, 29 Mar 2012 15:51:50 +0000 (17:51 +0200)]
gallium: add start_slot parameter to set_vertex_buffers

This allows updating only a subrange of buffer bindings.

set_vertex_buffers(pipe, start_slot, count, NULL) unbinds buffers in that
range. Binding NULL resources unbinds buffers too (both buffer and user_buffer
must be NULL).

The meta ops are adapted to only save, change, and restore the single slot
they use. The cso_context can save and restore only one vertex buffer slot.
The clients can query which one it is using cso_get_aux_vertex_buffer_slot.
It's currently set to 0. (the Draw module breaks if it's set to non-zero)

It should decrease the CPU overhead when using a lot of meta ops, but
the drivers must be able to treat each vertex buffer slot as a separate
state (only r600g does so at the moment).

I can imagine this also being useful for optimizing some OpenGL use cases.

Reviewed-by: Brian Paul <brianp@vmware.com>
11 years agost/xorg: Remove superfluous miInitializeBackingStore() call
Marvin Schmidt [Thu, 11 Oct 2012 18:02:47 +0000 (20:02 +0200)]
st/xorg: Remove superfluous miInitializeBackingStore() call

It was defined as an empty function since Nov 2010 and was ultimately
removed completely.

See xserver commit 1cb0261

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
11 years agoxlib: Do not undefine _R, _G, and _B.
Vinson Lee [Sat, 27 Oct 2012 19:49:52 +0000 (12:49 -0700)]
xlib: Do not undefine _R, _G, and _B.

Fixes build error on Cygwin and Solaris. _R, _G, and _B are used in
ctype.h on those platforms.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
11 years agomesa: remove array size so the static assert can work
Brian Paul [Sat, 27 Oct 2012 15:13:03 +0000 (09:13 -0600)]
mesa: remove array size so the static assert can work

With the explit NUM_TEXTURE_TARGETS array size, the assertion that
Elements(targets) == NUM_TEXTURE_TARGETS would pass even if elements
were missing.

Reviewed-by: Eric Anholt <eric@anholt.net>
11 years agomesa: use GLuint for more gl_constants fields
Brian Paul [Sat, 27 Oct 2012 14:58:19 +0000 (08:58 -0600)]
mesa: use GLuint for more gl_constants fields

To silence assorted MSVC warnings.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
11 years agovbo: silence MSVC double/float conversion warnings
Brian Paul [Sat, 27 Oct 2012 14:58:19 +0000 (08:58 -0600)]
vbo: silence MSVC double/float conversion warnings

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
11 years agomesa: silence some MSVC conversion warnings in get.c
Brian Paul [Sat, 27 Oct 2012 14:58:19 +0000 (08:58 -0600)]
mesa: silence some MSVC conversion warnings in get.c

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
11 years agomesa: silence MSVC signed/unsigned comparision warnings in hash_table.c
Brian Paul [Sat, 27 Oct 2012 14:58:19 +0000 (08:58 -0600)]
mesa: silence MSVC signed/unsigned comparision warnings in hash_table.c

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
11 years agomesa: silence MSVC signed/unsigned comparision warnings in transformfeedback.c
Brian Paul [Sat, 27 Oct 2012 14:58:19 +0000 (08:58 -0600)]
mesa: silence MSVC signed/unsigned comparision warnings in transformfeedback.c

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
11 years agomesa: silence MSVC signed/unsigned comparision warnings in accum.c
Brian Paul [Sat, 27 Oct 2012 14:58:19 +0000 (08:58 -0600)]
mesa: silence MSVC signed/unsigned comparision warnings in accum.c

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
11 years agomesa: silence MSVC signed/unsigned comparison warning in texstorage.c
Brian Paul [Sat, 27 Oct 2012 14:58:19 +0000 (08:58 -0600)]
mesa: silence MSVC signed/unsigned comparison warning in texstorage.c

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
11 years agomesa: silence MSVC double/float assignment warnings in pixel unpack code
Brian Paul [Sat, 27 Oct 2012 14:58:19 +0000 (08:58 -0600)]
mesa: silence MSVC double/float assignment warnings in pixel unpack code

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
11 years agor600g: tgsi-to-llvm emits right input intrinsics
Vincent Lejeune [Fri, 19 Oct 2012 13:49:06 +0000 (15:49 +0200)]
r600g: tgsi-to-llvm emits right input intrinsics

Reviewed-by: Tom Stellard <thomas.stellard at amd.com>
11 years agointel: support for 16 bit config with 24 depth and 8 stencil
Tapani Pälli [Mon, 29 Oct 2012 18:56:28 +0000 (11:56 -0700)]
intel: support for 16 bit config with 24 depth and 8 stencil

Patch adds additional singlesample config with 565 color buffer,
24 bit depth and 8 bit stencil buffer. This makes Quadrant benchmark
work on Android. Tested with Sandybridge and Ivybridge machines.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
11 years agodri: Support MESA_FORMAT_SARGB8 in driCreateConfigs
Ian Romanick [Thu, 12 Jul 2012 21:01:23 +0000 (14:01 -0700)]
dri: Support MESA_FORMAT_SARGB8 in driCreateConfigs

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
11 years agointel: If the visual is sRGB, use an sRGB internal format
Ian Romanick [Thu, 12 Jul 2012 20:55:56 +0000 (13:55 -0700)]
intel: If the visual is sRGB, use an sRGB internal format

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
11 years agodri: Convert driCreateConfigs to use a gl_format enum
Ian Romanick [Thu, 12 Jul 2012 20:52:06 +0000 (13:52 -0700)]
dri: Convert driCreateConfigs to use a gl_format enum

This is instead of the pair of GLenums for format and type that were
previously used.  This is necessary for the Intel drivers to expose sRGB
framebuffer formats.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
11 years agodri_util: Elminiate the bytes_per_pixel table
Ian Romanick [Thu, 12 Jul 2012 18:48:53 +0000 (11:48 -0700)]
dri_util: Elminiate the bytes_per_pixel table

With fewer formats to support, it's kind of useless.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
11 years agodri_util: Remove support for RGB332 framebuffers
Ian Romanick [Thu, 12 Jul 2012 18:42:54 +0000 (11:42 -0700)]
dri_util: Remove support for RGB332 framebuffers

None of the remaining DRI drivers in Mesa use this.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
11 years agoswrast: Remove the 2_3_3_REV framebuffer format
Ian Romanick [Thu, 12 Jul 2012 20:49:59 +0000 (13:49 -0700)]
swrast: Remove the 2_3_3_REV framebuffer format

There is no gl_format in Mesa that corresponds to this arrangement, so I
have a very hard time believing that this works.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
11 years agoglx: Add the extension string for GLX_ARB_framebuffer_sRGB
Ian Romanick [Thu, 12 Jul 2012 21:07:14 +0000 (14:07 -0700)]
glx: Add the extension string for GLX_ARB_framebuffer_sRGB

From the GLX perspective, the ARB and EXT extensions are identical.  Use
a single bit for both.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: Maciej Wieczorek <maciej.t.wieczorek@intel.com>
11 years agoglx: Set sRGBCapable to a default value
Ian Romanick [Thu, 12 Jul 2012 20:56:32 +0000 (13:56 -0700)]
glx: Set sRGBCapable to a default value

Previously, if the server didn't send a GLX_FRAMEBUFFER_SRGB_CAPABLE_EXT
tag, it would still be set to GLX_DONT_CARE (which is -1).  Set it to
GL_FALSE instead.

NOTE: This is a candidate for stable release branches.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: Maciej Wieczorek <maciej.t.wieczorek@intel.com>
11 years agoglsl_to_tgsi: set correct register type for array and structure elements
Bryan Cain [Tue, 23 Oct 2012 16:58:40 +0000 (11:58 -0500)]
glsl_to_tgsi: set correct register type for array and structure elements

This fixes an issue where glsl_to_tgsi_visior::get_opcode() would emit the
wrong opcode because the register type was GLSL_TYPE_ARRAY/STRUCT instead of
GLSL_TYPE_FLOAT/INT/UINT/BOOL, so the function would use the float opcodes for
operations on integer or boolean values dereferenced from an array or
structure.  Assertions have been added to get_opcode() to prevent this bug
from reappearing in the future.

NOTE: This is a candidate for the stable branches.

Reviewed-by: Brian Paul <brianp@vmware.com>
Tested-by: Andreas Boll <andreas.boll.dev@gmail.com>
11 years agor600g: implement texturing with 8x MSAA compressed surfaces for Evergreen
Marek Olšák [Fri, 12 Oct 2012 16:46:32 +0000 (18:46 +0200)]
r600g: implement texturing with 8x MSAA compressed surfaces for Evergreen

The 2x and 4x MSAA cases are completely broken. The lfdptr instruction returns
garbage there.

The 8x MSAA case is broken on Cayman, though at least the result looks somewhat
correct.

Only the 8x MSAA case works on Evergreen and is enabled.

11 years agomesa: bump MAX_VARYING to 32
Marek Olšák [Fri, 26 Oct 2012 15:37:07 +0000 (17:37 +0200)]
mesa: bump MAX_VARYING to 32

We're starting to get apps utilizing more than 16 varyings and
most current hardware supports 32 anyway.

Tested with r600g.
swrast, softpipe and llvmpipe still advertise 16 varyings.

This fixes a WebGL crash after launching this demo:
https://developer.mozilla.org/en-US/demos/detail/falling-cubes

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

NOTE: This is a candidate for the stable branches.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
11 years agoRevert "glsl_to_tgsi: set correct register type for array and structure elements"
Andreas Boll [Mon, 29 Oct 2012 11:21:07 +0000 (12:21 +0100)]
Revert "glsl_to_tgsi: set correct register type for array and structure elements"

This reverts commit ebd8df7a3152e34805e2863c8471ee1a2de38fe1.

accidentally pushed.

11 years agoscons: Add -fno-rtti to CXXFLAGS with llvm-3.2.
Vinson Lee [Sat, 27 Oct 2012 20:10:28 +0000 (13:10 -0700)]
scons: Add -fno-rtti to CXXFLAGS with llvm-3.2.

llvm-3.2svn r166772 no longer requires RTTI for lib/Support.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
11 years agonv50/ir: restore use of long immediate encodings
Christoph Bumiller [Thu, 25 Oct 2012 12:32:29 +0000 (14:32 +0200)]
nv50/ir: restore use of long immediate encodings

NOTE: This is a candidate for the 9.0 branch.

11 years agonv50,nvc0: fix 2d engine stencil-only copies
Christoph Bumiller [Thu, 25 Oct 2012 12:11:17 +0000 (14:11 +0200)]
nv50,nvc0: fix 2d engine stencil-only copies

11 years agogallium/gallivm: code generation options for LLVM 3.1+
Alexander V. Nikolaev [Sun, 23 Sep 2012 02:28:39 +0000 (05:28 +0300)]
gallium/gallivm: code generation options for LLVM 3.1+

LLVM 3.1+ haven't more "extern unsigned llvm::StackAlignmentOverride"
and friends for configuring code generation options, like stack
alignment.

So I restrict assiging of lvm::StackAlignmentOverride and other
variables to LLVM 3.0 only, and wrote similiar code using
TargetOptions.

This patch fix segfaulting of WINE using llvmpipe built with LLVM 3.1

Signed-off-by: Alexander V. Nikolaev <avn@daemon.hole.ru>
Signed-off-by: José Fonseca <jose.r.fonseca@gmail.com>
11 years agoi965: Merge brw_prepare_query_begin() and brw_emit_query_begin().
Eric Anholt [Thu, 18 Oct 2012 00:48:05 +0000 (17:48 -0700)]
i965: Merge brw_prepare_query_begin() and brw_emit_query_begin().

This is a leftover from when we had to split those two functions due to
the separate BO validation step.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
11 years agoi965: Rename misleading "active" field of brw->query.
Eric Anholt [Thu, 18 Oct 2012 00:45:46 +0000 (17:45 -0700)]
i965: Rename misleading "active" field of brw->query.

"Active" is an already-used term for the query being between
glBeginQuery() and glEndQuery(), while this is tracking whether the
start of the packet pair for emitting state has been inserted into the
current batchbuffer.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
11 years agor600g: advertise 32 streamout vec4 outputs
Marek Olšák [Fri, 26 Oct 2012 16:41:49 +0000 (18:41 +0200)]
r600g: advertise 32 streamout vec4 outputs

to match the varying limit.

11 years agosoftpipe: remove extraneous whitespace
Brian Paul [Tue, 23 Oct 2012 22:00:20 +0000 (16:00 -0600)]
softpipe: remove extraneous whitespace

11 years agogallivm/llvmpipe: fix 64-bit %ll format compiler warnings for mingw32
Brian Paul [Tue, 23 Oct 2012 21:54:11 +0000 (15:54 -0600)]
gallivm/llvmpipe: fix 64-bit %ll format compiler warnings for mingw32

Use the PRIx64 and PRIu64 format macros from inttypes.h.  We made a
similar change in prog_print.c in df2d81ea59993a77bd1f1ef96c5cf19ac692d5f7.

11 years agor600g: advertise 32 fragment shaders inputs, not 34
Marek Olšák [Fri, 26 Oct 2012 15:35:32 +0000 (17:35 +0200)]
r600g: advertise 32 fragment shaders inputs, not 34

11 years agograw/fs-test: Use user constant buffers.
José Fonseca [Fri, 26 Oct 2012 14:12:31 +0000 (15:12 +0100)]
graw/fs-test: Use user constant buffers.

Much simpler. More interesting.

11 years agotrace: Flush before drawing.
José Fonseca [Fri, 26 Oct 2012 14:05:14 +0000 (15:05 +0100)]
trace: Flush before drawing.

11 years agograw: Ensure new members are zeroed.
José Fonseca [Fri, 26 Oct 2012 14:04:46 +0000 (15:04 +0100)]
graw: Ensure new members are zeroed.

Several new state members were added, and they were not being zeroed,
causing random crashes.

11 years agotests/graw: Update occlusion query example.
José Fonseca [Fri, 26 Oct 2012 13:39:46 +0000 (14:39 +0100)]
tests/graw: Update occlusion query example.

11 years agoradeonsi: Handle TGSI_SEMANTIC_FACE.
Michel Dänzer [Tue, 25 Sep 2012 10:41:31 +0000 (12:41 +0200)]
radeonsi: Handle TGSI_SEMANTIC_FACE.

Fixes two piglit tests using gl_FrontFacing.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
11 years agoradeonsi: Handle TGSI_SEMANTIC_BCOLOR.
Michel Dänzer [Thu, 6 Sep 2012 16:03:38 +0000 (18:03 +0200)]
radeonsi: Handle TGSI_SEMANTIC_BCOLOR.

Put the back face colour right after the front face colour in the LDS parameter
space.

Fixes 18 piglit tests related to two sided lighting.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
11 years agoradeonsi: Don't snoop context state while building shaders.
Michel Dänzer [Fri, 5 Oct 2012 14:59:10 +0000 (16:59 +0200)]
radeonsi: Don't snoop context state while building shaders.

Let's use the shader key describing the state.

Ported from r600g commit b6521801070d52bdd5908824e82c1ce2dde16e8e.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
11 years agoradeon/llvm: Add intrinsic for reading SI FRONT_FACE VGPR in the pixel shader.
Michel Dänzer [Tue, 25 Sep 2012 10:40:49 +0000 (12:40 +0200)]
radeon/llvm: Add intrinsic for reading SI FRONT_FACE VGPR in the pixel shader.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
11 years agor600g: split cayman common state out into a shared function
Alex Deucher [Tue, 23 Oct 2012 16:24:45 +0000 (12:24 -0400)]
r600g: split cayman common state out into a shared function

And use it for compute.  This should improve compute support
on cayman.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
11 years agor600g: emit some additional regs on cayman
Alex Deucher [Tue, 23 Oct 2012 16:12:34 +0000 (12:12 -0400)]
r600g: emit some additional regs on cayman

These are common to both evergreen and cayman, but were
not emitted on cayman.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
11 years agor600g: there are 16 const buffer size regs for each shader stage
Alex Deucher [Tue, 23 Oct 2012 15:58:54 +0000 (11:58 -0400)]
r600g: there are 16 const buffer size regs for each shader stage

we were previously only setting 8 of them.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
11 years agor600g: rework evergreen_init_common_regs()
Alex Deucher [Tue, 23 Oct 2012 15:53:43 +0000 (11:53 -0400)]
r600g: rework evergreen_init_common_regs()

Move gfx specific bits out as the code is shared with
compute.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
11 years agor600g/compute: always CONTEXT_CONTROL packet at start of CS
Alex Deucher [Tue, 23 Oct 2012 15:30:31 +0000 (11:30 -0400)]
r600g/compute: always CONTEXT_CONTROL packet at start of CS

It's required.  The CP uses this to properly allocate new
contexts.  Also do a CS partial flush since we are updating
CONFIG regs which are single state.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
11 years agotools/trace: More helpful message when no args are provided.
José Fonseca [Fri, 26 Oct 2012 08:46:29 +0000 (09:46 +0100)]
tools/trace: More helpful message when no args are provided.

11 years agoscons: Build xlib swrast too.
José Fonseca [Fri, 26 Oct 2012 08:45:59 +0000 (09:45 +0100)]
scons: Build xlib swrast too.

Helpful for debugging.

11 years agovl: fix the dri winsys helper screen init
Christian König [Wed, 24 Oct 2012 09:18:40 +0000 (11:18 +0200)]
vl: fix the dri winsys helper screen init

Signed-off-by: Christian König <deathsimple@vodafone.de>
11 years agotests: Use printf instead of debug_printf in u_format_compatible_test.
Vinson Lee [Thu, 25 Oct 2012 06:25:08 +0000 (23:25 -0700)]
tests: Use printf instead of debug_printf in u_format_compatible_test.

Use printf instead of debug_printf to be consistent with print
statements in rest of unit tests.

This also fixes the lack of print output with the MinGW build of
u_format_compatible_test.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
11 years agor300g: fix texture border color for sRGB formats
Marek Olšák [Thu, 25 Oct 2012 23:03:53 +0000 (01:03 +0200)]
r300g: fix texture border color for sRGB formats

NOTE: This is a candidate for the stable branches.

11 years agoglsl: Allow ir_if in the linker's move_non_declarations function.
Kenneth Graunke [Wed, 24 Oct 2012 20:17:24 +0000 (13:17 -0700)]
glsl: Allow ir_if in the linker's move_non_declarations function.

Global initializers using the ?: operator with at least one non-constant
operand generate ir_if statements.  For example,

   float foo = some_boolean ? 0.0 : 1.0;

becomes:

   (declare (temporary) float conditional_tmp)
   (if (var_ref some_boolean)
       ((assign (x) (var_ref conditional_tmp) (constant float (0.0))))
       ((assign (x) (var_ref conditional_tmp) (constant float (1.0)))))

This pattern is necessary because the second or third arguments could be
function calls, which create statements (not expressions).

The linker moves these global initializers into the main() function.
However, it incorrectly had an assertion that global initializer
statements were only assignments, calls, or temporary variable
declarations.  As demonstrated above, they can be if statements too.

Other than the assertion, everything works fine.  So remove it.

Fixes new Piglit test condition-08.vert, as well as an upcoming
game that will be released on Steam.

NOTE: This is a candidate for stable release branches.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
11 years agoi965/vs: Preserve the type when copy propagating into an instruction.
Kenneth Graunke [Thu, 25 Oct 2012 09:29:15 +0000 (02:29 -0700)]
i965/vs: Preserve the type when copy propagating into an instruction.

Consider the following code, which reinterprets a register as a
different type:

mov(8)          g6<1>F          g1.4<0,4,1>.xF
and(8)          g5<1>.xUD       g6<4,4,1>.xUD   0x7fffffffUD

Copy propagation would notice that we can replace the use of g6 with
g1.4 and eliminate the MOV.  Unfortunately, it failed to preserve the UD
type, incorrectly generating:

and(8)          g5<1>.xUD       g6<4,4,1>.xF    0x7fffffffUD

Found while debugging Ian's uncommitted ARB_vertex_program LOG opcode
test with my new Mesa IR -> Vec4 IR translator.

NOTE: This is a candidate for stable release branches.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
11 years agoi965/vs: Don't lose the MRF writemask when doing compute-to-MRF.
Kenneth Graunke [Thu, 25 Oct 2012 04:16:46 +0000 (21:16 -0700)]
i965/vs: Don't lose the MRF writemask when doing compute-to-MRF.

Consider the following code sequence:

   mul(8)          g4<1>F          g1<0,4,1>.wzwwF g3<4,4,1>.wzwwF
   mov.sat(8)      m1<1>.xyF       g4<4,4,1>F
   mul(8)          g4<1>F          g1<0,4,1>.xxyxF g3<4,4,1>.xxyxF
   mov.sat(8)      m1<1>.zwF       g4<4,4,1>F

The compute-to-MRF pass will discover the first mov.sat and attempt to
replace it by rewriting earlier instructions.  Everything works out,
so it replaces scan_inst's destination file, reg, and reg_offset,
resulting in:

   mul(8)          m1<1>F          g1<0,4,1>.wzwwF g3<4,4,1>.wzwwF
   mul(8)          g4<1>F          g1<0,4,1>.xxyxF g3<4,4,1>.xxyxF
   mov.sat(8)      m1<1>.zwF       g4<4,4,1>F

Unfortunately, it loses the .xy writemask on the mov.sat's MRF
destination.  While this doesn't pose an immediate problem, it then
proceeds to transform the second mov.sat, resulting in:

   mul(8)          m1<1>F          g1<0,4,1>.wzwwF g3<4,4,1>.wzwwF
   mul(8)          m1<1>F          g1<0,4,1>.xxyxF g3<4,4,1>.xxyxF

Instead of writing both halves of the vector (like the original code),
it overwrites the full vector both times, clobbering the desired .xy
values.

When encountering a MOV, the compute-to-MRF code scans for instructions
which generate channels of the MOV source.  It ensures that all
necessary channels are available (possibly written by several
instructions).  In this case, *more* channels are available than
necessary, so we want to take the subset that's actually used.
Taking the bitwise and of both writemasks should accomplish that.

This was discovered by analyzing an ARB_vertex_program test
(glean/vertProg1/MUL test (with swizzle and masking)) with my new
Mesa IR -> Vec4 IR translator code.  However, it should be possible
with GLSL programs as well.

NOTE: This is a candidate for stable release branches.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
11 years agoglcpp: Don't use infinite lookhead for #define differentiation.
Kenneth Graunke [Mon, 22 Oct 2012 17:56:46 +0000 (10:56 -0700)]
glcpp: Don't use infinite lookhead for #define differentiation.

Previously, we used lookahead patterns to differentiate:

   #define FOO(x)  function macro
   #define FOO (x) object macro

Unfortunately, our rule for function macros:

   {HASH}define{HSPACE}+/{IDENTIFIER}"("

relies on infinite lookahead, and apparently triggers a Flex bug where
the generated code overflows a state buffer (see YY_STATE_BUF_SIZE).

There's no need to use infinite lookahead.  We can simply change state,
match the identifier, and use a single character lookahead for the '('.
This apparently makes Flex not generate the giant state array, which
avoids the buffer overflow, and should be more efficient anyway.

Fixes piglit test 17000-consecutive-chars-identifier.frag.

NOTE: This is a candidate for every release branch ever.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Carl Worth <cworth@cworth.org>