Commit Graph

53193 Commits

Author SHA1 Message Date
Imre Deak d220435416 mesa: glGet: use the build time generated hash tables
Signed-off-by: Imre Deak <imre.deak@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
2012-10-10 12:43:23 +03:00
Imre Deak 98f880e0c4 mesa: glGet: add script to generate hash tables in build time
This will be needed by the next patch, which will switch to using
the parameter descriptor- and hash tables generated by the script.

The hash algorithm remains the same, the output parameter descriptor
table format changes slightly. There the TYPE_API_MASK entries are
removed and an invalid NULL entry is inserted at the beginning. This is
ok, as get.c:find_value() doesn't rely on TYPE_API_MASK any more to
detect an invalid enum.

Signed-off-by: Imre Deak <imre.deak@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
2012-10-10 12:43:19 +03:00
Imre Deak 6678125eae scons/android: add flag to check for enabled GL APIs
Needed by the next patch.

Signed-off-by: Imre Deak <imre.deak@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
2012-10-10 12:43:16 +03:00
Imre Deak ea637c5b64 mesa: glGet: rename *{_EXT,_ARB} enums missing from the XML spec
The following enums used to be extensions but later became part of the
core specification. The _EXT/_ARB versions of these are not present in
in the current XML spec files, only defined in GL/glext.h

Later we'll need to look up these in a python script using the XML spec.
As a preparation for that remove the _EXT,_ARB suffix from these enums
and rename GL_DISTANCE_ATTENUATION_EXT to GL_POINT_DISTANCE_ATTENUATION.
Naturally, all enums keep their numerical values.

Note that similar renames shouldn't be necessary in the future: in case
of a new extension the XML spec is updated with the new _EXT/_ARB etc.
name and this name is added to the enum table in get.c.  Later the
extension may become part of the core spec, at which point the name w/o
the _EXT/_ARB suffix is added to the XML spec and the table in get.c
remains the same.

GL_BLEND_DST_ALPHA_EXT
GL_BLEND_DST_RGB_EXT
GL_BLEND_SRC_ALPHA_EXT
GL_BLEND_SRC_RGB_EXT
GL_COLOR_SUM_EXT
GL_COMPRESSED_TEXTURE_FORMATS_ARB
GL_CURRENT_FOG_COORDINATE_EXT
GL_CURRENT_SECONDARY_COLOR_EXT
GL_DISTANCE_ATTENUATION_EXT
GL_FOG_COORDINATE_ARRAY_EXT
GL_FOG_COORDINATE_ARRAY_STRIDE_EXT
GL_FOG_COORDINATE_ARRAY_TYPE_EXT
GL_FOG_COORDINATE_SOURCE_EXT
GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB
GL_PACK_IMAGE_HEIGHT_EXT
GL_PACK_SKIP_IMAGES_EXT
GL_SECONDARY_COLOR_ARRAY_EXT
GL_SECONDARY_COLOR_ARRAY_SIZE_EXT
GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT
GL_SECONDARY_COLOR_ARRAY_TYPE_EXT
GL_UNPACK_IMAGE_HEIGHT_EXT
GL_UNPACK_SKIP_IMAGES_EXT

Signed-off-by: Imre Deak <imre.deak@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
2012-10-10 12:43:11 +03:00
Imre Deak 59d3bf6542 mesa: glGet: simplify the 'enum not found' condition
When traversing the hash table looking up an enum that is invalid we
eventually reach the first element in the descriptor array. By looking
at the type of that element, which is always TYPE_API_MASK, we know that
we can stop the search and return error. Since this element is always
the first it's enough to check for its index being 0 without looking at
its type.

Later in this patchset, when we generate the hash tables during build
time, this will allow us to remove the TYPE_API_MASK and related flags
completly.

Signed-off-by: Imre Deak <imre.deak@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
2012-10-10 12:43:08 +03:00
Imre Deak 2ad4a47547 mesa: glGet: fix parameter lookup for apps using multiple APIs
The glGet hash was initialized only once for a single GL API, even if
the application later created a context for a different API. This
resulted in glGet failing for otherwise valid parameters in a context
if that parameter was invalid in another context created earlier.

Fix this by using a separate hash table for each API.

Signed-off-by: Imre Deak <imre.deak@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
2012-10-10 12:43:05 +03:00
Imre Deak 7182a1fc5e glapi: rename/move GL_POLYGON_OFFSET_BIAS to its extension section
This should be named GL_POLYGON_OFFSET_BIAS_EXT and listed under the
EXT_polygon_offset section. (Solution by Ian Romanick)

Signed-off-by: Imre Deak <imre.deak@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
2012-10-10 12:42:42 +03:00
Marek Olšák 87a34131c4 r600g: move SQ_GPR_RESOURCE_MGMT_1 into new config_state
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
2012-10-10 00:17:07 +02:00
Marek Olšák c5584e93b1 r600g: move DB_SHADER_CONTROL into db_misc_state
Also update the register value in more appropriate places
than r600_update_derived_state.

Reviewed-by: Jerome Glisse <jglisse@redhat.com>
2012-10-10 00:17:05 +02:00
Marek Olšák ae25b93245 r600g: emit PS_PARTIAL_FLUSH at the beginning of CS
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
2012-10-10 00:17:03 +02:00
Marek Olšák ef723613e0 r600g: atomize depth-stencil-alpha state
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
2012-10-10 00:17:01 +02:00
Marek Olšák 711f3bae9d r600g: atomize rasterizer state
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
2012-10-10 00:16:58 +02:00
Marek Olšák 9a683d1bd8 r600g: sort variables in r600_context
Some variables have been removed from there too.

Reviewed-by: Jerome Glisse <jglisse@redhat.com>
2012-10-10 00:16:55 +02:00
Marek Olšák 30bcc5538f r600g: initialize SQ_VTX_SEMANTIC_* in the start_cs command buffer
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
2012-10-10 00:16:49 +02:00
Marek Olšák 18a189188a r600g: atomize scissor state
The workaround for R600 lacking VPORT_SCISSOR_ENABLE has also been simplified.

Reviewed-by: Jerome Glisse <jglisse@redhat.com>
2012-10-10 00:16:45 +02:00
Marek Olšák ab075de53b r600g: atomize polygon offset state
POLY_OFFSET_DB_FMT_CNTL is moved to the framebuffer state, because it only
depends on the zbuffer format.

Reviewed-by: Jerome Glisse <jglisse@redhat.com>
2012-10-10 00:16:42 +02:00
Marek Olšák a50edc8ed8 r600g: atomize fetch shader
The state object is actually a buffer, it's literally a buffer containing
the shader code.

Reviewed-by: Jerome Glisse <jglisse@redhat.com>
2012-10-10 00:16:38 +02:00
Marek Olšák 8bf7044ec6 r600g: remove the dual_src_blend flag from the shader key
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
2012-10-10 00:16:35 +02:00
Marek Olšák faaba52aed r600g: atomize blend state
This is not so trivial, because we disable blending if the dual src
blending is turned on and the number of color outputs is less than 2.
I decided to create 2 command buffers in the blend state object and just
switch between them when needed, because there are other states unrelated
to blending (like the color mask) and those shouldn't be changed
(the old code had it wrong).

Reviewed-by: Jerome Glisse <jglisse@redhat.com>
2012-10-10 00:16:32 +02:00
Marek Olšák eb65fefa4b r600g: inline r600_atom_dirty
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
2012-10-10 00:16:28 +02:00
Marek Olšák d8ea64697b r600g: remove the "atom" variable from r600_command_buffer
r600_command_buffer is not an atom.

The "atoms" have evolved into state slots (or groups of state slots) where
you can bind states. There is a fixed amount of atoms (state slots)
in the context.

The command buffers are nothing like that. They represent states, not state
slots.

We could probably give r600_atom a better name someday.

Reviewed-by: Jerome Glisse <jglisse@redhat.com>
2012-10-10 00:16:25 +02:00
Eric Anholt 1e7776ca2b egl: Remove bogus invalidate code.
The invalidate event support is a careful dance between driver and loader,
where both have to say they can handle it, and then the loader reports
invalidate events for the driver so the driver can do the optimization.

The EGL code doesn't report __DRIuseInvalidateExtension to the driver, so it
has no responsibility to call the driver's invalidate function, and the driver
is doing the glViewport hack because it assume.  This is not
the only time invalidate would need to be called (we need it *any* time an
invalidate event comes down the pipe, but we don't watch for them), so just
stop calling the driver's function.

Acked-by: Chad Versace <chad.versace@linux.intel.com>
2012-10-09 14:32:04 -07:00
Eric Anholt 7e9bd2b2ed egl: Add support for driconf control of swapinterval.
This behavior mostly matches glx_dri2.  It's slightly complicated in
comparison because EGL exposes the implementation limits in the EGL config.

Note that platform_x11 was the only one setting swap_available, so the move of
the MaxSwapInterval into it is appropriate.

Acked-by: Chad Versace <chad.versace@linux.intel.com>
2012-10-09 14:32:03 -07:00
Eric Anholt 8c472b8f6a glx: Replace DRI2SwapBuffers() custom protocol with XCB.
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-10-09 14:32:03 -07:00
Eric Anholt f02242a4fa glx: Fix some indentation.
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-10-09 14:32:03 -07:00
Eric Anholt 811602885b glx: Replace DRI2SwapInterval custom protocol with XCB.
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-10-09 14:32:03 -07:00
Eric Anholt 7acf8ae0e1 glx: Reuse setSwapInterval for setting initial swap interval. 2012-10-09 14:32:03 -07:00
Eric Anholt d0937759db glx: Allow glXSwapInterval(0) when vblank_mode=0.
There's no reason to say no in this case.
2012-10-09 14:32:03 -07:00
Eric Anholt ab8ae9301f glx: Replace DRI2GetMSC custom protocol with XCB.
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-10-09 14:32:03 -07:00
Eric Anholt 8e61b9028a glx: Replace DRI2WaitForMSC custom protocol with XCB.
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-10-09 14:32:03 -07:00
Eric Anholt 183ab9e14e glx: Replace DRI2WaitForSBC custom protocol with XCB.
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-10-09 14:32:03 -07:00
Eric Anholt 1e74910bb7 glx/dri1: Remove uncompiled __DRI_SWAP_BUFFER_COUNTER code.
It's been in place but never enabled since 2010.  Note how one piece called a
DRI2 function, suggesting never being tested.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-10-09 14:32:02 -07:00
Eric Anholt da3f7c127b egl: Quit checking for a bug in old xcb when we require new xcb.
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-10-09 14:32:02 -07:00
Eric Anholt b477384f40 egl: Drop xcb ifdefs by just requiring a version from this year.
glx and gallium's xcb_dri2 usage already require this version, so this is
nothing really new.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-10-09 14:32:02 -07:00
Eric Anholt b49cd8495f egl: Unifdef dri_interface.h defines.
dri_interface.h comes from our tree, so why litter our tree with ifdefs for
older versions of it?

Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-10-09 14:32:02 -07:00
Eric Anholt c35a9388a3 glx: Unifdef some dri_interface.h defines.
dri_interface.h comes from our tree, so why litter our tree with ifdefs for
older versions of it?

I left in the DRI_TEX_BUFFER_VERSION ifdefs, which is broken and uncompiled
(the version wasn't bumped from 2 to 3 when the patch was landed), but I don't
know what should be done with it.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-10-09 14:32:02 -07:00
Eric Anholt bb01f671bb glx: Require xcb_dri2 for building glxdri2.c.
I'm going to transition a bunch of the protocol to using XCB so we can stop
rolling it ourselves.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-10-09 14:32:02 -07:00
Eric Anholt dc6fa41076 glx: Remove the last user of -DUSE_XCB.
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-10-09 14:32:02 -07:00
Eric Anholt 3f0e3a7ad5 glx: Unifdef USE_XCB.
It's been required for building glx since
b518dfb513 in january.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-10-09 14:32:02 -07:00
Eric Anholt 31c7d4ec18 egl: Cleanly cast EGLNative* pointers to X11 types.
The EGLNative* types are all defined to be pointers across all our EGL
implementations, but in the X11 platform they're actually just XIDs (32-bit
integers).

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-10-09 14:32:01 -07:00
Vincent Lejeune 11e08f42e4 r600g: use a select to handle front/back color in llvm
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-10-09 23:19:09 +02:00
Vincent Lejeune 80663cb185 r600g: frontcolor tracks its associated backcolor
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-10-09 23:19:09 +02:00
Matt Turner 900cc7cf80 Remove VAAPI support.
Not working and unmaintained.

Reviewed-by: Christian König <christian.koenig@amd.com>
2012-10-09 14:00:05 -07:00
Marcin Slusarz 63a15117a5 nv50: fix build after "nv50: fix printf warning"
When compiled with C++ compiler, inttypes.h defines PRI* macros only when
__STDC_FORMAT_MACROS is defined.
2012-10-09 22:42:54 +02:00
Marcin Slusarz 93eba26935 nouveau: use pre-calculated stride for resource_get_handle
Fixes FDO#55294.

NOTE: This is a candidate for the 9.0 branch.
2012-10-09 22:23:09 +02:00
Tom Stellard 45288cd2b6 r600g: Fix build with --enable-opencl 2012-10-09 19:54:12 +00:00
Ian Romanick b25fbceb86 mesa/tests: Remove driverCtx parameter from call to _mesa_initialize_context
Fixes 'make check' breakage since 733dba2.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-09 11:21:14 -07:00
Quentin Glidic 7cb8764ca3 intel: Add missing #include <time.h>
Commit 006c1a3c65 introduced a call to
clock_gettime, but failed to include <time.h>, breaking the build in
some cases.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-09 09:12:41 -07:00
Kenneth Graunke b6346749a8 i965: Delete some dead code from brw_eu_emit.c.
Presumably some of this was used by the old fragment shader backend.
2012-10-09 09:11:26 -07:00
Andreas Boll 840d8484c0 docs: add missing release date 2012-10-09 17:50:29 +02:00