mesa.git
10 years agor600g: Fix spelling error
Aaron Watry [Thu, 19 Dec 2013 18:40:13 +0000 (12:40 -0600)]
r600g: Fix spelling error

Trivial change, testing commit access

10 years agoegl: break instead of looping after driver is found
Quanxian Wang [Thu, 19 Dec 2013 05:11:00 +0000 (22:11 -0700)]
egl: break instead of looping after driver is found

Stop searching for a driver after success.

Signed-off-by: Quanxian Wang <quanxian.wang@intel.com>
Reviewed-By: Gong, Zhigang <zhigang.gong@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
10 years agomesa: Assert variable coming from get_variable() in get_current_attrib
Juha-Pekka Heikkila [Thu, 19 Dec 2013 12:27:00 +0000 (05:27 -0700)]
mesa: Assert variable coming from get_variable() in get_current_attrib

Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
10 years agomesa: Add asserts into emit_fog_instructions
Juha-Pekka Heikkila [Thu, 19 Dec 2013 12:27:00 +0000 (05:27 -0700)]
mesa: Add asserts into emit_fog_instructions

Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
10 years agoglx: Fix two identical null check errors in driSet/GetInterval
Juha-Pekka Heikkila [Thu, 19 Dec 2013 12:27:00 +0000 (05:27 -0700)]
glx: Fix two identical null check errors in driSet/GetInterval

Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
10 years agost_glsl_to_tgsi: add support for prim id fragment shader input
Dave Airlie [Wed, 18 Dec 2013 08:00:33 +0000 (18:00 +1000)]
st_glsl_to_tgsi: add support for prim id fragment shader input

For GLSL 1.50 we can get frag shaders with primitive id as an
input, add support to the translator for this.

Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
10 years agomesa: add asserts in load_texunit_bumpmap
Juha-Pekka Heikkila [Wed, 18 Dec 2013 13:58:00 +0000 (06:58 -0700)]
mesa: add asserts in load_texunit_bumpmap

In load_texunit_bumpmap tc_array is asserted so lets assert
rot_mat_0 and rot_mat_1 also which are coming from same path.

Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
10 years agoglx: add missing null check in dri2_bind_tex_image
Juha-Pekka Heikkila [Wed, 18 Dec 2013 13:58:00 +0000 (06:58 -0700)]
glx: add missing null check in dri2_bind_tex_image

Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
10 years agomesa: minor simplification in _mesa_es3_error_check_format_and_type()
Brian Paul [Tue, 17 Dec 2013 23:20:29 +0000 (16:20 -0700)]
mesa: minor simplification in _mesa_es3_error_check_format_and_type()

The type_valid local was set to true and never changed.

10 years agoglx: Add missing null check in dri2CreateDrawable
Juha-Pekka Heikkila [Mon, 16 Dec 2013 14:04:00 +0000 (07:04 -0700)]
glx: Add missing null check in dri2CreateDrawable

Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
10 years agomesa: Verify memory allocations success in _mesa_PushAttrib
Juha-Pekka Heikkila [Mon, 16 Dec 2013 14:04:00 +0000 (07:04 -0700)]
mesa: Verify memory allocations success in _mesa_PushAttrib

Check for malloc() returning null to fix Klocwork warnings.
Minor clean-ups by BrianP.

Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
10 years agomesa: Verify memory allocations success in _mesa_PushClientAttrib
Juha-Pekka Heikkila [Mon, 16 Dec 2013 14:04:00 +0000 (07:04 -0700)]
mesa: Verify memory allocations success in _mesa_PushClientAttrib

Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
10 years agomesa: Change save_attrib_data() to return boolean
Juha-Pekka Heikkila [Mon, 16 Dec 2013 14:04:00 +0000 (07:04 -0700)]
mesa: Change save_attrib_data() to return boolean

Change save_attrib_data() to return true/false depending on success.

Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
10 years agomesa: add API/extension checks for 3-component texture buffer formats
Brian Paul [Mon, 16 Dec 2013 16:41:09 +0000 (09:41 -0700)]
mesa: add API/extension checks for 3-component texture buffer formats

The GL_RGB32F, GL_RGB32UI and GL_RGB32I texture buffer formats are
only supposed to be allowed if the GL_ARB_texture_buffer_object_rgb32
extension is supported.  Note that the texture buffer extensions
require a core profile.  This patch adds those checks.

Fixes the soon-to-be-added
arb_clear_buffer_object-negative-bad-internalformat piglit test.

10 years agomesa: 78-column wrapping in extensions.c
Brian Paul [Mon, 16 Dec 2013 16:40:03 +0000 (09:40 -0700)]
mesa: 78-column wrapping in extensions.c

10 years agomesa: Cleanup mesa/main/bufferobj.h
Pi Tabred [Sat, 14 Dec 2013 17:32:00 +0000 (10:32 -0700)]
mesa: Cleanup mesa/main/bufferobj.h

Column wrapping and space between lines.

Reviewed-by: Brian Paul <brianp@vmware.com>
10 years agoModify release notes to include ARB_clear_buffer_object extension
Pi Tabred [Sat, 14 Dec 2013 17:32:00 +0000 (10:32 -0700)]
Modify release notes to include ARB_clear_buffer_object extension

Reviewed-by: Brian Paul <brianp@vmware.com>
10 years agoAdd ARB_clear_buffer_object to list of supported extensions
Pi Tabred [Sat, 14 Dec 2013 17:32:00 +0000 (10:32 -0700)]
Add ARB_clear_buffer_object to list of supported extensions

Reviewed-by: Brian Paul <brianp@vmware.com>
10 years agost/mesa: plug in default buffer object driver functions
Brian Paul [Mon, 16 Dec 2013 16:06:17 +0000 (09:06 -0700)]
st/mesa: plug in default buffer object driver functions

In particular, this plugs in the new ClearBufferSubData() fallback
driver function.

10 years agomesa: Implement functions for clear_buffer_object extensions
Pi Tabred [Sat, 14 Dec 2013 17:32:00 +0000 (10:32 -0700)]
mesa: Implement functions for clear_buffer_object extensions

Reviewed-by: Brian Paul <brianp@vmware.com>
10 years agomesa: Modify get_buffer() to allow for a variable error code
Pi Tabred [Sat, 14 Dec 2013 17:32:00 +0000 (10:32 -0700)]
mesa: Modify get_buffer() to allow for a variable error code

Reviewed-by: Brian Paul <brianp@vmware.com>
10 years agomesa: Add bufferobj_range_mapped function
Pi Tabred [Sat, 14 Dec 2013 17:32:00 +0000 (10:32 -0700)]
mesa: Add bufferobj_range_mapped function

Add function to test if the buffer is already mapped and if so,
if the mapped range overlaps the given range.
Modify the _mesa_InvalidateBufferSubData function to use
the new function.

Enable buffer_object_subdata_range_good() to use bufferobj_range_mapped

Reviewed-by: Brian Paul <brianp@vmware.com>
10 years agomesa: get_texbuffer_format(): differentiate between core and compat context
Pi Tabred [Sat, 14 Dec 2013 17:32:00 +0000 (10:32 -0700)]
mesa: get_texbuffer_format(): differentiate between core and compat context

alpha, lumincance and intensity formats are illegal in a core context.
Add a check to return MESA_FORMAT_NONE if one of those is requested within
a core context.

Reviewed-by: Brian Paul <brianp@vmware.com>
10 years agomesa: Modify format validation to check for extension not context version
Pi Tabred [Sat, 14 Dec 2013 17:32:00 +0000 (10:32 -0700)]
mesa: Modify format validation to check for extension not context version

Reviewed-by: Brian Paul <brianp@vmware.com>
10 years agomesa: Make validate_texbuffer_format function available externally
Pi Tabred [Sat, 14 Dec 2013 17:32:00 +0000 (10:32 -0700)]
mesa: Make validate_texbuffer_format function available externally

 - change storage class from static to extern
 - rename validate_texbuffer_format to _mesa_validate_texbuffer_format

Reviewed-by: Brian Paul <brianp@vmware.com>
10 years agomesa: Add infrastructure for GL_ARB_clear_buffer_object
Pi Tabred [Sat, 14 Dec 2013 17:32:00 +0000 (10:32 -0700)]
mesa: Add infrastructure for GL_ARB_clear_buffer_object

 - add xml file for extension
 - add reference in gl_API.xml
 - add pointer to device driver function table (dd.h)
 - update dispatch_sanity.cpp

Reviewed-by: Brian Paul <brianp@vmware.com>
10 years agoclover: Append buffers that use CL_MEM_USE_HOST_PTR.
Jan Vesely [Sun, 15 Dec 2013 22:28:16 +0000 (17:28 -0500)]
clover: Append buffers that use CL_MEM_USE_HOST_PTR.

Specs say it's legal for implementations to use internal copies, and
the write synchronization seems to work.  Fixes clCreateBuffer
(together with previous patches) and buffer-flags piglits.

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Acked-by: Francisco Jerez <currojerez@riseup.net>
10 years agoclover: Add parameter checks to clCreateBuffer.
Jan Vesely [Tue, 17 Dec 2013 16:19:09 +0000 (11:19 -0500)]
clover: Add parameter checks to clCreateBuffer.

v2: Use fewer if statements and functional tricks instead of single-use method,
    suggested by Francisco Jerez.
    Squash two small patches into one.

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
10 years agoconfigure.ac: remove -fcolor-diagnostics from LLVM flags
Markus Trippelsdorf [Fri, 13 Dec 2013 09:59:42 +0000 (10:59 +0100)]
configure.ac: remove -fcolor-diagnostics from LLVM flags

When LLVM is build with Clang, "llvm-config --cxxflags" contains the
-fcolor-diagnostics flag. It is not recognized by gcc and the build
fails. Fix by removing the flag.

Signed-off-by: Markus Trippelsdorf <markus@trippelsdorf.de>
Signed-off-by: Brian Paul <brianp@vmware.com>
10 years agost/dri: Check for kernel support before enabling fd sharing v2
Thomas Hellstrom [Tue, 17 Dec 2013 13:44:38 +0000 (05:44 -0800)]
st/dri: Check for kernel support before enabling fd sharing v2

The dri2 state tracker is checking for driver support before enabling
dri2ImageExtension version 7. This commit adds a check that also the
kernel driver supports fd sharing through prime.

Note that this adds a libdrm dependency on dri2.c.

v2: Removed unnecessary clamping of bool expression

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
10 years agoradeonsi: set CB_DISABLE if the color mask is 0
Marek Olšák [Tue, 17 Dec 2013 12:27:56 +0000 (13:27 +0100)]
radeonsi: set CB_DISABLE if the color mask is 0

Also needed for the DB in-place decompression according to hw docs.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
10 years agoradeonsi: add the htile buffer to the CS ioctl buffer list
Marek Olšák [Tue, 17 Dec 2013 11:45:03 +0000 (12:45 +0100)]
radeonsi: add the htile buffer to the CS ioctl buffer list

This may fix the GPU crashes.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
10 years agoglsl: Replace _mesa_glsl_parser_targets enum with gl_shader_type.
Paul Berry [Mon, 16 Dec 2013 21:09:20 +0000 (13:09 -0800)]
glsl: Replace _mesa_glsl_parser_targets enum with gl_shader_type.

These enums were redundant.

Reviewed-by: Brian Paul <brianp@vmware.com>
10 years agomain: Move MESA_SHADER_TYPES outside of gl_shader_type enum.
Paul Berry [Mon, 16 Dec 2013 21:05:09 +0000 (13:05 -0800)]
main: Move MESA_SHADER_TYPES outside of gl_shader_type enum.

This will avoid spurious compiler warnings in the patch that follows.

Reviewed-by: Brian Paul <brianp@vmware.com>
10 years agoglsl: Don't return bad values from _mesa_shader_type_to_index.
Paul Berry [Mon, 16 Dec 2013 20:58:55 +0000 (12:58 -0800)]
glsl: Don't return bad values from _mesa_shader_type_to_index.

This will avoid compiler warnings in the patch that follows.  There
should be no user-visible effect because the change only affects the
behaviour when an invalid enum is passed to
_mesa_shader_type_to_index(), and that can only happen if there is a
bug elsewhere in Mesa.

Reviewed-by: Brian Paul <brianp@vmware.com>
10 years agoswrast: silence driContextSetFlags() parameter type warning
Brian Paul [Fri, 13 Dec 2013 23:55:28 +0000 (15:55 -0800)]
swrast: silence driContextSetFlags() parameter type warning

10 years agost/dri: fix compiler warning for driCopySubBufferExtension
Brian Paul [Fri, 13 Dec 2013 23:54:45 +0000 (15:54 -0800)]
st/dri: fix compiler warning for driCopySubBufferExtension

10 years agoradeonsi: improve HiZ precision for less and lequal depth functions
Marek Olšák [Tue, 17 Dec 2013 02:11:30 +0000 (03:11 +0100)]
radeonsi: improve HiZ precision for less and lequal depth functions

r600g needs this too.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
10 years agoradeonsi: make DB_RENDER_OVERRIDE an invariant register
Marek Olšák [Tue, 17 Dec 2013 02:06:44 +0000 (03:06 +0100)]
radeonsi: make DB_RENDER_OVERRIDE an invariant register

All this cruft was ported from r600g and isn't needed on SI and later
according to hw docs. If we implemented HiS, we would set it to 0.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
10 years agoradeonsi: flush HTILE when appropriate
Marek Olšák [Mon, 16 Dec 2013 23:46:45 +0000 (00:46 +0100)]
radeonsi: flush HTILE when appropriate

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
10 years agost/xa: Add new map flags
Thomas Hellstrom [Thu, 20 Sep 2012 09:41:23 +0000 (11:41 +0200)]
st/xa: Add new map flags

Replicate some of the gallium pipe transfer functionality.
Also bump minor to signal availability of this feature.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
10 years agoHaiku: Add in public GL kit headers
Alexander von Gluck IV [Sat, 14 Dec 2013 17:46:05 +0000 (11:46 -0600)]
Haiku: Add in public GL kit headers

* These make up the base of what C++ GL Haiku applications
  use for 3D rendering.
* Not placed in includes/GL to prevent Haiku headers from
  getting installed on non-Haiku systems.

Acked-by: Brian Paul <brianp@vmware.com>
10 years agofreedreno: dummy-draw workaround for a320
Rob Clark [Sat, 14 Dec 2013 17:13:28 +0000 (12:13 -0500)]
freedreno: dummy-draw workaround for a320

Fixes gpu lockups in supertuxkart.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
10 years agor600g: expose 32-bit integer vertex formats
Marek Olšák [Thu, 12 Dec 2013 16:22:52 +0000 (17:22 +0100)]
r600g: expose 32-bit integer vertex formats

This advertises GL_ARB_texture_buffer_object_rgb32.

10 years agoradeonsi: move invariant regs to si_init_config
Marek Olšák [Thu, 5 Dec 2013 18:39:36 +0000 (19:39 +0100)]
radeonsi: move invariant regs to si_init_config

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
10 years agor600g: use shader-based MSAA resolving when hw-based one cannot be used
Marek Olšák [Thu, 12 Dec 2013 17:09:08 +0000 (18:09 +0100)]
r600g: use shader-based MSAA resolving when hw-based one cannot be used

This fixes some MSAA integer tests.

10 years agoradeonsi: use shader-based MSAA resolving when hw-based one cannot be used
Marek Olšák [Sat, 7 Dec 2013 16:57:10 +0000 (17:57 +0100)]
radeonsi: use shader-based MSAA resolving when hw-based one cannot be used

This fixes MSAA resolving for 32-bit integer colorbuffers, which isn't
implemented by the hardware.

It also fixes VM protection faults when resolving MSAA 2D array textures.
This may be a CB bug, because shader-based resolving works fine.

It may also be faster for upside-down and scaled blits.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
10 years agogallium/u_blitter: implement shader-based MSAA resolve with bilinear filtering
Marek Olšák [Sat, 7 Dec 2013 16:32:22 +0000 (17:32 +0100)]
gallium/u_blitter: implement shader-based MSAA resolve with bilinear filtering

For scaled resolve. The filter is only good for magnification.

If somebody has an idea how to implement a good filter for minification,
I'm all ears. I'd have to use derivatives probably.

Reviewed-by: Brian Paul <brianp@vmware.com>
10 years agogallium/u_blitter: implement shader-based MSAA resolve
Marek Olšák [Fri, 6 Dec 2013 22:55:05 +0000 (23:55 +0100)]
gallium/u_blitter: implement shader-based MSAA resolve

We need this for integer formats and upside-down blits, which Radeons don't
support for MSAA resolving.

It can be used by calling util_blitter_blit.

Reviewed-by: Brian Paul <brianp@vmware.com>
10 years agogallium/u_blitter: remove useless parameters from some functions
Marek Olšák [Fri, 6 Dec 2013 21:39:48 +0000 (22:39 +0100)]
gallium/u_blitter: remove useless parameters from some functions

Reviewed-by: Brian Paul <brianp@vmware.com>
10 years agost/dri: resolve sRGB buffers in linear colorspace
Marek Olšák [Tue, 10 Dec 2013 16:46:41 +0000 (17:46 +0100)]
st/dri: resolve sRGB buffers in linear colorspace

Reviewed-by: Brian Paul <brianp@vmware.com>
10 years agogallivm: fix pointer type for stmxcsr/ldmxcsr
Roland Scheidegger [Fri, 13 Dec 2013 20:20:05 +0000 (21:20 +0100)]
gallivm: fix pointer type for stmxcsr/ldmxcsr

The argument is a i8 pointer not a i32 pointer (even though the value actually
stored/loaded IS i32). Older llvm versions didn't care but 3.2 and newer do
leading to crashes.

Reviewed-by: Zack Rusin <zackr@vmware.com>
10 years agollvmpipe: get rid of barycentric calculation of a0
Roland Scheidegger [Fri, 13 Dec 2013 17:31:07 +0000 (18:31 +0100)]
llvmpipe: get rid of barycentric calculation of a0

Didn't really work as well as hoped (in particular it was not generally
more accurate), will solve this differently.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
10 years agollvmpipe: (trivial) get rid of triangle subdivision code
Roland Scheidegger [Fri, 13 Dec 2013 00:09:35 +0000 (01:09 +0100)]
llvmpipe: (trivial) get rid of triangle subdivision code

This code was always problematic, and with 64bit rasterization we no longer
need it at all.

Reviewed-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
10 years agoi965: Treat Haswell as 75 in the surface format table.
Kenneth Graunke [Wed, 8 May 2013 21:38:25 +0000 (14:38 -0700)]
i965: Treat Haswell as 75 in the surface format table.

Much like we do for G45.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
10 years agomesa: fix texture view use of _mesa_get_tex_image()
Chris Forbes [Sun, 8 Dec 2013 06:04:40 +0000 (19:04 +1300)]
mesa: fix texture view use of _mesa_get_tex_image()

The target parameter to _mesa_get_tex_image() is a target enum, not an index.
When we're setting up faces for a cubemap, it should be
CUBE_MAP_POSITIVE_X .. CUBE_MAP_NEGATIVE_Z; for all other targets it
should be the same as the texobj's target.

Fixes broken cubemaps [had only +X face but claimed to have all] produced by
glTextureView, which then caused various crashes in the driver when we
tried to use them.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Brian Paul <brianp@vmware.com>
10 years agoi965/fs: add support for gl_SampleMaskIn[]
Chris Forbes [Sun, 8 Dec 2013 07:29:43 +0000 (20:29 +1300)]
i965/fs: add support for gl_SampleMaskIn[]

v2: - add assert so we don't run into trouble on Gen6.
    - adjust for Tapani's rearrangement of ir_variable

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agoglsl: add gl_SampleMaskIn[] builtin
Chris Forbes [Sun, 8 Dec 2013 07:03:25 +0000 (20:03 +1300)]
glsl: add gl_SampleMaskIn[] builtin

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agomesa: add SYSTEM_VALUE_SAMPLE_MASK_IN
Chris Forbes [Sun, 8 Dec 2013 07:01:24 +0000 (20:01 +1300)]
mesa: add SYSTEM_VALUE_SAMPLE_MASK_IN

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agomesa: document _mesa_texstore() return value
Brian Paul [Sat, 14 Dec 2013 00:02:43 +0000 (17:02 -0700)]
mesa: document _mesa_texstore() return value

10 years agost/mesa: only set up sampler compare mode for depth textures
Brian Paul [Fri, 13 Dec 2013 16:52:15 +0000 (09:52 -0700)]
st/mesa: only set up sampler compare mode for depth textures

The GL_ARB_shadow spec says the shadow compare mode should have no
effect when sampling a color texture.  As it was, it was up to
drivers to check for that (softpipe, llvmpipe, svga and probably
the rest don't do that).  Note: it looks like DX10 allows shadow
compare with some non-depth formats, so this case really should be
handled in the state tracker.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
10 years agost/mesa: add const qualifiers in sampler validation code
Brian Paul [Fri, 13 Dec 2013 16:33:49 +0000 (09:33 -0700)]
st/mesa: add const qualifiers in sampler validation code

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
10 years agost/mesa: add const qualifier to st_translate_color()
Brian Paul [Fri, 13 Dec 2013 16:28:07 +0000 (09:28 -0700)]
st/mesa: add const qualifier to st_translate_color()

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
10 years agost/mesa: simplify integer texture check
Brian Paul [Fri, 13 Dec 2013 16:26:24 +0000 (09:26 -0700)]
st/mesa: simplify integer texture check

Just use the gl_texture_object::_IsInteger field instead of
computing it from scratch.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
10 years agomesa: update glext.h to version 20131212
Brian Paul [Thu, 12 Dec 2013 21:55:33 +0000 (14:55 -0700)]
mesa: update glext.h to version 20131212

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agosvga: don't emit extraneous fs shadow code
Brian Paul [Mon, 9 Dec 2013 20:50:44 +0000 (12:50 -0800)]
svga: don't emit extraneous fs shadow code

Depending on the depth texture format, we may or may not have to
emit explicit fs code to do the shadow comparison.  Before, we
were emitting it more often than needed.

v2: check the actual texture format rather than the screen->depth.z16
field.  The screen->depth.z16, x8z24, s8z24 fields may not all be set
to a consistent set of depth formats.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
10 years agomesa: s/uint/GLuint/ to fix MSVC error
Brian Paul [Fri, 13 Dec 2013 19:51:10 +0000 (12:51 -0700)]
mesa: s/uint/GLuint/ to fix MSVC error

10 years agomesa: Update TexStorage to support ARB_texture_view
Courtney Goeltzenleuchter [Mon, 4 Nov 2013 20:31:37 +0000 (13:31 -0700)]
mesa: Update TexStorage to support ARB_texture_view

Call TextureView helper function to set TextureView state
appropriately for the TexStorage calls.

Misc updates from review feedback.

Signed-off-by: Courtney Goeltzenleuchter <courtney@LunarG.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
10 years agomesa: add texture_view helper function for TexStorage
Courtney Goeltzenleuchter [Wed, 6 Nov 2013 21:40:31 +0000 (14:40 -0700)]
mesa: add texture_view helper function for TexStorage

Add helper function to set texture_view state from TexStorage calls.
Include review feedback.

Signed-off-by: Courtney Goeltzenleuchter <courtney@LunarG.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
10 years agomesa: Fill out ARB_texture_view entry points
Courtney Goeltzenleuchter [Wed, 6 Nov 2013 21:34:09 +0000 (14:34 -0700)]
mesa: Fill out ARB_texture_view entry points

Add Mesa TextureView logic.
Incorporate feedback on ARB_texture_view:
- Add S3TC VIEW_CLASSes to compatibility table
- Use existing _mesa_get_tex_image
- Clean up error strings
- Use bool instead of GLboolean for internal functions
- Split compound level & layer test into individual tests
- eliminate helper macro for VIEW_CLASS table
- do not call driver if ptr null.

Signed-off-by: Courtney Goeltzenleuchter <courtney@LunarG.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
10 years agomesa: consolidate multiple next_mipmap_level_size
Courtney Goeltzenleuchter [Mon, 25 Nov 2013 23:31:26 +0000 (16:31 -0700)]
mesa: consolidate multiple next_mipmap_level_size

Refactor to make next_mipmap_level_size defined in mipmap.c a
_mesa_ helper function that can then be used by texture_view

Signed-off-by: Courtney Goeltzenleuchter <courtney@LunarG.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
10 years agomesa: Add driver entry point for ARB_texture_view
Courtney Goeltzenleuchter [Mon, 4 Nov 2013 21:09:22 +0000 (14:09 -0700)]
mesa: Add driver entry point for ARB_texture_view

Signed-off-by: Courtney Goeltzenleuchter <courtney@LunarG.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
10 years agomesa: ARB_texture_view get parameters
Courtney Goeltzenleuchter [Mon, 4 Nov 2013 20:29:48 +0000 (13:29 -0700)]
mesa: ARB_texture_view get parameters

Add support for ARB_texture_view get parameters:
GL_TEXTURE_VIEW_MIN_LEVEL
GL_TEXTURE_VIEW_NUM_LEVELS
GL_TEXTURE_VIEW_MIN_LAYER
GL_TEXTURE_VIEW_NUM_LAYERS

Incorporate feedback regarding when to allow query of
GL_TEXTURE_IMMUTABLE_LEVELS.

Signed-off-by: Courtney Goeltzenleuchter <courtney@LunarG.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
10 years agomesa: update texture object for ARB_texture_view
Courtney Goeltzenleuchter [Mon, 4 Nov 2013 20:22:30 +0000 (13:22 -0700)]
mesa: update texture object for ARB_texture_view

Add state needed by glTextureView to the gl_texture_object.

Signed-off-by: Courtney Goeltzenleuchter <courtney@LunarG.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
10 years agomesa: Tracking for ARB_texture_view extension
Courtney Goeltzenleuchter [Mon, 4 Nov 2013 20:18:55 +0000 (13:18 -0700)]
mesa: Tracking for ARB_texture_view extension

Signed-off-by: Courtney Goeltzenleuchter <courtney@LunarG.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
10 years agomesa: Add API definitions for ARB_texture_view
Courtney Goeltzenleuchter [Mon, 4 Nov 2013 21:08:16 +0000 (14:08 -0700)]
mesa: Add API definitions for ARB_texture_view

Stub in glTextureView API call to go with the
glTextureView API xml definition.
Includes dispatch test for glTextureView

Signed-off-by: Courtney Goeltzenleuchter <courtney@LunarG.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
10 years agomesa: Fix error code generation in glBeginConditionalRender()
Anuj Phogat [Thu, 12 Dec 2013 22:34:27 +0000 (14:34 -0800)]
mesa: Fix error code generation in glBeginConditionalRender()

This patch changes the error condition to satisfy below statement
from OpenGL 4.3 core specification:
"An INVALID_OPERATION error is generated if id is the name of a query
object with a target other SAMPLES_PASSED, ANY_SAMPLES_PASSED, or
ANY_SAMPLES_PASSED_CONSERVATIVE, or if id is the name of a query
currently in progress."

Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
10 years agoMakefile: Add bin/test-driver to EXTRA_FILES
Carl Worth [Fri, 13 Dec 2013 05:33:02 +0000 (21:33 -0800)]
Makefile: Add bin/test-driver to EXTRA_FILES

I'm not sure why this change is necessary. When I've built previous tar files
(such as 9.2.4) with the "make tarballs" target, they include the
bin/test-driver file. But at my first attempt to build the tar files for the
10.0.1 release this file was not being included and the build failed.

(cherry picked from commit d573899b932435b0b37a7a33ebcbdc3c8cedd3e1)

[The cherry pick is because I original applied this on the 10.0 branch while
working on the 10.0.1 release. But if we don't have this on master as well,
this issue will trip us up again the next time we make a new major-release
branch off of master.]

10 years agodri_util: Don't assume __DRIcontext->driverPrivate is a gl_context
Kristian Høgsberg [Sun, 8 Dec 2013 06:02:11 +0000 (22:02 -0800)]
dri_util: Don't assume __DRIcontext->driverPrivate is a gl_context

The driverPrivate pointer is opaque to the driver and we can't assume
it's a struct gl_context in dri_util.c.  Instead provide a helper function
to set the struct gl_context flags from the incoming DRI context flags.

v2 (idr): Modify the other classic drivers to also use
driContextSetFlags.  I ran all the piglit GLX_ARB_create_context tests
with i965 and classic swrast without regressions.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> [v1]
Reviewed-by: Eric Anholt <eric@anholt.net>
Tested-by: Ilia Mirkin <imirkin@alum.mit.edu> [v1 on Gallium nouveau]
Cc: "10.0" <mesa-stable@lists.freedesktop.org>
10 years agodocs: Update note regarding nominating patches for the stable branch.
Carl Worth [Fri, 13 Dec 2013 07:07:26 +0000 (23:07 -0800)]
docs: Update note regarding nominating patches for the stable branch.

This brings the documentation up to date with the current practice of using
the CC syntax for patch nomination.

10 years agodocs: Fix typo
Carl Worth [Fri, 13 Dec 2013 07:02:54 +0000 (23:02 -0800)]
docs: Fix typo

Simply replacing Extentions with the correct Extensions.

10 years agodocs: Import 9.2.5 release notes, add news item.
Carl Worth [Fri, 13 Dec 2013 06:58:40 +0000 (22:58 -0800)]
docs: Import 9.2.5 release notes, add news item.

10 years agodocs: Import 10.0.1 release notes, add news item.
Carl Worth [Fri, 13 Dec 2013 06:21:08 +0000 (22:21 -0800)]
docs: Import 10.0.1 release notes, add news item.

10 years agoswrast* (gallium, classic): add MESA_copy_sub_buffer support (v3)
Dave Airlie [Thu, 28 Nov 2013 01:08:11 +0000 (11:08 +1000)]
swrast* (gallium, classic): add MESA_copy_sub_buffer support (v3)

This patches add MESA_copy_sub_buffer support to the dri sw loader and
then to gallium state tracker, llvmpipe, softpipe and other bits.

It reuses the dri1 driver extension interface, and it updates the swrast
loader interface for a new putimage which can take a stride.

I've tested this with gnome-shell with a cogl hacked to reenable sub copies
for llvmpipe and the one piglit test.

I could probably split this patch up as well.

v2: pass a pipe_box, to reduce the entrypoints, as per Jose's review,
add to p_screen doc comments.

v3: finish off winsys interfaces, add swrast classic support as well.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
swrast: add support for copy_sub_buffer

10 years agoutil: fix compile breakage
Brian Paul [Thu, 12 Dec 2013 18:11:31 +0000 (11:11 -0700)]
util: fix compile breakage

D'oh!

10 years agoutil: move variable declaration out of for-loop
Brian Paul [Thu, 12 Dec 2013 18:08:49 +0000 (11:08 -0700)]
util: move variable declaration out of for-loop

To fix MSVC build.

10 years agogallium/util: implement new color clear API in u_blitter
Marek Olšák [Wed, 4 Dec 2013 11:14:14 +0000 (12:14 +0100)]
gallium/util: implement new color clear API in u_blitter

10 years agost/mesa: set correct PIPE_CLEAR_COLORn flags
Marek Olšák [Wed, 4 Dec 2013 00:24:37 +0000 (01:24 +0100)]
st/mesa: set correct PIPE_CLEAR_COLORn flags

This also fixes the clear_with_quad function for glClearBuffer.

10 years agogallium: allow choosing which colorbuffers to clear
Marek Olšák [Tue, 3 Dec 2013 23:56:24 +0000 (00:56 +0100)]
gallium: allow choosing which colorbuffers to clear

Required for glClearBuffer, which only clears one colorbuffer attachment.

Example:
   If the first colorbuffer is float and the second one is int:
      pipe->clear(pipe, PIPE_CLEAR_COLOR0, float_clear_color, ...);
      pipe->clear(pipe, PIPE_CLEAR_COLOR1, int_clear_color, ...);

This doesn't need any driver changes yet, because all drivers just use:
  if (flags & PIPE_CLEAR_COLOR) ..

The drivers which support GL 3.0 will have to implement it properly though.

10 years agost/mesa: fix glClear with multiple colorbuffers and different formats
Marek Olšák [Tue, 3 Dec 2013 23:39:52 +0000 (00:39 +0100)]
st/mesa: fix glClear with multiple colorbuffers and different formats

Cc: 10.0 9.2 9.1 <mesa-stable@lists.freedesktop.org>
10 years agomesa: fix interpretation of glClearBuffer(drawbuffer)
Marek Olšák [Tue, 3 Dec 2013 23:27:20 +0000 (00:27 +0100)]
mesa: fix interpretation of glClearBuffer(drawbuffer)

This corresponding piglit tests supported this incorrect behavior instead of
pointing at it.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Cc: 10.0 9.2 9.1 <mesa-stable@lists.freedesktop.org>
10 years agodocs/GL3: better documentation of GL 3.0
Marek Olšák [Tue, 3 Dec 2013 23:25:55 +0000 (00:25 +0100)]
docs/GL3: better documentation of GL 3.0

10 years agor600g,radeonsi: fix initialized buffer range tracking for DMA, add comments
Marek Olšák [Wed, 4 Dec 2013 20:48:26 +0000 (21:48 +0100)]
r600g,radeonsi: fix initialized buffer range tracking for DMA, add comments

The DMA functions modify dst_offset and size and util_range_add gets wrong
values.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
10 years agoradeonsi: fix binding the dummy pixel shader
Marek Olšák [Wed, 4 Dec 2013 12:54:50 +0000 (13:54 +0100)]
radeonsi: fix binding the dummy pixel shader

This fixes valgrind errors in glxinfo.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
10 years agoradeonsi: fix FS_COLOR0_WRITES_ALL_CBUFS with mixed colorbuffer formats
Marek Olšák [Wed, 4 Dec 2013 12:24:22 +0000 (13:24 +0100)]
radeonsi: fix FS_COLOR0_WRITES_ALL_CBUFS with mixed colorbuffer formats

The 16bpc packing must be done separately for each render target.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
10 years agoradeonsi: use the colorbuffer count from the shader key
Marek Olšák [Wed, 4 Dec 2013 11:40:28 +0000 (12:40 +0100)]
radeonsi: use the colorbuffer count from the shader key

As a result, the initialization of write_all must be done before
the compilation.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
10 years agoradeonsi: remove unused variable in si_pipe_shader_ps
Marek Olšák [Wed, 4 Dec 2013 11:28:29 +0000 (12:28 +0100)]
radeonsi: remove unused variable in si_pipe_shader_ps

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
10 years agoradeonsi: Write htile state to hardware.
Andreas Hartmetz [Sat, 7 Dec 2013 03:42:24 +0000 (04:42 +0100)]
radeonsi: Write htile state to hardware.

10 years agoradeon: Allocate htile buffer for SI in r600_texture.
Andreas Hartmetz [Sat, 7 Dec 2013 01:15:27 +0000 (02:15 +0100)]
radeon: Allocate htile buffer for SI in r600_texture.

10 years agoradeon: rearrange r600_texture and related code a bit.
Andreas Hartmetz [Sat, 7 Dec 2013 01:08:27 +0000 (02:08 +0100)]
radeon: rearrange r600_texture and related code a bit.

This should make the differences and similarities between color and
depth buffer handling more clear.