Commit Graph

53632 Commits

Author SHA1 Message Date
Kenneth Graunke fd8655aa7a i965/vs: Add support for emitting DPH opcodes.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-11-01 14:29:19 -07:00
Kenneth Graunke 6bc021bc78 i965/vs: Only do INTEL_DEBUG=perf when there's a GLSL shader.
This will become necessary once we start supporting ARB programs and
fixed function in this backend.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-11-01 14:29:12 -07:00
Paul Berry a8ab7e335d dispatch: stop generating separate GLES1 API code.
This patch removes the generated files api_exec_es1.c,
api_exec_es1_dispatch.h, and api_exec_es1_remap_helper.h (and the
source files and build rules used to generate them), since they are no
longer used.  GLES1 now uses the same dispatch table layout as all the
other APIs.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-11-01 11:26:30 -07:00
Paul Berry 8386088e3d dispatch: stop using _mesa_create_exec_table_es1() for GLES1.
This patch modifies context creation code for GLES1 to use
_mesa_create_exec_table() (which is used for all other APIs) instead
of the GLES1-specific _mesa_create_exec_table_es1().

There is a slight change in functionality.  As a result of a mistake
in the code generation of _mesa_create_exec_table_es1(), it does not
include glFlushMappedBufferRangeEXT or glMapBufferRangeEXT (this is
because when support for those two functions was added in commit
762d9ac, src/mesa/main/APIspec.xml wasn't updated).  With this patch,
glFlushMappedBufferRangeEXT and glMapBufferRangeEXT are properly
included in the dispatch table.  Accordingly, dispatch_sanity.cpp is
modified to expect these two functions to be present.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>

v2: Leave GLES1.1 dispatch sanity test disabled when not building
GLES1 support.
2012-11-01 11:26:07 -07:00
Paul Berry a21116f87e 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>
2012-11-01 11:25:27 -07:00
Paul Berry 5a1b40acf5 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>
2012-11-01 11:25:14 -07:00
Paul Berry b60244cfb9 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).
2012-11-01 11:24:57 -07:00
Paul Berry dd3218d73b 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>
2012-11-01 11:23:22 -07:00
Paul Berry 571d5c353a 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>
2012-11-01 11:22:49 -07:00
Paul Berry 33e0004720 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>
2012-11-01 11:22:24 -07:00
Paul Berry 47deaf6175 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>
2012-11-01 11:22:09 -07:00
Eric Anholt 56f8ed4c35 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>
2012-11-01 09:22:09 -07:00
Kenneth Graunke b57d2dfbf6 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>
2012-10-31 19:54:36 -07:00
Kenneth Graunke 369419e847 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>
2012-10-31 19:54:36 -07:00
Kenneth Graunke 3d2b4291c2 i965: Don't bother trying to extend the current vertex buffers.
This essentially reverts the following:

  commit c625aa19cb
  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>
2012-10-31 19:54:36 -07:00
Marek Olšák 1eedebc65b 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.
2012-11-01 03:17:58 +01:00
Marek Olšák fa58644855 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>
2012-11-01 03:17:58 +01:00
Marek Olšák 4cf6acc3d0 gallium/u_vbuf: document how it works 2012-11-01 03:17:58 +01:00
Marek Olšák 46b0893fb9 gallium/u_vbuf: optimize looping over the list of buffers to upload 2012-11-01 03:17:58 +01:00
Marek Olšák a97b053fdd gallium/u_vbuf: skip processing of buffers unused by the vertex element state 2012-11-01 03:17:58 +01:00
Brian Paul fc2cf14038 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>
2012-10-31 13:37:11 -06:00
José Fonseca f69fc36127 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>
2012-10-31 16:50:40 +00:00
Jerome Glisse 470952f751 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>
2012-10-31 10:49:15 -04:00
Marek Olšák 183e122bdf draw: fix assertion failure in draw_emit_vertex_attr
This is a regression since b3921e1f53.

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>
2012-10-31 02:06:11 +01:00
Marek Olšák 91107a3522 r600g: use SQ_VTX_SEMANTIC_CLEAR to clear the semantic registers
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-10-31 02:06:11 +01:00
Marek Olšák d6600f9d39 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>
2012-10-31 02:05:12 +01:00
Marek Olšák b8380e54b8 mesa: remove SGIS_texture_lod extension enable flag
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-31 02:05:11 +01:00
Marek Olšák 01f0bedc2d mesa: remove NV_texgen_reflection extension enable flag
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-31 02:04:54 +01:00
Marek Olšák 7857dbeb17 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>
2012-10-31 02:04:54 +01:00
Marek Olšák cc07149276 mesa: remove IBM_rasterpos_clip extension enable flag
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-31 02:04:54 +01:00
Marek Olšák f5543d6eb2 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>
2012-10-31 02:04:54 +01:00
Marek Olšák 271b6aeccd mesa: remove APPLE_packed_pixels extension enable flag
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-31 02:04:54 +01:00
Marek Olšák 55bf57dbb4 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>
2012-10-31 02:04:54 +01:00
Marek Olšák b6f5c37ac3 mesa: move EXT_texture3D enabling to _mesa_init_extensions 2012-10-31 02:04:16 +01:00
Marek Olšák 2266b1df23 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>
2012-10-31 01:58:26 +01:00
Marek Olšák 39a0223a87 mesa: remove EXT_rescale_normal extension enable flag
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-31 01:58:23 +01:00
Marek Olšák 6f5fc612f3 mesa: remove EXT_packed_pixels extension enable flag
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-31 01:58:21 +01:00
Marek Olšák 57b00c85b1 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>
2012-10-31 01:58:19 +01:00
Marek Olšák cf9acc3833 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>
2012-10-31 01:58:17 +01:00
Marek Olšák 1301f91b31 mesa: remove ARB_window_pos extension enable flag
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-31 01:58:15 +01:00
Marek Olšák d012e6d8fe mesa: remove ARB_transpose_matrix extension enable flag
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-31 01:58:12 +01:00
Marek Olšák 3bba7c5ab4 mesa: remove ARB_copy_buffer extension enable flag
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-31 01:57:25 +01:00
Marek Olšák c9f2af3df7 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
2012-10-31 01:53:50 +01:00
Marek Olšák f2f782d50f mesa: implement ARB_map_buffer_alignment
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-10-31 01:48:40 +01:00
Marek Olšák 0ebd0b78c6 st/mesa: don't use _NEW_PROGRAM where ST_NEW_xxx_PROGRAM is sufficient
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-10-31 01:44:58 +01:00
Marek Olšák c0c26ddaef 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.
2012-10-31 00:55:23 +01:00
Marek Olšák e73bf3b805 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>
2012-10-31 00:55:13 +01:00
Marvin Schmidt a7c5be098a 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>
2012-10-30 11:36:31 +01:00
Vinson Lee 0a66ced8f8 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>
2012-10-29 22:25:56 -07:00
Brian Paul aab0ea9352 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>
2012-10-29 17:56:05 -06:00