Commit Graph

60206 Commits

Author SHA1 Message Date
Pi Tabred 78216fb485 Add ARB_clear_buffer_object to list of supported extensions
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-12-18 09:06:51 -07:00
Brian Paul 787dadbeea st/mesa: plug in default buffer object driver functions
In particular, this plugs in the new ClearBufferSubData() fallback
driver function.
2013-12-18 09:06:51 -07:00
Pi Tabred 5f7bc0c759 mesa: Implement functions for clear_buffer_object extensions
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-12-18 09:06:51 -07:00
Pi Tabred 7d94653052 mesa: Modify get_buffer() to allow for a variable error code
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-12-18 09:06:51 -07:00
Pi Tabred 84c4ea571d 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>
2013-12-18 09:06:51 -07:00
Pi Tabred 72d872ad82 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>
2013-12-18 09:06:51 -07:00
Pi Tabred 1ec2d0a9a8 mesa: Modify format validation to check for extension not context version
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-12-18 09:06:51 -07:00
Pi Tabred d5e6fe4d29 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>
2013-12-18 09:06:51 -07:00
Pi Tabred 1f7c3e541f 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>
2013-12-18 09:06:51 -07:00
Jan Vesely 56647c5d8f 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>
2013-12-18 16:21:59 +01:00
Jan Vesely 21f82188ce 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>
2013-12-18 16:18:15 +01:00
Markus Trippelsdorf 78fcc31d4a 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>
2013-12-18 07:12:13 -07:00
Thomas Hellstrom 00cf048b12 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>
2013-12-18 09:11:24 +01:00
Marek Olšák 37c24e6d86 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>
2013-12-18 01:20:11 +01:00
Marek Olšák 3352ff97c2 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>
2013-12-18 01:20:11 +01:00
Paul Berry 7963fde37b glsl: Replace _mesa_glsl_parser_targets enum with gl_shader_type.
These enums were redundant.

Reviewed-by: Brian Paul <brianp@vmware.com>
2013-12-17 12:31:36 -08:00
Paul Berry abab438543 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>
2013-12-17 12:31:36 -08:00
Paul Berry d9b55244fd 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>
2013-12-17 12:31:35 -08:00
Brian Paul 188630dc13 swrast: silence driContextSetFlags() parameter type warning 2013-12-17 09:47:47 -08:00
Brian Paul d79058d1c6 st/dri: fix compiler warning for driCopySubBufferExtension 2013-12-17 09:47:47 -08:00
Marek Olšák 2b404a6504 radeonsi: improve HiZ precision for less and lequal depth functions
r600g needs this too.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2013-12-17 15:41:46 +01:00
Marek Olšák 1a63f278f2 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>
2013-12-17 15:41:46 +01:00
Marek Olšák 249cb511c5 radeonsi: flush HTILE when appropriate
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2013-12-17 15:41:46 +01:00
Thomas Hellstrom 3e2b0f801d 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>
2013-12-17 09:01:29 +01:00
Alexander von Gluck IV 56d920a5c1 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>
2013-12-16 18:18:12 -06:00
Rob Clark f9cfe5ce82 freedreno: dummy-draw workaround for a320
Fixes gpu lockups in supertuxkart.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2013-12-14 12:35:07 -05:00
Marek Olšák b56c7f4df1 r600g: expose 32-bit integer vertex formats
This advertises GL_ARB_texture_buffer_object_rgb32.
2013-12-14 17:42:08 +01:00
Marek Olšák 2eb321b992 radeonsi: move invariant regs to si_init_config
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2013-12-14 17:42:08 +01:00
Marek Olšák 696229523d r600g: use shader-based MSAA resolving when hw-based one cannot be used
This fixes some MSAA integer tests.
2013-12-14 17:42:08 +01:00
Marek Olšák 9ebb9a3c8e 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>
2013-12-14 17:42:08 +01:00
Marek Olšák 5a609fbcb5 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>
2013-12-14 17:42:08 +01:00
Marek Olšák fc21098a95 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>
2013-12-14 17:42:08 +01:00
Marek Olšák f0ed082bab gallium/u_blitter: remove useless parameters from some functions
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-12-14 17:42:08 +01:00
Marek Olšák 072c5d0573 st/dri: resolve sRGB buffers in linear colorspace
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-12-14 17:42:08 +01:00
Roland Scheidegger 27d47bd42f 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>
2013-12-14 17:11:03 +01:00
Roland Scheidegger 7c027666da 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>
2013-12-14 17:11:03 +01:00
Roland Scheidegger bfcf1ba1c4 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>
2013-12-14 17:11:03 +01:00
Kenneth Graunke 35f0aafaa4 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>
2013-12-13 21:14:19 -08:00
Chris Forbes 8bb666cee3 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>
2013-12-14 16:32:41 +13:00
Chris Forbes 544869377d 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>
2013-12-14 16:28:11 +13:00
Chris Forbes 1d71f38924 glsl: add gl_SampleMaskIn[] builtin
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-12-14 16:24:22 +13:00
Chris Forbes c1e1dd2298 mesa: add SYSTEM_VALUE_SAMPLE_MASK_IN
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-12-14 16:24:21 +13:00
Brian Paul 7d91390359 mesa: document _mesa_texstore() return value 2013-12-13 17:02:43 -07:00
Brian Paul 19fa540219 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>
2013-12-13 16:06:07 -07:00
Brian Paul 31b0e7d024 st/mesa: add const qualifiers in sampler validation code
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2013-12-13 16:06:06 -07:00
Brian Paul 9f9860b004 st/mesa: add const qualifier to st_translate_color()
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2013-12-13 16:06:06 -07:00
Brian Paul eff11b5a4a 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>
2013-12-13 16:06:06 -07:00
Brian Paul b5cc710473 mesa: update glext.h to version 20131212
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2013-12-13 16:04:23 -07:00
Brian Paul d6a8421f3b 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>
2013-12-13 12:01:28 -08:00
Brian Paul e735dfd35b mesa: s/uint/GLuint/ to fix MSVC error 2013-12-13 12:51:10 -07:00