Commit Graph

53169 Commits

Author SHA1 Message Date
Marek Olšák 369e468889 gallium: unify transfer functions
"get_transfer + transfer_map" becomes "transfer_map".
"transfer_unmap + transfer_destroy" becomes "transfer_unmap".

transfer_map must create and return the transfer object and transfer_unmap
must destroy it.

transfer_map is successful if the returned buffer pointer is not NULL.
If transfer_map fails, the pointer to the transfer object remains unchanged
(i.e. doesn't have to be NULL).

Acked-by: Brian Paul <brianp@vmware.com>
2012-10-11 21:12:16 +02:00
Marek Olšák ec4c74a9dc st/mesa: use the renderbuffer chosen by core Mesa in CopyTexSubImage
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-10-11 21:12:12 +02:00
Marek Olšák 9fe06f8815 softpipe: remove unused functions
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-10-11 21:12:10 +02:00
Marek Olšák 1c02075df0 st/mesa: use transfer_inline_write in st_texture_image_data
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-10-11 21:12:07 +02:00
Marek Olšák ce7ebdd29a st/mesa: remove useless checking in reset_cache
It's always NULL here.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-10-11 21:12:03 +02:00
Andreas Boll f04a6a65cc docs: start release notes file for 9.1 2012-10-11 19:26:10 +02:00
Brian Paul 60a9390978 svga: don't use uninitialized framebuffer state
Only the first 'nr_cbufs' color buffers in the pipe_framebuffer_state are
valid.  The rest of the color buffer pointers might be unitialized.
Fixes a regression in the piglit fbo-srgb-blit test since changes in the
gallium blitter code.

NOTE: This is a candidate for the 9.0 branch (just to be safe).

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-10-11 09:13:59 -06:00
John Kåre Alsaker 6c53ec1ef2 svga: Remove wierd code which forces non-sRGB formats.
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-10-10 18:22:22 -06:00
John Kåre Alsaker 1a4aad11b0 svga: Add support for 16-bit per channel RGBA
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-10-10 18:19:44 -06:00
Eric Anholt 34c58acb59 i965/vs: Add support for splitting virtual GRFs.
This should improve our ability to register allocate without spilling.
Unfortuantely, due to the live variable analysis being ignorant of loops, we
still have register allocation failures on some programs.

v2: Add more context to the comment explaining the function.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> (v1)
2012-10-10 13:22:56 -07:00
Eric Anholt d4bcc65918 i965/vs: Try again when we've successfully spilled a reg.
Before, we'd spill one reg, then continue on without actually register
allocating, then assertion fail when we tried to use a vgrf number as a
register number.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-10 13:22:56 -07:00
Kenneth Graunke 9237f0ea8d i965/vs: Implement register spilling.
To validate this code, I ran piglit -t vs quick.tests with the "go spill
everything" debugging code enabled.  There was only one regression:
glsl-vs-unroll-explosion simply ran out of registers.  This should be
fine in the real world, since no one actually spills every single
register.

NOTE: This is a candidate for the 9.0 branch. Even if it proves to have
bugs, it's likely better than simply failing to compile.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-10-10 13:22:56 -07:00
Kenneth Graunke 46e529672b i965/vs: Fix unit mismatch in scratch base_offset parameter.
move_grf_array_access_to_scratch() calculates scratch buffer offsets in
bytes.  However, emit_scratch_read/write() expects the base_offset
parameter to be measured in OWords.

As a result, a shader using a scratch read/write offset greater than
zero (in practice, a shader containing more than one variable in
scratch) would use too large an offset, frequently exceeding the
available scratch space.

This patch corrects the mismatch by removing spurious conversion from
OWords to bytes in move_grf_array_access_to_scratch().

This is based on a patch by Paul Berry.

NOTE: This is a candidate for stable release branches.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-10-10 13:22:55 -07:00
Matt Turner 587d5db11d egl: Return EGL_BAD_MATCH for invalid profile attributes
Version 12 of the EGL_KHR_create_context spec changed this behavior.

NOTE: This is a candidate for the 9.0 branch
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-10-10 13:15:06 -07:00
Vincent Lejeune 5090ce42e4 radeon/llvm: use ceil intrinsic instead of llvm.AMDIL.round.posinf
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-10-10 22:03:33 +02:00
Vincent Lejeune 9a6bb3f645 radeon/llvm: use floor intrinsic instead of llvm.AMDIL.floor
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-10-10 22:03:20 +02:00
Vincent Lejeune bfdf26892c radeon/llvm: use llvm fabs intrinsic
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-10-10 22:03:03 +02:00
Vincent Lejeune 8db11bc4ed radeon/llvm: use llvm intrinsic for flog2
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-10-10 22:02:45 +02:00
Vincent Lejeune 23e11ac835 radeon/llvm: add support for cos/sin intrinsic
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-10-10 22:02:28 +02:00
Vincent Lejeune 876b42663c radeon/llvm: add a pattern for fsqrt
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-10-10 22:02:13 +02:00
Paul Berry 99802519b4 glapi: Reformat python code generation scripts to use 4-space indentation.
This brings us into accordance with the official Python style guide
(http://www.python.org/dev/peps/pep-0008/#indentation).

To preserve the indentation of the c code that is generated by these
scripts, I've avoided re-indenting triple-quoted strings (unless those
strings appear to be docstrings).

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-10 11:19:14 -07:00
José Fonseca 856464979b mesa: Avoid C99 indexed initializers.
Not supported by MSVC.

Reviewed-by: Imre Deak <imre.deak@intel.com>
2012-10-10 17:55:04 +01:00
José Fonseca 3f228ed090 mesa: Prevent CONST macro re-definition.
Should fix MSVC build, as windows.h also defines CONST.

CONST usage in get.c is not new, so probably this just appeared now due
to changes in the includes.
2012-10-10 11:40:34 +01:00
José Fonseca a555888151 mesa: Silence 'assignment makes integer from pointer without a cast' warnings. 2012-10-10 11:35:34 +01:00
Imre Deak 9c1c23331a glget: fix make check for glGet GL_POLYGON_OFFSET_BIAS
This got broken by:
7182a1f glapi: rename/move GL_POLYGON_OFFSET_BIAS to its extension
section

Fix it by appending the _EXT suffix to the enum in the test too.

Signed-off-by: Imre Deak <imre.deak@intel.com>
Reviewed-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
2012-10-10 12:56:02 +03:00
Imre Deak dd6479160c mesa: glGet: remove the unused TYPE_API_MASK flags
Since we generate the hash tables in build time, these flags aren't used
any more, remove them.

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:26 +03:00
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