Commit graph

48446 commits

Author SHA1 Message Date
Ian Romanick
b45f77dc4c glx/dri: Add utility function dri2_convert_glx_attribs
This converts all of the GLX data from glXCreateContextAttribsARB to
the values expected by the DRI driver interfaces.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-01-02 12:41:45 -08:00
Ian Romanick
4c7898cb13 st/mesa: Reject forward-looking contexts
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-01-02 12:41:45 -08:00
Ian Romanick
d9de33c304 dri_util: Mostly stub implementation of dri2CreateContextAttribs
This adds the function and modifies dri2CreateNewContextForAPI to call
it.  At this point only version 2 of the DRI2 API is advertised to the
loader.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-01-02 12:41:45 -08:00
Ian Romanick
c9d25cf73f glx: Add extension strings for GLX_ARB_create_context and GLX_ARB_create_context_profile
Note that these extensions are not automatically enabled for screens
capable of direct-rendering.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-01-02 12:41:45 -08:00
Ian Romanick
78aa71a3ce glx: Connect glXCreateContextAttribsARB to glXGetProcAddress
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-01-02 12:41:45 -08:00
Ian Romanick
588042a8ec glx: Initial implementation of glXCreateContextAttribsARB
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-01-02 12:41:44 -08:00
Ian Romanick
48ffc6a155 glx/dri2: Implement glx_screen_vtable::create_context_attribs for DRI2 contexts
This also enables GLX_ARB_create_context and
GLX_ARB_create_context_profile if the driver supports DRI_DRI2 version
3 or greater.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-01-02 12:41:44 -08:00
Ian Romanick
6a0640971f glx: Implement glx_screen_vtable::create_context_attribs for indirect contexts
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-01-02 12:41:44 -08:00
Ian Romanick
43409fa7b0 glx: Add glx_screen_vtable::create_context_attribs
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-01-02 12:41:44 -08:00
Ian Romanick
eacd61bfef glx: Use __glX_send_client_info with XCB
__glX_send_client_info only supports XCB, so use that instead of
__glXClientInfo when USE_XCB is defined.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-01-02 12:41:44 -08:00
Ian Romanick
6ccda72bf8 glx: Add __glX_send_client_info super function
This function picks the correct client-info protocol (based on the
server's GLX version and set of extensions) and sends it to the
server.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-01-02 12:41:44 -08:00
Christoph Bumiller
fc7ac4da7d glsl-to-tgsi: handle ir_unop_round_even 2012-01-02 21:16:03 +01:00
Bryan Cain
09497e020a glsl_to_tgsi: fix handling of CONT and BRK in eliminate_dead_code_advanced() 2012-01-02 14:09:45 -06:00
Paul Berry
7cbcce383c swrast: Remove dead code in _swrast_clear_depth_buffer()
This code was generating the gcc warning:

  variable ‘clearValue’ set but not used [-Wunused-but-set-variable]

Reviewed-by: Brian Paul <brianp@vmare.com>
2012-01-02 11:10:57 -08:00
Brian Paul
01a63f4bf5 radeon: move declarations before code 2012-01-02 11:55:40 -07:00
Brian Paul
5edc6fef4c radeon: add casts to silence warnings 2012-01-02 11:55:39 -07:00
Brian Paul
d939838267 radeon: remove unused tex image function prototypes 2012-01-02 11:55:39 -07:00
Brian Paul
d69d287068 mesa: remove the dstX/Y/Zoffset params to _mesa_texstore() functions
The were always zero.  When doing a sub-texture replacement we account
for the dstX/Y/Zoffsets when we map the texture image.  So no need to
pass them into the texstore code anymore.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-02 11:55:39 -07:00
Brian Paul
e833b98182 intel: pass xoffset, yoffset = 0 to _mesa_texstore()
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-02 11:55:39 -07:00
Eric Anholt
c82c24b18b i965: Silence gcc warning about uninitialized "inst" in assert() case. 2012-01-02 10:38:47 -08:00
Eric Anholt
bf2c7469fb i965: Silence gcc warning from resizing EU store changes. 2012-01-02 10:38:47 -08:00
Christian König
bce506ffc0 vl: seperate shader buffers from components
Buffers for shader based decoding can now be
released without its component still being around.

Signed-off-by: Christian König <deathsimple@vodafone.de>
Acked-by: Maarten Lankhorst <m.b.lankhorst@gmail.com>
2012-01-02 12:47:15 +01:00
Marek Olšák
2cd7e5b737 r300g: inline r300_resource_set_properties 2012-01-01 11:47:06 +01:00
Marek Olšák
ce9d61fec6 r300g: rework resource_copy_region, not changing pipe_resource
Changing pipe_resource was wrong, because it can be used by other contexts
at the same time. This fixes the last possible race condition in r300g
that I know of.

This also fixes blitting NPOT compressed textures. Random pixels sometimes
appeared at the right-hand edge of the texture.

Finally, this removes r300_texture_desc::stride_in_pixels. It makes little
sense with sampler views and surfaces being able to override width0, height0,
and the format entirely.
2012-01-01 11:47:05 +01:00
Marek Olšák
ce31970af1 u_blitter: expose functions for setting default views and surfaces for copying
And more importantly, don't call u_sampler_view_default_template etc.
it was a source of bugs.
2012-01-01 11:47:05 +01:00
Dave Airlie
b5fd0e04a7 st_glsl_to_tgsi: translate interp mode for front/back color
this fixes a bunch of interpolation tests on softpipe at least.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-12-31 13:48:19 +00:00
Dave Airlie
c44f6e0489 softpipe: reorder LIT to fix fp-lit-src-equals-dst
This reorders the LIT operation like the r600 one to fix the
fp-lit-src-equals-dst piglit test.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-12-31 13:17:23 +00:00
Dave Airlie
24668a38d1 llvmpipe: fix blending for intensity formats
This fixes the piglit fbo-blending-formats test for standard, ARB_texture_float
and EXT_texture_snorm.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-12-31 12:37:48 +00:00
Brian Paul
99fbf7ce34 st/mesa: remove stImage->base.Face/Level assignments in st_TexImage()
This fixes a regresssion (broken cube maps) caused by the
ctx->Driver.TexImage parameter simplification commit.  The target var
is always GL_TEXTURE_CUBE_MAP at this point so the Face field was always
getting set to zero.

These field assignments aren't needed anyway since core Mesa sets them.
2011-12-30 16:42:27 -07:00
Dave Airlie
bed4c7ea5e u_format: fix latc fetches.
This fixes the latc fetches for llvmpipe, fixes
fbo-generatemipmap-formats GL_ARB_texture_compression
fbo-generatemipmap-formats GL_ATI_texture_compression_3dc
fbo-generatemipmap-formats GL_EXT_texture_compression_latc

Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Dave Airlie <airlied@gmail.com>
2011-12-30 21:20:18 +00:00
Dave Airlie
0c6ee788f2 u_format/rgtc: fix alpha values in returned texels.
This fixes fbo-generatemipmap-formats GL_EXT_texture_compression_rgtc
on llvmpipe.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-12-30 20:31:34 +00:00
Alexander von Gluck
141d961d84 glsl: fix usage of potentially undefined data_end union
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-12-30 08:48:51 -07:00
Brian Paul
797960dbec st/glx/xlib: check for null attrib_list in glXCreateContextAttribsARB()
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=44234
2011-12-30 08:38:58 -07:00
Brian Paul
bec2ea8ef4 mesa: simplify Driver.GetCompressedTexImage() parameters
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-30 08:24:56 -07:00
Brian Paul
94a0c518dc mesa: simplify Driver.CompressedTex[Sub]Image function parameters
As with previous commits, the target, level and texObj info can be
obtained through the texImage pointer.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-30 08:24:56 -07:00
Brian Paul
92c64624cd mesa: simplify Driver.TexImage() parameters
As with TexSubImage(), the target, level and texObj values can be obtained
through the texImage pointer.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-30 08:24:55 -07:00
Brian Paul
da0cc82a09 mesa: simplify Driver.TexSubImage() parameters
There's no need to pass the target, level and texObj parameters since
they can be easily obtained from the texImage pointer.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-30 08:24:55 -07:00
Brian Paul
c22a95c4f2 st/mesa: remove TexSubImage code, use core mesa routines instead.
Since the move to Map/UnmapTextureImage, the core mesa routines are
equivalent to what the state tracker was doing.

The TexImage functions can be replaced too, but there's a few differences
that will need to be handled.
2011-12-30 08:24:55 -07:00
Dave Airlie
4ca624f8e0 u_format: fix inv_swizzles generation
inv_swizzles is used in lp_tile_soa.py to create lp_tile_soa.c, we overwrite swizzles if they are already set.

This results in the i8 format getting alpha instead of red, and the l8 format
getting blue instead of red.

Fixes fbo-alphatest-formats, fbo-alphatest-formats ARB_texture_float,
and fbo-alphatest-formats EXT_texture_snorm on llvmpipe.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-12-30 13:43:52 +00:00
Michel Dänzer
7dd2d29a56 r600g: Manage fences per screen rather than per context.
A fence is a screen object and can outlive the context it was created from.
The previous code would access freed memory in that case, resulting in
various problems.

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=44151
       https://bugs.freedesktop.org/show_bug.cgi?id=44007

Probably fixes: https://bugs.freedesktop.org/show_bug.cgi?id=43993

NOTE: This is a candidate for the 7.11 branch.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
2011-12-30 10:45:31 +01:00
Stéphane Marchesin
0e57b66fa1 i915g: Allocate tmp for KILP
This fixes https://bugs.freedesktop.org/show_bug.cgi?id=44297
2011-12-30 01:33:26 -08:00
Yuanhan Liu
efa1fac215 vbo: introduce vbo_sizeof_ib_type() function
introduce vbo_sizeof_ib_type() function to return the index data type
size. I see some place use switch(ib->type) to get the index data type,
which is sort of duplicate.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-30 13:53:40 +08:00
Stéphane Marchesin
ded02bd54b llvmpipe: Remove useless draw_install_pstipple_stage call.
It is #ifdef'd out, and is already called unconditionnaly a couple lines above.

Reviewed-By: Jose Fonseca <jfonseca@vmware.com>
2011-12-29 12:28:44 -08:00
Chad Versace
747f030762 intel: Fix memory leak in intel_miptree_create()
On failure, intel_miptree_create() needs to *release* the miptree, not
just free it, so that the stencil_mt gets released too.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2011-12-29 10:47:44 -08:00
Eric Anholt
069901e2f5 i965/fs: Allow constant propagation into IF with embedded compare.
This saves a couple of instructions on most programs with control
flow.  More interestingly, 6 shaders from unigine sanctuary now fit
into 16-wide without register spilling.
2011-12-29 09:33:56 -08:00
Eric Anholt
6a1e19d0f6 intel: Drop the batchbuffer flush on glRenderbufferStorage().
There's nothing batchbuffer-related here.  State updates by the caller
will trigger re-emitting of any new hardware state.
2011-12-29 09:33:56 -08:00
Eric Anholt
2529fde36e intel: Drop the batchbuffer flush on glFramebufferRenderbuffer().
There should be nothing special about this call compared to other
callers of intel_draw_buffer().
2011-12-29 09:33:56 -08:00
Eric Anholt
b890f1090c intel: Make the batchbuffer flush debug more useful.
We were printing out the line triggering the flush, but a variety of
different causes just printed the line number for intel_flush()'s call
of intel_batchbuffer_flush().  Plumb the line numbers from the caller
of intel_flush() on through.
2011-12-29 09:33:56 -08:00
Eric Anholt
7f854a5028 intel: Fix performance regression in Lightsmark since HiZ changes.
Since the refactor in d7b33309fe, depth
in the miptree changed from 1 to 6, so we always decided it didn't
match, and we would relayout to something that would still not
"match".

Improves performance 23.8% (+/- 1.1%, n=4)

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=43329
2011-12-29 09:33:56 -08:00
Eric Anholt
ab7794cada intel: Don't consider miptrees for other texture targets to match.
We would have done a relayout at validate time, but it's senseless to
store into a miptree if it's going to force relayout.
2011-12-29 09:33:56 -08:00