Marek Olšák [Tue, 16 Jun 2015 20:13:34 +0000 (22:13 +0200)]
drirc: drop support for Heaven 3.0, fixes tessellation in 4.0
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Marek Olšák [Thu, 16 Jul 2015 13:27:34 +0000 (15:27 +0200)]
winsys/radeon: implement buffer_unmap
This has been a no-op due to performance concerns. From now on, drivers
should decide when they don't want to unmap, not the winsys.
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Marek Olšák [Thu, 16 Jul 2015 12:54:50 +0000 (14:54 +0200)]
gallium/radeon: remove buffer_unmap calls that can potentially decrease perf
buffer_unmap is currently a no-op on radeon and done correctly on amdgpu.
I plan to fix it for radeon, but before that, all occurences of buffer_unmap
that can negatively affect performance in the future must be removed.
There are 2 reasons for removing buffer_unmap calls:
- There is a likelihood that buffer_map will be called again, so we don't
want to unmap yet.
- The buffer is being released, which automatically unmaps it.
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Marek Olšák [Thu, 16 Jul 2015 12:42:38 +0000 (14:42 +0200)]
radeonsi: remove switch statement in si_create_context
and make si_init_config static
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Marek Olšák [Thu, 16 Jul 2015 11:17:14 +0000 (13:17 +0200)]
radeonsi: don't change pipe_resource in resource_copy_region
Copied from r600g. pipe_resource can be shared by multiple threads, so we
shouldn't change it.
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Marek Olšák [Fri, 10 Jul 2015 21:35:55 +0000 (23:35 +0200)]
radeonsi: upload shader rodata after updating scratch relocations
Cc: 10.5 10.6 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Marek Olšák [Fri, 10 Jul 2015 21:29:04 +0000 (23:29 +0200)]
radeonsi: remove redundant parameter in si_shader_binary_read
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Marek Olšák [Sun, 5 Jul 2015 14:57:58 +0000 (16:57 +0200)]
cso: eliminate some sampler function wrappers
Marek Olšák [Sun, 12 Jul 2015 14:12:59 +0000 (16:12 +0200)]
gallium/tests: use cso_set_samplers
Marek Olšák [Sun, 12 Jul 2015 13:52:44 +0000 (15:52 +0200)]
gallium/util: use cso_set_samplers
Marek Olšák [Sun, 5 Jul 2015 14:54:44 +0000 (16:54 +0200)]
st/mesa: use cso_set_samplers
Marek Olšák [Sun, 5 Jul 2015 14:34:59 +0000 (16:34 +0200)]
cso: remove clip state handling
There is no need for this.
v2: handle redundant clip state changes in st/mesa
Marek Olšák [Sun, 5 Jul 2015 14:32:49 +0000 (16:32 +0200)]
cso: only allow saving and restoring fragment sampler states
Marek Olšák [Sun, 5 Jul 2015 14:10:54 +0000 (16:10 +0200)]
cso: drop inefficient checking for redundant sampler state changes
Drivers can do this better, because they can skip redundant state changes
at per-slot granularity.
Marek Olšák [Sun, 5 Jul 2015 13:53:10 +0000 (15:53 +0200)]
cso: only allow saving and restoring fragment sampler views
Not needed for other shader stages.
Marek Olšák [Sat, 4 Jul 2015 11:18:11 +0000 (13:18 +0200)]
gallium/util: improve dump functions
Reviewed-by: Brian Paul <brianp@vmware.com>
Marek Olšák [Sat, 4 Jul 2015 11:17:07 +0000 (13:17 +0200)]
tgsi: allow dumping to a file directly
Marek Olšák [Thu, 16 Jul 2015 15:14:07 +0000 (17:14 +0200)]
st/mesa: don't call st_validate_state in BlitFramebuffer
None of the draw states are used here.
This fixes a crash in piglit: ext_framebuffer_blit/blit-early
Calling st_manager_validate_framebuffers is the minimum requirement here.
Cc: mesa-stable@lists.freedesktop.org
Marek Olšák [Wed, 29 Apr 2015 15:57:46 +0000 (17:57 +0200)]
docs/relnotes: document new EGL extensions and EGL 1.5
Anatoli Antonovitch [Wed, 10 Jun 2015 12:47:03 +0000 (14:47 +0200)]
st/dri: enable 3D textures and sRGB colorspace for EGL
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
Marek Olšák [Wed, 10 Jun 2015 12:45:58 +0000 (14:45 +0200)]
egl,dri_interface: use DRI2rendererQueryExtension to enable 3D textures & sRGB
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Marek Olšák [Wed, 10 Jun 2015 00:49:29 +0000 (02:49 +0200)]
egl: implement EGL_KHR_gl_colorspace (v2)
v2: add missing "break"
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Marek Olšák [Tue, 9 Jun 2015 23:49:36 +0000 (01:49 +0200)]
st/dri: expose sRGB visuals (v2)
v2: The fix for the darkness in Ubuntu Unity is in the hunk
with the 4-line comment.
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Dylan Baker [Thu, 2 Jul 2015 17:25:41 +0000 (10:25 -0700)]
glapi: fix argument parsing in glX_proto_recv.py
One of the plugins I use with vim "helpfully" added an underscore to the
front of mode for kicks.
Obviously this isn't a feature used very often because it's been broken
since
d986cb7c70db (since May 20th), and no one has noticed.
Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
Emil Velikov [Tue, 21 Jul 2015 14:34:19 +0000 (15:34 +0100)]
egl: android: remove DRM_GRALLOC_TOP hack
Now that the drm_gralloc module exports the correct includes we can get
rid of this hack.
Cc: Chih-Wei Huang <cwhuang@android-x86.org>
Cc: Eric Anholt <eric@anholt.net>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Tested-by: Varad Gautam <varadgautam@gmail.com>
Emil Velikov [Mon, 13 Jul 2015 23:28:46 +0000 (00:28 +0100)]
egl: remove old makefile.sources
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Acked-by: Matt Turner <mattst88@gmail.com>
Emil Velikov [Mon, 13 Jul 2015 23:28:10 +0000 (00:28 +0100)]
android: rework the EGL build
See previous two commits for details.
v2: Don't forget git mv, bring back DRM_GRALLOC_TOP. Spotted by Varad.
Cc: Chih-Wei Huang <cwhuang@android-x86.org>
Cc: Eric Anholt <eric@anholt.net>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Acked-by: Matt Turner <mattst88@gmail.com>
Tested-by: Varad Gautam <varadgautam@gmail.com>
Emil Velikov [Tue, 14 Jul 2015 01:04:30 +0000 (02:04 +0100)]
scons: rework the EGL build
The scons equivalent of the previous commit - just fold the almost
identical driver + main Sconscripts.
Cc: Alexander von Gluck IV <kallisti5@unixzen.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Acked-by: Matt Turner <mattst88@gmail.com>
Emil Velikov [Tue, 14 Jul 2015 00:58:33 +0000 (01:58 +0100)]
automake: rework the EGL build
Simplify things by merging the two makefiles. This way we can combine
the duplicated HAVE_PLATFORM_ checks, and build the library without
having a separate static library.
v2: use $() when referencing variables, use correct define (Matt)
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Emil Velikov [Tue, 30 Jun 2015 21:43:50 +0000 (22:43 +0100)]
gbm: do not build intermittent libgbm_dri static library
The only user of it (libgbm.la) immediately links it. Just build it
directly into the library.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Emil Velikov [Mon, 13 Jul 2015 21:35:25 +0000 (22:35 +0100)]
egl: automake: remove unused HAVE_XCB_DRI2 define
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Emil Velikov [Tue, 14 Jul 2015 00:58:12 +0000 (01:58 +0100)]
egl: remove unused _EGL_DRIVER_SEARCH_DIR define
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Emil Velikov [Mon, 13 Jul 2015 21:16:11 +0000 (22:16 +0100)]
egl/haiku: remove unused DEFAULT_DRIVER_DIR define
Cc: Alexander von Gluck IV <kallisti5@unixzen.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Acked-by: Matt Turner <mattst88@gmail.com>
Emil Velikov [Tue, 14 Jul 2015 00:57:23 +0000 (01:57 +0100)]
egl: remove final Windows specific workaround
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Emil Velikov [Mon, 13 Jul 2015 23:19:54 +0000 (00:19 +0100)]
egl: remove custom string functions
Support for Windows has been removed for a while now, and virtually
every POSIX compliant system provides strcasecmp, strdup and snprintf.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Emil Velikov [Mon, 13 Jul 2015 22:36:19 +0000 (23:36 +0100)]
egl: remove _EGL_PLATFORM_WINDOWS enum
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Emil Velikov [Mon, 13 Jul 2015 21:05:46 +0000 (22:05 +0100)]
egl: remove final references of platform_null
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Emil Velikov [Mon, 13 Jul 2015 21:20:38 +0000 (22:20 +0100)]
egl: remove flatten HAVE_SHARED_GLAPI
It is simply not possible to use the dri backend without shared glapi,
as the alternative provider (libGL) is not always present. We have fixed
the build for a while now, so we can rip this out.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Emil Velikov [Tue, 14 Jul 2015 00:52:51 +0000 (01:52 +0100)]
egl: remove the non-haiku scons build
It has been broken since 2011 with commit
c98ea26e16b(egl: Make
egl_dri2 and egl_glx built-in drivers.). When the backends got merged
into the main library each entry point was guarded by a
_EGL_BUILT_IN_DRIVER_* define.
As the define was missing, the linker kindly removed the whole of the
dri2 backend, thus we did not notice any errors due to the unresolved
link to xcb and friends.
Cc: Chia-I Wu <olv@lunarg.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Acked-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Emil Velikov [Mon, 13 Jul 2015 20:12:01 +0000 (21:12 +0100)]
dri/common: remove unused drm_version variable
As of last commit the only user of it (radeon/r200) no longer uses it.
As such let's remove it and cleanup the nasty hacks that we had in place
to support this.
v2: Leave LIBDRM_CFLAGS around.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com> (v1)
Reviewed-by: Marek Olšák <marek.olsak@amd.com> (v1)
Emil Velikov [Thu, 9 Jul 2015 17:06:14 +0000 (18:06 +0100)]
radeon,r200: allow hyperz for radeon DRM module v2
The original code only half considered hyperz as an option. As per
previous commit "major != 2 cannot occur" we can simply things, and
allow users to set the option if they choose to do so.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Emil Velikov [Thu, 9 Jul 2015 16:34:30 +0000 (17:34 +0100)]
radeon,r200: remove support for UMS radeon DRM module
As mentioned by Michel Dänzer
"FWIW though, any code which is specific to radeon DRM major version 1
can be removed, because that's the UMS major version."
and Marek Olšák
"major != 2" can't occur. You don't have to check the major version at
all and you can just assume it's always 2."
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Emil Velikov [Thu, 9 Jul 2015 16:29:57 +0000 (17:29 +0100)]
radeon,r200: remove unused variable texmicrotile
Dead since at least 2009 with commit
ccf7814a315(radeon: major cleanups
removing old dead codepaths.)
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Emil Velikov [Wed, 8 Jul 2015 00:44:31 +0000 (01:44 +0100)]
scons: don't build the kms-dri winsys
Same as previous commit - unused (gbm is not a thing outside the
autotools build).
v2: Remove trailing HAVE_LIBDRM.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Emil Velikov [Tue, 7 Jul 2015 20:02:40 +0000 (21:02 +0100)]
android: don't build the kms-dri winsys
GBM (the only user of kms-dri) is currently not available under Android.
Considering we have no way of testing/using this let's not bother
building it for now.
Cc: Chih-Wei Huang <cwhuang@linux.org.tw>
Cc: Eric Anholt <eric@anholt.net>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Emil Velikov [Tue, 7 Jul 2015 15:04:27 +0000 (16:04 +0100)]
android: dri: correctly set HAVE_LIBDRM
Set the macro if we're not building swrast alone.
Cc: Eric Anholt <eric@anholt.net>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Chih-Wei Huang <cwhuang@linux.org.tw>
Emil Velikov [Tue, 7 Jul 2015 14:59:32 +0000 (15:59 +0100)]
swrast: remove unneeded __NOT_HAVE_DRM_H define
No longer applicable since the cleanup of dri_interface.h.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Emil Velikov [Tue, 7 Jul 2015 14:57:41 +0000 (15:57 +0100)]
dri/common: use HAVE_LIBDRM over __NOT_HAVE_DRM_H
See previous commit message for details.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Emil Velikov [Tue, 7 Jul 2015 14:42:15 +0000 (15:42 +0100)]
loader: use HAVE_LIBDRM instead of ! __NOT_HAVE_DRM_H
Double negatives in English language are normally avoided, plus the
former seems cleaner and more consistent.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Emil Velikov [Wed, 22 Jul 2015 15:34:15 +0000 (16:34 +0100)]
st/dri: unwrap/remove __NOT_HAVE_DRM_H magic
With the dri_interface.h clean of the macro, we can remove the final
only st/dri specific use of the very same.
Seemingly it was incorrectly used, as the build-time presence of dri2 is
not libdrm specific. At run-time, the code is already limited to dri2
use-cases plus returning true, when the extension is not present (or too
old) will likely lead to a crash as one tries to use it shortly after
the dri_with_format() call.
As a side effect this gives us a nice cleanup the builds.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Emil Velikov [Tue, 7 Jul 2015 14:13:46 +0000 (15:13 +0100)]
dri_interface: drop __NOT_HAVE_DRM_H magic
v2: use HAVE_LIBDRM macro.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Emil Velikov [Wed, 22 Jul 2015 15:22:44 +0000 (16:22 +0100)]
dri/swrast: automake: add LIBDRM_CFLAGS
With the follow up commit we'll remove the __NOT_HAVE_DRM_H macro. As
requested by Ian HAVE_LIBDRM will be used instead, which will lead to
swrast including drm.h when libdrm package is available, even though we
don't need/make use of the header.
As the define is added after the AM_CFLAGS we cannnot use -UHAVE_LIBDRM,
but instead let's just add LIBDRM_CFLAGS. The latter of which will
expand to NULL when the libdrm package is not around.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Emil Velikov [Thu, 9 Jul 2015 20:19:15 +0000 (21:19 +0100)]
configure.ac: do not set HAVE_DRI(23) when libdrm is missing
These conditionals are used to guard both dri modules and loader(s).
Currently if we try to build the gallium swrast dri module (without glx)
on a system that's missing libdrm the build will fail.
v2: Make sure we assign prior to checking the have_libdrm variable.
Cc: 10.6 <mesa-stable@lists.freedesktop.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Brian Paul [Wed, 22 Jul 2015 14:04:49 +0000 (08:04 -0600)]
mesa: fix typo s/glGetTextImage/glGetTexImage/
Trivial.
Michel Dänzer [Wed, 22 Jul 2015 07:11:39 +0000 (16:11 +0900)]
radeonsi: Flush when we're asked to return a fence but don't have one yet
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Timothy Arceri [Fri, 3 Jul 2015 22:34:32 +0000 (08:34 +1000)]
mesa: fix misleading comment
Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Timothy Arceri [Wed, 17 Jun 2015 13:03:52 +0000 (23:03 +1000)]
mesa: fix active sampler conflict validation
The type stored in gl_uniform_storage is the type of a single array
element not the array type so size was always 1.
V2: Dont validate sampler units pointing to 0
Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Timothy Arceri [Thu, 2 Jul 2015 22:45:30 +0000 (08:45 +1000)]
glsl: check for leading zeros in array index validation
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Brian Paul [Wed, 22 Jul 2015 00:44:07 +0000 (18:44 -0600)]
swrast: remove unneeded & operators in _swrast_choose_texture_sample_func()
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Brian Paul [Wed, 22 Jul 2015 00:44:07 +0000 (18:44 -0600)]
mesa: move check for no-op glShadeModel call earlier
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Brian Paul [Wed, 22 Jul 2015 00:44:07 +0000 (18:44 -0600)]
mesa: move check for no-op glAlphaFunc call earlier
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Brian Paul [Wed, 22 Jul 2015 00:44:07 +0000 (18:44 -0600)]
mesa: move check for no-op glFrontFace call earlier
If the new mode matches the current mode, there can be no error.
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Brian Paul [Wed, 22 Jul 2015 00:35:38 +0000 (18:35 -0600)]
mesa: s/GLint/GLsizei/ for consistency
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Brian Paul [Wed, 22 Jul 2015 00:35:38 +0000 (18:35 -0600)]
docs: document that GL_ARB_get_texture_sub_image is completed
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Brian Paul [Wed, 22 Jul 2015 00:35:38 +0000 (18:35 -0600)]
mesa: enable GL_ARB_get_texture_sub_image for all drivers
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Brian Paul [Wed, 22 Jul 2015 00:35:38 +0000 (18:35 -0600)]
mesa: add API dispatch for GL_ARB_get_texture_sub_image
This adds the new glGetTextureSubImage() and
glGetCompressedTextureSubImage() functions. Also update the
dispatch sanity test program.
v2: remove stray brace, move xi:include line in gl_API.xml, fix extension
number typo, s/program/texture/ in xml file.
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Brian Paul [Wed, 22 Jul 2015 00:35:38 +0000 (18:35 -0600)]
mesa: add new _mesa_Get[Compressed]TextureSubImage() functions
Simple implementations in terms of get_[compressed_]texture_image().
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Brian Paul [Wed, 22 Jul 2015 00:35:38 +0000 (18:35 -0600)]
mesa: overhaul the glGetCompressedTexImage code
Same idea as the previous patch.
v2: a few clean-ups spotted by Ilia
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Brian Paul [Wed, 22 Jul 2015 00:35:38 +0000 (18:35 -0600)]
mesa: overhaul the glGetTexImage code
1. Reorganize the error checking code.
2. Lay groundwork for getting sub images by passing image offset and
dimensions to the error checking code.
3. Implement _mesa_GetnTexImageARB(), _mesa_GetTexImage() and
_mesa_GetTextureImage() all in terms of get_texture_image().
v2: pass offset/width/height/depth arguments to the error checking
function, avoid using magic width/height/depth values.
v3: remove unused bufSize param to get_texture_image()
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Brian Paul [Wed, 22 Jul 2015 00:35:38 +0000 (18:35 -0600)]
mesa: 80-column wrapping in texgetimage.c
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Brian Paul [Wed, 22 Jul 2015 00:35:38 +0000 (18:35 -0600)]
mesa: replace Driver.GetCompressedTexImage() w/ GetCompressedTexSubImage()
For now, pass offsets of zero and width/height/depth equal to the
whole image.
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Brian Paul [Wed, 22 Jul 2015 00:35:38 +0000 (18:35 -0600)]
mesa: make _mesa_get_[compressed_]texture_image() static
These functions are only called from teximage.c
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Brian Paul [Wed, 22 Jul 2015 00:35:38 +0000 (18:35 -0600)]
mesa: plumb offset/size parameters through GetTexSubImage code
Needed for GL_ARB_get_texture_sub_image. But at this point, the
offsets are always zero and the sizes match the whole texture image.
v2: Fixes, suggestions from Laura Ekstrand:
* Fix calls to ctx->Driver.UnmapTextureImage() to pass the correct
slice value.
* Added comments and assertions to check zoffset+depth<=tex->Depth before
the 'img' loops.
* Added a new zoffset==0 assert in get_tex_memcpy().
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Brian Paul [Wed, 22 Jul 2015 00:35:38 +0000 (18:35 -0600)]
mesa: replace Driver.GetTexImage with GetTexSubImage()
The new driver hook has x/y/zoffset and width/height/depth parameters
for the new glGetTextureSubImage() function.
The meta code and gallium state tracker are updated to handle the
new parameters.
Callers to Driver.GetTexSubImage() pass in offsets=0 and sizes equal
to the whole texture size.
v2: update i965 driver code, s/GLint/GLsizei/ in GetTexSubImage hook
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Brian Paul [Wed, 22 Jul 2015 00:35:38 +0000 (18:35 -0600)]
meta: add offset, width, height parameters to decompress_texture_image()
In preparation for decompressing texture sub images.
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Brian Paul [Wed, 22 Jul 2015 00:35:38 +0000 (18:35 -0600)]
meta: handle subimages in _mesa_meta_setup_texture_coords()
v2: fix depth, total_depth mix-up in meta.h, per Laura Ekstrand.
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Brian Paul [Wed, 22 Jul 2015 00:35:38 +0000 (18:35 -0600)]
mesa: assorted whitespace, formatting fixes in teximage.c
Trivial.
Brian Paul [Wed, 22 Jul 2015 00:35:38 +0000 (18:35 -0600)]
mesa: allow GL_TEXTURE_CUBE_MAP_ARRAY case for glCompressedTexSubImage3D()
Since s3tc works for cube maps and 2D arrays, it should also work for
cube arrays. NVIDIA's driver supports this too. Seems like the spec
should say this.
This is a minor follow-on fix for the commit "mesa: fix up some texture
error checks".
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Jonathan Gray [Wed, 15 Jul 2015 15:17:37 +0000 (01:17 +1000)]
mesa: include stdarg.h for va_list
Include stdarg.h for va_list. Unbreaks the build on OpenBSD:
In file included from mesa/program/dummy_errors.c:24:
../src/mesa/main/errors.h:85: error: expected declaration specifiers or '...' before 'va_list'
Signed-off-by: Jonathan Gray <jsg@jsg.id.au>
Acked-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Ilia Mirkin [Mon, 20 Jul 2015 23:58:43 +0000 (19:58 -0400)]
gallium: replace INLINE with inline
Generated by running:
git grep -l INLINE src/gallium/ | xargs sed -i 's/\bINLINE\b/inline/g'
git grep -l INLINE src/mesa/state_tracker/ | xargs sed -i 's/\bINLINE\b/inline/g'
git checkout src/gallium/state_trackers/clover/Doxyfile
and manual edits to
src/gallium/include/pipe/p_compiler.h
src/gallium/README.portability
to remove mentions of the inline define.
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Samuel Pitoiset [Tue, 21 Jul 2015 19:58:08 +0000 (21:58 +0200)]
nvc0: force cache flush when binding a new ubo
This fixes the following piglit test:
ext_transform_feedback-immediate-reuse-uniform-buffer
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Samuel Pitoiset [Tue, 21 Jul 2015 19:35:43 +0000 (21:35 +0200)]
nv50: force cache flush when binding a new ubo
This fixes the following piglit test:
ext_transform_feedback-immediate-reuse-uniform-buffer
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Vinson Lee [Tue, 21 Jul 2015 04:52:40 +0000 (21:52 -0700)]
st/mesa: Silence GCC unused-variable warning.
Silence a release build warning.
st_glsl_to_tgsi.cpp: In function 'pipe_error st_translate_program(gl_context*, uint, ureg_program*, glsl_to_tgsi_visitor*, const gl_program*, GLuint, const GLuint*, const GLuint*, const ubyte*, const ubyte*, const GLuint*, const GLuint*, GLuint, const GLuint*, const GLuint*, const ubyte*, const ubyte*, boolean, boolean)':
st_glsl_to_tgsi.cpp:5461:36: warning: unused variable 'pscreen' [-Wunused-variable]
struct pipe_screen *pscreen = st->pipe->screen;
^
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Adam Jackson [Tue, 21 Jul 2015 16:08:20 +0000 (12:08 -0400)]
r600/sb: Fix an &/&& mistake
gcc says:
sb/sb_sched.cpp: In member function 'bool r600_sb::alu_group_tracker::try_reserve(r600_sb::alu_node*)':
sb/sb_sched.cpp:492:7: warning: suggest parentheses around operand of '!' or change '&' to '&&' or '!' to '~' [-Wparentheses]
if (!trans & fbs)
It happens to be harmless; if fbs is ever non-zero, it will be VEC_210,
which is 5, so (!trans & 5) == 1 and the branch works as expected. But
logical AND is clearly what was meant.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
Anuj Phogat [Fri, 17 Jul 2015 21:14:29 +0000 (14:14 -0700)]
Revert "i965/gen9: Plugin the code for selecting YF/YS tiling on skl+"
Commit c9dbdc0 introduced some dead code which is supposed to be used
once we have Yf/Ys tiling working and performing better. Ken reported
the issue that static analysis tool now shows warnings due to the dead
code. To fix these warnings, this patch reverts the changes made in
commit c9dbdc0.
It'll be better to add the Yf/Ys tiling selection code later, when we
are ready to use it.
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Francisco Jerez [Mon, 13 Jul 2015 12:52:28 +0000 (15:52 +0300)]
i965: Fix stride field for the result of emit_uniformize().
This is essentially the same problem fixed in an earlier patch for
immediates. Setting the stride to zero will be particularly useful
for my future SIMD lowering pass, because we will be able to just
check whether the stride of a source register is zero and skip
emitting the copies required to unzip it in that case.
Instead of setting stride to zero in every caller of emit_uniformize()
I've changed the function to return the result as its return value
(previously it was being written into a caller-provided destination
register), because this way we can enforce that the result is used with
the correct regioning from the function itself.
The changes to the prototype of its VEC4 counterpart are mainly for
the sake of symmetry, VEC4 registers don't have stride.
Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Francisco Jerez [Mon, 13 Jul 2015 12:29:39 +0000 (15:29 +0300)]
i965/fs: Fix stride field for uniforms.
This fixes essentially the same problem as for immediates. Registers
of the UNIFORM file are typically accessed according to the formula:
read_uniform(r, channel_index, array_index) =
read_element(r, channel_index * 0 + array_index * 1)
Which matches the general direct addressing formula for stride=0:
read_direct(r, channel_index, array_index) =
read_element(r, channel_index * stride +
array_index * max{1, stride * width})
In either case if reladdr is present the access will be according to
the composition of two register regions, the first one determining the
per-channel array_index used for the second, like:
read_indirect(r, channel_index, array_index) =
read_direct(r, channel_index,
read(r.reladdr, channel_index, array_index))
where:
read(r, channel_index, array_index) = if r.reladdr == NULL
then read_direct(r, channel_index, array_index)
else read_indirect(r, channel_index, array_index)
In conclusion we can handle uniforms consistently with the other
register files if we set stride to zero. After lowering to a GRF
using VARYING_PULL_CONSTANT_LOAD in demote_pull_constant_loads() the
stride of the source is set to one again because the result of
VARYING_PULL_CONSTANT_LOAD is generally non-uniform.
Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Francisco Jerez [Mon, 13 Jul 2015 11:50:24 +0000 (14:50 +0300)]
i965/fs: Fix stride for immediate registers.
When the width field was removed from fs_reg the BROADCAST handling
code in opt_algebraic() started to miss a number of trivial
optimization cases resulting in the ugly indirect-addressing sequence
to be emitted unnecessarily for some variable-indexed texturing and
UBO loads regardless of one of the sources of BROADCAST being
immediate. Apparently the reason was that we were setting the stride
field to one for immediates even though they are typically uniform.
Width used to be set to one too which is why this optimization used to
work previously until the "reg.width == 1" check was removed.
The stride field of vector immediates is intentionally left equal to
one, because they are strictly speaking not uniform. The assertion in
fs_generator makes sure that immediates have the expected stride as
consistency check.
Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Iago Toral Quiroga [Mon, 20 Jul 2015 10:58:12 +0000 (12:58 +0200)]
i965/vec4: Fix liveness analysis with BRW_OPCODE_SEL
We only consider a vgrf defined by a given block if the block writes to it
unconditionally. So far we have been checking this by testing that the
instruction is not predicated, however, in the case of BRW_OPCODE_SEL,
the predication is used to select the value to write, not to decide if
the write is actually done. The consequence of this was increased life
spans for affected vgrfs, which could lead to additional register pressure.
Since NIR generates selects for conditional writes this was causing massive
register pressure in a handful of piglit and dEQP tests that had a large
number of select operations with the NIR-vec4 backend.
Fixes the following piglit tests with the NIR-vec4 backend:
spec/glsl-1.50/execution/variable-indexing/vs-output-array-vec4-index-wr-before-gs
spec/glsl-1.50/execution/variable-indexing/gs-input-array-vec4-index-rd
spec/glsl-1.50/execution/variable-indexing/vs-output-array-vec2-index-wr-before-gs
spec/glsl-1.50/execution/variable-indexing/vs-output-array-vec3-index-wr-before-gs
spec/glsl-1.50/execution/variable-indexing/vs-output-array-float-index-wr-before-gs
Fixes 80 dEQP tests with the NIR-vec4 backend in the following category:
dEQP-GLES3.functional.ubo.*
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Kenneth Graunke [Sat, 18 Jul 2015 08:22:00 +0000 (01:22 -0700)]
mesa: Rename _mesa_lookup_enum_by_nr() to _mesa_enum_to_string().
Generated by sed; no manual changes.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Samuel Pitoiset [Mon, 20 Jul 2015 19:32:43 +0000 (21:32 +0200)]
nouveau: use bool instead of boolean
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Acked-by: Ilia Mirkin <imirkin@alum.mit.edu>
Tom Stellard [Mon, 20 Jul 2015 15:12:56 +0000 (15:12 +0000)]
gallivm: Initialize LLVM Modules's DataLayout to an empty string.
This fixes crashes in llvmpipe with LLVM 3.8 and also some piglit tests
on radeonsi that use the draw module.
This is just a temporary solution. The correct solution will require
creating a TargetMachine during gallivm initialization and pulling the
DataLayout from there. This will be a somewhat invasive change, and it
will need to be validatated on multiple LLVM versions.
https://llvm.org/bugs/show_bug.cgi?id=24172
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Samuel Pitoiset [Thu, 16 Jul 2015 21:05:05 +0000 (23:05 +0200)]
nvc0: add a missing parameter to nvc0_set_shader_images()
This fixes a compilation warning introduced in commit 05a12c5
(gallium: add interface for writable shader images).
While we are at it, fix indentation and rename parameters according to
the gallium interface.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Samuel Pitoiset [Mon, 20 Jul 2015 16:47:17 +0000 (18:47 +0200)]
nouveau: always align buffers to 0x100
Only constbufs must be aligned to 0x100, but since all buffers can be
rebinded as constant buffers they must be also aligned.
This patch prevents this behaviour by aligning everything to 256-byte
increments at buffer creation.
This fixes dmesg fails for the following piglit test:
ext_transform_feedback-immediate-reuse-uniform-buffer -auto -fbo
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Samuel Pitoiset [Mon, 13 Jul 2015 11:34:31 +0000 (13:34 +0200)]
nv50: limit the maximum number of samplers to 16
NV50_3D_BIND_TSC only allows to bind 16 samplers, and since we don't
want to do anything with NV50_3D_BIND_TSC2, just limit the maximum
number of samplers to 16 like for nvc0.
This fixes dmesg fails with the following piglit test:
max-samplers
But the test still fails.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Samuel Pitoiset [Mon, 13 Jul 2015 10:52:57 +0000 (12:52 +0200)]
nv50: turn samples counts off during blit
Fixes the following piglit test:
occlusion_query_meta_no_fragments
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Samuel Pitoiset [Mon, 13 Jul 2015 10:51:21 +0000 (12:51 +0200)]
nv50: add nesting support for occlusion queries
This is loosely based on nvc0.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Alejandro Piñeiro [Fri, 17 Jul 2015 09:54:34 +0000 (11:54 +0200)]
i965/nir/fs: removed unneeded support for global variables
As functions are inlined, and nir_lower_global_vars_to_local gets
run, all global variables are lowered to local variables.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Ilia Mirkin [Mon, 20 Jul 2015 04:19:56 +0000 (00:19 -0400)]
nv50: fix max level clamping on G80
It appears that the G80 did not have support for the sampler view
first/last clamping. Put the view's last level in the place of the
texture's so that it doesn't go past what the sampler view allows.
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: mesa-stable@lists.freedesktop.org
Ilia Mirkin [Sat, 18 Jul 2015 23:02:29 +0000 (19:02 -0400)]
gm107/ir: fix indirect txq emission
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: mesa-stable@lists.freedesktop.org