Compare commits

...

3558 Commits

Author SHA1 Message Date
Emil Velikov
64d51e2507 Add release notes for the 10.2.7 release
Listing bugs fixed and changes made.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-09-06 00:47:24 +01:00
Emil Velikov
25f5457e84 Update VERSION to 10.2.7
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-09-06 00:36:45 +01:00
José Fonseca
7ffc8556ca mesa: Move declaration to top of block.
To fix MSVC build.  Trivial.
(cherry picked from commit c98b704128)
2014-09-03 16:39:53 -06:00
Kenneth Graunke
65324b89b8 i965/clip: Fix brw_clip_unfilled.c/compute_offset's assembly.
Due to the destination register width of 1 or 2, these instructions get
ExecSize 1 or 2.  But dir and offset (used as src0) are both registers
of width 4, violating the execsize >= width assertion.

I honestly don't think this could have ever worked.

Fixes Piglit's polygon-offset and polygon-mode-offset tests on Gen4-5.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=70441
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
(cherry picked from commit b7679639bc)
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=36193
2014-09-02 13:35:03 +01:00
Adam Jackson
0c739aa1d2 radeonsi: Don't use anonymous struct trick in atom tracking
I'm somewhat impressed that current gccs will let you do this, but
sufficiently old ones (including 4.4.7 in RHEL6) won't.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
(cherry picked from commit 74388dd24b)
Nominated-by: Jonathan Gray <jsg@jsg.id.au>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76789
2014-09-02 13:35:03 +01:00
Pekka Paalanen
55d28925e6 egl_dri2: fix EXT_image_dma_buf_import fds
The EGL_EXT_image_dma_buf_import specification was revised (according to
its revision history) on Dec 5th, 2013, for EGL to not take ownership of
the file descriptors.

Do not close the file descriptors passed in to eglCreateImageKHR with
EGL_LINUX_DMA_BUF_EXT target.

It is assumed, that the drivers, which ultimately process the file
descriptors, do not close or modify them in any way either. This avoids
the need to dup(), as it seems we would only need to just close the
dup'd file descriptors right after.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76188
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
(cherry picked from commit 08264e5dad)
2014-09-02 13:35:03 +01:00
Emil Velikov
ec7d081e13 mesa: fix make tarballs
Current method of generating distribution tar-balls involves manually
invoking make + target name in the appropriate places. This temporary
solution is used until we get 'make dist' working.

Currently it does not work, as in order to have the target (which is
also a filename) available in the final Makefile we need to add a PHONY
target + use the correct target name.

Cc: "10.2 10.3" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
(cherry picked from commit 88cbe3908f)

Also squashed together with:

Revert "mesa: fix make tarballs"

This reverts commit 0fbb9a599d.

Rather than adding hacks around the issue drop the sources from the
final tarball, and re-add them back with 'make dist'. This fixes a
problem when running parallel 'make install' fails as it recreates
sources and triggers partial recompilation.

Cc: "10.2 10.3" <mesa-stable@lists.freedesktop.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=83355
Reported-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Tested-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Tested-by: Kai Wasserbäch <kai@dev.carbon-project.org>
(cherry picked from commit 5a4e0f3873)
2014-09-02 13:35:02 +01:00
Dave Airlie
c4fa2bc796 i965: add missing parens in vec4 visitor
coverity reported this, Matt said it look like missing parens,
not bad identing, so lets try that.

Cc: "10.2 10.3" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Signed-off-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit 94a909ec2d)
2014-09-02 13:35:02 +01:00
Ilia Mirkin
0dad6d0ab0 nv50: attach the buffer bo to the miptree structures
The current code... makes no sense. Use nouveau_bo_ref to attach the bo
to the exposed resource so as to have the proper lifetime guarantees.

Tested-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.2 10.3" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 2c44043313)
2014-09-02 13:35:02 +01:00
Ilia Mirkin
00ef4b0ab1 nv50: mt address may not be the underlying bo's start address
With VP2, nv50_miptree is faked because the underlying bo's have to be
laid out in a certain way. This is done by adjusting the address. Make
sure that blits (and everything else for consistency) use the mt address
rather than the bo address as a base.

This fixes retrieving chroma plane with VDPAU.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=82255
Tested-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.2 10.3" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 9d52e551a5)
2014-09-02 13:35:02 +01:00
Ilia Mirkin
eb7c7032c3 nv50: set the miptree address when clearing bo's in vp2 init
The mt address is about to be used more, make sure it's set
appropriately.

Reported-by: Emil Velikov <emil.l.velikov@gmail.com>
Tested-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.2 10.3" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 2528d402b9)
2014-09-02 13:35:01 +01:00
Ilia Mirkin
a708926792 nv50/ir: avoid creating instructions that can't be emitted
When constant folding a MAD operation, we first fold the multiply and
generate an ADD. However we do so without making sure that the immediate
can be handled in the saturate case. If it can't, load the immediate in
a separate instruction.

Reported-by: Tiziano Bacocco <tizbac2@gmail.com>
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.2 10.3" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 6c2b079231)
2014-09-02 13:35:01 +01:00
Ilia Mirkin
2a967f7128 nvc0: don't make 1d staging textures linear
Experimentally, the sampler doesn't appear to like these, neither as
buffer nor as rect textures. So remove 1D from the list of texture types
to make linear when used for staging.

This fixes the OSD in mplayer for VDPAU.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.2 10.3" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 115d9a5525)
2014-09-02 13:35:01 +01:00
Ilia Mirkin
eb38556137 nv50: zero out unbound samplers
Samplers are only defined up to num_samplers, so set all samplers above
nr to NULL so that we don't try to read them again later.

Tested-by: Christian Ruppert <idl0r@qasl.de>
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.2 10.3" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 362cd26960)
2014-09-02 13:35:01 +01:00
Ilia Mirkin
836b0ae8b6 nvc0/ir: avoid infinite recursion when finding first uses of tex
In certain circumstances, findFirstUses could end up doubling back on
instructions it had already processed, resulting in an infinite
recursion. Avoid this by keeping track of already-visited instructions.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=83079
Tested-by: Tobias Klausmann <tobias.johannes.klausmann@mni.thm.de>
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.2 10.3" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit c4bb436f76)

Conflicts:
	src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.h
2014-09-02 13:34:54 +01:00
Vinson Lee
3fe59905fc gallivm: Fix build with LLVM >= 3.6 r215967.
This LLVM 3.6 commit changed EngineBuilder constructor.

commit 3f4ed32b4398eaf4fe0080d8001ba01e6c2f43c8
Author: Rafael Espindola <rafael.espindola@gmail.com>
Date:   Tue Aug 19 04:04:25 2014 +0000

    Make it explicit that ExecutionEngine takes ownership of the modules.

    git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@215967 91177308-0d34-0410-b5e6-96231b3b80d8

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-and-Tested-by: Michel Dänzer <michel.daenzer@amd.com>
(cherry picked from commit c04a6d5c29)
Nominated-by: Marek Olšák <maraeo@gmail.com>
2014-09-02 12:29:58 +01:00
Jan Vesely
8fe85c7742 gallivm: Fix build with latest LLVM
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-and-Tested-by: Michel Dänzer <michel.daenzer@amd.com>
(cherry picked from commit e28136343b)
Nominated-by: Marek Olšák <maraeo@gmail.com>

Conflicts:
	src/gallium/auxiliary/gallivm/lp_bld_debug.cpp
2014-09-02 12:29:58 +01:00
Andreas Boll
c89719e955 winsys/radeon: fix nop packet padding for hawaii
// Marek - merged cce58147eb into this one

The initial firmware for hawaii does not support type3 nop packet.
Detect the new hawaii firmware with query RADEON_INFO_ACCEL_WORKING2.
If the returned value is 3, then the new firmware is used.

This patch uses type2 for the old firmware and type3 for the new firmware.

It fixes the cases when the old firmware is used and the user wants to
manually enable acceleration.
The two possible scenarios are:
 - the kernel has no support for the new firmware.
 - the kernel has support for the new firmware but only the old firmware
   is available.

Additionaly this patch disables GPU acceleration on hawaii if the kernel
returns a value < 2. In this case the kernel hasn't the required fixes
for proper acceleration.

v2:
 - Fix indentation
 - Use private struct radeon_drm_winsys instead of public struct radeon_info
 - Rename r600_accel_working2 to accel_working2

v3:
 - Use type2 nop packet for returned value < 3

v4:
 - Fail to initialize winsys for returned value < 2

Cc: mesa-stable@lists.freedesktop.org
Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: Jérôme Glisse <jglisse@redhat.com>
Cc: Marek Olšák <marek.olsak@amd.com>
Cc: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Andreas Boll <andreas.boll.dev@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 36771dc60f)

Conflicts:
	src/gallium/winsys/radeon/drm/radeon_drm_winsys.c

Also squashed together with:

winsys/radeon: fix hawaii accel_working2 comment

accel_working2 returns 3 if the new firmware is used.

The comment wasn't updated in v3 of commit:
36771dc winsys/radeon: fix nop packet padding for hawaii

Signed-off-by: Andreas Boll <andreas.boll.dev@gmail.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 64c379a3a8)
2014-09-02 12:29:58 +01:00
Marek Olšák
6e46a1c0b3 glsl_to_tgsi: allocate and enlarge arrays for temporaries on demand
This fixes crashes if the number of temporaries is greater than 4096.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=66184

v2: added fail paths for realloc failures

Cc: 10.2 10.3 mesa-stable@lists.freedesktop.org
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
(cherry picked from commit 482def592f)

Conflicts:
	src/mesa/state_tracker/st_glsl_to_tgsi.cpp
2014-09-02 12:29:58 +01:00
Robert Bragg
86b7073739 meta: save and restore swizzle for _GenerateMipmap
This makes sure to use a no-op swizzle while iteratively rendering each
level of a mipmap otherwise we may loose components and effectively
apply the swizzle twice by the time these levels are sampled.

Signed-off-by: Robert Bragg <robert@sixbynine.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit c6f118484c)
Nominated-by: Kenneth Graunke <kenneth@whitecape.org>
2014-08-27 13:38:30 +01:00
Emil Velikov
36b8a16236 get-pick-list.sh: Require explicit "10.2" for nominating stable patches
A nomination unadorned with a specific version is now interpreted as
being aimed at the 10.3 branch, (which was recently opened).

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-08-27 13:38:30 +01:00
Carl Worth
fefeba913b Makefile: Switch from md5sums to sha256sums
We switched to these several stable releases ago, (since the MD5 algorithm has
been broken for some time), but only now did I get around to fixing this in
the Makefile rather than just performing this step manually.

CC: "10.2 10.3" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 46d03d37bf)
2014-08-27 13:38:30 +01:00
Alex Deucher
ac37c3c66e radeonsi: add new SI pci ids
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: mesa-stable@lists.freedesktop.org
(cherry picked from commit 153df68834)
2014-08-27 13:38:30 +01:00
Alex Deucher
438346b6c5 radeonsi: add new CIK pci ids
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: mesa-stable@lists.freedesktop.org
(cherry picked from commit f50b6b4895)
2014-08-27 13:38:30 +01:00
Tom Stellard
8d9a4112f2 r600g/compute: Don't initialize vertex_buffer_state masks to 0x2
cs_vertex_buffer_state.enabled_mask and
cs_vertex_buffer_state.dirty_mask are both updated when
r600_set_constant_buffer() is called, so we don't need to manually
update these values.

This fixes a crash with OpenCL programs that have a kernel with no
arguments.

https://bugs.freedesktop.org/show_bug.cgi?id=82671

CC: "10.2" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit bf7a60f41d)
2014-08-27 13:38:29 +01:00
Tom Stellard
f293bb9664 pipe-loader: Fix memory leak v2
v2:
  - Change driver_name to char*

Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
CC: "10.2" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 43d954342e)

Conflicts:
	src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c
2014-08-27 13:38:29 +01:00
Tom Stellard
0931f475fa radeon: Add work-around for missing Hainan support in clang < 3.6 v2
v2:
  - Add missing break.

https://bugs.freedesktop.org/show_bug.cgi?id=82709

CC: "10.2" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 8109664ded)
2014-08-27 13:38:29 +01:00
Brian Paul
6f8d2db2ef mesa: fix NULL pointer deref bug in _mesa_drawbuffers()
This is a follow-on fix to commit 39b40ad144.  Fixes a crash if the
user calls glDrawBuffers(0, NULL).

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=82814
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
(cherry picked from commit 31ce84a81f)
2014-08-27 13:38:29 +01:00
Marek Olšák
0374fdd5b6 radeonsi: save scissor state and sample mask for u_blitter
Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
(cherry picked from commit 7792f9858b)
2014-08-27 13:38:29 +01:00
Ilia Mirkin
fa03aa9a8a nouveau: don't keep stale pointer to free'd data
If ->sys is non-null, we might decide that it's where the data is
stored.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: <mesa-stable@lists.freedesktop.org>
(cherry picked from commit ef130b6050)
2014-08-27 13:38:29 +01:00
Ilia Mirkin
301a23c624 nouveau: make sure to invalidate any vbo state as well
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 8867ffbf95)
2014-08-27 13:38:29 +01:00
Marek Olšák
12e4e88c95 r600g: fix constant buffer fetches
Somebody forgot to do this. It was uncovered by recent st/mesa changes.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=82139

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Tested-by: Andreas Boll <andreas.boll.dev@gmail.com>
(cherry picked from commit da9c3ed304)
2014-08-27 13:38:29 +01:00
Anuj Phogat
0ecb1cfad3 i965: Bail on vec4 copy propagation for scratch writes with source modifiers
Fixes Khronos GLES3 CTS test:
dynamic_expression_array_access_vertex

Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
(cherry picked from commit 7c1ea00eaf)
2014-08-27 13:38:28 +01:00
Tom Stellard
42bd348d21 clover: Flush the command queue in clReleaseCommandQueue()
This is required by the spec.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>

CC: "10.2" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit ed3f7eadad)
2014-08-27 13:38:28 +01:00
Emil Velikov
e8d7e3bc57 cherry-ignore: reject a15088338e
The commit "radeonsi/compute: Stop leaking the input buffer" is not
meant for 10.2 as it relies on code that was never part of this
branch and breaks the build.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-08-27 13:37:26 +01:00
Emil Velikov
869e6e3955 cherry-ignore: drop whitespace fix
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-08-27 13:26:14 +01:00
Tom Stellard
a92c1b1904 radeonsi/compute: Call si_pm4_free_state() after emitting compute state
This will decrement the reference count for buffers referenced in the
command stream will prevent us from leaking them.

CC: "10.2" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 1e2e550671)
2014-08-27 13:25:19 +01:00
Tom Stellard
c5885eca15 radeonsi/compute: Update reference counts for buffers in si_set_global_binding()
CC: "10.2" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 05e9681d55)

Conflicts:
	src/gallium/drivers/radeonsi/si_compute.c
2014-08-27 13:25:19 +01:00
Emil Velikov
f1ff7753f1 cherry-ignore: PIPE_SHADER_CAP_MAX_CONST_BUFFER_SIZE is not it 10.2
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-08-27 13:24:26 +01:00
Tom Stellard
7b78cf4ae2 radeon/compute: Fix reported values for MAX_GLOBAL_SIZE and MAX_MEM_ALLOC_SIZE
There is a hard limit in older kernels of 256 MB for buffer allocations,
so report this value as MAX_MEM_ALLOC_SIZE and adjust MAX_GLOBAL_SIZE
to statisfy requirements of OpenCL.

CC: "10.2" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 77ea58ca81)
2014-08-27 13:22:46 +01:00
Emil Velikov
395d4e11cf cherry-ignore: remove patch that lacking previous dependencies
The patch clears up the msse4.1 handling, yet mesa 10.2 lacks earlier
patches that this one relies on.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-08-27 13:22:45 +01:00
Emil Velikov
cab73f6eba android: dri/i915: do not build an 'empty' driver
The variable i915_C_FILES changed to i915_FILES with commit
34d4216e64 back in mesa 9.1/9.2. Yet we've missed to update the
the android build, essentially creating an dummy/empty driver that
can never work.

Cc: "10.1 10.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
(cherry picked from commit 5facd003a0)
2014-08-25 23:45:17 +01:00
Emil Velikov
0e52107ff8 android: glsl: the stlport over the limited Android STL
The latter lacks various functionality used by mesa/glsl.

Cc: "10.1 10.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
(cherry picked from commit 07f583186d)
2014-08-25 23:39:47 +01:00
Emil Velikov
aba5b15068 android: drop HAL_PIXEL_FORMAT_RGBA_{5551,4444}
Upstream Android (system/core) has dropped these formats with commit
6bac41f1bf9(get rid of HAL pixelformats 5551 and 4444) yet does not
mention why.

These formats never really worked so we're safe to drop them as well.

Identical commit is available in the android-x86 external/mesa repo

    commit 06a2d36edc
    Author: Chih-Wei Huang <cwhuang@linux.org.tw>
    Date:   Wed Sep 25 01:16:57 2013 +0800

        android: get rid of HAL pixelformats 5551 and 4444

Cc: "10.1 10.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
(cherry picked from commit dfa6dc5eb8)
2014-08-25 23:39:30 +01:00
Emil Velikov
477babf6f4 android: gallium/auxiliary: drop log2/log2f redefitions
Recent versions of bionic has picked up support for these functions,
leading to build issues due to the redefition of the symbols.

Note: wrapping things in #ifdef does not cut it :\

Identical patch is available in chromium, android-x86 and perhaps other
projects.

    commit 66c1c789ce3407472de9ed620c9f815639058835
    Author: rmcilroy@chromium.org
    Date:   Wed Apr 02 10:59:34 2014 +0000

        Porting to x64 Android. Remove redefinitions of log2 and log2f.

        BUG=
        R=kbr@chromium.org

        Review URL: https://codereview.chromium.org/216773005

    commit 9cc0a0d2b0
    Author: Chih-Wei Huang <cwhuang@linux.org.tw>
    Date:   Sun Jul 21 23:04:19 2013 +0800

        android: remove log2, log2f

        The functions are already defined in the latest bionic.

Cc: Chia-I Wu <olvaffe@gmail.com>
Cc: "10.1 10.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Acked-by: Chia-I Wu <olvaffe@gmail.com>
(cherry picked from commit 51a9a09ba8)
2014-08-25 23:39:04 +01:00
Emil Velikov
1cab5b5144 android: egl/main: add/enable freedreno
For all everyone willing to give the freedreno driver
a go they can now build it under Android.

Cc: "10.1 10.2" <mesa-stable@lists.freedesktop.org>
Cc: Rob Clark <robclark@freedesktop.org>
Cc: freedreno@lists.freedesktop.org
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
(cherry picked from commit 792041ebe5)
2014-08-25 23:38:43 +01:00
Emil Velikov
6761e28a46 android: gallium/freedreno: add preliminary build
For all the people interested in testing the freedreno driver on
their Android devices. The next commit will hook these up within
the libEGL driver (via the gallium-egl backend).

There may be some rough edges but those can be sorted when a
willing builder/tester comes along.

v2:
 - s/freefreno/freedreno/. Spotted by Matt Turner.
 - Use the installed libdrm headers.

Cc: "10.1 10.2" <mesa-stable@lists.freedesktop.org>
Cc: Rob Clark <robclark@freedesktop.org>
Cc: freedreno@lists.freedesktop.org
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
(cherry picked from commit bf05e06757)
2014-08-25 23:38:18 +01:00
Emil Velikov
0cdebea90c automake: gallium/freedreno: drop spurious include dirs
Rather than including two extra folders only for two headers,
just prefix the headers and be done with it.

Cc: "10.1 10.2" <mesa-stable@lists.freedesktop.org>
Cc: Rob Clark <robclark@freedesktop.org>
Cc: freedreno@lists.freedesktop.org
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Rob Clark <robdclark@gmail.com>
(cherry picked from commit 458d03a4a4)

Conflicts:
	src/gallium/drivers/freedreno/Makefile.am
2014-08-25 23:35:47 +01:00
Paulo Sergio Travaglia
6601260464 android: egl/main: resolve radeon linking issues
- link against libdrm_radeon
 - link the r600 driver against libstlport
 - linkin the newly added libmesa_pipe_radeon library
required by r600 and radeonsi drivers

v2: Include pipe_radeon after pipe_r600/radeonsi.

Cc: "10.1 10.2" <mesa-stable@lists.freedesktop.org>
[Emil Velikov] Split up and add commit message.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>

(cherry picked from commit aae453afe8)
2014-08-25 23:34:29 +01:00
Paulo Sergio Travaglia
a3eb6989ad android: gallium/radeon: attempt to fix the android build
- include the correct folders
 - add a new buildscript for the common radeon folder

v2: Use the installed libdrm headers over the DRM_TOP ones.

Cc: "10.1 10.2" <mesa-stable@lists.freedesktop.org>
[Emil Velikov] Split up and add commit message.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>

(cherry picked from commit 5bbfa308c9)
2014-08-25 23:34:22 +01:00
Emil Velikov
eda6510425 android: egl/main: fixup the nouveau build
For a while the nouveau pipe driver has been a static library
and it has been using STL for even longer.
Correct add the link and cleanup the gallium_DRIVERS.

Cc: "10.1 10.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
(cherry picked from commit 825fa2873f)
2014-08-25 23:34:14 +01:00
Emil Velikov
8cb517e43a android: gallium/nouveau: fix include folders, link against libstlport
nouveau uses STL for a while now thus we need to include
external/stlport/libstlport.mk in order to get the build
at least partially working.

v2: Use the installed libdrm headers over the DRM_TOP ones.

Cc: "10.1 10.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
(cherry picked from commit 6b510c6338)
2014-08-25 23:33:31 +01:00
Emil Velikov
cdfc7c6c74 configure.ac: bail out if building gallium_gbm without gallium_egl
The former is the only user of the latter. As such building gbm
without egl makes little to no sense.

Cc: "10.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
(cherry picked from commit 1d1ec76bdf)
2014-08-25 23:32:36 +01:00
Kenneth Graunke
62f60edd77 i965/vec4: Respect ir->force_writemask_all in Gen8 code generation.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 2e180e4c09)
2014-08-25 23:27:51 +01:00
Kenneth Graunke
66f88a4640 i965/vec4: Set NoMask for GS_OPCODE_SET_VERTEX_COUNT on Gen8+.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 7b6b61ba83)
2014-08-25 23:27:44 +01:00
Ian Romanick
d82ca4e2b2 mesa: Handle uninitialized textures like other textures in get_tex_level_parameter_image
Instead of catching the special case early, handle it by constructing a
fake gl_texture_image that will cause the values required by the OpenGL
4.0 spec to be returned.

Previously, calling

    glGenTextures(1, &t);
    glBindTexture(GL_TEXTURE_2D, t);
    glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, 0xDEADBEEF, &value);

would not generate an error.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Suggested-by: Brian Paul <brianp@vmware.com>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
Cc: Anuj Phogat <anuj.phogat@gmail.com>
(cherry picked from commit ee58c71a65)
2014-08-19 15:24:18 -07:00
Carl Worth
8b056fc486 docs: Add sha256 sums for the 10.2.6 release 2014-08-19 15:17:50 -07:00
Carl Worth
346dda24bf Add release notes for the 10.2.6 release
Listing bugs fixed and changes made.
2014-08-19 14:01:02 -07:00
Carl Worth
efc7aa3187 Update VERSION to 10.2.6
In preparation for the 10.2.6 release.
2014-08-19 13:58:32 -07:00
Brian Paul
5532cf9d7e mesa: fix assertion in _mesa_drawbuffers()
Fixes failed assertion when _mesa_update_draw_buffers() was called
with GL_DRAW_BUFFER == GL_FRONT_AND_BACK.  The piglit gl30basic hit
this.

Cc: "10.2" <mesa-stable@lists.freedesktop.org>

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit 39b40ad144)
2014-08-11 14:38:22 -07:00
Maarten Lankhorst
bca8865aec configure.ac: Do not require llvm on x32
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Maarten Lankhorst <dev@mblankhorst.nl>
(cherry picked from commit 4c16e6a8e0)
2014-08-11 14:37:57 -07:00
Marek Olšák
629df2fbdd radeonsi: fix CMASK and HTILE allocation on Tahiti
Tahiti has 12 tile pipes, but P8 pipe config.

It looks like there is no way to get the pipe config except for reading
GB_TILE_MODE. The TILING_CONFIG ioctl doesn't return more than 8 pipes,
so we can't use that for Hawaii.

This fixes a regression caused by fcb6c0d2b8
(cherry picked from 9b046474c9 as part of
Mesa 10.2.5) on Tahiti.

v2: add an assertion and print an error on failure

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
(cherry picked from commit 955505f6ff)
2014-08-11 14:36:24 -07:00
Marek Olšák
22ec7df0d7 radeonsi: fix a hang with instancing in Unigine Heaven/Valley on Hawaii
This isn't documented anywhere, but it's the only thing that works
for this case.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 515269b3a7)

Conflicts:
	src/gallium/drivers/radeonsi/si_state_draw.c
2014-08-11 14:34:52 -07:00
Marek Olšák
1e0820032d radeon,r200: fix buffer validation after CS flush
This validates all bound buffers (CB, ZB, textures, DMA) at the beginning
of CS. This fixes "bo->space_accouned" assertion failures.

Tested by: Jochen Rollwagen <joro-2013@t-online.de>
Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>

(cherry picked from commit 085a861545)
2014-08-11 14:27:45 -07:00
Marek Olšák
485fd2a4eb st/mesa: fix blit-based partial TexSubImage for 1D arrays
This fixes piglit spec/EXT_texture_array/render-1darray.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
(cherry picked from commit 0b5d88a518)
2014-08-11 14:27:10 -07:00
Pali Rohár
56a455f5ba configure: check for dladdr via AC_CHECK_FUNC/AC_CHECK_LIB
Use both macros as in some cases using AC_CHECK_FUNCS alone may fail.
Thus HAVE_DLADDR will not be defined, and as a result most of the code
in megadriver_stub.c will not be compiled. Breaking the backwards
compatibility between older libGL/xserver(s) and DRI megadrivers.

Cc: Jon TURNEY <jon.turney@dronecode.org.uk>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
[Emil Velikov] Commit message.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>

(cherry picked from commit 39a4cc45a4)

Also squashed together with:

configure.ac: Use LIBS rather than LDFLAGS to add -ldl to dladdr check

ec8ebff "Check for dladdr()" erroneously uses LDFLAGS rather than LIBS to add
-ldl to the dladdr check.

Replace the workaround in 39a4cc4 of explicitly checking in libdl, with a more
correct approach of using LIBS.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Tested-by: Pali Rohár <pali.rohar@gmail.com>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit a2e1dc0cce)
2014-08-11 14:26:18 -07:00
Anuj Phogat
3e541f0ab8 meta: Fix datatype computation in get_temp_image_type()
Changes in the patch will cause datatype to be computed
correctly for 8 and 16 bit integer formats. For example:
GL_RG8I, GL_RG16I etc.

Fixes many failures in gles3 Khronos CTS test:
copy_tex_image_conversions_required
copy_tex_image_conversions_forbidden

Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
(cherry picked from commit 338fef61f8)

Conflicts:
	src/mesa/drivers/common/meta.c
2014-08-11 14:25:01 -07:00
Anuj Phogat
82d46ebc07 egl: Fix OpenGL ES version checks in _eglParseContextAttribList()
We would generate EGL_BAD_CONFIG because _eglGetContextAPIBit
returns zero for the combination of EGL_OPENGL_ES_API and a major
version > 3.  By just returning zero, the caller can't tell the
difference between a bad version (which should generate
EGL_BAD_MATCH) and a bad API (which should generate
EGL_BAD_CONFIG).  This patch causes us to filter out major
versions > 3 at a point where we can generate the correct error.

Fixes gles3 Khronos CTS test:
egl_create_context.egl_create_context

V2: Fix commit message as suggested by Ian.

Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit d308f57fe7)
2014-08-06 14:52:05 -07:00
Anuj Phogat
29e2f11f5d meta: Use _mesa_get_format_bits() to get the GL_RED_BITS
We currently get red bits from ctx->DrawBuffer->Visual.redBits
by making a false assumption that the texture we're writing to
(in glCopyTexImage2D()) is used as a DrawBuffer.

Fixes many failures in gles3 Khronos CTS test:
copy_tex_image_conversions_required

Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
(cherry picked from commit 7de90890c6)

Conflicts:
	src/mesa/drivers/common/meta.c
2014-08-06 14:50:18 -07:00
Anuj Phogat
8dc1caa1ad mesa: Allow GL_TEXTURE_CUBE_MAP target with compressed internal formats
GL_TEXTURE_CUBE_MAP is an allowed texture target in glTexStorage2D()
and is allowed to be used (like GL_TEXTURE_2D) with compressed internal
formats.

Cc: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
(cherry picked from commit c7def2257a)
2014-08-06 14:49:47 -07:00
Anuj Phogat
eef8b88e63 mesa: Add gles3 condition for normalized internal formats in glCopyTexImage*()
Fixes many failures in gles3 Khronos CTS test: packed_pixels

Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
(cherry picked from commit 2fc4205461)
2014-08-06 14:49:36 -07:00
Anuj Phogat
326648add1 mesa: Add utility function _mesa_is_enum_format_unorm()
V2: Add missing formats.

Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
(cherry picked from commit 938b3d0034)
2014-08-06 14:49:27 -07:00
Anuj Phogat
ad0d1a1ab3 mesa: Add gles3 error condition for GL_RGBA10_A2 buffer format in glCopyTexImage*()
Fixes many failures in gles3 Khronos CTS test: packed_pixels

Khronos bug# 9807
Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>

(cherry picked from commit 6df48ff27a)
2014-08-06 14:49:18 -07:00
Anuj Phogat
712933f1d6 mesa: Add a gles3 error condition for sized internalformat in glCopyTexImage*()
Fixes many failures in gles3 Khronos CTS test: packed_pixels

V2: Add the check for alpha bits to avoid confusion.

Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
(cherry picked from commit 5c0d2a12f3)
2014-08-06 14:49:10 -07:00
Anuj Phogat
8829b3c37a mesa: Add a helper function _mesa_is_enum_format_unsized()
Function is utilized by next patch in the series.

V2: Add missing formats.

Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
(cherry picked from commit e0fe00eeac)
2014-08-06 14:37:04 -07:00
Anuj Phogat
4c02b3d90e mesa: Don't allow snorm internal formats in glCopyTexImage*() in GLES3
Fixes few failures in gles3 Khronos CTS test: packed_pixels

Cc: "10.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
(cherry picked from commit 2d362a6aee)
2014-08-06 14:36:46 -07:00
Anuj Phogat
b6fe3e7ac2 mesa: Add utility function _mesa_is_enum_format_snorm()
Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
(cherry picked from commit 845b5ec89f)
2014-08-06 14:36:31 -07:00
Anuj Phogat
323f0246ef mesa: Fix condition for using compressed internalformat in glCompressedTexImage3D()
Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
(cherry picked from commit 3c7a0c690a)
2014-08-06 14:36:06 -07:00
Anuj Phogat
686247ff62 mesa: Add error condition for using compressed internalformat in glTexStorage3D()
Fixes gles3 Khronos CTS test: texture_storage_texture_internal_formats

Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
(cherry picked from commit e27c9f3a02)
2014-08-06 14:35:46 -07:00
Anuj Phogat
d21e0d34fc mesa: Turn target_can_be_compressed() in to a utility function
V2:  Declare the function in teximage.h

Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
(cherry picked from commit ac2adf66c1)
2014-08-06 14:35:17 -07:00
Anuj Phogat
8bb6628cb9 mesa: Fix error condition for valid texture targets in glTexStorage* functions
Fixes gles3 Khronos CTS test: texture_storage_texture_targets

Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
(cherry picked from commit a94d78438d)
2014-08-06 14:34:57 -07:00
Ilia Mirkin
69d6ceda43 mesa/st: only convert AND(a, NOT(b)) into MAD when not using native integers
Native integers imply a somewhat different handling of booleans. Instead
of being 1.0/0.0 floats, they are 0 (true) / -1 (false) integers. As such
the original optimization no longer applies.

Reported-by: Glenn Kennard <glenn.kennard@gmail.com>
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 7b3d0a9a1e)
2014-08-06 14:33:51 -07:00
Jordan Justen
1abd1d0430 i965/miptree: Layout 1D Array as 2D Array with height of 1
1D array miptrees were being laid out as a 2D texture with 1 slice.
This happened due to the mesa core storing the 1D array slice count in
the height field. On Intel hardware, we want to create a 2D array with
a height of 1 for the 1D array case.

Fixes assertion failure in piglit (gen6, gen8):
spec/glsl-1.30/execution/tex-miplevel-selection textureOffset 1DArrayShadow

In release builds of Mesa, this test was observed to cause a GPU hang
on gen8.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=81450
Tested-by: Ben Widawsky <ben@bwidawsk.net>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
(cherry picked from commit c860a379d2)
2014-08-06 14:33:03 -07:00
Roland Scheidegger
3baf37f076 gallivm: fix up out-of-bounds level when using conformant out-of-bound behavior
When using (d3d10) conformant out-of-bound behavior for texel fetching
(currently always enabled) the level still needs to be set to a safe value
even though the offset in the end won't get used because the level is used
to look up the mip offset itself and the actual strides, which might otherwise
crash.
For simplicity, we'll use level 0 in this case (this ought to be safe, llvmpipe
does not actually fill in level 0 information if first_level is larger, but
some random strides / offsets shouldn't hurt as ultimately we always use
offset 0 in this case).
Fixes a crash in some in-house test where random huge levels appear in
lp_build_fetch_texel() (the test actually uses level 0 always but if the
fetching happens in a block with a execution mask random values may appear).

CC: <mesa-stable@lists.freedesktop.org>

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
(cherry picked from commit 5a12155503)
2014-08-06 14:31:48 -07:00
Carl Worth
12d68e9aaf docs: Add sha256 sums to the 10.2.5 release notes 2014-08-02 19:10:30 -07:00
Carl Worth
a53047f6d1 docs: Add release notes for 10.2.5 2014-08-02 19:06:05 -07:00
Carl Worth
b83b9b677b Update version to 10.2.5
In preparation for the 10.2.5 release, of course.
2014-08-02 19:03:34 -07:00
Marek Olšák
853cd6a4f7 radeonsi: use DRAW_PREAMBLE on CIK
It's the same as setting the 3 regs separately, but shorter, and it also
seems to be required on GFX7.2 and later. This doesn't fix Hawaii.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
(cherry picked from commit 315f3c171d)
2014-07-31 15:23:14 -07:00
Christian König
c66da3d457 radeonsi: fix order of r600_need_dma_space and r600_context_bo_reloc
Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
(cherry picked from commit c8011c1885)
2014-07-31 15:22:49 -07:00
Marek Olšák
f75dfcee10 radeonsi: fix build because of lack of draw_indirect infrastructure in 10.2 2014-07-31 15:22:21 -07:00
Carl Worth
490d8ddf87 cherry-ignore: Ignore a few patches picked in the previous stable release
I don't know what happened here, but these three commits were picked earlier,
but the commit IDs referenced in their commit messages do not currently
appear in the master branch, (perhaps a force-push occurred?).

Anyway, we can ignore these now.
2014-07-30 22:09:46 -07:00
Jason Ekstrand
b9c5a8f869 main/get_hash_params: Add GL_SAMPLE_SHADING_ARB
GL_SAMPLE_SHADING is specified as a valid pname for glGet in the
GL_ARB_sample_shading extension.  It seems as if we forgot to add it to the
table of pnames.

Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: mesa-stable@lists.freedesktop.org
(cherry picked from commit 3ea922dd7c)
2014-07-30 22:09:46 -07:00
José Fonseca
c84b367b18 st/wgl: Clamp wglChoosePixelFormatARB's output nNumFormats to nMaxFormats.
While running https://github.com/nvMcJohn/apitest with apitrace I noticed that Mesa was producing bogus results:

  wglChoosePixelFormatARB(hdc, piAttribIList = {...}, pfAttribFList = &0, nMaxFormats = 1, piFormats = {19, 65576, 37, 198656, 131075, 0, 402653184, 0, 0, 0, 0, -573575710}, nNumFormats = &12) = TRUE

However https://www.opengl.org/registry/specs/ARB/wgl_pixel_format.txt states

    <nNumFormats> returns the number of matching formats. The returned
    value is guaranteed to be no larger than <nMaxFormats>.

Cc: "10.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 66a1b3a1da)
2014-07-30 22:09:46 -07:00
Marek Olšák
71102219ea r600g,radeonsi: switch all occurences of array_size to util_max_layer
This fixes 3D texture support in all these cases, because array_size is 1
with 3D textures and depth0 actually contains the "array size".
util_max_layer is universal and returns the last layer index for any texture
target.

A lot of the cases below can't actually be hit with 3D textures, but let's
be consistent.

This fixes a failure in:
    piglit layered-rendering/clear-color-all-types 3d single_level
for r600g and radeonsi, which was caused by an incorrect CMASK size
calculation.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
(cherry picked from commit a9528cef6b)
2014-07-30 22:09:45 -07:00
Marek Olšák
d26ac40bad radeonsi: fix occlusion queries on Hawaii
This was just a guess - and it worked!

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 71ce92200e)
2014-07-30 22:09:45 -07:00
Marek Olšák
50dcc2eb26 winsys/radeon: fix vram_size overflow with Hawaii
This fixes piglit spec/!OpenGL 3.1/minmax.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 156b7e244c)
2014-07-30 22:09:45 -07:00
Marek Olšák
0dfcf50639 radeonsi: fix a hang with streamout on Hawaii
I actually couldn't reproduce this one, but internal docs recommend this
workaround. Better safe than sorry.

Also, the number of dwords for the sync packets is increased by 4 instead
of 2, because it wasn't bumped last time when a new packet was added there.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 0e7f56313d)
2014-07-30 22:09:45 -07:00
Marek Olšák
6ff3da2509 radeonsi: fix a hang with instancing on Hawaii
This fixes "piglit/bin/arb_transform_feedback2-draw-auto instanced".

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 3d9e87406c)
2014-07-30 22:09:45 -07:00
Marek Olšák
378def4cab gallium/util: add a helper for calculating primitive count from vertex count
This is needed by the following commit which is a candidate for stable too.

Cc: mesa-stable@lists.freedesktop.org
(cherry picked from commit c7407b94a8)
2014-07-30 22:09:45 -07:00
Marek Olšák
fcb6c0d2b8 radeonsi: fix CMASK and HTILE calculations for Hawaii
This fixes the checkerboard pattern in glxgears and anything that triggers
fast color clear.

num_channels is always <= 8, but Hawaii has 16 pipes.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 9b046474c9)
2014-07-30 22:09:45 -07:00
Marek Olšák
d59406cdb7 r600g: switch SNORM conversion to DX and GLES behavior
it also matches GL 4.2

further discussion:
http://lists.freedesktop.org/archives/mesa-dev/2013-August/042680.html

Cc: mesa-stable@lists.freedesktop.org
(cherry picked from commit d5bcb5e8de)
2014-07-30 22:09:45 -07:00
Ilia Mirkin
f2023b8dc8 nvc0: make sure that the local memory allocation is aligned to 0x10
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 47e5a8d7a2)
2014-07-30 22:09:45 -07:00
Kenneth Graunke
37114cc2eb i965/fs: Set LastRT on the final FB write on Broadwell.
In Piglit's EXT_framebuffer_multisample/alpha-to-coverage-dual-src-blend
test, key->nr_color_regions == 2, but the dual source blend FB write has
ir->target set to 0.  So we failed to set "Last Render Target Select" on
any FB write message.

We only emit one FB write per render target, so my comment about setting
LastRT on every FB write directed at the last color region is a bit...
misinformed.  According to the documentation, depth buffer writes and
scoreboard updates happen on the FB write with LastRT set, so I believe
we want to set it only once.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit d4d886a0bc)

Conflicts:
	src/mesa/drivers/dri/i965/gen8_fs_generator.cpp
2014-07-30 22:09:45 -07:00
Anuj Phogat
f876eae80b mesa: Don't use memcpy() in _mesa_texstore() for float depth texture data
because float depth texture data needs clamping to [0.0, 1.0]. Let the
_mesa_texstore() fallback to slower path.

Fixes Khronos GLES3 CTS tests:
shadow_execution_vert
shadow_execution_frag

V2: Move the check to _mesa_texstore_can_use_memcpy() function.
    Add check for floating point data types.

Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
(cherry picked from commit 9548ba6e7b)
2014-07-30 22:09:45 -07:00
Kenneth Graunke
8e91b094c8 i965/fs: Fix gl_SampleMask handling for SIMD16 on Gen8+.
We actually want to use mov(16), not mov(8).

Fixes 7 Piglit tests: ARB_sample_shading/builtin-gl-sample-mask [2468]
and ARB_sample_shading/builtin-gl-sample-mask-simple [468].

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=80991
Reviewed-by: Matt Turner <mattst88@gmail.com>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 29af97f280)
2014-07-30 22:09:45 -07:00
Kenneth Graunke
6893c25c7b i965/fs: Fix gl_SampleID for 2x MSAA and SIMD16 mode.
We might be able to do this without an extra program key field, but this
is non-invasive and fixes the bug, for now.

This fixes the following Piglit tests on Broadwell:
- ARB_sample_shading/builtin-gl-sample-id 2
- ARB_sample_shading/builtin-gl-sample-position 2
- EXT_framebuffer_multisample/multisample-blit 2 color
- EXT_framebuffer_multisample/multisample-blit 2 color linear
- EXT_framebuffer_multisample/multisample-blit 2 depth
- EXT_framebuffer_multisample/no-color 2 depth combined
- EXT_framebuffer_multisample/no-color 2 depth separate
- EXT_framebuffer_multisample/no-color 2 depth single
- EXT_framebuffer_multisample/no-color 2 depth-computed combined
- EXT_framebuffer_multisample/no-color 2 depth-computed separate
- EXT_framebuffer_multisample/no-color 2 depth-computed single
- EXT_framebuffer_multisample/unaligned-blit 2 color msaa
- EXT_framebuffer_multisample/unaligned-blit 2 depth msaa

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=80991
Reviewed-by: Matt Turner <mattst88@gmail.com>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 38ffef7840)
2014-07-30 22:09:38 -07:00
Kenneth Graunke
62ebb85cd4 i965: Add missing persample_shading field to brw_wm_debug_recompile.
Otherwise, the performance warning for shader recompiles will just say
"something else".

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
(cherry picked from commit 4cf47c80fc)
2014-07-30 16:31:39 -07:00
Jason Ekstrand
8c8dc8c9e9 main/format_pack: Fix a wrong datatype in pack_ubyte_R8G8_UNORM
Before it was only storing one of the color components due to truncation.
With this patch it now properly stores all of them.

Reviewed-by: Brian Paul <brianp@vmware.com>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit ecd3e89b32)
2014-07-30 16:28:54 -07:00
Anuj Phogat
775895110c i965: Fix z_offset computation in intel_miptree_unmap_depthstencil()
The bug is triggered by using glTexSubImage2d() with GL_DEPTH_STENCIL
as base internal format and non-zero x, y offsets. Currently x, y
offsets are ignored while updating the texture image.

Fixes Khronos GLES3 CTS tests:
npot_tex_sub_image_2d
npot_tex_sub_image_3d
npot_pbo_tex_sub_image_2d
npot_pbo_tex_sub_image_2d

Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
(cherry picked from commit 984a02ba55)
2014-07-30 16:28:30 -07:00
Adel Gadllah
386648c555 i915: Fix up intelInitScreen2 for DRI3
Commit 442442026e updated both i915 and i965 for DRI3 support,
but one check in intelInitScreen2 was missed for i915 causing crashes
when trying to use i915 with DRI3.

So fix that up.

Reported-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
References: https://bugzilla.redhat.com/show_bug.cgi?id=1115323
References: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=754297
Tested-by: František Zatloukal <Zatloukal.Frantisek@gmail.com>
Tested-by: Dirk Griesbach <spamthis@freenet.de>
Signed-off-by: Adel Gadllah <adel.gadllah@gmail.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit b656e3c603)
2014-07-30 16:27:59 -07:00
Thorsten Glaser
0e6d8ca573 nv50: fix build failure on m68k due to invalid struct alignment assumptions
Make alignment assumptions explicit by inserting correct padding with
unknown struct members.

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 3cfe6bc9cc)
2014-07-30 16:27:23 -07:00
Tom Stellard
1233cdd98d clover: Call end_query before getting timestamp result v2
v2:
  - Move the end_query() call into the timestamp constructor.
  - Still pass false as the wait parameter to get_query_result().

Reviewed-by: Niels Ole Salscheider <niels_ole@salscheider-online.de>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>

CC: "10.2" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 74dfd86ed6)

Conflicts:
	src/gallium/state_trackers/clover/core/timestamp.cpp
2014-07-30 16:26:44 -07:00
Ian Romanick
7a856002d3 mesa: Don't allow GL_TEXTURE_{LUMINANCE,INTENSITY}_* queries outside compat profile
There are no queries for GL_TEXTURE_LUMINANCE_SIZE,
GL_TEXTURE_INTENSITY_SIZE, GL_TEXTURE_LUMINANCE_TYPE, or
GL_TEXTURE_INTENSITY_TYPE in any version of OpenGL ES or desktop OpenGL
core profile.

NOTE: Without changes to piglit, this regresses
required-sized-texture-formats.

v2: Rebase on different initial change.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Cc: "10.2 <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 9a723b970e)
2014-07-30 16:10:38 -07:00
Ian Romanick
d8074a6a1c mesa: Don't allow GL_TEXTURE_BORDER queries outside compat profile
There are no texture borders in any version of OpenGL ES or desktop
OpenGL core profile.

Fixes piglit's gl-3.2-texture-border-deprecated.

v2: Rebase on different initial change.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Cc: "10.2 <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 750286600b)
2014-07-30 16:10:11 -07:00
Carl Worth
816d37e5c5 docs: Add SHA256 checksums for the 10.2.4 release
Just after tagging the commit used to create the release.
2014-07-18 16:46:28 -07:00
Carl Worth
efe8cb1e53 Add release notes for 10.2.4
Just prior to the release.
2014-07-18 12:45:19 -07:00
Carl Worth
54733e5cb8 Update VERSION to 10.2.4
In preparation for the 10.2.4 release, of course.
2014-07-18 12:37:31 -07:00
Kenneth Graunke
6388ad51ff i965: Enable compressed multisample support (CMS) on Broadwell.
Everything is in place and appears to be working.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
(cherry picked from commit 8cf289c3ef)
2014-07-17 15:59:01 -07:00
Kenneth Graunke
ab0ad8f7e9 i965: Add 2x MSAA support to the MCS allocation function.
2x MSAA also uses 8 bits, just like 4x.  More bits are unused.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
(cherry picked from commit db184d43b0)
2014-07-17 15:59:01 -07:00
Kenneth Graunke
1c386d5c35 i965: Hook up the MCS buffers in SURFACE_STATE on Broadwell.
MCS buffers are never allocated on Broadwell, so this does nothing for
now, but puts the infrastructure in place for when they do exist.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
(cherry picked from commit a248b2a4eb)
2014-07-17 15:59:01 -07:00
Kenneth Graunke
e3c0c23873 i965: Drop SINT workaround for CMS layout on Broadwell.
According to the documentation, we don't need this SINT workaround on
Broadwell.  (Or at least, it doesn't mention that we need it.)

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
(cherry picked from commit e10311be9f)
2014-07-17 15:59:01 -07:00
Kenneth Graunke
2a90fbfce4 i965: Add plumbing for Broadwell's auxiliary surface support.
Broadwell generalizes the MCS fields to allow for multiple kinds of
auxiliary surfaces.  This patch adds the plumbing to set those values,
but doesn't yet hook any up.

v2: (by Jordan Justen) Use mt for qpitch; pitch is tiles - 1.
v3: Don't forget to subtract 1 from aux_mt->pitch.
v4: Drop unnecessary aux_mt->offset (caught by Jordan Justen).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
(cherry picked from commit fd77187689)
2014-07-17 15:59:01 -07:00
Jordan Justen
d374cfe0bc i965: Add auxiliary surface field #defines for Broadwell.
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
(cherry picked from commit a46cb6a971)
2014-07-17 15:59:01 -07:00
Matt Turner
b56908d7db i965/fs: Set correct number of regs_written for MCS fetches.
regs_written is in units of virtual GRFs.

Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit dfd117b857)
2014-07-17 15:59:01 -07:00
Eric Anholt
c6a6acb6b4 i965: Generalize the pixel_x/y workaround for all UW types.
This is the only case where a fs_reg in brw_fs_visitor is used during
optimization/code generation, and it meant that optimizations had to be
careful to not move pixel_x/y's register number without updating it.

Additionally, it turns out we had a couple of other UW values that weren't
getting this treatment (like gl_SampleID), so this more general fix is
probably a good idea (though I wasn't able to replicate problems with
either pixel_[xy]'s values or gl_SampleID, even when telling the register
allocator to reuse registers immediately)

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 66f5c8df06)
2014-07-17 15:59:00 -07:00
Kenneth Graunke
64ff84abae i965/fs: Use WE_all for gl_SampleID header register munging.
This code should execute without regard to the currently executing
channels.  Asking for gl_SampleID inside control flow might break in
strange ways.  It appears to break even at the top of the program in
SIMD16 mode occasionally as well.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: mesa-stable@lists.freedesktop.org
(cherry picked from commit 6dc9e4e22a19108057162d9d8f8c7d559545f8de)
2014-07-17 15:59:00 -07:00
Matt Turner
8f4e03c397 i965/fs: Don't use brw_imm_* unnecessarily.
Using brw_imm_* creates a source with file=HW_REG, and the scheduler
inserts barrier dependencies when it sees HW_REG. None of these are
hardware-registers in the sense that they're special and scheduling
shouldn't touch them. A few of the modified cases already have HW_REGs
for other sources, so it won't allow extra flexibility in some cases.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit c938be8ad2)
(This patch was cherry-picked to make the next commit apply cleanly.)
2014-07-17 15:59:00 -07:00
Kenneth Graunke
258f35441a i965/fs: Set force_uncompressed and force_sechalf on samplepos setup.
gen8_fs_generator uses these to decide whether to set the execution size
to 8 or 16, so we incorrectly made both of these MOVs the full width in
SIMD16 shaders.  (It happened to work out on Gen4-7.)

Setting them should also help inform optimization passes what's really
going on, which could help avoid bugs.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: mesa-stable@lists.freedesktop.org
2014-07-17 15:59:00 -07:00
Kenneth Graunke
cb04294b42 i965: Set execution size to 8 for instructions with force_sechalf set.
Both inst->force_uncompressed and inst->force_sechalf mean that the
generated instruction should be uncompressed and have an execution size
of 8.  We don't require the visitor to set both flags - setting
inst->force_sechalf by itself is supposed to be enough.

On Gen4-7, guess_execution_size() demoted instructions to 8-wide based
on the default compression state.  On Gen8+, we instead set a default
execution size, which worked great...except that we forgot to check
inst->force_sechalf when deciding whether to use 8 or 16.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: mesa-stable@lists.freedesktop.org
(cherry picked from commit 1c62126612752f6eedb66f705cc3ff1e11beea5d)
2014-07-17 15:59:00 -07:00
Matt Turner
d389a863f2 i965/vec4: Constant propagate into 2-src math instructions on Gen8.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 7192207de1)
2014-07-17 15:59:00 -07:00
Matt Turner
7fcfdfb17b i965/fs: Constant propagate into 2-src math instructions on Gen8.
total instructions in shared programs: 1878133 -> 1876986 (-0.06%)
instructions in affected programs:     153007 -> 151860 (-0.75%)

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 038eb649b3)
2014-07-17 15:59:00 -07:00
Matt Turner
8612a12a62 i965/fs: Make try_constant_propagate() static.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit aca4a951ea)
2014-07-17 15:59:00 -07:00
Matt Turner
8f787d3ca2 i965/fs: Don't fix_math_operand() on Gen >= 8.
Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit 48f1143c64)
2014-07-17 15:59:00 -07:00
Matt Turner
b323fa8957 i965/vec4: Don't fix_math_operand() on Gen >= 8.
The emit_math?_gen? functions serve to implement workarounds for the
math instruction, none of which exist on Gen8+.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit b24e1cc604)
2014-07-17 15:59:00 -07:00
Matt Turner
d5d94598cb i965/vec4: Don't return void from a void function.
Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit 0e800dfe75)
2014-07-17 15:59:00 -07:00
Kenneth Graunke
2efd0a3479 i965: Don't copy propagate abs into Broadwell logic instructions.
It's not clear what abs on logical instructions means on Broadwell, and
it doesn't appear to do anything sensible.

Fixes 270 Piglit tests (the bitand/bitor/bitxor tests with abs).

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=81157
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit a2de656278)
2014-07-17 15:59:00 -07:00
Abdiel Janulgue
1a832e5846 i965/vec4: skip copy-propate for logical instructions with negated src entries
The negation source modifier on src registers has changed meaning in Broadwell when
used with logical operations. Don't copy propagate when negate src modifier is set
and when the destination instruction is a logical op.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Abdiel Janulgue <abdiel.janulgue@linux.intel.com>
(cherry picked from commit c17db7537f)
2014-07-17 15:59:00 -07:00
Abdiel Janulgue
d55a897929 i965/fs: skip copy-propate for logical instructions with negated src entries
The negation source modifier on src registers has changed meaning in Broadwell when
used with logical operations. Don't copy propagate when negate src modifier is set
and when the destination instruction is a logical op.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Abdiel Janulgue <abdiel.janulgue@linux.intel.com>
(cherry picked from commit 609d00e13e)
2014-07-17 15:59:00 -07:00
Abdiel Janulgue
276c6bb369 i965/fs: Refactor check for potential copy propagated instructions.
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Abdiel Janulgue <abdiel.janulgue@linux.intel.com>
(cherry picked from commit a66660d2b7)
2014-07-17 15:59:00 -07:00
Marek Olšák
0273f22a10 radeonsi: add support for TXB2
This is needed by latest fixes for samplerCubeShadow with bias.
Otherwise, a crash occurs.
2014-07-17 14:29:10 -07:00
Marek Olšák
e731031372 radeonsi: fix samplerCubeShadow with bias
Pack the depth value before overwriting it with cube coordinates.

Cc: mesa-stable@lists.freedesktop.org
(cherry picked from commit b279f0143f)

Conflicts:
	src/gallium/drivers/radeonsi/si_shader.c
2014-07-14 11:46:43 -07:00
Marek Olšák
906727dccb st/mesa: fix samplerCubeShadow with bias
It has 5 coordinates: (x,y,z,depth,lodbias)

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
(cherry picked from commit a11fff329e)
2014-07-14 11:43:22 -07:00
Brian Paul
d69c9114df gallium/u_blitter: fix some shader memory leaks
The _msaa shaders weren't getting freed.
Cc: "10.2" <mesa-stable@lists.freedesktop.org>

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
(cherry picked from commit 378fa34c7b)
2014-07-10 12:59:50 -07:00
Brian Paul
9b062d2020 st/mesa: fix geometry shader memory leak
Spotted by Charmaine Lee.
Cc: "10.2" <mesa-stable@lists.freedesktop.org>

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
(cherry picked from commit d10204930f)
2014-07-10 12:59:34 -07:00
Brian Paul
37005cafa4 mesa: fix geometry shader memory leaks
Spotted by Charmaine Lee.
Cc: "10.2" <mesa-stable@lists.freedesktop.org>

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
(cherry picked from commit 176b64b811)
2014-07-10 12:59:19 -07:00
Marek Olšák
abe859d56e gallium: fix u_default_transfer_inline_write for textures
This doesn't fix any known issue. In fact, radeon drivers ignore all
the discard flags for textures and implicitly do "discard range"
for any write transfer.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
(cherry picked from commit fe6be9926f)
2014-07-10 12:58:56 -07:00
Ilia Mirkin
1e6620997f nvc0/ir: use manual TXD when offsets are involved
Something about how we're implementing offsets for TXD is wrong, just
flip to the generic quadop-based implementation in that case.

This is the minimal fix appropriate for backporting.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 114d46829d)
2014-07-10 12:58:28 -07:00
Ilia Mirkin
9fd133747b nvc0/ir: do quadops on the right texture coordinates for TXD
handleTEX moves the layer as the first argument. This makes sure that
the quadops deal with the texture coordinates.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: <mesa-stable@lists.freedesktop.org>
(cherry picked from commit afea9bae67)
2014-07-10 12:58:05 -07:00
Ilia Mirkin
5e1bfed1ca nv50/ir: ignore bias for samplerCubeShadow on nv50
Unfortunately there's no good way to do this on the nv50 shader isa.
Dropping the bias seems preferable to doing the compare post-filtering.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 1065aa92f4)
2014-07-10 12:57:43 -07:00
Ilia Mirkin
0618881c82 nv50/ir: retrieve shadow compare from first arg
This can only happen with texture(samplerCubeShadow, bias), where the
compare will be in the first argument.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 30d91e0eec)
2014-07-10 12:57:17 -07:00
Carl Worth
d00d73d1e1 docs: Add sha256 checksums for the 10.2.3 release
This was not possible until the previous commit was complete, used for
building archives, and then tagged.
2014-07-07 16:17:21 -07:00
Carl Worth
33cb9f9503 docs: Add release notes for the 10.2.3 release.
Which is imminent.
2014-07-07 16:12:42 -07:00
Rob Clark
0186858227 freedreno/a3xx: vtx formats
Add support for more vertex buffer formats.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
(cherry picked from commit 06e9536e5f)

Squashed with:

freedreno: update generated headers

Signed-off-by: Rob Clark <robclark@freedesktop.org>
(cherry picked from commit ba6a490bbc)
2014-07-07 16:09:36 -07:00
Rob Clark
b20c82f74c freedreno: fix for null textures
Some apps seem to give us a null sampler/view for texture slots which
come before the last used texture slot.  In particular 0ad triggers
this.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
(cherry picked from commit 6aeeb706d2)
2014-07-07 16:09:36 -07:00
Rob Clark
8f77fbb6af freedreno/a3xx: texture fixes
Signed-off-by: Rob Clark <robclark@freedesktop.org>
(cherry picked from commit aa78c4586d)

Squashed with:

freedreno: update generated headers

Signed-off-by: Rob Clark <robclark@freedesktop.org>
(cherry picked from commit 2456be63e9)
2014-07-07 16:09:21 -07:00
Rob Clark
afcb63802f freedreno: few caps fixes
Signed-off-by: Rob Clark <robclark@freedesktop.org>

(cherry picked from commit 286863939f)
2014-07-07 16:09:21 -07:00
Rob Clark
8b2d1068b5 freedreno/a3xx: fix blend opcode
Seems the opcodes are slightly different from a2xx.  Resync headers and
move blend_func() helper into hw generation specific code.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
(cherry picked from commit a4d229b099)
2014-07-07 16:09:20 -07:00
Rob Clark
f96e3e5351 freedreno/a3xx: fix depth/stencil gmem restore
We already multiply by bytes per pixel for this, so f3ba7611 broke
mem2gmem for depth/stencil.  Drop the now-redundant mutiply by cpp.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
(cherry picked from commit b81de5352d)
2014-07-07 16:09:20 -07:00
Rob Clark
55b6821a9f freedreno/a3xx: fix depth/stencil GMEM positioning
In cases where there was no color buf bound, there were inconsistancies
in register settings related to position of depth/stencil inside GMEM.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
(cherry picked from commit f3ba761129)

Squashed with:

freedreno: update generated headers

Signed-off-by: Rob Clark <robclark@freedesktop.org>
(cherry picked from commit 4da8267c36)
2014-07-07 16:09:00 -07:00
Rob Clark
a1b7c7d88e freedreno: use OUT_RELOCW when buffer is written
These aren't buffers we ever read back from CPU, so using incorrect
reloc fxn wasn't really harming anything.  But might as well be correct.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
(cherry picked from commit 0d54904c04)
2014-07-03 21:26:09 -07:00
Rob Clark
ff9cea8776 xa: fix segfault
Fixes:

  Program received signal SIGSEGV, Segmentation fault.
  bind_samplers (comp=0x21b054, comp=0x21b054, ctx=0x211430)
      at ../../../../../src/gallium/state_trackers/xa/xa_composite.c:445
  445						mask_pic->srf->tex->format);
  (gdb) bt
  #0  bind_samplers (comp=0x21b054, comp=0x21b054, ctx=0x211430)
      at ../../../../../src/gallium/state_trackers/xa/xa_composite.c:445
  #1  xa_composite_prepare (ctx=0x211430, comp=comp@entry=0x21b054)
      at ../../../../../src/gallium/state_trackers/xa/xa_composite.c:488
  #2  0xb6f454b4 in XAPrepareComposite (op=<optimized out>, pSrcPicture=<optimized out>,
      pMaskPicture=<optimized out>, pDstPicture=<optimized out>, pSrc=0x5b3ad8, pMask=0x0,
      pDst=0x5923b8) at msm-exa-xa.c:533

We can't yet handle solid fill mask, so explicitly reject that, rather
than segfaulting.  Otherwise DDX would need to check XA version to see
if solid fill mask were supported.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
(cherry picked from commit b7e7ae9f60)
2014-07-03 21:25:50 -07:00
Ilia Mirkin
95ff8c6f18 nvc0: add a memory barrier when there are persistent UBOs
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 9a37eb8adb)
2014-07-03 20:04:56 -07:00
Ilia Mirkin
e11b3f8fbc nv50: do an explicit flush on draw when there are persistent buffers
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 5d4f5218bb)
2014-07-03 20:04:12 -07:00
Ilia Mirkin
da80e6a1c4 nv50: disable dedicated ubo upload method
The hardware allows multiple simultaneous renders with the same
memory-backed constbufs but with each invocation having different
values. However in order for that to work, the data has to be streamed
in via the right constbuf slot. We weren't doing that for UBOs.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.2 10.1" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit b2b7c65122)
2014-07-03 20:03:06 -07:00
Aaron Watry
5ba1cf1893 radeon/llvm: Allocate space for kernel metadata operands
Previously, we were assuming that kernel metadata nodes only had 1 operand.

Kernels which have attributes can have more than 1, e.g.:
!0 = metadata !{void (i32 addrspace(1)*)* @testKernel, metadata !1}
!1 = metadata !{metadata !"work_group_size_hint", i32 4, i32 1, i32 1}

Attempting to get the kernel without the correct number of attributes led
to memory corruption and luxrays crashing out.

Fixes the cl/program/execute/attributes.cl piglit test.

Signed-off-by: Aaron Watry <awatry@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76223
CC: "10.2" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 824197efd5)
2014-07-03 20:02:17 -07:00
Thomas Hellstrom
ff02e7995c st/xa: Don't close the drm fd on failure v2
If XA fails to initialize with pipe_loader enabled, the pipe_loader's
cleanup function will close the drm file descriptor. That's pretty bad
because the file descriptor will probably be the X server driver's only
connection to drm. Temporarily solve this by dup()'ing the file descriptor
before handing it over to the pipe loader.

This fixes freedesktop.org bugzilla bug #80645.

v2: Fix CC addresses.

Cc: "10.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
(cherry picked from commit 35cf3831d7)

Conflicts:
	src/gallium/state_trackers/xa/xa_tracker.c
2014-07-03 18:42:46 -07:00
Michel Dänzer
ee4274c393 radeon/llvm: Use the llvm.rsq.clamped intrinsic for RSQ
Reviewed-and-Tested-by: Michel Dänzer <michel.daenzer@amd.com>
Tested-by: Laurent Carlier <lordheavym@gmail.com>

https://bugs.freedesktop.org/show_bug.cgi?id=80015

CC: "10.1 10.2" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit b9f501bc6b)

Squashed together with the earlier:

radeon/llvm: Adapt to AMDGPU.rsq intrinsic change in LLVM 3.5

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
(cherry picked from commit 93b6b1fa83)
2014-07-03 18:39:43 -07:00
Carl Worth
7b21ee08db cherry-ignore: Add a patch that's been rejected
It may be that the patch is just fine, but at the very least it needs a better
commit message.
2014-07-03 18:36:06 -07:00
Kenneth Graunke
f9718e4b93 i965/disasm: Fix INTEL_DEBUG=fs on Broadwell for ARB_fp applications.
Apparently INTEL_DEBUG=fs has crashed on Broadwell for anything using
ARB_fragment_program since commit 9cee3ff5.  We need to NULL-check the
right field.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit c60a4ba7e3)

Conflicts:
	src/mesa/drivers/dri/i965/gen8_fs_generator.cpp
2014-07-03 18:35:54 -07:00
Jasper St. Pierre
3ca2119593 glxext: Send the Drawable's ID in the GLX_BufferSwapComplete event
While the official INTEL_swap_event specification says that the drawable
field should contain the GLXDrawable, not the Drawable, the existing
DRI2 code in dri2.c that translates from DRI2_BufferSwapComplete sends out
GLX_BufferSwapComplete with the Drawable's ID, so existing codebases
like Clutter/Cogl rely on getting the Drawable.

Match DRI2's error here and stuff the event with the X Drawable, not
the GLX drawable.

This fixes apps seeing wrong drawables through an indirect GLX context
or with DRI3, which uses the GLX_BufferSwapComplete event directly on
the wire instead of translates Present in mesa.

At the same time, also modify the structure for the event to make sure
that clients don't make the same mistake. This is not an API or ABI
break, as GLXDrawable and Drawable are both typedefs for XID.

Signed-off-by: Jasper St. Pierre <jstpierre@mecheye.net>
Reviewed-by: Axel Davy <axel.davy@ens.fr>
Cc: "10.1 10.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit b4dcf87f34)
2014-07-03 18:03:11 -07:00
Kenneth Graunke
ad79d7e987 i965: Include marketing names for Broadwell GPUs.
Intel would like us to include the marketing names.  Developers
additionally want "Broadwell GT1/2/3" because it makes it easier
to identify what hardware users have when they request assistance
or report issues.

Including both makes it easy for everyone to map between the names.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 05126b9bb5)
2014-07-03 18:02:00 -07:00
Takashi Iwai
9bd6dc9371 llvmpipe: Fix zero-division in llvmpipe_texture_layout()
Fix the crash of "gnome-control-center info" invocation on QEMU where
zero height is passed at init.

(sroland: simplify logic by eliminating the div altogether, using 64bit mul.)

Fixes: https://bugzilla.novell.com/show_bug.cgi?id=879462

Cc: "10.2" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 6b8b17153a)
2014-07-03 18:01:14 -07:00
Ilia Mirkin
89e3b89796 nouveau: dup fd before passing it to device
nouveau screens are reused for the same device node. However in the
scenario where we create screen 1, screen 2, and then delete screen 1,
the surrounding code might also close the original device node. To
protect against this, dup the fd and use the dup'd fd in the
nouveau_device. Also tell the nouveau_device that it is the owner of the
fd so that it will be closed on destruction.

Also make sure to free the nouveau_device in case of any failure.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=79823
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@ubuntu.com>
(cherry picked from commit a59f2bb17b)
2014-07-03 18:00:37 -07:00
Tobias Klausmann
bcff69f18f nv50/ir: allow gl_ViewportIndex to work on non-provoking vertices
Previously, if we had something like:

  gl_ViewportIndex = idx;
  for(int i = 0; i < gl_in.length(); i++) {
     gl_Position = gl_in[i].gl_Position;
     EmitVertex();
  }
  EndPrimitive();

The right viewport index would not be set on the primitive because the
last vertex is the provoking one. However blob drivers appear to move
the gl_ViewportIndex write into the for loop, allowing the application
to be ignorant of this detail.

While the application is technically wrong here, because the blob does
it and other drivers appear to implicitly work this way as well, we add
a buffer register that viewport index writes go into, which is then
exported before every EmitVertex() call.

This fixes the remaining piglit tests in ARB_viewport_array for nv50/nvc0.

Signed-off-by: Tobias Klausmann <tobias.johannes.klausmann@mni.thm.de>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
(cherry picked from commit 98a86f61a8)
2014-07-03 17:46:01 -07:00
Roland Scheidegger
6ae4aff303 draw: (trivial) fix clamping of viewport index
The old logic would let all negative values go through unclamped, with
potentially disastrous results (probably trying to fetch viewport values
from random memory locations). GL has undefined rendering for vp indices
outside valid range but that's a bit too undefined...
(The logic is now the same as in llvmpipe.)

CC: "10.1 10.2" <mesa-stable@lists.freedesktop.org>

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Tested-by: Ilia Mirkin <imirkin@alum.mit.edu>
(cherry picked from commit 604e54de78)
2014-07-03 17:44:50 -07:00
Kenneth Graunke
500849f9cf i965: Don't emit SURFACE_STATEs for gather workarounds on Broadwell.
As far as I can tell, Broadwell doesn't need any of the SURFACE_STATE
workarounds for textureGather() bugs, so there's no need to emit
a second set of identical copies.

To keep things simple, just point the gather surface index base to the
same place as the texture surface index base.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit f6a99d1167)
2014-07-03 17:44:43 -07:00
Carl Worth
05add05438 docs: Add sha256 sums for the 10.2.2 release
Which, of course, we couldn't do until making the release files and tagging
the release.
2014-06-24 21:45:41 -07:00
Carl Worth
623e68fb1b docs: Add release notes for 10.2.2 release
Which is ready to go.
2014-06-24 21:30:02 -07:00
Carl Worth
a9750ff7b5 Update VERSION to 10.2.2
In preparation for the 10.2.2 release.
2014-06-24 21:26:25 -07:00
Ville Syrjälä
274be620a8 i915: Fix gen2 texblend setup
Fix an off by one in the texture unit walk during texblend
setup on gen2. This caused the last enabled texunit to be
skipped resulting in totally messed up texturing.

This is a regression introduced here:
 commit 1ad443ecdd
 Author: Eric Anholt <eric@anholt.net>
 Date:   Wed Apr 23 15:35:27 2014 -0700

    i915: Redo texture unit walking on i830.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
(cherry picked from commit ca55a1aaa7)
2014-06-23 15:04:35 -07:00
Kenneth Graunke
5751b661ad i965: Save meta stencil blit programs in the context.
When the last context in a share group is destroyed, the hash table
containing all of the shader programs (ctx->Shared->ShaderObjects) is
destroyed, throwing away all of the shader programs.

Using a static variable to store program IDs ends up holding on to them
after this, so we think we still have a compiled program, when it
actually got destroyed.  _mesa_UseProgram then hits GL errors, since no
program by that ID exists.

Instead, store the program IDs in the context, so we know to recompile
if our context gets destroyed and the application creates another one.

Fixes es3conform tests when run without -minfmt (where it creates
separate contexts for testing each visual).

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77865
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit a20994d616)

Conflicts:
	src/mesa/drivers/dri/i965/brw_meta_stencil_blit.c
2014-06-23 15:04:11 -07:00
Daniel Manjarres
282ca8ba98 glx: Don't crash on swap event for a Window (non-GLXWindow)
Prior to GLX 1.3 there was the glxMakeCurrent() function that took a
single drawable handle. The Drawable could be either a bare XID for a
Window or an XID for a glxpixmap.

GLX 1.3 added glxMakeContextCurrent that takes 2 handles: one for
reading, one for writing. Nowadays the old glxMakeCurrent call is
implemented as a call to glxMakeContextCurrent with the single handle
duplicated.

Because of this it is allowed to use a plain-old Window ID as an
argument to glxMakeContextCurrent, although nobody really documents this
sort of thing. The manpage for the NEW call specifies the arguments as
GLXPixmaps, but the actual code accepts Window XIDs too, and handles
them correctly.

Similarly, the glxSelectEvents function can also take a bare Window XID.

The "piglit" tests all use GLXWindows and/or GLXPixmaps. You never
tested swap events with a bare Window XID. That is what my app was
doing.

The swap_events code worked with Window XIDs in mesa 7.x.y. The new code
added in versions 8, 9, and 10 assumes that all buffer swap events have
a GLXPixmap associated with them. Because of the historical quirks
above, this is not true. Swap events for bare Window XIDs do NOT have a
glxpixmap resulting in a segfault.

Any app that uses the old school glxMakeCurrent call with a Window XID
while trying to use swap_events will crash when the libs try to lookup
the nonexistent GLXPixmap associated with the incoming swap event.

I believe that the people who wrote the spec overlooked this, because
the "sbc" field comes from the OML_sync extension that is defined in
terms of glxpixmaps only.

v2 (idr): Formatting changes.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54372
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Cc: "10.1 10.2" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 86bd2196b4)
2014-06-23 15:01:16 -07:00
Iago Toral Quiroga
c50fa76c7e mesa: Copy Geom.UsesEndPrimitive when cloning a geometry program.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Cc: "10.1 10.2" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 96a95f48ea)
2014-06-23 15:01:06 -07:00
Tom Stellard
ad9264366a clover: Don't use llvm's global context
An LLVMContext should only be accessed by a single and using the global
context was causing crashes in multi-threaded environments.  Now we use
a separate context for each compile.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>

CC: "10.1 10.2" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 4aa128a123)
2014-06-23 15:00:49 -07:00
Tom Stellard
855adad132 clover: Prevent Clang from printing number of errors and warnings to stderr.
https://bugs.freedesktop.org/show_bug.cgi?id=78581

CC: "10.1 10.2" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 0cc391f013)
2014-06-23 15:00:37 -07:00
Ilia Mirkin
3568cf8128 nv30: hack to avoid errors on unexpected color/zeta combinations
This is just a hack, it should be possible to create a temporary zeta
surface and render to that instead. However that's more complicated and
this avoids the render being entirely broken and errors being reported
by the card.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 25182e249e)
2014-06-23 15:00:14 -07:00
Ilia Mirkin
aca2d98c35 nv30: avoid dangling references to deleted contexts
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit c092c46b27)
2014-06-23 15:00:00 -07:00
Ilia Mirkin
08317fa9c4 nv30: plug some memory leaks on screen destroy and shader compile
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 5af80f6268)
2014-06-23 14:59:47 -07:00
Ian Romanick
4d0c445af6 meta: Respect the driver's maximum number of draw buffers
Commit c1c1cf5f9 added infrastructure for saving and restoring draw
buffer state.  However, it universially used MAX_DRAW_BUFFERS, but many
drivers support far fewer than that at limit.  For example, the radeon
and i915 drivers only support 1.  Using MAX_DRAW_BUFFERS causes meta to
generate GL errors.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=80115
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Kenneth Graunke <kenneth@whitecape.org> [on Broadwell]
Tested-by: jpsinthemix@verizon.net
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit cc219d1d65)
2014-06-23 14:59:28 -07:00
Kristian Høgsberg
9ad103d664 mesa: Remove glClear optimization based on drawable size
A drawable size of 0x0 means that we don't have buffers for a drawable yet,
not that we have a zero-sized buffer.  Core mesa shouldn't be optimizing out
drawing based on buffer size, since the draw call could be what triggers
the driver to go and get buffers.  As discussed in the referenced bug report,
the optimization was added as part of a scatter-shot attempt to fix a
different problem.  There's no other example in mesa core of using the
buffer size in this way.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=74005
Cc: "10.1 10.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit 7928b946ad)
2014-06-23 14:59:06 -07:00
Grigori Goronzy
12fcbcde47 radeon/uvd: disable VC-1 simple/main on UVD 2.x
It's about as broken as on later UVD revisions.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=66452
Cc: "10.1 10.2" <mesa-stable@lists.freedesktop.org>

Reviewed-by: Christian König <christian.koenig@amd.com>
(cherry picked from commit 6cd30f5d73)
2014-06-23 14:58:46 -07:00
Ilia Mirkin
d8e3158a43 nv50: make sure to mark first scissor dirty after blit
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit af05270ccf)
2014-06-23 14:58:33 -07:00
Kenneth Graunke
ef5f998b76 i965: Use 8x4 aligned rectangles for HiZ operations on Broadwell.
Like on Haswell, we need to use 8x4 aligned rectangle primitives for
hierarchical depth buffer resolves and depth clears.  See the comments
in brw_blorp.cpp's brw_hiz_op_params() constructor.  (The Broadwell
documentation confirms that this is still necessary.)

This patch makes the Broadwell code follow the same behavior as Chad and
Jordan's Gen7 BLORP code.  Based on a patch by Topi Pohjolainen.

This fixes es3conform's framebuffer_blit_functionality_scissor_blit
test, with no Piglit regressions.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 49659ad90c)
2014-06-23 14:58:22 -07:00
Kenneth Graunke
31dd2a6f18 i965/vec4: Use the sampler for pull constant loads on Broadwell.
We've used the LD sampler message for pull constant loads on earlier
hardware for some time, and also were already using it for the FS on
Broadwell.  This patch makes us use it for Broadwell VS/GS as well.

I believe that when I wrote this code in 2012, we still used the data
port in some cases, and I somehow neglected to convert it while
rebasing.

Improves performance in GLBenchmark 2.7 Egypt by 416.978% +/- 2.25821%
(n = 17).  Many other applications should benefit similarly: this speeds
up uniform array access in the VS, which is commonly used for skinning
shaders, among other things.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Tested-by: Ben Widawsky <ben@bwidawsk.net>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 5d8e246ac8)
2014-06-23 14:57:56 -07:00
Kenneth Graunke
c07485eab1 i965: Add missing newlines to a few perf_debug messages.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 847abaccc0)
2014-06-23 14:57:27 -07:00
Kenneth Graunke
3b941857ee i965: Drop Broadwell perf_debugs about missing MOCS that aren't missing.
I actually added MOCS support for these things, but forgot to delete the
corresponding perf_debug() warnings.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit d053a05ef3)
2014-06-23 14:56:50 -07:00
Kenneth Graunke
6b753df1f4 i965: Add missing MOCS setup for 3DSTATE_INDEX_BUFFER on Broadwell.
Somehow I missed this when adding all of the other MOCS values.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 7f256c1c70)
2014-06-23 14:56:31 -07:00
Kenneth Graunke
01a79ac679 i965/vec4: Fix dead code elimination for VGRFs of size > 1.
When faced with code such as:

    mov vgrf31.0:UD, 960D
    mov vgrf31.1:UD, vgrf30.xxxx:UD

The dead code eliminator didn't consider reg_offsets, so it decided that
the second instruction was writing was writing to the same register as
the first one, and eliminated the first one.  But they're actually
different registers.

This fixes INTEL_DEBUG=shader_time for vertex shaders.  In the above
code, vgrf31.0 represents the offset into the shader_time buffer where
the data should be written, and vgrf31.1 represents the actual time
data.  With a completely undefined offset, results were...unexpected.

I think this is probably one of the few cases (maybe only case) where we
generate multiple MOVs to a large VGRF.  Normally, we just use them as
texturing results; the other SEND-from-GRF uses a size 1 VGRF.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=79029
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Cc: mesa-stable@lists.freedesktop.org
(cherry picked from commit d0575d98fc)
2014-06-23 14:56:11 -07:00
Jason Ekstrand
83be6a5517 meta_blit: properly compute texture width for the CopyTexSubImage fallback
Cc: "10.2" <mesa-stable@lists.freedesktop.org>

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
(cherry picked from commit ffe609cc69)
2014-06-23 14:55:48 -07:00
Emil Velikov
348125e7f7 configure: correctly autodetect xvmc/vdpau/omx
Commit e62b7d38a1 (configure: autodetect video state-trackers
when non swrast driver is present) added a check that caused
the autodetection to be omitted when we have the swrast gallium
driver. Whereas it should have skipped the VL targets when only
swrast was selected.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=79907
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
(cherry picked from commit 816d392b58)
2014-06-23 11:47:24 -07:00
Neil Roberts
126600c918 i965: Set the fast clear color value for texture surfaces
When a multisampled texture is used for sampling the fast clear color value
needs to be programmed into the surface state. This was being left as all
zeroes so if the surface was cleared to a value other than black then it
wouldn't work properly. This doesn't matter for single-sample textures because
in that case the MCS buffer is resolved before it is used as a texture source.

https://bugs.freedesktop.org/show_bug.cgi?id=79729

Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Cc: "10.1 10.2" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 765efeef88)
2014-06-23 11:47:04 -07:00
Kenneth Graunke
ee2035a95f i965: Invalidate live intervals when inserting Gen4 SEND workarounds.
We need to invalidate the live intervals when inserting new
instructions.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Cc: mesa-stable@lists.freedesktop.org
(cherry picked from commit 237aac39b1)
2014-06-23 11:46:43 -07:00
Kenneth Graunke
07a6f8bcab i965: Don't use the head sentinel as an fs_inst in Gen4 workaround code.
When walking backwards, we want to stop at the head sentinel, which is
where scan_inst->prev->prev == NULL, not scan_inst->prev == NULL.

Fixes random crashes, as well as valgrind errors.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Cc: mesa-stable@lists.freedesktop.org
(cherry picked from commit ecc78eab11)
2014-06-23 11:46:17 -07:00
Michel Dänzer
1d46c58b83 configure: Only check for OpenCL without LLVM when the latter is certain
LLVM is enabled by default for some architectures, but the test was failing
before that.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>

Cc: "10.1 10.2" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 2d399bb183)
2014-06-23 11:45:48 -07:00
Adrian Negreanu
f7fd6e52ec android, dricore: undefined reference to _mesa_streaming_load_memcpy
_mesa_streaming_load_memcpy is defined in main/streaming-load-memcpy.c
I'm adding it to the dricore lib

Cc: "10.1 10.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Adrian Negreanu <adrian.m.negreanu@intel.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
(cherry picked from commit 357a8b6f33)
2014-06-23 11:43:11 -07:00
Adrian Negreanu
a46fa0f9de android, mesa_gen_matypes: pull in timespec POSIX definition
This fixes:
  include/c11/threads_posix.h: In function 'cnd_timedwait':
  include/c11/threads_posix.h:140:21: error: storage size of 'abs_time' isn't known

Cc: "10.1 10.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Adrian Negreanu <adrian.m.negreanu@intel.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
(cherry picked from commit 6eb3888c86)
2014-06-23 11:43:02 -07:00
Adrian Negreanu
f4a19c1e2c android, egl: typo dri2_fallback_pixmap_surface -> dri2_fallback_create_pixmap_surface
I used commit bc8b07a6 as reference, and only the droid_display_vtbl had this issue.

This fixes:
src/egl/drivers/dri2/platform_android.c:641:29:
  error: 'dri2_fallback_pixmap_surface' undeclared here (not in a function)

Cc: "10.1 10.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Adrian Negreanu <adrian.m.negreanu@intel.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
(cherry picked from commit 6980cae6ae)
2014-06-23 11:42:53 -07:00
Adrian Negreanu
bed18b082a android, egl: add correct drm include for libmesa_egl_dri2
Fixes:
  src/egl/drivers/dri2/platform_android.c:38:
  include/GL/internal/dri_interface.h:51:17:
    fatal error: drm.h: No such file or directory

Cc: "10.1 10.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Adrian Negreanu <adrian.m.negreanu@intel.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
(cherry picked from commit 4dc5545eff)
2014-06-23 11:42:42 -07:00
Adrian Negreanu
43752c3c37 android: add src/gallium/auxiliary as include path for libmesa_dricore
This fixes:
In file included from
/home/adrian/workspace/mesa/mesa-master.git/src/mesa/vbo/vbo_exec_api.c:445:0:
/home/adrian/workspace/mesa/mesa-master.git/src/mesa/vbo/vbo_attrib_tmp.h:28:38:
fatal error: util/u_format_r11g11b10f.h: No such file or directory

Cc: "10.1 10.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Adrian Negreanu <adrian.m.negreanu@intel.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
(cherry picked from commit 0048483f73)
2014-06-23 11:40:25 -07:00
Adrian Negreanu
aa03f78fc8 android: add libloader to libGLES_mesa and libmesa_egl_dri2
This fixes
  src/egl/drivers/dri2/platform_android.c:664: error: undefined reference to 'loader_set_logger'
  src/egl/drivers/dri2/platform_android.c:678: error: undefined reference to 'loader_get_driver_for_fd'

Cc: "10.1 10.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Adrian Negreanu <adrian.m.negreanu@intel.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
(cherry picked from commit a49ebfab1d)
2014-06-23 11:40:14 -07:00
Adrian Negreanu
6194593661 android: adapt to the megadriver mechanism
Fixes linker error:
  ld:
  .../libmesa_dri_common_intermediates/libmesa_dri_common.a(dri_util.o):
    in function globalDriverAPI:dri_util.c(.data.rel+0x0): error:
    undefined reference to 'driDriverAPI'

As an example, you can see that mesa_dri_drivers
also uses common/libmegadriver_stub (src/mesa/drivers/dri/Makefile.am)

The _stub part might be confusing, but
it actually provides the dri-driver shared lib constructor,
megadriver_stub_init, which will later on load the real
platform dependent part and call
l __driDriverGetExtensions_<platform>

Cc: "10.1 10.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Adrian Negreanu <adrian.m.negreanu@intel.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
(cherry picked from commit aba0f152be)
2014-06-23 11:39:59 -07:00
Adrian Negreanu
7654120e86 add megadriver_stub_FILES
So that android part can also use $(megadriver_stub_FILES)

Cc: "10.1 10.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Adrian Negreanu <adrian.m.negreanu@intel.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
(cherry picked from commit eb3f80dbba)
2014-06-23 11:39:43 -07:00
Emil Velikov
d6d80b44c4 configure: error out when building opencl without LLVM
Cc: Tom Stellard <thomas.stellard@amd.com>
Cc: "10.1 10.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
(cherry picked from commit 93257a56b5)
2014-06-23 11:39:28 -07:00
José Fonseca
a5d00e243c mesa/main: Prevent sefgault on glGetIntegerv(GL_ATOMIC_COUNTER_BUFFER_BINDING).
A recent ApiTrace change, that tries to dump more buffer state
causes Mesa from my distro (10.1.4) to segfaults here.

I haven't actually confirm this fixes it (I can't repro on master),
but it seems a good idea to be defensive here anyway.

Cc: "10.1 10.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit eb58aa9cf0)
2014-06-23 11:39:15 -07:00
Ilia Mirkin
bfff355cef gk110/ir: fix bfind emission
There is a short-immediate version as well, but it should never end up
getting used since it would have gotten folded earlier.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit bd7dd3ed06)
2014-06-23 11:38:58 -07:00
Ilia Mirkin
1e1bdee5ec gk110/ir: fix emitting constbuf file index
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 7a67318794)
2014-06-23 11:38:38 -07:00
Ilia Mirkin
9e50fc3812 gk110/ir: emit saturate flag on fadd when needed
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 4a3a71a183)
2014-06-23 11:38:10 -07:00
Emil Velikov
8c319b3f98 targets/xa: limit the amount of exported symbols
In the presence of LLVM the final library exports every symbol from
the llvm namespace. Resolve this by using a version script (w/o the
version/name tag).

Considering that there are only ~35 symbols, explicitly list them
to minimize the chances of rogue symbols sneaking in.

v2: Conditionally include the version-script.

Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com> (v1)
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
(cherry picked from commit a75baba2f1)
Signed-off-by: Andreas Boll <andreas.boll.dev@gmail.com>
2014-06-16 15:32:16 +02:00
Ian Romanick
70ce1031e7 docs: Add MD5 checksum, etc. for 10.2.1 release
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-06 23:28:53 -07:00
Ian Romanick
8c4845d29b docs: Add initial 10.2.1 release notes
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-06 23:20:00 -07:00
Ian Romanick
1b69ea1c6d Bump version to 10.2.1 2014-06-06 23:20:00 -07:00
Ian Romanick
c2fc9fb907 radeonsi: Fix build error introduced in 5ab9a9c
While resolving conflicts in cherry picking commit d226191, I
accidentally introduced some garbage.  Because radeonsi isn't built by
default, the problem went unnoticed by me.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reported-by: Laurent Carlier <lordheavym@gmail.com>
Tested-by: Laurent Carlier <lordheavym@gmail.com>
2014-06-06 23:19:53 -07:00
Ian Romanick
28d41e409d docs: Add MD5 checksum, etc. for 10.1 release
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-06 21:17:02 -07:00
Ian Romanick
f836ef63fd Bump version to 10.2 (final)
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-06 20:40:00 -07:00
Ilia Mirkin
99b9a0973a gk110/ir: fix slct emission
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 9fef8b3d81)
2014-06-06 20:40:00 -07:00
Ilia Mirkin
d36d53b564 gk110/ir: fix interp mode emission
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit d588a4919b)
2014-06-06 18:40:58 -07:00
Ilia Mirkin
283cd12933 nvc0: don't bother trying to set up compute for gk110+
The nouveau fw currently prints a bunch of errors. No point in seeing
those all the time, esp since compute doesn't really work in the first
place.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Ben Skeggs <bskeggs@redhat.com>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>

Conflicts:
	src/gallium/drivers/nouveau/nvc0/nvc0_screen.c
(cherry picked from commit ca65fc418f)
2014-06-06 18:40:21 -07:00
Ilia Mirkin
aa8ea648f4 gk110: add in forgotten code for gk110 isa
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Ben Skeggs <bskeggs@redhat.com>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>

Conflicts:
	src/gallium/drivers/nouveau/nvc0/nvc0_surface.c
(cherry picked from commit b9ec766bd0)
2014-06-06 18:37:07 -07:00
Ilia Mirkin
e901f40764 gk110/ir: fix ISAD emission with register args
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit ed1b9e5721)
2014-06-06 18:19:45 -07:00
Ilia Mirkin
d5e47ee66b gk110/ir: fix quadon opcode emission
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 6e046508a1)
2014-06-06 18:19:10 -07:00
Ilia Mirkin
932a5dadda gk110/ir: emit texbar the same way that the blob does
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Ben Skeggs <bskeggs@redhat.com>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 73eec47ef8)
2014-06-06 18:14:50 -07:00
Tobias Klausmann
203bc289a0 nv50/ir: clear subop when folding constant expressions
Some operations (e.g. OP_MUL/OP_MAD/OP_EXTBF) might have a subop set.
After folding, make sure that it is cleared

Signed-off-by: Tobias Klausmann <tobias.johannes.klausmann@mni.thm.de>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.1 10.2" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 3164bfc734)
2014-06-06 18:14:22 -07:00
Kenneth Graunke
11b3011805 i965: Support GL_CLAMP natively on Broadwell.
The new hardware actually supports this OpenGL 1.x feature natively,
so we can finally drop our shader workarounds.

Not many applications use GL_CLAMP, and most use it unintentionally, but
it's trivial to do right, so we should.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 221169693b)
2014-06-06 18:13:03 -07:00
Kenneth Graunke
c62bc58cce i965: Pass brw to translate_wrap_mode().
This lets us do generation checks.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 7f3d64a77b)
2014-06-06 18:12:20 -07:00
Kenneth Graunke
304e80e356 i965: Fix copy and pasted values in Broadwell code.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 7913b4b97b)
2014-06-06 18:11:54 -07:00
Sinclair Yeh
f4aca6868a egl: Check for NULL native_window in eglCreateWindowSurface
We have customers using NULL as a way to test the robustness of the API.
Without this check, EGL will segfault trying to dereference
dri2_surf->wl_win->private because wl_win is NULL.

This fix adds a check and sets EGL_BAD_NATIVE_WINDOW

v2: Incorporated feedback from idr - moved the check to a higher level
function.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Cc: "10.1 10.2" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 91ff0d4c65)
2014-06-06 18:11:30 -07:00
Marek Olšák
5ab9a9c0cc r600g,radeonsi: don't use hardware MSAA resolve if dst is fast-cleared
It doesn't work and our docs say so too.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
(cherry picked from commit d226191820)
2014-06-06 18:08:23 -07:00
Marek Olšák
ae16f443c2 r600g,radeonsi: disable fast clear if render condition is on
For some reason, CP DMA doesn't follow the predicate bit if I enable it,
so this is the only option.

This fixes piglit: spec/NV_conditional_render/clear

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
(cherry picked from commit bf701a84eb)
2014-06-06 18:03:10 -07:00
José Fonseca
b8241bb3f2 mesa: Make glGetIntegerv(GL_*_ARRAY_SIZE) return GL_BGRA.
Same as b026b6bbfe, but
COLOR_ARRAY_SIZE/SECONDARY_COLOR_ARRAY_SIZE.

Ideally we wouldn't munge the incoming state, so that we wouldn't need
to unmunge it back on glGet*.  But the array size state is copied and
referred in many places, many of which couldn't take an GLenum like
GL_BGRA instead of a plain integer.  So just hack around on glGet*,
to ensure there is no risk of introducing regressions elsewhere.

This bug causes problems to Apitrace, resulting in wrong traces.  See
https://github.com/apitrace/apitrace/issues/261 for details.

Tested with piglit arb_vertex_array_bgra-get, which was created for this
purpose.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Cc: "10.1 10.2" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit e3e13d6b85)
2014-06-06 17:54:32 -07:00
José Fonseca
224c193237 mesa/main: Make get_hash.c values constant.
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Cc: "10.1 10.2" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 53468dee03)
2014-06-06 17:35:45 -07:00
Beren Minor
494f916125 egl/main: Fix eglMakeCurrent when releasing context from current thread.
EGL 1.4 Specification says that
eglMakeCurrent(display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT)
can be used to release the current thread's ownership on the surfaces
and context.

MESA's egl implementation was only accepting the parameters when the
KHR_surfaceless_context extension is supported.

[chadv] Add quote from the EGL 1.4 spec.
Cc: "10,1, 10.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
(cherry picked from commit 0ca0d5743f)
2014-06-06 17:15:51 -07:00
Marek Olšák
767bc05309 Revert "glx: load dri driver with RTLD_LOCAL so dlclose never fails to unload"
This reverts commit e3cc0d90e1.

It breaks too many apps and completely breaks my desktop too.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=79469

We'll probably need to re-release all stable versions after this is committed.

Cc: "10.1 10.2" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 0d5ec2c615)
2014-06-06 17:13:03 -07:00
Roland Scheidegger
3aaae6056e llvmpipe: fix crash when not all attachments are populated in a fb
Framebuffers can have NULL attachments since a while. llvmpipe handled
that properly for lp_rast_shade_quads_mask but it seems the change didn't
make it to lp_rast_shade_tile.
This fixes piglit fbo-drawbuffers-none test (though I need to increase
the FB_SIZE from 32 to 256 so the tris cover some tiles fully).
https://bugs.freedesktop.org/show_bug.cgi?id=79421

Cc: "10.1 10.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
(cherry picked from commit 576868140b)
2014-06-06 17:06:55 -07:00
Ian Romanick
8b71741222 Bump version to 10.2-rc5
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2014-05-30 17:11:47 -07:00
Lubomir Rintel
15ec4ef0da i915: add a missing NULL pointer check
mesaVisual can be NULL with configless context since this commit:

    commit 551d459af4
    Author: Neil Roberts <neil@linux.intel.com>
    Date:   Fri Mar 7 18:05:47 2014 +0000

    Add the EGL_MESA_configless_context extension
...
    Previously the i965 and i915 drivers were explicitly creating a zeroed visual
    whenever 0 is passed for the EGLConfig.

We attempt to dereference the visual in i915 and now we don't create a
zeroed-out one one it crashes, breaking at least weston in an i915. There's
no point in doing so as it would be zero anyway.

v2: Fixed a typo in commit message.  Added some tags.

Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1100967
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit 90b5747856)
2014-05-30 17:11:47 -07:00
Ian Romanick
9fde5670e2 glapi: Duplicate GLES1 prototypes in glapi_dispatch.c
These prototypes are necessary because GLES1 library builds will create
dispatch functions for them.  We can't directly include GLES/gl.h
because it would conflict the previously-included GL/gl.h.  Since GLES1
ABI is not expected to every add more functions, the path of least
resistance is to just duplicate the prototypes for the functions that
aren't already in desktop OpenGL.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=79294
Acked-by: Matt Turner <mattst88@gmail.com>
Tested-by: Andreas Boll <andreas.boll.dev@gmail.com>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 7b1aeec9cd)
2014-05-30 17:11:47 -07:00
Ilia Mirkin
76e112380a nvc0: revert mistaken logic to collapse color outputs to the beginning
In commit af38ef907, I added a "fix" to color outputs not being assigned
correctly when sample mask was being output. This was totally wrong --
the color indices (i.e. "si" values) were the ones that were wrong. Undo
that hunk.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Acked-by: Emil Velikov <emil.l.velikov@gmail.com>
(cherry picked from commit 0d699530ff)

Requested-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-05-30 17:11:15 -07:00
Ilia Mirkin
8ac81e5b66 mesa/st: fix color outputs in presence of sample mask output
Commit c5d822dad9 added support for sample mask incorrectly. It became
treated as a color output, and messed up the color output indices.
Revert the hunk that did that, and add explicit support just like for
depth/stencil writes.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Acked-by: Marek Olšák <marek.olsak@amd.com>
(cherry picked from commit ab7bd7093d)

Requested-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-05-30 17:11:15 -07:00
Rob Clark
6d23a0b2a6 configure: fix build error with XA
Fixes:

xa_tracker.c: In function 'xa_tracker_create':
 xa_tracker.c:147:5: error: implicit declaration of function 'pipe_loader_drm_probe_fd' [-Werror=implicit-function-declaration]

in some build configurations, as XA now implicitly depends on
gallium_drm_loader.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
(cherry picked from commit 20d14ef263)

Bugzilla: https://bugs.gentoo.org/show_bug.cgi?id=511700
Requested-by: Matt Turner <mattst88@gmail.com>
2014-05-30 17:11:15 -07:00
Pavel Popov
8f984928cc i965: Fix Line Stipple enable bit in 3DSTATE_SF for Haswell.
Cc: "10.1 10.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Pavel Popov <pavel.e.popov@intel.com>
(cherry picked from commit d292d40207)
2014-05-30 17:11:15 -07:00
Jerome Glisse
7ab2363c11 glx: load dri driver with RTLD_LOCAL so dlclose never fails to unload
There is no reason anymore to load with RTLD_GLOBAL and for some driver
this even result in dlclose failing to unload leading to catastrophic
failure with swrast fallback.

Cc: "10.1 10.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Jérôme Glisse <jglisse@redhat.com>
(cherry picked from commit e3cc0d90e1)
2014-05-29 15:48:53 -07:00
Brian Paul
55b9effa4a glsl: fix use-after free bug/crash in ast_declarator_list::hir()
The call to get_variable_being_redeclared() may delete 'var' so we
can't reference var->name afterward.  We fix that by examining the
var's name before making that call.

Fixes valgrind warnings and possible crash when running the piglit
tests/spec/glsl-1.30/execution/clipping/vs-clip-distance-in-param.shader_test
test (and probably others).

Cc: "10.1 10.2" <mesa-stable@lists.freedesktop.org>

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit f9cecca7a6)
2014-05-29 15:48:02 -07:00
Kenneth Graunke
5347fc5295 i965: Fix repeated usage of rectangle texture coordinate scaling.
Previously, we set up new entries in the params[] array on every access
of a rectangle texture.  Unfortunately, we only reserve space for
(2 * MaxTextureImageUnits) extra entries, so programs which accessed
rectangle textures more times than that would write off the end of the
array and likely crash.

We don't really have a decent mapping between the index returned by
_mesa_add_state_reference and our index into the params array, so we
have to manually search for it.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=78691
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Cc: mesa-stable@lists.freedesktop.org
(cherry picked from commit bb9623a1a8)
2014-05-29 15:47:29 -07:00
Topi Pohjolainen
e8e48889e6 meta/blit: Use gl_FragColor also in the msaa blit shader
Fixes framebuffer_blit_functionality_multisampled_to_singlesampled_blit
es3 cts test on bdw. Also fixes this on ivb when ivb is forced to use
the meta path.

No piglit regressions on IVB.

Further input from Ken:

 "Unfortunately, this doesn't fix MRT for integer data.

  In the single-sampled case, since we're directly copying data, we were
  read/copy/write data as "float" values, which actually contained the
  integer bits.  Here, we can't do that since we need to process the
  actual integer data.

  I do wonder if we could use intBitsToFloat/uintBitsToFloat to stuff the
  integer bits in the float gl_FragColor output.  Just a crazy idea.

  In the long term (post 10.2), I think we should draft an extension that
  allows you to do "layout(location = all)" on user-defined fragment
  shader outputs.  (Or some similar syntax.)"

Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
(cherry picked from commit a6022e5405)
2014-05-29 15:46:26 -07:00
Topi Pohjolainen
af3d4eddc1 i965/meta: Store stencil texturing mode
Meta path needs to keep the current texture object's state. Fixes
the following gles3 cts tests on bdw:

framebuffer_blit_functionality_negative_width_blit.test: fail
framebuffer_blit_functionality_all_buffer_blit.test: fail
framebuffer_blit_functionality_negative_height_blit.test: fail
framebuffer_blit_functionality_missing_buffers_blit.test: fail
framebuffer_blit_functionality_negative_dimensions_blit.test: fail
framebuffer_blit_functionality_minifying_blit.test: fail
framebuffer_blit_functionality_magnifying_blit.test: fail

Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 57730d67f6)
2014-05-29 15:45:43 -07:00
Topi Pohjolainen
75ae4fff35 meta/blit: Add stencil texturing mode save and restore
v2 (Ken): Only restore the mode if it has changed.

Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit c246828c4d)
2014-05-29 15:44:45 -07:00
Matt Turner
c984e5bd2e Revert "i965: Don't make instructions with a null dest a barrier to scheduling."
This reverts commit 42a26cb5e4.

Cc: "10.2" <mesa-stable@lists.freedesktop.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=78648
(cherry picked from commit 0d3f83f4ad)
2014-05-29 15:44:09 -07:00
Matt Turner
ca6b38b80a Revert "i965/fs: Simplify interference scan in register coalescing."
This reverts commit 5ff1e446d4.

Cc: "10.2" <mesa-stable@lists.freedesktop.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77704
(cherry picked from commit a39428cf5c)
2014-05-29 15:42:43 -07:00
Matt Turner
b814afeb6c Revert "i965/fs: Give up in interference check if we see a WHILE."
This reverts commit 55de1c035c.

Cc: "10.2" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit fc025a6719)
2014-05-29 15:41:53 -07:00
Matt Turner
17c7ead727 Revert "i965/fs: Reduce restrictions on interference in register coalescing."
This reverts commit f770123f58.

Cc: "10.2" <mesa-stable@lists.freedesktop.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=78692
(cherry picked from commit ccb1ea8a15)
2014-05-29 15:40:55 -07:00
Emil Velikov
2a29dbdc6e glx: do not leak dri3Display
v2: Do not wrap the code in ifdef HAVE_DRI3 (suggested by Keith)

Cc: "10.1 10.2" <mesa-stable@lists.freedesktop.org>
Cc: Keith Packard <keithp@keithp.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
(cherry picked from commit eb2241f8a9)
2014-05-29 15:40:09 -07:00
Matt Turner
03e93f6079 Revert "i965/fs: Change fs_visitor::emit_lrp to use MAC for gen<6"
This reverts commit a6860100b8.

Why this code didn't work in all circumstances is unknown and without a
working Ironlake simulator (which uses a different AUB format) we'll
probably never know, short of a lot of experimentation, and spending a
bunch of time to try to optimize a few instructions on Ironlake is not
time well spent.

Moreover, for mix(vec4, vec4, vec4) using the accumulator introduces a
dependence between the otherwise independent per-component calculations.
Not using the accumulator, even if it means an extra instruction per
component might be preferable. We don't know, we don't have data, and
we don't have the necessary register on Ironlake for shader_time to tell
us.

Cc: "10.2" <mesa-stable@lists.freedesktop.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77707
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit c2c639ecf6)
2014-05-29 15:17:53 -07:00
Matt Turner
bc4b9467af Revert "i965/vec4: Change vec4_visitor::emit_lrp to use MAC for gen<6"
This reverts commit 2dfbbeca50 with the
comment about MAC and implicit accumulator removed.

Why this code didn't work in all circumstances is unknown and without a
working Ironlake simulator (which uses a different AUB format) we'll
probably never know, short of a lot of experimentation, and spending a
bunch of time to try to optimize a few instructions on Ironlake is not
time well spent.

Moreover, for mix(vec4, vec4, vec4) using the accumulator introduces a
dependence between the otherwise independent per-component calculations.
Not using the accumulator, even if it means an extra instruction per
component might be preferable. We don't know, we don't have data, and
we don't have the necessary register on Ironlake for shader_time to tell
us.

Cc: "10.2" <mesa-stable@lists.freedesktop.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77703
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit db42dd8952)
2014-05-29 15:17:28 -07:00
Christoph Bumiller
7efdc55f5f nv50/ir/tgsi: optimize KIL
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit d479713d25)
2014-05-29 15:16:56 -07:00
Christoph Bumiller
9ea859931e nv50/ir: fix lowering of predicated instructions (without defs)
Note that predicated instructions with defs are still not supported
because transformation to SSA doesn't handle them yet.

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 452a4151aa)
2014-05-29 15:16:24 -07:00
Christoph Bumiller
4e5296208d nv50/ir/opt: fix constant folding with saturate modifier
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 3b0867f35b)
2014-05-29 15:16:03 -07:00
Christoph Bumiller
1ced952686 nv50/ir/tgsi: TGSI_OPCODE_POW replicates its result
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 2f2d1b3d9b)
2014-05-29 15:15:59 -07:00
Christoph Bumiller
afe723ce5f nv50,nvc0: set constbufs dirty on pipe context switch
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 49eccef06b)
2014-05-29 15:15:39 -07:00
Christoph Bumiller
8b74c2bdbd nv50: setup scissors on clear_render_target/depth_stencil
[imirkin: add logic to also clear the "regular" scissors]
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 200382be85)
2014-05-29 15:15:10 -07:00
Christoph Bumiller
4afbd9b0e2 nv50,nvc0: always pull out bufctx on context destruction
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 7d11b761f2)
2014-05-29 15:01:49 -07:00
Ian Romanick
697316fe06 Bump version to 10.2-rc4
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2014-05-23 17:36:42 -07:00
Ian Romanick
bfaee5277a Merge remote-tracking branch 'robclark/freedreno-10.2' into 10.2 2014-05-23 17:21:59 -07:00
Pavel Popov
9a8f12ae03 i965: Properly return *RESET* status in glGetGraphicsResetStatusARB
The glGetGraphicsResetStatusARB from ARB_robustness extension always
returns GUILTY_CONTEXT_RESET_ARB and never returns NO_ERROR for guilty
context with LOSE_CONTEXT_ON_RESET_ARB strategy.  This is because Mesa
returns GUILTY_CONTEXT_RESET_ARB if batch_active !=0 whereas kernel
driver never reset batch_active and this variable always > 0 for guilty
context.  The same behaviour also can be observed for batch_pending and
INNOCENT_CONTEXT_RESET_ARB.

But ARB_robustness spec says:

  If a reset status other than NO_ERROR is returned and subsequent calls
  return NO_ERROR, the context reset was encountered and completed. If a
  reset status is repeatedly returned, the context may be in the process
  of resetting.

  8. How should the application react to a reset context event?
  RESOLVED: For this extension, the application is expected to query the
  reset status until NO_ERROR is returned. If a reset is encountered, at
  least one *RESET* status will be returned. Once NO_ERROR is
  encountered, the application can safely destroy the old context and
  create a new one.

The main problem is the context may be in the process of resetting and
in this case a reset status should be repeatedly returned.  But looks
like the kernel driver returns nonzero active/pending only if the
context reset has already been encountered and completed.  For this
reason the *RESET* status cannot be repeatedly returned and should be
returned only once.

The reset_count and brw->reset_count variables can be used to control
that glGetGraphicsResetStatusARB returns *RESET* status only once for
each context.  Note the i915 triggers reset_count twice which allows to
return correct reset count immediately after active/pending have been
incremented.

v2 (idr): Trivial reformatting of comments.

Signed-off-by: Pavel Popov <pavel.e.popov@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Cc: "10.1 10.2" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 8dc4a98c44)
2014-05-23 09:57:18 -07:00
Emil Velikov
a31062fcb3 targets/egl-static: add missing line break in ldflags
Accidently omitted by commit 7b7944ee1c.

Cc: "10.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
(cherry picked from commit e0372239a5)
2014-05-23 09:57:15 -07:00
James Legg
a1fff38c96 mesa: Fix unbinding GL_DEPTH_STENCIL_ATTACHMENT
glFramebufferRender(..., GL_DEPTH_STENCIL_ATTACHMENT, ..., 0) only
detached the depth buffer and not the stencil buffer.

Bugzilla: http://bugs.freedesktop.org/show_bug.cgi?id=79115
Reviewed-by: Brian Paul <brianp@vmware.com>
Cc: "10.1 10.2" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 846c715abb)
2014-05-23 09:56:26 -07:00
Jordan Justen
1db3ebd8a5 meta blit: Set Z texcoord during meta blit to sample the correct layer
If the source renderbuffer has a depth > 0, then send a Z texcoord
which is set to the source attachment Z offset.

This fixes piglit's gl-3.2-layered-rendering-gl-layer-render with the
GL_TEXTURE_2D_MULTISAMPLE_ARRAY case test on i965/gen8.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 57876fee38)
2014-05-23 09:55:23 -07:00
Kenneth Graunke
7cf3a674ea i965: Listen to BRW_NEW_FRAGMENT_PROGRAM for 3DSTATE_PS_BLEND.
brw_color_buffer_write_enabled depends on brw->fragment_program, which
means we have to listen to BRW_NEW_FRAGMENT_PROGRAM.

On most generations, this was only called from a function that already
subscribed.  However, on Broadwell, we failed to listen to the necessary
event in the atom that emits 3DSTATE_PS_BLEND.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 746921cbb4)
2014-05-23 09:54:41 -07:00
Kenneth Graunke
d2521a44af i965: Use WE_all for FB write header setup on Broadwell.
I forgot to disable writemasking on the OR and MOV which set the render
target index and "source 0 alpha present to render target" bit.

Using get_element_ud is equivalent and avoids a line-wrap.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 7d3985ca6c)
2014-05-23 09:54:15 -07:00
Anuj Phogat
00f2dcb791 meta: Use gl_FragColor to output color values to all the draw buffers
_mesa_meta_setup_blit_shader() currently generates a fragment shader
which, irrespective of the number of draw buffers, writes the color
to only one 'out' variable. Current shader rely on an undefined
behavior and possibly works by chance.

From OpenGL 4.0  spec, page 256:
  "If a fragment shader writes to gl_FragColor, DrawBuffers specifies a
   set of draw buffers into which the single fragment color defined by
   gl_FragColor is written. If a fragment shader writes to gl_FragData,
   or a user-defined varying out variable, DrawBuffers specifies a set
   of draw buffers into which each of the multiple output colors defined
   by these variables are separately written. If a fragment shader writes
   to none of gl_FragColor, gl_FragData, nor any user defined varying out
   variables, the values of the fragment colors following shader execution
   are undefined, and may differ for each fragment color."

OpenGL 4.4 spec, page 463, added an additional line in this section:
  "If some, but not all user-defined output variables are written, the
   values of fragment colors corresponding to unwritten variables are
   similarly undefined."

V2: Write color output to gl_FragColor instead of writing to multiple
    'out' variables. This'll avoid recompiling the shader every time
    draw buffers count is updated.

Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 46737cebd3)
2014-05-23 09:53:42 -07:00
Anuj Phogat
ed1ffa0197 meta: Refactor _mesa_meta_setup_blit_shader() to avoid duplicate shader code
Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit bee2915210)
2014-05-23 09:52:29 -07:00
Ilia Mirkin
5d056f51ab tgsi: add GS_INVOCATIONS to property names array
In commit 4be146b1, I neglected to add the new property to the strings
array. This leads to the string '(null)' to be printed instead when
converting a GS shader to text.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
(cherry picked from commit cdeb7004e0)
2014-05-23 09:51:49 -07:00
Ilia Mirkin
6be7789e11 nv50,nvc0: fix 3d blits with mipmap levels
Make sure to normalize the z coordinates as well as the x/y ones when
there are mipmaps present. Fixes 3d mipmap generation, which now uses
the blit path.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Ben Skeggs <bskeggs@redhat.com>
(cherry picked from commit 28360fcad7)
2014-05-23 09:51:26 -07:00
Ilia Mirkin
d6a4c3c29c nv50/ir: fix constant folding for OP_MUL subop HIGH
These instructions can come in either through IMUL_HI/UMUL_HI TGSI
opcodes, or from OP_DIV constant folding.

Also make sure that the constant foldings which delete the original
instruction still get counted as having done something.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.1 10.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Ben Skeggs <bskeggs@redhat.com>
(cherry picked from commit d2a3de19c6)
2014-05-23 09:51:06 -07:00
Ilia Mirkin
9028b94670 nv50/ir: fix s32 x s32 -> high s32 multiply logic
Retrieving the high 32 bits of a signed multiply is rather annoying. It
appears that the simplest way to do this is to compute the absolute
value of the arguments, and perform a u32 x u32 -> u64 operation. If the
arguments' signs differ, then negate the result. Since there is no u64
support in the cvt instruction, we have the perform the 2's complement
negation "by hand".

This logic can come into use by the IMUL_HI instruction (very unlikely
to be seen), as well as from constant folding of division by a constant.
Fixes dolphin's divisions by 255.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.1 10.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Ben Skeggs <bskeggs@redhat.com>
(cherry picked from commit d3a5cf052c)
2014-05-23 09:50:26 -07:00
Kenneth Graunke
085d6bd5e7 meta: Avoid _swrast_BlitFramebuffer in the meta CopyTexSubImage code.
This is a replacement for bd44ac8b5c
that should actually work.

Fixes Piglit's copyteximage-border on swrast, as well as one of
es3conform's packed_pixels_pixelstore test.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=78546
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77705
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 2ecc7268ba)
2014-05-23 09:49:28 -07:00
Kenneth Graunke
fd0ea5be9d meta: Split _swrast_BlitFramebuffer out of the meta blit path.
Separating the software fallbacks from the rest of the meta path (which
is usually hardware accelerated) gives callers better control over their
blitting options.

For example, i965 might want to try meta blit, hardware blits, then
swrast as a last resort.  Splitting it makes that possible.

This updates all callers to maintain the existing behavior (even in the
few cases where it isn't desirable behavior - later patches can change
that).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 54540ea691)
2014-05-23 09:48:13 -07:00
Kenneth Graunke
27d4836f35 meta: Drop unnecessary early returns in _mesa_meta_BlitFramebuffer.
These aren't necessary - all of the following code is predicated on mask
being non-zero, so no code will get executed anyway.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Courtney Goeltzenleuchter <courtney@lunarg.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit d89ce333cc)
2014-05-23 09:47:37 -07:00
Kenneth Graunke
e306ba9a9b Revert "i965: Don't _swrast_BlitFramebuffer when doing CopyTexSubImage."
This reverts commit bd44ac8b5c.

Fixes:
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=78842
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=78843

Re-breaks:
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77705
but that will be fixed properly in a few commits.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 2fa3796bc1)
2014-05-23 09:46:57 -07:00
Topi Pohjolainen
81fb9ef112 i965/fbo: Only try stencil meta blits on gen >= 8
I don't have an ILK at hand but the fix should be trivial.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=78872
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-and-tested-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 21dddb22c1)
2014-05-23 09:46:28 -07:00
Kenneth Graunke
32549f3f17 mesa: Disable GL_EXT_framebuffer_multisample_blit_scaled on Broadwell.
It's not properly implemented in the meta code, and we don't have time
to fix it for 10.2.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 0b96d362bf)
2014-05-23 09:45:52 -07:00
Ilia Mirkin
9576e17804 nv50/ir: fix integer mul lowering for u32 x u32 -> high u32
UNION appears to expect that all of its sources are conditionally
defined. Otherwise it inserts an unpredicated mov instruction which
overwrites the desired result. This fixes tests that use UMUL_HI, and
much less directly, unsigned integer division by a constant, which uses
this functionality in a peephole pass.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.1 10.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Ben Skeggs <bskeggs@redhat.com>
(cherry picked from commit 5b8f1a0f7c)
2014-05-23 09:45:13 -07:00
Ilia Mirkin
cc65bc4d15 nv50/ir: make sure that texprep/texquerylod's args get coalesced
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Ben Skeggs <bskeggs@redhat.com>
(cherry picked from commit 4ebaabcccb)
2014-05-23 09:40:26 -07:00
Jeremy Huddleston Sequoia
25e641213f darwin: Fix test for kCGLPFAOpenGLProfile support at runtime
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
(cherry picked from commit 7a109268ab)
2014-05-20 10:55:12 -07:00
Rob Clark
e084f71548 freedreno: don't advertise texture arrays for now
I think a3xx and later should support (it is part of GLES3), but this
isn't needed for the time being and still needs to be reversed.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-05-20 10:55:54 -04:00
Rob Clark
cdd328639f freedreno/a3xx: shadow sampler support
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-05-20 08:48:49 -04:00
Rob Clark
6440561737 freedreno/a3xx/compiler: refactor trans_samp()
Split it up into some smaller fxns so it doesn't grow into a huge
monster as we add things.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-05-20 08:48:49 -04:00
Rob Clark
fb4461b7dc freedreno: update generated headers
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-05-20 08:48:20 -04:00
Rob Clark
fec2b45d02 freedreno/a3xx: use util_format_compose_swizzles()
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-05-20 08:48:20 -04:00
Rob Clark
d0c813c40a freedreno/a3xx/compiler: 1D textures
Gallium already gives us height==1 for these, so the texture state is
already setup correctly to emulate 1D textures as a Nx1 2D texture.  We
just need to supply the .y coord.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-05-20 08:48:20 -04:00
Rob Clark
a05c073d79 freedreno: fix caps
In particular, we want mesa to emulate primitive restart for us.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-05-20 08:48:20 -04:00
Rob Clark
031ee21961 freedreno: fix index buffer offset
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-05-20 08:48:20 -04:00
Rob Clark
b7604eff4c freedreno/a3xx: add sRBG texture support
That was easy.  Turns out it is just a matter of setting one bit.
Enable sampling from sRGB texture, and therefore enable GL 2.1 :-)

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-05-20 08:48:20 -04:00
Rob Clark
80da86c650 freedreno: update generated headers
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-05-20 08:48:20 -04:00
Rob Clark
3c0ca023dd freedreno/a3xx: fix write to bogus register
The loops for updating the multiple packed fields in SP_VS_OUT[] and
SP_VS_VPC_DST[] will zero out one register beyond the last that on
required.  Which is normally not a problem (and is kinda convenient
when looking at cmdstream dumps) unless we have maximum (16) varyings.

Fix loop termination condition so that this does not happen.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-05-20 08:47:20 -04:00
Rob Clark
516db26e1e freedreno/a3xx: account for special inputs/outputs
We need to size input/output tables big enough for special inputs/
outputs (gl_Position, gl_FrontFacing, etc) which, while they don't
count towards the hw limit of 16 attributes or 16 varyings, we do
still need to track them all the same.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-05-20 08:47:19 -04:00
Rob Clark
d5d9984c2b freedreno/a3xx: fix MAX_INPUTS shader cap
Hardware only supports 16.  Which fd3_shader_variant properly reflected,
but the pipe cap did not, leading to array overflow (and shaders that
could not possibly work).

Also a bunch of asserts to make problems like this easier to see.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-05-20 08:47:19 -04:00
Ryan Houdek
6db6f05fae freedreno/a3xx/compiler: add KILL_IF
The KILL_IF opcode could potentially be merged in to the regular KILL
opcode function.  It was a pain to do so, so I've left is separated
for cleanliness.

Signed-off-by: Ryan Houdek <Sonicadvance1@gmail.com>
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-05-20 08:47:19 -04:00
Ryan Houdek
c338759051 freedreno/a3xx/compiler: start adding integer support
Adds a large sum of TGSI opcodes to the a3xx compiler.

For integer opcodes we have 28 opcodes added.
Adds 4 floating point compare opcodes

If GLSL 1.30 is enabled, this allows the GLSL 1.30 piglits to have a
completion amount of 432/641.

Signed-off-by: Ryan Houdek <Sonicadvance1@gmail.com>
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-05-20 08:46:38 -04:00
Rob Clark
47a6830e22 freedreno/a3xx: occlusion query support
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-05-20 08:46:38 -04:00
Rob Clark
3ffc507c94 freedreno: add support for hw queries
Real GPU queries need some infrastructure to track samples per tile and
accumulate the results.  But fortunately this can be shared across GPU
generation.

See:
https://github.com/freedreno/freedreno/wiki/Queries#hardware-queries

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-05-20 08:46:38 -04:00
Rob Clark
c94e339adc freedreno/query: allow multiple query implementations
Split out fd_query into an abstract base class, to allow multiple
implementations.  The current sw based queries are moved into
fd_sw_query.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-05-20 08:45:50 -04:00
Rob Clark
a5951d09a5 freedreno/a3xx: add point-size
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-05-20 08:45:50 -04:00
Rob Clark
3475ca1f00 freedreno: update generated headers
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-05-20 08:45:50 -04:00
Rob Clark
3733cc3e8f freedreno/a2xx: fix compiler warning
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-05-20 08:45:50 -04:00
Jeremy Huddleston Sequoia
ac49f97f12 glapi: Avoid heap corruption in _glapi_table
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Reviewed-by: Chia-I Wu <olv@lunarg.com>
(cherry picked from commit ff5456d1ac)
2014-05-20 01:39:17 -07:00
Ian Romanick
d0aa394741 Bump version to 10.2-rc3
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2014-05-16 23:48:44 -07:00
Brian Paul
4baf6f12a5 mesa: fix double-freeing of dispatch tables inside glBegin/End.
We allocate dispatch tables for BeginEnd and OutsideBeginEnd.  But
when we destroy the context we were freeing the BeginEnd and Exec
tables.  If Exec==BeginEnd we did a double-free.  This would happen
if the context was destroyed while inside a glBegin/End pair.  Now
free the BeginEnd and OutsideBeginEnd pointers.

Cc: "10.1", "10.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
(cherry picked from commit ef6b6658f9)
2014-05-16 23:46:34 -07:00
Michel Dänzer
21792665c7 glsl_to_tgsi: Make sure the 'shader' member is always initialized
Fixes the valgrind report below and random crashes with piglit on radeonsi.

==30005== Conditional jump or move depends on uninitialised value(s)
==30005==    at 0xB13584E: st_translate_program (st_glsl_to_tgsi.cpp:5100)
==30005==    by 0xB14698B: st_translate_fragment_program (st_program.c:747)
==30005==    by 0xB14777D: st_get_fp_variant (st_program.c:824)
==30005==    by 0xB11219C: get_color_fp_variant (st_cb_drawpixels.c:1042)
==30005==    by 0xB1131AE: st_DrawPixels (st_cb_drawpixels.c:1154)
==30005==    by 0xAFF8806: _mesa_DrawPixels (drawpix.c:162)
==30005==    by 0x4EB86DB: stub_glDrawPixels (generated_dispatch.c:6640)
==30005==    by 0x4F1DF08: piglit_visualize_image (piglit-util-gl.c:1574)
==30005==    by 0x40691D: draw_image_to_window_system_fb(int, bool) (draw-buffers-common.cpp:733)
==30005==    by 0x406C8B: draw_reference_image(bool, bool) (draw-buffers-common.cpp:854)
==30005==    by 0x40722A: piglit_display (alpha-to-coverage-dual-src-blend.cpp:117)
==30005==    by 0x4EA7168: run_test (piglit_fbo_framework.c:52)

Cc: "10.1 10.2" <mesa-stable@lists.freedesktop.org>

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
(cherry picked from commit 2bab95973d)
2014-05-16 23:45:50 -07:00
Topi Pohjolainen
872ea423ac i965/fb: Use meta path for stencil up/downsampling
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
(cherry picked from commit d45fadf11a)
2014-05-16 23:45:24 -07:00
Topi Pohjolainen
ad8ad99eff i965/meta: Stencil blit for miptree updownsampling
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 475216a4f0)
2014-05-16 23:43:16 -07:00
Topi Pohjolainen
62f1509070 i965/fb: Use meta path for stencil blits
This is effective only on gen8 for now as previous generations still
go through blorp.

Cc: "10.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit b18f6b9b86)
2014-05-16 23:42:08 -07:00
Topi Pohjolainen
eb2ef1641c i965/meta: Stencil blits
v2: Create the intel renderbuffer with level hardcoded to zero instead
    of overriding it in the surface state configuration. Also moved the
    dimension adjustments for tiling, mip level, msaa into the render
    buffer creation. Finally prepares for another blit path needed for
    miptree updownsampling.
v3 (Ken): Dropped unnecessary memory context for "ralloc_asprintf()"

Cc: "10.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
(cherry picked from commit d1829badf5)
2014-05-16 23:41:56 -07:00
Topi Pohjolainen
947b60d19e meta: Refactor state save/restore for framebuffer texture blits
Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit 2a549c43a8)

Note: This patch was cherry picked so that the next patch would build.
2014-05-16 23:41:40 -07:00
Topi Pohjolainen
cb37016f89 i965: Extend brw_get_rb_for_first_slice() for specified level/layer
v2: Configure stencil directly for final dimensions instead of
    adjusting bit by bit for tiling, mip level and msaa.
v3 (Ken): Used non-static constant for horizontal alignment

Cc: "10.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 9d752c098c)
2014-05-16 23:31:05 -07:00
Topi Pohjolainen
43ea5f9347 i965/gen8: Surface state overriding for stencil
v2: Allow hardware to offset accesses to individual layers. Also leave
    the mip-level overriding for the creator of the intel renderbuffer
    to handle. Merged with "i965/gen8: Allow stencil buffers to be
    configured as single sampled"

Ken: I left the "_mesa_problem()" still in place. I think it is clearer
     to remove it in a separate patch.

Cc: "10.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 36caae48b2)
2014-05-16 23:28:04 -07:00
Topi Pohjolainen
b5e717a618 i965/wm: Surface state overrides for configuring w-tiled as y-tiled
v2: Use intel_mipmap_tree::total_width in order to get correct alignment
    automatically. Also use "mt->total_height / mt->physical_depth0" as
    surface height allowing hardware to offset to correct slice.

Cc: "10.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 6aefaa4eb2)
2014-05-16 23:27:29 -07:00
Jordan Justen
f5848ec2e4 i965 meta up/downsample: Fix renderbuffer _BaseFormat
mt->format is of type mesa_format, and therefore can't be
used with _mesa_base_fbo_format which requires a GLenum input.

On gen8, this fixes various piglit fbo-depthstencil tests with
samples > 1.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 103057b2b7)
2014-05-16 23:26:58 -07:00
Roland Scheidegger
79a34441d5 mesa/st: fix number of ubos being declared in a shader
Previously the code used the total number of ubos being declared in the
linked program (so the ubos of all shaders combined), use the number
from the particular shader instead.
This fixes an assertion failure with piglit arb_uniform_buffer_object-maxblocks
seen in llvmpipe since 8a9f5ecdb1 as it now emits
code for each declared buffer, not just the ones actually used.

CC: "10.1 10.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 3e817e7e56)
2014-05-16 23:17:47 -07:00
Emil Velikov
1041fb86c0 docs: Add a note about llvm-shared-libs and libxatracker
Both changes landed in 10.2, and for people not following the
development cycle these will come as a surprise. Note that the
pipe_* interface is not stable.

Cc: "10.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Acked-by: Rob Clark <robclark@freedesktop.org>
(cherry picked from commit e48054d036)
2014-05-16 23:15:14 -07:00
Emil Velikov
b1aa25907a configure: correctly set LD_NO_UNDEFINED
Commit 11623be934 was meant to have this hunk, which
I accidently dropped during git rebase.

Cc: 10.2 <mesa-stable@lists.freedesktop.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Julien Cristau <jcristau@debian.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Jonathan Gray <jsg@jsg.id.au>
(cherry picked from commit f57d092199)
2014-05-16 23:15:09 -07:00
Michel Dänzer
5d6e822d03 radeonsi: Fix anisotropic filtering state setup
Bring it back in line with r600g. I broke this in the original radeonsi
bringup. :(

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=78537

Cc: "10.1 10.2" <mesa-stable@lists.freedesktop.org>

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit c5828b0599)
2014-05-16 23:14:36 -07:00
Jonathan Gray
26d5b22039 glsl: simplify the M_PI*f macros, fixes build on OpenBSD
The M_PI*f macros used a preprocessor paste to append 'f'
to M_PI defines, which works if the values are only numbers
but breaks on OpenBSD where M_PI definitions have casts
and brackets to meet requirements of a future version of POSIX,

http://austingroupbugs.net/view.php?id=801
http://austingroupbugs.net/view.php?id=828

Simplify the M_PI*f macros by using casts directly in the defines
as suggested by Kenneth Graunke.

Cc: "10.2" <mesa-stable@lists.freedesktop.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=78665
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Jonathan Gray <jsg@jsg.id.au>
(cherry picked from commit 0c0bbe77d0)
2014-05-16 23:13:37 -07:00
Kenneth Graunke
3171da3402 i965: Don't _swrast_BlitFramebuffer when doing CopyTexSubImage.
The point of copytexsubimage_using_blit_framebuffer is to use a hardware
accelerated BlitFramebuffer path.  If that fails, we shouldn't do a
swrast blit---we should try our CTSI fallback code.

This is especially important for i965 and GLES, where we don't even
create a swrast context.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77705
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit bd44ac8b5c)
2014-05-16 23:13:04 -07:00
Kristian Høgsberg
875fd92d16 wayland: Move version 2 request to end of interface specification
We're moving towards requiring interface additions to be appended to the
end of the interface block.  No functional change, opcodes are assigned as
before, but version 2 additions are now grouped together, which prevents
a scanner warning.

Cc: "10.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
(cherry picked from commit 06842d436e)
2014-05-16 23:12:45 -07:00
Topi Pohjolainen
fb5c68d312 meta: Refactor configuration of renderbuffer sampling
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 4dc9c314c8)
2014-05-16 23:07:02 -07:00
Topi Pohjolainen
0e7b0f2a0a meta: Refactor binding of renderbuffer as texture image
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit a2952315ac)
2014-05-16 23:05:22 -07:00
Topi Pohjolainen
5f495b85a0 meta: Merge compiling and linking of blit program
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit ac4db0aa55)
2014-05-16 23:04:22 -07:00
Topi Pohjolainen
253834cbf6 i965/blorp: Expose coordinate scissoring and mirroring
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 3a43cd0c3e)
2014-05-16 23:00:40 -07:00
Topi Pohjolainen
f5c083dbc3 i965/gen8: Use helper variables for surface parameters
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 4a92ad5531)
2014-05-16 22:55:44 -07:00
Jordan Justen
2b4a871e05 i965/gen8: Set depth extent field
The depth extent field is used to limit the allowed slice range that
can be rendered to.

With the previous setting, only slice 0 could be rendered.

This fixes piglit amd_vertex_shader_layer-layered-depth-texture-render.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
(cherry picked from commit c51c192891)
2014-05-14 12:19:16 -07:00
Jordan Justen
27da0bbeb4 i965/gen8 depth: Set depth size based on LOD0 for 3D textures
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
(cherry picked from commit 294ada2fef)
2014-05-14 12:19:14 -07:00
Jordan Justen
91e2808c41 i965/gen7 depth: Set depth size based on LOD0 for 3D textures
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
(cherry picked from commit e6d6ed55ab)
2014-05-14 12:19:13 -07:00
Jordan Justen
6cad93daab i965/gen8 renderbuffer: Set depth size based on LOD0 for 3D textures
Fixes piglit's
'gl-3.2-layered-rendering-clear-color-all-types 3d mipmapped'

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
(cherry picked from commit e47d08adef)
2014-05-14 12:19:12 -07:00
Jordan Justen
71f78bb87e i965/gen7 renderbuffer: Set depth size based on LOD0 for 3D textures
If blorp is disabled for color clears, then piglit's
'gl-3.2-layered-rendering-clear-color-all-types 3d mipmapped'
will fail.

Currently, gen8 fails similarly on this test because gen8
does not use blorp.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
(cherry picked from commit b875f39e29)
2014-05-14 12:19:08 -07:00
Chris Forbes
ab43a98fcf i965/Gen8: Set up layer constraints properly for depth buffers
Same issues as the previous commit fixed for Gen7:
- Bogus physical->logical layer conversion; depth/stencil surfaces
  are still IMS layout on Gen8.
- mt_layer ignored in layered rendering case, which breaks handling
  of views with MinLayer.
- Render target array extent not set correctly for arrays.

I'm not able to test this one since I can't get a Broadwell yet, but
it's the same set of fixes as for Gen7.

V2: Restore the MAX2() to account for zero depth/layer_count.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 23e9f06569)
2014-05-14 12:16:54 -07:00
Chris Forbes
af228e999c i965/Gen7: Set up layer constraints properly for depth buffers
Again, a few problems:
- Layered attachments did not honor MinLayer.
- Non-layered MSAA attachments rendered to the wrong layer due to
  dividing by the layer count. All depth buffers use the IMS layout, so
  the physical layer count == logical layer count.
- Layered attachments were not limited to irb->layer_count, so we could
  render off the end of the texture.

V2: Restore the MAX2() to account for zero depth/layer_count.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 77d55ef481)
2014-05-14 12:16:51 -07:00
Chris Forbes
725a27e04d i965/Gen8: Set up layer constraints properly for renderbuffers
Fixing the same issues the previous commit does for Gen7.

Note that I can't test this one, since I don't have a Broadwell.

V2: Restore the MAX2() to account for zero depth/layer_count.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 9269ea599c)
2014-05-14 12:16:50 -07:00
Chris Forbes
b0609b715b i965/Gen7: Set up layer constraints properly for renderbuffers
There were a few problems here, which mostly just broke layered
rendering into a view:

- Render target view extent was always set to be == depth. This is
  benign for non-layered-rendering, but allows writes off the end of the
  render target for layered rendering, which ends badly.
- Layered rendering did not honor the mt_layer setting, so would not
  properly handle MinLayer being set on a view.

V2: Restore the MAX2() to account for zero depth/layer_count.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit dd43900b7b)
2014-05-14 12:16:47 -07:00
Ilia Mirkin
ca549a0f19 nv50,nvc0: fix blit 3d path for 1d array textures
Need to adjust coordinates since the shader receives the array index as
depth in z, but the TEX instruction expects it to be the second
coordinate for a 1D array texture. This fixes fbo-generatemipmap-array.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Ben Skeggs <bskeggs@redhat.com>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 8baed87212)
2014-05-13 10:19:04 -07:00
Ilia Mirkin
407bff9db0 nv50,nvc0: leave queries on during blit, turn them on for 2d engine
Fixes the new logic of the conditional rendering piglit test.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Ben Skeggs <bskeggs@redhat.com>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 4467c0c9fb)
2014-05-13 10:18:05 -07:00
Ilia Mirkin
0e14b19492 mesa/st: leave current query enabled during glBlitFramebuffer
Also make sure that pipe_blit_info gets zero'd out so that query isn't
accidentally left enabled.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
(cherry picked from commit 64a7ddf40d)
2014-05-13 10:11:00 -07:00
Ilia Mirkin
a233f4c303 gallium: add bit to pipe_blit_info to leave current query enabled
Previously the implication was that queries should be disabled during
blits. However glBlitFramebuffer() is supposed to obey the current
query, and this new bit will indicate that to the driver.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
(cherry picked from commit 752ce0affb)
2014-05-13 10:08:33 -07:00
Ilia Mirkin
7a81788c67 nv50: fix setting of texture ms info to be per-stage
Different textures may be bound to each slot for each stage. So we need
to be able to upload ms parameters for each one without stages
overwriting each other.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Ben Skeggs <bskeggs@redhat.com>
Cc: "10.1 10.2" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 863573b9cb)
2014-05-13 10:08:01 -07:00
Ilia Mirkin
13bb2bc84b nv50/ir: make sure to reverse cond codes on all the OP_SET variants
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Ben Skeggs <bskeggs@redhat.com>
Cc: "10.2 10.1" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 68f47cad0d)
2014-05-13 09:57:28 -07:00
Ian Romanick
98b66e8d96 Add .cherry-ignore file
e696727 adds a change, and 155f98d reverts that change.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2014-05-13 09:55:23 -07:00
Ian Romanick
0b3126bddd mesa: Bump version to 10.2-rc2
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2014-05-09 20:10:38 -07:00
Emil Velikov
f2682b3b9f glx/tests: Partially revert commit 51e3569573
C++ does not support designated initializers, thus compilation
is not guaranteed to succeed. Surprisingly gcc 4.6.3 fails to
build the code, while version 4.9.0 compiles it without a hitch.

Cc: "10.2" <mesa-stable@lists.freedesktop.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=78403
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Tested-by: Vinson Lee <vlee@freedesktop.org>
(cherry picked from commit 326b8e253e)
2014-05-09 20:10:38 -07:00
Emil Velikov
d259928a56 configure: error out if building GBM without dri
Both backends require --enable-dri, and building an empty libgbm
makes little to no sense. Error out at configure to prevent the
user from shooting themselves in the foot.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=78225
Cc: "10.1 10.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit e477d12c33)
2014-05-09 20:10:38 -07:00
Kenneth Graunke
ec6bd21162 i965: Fix GPU hangs on Broadwell in shaders with some control flow.
According to the documentation, we need to set the source 0 register
type to IMM for flow control instructions that have both JIP and UIP.

Fixes GPU hangs in approximately 10 Piglit tests, 5 es3conform tests,
Unigine Crypt, a WebGL raytracer demo, and several Steam titles.

Cc: "10.2" <mesa-stable@lists.freedesktop.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=75478
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=75878
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76939
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Tested-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
(cherry picked from commit 9584959123)
2014-05-09 20:10:37 -07:00
Tom Stellard
53a0f9d0ba radeonsi: Enable geometry shaders with LLVM 3.4.1
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>

CC: "10.1 10.2" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 93c2ebbd83)
2014-05-09 20:10:37 -07:00
Tom Stellard
0f0f1106b6 configure.ac: Add LLVM_VERSION_PATCH to DEFINES
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>

CC: "10.1 10.2" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit c5d0008325)
2014-05-09 20:10:37 -07:00
Thomas Hellstrom
2b34277bbd st/xa: Fix performance regression introduced by commit "Cache render target surface"
The mentioned commit has the nasty side-effect of turning off accelerated
copies.

Cc: "10.1 10.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
Reviewed-by: Rob Clark <robdclark@gmail.com>
(cherry picked from commit 9306b7c171)
2014-05-09 20:10:37 -07:00
Tom Stellard
e29daf82cc clover: Destory pipe_screen when device does not support compute v2
v2:
  - Make sure screen was successfully created before destroying it.

Cc: "10.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
(cherry picked from commit c5f0c98c49)
2014-05-09 20:10:37 -07:00
Tom Stellard
03673bcf6c pipe-loader: Don't destroy the winsys in the sw loader
The screen takes ownership of the winsys, and is responsible for
destroying it.  Users of pipe-loader should make sure they destory
and  screens they've created to avoid memory leaks.

This fixes a crash in clover introduced by
ce6c17c083 where the pipe-loader was
destroying the winsys while a screen was still using it.

Cc: "10.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
(cherry picked from commit c650033b86)
2014-05-09 20:10:37 -07:00
Roland Scheidegger
af47859aed draw: do not use draw_get_option_use_llvm() inside draw execution paths
1c73e919a4 made it possible to not allocate
the tgsi machine if llvm was used. However, draw_get_option_use_llvm() is
not reliable after draw context creation, since drivers can explicitly
request a non-llvm draw context even if draw_get_option_use_llvm() would
return true (and softpipe does just that) which leads to crashes.
Thus use draw->llvm to determine if we're using llvm or not instead (and
make draw->llvm available even if HAVE_LLVM is false so we don't have to put
even more ifdefs).

Cc: "10.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 9af68e9b1d)
2014-05-09 20:10:37 -07:00
Kenneth Graunke
e120f1a958 mesa: Fix MaxNumLayers for 1D array textures.
1D array targets store the number of slices in the Height field.

Cc: "10.2 10.1 10.0" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
(cherry picked from commit 5c399ca8e4)
2014-05-09 18:27:26 -07:00
Kenneth Graunke
cc92276cb8 i965: Enable GL_ARB_texture_view on Broadwell.
This is a port of commit c9c08867ed.
A tiny bit of extra work was necessary to not break stencil texturing.

Cc: "10.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
(cherry picked from commit ecfc418b68)
2014-05-08 14:57:12 -07:00
Ilia Mirkin
fac042fa05 nv50/ir/gk110: fix set with f32 dest
Should fix comparison opcodes like SGE/SLT/etc which expected a float to
be returned. These were previously getting integer 0/-1 values.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Ben Skeggs <bskeggs@redhat.com>
Cc: 10.2 <mesa-stable@lists.freedesktop.org>
(cherry picked from commit e7047f2917)
2014-05-08 14:50:33 -07:00
Ian Romanick
d26b59ec27 linker: Fix consumer_inputs_with_locations indexing
In an earlier incarnation of populate_consumer_input_sets and
get_matching_input, the consumer_inputs_with_locations array was indexed
using the user-specified location.  In that version, only user-defined
varyings were included in the array.

In the current incarnation, the Mesa location is used to index the
array, and built-in varyings are included.

This change fixes the unit test to exepect gl_ClipDistance in the array,
and it resizes the arrays to actually be big enough.  It's just dumb
luck that the existing piglit tests use small enough locations to not
stomp the stack. :(

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=78258
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
Cc: Vinson Lee <vlee@freedesktop.org>
(cherry picked from commit f7bf37cb13)
2014-05-07 09:50:52 -07:00
Kenneth Graunke
c2c15a9a37 meta: Only clear the requested color buffers.
This path is used to implement both glClear and glClearBuffer; the
latter is only supposed to clear particular buffers.  Core Mesa provides
us that information in the buffers bitmask; we must only clear buffers
mentioned there.

To accomplish this, we save/restore the color draw buffers state, and
use glDrawBuffers to restrict drawing to the relevant buffers.

Fixes Piglit's spec/!OpenGL 3.0/clearbuffer-mixed-formats and
spec/ARB_framebuffer_object/fbo-drawbuffers-none glClearBuffer tests
for drivers using meta clears (such as Broadwell).

Cc: "10.2" <mesa-stable@lists.freedesktop.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77852
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77856
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 9701c6984d)
2014-05-07 09:49:13 -07:00
Kenneth Graunke
e6c98309c6 meta: Add infrastructure for saving/restoring the DrawBuffers state.
Sometimes we need to configure what draw buffers we render to, without
creating a new FBO.  This path will make that possible.

Cc: "10.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit c1c1cf5f92)
2014-05-07 09:48:34 -07:00
Kenneth Graunke
ffc0cc027a meta: Add a new MESA_META_DRAW_BUFFERS bit.
This will be used for saving/restoring the glDrawBuffers state.
For now, make sure that existing users of MESA_META_ALL don't get
the new bit, since they probably won't want it.

Cc: "10.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit e526ebf35c)
2014-05-07 09:48:34 -07:00
Kenneth Graunke
658d0410d0 meta: Unify the GLSL and fixed-function clear paths.
The majority of _mesa_meta_Clear and _mesa_meta_glsl_Clear was the same;
adding a boolean for whether to use GLSL allows us to share most of it
without polluting either path too much.

Tested for regressions by hacking i965 to always use the non-GLSL path.

Cc: "10.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 7c8df60f31)
2014-05-07 09:48:34 -07:00
Kenneth Graunke
a1dd1e62fa i965: Always intel_prepare_render() after invalidating front buffers.
Fixes glean/texture_srgb, which hit recursive-flush prevention
assertions in vbo_exec_FlushVertices.

This probably hurts the performance of front buffer rendering, but
very few people in their right mind do front buffer rendering.

Fixes Glean's texture_srgb test.

Cc: "10.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit cde8bad1c9)
2014-05-07 09:48:34 -07:00
Tapani Pälli
c7a3c2d29d glsl: fix bogus layout qualifier warnings
Print out GL_ARB_explicit_attrib_location warnings only
when parsing attribute that uses "location" qualifier.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77245
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Cc: "10.1 10.2" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit e65917f94e)
2014-05-07 09:48:34 -07:00
Kenneth Graunke
0a5034517a i965: Set miptree target field when creating from a BO.
Prior to commit 8435b60a35, the region
equivalent of this function called intel_miptree_create_layout, which
set mt->target to target.  With that commit, it no longer copied target.

Piglit's ext_image_dma_buf_import-sample_[xa]rgb8888 tests would then
hit an assertion failure, where image->TexObject->Target was
GL_TEXTURE_EXTERNAL_OES, and mt->target was GL_TEXTURE_2D.

Copying the target fixes this assertion failure.

Cc: "10.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 829cb0423d)
2014-05-05 10:10:54 -07:00
Ian Romanick
e8f6150320 mesa: Bump version to 10.2-rc1
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2014-05-02 21:17:00 -07:00
Ian Romanick
a06c9791d1 docs: Add missing release notes for ARB_separate_shader_objects
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reported-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-05-02 17:25:19 -07:00
Eric Anholt
20404e45c7 i965: Move push constant state packets to push constant update time.
-0.553779% +/- 0.423394% effect on cairo-perf-trace runtime on glamor
(n=612)

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-05-02 17:01:40 -07:00
Eric Anholt
113037148d i965: Merge gen8_upload_constant_state into gen7_upload_constant_state.
The two paths are really similar, and the extra conditionals will be
dwarfed by the cost of the actual upload.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-05-02 17:01:40 -07:00
Eric Anholt
51b79a6571 i965: Refactor gen7_upload_constant_state to look more like gen8.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-05-02 17:01:40 -07:00
Eric Anholt
1515ceb8fd i965: Drop unnecessary state flag for units on NEW_BINDING_TABLE.
Commit 30259856a8 moved the state packets to
table generation time, but forgot to make this change.  Apparently the
performance win there was about not reemitting the table pointers on
unrelated state changes.

No performance difference on cairo on glamor (n=118).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-05-02 17:01:40 -07:00
Eric Anholt
f9a2679db5 i965/gen7+: Move sampler state packets to the stage sampler state table update.
Now that we have the stage state coming into our setup of sampler states,
it's easy to drop an identifier into it of which stage the stage_state is,
and then look up which packet to emit in a little table.

No performance difference on cairo on glamor (n=492).

v2: Don't forget to do the workaround flush on IVB.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-05-02 17:01:40 -07:00
Eric Anholt
680d202d49 i965/gen6: Don't update unit state when samplers change.
There's no remaining dependency between these two packets that I can find.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-05-02 17:01:40 -07:00
Eric Anholt
02a3449758 i965: Drop a NEW_SAMPLER annotation for use of sampler_count.
The sampler count is set up from the gl_program at draw time, not at
sampler change time.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-05-02 17:01:40 -07:00
Eric Anholt
57ad5a3103 i965: Simplify sampler setup by passing the stage state.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-05-02 17:01:40 -07:00
Eric Anholt
9e363f0262 i965: Make batch dumping go to stderr, too.
All our other debug goes there.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-05-02 17:01:40 -07:00
Eric Anholt
55a049b9ae i965: Fix a stale comment reference
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-05-02 17:01:39 -07:00
Armin K
0b307afd57 glx: Conditionally compile GLX_MESA_query_renderer DRI3 support
Missed out with commit 625bdd64e5.

Cc: "10.1" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-05-02 23:20:34 +01:00
Samuel Li
7f8f6790e4 radeonsi: add Mullins pci ids.
Signed-off-by: Samuel Li <samuel.li@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-05-02 17:30:31 -04:00
Samuel Li
aad669b1e9 radeonsi: add support for Mullins asics.
v2: name defaults to kabini for older llvm
v3: fix llvm version check

Signed-off-by: Samuel Li <samuel.li@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-05-02 17:30:27 -04:00
Alex Deucher
b26175b6c3 configure: bump up libdrm_radeon requirement to 2.4.54
Required for Mullins.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2014-05-02 17:29:56 -04:00
Ian Romanick
625bdd64e5 dri3: Enable GLX_MESA_query_renderer on DRI3 too
This should have happend around the time of commit 4680d23, but Keith's
DRI3 patches and my GLX_MESA_query_renderer patches crossed in the mail.

I don't have a working DRI3 setup, so I haven't been able to actually
verify this.  I'm hoping that someone can piglit this for me on DRI3...
It's also unfortunate the DRI2 and DRI3 can't share more code.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Cc: Keith Packard <keithp@keithp.com>
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-05-02 22:13:58 +01:00
José Fonseca
7ebdc9e48c util: Don't attempt to redefine INFINITY/NAN on VS 2013.
There are now provided by VS.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-05-02 22:04:47 +01:00
José Fonseca
8c879ac197 mesa: VS 2013 does not provide strcasecmp.
A define is necessary, like for earlier VS versions.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-05-02 22:04:47 +01:00
José Fonseca
ade79b21e9 egl: Don't attempt to redefine stdint.h types with VS 2010.
Just include stdint.h.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-05-02 22:04:47 +01:00
José Fonseca
979692a52a scons: Don't use bundled C99 headers for VS 2013.
Use the ones provided by the compiler instead.

NOTE: External trees should be updated to not include '#include/c99'
directory directly, but rather rely on scons/gallium.py to do the right
thing.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-05-02 22:04:46 +01:00
José Fonseca
0582800dd6 scons: Don't restrict MSVC_VERSION values.
Saves the trouble of continuously needing to update.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-05-02 22:04:46 +01:00
José Fonseca
d69fd5d940 draw: Prevent signed/unsigned comparisons.
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-05-02 22:04:46 +01:00
José Fonseca
605ef195aa st/vega: Prevent signed/unsigned comparisons.
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-05-02 22:04:46 +01:00
José Fonseca
42b9f8590d scons: Adjust the warnings for VS.
Silence insignificant warnings so significant warnings have a chance to
stand out.

The only abundant warning that's not silenced here is "C4018:
signed/unsigned mismatch", as it could hide security issues, so it's better
to actually fix the code.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-05-02 22:04:46 +01:00
José Fonseca
5bd3b91784 util/u_debug_flush: Use util_snprintf.
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-05-02 22:04:46 +01:00
Emil Velikov
1c6154c9b4 targets/omx: add nouveau target
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-05-02 21:48:27 +01:00
Emil Velikov
be1b5feaa0 targets/omx: use GALLIUM_VIDEO_CFLAGS
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2014-05-02 21:48:27 +01:00
Emil Velikov
ce6c17c083 targets/pipe-loader: cleanup version-script
Drop the version/name tag from the script as it was never
meant to be there. Add swrast_create_screen as it is used
when loading swrast. Rename the file to pipe.sym.

v2: Rebase on top of the LD_NO_UNDEFINED changes.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2014-05-02 21:48:27 +01:00
Emil Velikov
f743670b9a targets/opencl: hide all the exported llvm/clang mayhem... hopefully
Both llvm and clang polute the exported symbol table, as soon
as we try to link with either one. Other than those two
everything else looks good (clean).

Cc: Tom Stellard <thomas.stellard@amd.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2014-05-02 21:48:27 +01:00
Emil Velikov
7b7944ee1c targets/egl-static: freshen up the version script
Namely drop the version/name tag of the exported symbol, and
rename the filename to egl.sym.

v2: Rebase on top of the LD_NO_UNDEFINED changes.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-05-02 21:48:26 +01:00
Emil Velikov
4eaa3c9b60 targets/gbm: add version-script to limit exported symbols
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-05-02 21:48:26 +01:00
Emil Velikov
69d790da9f targets/vdpau: use version script to limit the exported symbols
Using export-symbols-regex is the least desirable method of restricting
the exported symbols, as is completely messes up with the symbol table.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2014-05-02 21:48:26 +01:00
Emil Velikov
53dd2e45f4 targets/omx: drop the version from the omx targets
Suggested-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-05-02 21:48:26 +01:00
Emil Velikov
bea9e8dca0 targets/omx: use version script to limit amount of exported symbols
Using export-symbols-regex is the least desirable method of restricting
the exported symbols, as is completely messes up with the symbol table.

radeon_drm_winsys_create is not needed, avoid exporting it.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2014-05-02 21:48:26 +01:00
Emil Velikov
6239d42fdb targets/dri: use a single version script to restict exported symbols
Rather than having multiple (almost) identical version scripts use
a single one.

Cc: Christian König <christian.koenig@amd.com>
Acked-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-05-02 21:48:25 +01:00
Emil Velikov
b8f31dfc22 targets/xvmc: limit the amount of exported symbols
In the presence of LLVM the final library exports every symbol from
the llvm namespace. Resolve this by using a version script (w/o the
version/name tag).

Considering that there are only ~25 symbols, explicitly list them
to minimize the chances of rogue symbols sneaking in.

Drop the *winsys_create functions as they were only meant for
gl-vdpau interop.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2014-05-02 21:48:25 +01:00
Emil Velikov
9bcb3698db targets/osmesa: hide osmesa_create_screen
The symbol is not meant to be exported, and its presence was
only a side effect due to the missing visibility flags.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-05-02 21:48:25 +01:00
Emil Velikov
658b36ff78 targets/pipe-loader: drop driver_descriptor symbol from swrast
The symbol is used for hardware only drivers. For swrast the
loader uses swrast_create_screen. Add VISIBILITY_CFLAGS while
we're here.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2014-05-02 21:48:25 +01:00
Juha-Pekka Heikkila
a50b02783b mesa: add extra null checks in vbo_rebase_prims()
v2 [idr]: Move declarations before code to prevent MSVC build breaks.

Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2014-05-02 12:00:30 -07:00
Juha-Pekka Heikkila
dc675919d3 mesa: add missing null checks in _tnl_register_fastpath()
Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-05-02 11:58:36 -07:00
Ian Romanick
59ad2e6696 mesa: Add _mesa_error_no_memory for logging out-of-memory messages
This can be called from locations that don't have a context pointer
handy.  This patch also adds enough infrastructure so that the unit
tests for the GLSL compiler and the stand-alone compiler will build and
function.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
2014-05-02 11:58:36 -07:00
Chia-I Wu
267e28bb62 glsl: make static constant variables "static const"
This allows them to be moved to .rodata, and allow us to be sure that they
will not be modified.

Signed-off-by: Chia-I Wu <olv@lunarg.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Timothy Arceri <t_arceri@yahoo.com.au>
2014-05-02 10:50:14 -07:00
Petri Latvala
6a2d28599f docs: update 10.2 release notes
Signed-off-by: Petri Latvala <petri.latvala@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-05-02 10:07:05 -07:00
Petri Latvala
b4363c8ea4 i965: Enable INTEL_performance_query for Gen5+.
Signed-off-by: Petri Latvala <petri.latvala@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-05-02 10:07:04 -07:00
Petri Latvala
8cf5bdad3c mesa: Implement INTEL_performance_query.
Using the existing driver hooks made for AMD_performance_monitor, implement
INTEL_performance_query functions.

v2: Whitespace changes.
v3: Whitespace changes, add a _mesa_warning()

Signed-off-by: Petri Latvala <petri.latvala@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-05-02 10:07:04 -07:00
Petri Latvala
dac82ceac5 mesa: Add core support for the GL_INTEL_performance_query extension.
Like AMD_performance_monitor, this extension provides an interface for
applications (and OpenGL-based tools) to access GPU performance
counters. Since the exact performance counters available vary between
vendors and hardware generations, the extension provides an API the
application can use to get the names, types, and minimum/maximum
values of all available counters.

Applications create performance queries based on available query
types, and begin/end measurement collection. Multiple queries can be
measuring simultaneously.

v2: Whitespace changes
v3: src/mapi/glapi/gen/gl_API.xml: Also expose the functions to GLES2.
v4: Whitespace changes, static_dispatch="false" for all functions, fix
    dispatch_sanity test for GLES2 functions

Signed-off-by: Petri Latvala <petri.latvala@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-05-02 10:07:04 -07:00
Petri Latvala
6ccb98e88c mesa: Add INTEL_performance_query enums to tests/enum_strings.cpp
Signed-off-by: Petri Latvala <petri.latvala@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-05-02 10:07:04 -07:00
Petri Latvala
927c3c9704 Regenerate gl_mangle.h.
Signed-off-by: Petri Latvala <petri.latvala@intel.com>
Acked-by: Ian Romanick <ian.d.romanick@intel.com>
2014-05-02 10:07:04 -07:00
Ilia Mirkin
cf6c9dbc33 docs: update ARB_buffer_storage for nouveau 2014-05-02 12:16:25 -04:00
Ilia Mirkin
3df4d692f3 nouveau: add ARB_buffer_storage support
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-05-02 12:16:25 -04:00
Ilia Mirkin
b0d02db7e0 nouveau: remove cb_dirty, it's never used
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-05-02 12:01:35 -04:00
Ilia Mirkin
1baf77dbe8 nvc0: treat non-linear 2DRect textures the same as 2D
This fixes textureGather(2DRect) piglit tests, and does not appear to
have any adverse effects.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-05-02 12:01:35 -04:00
Ilia Mirkin
cd064c6a25 mesa/st: enable carry/borrow lowering pass
This handles the last of the ARB_gs5 instructions currently present in
mesa.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-05-02 12:01:35 -04:00
Ilia Mirkin
31b92aa2fc glsl: add lowering passes for carry/borrow
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-05-02 12:01:35 -04:00
Ian Romanick
f64bfb2e39 mesa: Eliminate gl_shader_program::InternalSeparateShader
This was a work-around to allow linking a program with only a fragment
shader in a GLES context.  Now that we have GL_EXT_separate_shader_objects
in GLES contexts, we can just use that.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-05-02 07:20:11 -07:00
Ian Romanick
7d9adef340 mesa: Enable GL_EXT_separate_shader_objects for OpenGL ES
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-05-02 07:20:10 -07:00
Ian Romanick
507b875cf5 glsl: Sort the list of extensions
ARB, OES, then everything else.  If there's ever a KHR shading language
extension, it should go between ARB and OES.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Eric Anholt <eric@anholt.net>
2014-05-02 07:20:10 -07:00
Ian Romanick
fb615feafb mesa: Remove support for desktop OpenGL GL_EXT_separate_shader_objects
I don't know of any applications that actually use it.  Now that Mesa
supports GL_ARB_separate_shader_objects in all drivers, this extension
is just cruft.

The entrypoints for the extension remain in the XML.  This is done so
that a new libGL will continue to provide dispatch support for old
drivers that try to expose this extension.

Future patches will add OpenGL ES GL_EXT_separate_shader_objects, but
that's a different thing.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-05-02 07:20:10 -07:00
Ian Romanick
e608449d3e mesa/sso: Enable GL_ARB_separate_shader_objects by default
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-05-02 07:20:08 -07:00
Ian Romanick
0939d3d097 sso: Add display list support for ARB_separate_shader_objects new functions
With this patch, the piglit arb_separate_shader_object-dlist test
passes.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-05-02 07:19:40 -07:00
Ian Romanick
7ff937e579 linker: Modify cross_validate_outputs_to_inputs to match using explicit locations
This will be used for GL_ARB_separate_shader_objects.  That extension
not only allows separable shaders to rendezvous by location, but it also
allows traditionally linked shaders to rendezvous by location.  The spec
says:

    36. How does the behavior of input/output interface matching differ
        between separable programs and non-separable programs?

        RESOLVED: The rules for matching individual variables or block
        members between stages are identical for separable and
        non-separable programs, with one exception -- matching variables
        of different type with the same location, as discussed in issue
        34, applies only to separable programs.

        However, the ability to enforce matching requirements differs
        between program types.  In non-separable programs, both sides of
        an interface are contained in the same linked program.  In this
        case, if the linker detects a mismatch, it will generate a link
        error.

v2: Make sure consumer_inputs_with_locations is initialized when
consumer is NULL.  Noticed by Chia-I.

v3: Rebase on removal of ir_variable::user_location.

v4: Replace a (stale) FINISHME with some good explanation comments from
Eric.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-05-02 07:19:40 -07:00
Ian Romanick
d030a3404c linker: Sort shader I/O variables into a canonical order
v2: Rebase on removal of ir_variable::user_location.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-05-02 07:19:40 -07:00
Ian Romanick
c557eb7722 linker: Allow geometry shader without vertex shader for separable programs
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-05-02 07:19:40 -07:00
Ian Romanick
1ff5a2b1ba linker: Assign varying locations for separable programs
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2014-05-02 07:19:40 -07:00
Ian Romanick
7d73c3e99e linker: Allow consumer stage or producer stage to be NULL
When linking a separable program that contains only a fragment shader,
the producer will be NULL.  Similar cases will exist with geometry
shaders and, eventually, tessellation shaders.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-05-02 07:19:40 -07:00
Ian Romanick
fe37cb0ac6 linker: Refactor code that gets an input matching an output
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2014-05-02 07:19:40 -07:00
Ian Romanick
5699220cd5 glsl: Exit when the shader IR contains an interface block instance
While writing the link_varyings::single_interface_input test, I
discovered that populate_consumer_input_sets assumes that all shader
interface blocks have been lowered to discrete variables.  Since there
is a pass that does this, it is a reasonable assumption.  It was,
however, non-obvious.  Make the code fail when it encounters such a
thing, and add a test to verify that behavior.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2014-05-02 07:19:40 -07:00
Ian Romanick
ba7195d126 glsl/tests: Add first simple tests of populate_consumer_input_sets
Four initial tests:

* Create an IR list with a single input variable and verify that
  variable is the only thing in the hash tables.

* Same as the previous test, but use a built-in variable
  (gl_ClipDistance) with an explicit location set.

* Create an IR list with a single input variable from an interface block
  and verify that variable is the only thing in the hash tables.

* Create an IR list with a single input variable and a single input
  variable from an interface block.  Verify that each is the only thing
  in the proper hash tables.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2014-05-02 07:19:39 -07:00
Ian Romanick
8f5852bd2b linker: Refactor code that builds hash tables of varyings during linking
I want to make some changes to this code, but first I want to make some
unit tests for it... so that I can capture the pre- and
post-invariants.  Pulling the code out into its own function in a
non-anonymous namespace enables that.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-05-02 07:19:39 -07:00
Ian Romanick
ca21cffebd meta: Fix saving the program pipeline state
This code was broken in some odd ways before.  Too much state was being
saved, it was being restored in the wrong order, and in the wrong way.
The biggest problem was that the pipeline object was restored before
restoring the programs attached to the default pipeline.

Fixes a regression in the glean texgen test.

v3: Fairly significant re-write.  I think it's much cleaner now, and it
avoids a bug with some meta ops that use shaders (reported by Chia-I).

v4: Check Pipeline.Current against NULL instead of Pipeline.Default.
Suggested by Chia-I.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chia-I Wu <olv@lunarg.com>
2014-05-02 07:17:34 -07:00
Ian Romanick
4a868a984d mesa/sso: Refactor new function _mesa_bind_pipeline
Pull most of the guts out of _mesa_BindPipeline into a new utility
function that can be use elsewhere (e.g., meta).

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-05-02 07:16:55 -07:00
Ian Romanick
5998fd536a linker: Make lower_packed_varyings work with explicit locations
Don't do anything with variables that have explicitly assigned
locations.  This is also how built-in varyings are handled.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-05-02 07:16:54 -07:00
Ian Romanick
7016afe25d glsl: Remove varying "base" parameters
In February 2013 Paul unified the values used for shader stage outputs
and shader stage inputs.  See commits 8a076c5f0^..eed6baf76.  Since that
time, the location_base parameters are always VARYING_SLOT_VAR0.
Instead of passing that around, just hard code it.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-05-02 07:16:54 -07:00
Ian Romanick
03488cd3b9 glsl: Constify parameter to a couple varying_matches methods
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-05-02 07:16:54 -07:00
Tom Stellard
e05cebafd8 clover: Add a stub implementation of clCreateImage() v3
Now that we are uisng the OpenCL 1.2 headers, applications expect all
the OpenCL 1.2 functions to be implemented.

This fixes linking errors with the piglit CL tests.

v2:
  - Use c++ features
  - Fix error code handling

v3:
  - Move <iostream> into api/util.hpp
  - Fix indentation

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2014-05-02 06:48:17 -07:00
Chris Forbes
11f92fd9f9 docs: Add missing ARB_gpu_shader5 subfeature to GL3.txt
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
2014-05-02 17:09:13 +12:00
Fredrik Höglund
e6ff557d15 docs: Mark ARB_multi_bind as done
...and update relnotes.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-05-02 03:00:42 +02:00
Fredrik Höglund
68f3b31a0f mesa: Enable ARB_multi_bind
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-05-02 03:00:42 +02:00
Fredrik Höglund
2a25570456 mesa: Implement glBindImageTextures
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-05-02 03:00:41 +02:00
Fredrik Höglund
63995b902a mesa: Implement glBindVertexBuffers
v2: Use the user provided offset and stride when the buffer ID is zero.

Reviewed-by: Brian Paul <brianp@vmware.com> (v1)
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> (v1)
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> (v2)
2014-05-02 03:00:41 +02:00
Fredrik Höglund
f0c36cf4fa mesa: Implement glBindBuffersRange
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-05-02 03:00:41 +02:00
Fredrik Höglund
533cfa03ac mesa: Implement glBindBuffersBase
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-05-02 03:00:41 +02:00
Fredrik Höglund
835abfaba4 mesa: Add _mesa_set_transform_feedback_binding()
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-05-02 03:00:41 +02:00
Fredrik Höglund
f65a0c19a5 mesa: Refactor set_ubo_binding()
Make set_ubo_binding() just update the binding, and move the code
that does validation, flushes the vertices etc. into a new
bind_uniform_buffer() function.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-05-02 03:00:41 +02:00
Fredrik Höglund
28d7335810 mesa: Add helper functions for looking up multiple buffers
v2: Document the difference between _mesa_lookup_bufferobj() and
    _mesa_multi_bind_lookup_bufferobj().
v3: Don't create the buffer objects when they don't exist.

Reviewed-by: Brian Paul <brianp@vmware.com> (v2)
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> (v2)
2014-05-02 02:53:26 +02:00
Fredrik Höglund
19f7eeb6fb mesa: Refactor set_atomic_buffer_binding()
Make set_atomic_buffer_binding() just update the binding, and move
the code that does validation, flushes the vertices etc. into a new
bind_atomic_buffer() function.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-05-02 02:53:26 +02:00
Fredrik Höglund
4f30c0ba80 mesa: Implement glBindTextures
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-05-02 02:53:25 +02:00
Fredrik Höglund
659d94b256 mesa: Add a texUnit parameter to dd_function_table::BindTexture
This is for glBindTextures(), since it doesn't change the active
texture unit.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-05-02 02:53:25 +02:00
Fredrik Höglund
b8ee235e72 mesa: Add helper functions for looking up multiple textures
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-05-02 02:53:25 +02:00
Fredrik Höglund
b16e2ada4c mesa: Implement glBindSamplers
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-05-02 02:53:25 +02:00
Fredrik Höglund
6655e70f99 glapi: Add infrastructure for ARB_multi_bind
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-05-02 02:53:25 +02:00
Fredrik Höglund
82291f64e3 mesa: Add functions for doing unlocked hash table lookups
This patch adds functions for locking/unlocking the mutex, along with
_mesa_HashLookupLocked() and _mesa_HashInsertLocked()
that do lookups and insertions without locking the mutex.

These functions will be used by the ARB_multi_bind entry points to
avoid locking/unlocking the mutex for each binding point.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-05-02 02:53:25 +02:00
Fredrik Höglund
30af8ce3f8 mesa: Optimize unbind_texobj_from_texunits()
The texture can only be bound to the index that corresponds to its
target, so there is no need to loop over all possible indices
for every unit and checking if the texture is bound to it.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-05-02 02:53:25 +02:00
Fredrik Höglund
4bd8272088 mesa: Add a _BoundTextures field in gl_texture_unit
This will be used by glBindTextures() when unbinding textures,
to avoid having to loop over all the targets.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-05-02 02:53:25 +02:00
Fredrik Höglund
6bf8ac846a mesa: Store the target index in gl_texture_object
This will be used by glBindTextures() so we don't have to look it up
for each texture.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-05-02 02:53:25 +02:00
Eric Anholt
d55e5a323b i965: Fix the file comment for intel_image.h
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2014-05-01 15:12:28 -07:00
Eric Anholt
5566747296 i965: Rename intel_regions.h to something more appropriate now.
We had the EGLimage structure laying around in intel_regions.h, but now
it's the only thing left in the file.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2014-05-01 15:12:27 -07:00
Eric Anholt
e7f65655cb i965: Delete the intel_regions.c code.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2014-05-01 15:12:27 -07:00
Eric Anholt
3278f96a52 i965: Drop region usage from DRI2 winsys-allocated buffers.
v2: Fix bad pointer on unreference (caught by Chad)

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-05-01 15:12:27 -07:00
Eric Anholt
835f90692f i965: Drop a funny assert about mt pitch.
I slipped this in in the region->pitch change from pixels to bytes, but I
don't see any reason for it any more -- the libdrm code doesn't appear to
divide pitch by a cpp.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2014-05-01 15:12:27 -07:00
Eric Anholt
b49982de6a i965: Fix intel_bufferobj_buffer range for blit drawpixels.
If the stride wasn't width*cpp, we wouldn't track how much of the src is
busy, and allow a subdata into the end to proceed unsynchronized.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2014-05-01 15:12:27 -07:00
Eric Anholt
e16c5c9063 i965: Drop use of intel_region from miptrees.
Note: region->width/height used to reflect the total_width/height padding
of separate stencil, though mt->total_width didn't.  region->width/height
was being used in EGL images, where the padded value would have been the
wrong one, so I converted them to use rb->Width/Height.

v2: Drop debug printf that slipped in (caught by Ken)

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2014-05-01 15:12:27 -07:00
Eric Anholt
e3a9ca4563 i965: Replace the region in DRIimage with just a BO pointer and stride.
Regions aren't refcounted safely for multithreaded applications, and
they're not terribly useful wrappers of a BO, so I'm trying to remove
them.

Even the stride I added here could probably be reduced to use of an
existing field in the __DRIimageRec, but I want this to be as mechanical
of a change as possible.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2014-05-01 15:12:27 -07:00
Eric Anholt
8435b60a35 i965: Make intel_set_texture_region just take a BO and pitch.
I want to do this to get the region removed from DRI images.  However, it
does mean that we won't share the intel_region between the rb and the
texture for texture_from_pixmap.  I think that's fine.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2014-05-01 15:12:27 -07:00
Eric Anholt
c0bf5a7eff i965: Stop making a pointless region for DRI2 to just throw it away.
I noticed that we were doing this while changing the DRI3 path to not use
regions, which involved changing the signature of
intel_update_winsys_renderbuffer_miptree() this way.

v2: Replace my comment with Chad's version.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> (v1)
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net> (v1)
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2014-05-01 15:12:26 -07:00
Eric Anholt
3a7a20752f i965: Drop the global GEM name from regions.
Once a buffer has been named, drm_intel_bo_flink() is just a getter.

Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2014-05-01 15:12:26 -07:00
Eric Anholt
76932c0ded i965: Drop the tiling argument to intel_miptree_create_for_bo.
The drm function to get the tiling is just a getter storing the two
pointers, so we don't need to go out of our way to avoid it.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2014-05-01 15:12:26 -07:00
Eric Anholt
522fb01275 i965: Drop pointless cast of texObj to intelObj.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2014-05-01 15:12:26 -07:00
Eric Anholt
3033f80af5 i965: Move intel_region_get_aligned_offset() to be a miptree function.
All the consumers are doing it on a miptree.

v2: fix a silly duplicated dereference (review by Ken)

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net> (v1)
Reviewed-by: Chad Versace <chad.versace@linux.intel.com> (v1)
2014-05-01 15:12:26 -07:00
Eric Anholt
9791eb4280 i965: Move intel_region_get_tile_masks() to be a miptree function.
All the consumers are doing it on a miptree.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2014-05-01 15:12:26 -07:00
Eric Anholt
ea2cac01e8 i965: Fix another broken offset-aligned-to-tile test.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2014-05-01 15:12:26 -07:00
Eric Anholt
65e025f99c i965: Fix offset-aligned-to-tile test in dma_buf import.
v1 of the patch got pushed, insted of the v2 that I had reviewed.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2014-05-01 15:12:26 -07:00
Eric Anholt
6db640da22 i965: Reuse intel_miptree_get_tile_offsets().
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2014-05-01 15:12:26 -07:00
Brian Paul
5ec1adeb10 mesa: move declarations before code in texstore.c
To fix MSVC build.

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-05-01 16:01:06 -06:00
Ville Syrjälä
eb502c31a0 i965: Fix format of private renderbuffers
intel_alloc_renderbuffer_storage() will clobber rb->Format which was
already set up by intel_create_renderbuffer(). This causes the driver
to potentially create the depth buffer in the wrong format.

In practice this makes the depth buffer Z24 even if the visual has
depthBits==16.

The incorrect depth buffer format doesn't seem to cause any actual
problems in i965, but it seems like we should fix it anyway. I see
Z16 has been more or less deprecated in the driver except the for
the depthBits==16 case. But if we want to use Z24 even in that
case (not sure it's really legal?) it would look better if the
code made that decision explicitly rather than relying on the
format to get magically overwritten by the renderbuffer code.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2014-05-01 23:56:34 +03:00
Ville Syrjälä
c1d4d49993 i915: Don't advertise Z formats in TextureFormatSupported on gen2
Gen2 doesn't support texturing from Z formats, so state as much.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2014-05-01 23:56:25 +03:00
Ville Syrjälä
d3edc31810 i915: Fix format of private renderbuffers
intel_alloc_renderbuffer_storage() will clobber rb->Format which was
already set up by intel_create_renderbuffer(). This causes the driver
to potentially create the depth buffer in the wrong format.

Long time ago things worked by accident because
_mesa_choose_tex_format() checked for ARB_depth_texture
and thus returned MESA_FORMAT_NONE on gen2 hardware. Somehow
that ended up working when depthBits==16 because the driver
would then pick DEPTH_FRMT_16_FIXED. Not sure how, but things
also seemed to work with depthBits==24.

Things started to go more sideways at:
 commit 6ae473221a
 Author: Eric Anholt <eric@anholt.net>
 Date:   Mon Apr 22 16:04:25 2013 -0700

    intel: Fold the one last function intel_tex_format.c into the caller.

since that caused intel_miptree_create_layout() to divide by zero
when encoutering MESA_FORMAT_NONE (bw==0). So after this
commit things were broken enough that many applications wouldn't even
run.

Things got a bit better at:
 commit c245efe7e8
 Author: Eric Anholt <eric@anholt.net>
 Date:   Thu Mar 21 09:50:45 2013 -0700

    mesa: Remove extension checking from ChooseTexFormat.

since now _mesa_choose_tex_format() would return MESA_FORMAT_X8_Z24
for GL_DEPTH_COMPONENT due to i915 erroneosly claiming that
MESA_FORMAT_X8_S24 (and others) are supported texture formats even
on gen2 hardware. So now the the div-by-zero was gone, but now the
driver would pick DEPTH_FRMT_24_FIXED_8_OTHER even when
depthBits==16 which caused rendering problems.

If we prevent rb->Format from getting clobbered for the depth buffer
things work much better. This makes the spinning title text visible
again in chromium-bsu at 16bpp, for example.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2014-05-01 23:56:09 +03:00
Anuj Phogat
c1743707a1 mesa: Allow FLOAT_32_UNSIGNED_INT_24_8_REV in get_tex_depth_stencil()
Fixes a crash in Khronos OpenGL CTS packed_pixels tests.

Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-05-01 10:58:40 -07:00
Anuj Phogat
29b8e894d1 mesa: Add support to unpack depth-stencil texture in to FLOAT_32_UNSIGNED_INT_24_8_REV
V2: Follow the new naming convention for unpack functions.
    Use double precision for converting Z24 to a float.
V3: Unpack stencil value to most significant byte.
    Use 'struct z32f_x24s8' type.
V4: Unpack stencil value to least significant byte.
    Add a comment to clarify stencil packing.

Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-05-01 10:58:40 -07:00
Anuj Phogat
7a8045d2f7 mesa: Add new helper function _mesa_unpack_depth_stencil_row()
This patch makes non-functional changes in the code. New helper
function added here will make it easier to support more data
types in the following patches.

Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-05-01 10:58:40 -07:00
Anuj Phogat
ef924f0de9 mesa: Remove redundant if checks in _mesa_texstore_xx_xx() functions
This patch contains non-functional changes. Assertion checks made
earlier in the functions make the if checks redundant. So, remove
the if checks and unindent the code in if block.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-05-01 10:58:40 -07:00
Anuj Phogat
1a8f9ba9b3 mesa: Allow srcFormat=GL_DEPTH_STENCIL in _mesa_texstore_xx_xx() functions
_mesa_texstore_z24_s8() and _mesa_texstore_z32f_x24s8() are capable of
handling GL_DEPTH_STENCIL format. So, allow it in both the functions.

Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-05-01 10:58:40 -07:00
Anuj Phogat
aeb9d4495d mesa: Add missing types in _mesa_texstore_xx_xx() functions
Depth-stencil teture targets are allowed to use source data of type
GL_UNSIGNED_INT_24_8_EXT and GL_FLOAT_32_UNSIGNED_INT_24_8_REV.

Fixes few crashes in Khronos OpenGL CTS packed_pixels tests.

Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-05-01 10:58:40 -07:00
Anuj Phogat
d714b20eb4 i965: Fix crash in do_blit_readpixels()
Fixes a crash in Khronos CTS packed_pixels tests.

Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-05-01 10:58:40 -07:00
Anuj Phogat
5388fc157e mesa: Add error condition for format=STENCIL_INDEX in glGetTexImage()
From OpenGL 4.0 spec, page 306:
   "Calling GetTexImage with a format of STENCIL_INDEX
    causes the error INVALID_ENUM."

Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-05-01 10:58:39 -07:00
Anuj Phogat
340658e44f mesa: Add entry for extension ARB_texture_stencil8
V2: Alphabetize the new entry

Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-05-01 10:58:39 -07:00
Anuj Phogat
9bcb0a8532 glsl: Apply the link error conditions to GL_ARB_fragment_coord_conventions
Link error conditions added in previous patch are equally applicable
to GL_ARB_fragment_coord_conventions implementation. Extension's spec
says:
   "If gl_FragCoord is redeclared in any fragment shader in a program,
    it must be redeclared in all the fragment shaders in that program
    that have a static use of gl_FragCoord. All redeclarations of
    gl_FragCoord in all fragment shaders in a single program must have
    the same set of qualifiers."

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Cc: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-05-01 10:58:39 -07:00
Anuj Phogat
35f11e85cb glsl: Link error if fs defines conflicting qualifiers for gl_FragCoord
GLSL 1.50 spec says:
   "If gl_FragCoord is redeclared in any fragment shader in a program,
    it must be redeclared in all the fragment shaders in that
    program that have a static use gl_FragCoord. All redeclarations of
    gl_FragCoord in all fragment shaders in a single program must
    have the same set of qualifiers."

This patch causes the shader link to fail if we have multiple fragment
shaders with conflicting layout qualifiers for gl_FragCoord.

V2: Restructure the code and add conditions to correctly handle the
    following case:

fragment shader 1:
layout(origin_upper_left) in vec4 gl_FragCoord;
void main()
{
    foo();
    gl_FragColor = gl_FragData;
}

fragment shader 2:
layout(pixel_center_integer) in vec4 gl_FragCoord;
void foo()
{
}

V3:
Allow linking in the following case:
fragment shader 1:
void main()
{
    foo();
    gl_FragColor = gl_FragCoord;
}

fragment shader 2:
in vec4 gl_FragCoord;
void foo()
{
   ...
}

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Cc: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-05-01 10:58:39 -07:00
Anuj Phogat
a751adf071 glsl: Compile error if fs uses gl_FragCoord before first redeclaration
Section 4.3.8.1, page 39 of GLSL 1.50 spec says:
  "Within any shader, the first redeclarations of gl_FragCoord
   must appear before any use of gl_FragCoord."

GLSL compiler should generate an error in following case:

vec4 p = gl_FragCoord;
layout(origin_upper_left) in vec4 gl_FragCoord;

void main()
{
}

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Cc: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-05-01 10:58:39 -07:00
Anuj Phogat
581e4acb0d glsl: Compile error if fs defines conflicting qualifiers for gl_FragCoord
GLSL 1.50 spec says:
   "If gl_FragCoord is redeclared in any fragment shader in a program,
    it must be redeclared in all the fragment shaders in that
    program that have a static use gl_FragCoord. All redeclarations of
    gl_FragCoord in all fragment shaders in a single program must
    have the same set of qualifiers."

This patch makes the glsl compiler to generate an error if we have a
fragment shader defined with conflicting layout qualifier declarations
for gl_FragCoord. For example:

layout(origin_upper_left, pixel_center_integer) in vec4 gl_FragCoord;
layout(pixel_center_integer) in vec4 gl_FragCoord;

void main()
{
}

V2: Some code refactoring for better readability.
    Add compiler error conditions for redeclarations like:

layout(origin_upper_left) in vec4 gl_FragCoord;
layout(origin_upper_left, pixel_center_integer) in vec4 gl_FragCoord;

and

in vec4 gl_FragCoord;
layout(origin_upper_left, pixel_center_integer) in vec4 gl_FragCoord;

V3: Simplify function is_conflicting_fragcoord_redeclaration()
V4: Check for null pointer before doing strcmp(var->name, "gl_FragCoord").

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Cc: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-05-01 10:58:39 -07:00
Anuj Phogat
49c71050de mesa: Use location VERT_ATTRIB_GENERIC0 for vertex attribute 0
In OpenGL 3.1 attribute 0 becomes non-magic, just like in
OpenGL ES 2.0. Earlier versions of OpenGL used attribute 0
exclusively for vertex position.

V2: Add a utility function _mesa_attr_zero_aliases_vertex() in
    varray.h

Fixes 4 Khronos OpenGL CTS failures:
glGetVertexAttrib
depth24_basic
depth24_precision
rgb8_rgba8_rgb

Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-05-01 10:58:39 -07:00
Anuj Phogat
dc75479b7a mesa: Fix querying location of nth element of an array variable
This patch makes changes to the behavior of glGetAttribLocation(),
glGetFragDataLocation() and glGetFragDataIndex() functions.

Code changes handle a case described in following example:

shader program:
layout(location = 1)in vec4[4] a;
void main()
{
}

Currently, glGetAttribLocation("a") returns 1.
glGetAttribLocation("a[i]"), where i = {0, 1, 2, 3}, returns -1.
But the expected locations for array elements are: 1, 2, 3 and 4
respectively.

This clarification came up with the addition of
ARB_program_interface_query to OpenGL 4.3.

From Page 326 (page 347 of the PDF) of OpenGL 4.3 spec:
   "Otherwise, the command is equivalent to

    GetProgramResourceLocation(program, PROGRAM_INPUT, name);"

And, From Page 101 (page 122 of the PDF) of OpenGL 4.3 spec:

   "A string provided to GetProgramResourceLocation or
    GetProgramResourceLocationIndex is considered to match an active
    variable if

    • the string exactly matches the name of the active variable;
    • if the string identifies the base name of an active array, where
      the string would exactly match the name of the variable if the
      suffix "[0]" were appended to the string; or
    • if the string identifies an active element of the array, where
      the string ends with the concatenation of the "[" character, an
      integer (with no "+" sign, extra leading zeroes, or whitespace)
      identifying an array element, and the "]" character, the integer
      is less than the number of active elements of the array variable,
      and where the string would exactly match the enumerated name of
      the array if the decimal integer were replaced with zero."

V2: Simplify get_matching_index() function.
    Add relevant text from OpenGL spec in commit message.

Fixes failures in Khronos OpenGL CTS tests:
explicit_attrib_location_room
draw_instanced_max_vertex_attribs

Proprietary linux drivers of NVIDIA (331.49) matches the behavior
expected by OpenGL 4.3 spec.

Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-05-01 10:58:39 -07:00
Anuj Phogat
8c61b6a99b glsl: Allow overlapping locations for vertex input attributes
Currently overlapping locations of input variables are not allowed for all
the shader types in OpenGL and OpenGL ES.

From OpenGL ES 3.0 spec, page 56:
   "Binding more than one attribute name to the same location is referred
    to as aliasing, and is not permitted in OpenGL ES Shading Language
    3.00 vertex shaders. LinkProgram will fail when this condition exists.
    However, aliasing is possible in OpenGL ES Shading Language 1.00 vertex
    shaders."

Taking in to account what different versions of OpenGL and OpenGL ES specs
say about aliasing:
   - It is allowed only on vertex shader input attributes in OpenGL (2.0 and
     above) and OpenGL ES 2.0.
   - It is explictly disallowed in OpenGL ES 3.0.

Fixes Khronos CTS failing test:
explicit_attrib_location_vertex_input_aliased.test
See more details about this at below mentioned khronos bug.

V2: Fix the case where location exceeds the maximum allowed attribute
    location.
V3: Simplify the condition added in V2.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Cc: "9.2 10.0 10.1" <mesa-stable@lists.freedesktop.org>
Bugzilla: Khronos #9609
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-05-01 10:58:39 -07:00
Roland Scheidegger
a773fdc64d glx/drisw: fix memory leak when destroying screen.
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-05-01 16:13:38 +02:00
Roland Scheidegger
64d6460a56 gallivm: fix 2 leaks in disassembly code
don't leak the MCSubtargetInfo (not really big, was already fixed with
llvm master) and TargetMachine (big). While this is only used for debugging
the leak is large enough to get you into trouble in some cases.
Tested with llvm 3.1 and master.
Before (llvm 3.1), GALLIVM_DEBUG=asm glxgears:
==14152== LEAK SUMMARY:
==14152==    definitely lost: 105,228 bytes in 20 blocks
==14152==    indirectly lost: 347,252 bytes in 261 blocks
==14152==      possibly lost: 866,625 bytes in 1,453 blocks
==14152==    still reachable: 7,344,677 bytes in 6,494 blocks
==14152==         suppressed: 0 bytes in 0 blocks

After:
==13799== LEAK SUMMARY:
==13799==    definitely lost: 3,108 bytes in 6 blocks
==13799==    indirectly lost: 0 bytes in 0 blocks
==13799==      possibly lost: 804,143 bytes in 1,429 blocks
==13799==    still reachable: 7,314,267 bytes in 6,473 blocks
==13799==         suppressed: 0 bytes in 0 blocks

Reviewed-by: Brian Paul <brianp@vmware.com>
2014-05-01 16:13:38 +02:00
José Fonseca
6d911a5944 mesa: Move declaration to top of block.
To fix MSVC build.  Trivial.
2014-05-01 10:00:10 +01:00
José Fonseca
b0de67ad2d osmesa: Fix typo in _MaxEnabledTexImageUnit. 2014-05-01 09:55:20 +01:00
Kenneth Graunke
85ce2242cb i965/vec4: Port untyped atomic message support to Broadwell.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77221
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-05-01 00:24:12 -07:00
Kenneth Graunke
45367d2d09 i965/vec4: Port untyped surface reads support to Broadwell.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77221
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-05-01 00:24:10 -07:00
Kenneth Graunke
e9e89d5756 i965/fs: Port untyped atomic message support to Broadwell.
v2: Fix SIMD mode comment (caught by Eric Anholt).

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77221
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-05-01 00:24:08 -07:00
Kenneth Graunke
54a48984b3 i965/fs: Port untyped surface read support to Broadwell.
v2: Drop unused num_components variable; fix SIMD Mode comment
    (caught by Eric Anholt).

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77221
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-05-01 00:24:06 -07:00
Kenneth Graunke
f1cd9fee53 i965/fs: Set fs_inst::header_present for untyped atomics/surface reads.
The brw_eu_emit.c code manually forces the header present bit when
used in align1 (scalar) mode.  So, this has no effect currently.

However, it is nice to have fs_inst::header_present reflect reality.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77221
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-05-01 00:24:04 -07:00
Kenneth Graunke
4d9c27df45 i965: Disassemble atomic operations and other DP:DC1 stuff on Broadwell.
This is similar to what Eric did for Gen7 a little while ago; it also
has support for untyped surface reads.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-05-01 00:24:02 -07:00
Kenneth Graunke
3b3c46656e i965: Implement the create_raw_surface() hook on Broadwell.
Otherwise we crash when setting up atomic buffer objects.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77221
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-05-01 00:23:59 -07:00
Kenneth Graunke
69fd055166 i965: Drop mark_surface_used from gen8 generators.
Francisco made brw_mark_surface_used a freestanding function in
commit a32817f3c2.  We should use it.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-05-01 00:23:57 -07:00
Kenneth Graunke
b10785f9a9 i965/fs: Add support for fs_inst::force_writemask_all on Broadwell.
This must not have existed when I wrote the original code.  The atomic
operation header setup code uses this.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-05-01 00:23:44 -07:00
Kenneth Graunke
ac30e1adb4 i965: Actually emit PIPELINE_SELECT and 3DSTATE_VF_STATISTICS.
For platforms using hardware contexts (currently Gen6+), we failed to
emit PIPELINE_SELECT and 3DSTATE_VF_STATISTICS, instead emitting MI_NOOP
for both.

During one of the context initialization reordering patches, we
accidentally moved brw_init_state before we set brw->CMD_PIPELINE_SELECT
and brw->CMD_VF_STATISTICS.  So, when brw_init_state uploaded initial
GPU state (brw_init_state -> brw_upload_initial_gpu_state ->
brw_upload_invariant_state), these would be 0 (MI_NOOP).

Storing the commands in the context is not worthwhile.  We have many
generation checks in our state upload code, and for platforms with
hardware contexts, this only gets called once per GL context anyway.
The cost is negligable, and it's easy to botch context creation
ordering.

This may fix hangs on Gen6+ when using the media pipeline.

Cc: "10.0 10.1" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
2014-05-01 00:12:22 -07:00
Kenneth Graunke
0380ec467d i965: Don't enable reset notification support on Gen4-5.
arekm reported that using Chrome with GPU acceleration enabled on GM45
triggered the hw_ctx != NULL assertion in brw_get_graphics_reset_status.

We definitely do not want to advertise reset notification support on
Gen4-5 systems, since it needs hardware contexts, and we never even
request a hardware context on those systems.

Cc: "10.1" <mesa-stable@lists.freedesktop.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=75723
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-30 23:08:22 -07:00
Carl Worth
4546b70e08 doc: Add pointer to the Mesa Stable Queue page.
Since this is now updated daily and looks to be useful.
2014-04-30 16:27:03 -07:00
Eric Anholt
862986ade3 i965: Fix state flag comments on color_buffer_write_enabled() calls.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-30 14:33:21 -07:00
Eric Anholt
e739558c9d i965: Drop bogus state flag comment.
This was introduced with the comment and code below it, though the code
only touches prog_data (CACHE_NEW_WM_PROG).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-30 14:33:21 -07:00
Eric Anholt
60c5f9716c i965: Track the number of samples in the drawbuffer.
This keeps us from having to emit the nonpipelined state packet on every
FBO binding.

-4.42003% +/- 1.09961% effect on cairo-perf-trace runtime on glamor (n=110).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-30 14:33:21 -07:00
Eric Anholt
973345fc23 mesa: Track maximum CurrentTexUnit to reduce glDeleteTextures() overhead.
No more walking 96*6 pointers looking to see if they're the current
texture, when we only use the first 2 out of 96 units.  -6.26002% +/-
1.87817% effect on cairo runtime on no-fbo-cache glamor (n=36).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-30 14:33:21 -07:00
Eric Anholt
6a97deb88a mesa: Rewrite shader-based texture image state updates.
Instead of walking 6 shader stages for each of the 96 combined texture
image units, now we just walk the samplers used in each shader stage.

With cairo-perf-trace on Xephyr with glamor, I'm seeing a -6.50518% +/-
2.55601% effect on runtime (n=22) since the "drop _EnabledUnits" change.
No significant performance difference on an apitrace of minecraft (n=442).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-30 14:33:20 -07:00
Eric Anholt
a580b500ed mesa: Split the shader texture update logic from fixed function.
I want to avoid walking the entire long array texture image units, but the
obvious way to do so means walking program samplers, and thus hitting the
units in a random order.

This change replaces the previous behavior of only setting up the fallback
texture for a fragment shader with setting up the fallback texture for any
shader that's missing a complete texture of the right target in its unit.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-30 14:33:20 -07:00
Eric Anholt
e5e50fae6a mesa: Finish removing the _ReallyEnabled field.
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-30 14:33:20 -07:00
Eric Anholt
741f5d58e6 radeon: Drop the remaining driver usage of _ReallyEnabled.
This is kind of ugly, but I think it's worth it to finish off the last
consumers of _ReallyEnabled.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-30 14:33:20 -07:00
Eric Anholt
2f8749af20 swrast: Drop remaining use of _ReallyEnabled.
The _MaxEnabledTexImageUnit check assures us that Unit[0].Current != NULL.
This is the last consumer of _ReallyEnabled outside of the radeons.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-30 14:33:20 -07:00
Eric Anholt
8061f90a64 gallium: Drop use of _ReallyEnabled.
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-30 14:33:20 -07:00
Eric Anholt
cef82a64bd mesa: Drop _ReallyEnabled usage from ff_fragment_shader.
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-30 14:33:20 -07:00
Eric Anholt
07b94c99a7 i915: Drop use of _ReallyEnabled.
We can just look at _Current's target.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-30 14:33:20 -07:00
Eric Anholt
ff9c3e8e5a mesa: Replace use of _ReallyEnabled as a boolean with use of _Current.
I'm probably not the only person that has tried to kill _ReallyEnabled.
This does the mechanical part of the work, and cleans _ReallyEnabled from
i965.

I think that using _Current makes texture management clearer: You can't
have multiple targets in use in the same texture image unit at the same
time, because there's just that one pointer.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-30 14:33:20 -07:00
Eric Anholt
62d46332d8 mesa: Ensure that (unit->_Current != 0) == (unit->_ReallyEnabled != 0).
I'm going to try to delete _ReallyEnabled, which is this weird bitfield
with either 0 or 1 bits set with just the reference to _Current.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-30 14:33:20 -07:00
Eric Anholt
6bac47c05a mesa: Drop dead last_ReallyEnabled fields from drivers.
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-30 14:33:20 -07:00
Eric Anholt
c703658b39 mesa: Drop _EnabledUnits.
The field wasn't really valid, since we've got more than 32 units now.  It
turns out it was mostly just used for checking != 0, or checking for fixed
function coordinates, though.

v2: Fix mis-conversion in xm_line.c (caught by Ken).

Reviewed-by: Matt Turner <mattst88@gmail.com> (v1)
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-30 14:33:17 -07:00
Eric Anholt
3dfe56c53b swrast: Just use _EnabledCoordUnits for figuring out which texcoords to build.
_EnabledUnits is all of the first 32 image units that are used by fixed
function or programs, while _EnabledCoordUnits is just which fixed function
fragment shader texcoords need to be generated.  This is a theoretical bugfix
in the case of a vertex shader texturing from large texture image unit number
(we'd end up flagging something other than a VARYING_SLOT_TEXn as needing to
be generated), but it's actually just motivated by trying to kill
_EnabledUnits.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-30 14:21:59 -07:00
Eric Anholt
1ad443ecdd i915: Redo texture unit walking on i830.
We now know what the max unit is in the context state.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-30 14:21:59 -07:00
Matt Turner
9565392031 i965/vec4: Remove 'mul_arg' from try_emit_mad().
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-30 11:41:29 -07:00
Matt Turner
1e50bc9ee1 i965/fs: Remove 'mul_arg' from try_emit_mad().
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-30 11:41:29 -07:00
Brian Paul
475f5ff64d mesa: change invalid texture swizzle error to GL_INVALID_ENUM
The original GL_EXT_texture_swizzle extensions said GL_INVALID_OPERATION
was to be generated when the an invalid swizzle was passed to
glTexParameter().  But in OpenGL 3.3 and later, the error should be
GL_INVALID_ENUM.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-04-30 10:09:44 -06:00
Andreas Hartmetz
1c6aa6599e translate_sse: Use the correct buffer index in this fast path.
It is possible that there are multiple input buffers but only one is
relevant for translation. Then there will be only a single translation
group, which might need to source data from a buffer index != 0.

Fixes wrong vertex shader inputs as observed while debugging with an
application and driver combination that requires translation of a
vertex attribute in a non-trivial set of attributes and input buffers.

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-04-29 20:35:10 -04:00
Tom Stellard
ca848e8bee clover: Query drivers for max clock frequency
Igor Gnatenko:

v2: PIPE_COMPUTE_CAP_MAX_CLOCK_FREQUENCY instead of
    PIPE_COMPUTE_MAX_CLOCK_FREQUENCY

Bruno Jiménez:

  v3: Drivers report clock in Mhz

Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2014-04-29 15:28:17 -07:00
Tom Stellard
0a41054b7f radeon/compute: Implement PIPE_COMPUTE_CAP_MAX_CLOCK_FREQUENCY
Igor Gnatenko:
  v2: in define RADEON_INFO_MAX_SCLK use 0x1a instead of 0x19 (upstream changes)

Bruno Jiménez:
  v3: Convert the frequency to MHz from kHz after getting it in
  'do_winsys_init'

Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-04-29 15:25:50 -07:00
Tom Stellard
5fe1a0ebad gallium: Add PIPE_COMPUTE_CAP_MAX_CLOCK_FREQUENCY
Bruno Jiménez:
  v2: Updated the docs
  v3: Remove trailing comma

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2014-04-29 15:24:53 -07:00
Kenneth Graunke
979a015bc1 i965: Fix a few base addresses on Broadwell.
We intended to set these 64-bit addresses to 0, and set the enable bit.
But, I accidentally placed the DWord with the high bits first, when it
should have been second.

This generally worked out, by luck - presumably General State Base
Address is initially zero, and ends up remaining that way in our
contexts since we bungled the "modify enable" bit.

v2: Fix MOCS shift on GSBA.  It should be 4, and I had 2.
    (Caught by Ben Widawsky.)

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
2014-04-29 14:01:06 -07:00
EdB
7fb05f9298 clover: Stub implementation of CL 1.2 sub-devices.
The implementation is basically a NOP but it conforms with OpenCL 1.2.

[ Francisco Jerez: Initialize property return buffer for
  CL_DEVICE_PARTITION_PROPERTIES, CL_DEVICE_PARTITION_TYPE,
  CL_DEVICE_PARTITION_AFFINITY_DOMAIN, and make the latter a scalar
  rather than a vector.  Some clean-up and code style fixes. ]

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2014-04-29 16:14:50 +02:00
EdB
5827781d25 clover: Add clEnqueue{Marker, Barrier}WithWaitList.
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2014-04-29 13:12:38 +02:00
Jan Vesely
7b11c97d31 clover: Align kernel argument sizes to nearest power of 2
v2: use a new variable for aligned size
    add comment
    make both vars const
    only use the aligned value in argument constructors
    fix comment typo

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2014-04-29 13:09:21 +02:00
Francisco Jerez
df985cc8f6 clover: Avoid warnings from references to deprecated CL 1.1 APIs.
Acked-by: Tom Stellard <thomas.stellard@amd.com>
2014-04-29 13:01:37 +02:00
Francisco Jerez
beadd6b0cc clover: Update OpenCL headers to version 1.2 from Khronos.
The C++ headers are *not* updated because they rely on CL 1.2 APIs
that we do not implement yet when the core CL 1.2 headers are present.

Acked-by: Tom Stellard <thomas.stellard@amd.com>
2014-04-29 13:01:10 +02:00
Ilia Mirkin
f782d6e792 nvc0/ir: offset appears to come before the Z ref
Fixes textureGatherOffset when used with a shadow sampler. Also verified
against blob compiler with textureLodOffset manually (no piglit tests
for texture[Lod]Offset + shadow samplers).

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-04-28 20:32:36 -04:00
Brian Paul
50034c0171 mesa: remove unused #pragma export on/off lines
PRAGMA_EXPORT_SUPPORTED is never defined.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77749
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-04-28 17:16:42 -06:00
Ilia Mirkin
f3aa999383 nv50/ir: change texture offsets to ValueRefs, allow nonconst
This allows us to have non-constant offsets for textureGatherOffset and
textureGatherOffsets.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-04-28 19:09:18 -04:00
Ilia Mirkin
46364a53ef nvc0/ir: do constant folding of extbf/insbf
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-04-28 19:05:16 -04:00
Ilia Mirkin
1c85177419 nvc0/ir: add support for MUL_HI tgsi opcodes
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-04-28 19:05:16 -04:00
Ilia Mirkin
b4b20d42f6 nvc0/ir: add support for new bitfield manipulation opcodes
This adds support for:

IBFE, UBFE, BFI, LSB, IMSB, UMSB, BREV, POPC

Which are all required for ARB_gs5 support.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-04-28 19:05:16 -04:00
Ilia Mirkin
1db993f2fe tgsi: add tgsi_exec support for new bit manipulation opcodes
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-04-28 19:05:11 -04:00
Ilia Mirkin
ab4927f3e0 gallium/util: add helpers for bitfield manipulation
Add bitwise reversing and signed MSB helpers for software implementation
of the new TGSI opcodes.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-04-28 19:05:07 -04:00
Ilia Mirkin
3e73bf2724 mesa/st: implement new bit manipulation opcodes
Also pipe through [IU]MUL_HI, MAD, and lower ldexp. This provides
coverage of all new ARB_gpu_shader5 functions except uaddCarry,
usubBorrow and interpolateAt*.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-04-28 19:05:04 -04:00
Ilia Mirkin
a52eaba787 gallium: add new opcodes for ARB_gs5 bit manipulation support
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-04-28 19:04:46 -04:00
Emil Velikov
b125c92aa9 glx/drisw: explicitly assign struct components for glx_*_vtable
... to improve readability of code.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-04-28 19:13:39 +01:00
Emil Velikov
a2454bdfbd glx/dri3: explicitly assign struct components for glx_*_vtable
... to improve readability of code.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-04-28 19:13:39 +01:00
Emil Velikov
55d82adec6 glx/dri2: explicitly assign struct components for glx_*_vtable
... to improve readability of code.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-04-28 19:13:38 +01:00
Emil Velikov
76ae25d7e8 glx/dri: explicitly assign struct components for glx_*_vtable
... to improve readability of code.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-04-28 19:13:38 +01:00
Emil Velikov
2f519e4635 glx/indirect: explicitly assign struct components for glx_*_vtable
... to improve readability of code. Set indirect_screen_vtable as a static const.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-04-28 19:13:38 +01:00
Emil Velikov
31a3b58cb7 glx/apple: explicitly assign struct components for glx_*_vtable
... to improve readability of code. Set applegl_screen_vtable as a static const.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-04-28 19:13:38 +01:00
Emil Velikov
5f280d0c44 egl_dri: rework dri extension handling
Use designated initialisers, and store the extensions pointers as const.

The loader extensions __DRIdri2LoaderExtension and __DRIswrastLoaderExtension
are setup by the platform backends so they should not be constified.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-04-28 19:13:38 +01:00
Emil Velikov
5457caa58c gbm: cleanup __DRI*extension handling
Use designated initialisers, store all extension pointers as const and use
a const __DRIextensions array over assigning each element individually.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-04-28 19:13:38 +01:00
Emil Velikov
c812557a0e dri_util: cleanup dri extension handling
Explicitly set the version that is implemented, as that may differ from
the one defined in dri_interface.h. The remaining __DRI*Extensions are
treated as constants, so got ahead and declare them as such.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-04-28 19:13:38 +01:00
Emil Velikov
51e3569573 glx/tests: explicitly set __DRI2rendererQueryExtension members
While we're here use the typcast'ed name and constify.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-04-28 19:13:38 +01:00
Emil Velikov
ecfe986120 glx/dri3: rework __DRIextension handling
Use a const array with the extensions, rather than assigning each
one to a fixed size array at runtime.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-04-28 19:13:37 +01:00
Emil Velikov
4be3874c97 glx/dri2: rework __DRIextension handling
Make sure that the DRI*Extensions report the version of the interface
implemented over the listed in the headers. While both are currently
the same, this may change in the future.

v2: Keep loader extensions handling as is.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> (v1)
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-04-28 19:13:18 +01:00
Emil Velikov
98e2a8e2f9 st/dri: cleanup dri extension handling
Explicitly set the version that is implemented, as that may differ
from the one defined in dri_interface.h. Use designated initialisers
and constify whereever possible.

Note: __DRIimageExtension should not be made const as it's modified
at runtime. This patch should have no side effects on compilers that
do not support designated initialisers, as the existing code in
dri/common already uses them.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-04-28 19:11:28 +01:00
Emil Velikov
748b35a69f dri/radeon: use a const __DRIextension array
Rather than keeping a separate and unused copy of the screen extensions
within the radeon screen, use a constant array that can be used directly
with __DRIscreen.

[Kristian Høgsberg]
The copy in the radeon screen isn't unused, that's where the array is
built and stored, the dri screen just points to that.  The pattern
here was used for cases where the extensions exported by a dri driver
could vary at runtime, for example depending on chipset.  In this
case, it's known at compile time, so it makes sense to use a static
const array instead.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-04-28 19:11:27 +01:00
Emil Velikov
38f20f79da drivers/dri: cleanup dri extension instantiation
Uniformly use the typecasted extension name, constify extension instances
and use designated initialisers. Set the implemented version of the
extension, over the one defined in dri_infertace.h. Patch covers the
following extensions:

__DRItexBufferExtension
__DRIimageExtension
__DRIrobustnessExtension
__DRI2rendererQueryExtension
__DRIdri2LoaderExtension

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-04-28 19:11:27 +01:00
Emil Velikov
9b42fd1772 dri_interface: Update __DRItexBufferExtensionRec to version 3
With commit e59fa4c46c8("dri2: release texture image.") we updated the
extension without bumping the version number. The patch itself added an
interface required to enable texture_from_pixmap on certain platforms.

The new code was effectively never build, as it depended on
__DRI_TEX_BUFFER_VERSION >= 3, which never came to be in upstream mesa.

This commit bumps the version number, drops the __DRI_TEX_BUFFER_VERSION
checks and resolves all the build conflicts. Additionally it add a version
check as egl and dri3, as require version 2 of the extension which does
not have the releaseTexBuffer hook.

Cc: Juan Zhao <juan.j.zhao@intel.com>
Cc: Kristian Høgsberg <krh@bitplanet.net>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-04-28 19:11:27 +01:00
Jon TURNEY
ec8ebff342 Check for dladdr(), rather than assuming we have it if we have RTLD_DEFAULT
Unfortunately, Cygwin defines RTLD_DEFAULT (for glibc compatibility), but can't
provide dladdr(), so add a check for dladdr()

Since I don't think scons is ever used to build for Cygwin, just set HAVE_DLADDR
in SConscript, assuming that if we have RTLD_DEFAULT, we have dladdr().

Cc: Jonathan Gray <jsg@jsg.id.au>
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-04-28 19:11:02 +01:00
Richard Sandiford
6c8f547f66 util: Fix cross-compiles between endiannesses
The old python code used sys.is_big_endian to select between little-endian
and big-endian formats, which meant that the build and host endiannesses
needed to be the same.  This patch instead generates both big- and little-
endian layouts, using PIPE_ARCH_BIG_ENDIAN to select between them.

Signed-off-by: Richard Sandiford <rsandifo@linux.vnet.ibm.com>
Signed-off-by: José Fonseca <jfonseca@vmware.com>
2014-04-28 13:16:27 +01:00
Richard Sandiford
6944796cbe util: Split out channel-parsing Python code
Splits out the code that parses the channel list, so that we
can have different lists for little and big endian.

There is no change to the generated u_format_table.c.

Signed-off-by: Richard Sandiford <rsandifo@linux.vnet.ibm.com>
Signed-off-by: José Fonseca <jfonseca@vmware.com>
2014-04-28 13:16:25 +01:00
Richard Sandiford
1a3746212d util: Split out channel-printing Python code
Rather than iterate over format.channels and format.swizzles directly,
use Python subfunctions that take the channel and swizzle lists as
arguments.  This allow the channel and swizzle lists to depend on
endianness.

There is no change to the generated u_format_table.c.

Signed-off-by: Richard Sandiford <rsandifo@linux.vnet.ibm.com>
Signed-off-by: José Fonseca <jfonseca@vmware.com>
2014-04-28 13:16:24 +01:00
Richard Sandiford
0ee3ac938a util: Turn inv_swizzle into a global function
With the big-endian changes, there can be two swizzle orders for each format.
This patch turns Format.inv_swizzle() into a global function that takes the
swizzle list as a parameter.

There is no change to the generated u_format_table.c.

Signed-off-by: Richard Sandiford <rsandifo@linux.vnet.ibm.com>
Signed-off-by: José Fonseca <jfonseca@vmware.com>
2014-04-28 13:16:22 +01:00
Richard Sandiford
227d7a6a3c util: Add more query methods to u_format_parse.Format
The main aim is to reduce the number of places that access channels[0],
swizzles[0] and swizzles[1] directly.

There is no change to the generated u_format_table.c.

Signed-off-by: Richard Sandiford <rsandifo@linux.vnet.ibm.com>
Signed-off-by: José Fonseca <jfonseca@vmware.com>
2014-04-28 13:16:20 +01:00
Michel Dänzer
136c437cea st/mesa: Fix NULL pointer dereference for incomplete framebuffers
This can happen with glamor, which uses EGL_KHR_surfaceless_context and
only explicitly binds GL_READ_FRAMEBUFFER for glReadPixels.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-04-28 12:12:03 +09:00
Chris Forbes
151a20dcd4 glsl: fix spelling of derived
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
2014-04-27 21:37:23 +12:00
Ilia Mirkin
e88644c1f2 docs: mark off nv50/nvc0 for ARB_sample_shading, update relnotes
relnotes weren't updated this whole time, so I went through all the
GL3.txt changes and picked out the nouveau ones since 10.1.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-04-27 00:16:29 -04:00
Chia-I Wu
7b2dd89041 mesa: overhaul debug namespace support
_mesa_HashTable is not well-suited for us: it locks a mutex unnecessarily and
it does not accept 0 as the key (and have branches to handle 1 specially).
What we really need is a sparse array.  Whether it should be implemented as a
hash table, a list, or a bsearch()-able array requires investigations of the
use models.

We choose to implement it as a list for now, assuming it is common to have a
short list of IDs in each (source, type) namespace.  The code is simpler, and
the memory footprint is lower.  This also fixes several corner cases such as
making messages to have different states at different severities.

v2: use GLbitfield for State/DefaultState, and add a comment

Signed-off-by: Chia-I Wu <olv@lunarg.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-04-27 10:06:21 +08:00
Chia-I Wu
70e4337014 mesa: delay copying of debug groups
Do not copy the debug group until it is about to be written.  One likely
scenario of using glPushDebugGroup/glPopDebugGroup is to enclose a sequence of
GL commands and give them a human-readable description.  There is no message
control change in this scenario, and thus no need to copy.

This also reduces the initial size of gl_debug_state from 306KB to 7KB.

Signed-off-by: Chia-I Wu <olv@lunarg.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-04-27 10:06:21 +08:00
Chia-I Wu
a30c4c6ca0 mesa: clean up debug output namespace handling
Add functions to provide these operations on a struct gl_debug_namespace:

  init():    initialize the namespace
  copy():    copy all elements from one namespace to another
  clear():   clear all elements (to free the memories)
  set():     set the value of an element
  set_all(): set the value of all elements
  get():     get the value of an element

A debug namespace is like a sparse array.  The length of the array is huge,
2^sizeof(GLuint), but most of the elements assume the same value sepcified by
set_all().

Signed-off-by: Chia-I Wu <olv@lunarg.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-04-27 10:06:21 +08:00
Chia-I Wu
44a1374793 mesa: clean up debug groups
Add struct gl_debug_group to hold all namespaces of a debug group.  Replace
the 3-dimensional array, Namespaces, in struct gl_debug_state by a
1-dimensional array of type struct gl_debug_groups.

Turn the 4-dimensional array, Defaults, in struct gl_debug_state to a
1-dimensional array in struct gl_debug_namespace.

Signed-off-by: Chia-I Wu <olv@lunarg.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-04-27 10:06:21 +08:00
Chia-I Wu
e412305f9f mesa: clean up debug message log
Remove NextMsgLength, and move members of struct gl_debug_state that belong to
the message log to a new struct, gl_debug_log.  Rename gl_debug_msg to
gl_debug_message.

Signed-off-by: Chia-I Wu <olv@lunarg.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-04-27 10:06:21 +08:00
Chia-I Wu
cf61ea3029 mesa: use accessors for struct gl_debug_state
When GL_DEBUG_OUTPUT_SYNCHRONOUS is GL_TRUE, drivers are allowed to log debug
messages from other threads.  That requires gl_debug_state to be protected by
a mutex, even when it is a context state.  While we do not spawn threads in
Mesa yet, this commit makes it easier to do when we want to.

Since the definition of struct gl_debug_state is no longer needed by the rest
of the driver, move it to main/errors.c.  This should make it even harder to
use the struct incorrectly.

v2: add comments for the accessors

Signed-off-by: Chia-I Wu <olv@lunarg.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-04-27 10:06:20 +08:00
Chia-I Wu
94e45c98e1 mesa: eliminate debug output message_insert
Add validate_length, and call it together with log_msg directly instead of
message_insert.  No functional change.

v2: make sure length is non-negative (i.e., known) before calling
    validate_length, noted by Timothy Arceri

Signed-off-by: Chia-I Wu <olv@lunarg.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-04-27 10:06:20 +08:00
Chia-I Wu
188d22d9b7 mesa: eliminate debug output should_log
In both call sites, it could be easily replaced by direct
debug_is_message_enabled calls.  No functional change.

Signed-off-by: Chia-I Wu <olv@lunarg.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-04-27 10:06:20 +08:00
Chia-I Wu
c9dfb6b76c mesa: eliminate debug output control_app_messages
Merge control_app_messages with the only caller.  Eliminate set_message_state
and control_messages too as they are unused.  No functional change.

Signed-off-by: Chia-I Wu <olv@lunarg.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-04-27 10:06:20 +08:00
Chia-I Wu
274913c42c mesa: eliminate debug output get_msg
Merge get_msg with the only caller.  No functional change.

Signed-off-by: Chia-I Wu <olv@lunarg.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-04-27 10:06:20 +08:00
Chia-I Wu
04a8baad37 mesa: refactor _mesa_PopDebugGroup and _mesa_free_errors_data
Replace free_errors_data by debug_clear_group.  Add debug_pop_group and
debug_destroy for use in _mesa_PopDebugGroup and _mesa_free_errors_data
respectively.  No funcitonal change.

Signed-off-by: Chia-I Wu <olv@lunarg.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-04-27 10:06:20 +08:00
Chia-I Wu
f1d00dce43 mesa: refactor _mesa_PushDebugGroup
Move group copying to debug_push_group.  Save the group message before pushing
instead of after, since we will need it after popping.  No functional change
otherwise.

Signed-off-by: Chia-I Wu <olv@lunarg.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-04-27 10:06:20 +08:00
Chia-I Wu
de0e0ae4b6 mesa: refactor debug output control_messages
Move most of the code to debug_set_message_enable_all.  No functional change.

Signed-off-by: Chia-I Wu <olv@lunarg.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-04-27 10:06:20 +08:00
Chia-I Wu
7e9451dc46 mesa: refactor debug output get_msg
Move message fetching to debug_fetch_message and message deletion to
debug_delete_messages.  No functional change.

Signed-off-by: Chia-I Wu <olv@lunarg.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-04-27 10:06:20 +08:00
Chia-I Wu
e9d1b5c8af mesa: refactor debug out log_msg
Move message logging to debug_log_message.  Replace store_message_details by
debug_message_store.  No functional change.

Signed-off-by: Chia-I Wu <olv@lunarg.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-04-27 10:06:20 +08:00
Chia-I Wu
880183fee8 mesa: refactor debug output set_message_state
Move message state update to debug_set_message_enable.  No functional change.

Signed-off-by: Chia-I Wu <olv@lunarg.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-04-27 10:06:20 +08:00
Chia-I Wu
7554d27de4 mesa: refactor debug output should_log
Move the message filtering logic to debug_is_message_enabled.  No functional
change.

Signed-off-by: Chia-I Wu <olv@lunarg.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-04-27 10:06:20 +08:00
Chia-I Wu
672b209225 mesa: refactor _mesa_get_debug_state
Move gl_debug_state allocation to a new function, debug_create.  No functional
change.

Signed-off-by: Chia-I Wu <olv@lunarg.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-04-27 10:06:20 +08:00
Ilia Mirkin
9339f8ac1b nvc0/ir: fetch shadow value from proper place for TG4 cube array
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-04-26 12:01:13 -04:00
Ilia Mirkin
b86d78b4c1 nvc0/ir: set gatherComp for non-shadow targets
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-04-26 12:01:13 -04:00
Ilia Mirkin
24e68c9024 nvc0/ir: set instance count based on the GS_INVOCATIONS property
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-04-26 12:01:13 -04:00
Ilia Mirkin
802fe8d9af nvc0/ir: add support for INVOCATIONID system value
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-04-26 12:01:13 -04:00
Ilia Mirkin
b3a2398ade nvc0/ir: add support for SAMPLEMASK sysval
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-04-26 11:57:18 -04:00
Ilia Mirkin
c3d2bda53e mesa/st: translate gl_InvocationID to INVOCATIONID semantic
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-04-26 11:57:15 -04:00
Ilia Mirkin
389379e81d mesa/st: translate gl_SampleMaskIn to SAMPLEMASK semantic
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-04-26 11:57:12 -04:00
Ilia Mirkin
4be146b108 gallium: add GS_INVOCATIONS property
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-04-26 11:57:09 -04:00
Ilia Mirkin
76db20fc67 gallium: add INVOCATIONID semantic
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-04-26 11:56:39 -04:00
Ilia Mirkin
af38ef907c nvc0: add support for PIPE_CAP_SAMPLE_SHADING
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-04-26 11:53:34 -04:00
Ilia Mirkin
f715a0a39a nv50: add support for PIPE_CAP_SAMPLE_SHADING
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-04-26 11:53:24 -04:00
Ilia Mirkin
c5d822dad9 mesa/st: add support for ARB_sample_shading
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-04-26 11:52:52 -04:00
Ilia Mirkin
88d8d88d8c gallium: add basic support for ARB_sample_shading
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-04-26 11:52:01 -04:00
Enrico Horn
3a2885fb26 mapi: OpenVG symbol exports.
Fixes another mistake in 144bbb7b78.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77502
2014-04-25 19:34:38 -07:00
Matt Turner
18993f7892 glsl: Use properly typed arguments for bitfieldInsert.
bitfieldInsert takes scalar integers for its last two arguments. Since
bitfieldInsert is lowered on i965 to two instructions that have more
flexible arguments, I didn't notice when I wrote this.

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-04-25 19:24:39 -07:00
Eric Anholt
07730e9463 i965: Don't bother flushing the batch if it doesn't ref our mt to map.
-1.1372% +/- 0.858033% effect on cairo runtime on glamor (n=175).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-25 18:19:55 -07:00
Ander Conselvan de Oliveira
17860309f1 egl: Protect use of gbm_dri with ifdef HAVE_DRM_PLATFORM
Otherwise it fails to compile if the drm egl platform is disabled.

Cc: "10.0" "10.1" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-04-25 21:17:54 +01:00
Neil Roberts
63d4661ab2 wayland: Fix the logic in disabling the prime capability
It looks like this bit of code is trying to disable the prime capability if
the driver doesn't support createImageFromFds. However the logic looks a bit
broken and what it would actually do is disable all other capabilities apart
from prime. This patch fixes it to actually disable prime.

Cc: "10.0" "10.1" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-04-25 21:17:05 +01:00
Ander Conselvan de Oliveira
49964fa28b gbm: Set errno on errors
This should give the caller some information of what called the error.
For the gbm_bo_import() case, for instance, it is possible to know if
the import is not supported or the error was caused by an invalid
parameter.

Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-04-25 21:16:45 +01:00
Ander Conselvan de Oliveira
aa91fe1c09 gbm/dri: Fix out-of-memory error path in dri_device_create()
Cc: "10.0" "10.1" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-04-25 21:16:00 +01:00
Emil Velikov
c0953cf06e gallium/tests: conditionally include sw/dri winsys
In all fairness we allow the gallium tests to be build with --disable-dri
which will result in the approapriate winsys to not be build, thus the
build will fail.

  ./configure --disable-dri --with-gallium-drivers=svga --enable-gallium-tests

Cc: Brian Paul <brianp@vmware.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-04-25 21:09:26 +01:00
Emil Velikov
6c44d43bae automake: cleanup pipe-loader handling when using sw/xlib winsys
Rather than defining our own set of variables, use NEED_WINSYS_XLIB
and based on it include the sw/xlib winsys.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-04-25 21:09:17 +01:00
Emil Velikov
5c6a1445d5 pipe-loader: conditionally build and use pipe_loader_sw_probe_dri
The function relies on the sw/dri winsys which is build only when --enable-dri
is set. Fixes build issues with the following config

 ./configure --disable-dri --with-gallium-drivers=svga --enable-xa

Issue can be reproduced with any hw gallium driver + st that uses the pipe-loader.

Cc: Brian Paul <brianp@vmware.com>
Reported-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-04-25 21:09:09 +01:00
Roland Scheidegger
a7a03d84fc llvmpipe: fix clearing of individual color buffers in a fb
GL (3.0) allows you to clear individual color buffers in a fb. In fact
for fbs containing both int and float/normalized color buffers this is
required (because the clearing values are otherwise undefined if applied
to all buffers). The gallium interface was changed a while ago, but llvmpipe
ignored it (hence doing such individual clears always resulted in clearing
all buffers, plus some assorted asserts due to the mixed fbs).
So change the clear command to indicate the buffer to be cleared. Also, because
indicating the buffer to be cleared would have made lp_rast_arg_cmd larger
which is unacceptable (we're trying to shrink it some day) allocate the clear
value in the scene and just pass a pointer.
There's several advantages and disadvantages here:
+ clearing individual buffers works (we could also actually bin such clears now
if they'd come through clear_render_target() if the surface is in the current
fb, though we didn't do this before for the single rb case and still don't try).
+ since there's one clear per rb, we do the format conversion in setup rather
than per bin. Aside from the (drop in the ocean...) performance advantage this
means that clearing to very small values (that is, denormal when converted to
the format) should work for small float (fp16 etc.) formats, as the util code
couldn't handle it correctly before (because cpu denorms are disabled when
executing the bin commands, screwing up the magic conversion and flushing
the values to 0, though this was not verified).
- there's some overhead for traditional old-style clear-all MRT cases, since
there's one rast clear command per rb instead of one for all rbs.

This fixes https://bugs.freedesktop.org/show_bug.cgi?id=76976.

v2: get rid of the ugly manual memcpy stuff and just use union util_color.
This is 32 bytes instead of 16 but as the allocation is per scene we can live
with those additional 16 bytes (and the additional 128 bytes in the setup
context), which makes the code much more obvious. Suggested by Brian.

Reviewed-by: Brian Paul <brianp@vmware.com>
2014-04-25 19:29:30 +02:00
Roland Scheidegger
fa4082320a gallium/util: use ui[4] instead of ui in union util_color
util_color often merely represents a collection of bytes, however it is
inconvenient if those bytes can only be accessed as floats/doubles for int
formats exceeding 32bits.
(Note that since rgba8 formats use one uint, not 4 bytes, hence the byte and
short member were left as is.)
2014-04-25 19:29:30 +02:00
Roland Scheidegger
2f65f61bea llvmpipe: (trivial) use correct LP_MIN_VECTOR_ALIGN define for alignment.
Currently it's the same value.

Reviewed-by: Brian Paul <brianp@vmware.com>
2014-04-25 19:29:30 +02:00
Marek Olšák
3a3b1bf60e r600g: fix hang on RV740 by using DX_RASTERIZATION_KILL instead of SX_MISC
Changing SX_MISC hangs RV740. When we're at it, let's use DX_RASTERIZATION_KILL
on all R700 and later chipsets.

Cc: 10.0 10.1 mesa-stable@lists.freedesktop.org
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2014-04-25 01:33:13 +02:00
Marek Olšák
3d0c4f3b01 r600g: fix for an MSAA hang on RV770
Cc: 10.0 10.1 mesa-stable@lists.freedesktop.org
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2014-04-25 01:33:12 +02:00
Marek Olšák
ecc8a37ec5 r600g: fix for broken CULL_FRONT behavior on R6xx
Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2014-04-25 01:33:12 +02:00
Marek Olšák
ef162cf13d r600g: fix for HTILE on R6xx
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2014-04-25 01:33:12 +02:00
Marek Olšák
0967970768 r600g: fix buffer copying on R600-R700
This fixes broken rendering in DOTA 2.

Cc: 10.0 10.1 mesa-stable@lists.freedesktop.org
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2014-04-25 01:33:12 +02:00
Marek Olšák
042e40f67b r600g: fix flushing on RV670, RS780, RS880 again
Cc: 10.0 10.1 mesa-stable@lists.freedesktop.org
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2014-04-25 01:33:12 +02:00
Marek Olšák
20a9b784da r600g: fix MSAA resolve on R6xx when the destination is 1D-tiled
Cc: 10.0 10.1 mesa-stable@lists.freedesktop.org
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2014-04-25 01:33:12 +02:00
Marek Olšák
6dd045ef40 r600g: disable async DMA on R700
Cc: 10.0 10.1 mesa-stable@lists.freedesktop.org
2014-04-25 01:33:12 +02:00
Marek Olšák
e5741f1e91 r600g: fix edge flags and layered rendering on R600-R700
We forgot to set these bits.

Cc: 10.1 mesa-stable@lists.freedesktop.org
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2014-04-25 01:33:12 +02:00
Marek Olšák
8a1dfba73e st/mesa: remove trailing NULL colorbuffers
Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-04-25 01:33:12 +02:00
Marek Olšák
e522c455e4 r300g: don't crash when getting NULL colorbuffers
Cc: mesa-stable@lists.freedesktop.org
2014-04-25 01:33:12 +02:00
Marek Olšák
ba4f6a5fc9 r300g: fix runtime warning after winsys cleanup
Broken by:
  b2238b3452
  winsys/radeon: remove cs_write_reloc, add simpler cs_get_reloc
2014-04-25 01:33:12 +02:00
Marek Olšák
7920adb45c radeonsi: implement GL_ARB_vertex_type_10f_11f_11f_rev
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-04-25 01:33:12 +02:00
José Fonseca
f438a82492 st/xlib: Do minimal version checking in glXCreateContextAttribsARB.
The current version checking is wrongly refusing to create 3.3 contexts;
unsupported version are checked elsewhere; and the DRI path doesn't do
this sort of checking neither.

This enables piglit glsl 3.30 tests to run without skipping.

Reviewed-by: Brian Paul <brianp@vmware.com>
2014-04-24 20:26:23 +01:00
José Fonseca
7380ce9bf6 llvmpipe: Advertise GLSL 3.30.
According to Roland all TGSI support is there in theory.

In practice there are a few piglit failures and crashes, as this hadn't
been tested before.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-04-24 20:26:23 +01:00
José Fonseca
5f493eed69 st/xlib: Honour request of 3.1 contexts through core profile where available.
The GLX_ARB_create_context_profile spec says:

    "If version 3.1 is requested, the context returned may implement
    any of the following versions:

      * Version 3.1. The GL_ARB_compatibility extension may or may not
        be implemented, as determined by the implementation.

      * The core profile of version 3.2 or greater."

Mesa does not support GL_ARB_compatibility, and there are no plans to
ever support it, therefore the only chance to honour a 3.1 context is
through core profile, i.e, the 2nd alternative from the spec.

This change does that.  And with it piglit tests that require 3.1
contexts no longer skip.

Assuming there is no objection with this change, src/glx/dri_common.c
and src/gallium/state_trackers/wgl/stw_context.c should also be updated
accordingly, given they have the same logic.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-04-24 20:26:23 +01:00
Zack Rusin
1c73e919a4 draw/llvm: reduce memory usage
Lets make draw_get_option_use_llvm function available unconditionally
and use it to avoid useless allocations when LLVM paths are active.
TGSI machine is never used when we're using LLVM.

Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2014-04-24 13:59:24 -04:00
Brian Paul
552a8e44a9 docs: fix typo in 10.1.1 release notes URL 2014-04-24 08:37:23 -06:00
Brian Paul
0a92c88a51 swrast: move texture_slices() calls out of loops
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2014-04-24 08:16:01 -06:00
Brian Paul
1a7fa8b2eb swrast: move null pointer check earlier in _swrast_map_teximage()
There's no reason to compute texel size, stride, etc. if there's no
image data to map.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2014-04-24 08:16:01 -06:00
Brian Paul
5e81e6e268 swrast: remove _mesa_ prefix from static function
And add a const qualifier.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2014-04-24 08:16:01 -06:00
Brian Paul
7cc2e2e99d swrast: allocate swrast_texture_image::ImageSlices array if needed
Fixes a segmentation fault in conform divzero.c test.
This happens when glTexImage(level, width=0, height=0) is called.  We
don't allocate texture memory in that case so the ImageSlices array
was never allocated.

Cc: "10.1" <mesa-stable@lists.freedesktop.org>

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2014-04-24 08:16:01 -06:00
nick
15c92464df swrast: Fix vertex color in _swsetup_Translate()
Straightforward fix to properly load dest->color with color data, as
opposed to position data as previously implemented.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=27499
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-04-24 08:16:00 -06:00
José Fonseca
1527a545a4 gallivm: Fix wrong operator in lp_exec_default.
Courtesy of MSVC static code analyser.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-04-24 14:49:53 +01:00
José Fonseca
878877d3c4 mesa/st: Handle empty frame-buffers without asserting.
Fixes assertion failures with radeonsi.

Tested-by: Marek Olšák <maraeo@gmail.com>
2014-04-24 14:48:37 +01:00
José Fonseca
fd92346c53 mesa/st: Fix pipe_framebuffer_state::height for PIPE_TEXTURE_1D_ARRAY.
This prevents buffer overflow w/ llvmpipe when running piglit

  bin/gl-3.2-layered-rendering-clear-color-all-types 1d_array single_level -fbo -auto

v2: Compute the framebuffer size as the minimum size, as pointed out by
Brian;  compacted code;  ran piglit quick test list (with no
regressions.)

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-04-23 19:12:23 +01:00
José Fonseca
7a8667f2b3 util/u_debug: Pass correct size to strncat.
Courtesy of Clang static analyzer.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-04-23 19:12:23 +01:00
Rob Clark
05b3cea77b freedreno/a3xx: fix TOTALATTRTOVS
In cases where varying fetches are optimized away (just pass-through in
vertex shader, but unused in fragment shader) we need to calculate the
correct TOTALATTROVS based on the actual number of varyings fetched,
otherwise lockup.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-04-23 07:32:16 -04:00
Kenneth Graunke
34a68345e2 i965: Make Broadwell HiZ path arrange for TC flushes.
HiZ operations make the depth/render caches out of sync with the sampler
caches.  We need to arrange for a TC flush to happen before the target
buffer is used by the sampler.  Calling brw_render_cache_set_add_bo
makes that happen.

On previous generations, brw_blorp_exec took care of flushing the
texture cache by calling intel_batchbuffer_emit_mi_flush after doing
any rendering.  If we were to use the normal drawing path, then
brw_postdraw_set_buffers_need_resolve would handle this.

On Broadwell, we don't use BLORP, and we don't emit a rectangle
primitive via the normal drawing path.  The 3DSTATE_WM_HZ_OP and
PIPE_CONTROL implicitly make drawing happen.  So, none of our existing
code makes this flush happen - we need to do it directly.

Fixes 11 Piglit copyteximage subtests.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77223
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77226
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-04-22 10:57:11 -07:00
Matt Turner
fe49949392 i965: Use uint16_t for control/src index tables.
No need to use 32-bits to store 15 and 12.

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-04-22 09:12:31 -07:00
Matt Turner
f02f489295 i965/disasm: Fix s/xoo/xor/ typo.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-22 09:12:31 -07:00
Matt Turner
06501b3cf0 i965/disasm: Remove tables with obvious mappings.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-22 09:12:31 -07:00
Ilia Mirkin
5ce3f2fe72 mesa/st: enable EXT_shader_integer_mix when NativeIntegers is on
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-04-22 11:27:34 -04:00
Christian König
7eda318ffe st/omx/enc: implement frame reordering and B-frames
Signed-off-by: Christian König <christian.koenig@amd.com>
2014-04-22 16:42:08 +02:00
Leo Liu
b03be6908e st/omx/enc: replace omx buffer with texture buffer
Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2014-04-22 15:13:08 +02:00
Michel Dänzer
360038fa50 radeonsi: Fix calculation of number of banks for SI
The way cik_num_banks() was calculating the index only makes sense for
the CIK specific macrotile mode array. For SI, we need to use the tile
mode index directly.

This happened to work most of the time because most of the SI tiling
modes use the same number of banks.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2014-04-22 12:07:07 +09:00
Chris Forbes
0dfa6e7cf5 glsl: Only allow invariant on shader in/out between stages.
Previously this was special-cased for VS and FS; it never got updated
when geometry shaders came along. Generalize using is_varying_var() so
this won't be broken again with tessellation.

Note that there are two copies of the logic for `invariant`: It can be
present as part of a new declaration, and also as a redeclaration of an
existing variable or block member.

Fixes the four new piglits:
   spec/glsl-1.50/compiler/invariant-qualifier-*.geom

Note for stable: This won't quite pick cleanly due to whitespace and
state->target -> state->stage renames. Should be straightforward
adjustments though.

Cc: "10.0 10.1" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-04-22 09:07:05 +12:00
Brian Paul
0a0075666c svga: move draw debug code into separate function
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2014-04-21 14:54:28 -06:00
Brian Paul
e959274081 mesa: move declaration before code
To fix MSVC build.
2014-04-21 13:24:26 -06:00
Anuj Phogat
f8ae2a56c6 mesa: Fix error code generation in glReadPixels()
Section 4.3.1, page 220, of OpenGL 3.3 specification explains
the error conditions for glreadPixels():

   "If the format is DEPTH_STENCIL, then values are taken from
    both the depth buffer and the stencil buffer. If there is
    no depth buffer or if there is no stencil buffer, then the
    error INVALID_OPERATION occurs. If the type parameter is
    not UNSIGNED_INT_24_8 or FLOAT_32_UNSIGNED_INT_24_8_REV,
    then the error INVALID_ENUM occurs."

Fixes failing Khronos CTS test packed_depth_stencil_error.test

V2: Avoid code duplication

Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-04-21 11:20:50 -07:00
Anuj Phogat
bd1880dfe8 mesa: Add an error condition in glGetFramebufferAttachmentParameteriv()
From the OpenGL 4.4 spec page 275:
  "If pname is FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE, param will
   contain the format of components of the specified attachment,
   one of FLOAT, INT, UNSIGNED_INT, SIGNED_NORMALIZED, or
   UNSIGNED_NORMALIZED for floating-point, signed integer,
   unsigned integer, signed normalized fixedpoint, or unsigned
   normalized fixed-point components respectively. If no data
   storage or texture image has been specified for the attachment,
   param will contain NONE. This query cannot be performed for a
   combined depth+stencil attachment, since it does not have a
   single format."

Fixes Khronos CTS test: packed_depth_stencil_parameters.test

Khronos Bug# 9170
Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-04-21 11:20:50 -07:00
Brian Paul
7cb3bbf2cd libgl-gdi: silence unused variable warning when not using LLVM 2014-04-21 09:50:53 -06:00
Brian Paul
1f043cd95a docs: import 10.0.5 release notes and update links 2014-04-21 09:03:32 -06:00
Brian Paul
3fd9943a65 docs: import 10.1.1 release notes, update links 2014-04-21 09:03:32 -06:00
Benjamin Bellec
9b3b9c613f mesa: fix GetStringi error message with correct function name
Signed-off-by: Benjamin Bellec <b.bellec@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Cc: <mesa-stable@lists.freedesktop.org>
2014-04-21 08:44:20 -06:00
Brian Paul
27496af67f st/mesa: fix invalid pointer use in st_texture_get_sampler_view()
The '**used' pointer was pointing into the stObj->sampler_views array.
If 'free' was null, we'd realloc that array, thus making the 'used'
pointer invalid.  This soon led to memory errors.

Just change the pointer to be '*used' so it points directly at the
pipe_sampler_view.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-04-21 08:30:46 -06:00
Chris Forbes
9fec560e63 glsl: Fix typo
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
2014-04-21 16:02:02 +12:00
Chris Forbes
d63026f62a i965: Use ctx->Texture._MaxEnabledTexImageUnit for upper bound
Avoid looping over 32/48/96 (!!) tex image units every draw, most of
which we don't care about.

Improves performance on everyone's favorite not-a-benchmark by 2.9% on
Haswell.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-04-21 10:13:07 +12:00
Chris Forbes
c4a98e76d7 mesa: Track max enabled tex image unit
This gives us a better bound for some hot loops in the drivers than
MAX_COMBINED_TEXTURE_IMAGE_UNITS, which is ridiculously large on modern
hardware, and only getting worse as more shader stages are added.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-04-21 10:12:00 +12:00
Ilia Mirkin
ba6dcb3c2b nouveau/codegen: add missing values for OP_TXLQ into the target arrays
Also rework things so that if someone were to add an opcode without
adjusting the values in these arrays, there will be a compilation error.

This fixes a few quadop-related piglit regressions since commit
d5faf8e786.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-04-19 13:23:32 -04:00
Ilia Mirkin
47c19a5819 nvc0: change logic for centering of eng2d blit when downsampling
We want to center the sample. The old code may have been correct given
the limited values of ms_x/y, but the new logic should be more
intuitive. Note that ms_x can only be 1/2 and ms_y can only be 0/1.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-04-19 13:23:32 -04:00
Ilia Mirkin
6d5c3c8260 nv50: use 2d blit when src/dst have same number of samples
The 2D engine should be usable in more cases, but this fixes MS blits
between textures with the same MS settings. Otherwise a single sample is
selected to be the target texel value.

This allows other tests to work that render to a RB and then blit that
to a texture for input into a shader that uses sampler2DMS to verify it.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-04-19 13:23:32 -04:00
Ilia Mirkin
2d2e60bdee gallium/docs: fix PIPE_CAP_ENDIANNESS delimiter, remove trailing spaces
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-04-19 13:23:32 -04:00
Petri Latvala
b45f65e760 mesa: update glext.h to version 20140313
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-04-18 14:30:57 -07:00
Kenneth Graunke
a1273a07ed i965/fs: Implement fs_inst::force_sechalf support on Broadwell.
Back when I originally wrote this code, force_sechalf was only used for
Gen4 code, so I didn't bother hooking it up.  However, it's used more
generally these days.  In particular, we use it for computing
gl_SamplePosition.

Fixes Piglit's spec/ARB_sample_shading/builtin-gl-sample-position tests.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77222
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-04-18 11:57:33 -07:00
Chris Forbes
92840aabf7 glsl: Allow explicit binding on atomics again
As of 943b2d52bf, layout(binding) on an atomic would fail the assertion
here.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-18 10:35:05 -07:00
Alex Deucher
7489f3eeda radeonsi: fix num banks selection on SI for dma setup (v2)
The number of banks varies based on the tile mode index
just like CIK.

Bug:
https://bugs.freedesktop.org/show_bug.cgi?id=77533

v2: fix ordering for nbanks calculation for consistency

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2014-04-18 13:24:12 -04:00
Matt Turner
f770123f58 i965/fs: Reduce restrictions on interference in register coalescing.
We previously only allowed coalescing registers that interfere (i.e.,
whose live ranges overlap) if the destination register's live range was
entirely inside the source's live range. This is unnecessary -- we only
need to check for interfering writes in the intersection of their live
ranges.

total instructions in shared programs: 1639470 -> 1638453 (-0.06%)
instructions in affected programs:     84751 -> 83734 (-1.20%)

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-18 09:16:19 -07:00
Matt Turner
55de1c035c i965/fs: Give up in interference check if we see a WHILE.
Rather than any old control flow. Muchnick's algorithm just checks for
interfering writes between the MOV and the end of the program. Handling
this when you have backward branches is hard, so don't, but there's no
reason to bail if you see forward branches.

instructions in affected programs:     4270 -> 4248 (-0.52%)

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-18 09:16:19 -07:00
Matt Turner
5ff1e446d4 i965/fs: Simplify interference scan in register coalescing.
We were starting at the beginning of the instruction list, rather than
with the MOV instruction itself. This allows us to coalesce after
control flow.

Excluding the shaders from an unreleased title, the shader-db results:

total instructions in shared programs: 1603791 -> 1594215 (-0.60%)
instructions in affected programs:     678772 -> 669196 (-1.41%)
GAINED:                                5
LOST:                                  0

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-18 09:16:19 -07:00
Matt Turner
04a4e43eb2 i965/fs: Unindent can_coalesce_vars().
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-18 09:16:19 -07:00
Matt Turner
a975b2f55c i965/fs: Recognize nop-MOV instructions early.
And avoid rewriting other instructions unnecessarily. Removes a few
self-moves we weren't able to handle because they were components of a
large VGRF.

instructions in affected programs:     830 -> 826 (-0.48%)

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-18 09:16:19 -07:00
Matt Turner
ef6127ff69 i965/fs: Only sweep NOPs if register coalescing made progress.
Otherwise there's nothing to do.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-18 09:16:19 -07:00
Marek Olšák
352e06ddea r600g,radeonsi: don't skip the context flush if a fence should be returned
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77589
2014-04-18 13:33:57 +02:00
Brian Paul
744d2a225d svga: fix comment for emit_adjusted_vertex_attribs() 2014-04-17 16:15:37 -06:00
Brian Paul
cb34575e19 svga: compute need_swvfetch in svga_create_vertex_elements_state()
This saves us doing it at state validation time.

Reviewed-by: Matthew McClure <mcclurem@vmware.com>
2014-04-17 11:31:15 -07:00
Brian Paul
851645a3e7 svga: add VS code to set attribute W component to 1
There's a few 3-component vertex attribute formats that have no
equivalent SVGA3D_DECLTYPE_x format.  Previously, we had to use
the swtnl code to handle them.  This patch lets us use hwtnl for
more vertex attribute types by fetching 3-component attributes as
4-component attributes and explicitly setting the W component to 1.

This lets us handle PIPE_FORMAT_R16G16B16_SNORM/UNORM and
PIPE_FORMAT_R8G8B8_UNORM vertex attribs without using the swtnl path.

Fixes piglit normal3b3s GL_SHORT test.

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2014-04-17 11:29:33 -07:00
Brian Paul
615a356ee3 svga: implement support for signed byte vertex attributes
There's no SVGA3D_DECLTYPE that directly corresponds to
PIPE_FORMAT_R8G8B8_SNORM.  Previously, we used the swtnl fallback
path to handle this but that's slow and causes invariance issues.
Now we fetch the attribute as SVGA3D_DECLTYPE_UBYTE4N and insert
some extra VS instructions to remap the attributes from the range
[0,1] to the range[-1,1].

Fixes Sauerbraten sw fallback.
Fixes piglit normal3b3s-invariance test.

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2014-04-17 11:29:33 -07:00
Brian Paul
52faafa174 svga: move translated vertex declaration types into svga_velems_state
Now only translate the formats once in svga_create_vertex_elements_state().
And rename the array and use the proper SVGA3dDeclType type.

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2014-04-17 11:29:32 -07:00
Brian Paul
0f5add1959 Revert "svga: add work-around for Sauerbraten Z fighting issue"
This reverts commit c875d6e57a.

Conflicts:
	src/gallium/drivers/svga/svga_context.c

This work-around will no longer be needed after the next patch
which properly supports signed-byte vertex attributes.

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2014-04-17 11:29:32 -07:00
Brian Paul
7c7ab5434a svga: use new inst_token_setp() helper function
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2014-04-17 11:29:32 -07:00
Brian Paul
8e131576ee svga: use new inst_token_predicated() helper function
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2014-04-17 11:29:32 -07:00
Kenneth Graunke
71846a943f i965: Retype pre-Gen6 varying pull load destination to UW.
This sets up the proper execution mask for sends in SIMD16 mode.

Fixes Piglit's glsl-fs-normalmatrix, glsl-fs-uniform-array-2,
glsl-fs-uniform-array-6, and glsl-fs-uniform-array-7 on Ironlake,
which regressed when I enabled SIMD16 pull parameter support in
commit b207e88b25.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-04-17 10:54:00 -07:00
Anuj Phogat
ee10e893cb mesa: Fix error condition for multisample proxy texture targets
Fixes failures in Khronos OpenGL CTS test proxy_textures_invalid_samples

Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-17 10:26:39 -07:00
Anuj Phogat
1d350b9e22 i965: Add glBlitFramebuffer to commands affected by conditional rendering
Fixes failures in Khronos OpenGL CTS test conditional_render_test9

Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-17 10:26:39 -07:00
Anuj Phogat
8ed42ddd7d swrast: Add glBlitFramebuffer to commands affected by conditional rendering
Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-04-17 10:26:05 -07:00
Anuj Phogat
48fc2703e5 i965: Fix component mask and varying_to_slot mapping for gl_ViewportIndex
gl_ViewportIndex doesn't get its own varying slot. It is stored
in VARYING_SLOT_PSIZ.z. This patch fixes the issue for both gen7
and gen8 because gen7_upload_3dstate_so_decl_list() is shared
between them.

Fixes failures in OpenGL Khronos CTS test transform_feedback_builtins.
Makes new piglit test glsl-1.50-transform-feedback-builtins pass for
'gl_ViewportIndex'.

Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-17 10:08:28 -07:00
Anuj Phogat
7928b9c249 i965: Fix component mask and varying_to_slot mapping for gl_Layer
gl_Layer doesn't get its own varying slot. It is stored in
VARYING_SLOT_PSIZ.y. This patch fixes the issue for both gen7
and gen8 because gen7_upload_3dstate_so_decl_list() is shared
between them.

Fixes failures in OpenGL Khronos CTS test transform_feedback_builtins.
Makes new piglit test glsl-1.50-transform-feedback-builtins pass for
'gl_Layer'.

Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-17 10:08:28 -07:00
Anuj Phogat
969b461c2b i965: Put an assertion to check valid varying_to_slot[varying]
Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-17 10:08:28 -07:00
Darren Powell
bc86690f13 radeonsi: Added Diag Handler to receive LLVM Error messages
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-04-17 19:37:58 -04:00
Marek Olšák
9f9ab8ec0d winsys/radeon: remove some unused code
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-04-17 13:54:19 +02:00
Marek Olšák
8b966bcaf2 winsys/radeon: remove is_handle_added array
Use index -1 if a buffer is not added.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-04-17 13:54:19 +02:00
Marek Olšák
b0fca0a378 winsys/radeon: remove local variable reloc from radeon_get_reloc
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-04-17 13:54:18 +02:00
Marek Olšák
3384a41aa9 winsys/radeon: remove parameter reloc from radeon_get_reloc
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-04-17 13:54:18 +02:00
José Fonseca
75e487538d util: Add __declspec(noreturn) to _debug_assert_fail().
Mostly for consistency; as MSVC's static source code analysis doesn't
seem to rely on assertions, but instead on different kind of source
annotations( http://msdn.microsoft.com/en-us/library/hh916383.aspx ).

Reviewed-by: Brian Paul <brianp@vmware.com>
2014-04-17 09:56:49 +01:00
José Fonseca
a2b89c4ae1 auxiliary/os,auxiliary/util: Fix the ‘noreturn’ function does return warning.
Now that _debug_assert_fail() has the noreturn attribute, it is better
that execution truly never returns.  Not just for sake of silencing the
warning, but because the code at the return IP address may be invalid or
lead to inconsistent results.

This removes support for the GALLIUM_ABORT_ON_ASSERT debugging
environment variable, but between the usefulness of
GALLIUM_ABORT_ON_ASSERT and better static code analysis I think better
static code analysis wins.

Reviewed-by: Brian Paul <brianp@vmware.com>
2014-04-17 09:56:48 +01:00
José Fonseca
97fa9cd220 scons: Enable building through Clang Static Analyzer.
Same intent as commit a45a50a482,
but this the C compiler is detected via C-preprocessor macros,
similar to how autotools do it, as that seems to be the most
reliable method.

Reviewed-by: Brian Paul <brianp@vmware.com>
2014-04-17 09:56:48 +01:00
Maarten Lankhorst
74f19445cc gallium glsl: Fix crash with piglit fs-deref-literal-array-of-structs.shader_test
This allows the following shader code to work without a weird crash:

struct Foo {
  int value[1];
};

int actual_value = Foo[2](Foo(int[1](100)), Foo(int[1](200)))[i].value[0];

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
2014-04-17 10:34:10 +02:00
Maarten Lankhorst
49d26a277d nouveau/vdec: small fixes to h264 handling
nouveau_vp3_inter_sizes requires sliec_count as argument just
as the other places that call it from h264 code do. Hopefully
fixes something.

Fix the status_vp code to allow status == 0 too, when processing
hasn't started yet.

set h264->second_field correctly.
2014-04-17 10:30:39 +02:00
Thomas Hellstrom
09cd376353 st/xa: Cache render target surface
Otherwise it will trick the gallium driver into thinking that the render
target has actually changed (due to different pipe_surface pointing to
same underlying pipe_resource).  This is really badness for tiling GPUs
like adreno.

This also appears to fix a rendering error with Motif on vmwgfx.
Why that is is still under investigation.

Based on an idea by Rob Clark.

Cc: "10.0 10.1" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Rob Clark <robclark@freedesktop.org>
2014-04-17 09:56:28 +02:00
Rob Clark
a45ae814d1 st/xa: scissor to help tilers
Keep track of the maximal bounds of all the operations and set scissor
accordingly.  For tiling GPU's this can be a big win by reducing the
memory bandwidth spent moving pixels from system memory to tile buffer
and back.

You could imagine being more sophisticated and splitting up disjoint
operations.  But this simplistic approach is good enough for the common
cases.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
2014-04-17 09:42:06 +02:00
Rob Clark
3c52013273 st/xa: remove unneeded args
Signed-off-by: Rob Clark <robclark@freedesktop.org>
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
2014-04-17 09:40:42 +02:00
Iago Toral Quiroga
cda5e0c25e glsl: Small optimization for constant conditionals
Once the relevant branch has been identified do not iterate over the
instructions in the branch, do a linked list insertion instead to avoid the
loop.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-16 23:39:57 -07:00
Iago Toral Quiroga
4472ab9e6d glsl: Fix incorrect indentation.
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-16 23:22:24 -07:00
Chris Forbes
d1b6f67110 meta: Clip src/dest rects in BlitFramebuffer, using the scissor
Fixes piglit's fbo-blit-stretch test on drivers which use the meta path.
(i965: should fix Broadwell, but also fixes Sandybridge/Ivybridge/Haswell
since this test falls off the blorp path now due to format conversion)

V2: Use scissor instead of just mangling the rects, to avoid texcoord
rounding problems. (Thanks Marek)

V3: Rebase on Eric's CTSI meta changes; re-add _mesa_update_state in the
CTSI path so that _mesa_clip_blit sees the correct bounds.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77414
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Tested-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-04-17 18:11:24 +12:00
Samuel Iglesias Gonsalvez
9927180714 mesa: fix check for dummy renderbuffer in _mesa_FramebufferRenderbufferEXT()
According to the spec:
	<renderbuffertarget> must be RENDERBUFFER and <renderbuffer>
	should be set to the name of the renderbuffer object to be
	attached to the framebuffer.  <renderbuffer> must be either
	zero or the name of an existing renderbuffer object of type
	<renderbuffertarget>, otherwise an INVALID_OPERATION error is
	generated.

This patch changes the previous returned GL_INVALID_VALUE to
GL_INVALID_OPERATION.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76894

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com>
2014-04-16 23:00:40 -07:00
Matt Turner
42a26cb5e4 i965: Don't make instructions with a null dest a barrier to scheduling.
Now that we properly track accumulator dependencies, the scheduler is
able to schedule instructions between the mach and mov in the common
the integer multiplication pattern:

   mul  acc0, x, y
   mach null, x, y
   mov  dest, acc0

Since a null destination implies no dependency on the destination, we
can also safely schedule instructions (that don't write the accumulator)
between the mul and mach.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-16 22:46:45 -07:00
Juha-Pekka Heikkila
a6860100b8 i965/fs: Change fs_visitor::emit_lrp to use MAC for gen<6
This allows us to emit ADD/MUL/MAC instead of MUL/ADD/MUL/ADD,
saving one instruction and two temporary registers.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
2014-04-16 22:46:45 -07:00
Juha-Pekka Heikkila
da0c3b02e7 i965/fs: Add support for the MAC instruction.
This allows us to generate the MAC (multiply-accumulate) instruction,
which can be used to implement some expressions in fewer instructions
than doing a series of MUL and ADDs.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
2014-04-16 22:46:45 -07:00
Juha-Pekka Heikkila
2dfbbeca50 i965/vec4: Change vec4_visitor::emit_lrp to use MAC for gen<6
This allows us to emit ADD/MUL/MAC instead of MUL/ADD/MUL/ADD,
saving one instruction and two temporary registers.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
2014-04-16 22:46:45 -07:00
Juha-Pekka Heikkila
0974706671 i965/vec4: Add support for the MAC instruction.
This allows us to generate the MAC (multiply-accumulate) instruction,
which can be used to implement some expressions in fewer instructions
than doing a series of MUL and ADDs.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
2014-04-16 22:46:45 -07:00
Juha-Pekka Heikkila
306ed81b93 i965: Add writes_accumulator flag
Our hardware has an "accumulator" register, which can be used to store
intermediate results across multiple instructions.  Many instructions
can implicitly write a value to the accumulator in addition to their
normal destination register.  This is enabled by the "AccWrEn" flag.

This patch introduces a new flag, inst->writes_accumulator, which
allows us to express the AccWrEn notion in the IR.  It also creates a
n ALU2_ACC macro to easily define emitters for instructions that
implicitly write the accumulator.

Previously, we only supported implicit accumulator writes from the
ADDC, SUBB, and MACH instructions.  We always enabled them on those
instructions, and left them disabled for other instructions.

To take advantage of the MAC (multiply-accumulate) instruction, we
need to be able to set AccWrEn on other types of instructions.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
2014-04-16 22:46:45 -07:00
Juha-Pekka Heikkila
30c35d1dcb i965: Add is_accumulator() function.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
2014-04-16 22:46:45 -07:00
Matt Turner
6541f1b4d0 i965: Add reads_accumulator_implicitly() function.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-16 22:46:44 -07:00
Anuj Phogat
cb6566f9df mesa: Add error condition for integer formats in glGetTexImage()
OpenGL 4.0 spec, page 306 suggests an INVALID_OPERATION in glGetTexImage
if :
   "format is one of the integer formats in table 3.3 and the internal
    format of the texture image is not integer, or format is not one of
    the integer formats in table 3.3 and the internal format is integer."

V2: Use helper function _mesa_is_format_integer()

Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-04-16 18:37:06 -07:00
Anuj Phogat
3135668254 mesa: Add helper function _mesa_is_format_integer()
This function will be used in the following patch.

Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-04-16 18:37:06 -07:00
Anuj Phogat
fdd8bebc22 mesa: Fix glGetVertexAttribi(GL_VERTEX_ATTRIB_ARRAY_SIZE)
mesa currently returns 4 when GL_VERTEX_ATTRIB_ARRAY_SIZE is queried
for a vertex array initially set up with size=GL_BGRA. This patch
makes changes to return size=GL_BGRA as required by the spec.

Fixes Khronos OpenGL CTS test: vertex_array_bgra_basic.test

V2: Use array->Format instead of adding a new variable

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Cc: <mesa-stable@lists.freedesktop.org>
2014-04-16 18:37:06 -07:00
Anuj Phogat
80b4a36fed glsl: Fix copy-paste error in linker_warning()
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-16 18:37:06 -07:00
Michel Dänzer
7286739b9b r600g: Disable LLVM by default at runtime for graphics
For graphics, the LLVM compiler backend currently has many shortcomings
compared to the non-LLVM one. E.g. it can't handle geometry shaders yet,
but that's just the tip of the iceberg.

So building Mesa with --enable-r600-llvm-compiler is currently not
recommended for anyone who doesn't want to work on fixing those issues.
However, for protection of users who end up enabling it anyway for some
reason, let's disable the LLVM backend at runtime by default. It can be
enabled with the environment variable R600_DEBUG=llvm.

Cc: "10.1" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-04-17 10:15:59 +09:00
Roland Scheidegger
f23d1160c2 gallivm: fix compilation with llvm 3.5 r206241+
Just adjust to the ever-changing API, pass in MCContext when creating the
MCDisassembler.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-04-16 19:57:47 +02:00
José Fonseca
e3c58cdfd9 Revert "scons: Enable building through Clang Static Analyzer."
This reverts commit a45a50a482.

Unfortunately gcc dumps argv[0] as the first word of --version, so it is
unreliable for detecting gcc.

In particular `cc --version` and `i686-w64-mingw32-gcc --version` give
wrong results.

A better solution needs to be found -- most likely using C-preprocessing
like autotools does.  Revert for now.
2014-04-16 13:18:06 +01:00
Marek Olšák
11459436d9 r600g,radeonsi: share some of gfx flush code
Reviewed-by: Christian König <christian.koenig@amd.com>
2014-04-16 14:02:52 +02:00
Marek Olšák
adfadeadd8 r600g,radeonsi: share r600_flush_from_st
Reviewed-by: Christian König <christian.koenig@amd.com>
2014-04-16 14:02:52 +02:00
Marek Olšák
586011486d r600g: merge r600_flush with r600_context_flush
Reviewed-by: Christian König <christian.koenig@amd.com>
2014-04-16 14:02:51 +02:00
Marek Olšák
d4edc60767 radeonsi: merge si_flush with si_context_flush
This also removes si_flush_gfx_ring.

Reviewed-by: Christian König <christian.koenig@amd.com>
2014-04-16 14:02:51 +02:00
Marek Olšák
70cf6639c3 gallium/radeon: create and return a fence in the flush function
All flush functions get a fence parameter. cs_create_fence is removed.

Reviewed-by: Christian König <christian.koenig@amd.com>
2014-04-16 14:02:51 +02:00
Marek Olšák
3e9d2cbca2 r600g: remove redundant r600_flush_dma_from_winsys
Reviewed-by: Christian König <christian.koenig@amd.com>
2014-04-16 14:02:51 +02:00
Marek Olšák
dd72c327e9 winsys/radeon: fold cs_set_flush_callback into cs_create
Reviewed-by: Christian König <christian.koenig@amd.com>
2014-04-16 14:02:51 +02:00
Marek Olšák
c6033a6cb8 radeonsi: cleanup redundant computation of flush flags and rename a function
Reviewed-by: Christian König <christian.koenig@amd.com>
2014-04-16 14:02:51 +02:00
Marek Olšák
fc151b08be r600g: remove redundant r600_flush_from_winsys
Reviewed-by: Christian König <christian.koenig@amd.com>
2014-04-16 14:02:51 +02:00
Marek Olšák
b2238b3452 winsys/radeon: remove cs_write_reloc, add simpler cs_get_reloc
The only difference is that it doesn't write to the CS and only returns
the index.

Reviewed-by: Christian König <christian.koenig@amd.com>
2014-04-16 14:02:51 +02:00
Marek Olšák
927213f33d winsys/radeon: consolidate hash table lookup
I should have done this long ago.

Reviewed-by: Christian König <christian.koenig@amd.com>
2014-04-16 14:02:51 +02:00
José Fonseca
d3c0e236f2 scons: Add an analyze option.
For Clang static code analyzer, the scan-build script will produce more
comprehensive output.  Nevertheless you can invoke it as

  CC=clang CXX=clang++ scons analyze=1

For MSVC this is the best way to use its static code analysis.  Simply
invoke as

  scons analyze=1

Reviewed-by: Brian Paul <brianp@vmware.com>
2014-04-16 11:44:21 +01:00
José Fonseca
f81305c0cb util/u_debug: Add noreturn attribute to _debug_assert_fail().
As recommended by
http://clang-analyzer.llvm.org/annotations.html#attr_noreturn

Reviewed-by: Brian Paul <brianp@vmware.com>
2014-04-16 11:44:17 +01:00
José Fonseca
a45a50a482 scons: Enable building through Clang Static Analyzer.
By accurately detecting gcc/clang through --version option instead
of executable name.

Clang Static Analyzer reports many issues, most false positives, but it
found at least one real and subtle use-after-free issue
in st_texture_get_sampler_view():

  http://people.freedesktop.org/~jrfonseca/scan-build-2014-04-14-1/report-869047.html#EndPath

Reviewed-by: Brian Paul <brianp@vmware.com>
2014-04-16 11:44:06 +01:00
Iago Toral Quiroga
6d0e30c6a3 glsl: Properly handle blocks that define the same field name.
Currently we can have name space collisions between blocks that define the same
fields. For example:

in block
{
    vec4 Color;
} In[];

out block
{
    vec4 Color;
} Out;

These two blocks will assign the same interface name (block.Color) to the Color
field in flatten_named_interface_blocks_declarations.cpp, leading to havoc.
This was breaking badly the gl-320-primitive-shading test from ogl-samples.

The patch uses the block instance name to avoid collisions, producing names
like block.In.Color and block.Out.Color to avoid the name clash.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76394
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-15 22:18:43 -07:00
Michel Dänzer
6ac5a5e383 r600g/radeonsi: Map transfer staging texture unsynchronized when possible
The transfer staging texture is always freshly allocated, so for write-only
transfers we don't need to explicitly wait for the BO to become idle.

Squeezes a few hundered MB/s more out of x11perf -shmput500 with glamor.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-04-16 12:11:27 +09:00
Matt Turner
9fed627234 Revert "i965/fs: Only sweep NOPs if register coalescing made progress."
This reverts commit f092e8951c.

Didn't mean to push this...
2014-04-15 17:27:55 -07:00
Matt Turner
f092e8951c i965/fs: Only sweep NOPs if register coalescing made progress.
Otherwise there's nothing to do.
2014-04-15 16:28:04 -07:00
Eric Anholt
7ae870211d i965: Fix buffer overruns in MSAA MCS buffer clearing.
This manifested as rendering failures or sometimes GPU hangs in
compositors when they accidentally got MSAA visuals due to a bug in the X
Server.  Today we decided that the problem in compositors was equivalent
to a corruption bug we'd noticed recently in resizing MSAA-visual
glxgears, and debugging got a lot easier.

When we allocate our MCS MT, libdrm takes the size we request, aligns it
to Y tile size (blowing it up from 300x300=900000 bytes to 384*320=122880
bytes, 30 pages), then puts it into a power-of-two-sized BO (131072 bytes,
32 pages).  Because it's Y tiled, we attach a 384-byte-stride fence to it.
When we memset by the BO size in Mesa, between bytes 122880 and 131072 the
data gets stored to the first 20 or so scanlines of each of the 3 tiled
pages in that row, even though only 2 of those pages were allocated by
libdrm.  In the glxgears case, the missing 3rd page happened to
consistently be the static VBO that got mapped right after the first MCS
allocation, so corruption only appeared once window resize made us throw
out the old MCS and then allocate the same BO to back the new MCS.

Instead, just memset the amount of data we actually asked libdrm to
allocate for, which will be smaller (more efficient) and not overrun.
Thanks go to Kenneth for doing most of the hard debugging to eliminate a
lot of the search space for the bug.

Cc: "10.0 10.1" <mesa-stable@lists.freedesktop.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77207
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-15 14:34:47 -07:00
Eric Anholt
e5b86cb64b meta: Add support for MSAA resolves from 2D_MS_ARRAY textures.
We don't have any piglit tests for this currently.

v2: Use vec3s for the texcoords so it has some hope of working.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-15 14:34:45 -07:00
Eric Anholt
234db60954 meta: Add an accelerated glCopyTexSubImage using glBlitFramebuffer.
You'll note from the previous commits that there's something of a loop
here: You call CTSI, which calls BlitFB, then if things go wrong that
falls back to CTSI.  As a result, meta CTSI reaches over into blitfb to
tell it "no, don't try that fallback".

v2: Drop the _mesa_update_state(), which was only necessary due to use of
    _mesa_clip_blit() in _mesa_meta_BlitFramebuffer() in another patch
    series.
v3: Drop an _EXT suffix I copy-and-pasted.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> (v2)
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-15 14:34:22 -07:00
Eric Anholt
70961c032f meta: Add support for CUBE_MAP_ARRAY to generatemipmap.
I added support to bind_fbo_image in the process of building meta
CopyTexSubImage, and found that it broke generatemipmap because previously
we would just throw a GL error there and then end up with an incomplete
FBO and fallback.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-15 14:34:22 -07:00
Eric Anholt
bb3f983d10 meta: Infer bind_fbo_image parameters from an incoming image.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-15 14:34:22 -07:00
Eric Anholt
cd808ac848 meta: Move bind_fbo_image() code back to meta.c, to reuse it elsewhere.
I need to do the same code again for CopyTexSubImage().

v2: Drop incorrect, not-terribly-useful comment (review by Ken)

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> (v1)
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-15 14:34:22 -07:00
Eric Anholt
4cc42805e7 meta: Refactor the BlitFramebuffer depth CopyTexImage fallback.
This avoids a ReadPixels() if there's accelerated CopyTexImage present.
It now requires GLSL as opposed to just fragment programs, but we don't
have any drivers that do ARB_fp but not GLSL.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-15 14:34:22 -07:00
Eric Anholt
b702233f53 meta: Refactor the BlitFramebuffer color CopyTexImage fallback.
There shouldn't be anything special about copying out a subset of the src
rb to a temp before texturing from it, so just do it when we're figuring
out our src texture binding.

This drops Anuj's change to copy an extra border of 1 pixel around the src
area.  I can't see how that change could be valid, and presumably if
there's some filtering problem at edges we just need to set the right
wrap mode.

v2: Don't fall back to swrast on non-2D/RECT/2D_MS textures when we can
    still CopyTexSubImage.  Fixes a segfault regression on i965 with
    gl-3.2-layered-rendering-blit.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> (v1)
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> (v1)
Tested-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-04-15 14:34:06 -07:00
Eric Anholt
4e43299633 meta: Drop blit src size fallback.
I think we can assert that renderbuffer size is <= maximum 2D texture
size.  Our source coordinates should have already been clipped to the src
renderbuffer size, but haven't actually (so we could potentially have
trouble if there's scaling, and we're in the CopyTexImage path that tries
to use src size).  However, this texture size dependency was blocking the
next refactors, so I'm not sure if we want to go ahead with this series
before we get the clipping sorted out or not.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-15 12:27:37 -07:00
Mike Stroyan
602510395a i965: Avoid dependency hints on math opcodes
Putting NoDDClr and NoDDChk dependency control on instruction
sequences that include math opcodes can cause corruption of channels.
Treat math opcodes like send opcodes and suppress dependency hinting.

Signed-off-by: Mike Stroyan <mike@LunarG.com>
Tested-by: Tony Bertapelli <anthony.p.bertapelli@intel.com>
Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-04-15 10:31:46 -07:00
Matt Turner
ad48a9a319 i965: Expand INTEL_DEBUG to uint64_t.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-15 10:29:00 -07:00
Matt Turner
58db339599 dri: Expand driParseDebugString return value to uint64_t.
Users will downcast if they don't have >32 debug flags.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-15 10:28:57 -07:00
Matt Turner
73400d8f70 i965/fs: Remove dead_code_eliminate_local().
Subsumed by the new dead_code_eliminate() function. No shader-db
changes.

Reviewed-by: Eric Anholt <eric@anholt.net>
2014-04-15 09:25:47 -07:00
Matt Turner
18d12336b9 i965/fs: Clear variable from live-set if it's completely overwritten.
One program affected:

instructions in affected programs:     246 -> 244 (-0.81%)

Reviewed-by: Eric Anholt <eric@anholt.net>
2014-04-15 09:25:44 -07:00
Matt Turner
f34f39330b i965/fs: Reimplement dead_code_elimination().
total instructions in shared programs: 1653399 -> 1651790 (-0.10%)
instructions in affected programs:     92157 -> 90548 (-1.75%)
GAINED:                                2
LOST:                                  2

Also significantly reduces the number of optimization loop iterations:

total loop iterations in shared programs: 39724 -> 31651 (-20.32%)
loop iterations in affected programs:     21617 -> 13544 (-37.35%)

Including some great pathological cases, like 29 -> 3 in Strike Suit
Zero and 24 -> 3 in Dota2.

Reviewed-by: Eric Anholt <eric@anholt.net>
2014-04-15 09:25:11 -07:00
Matt Turner
596737ee91 i965/vec4: Let DCE eliminate dead writes in other basic blocks.
We previously stopped searching for unread writes after encountering
control flow, but we can instead just search backwards until we hit
control flow.

instructions in affected programs:     22854 -> 22194 (-2.89%)
2014-04-15 09:24:09 -07:00
Matt Turner
4dcfb92417 i965/gs: Add dummy source to prepare_channel_masks instruction.
The generator uses its destination as a source implicitly, which breaks
some assumptions in dead code elimination. Giving the instruction a
source allows us to reason about it better.
2014-04-15 09:24:09 -07:00
Matt Turner
d877c643be glsl: Use M_PI_* macros.
Notice our multiple values for M_PI_2, which rounded ...32 up to
...4 and ...5.
2014-04-15 09:24:09 -07:00
Kenneth Graunke
4f20b7d3dd i965: Disable Z16 in all APIs.
We originally thought that GL 3.0 required GL_DEPTH_COMPONENT16 to map
exactly to Z16.  However, we misread the specification, thanks in part
to LaTeX reordering the tables in the PDF.

Page 180 of the GL 3.0 specification (glspec30.20080923.pdf) says:
"[...] memory allocation per texture component is assigned by the GL to
match the allocations listed in tables 3.16-3.18 as closely as possible.
[...]

Required Texture Formats
[...]
In addition, implementations are required to support the following sized
internal formats.  Requesting one of these internal formats for any
texture type will allocate exactly the internal component sizes and
types shown for that format in tables 3.16-3.17:"

Notably, however, GL_DEPTH_COMPONENT16 does /not/ appear in table 3.16
or table 3.17.  It appears in table 3.18, where the "exact" rule doesn't
apply, and it falls back to the "closely as possible" rule.

The confusing part is that the ordering of the tables in the PDF is:

Table 3.16 (pages 182-184)
Table 3.18 (bottom of page 184 to top of 185)
Table 3.17 (page 185)

Presumably, people saw table 3.16, then saw the table immediately
following with DEPTH_COMPONENT* formats, and assumed it was 3.17.

Based on a patch by Chia-I Wu, but without the driconf option to force
Z16 to be used.  It's not required, and there's apparently no benefit
to actually using it.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Chia-I Wu <olv@lunarg.com>
2014-04-15 02:15:11 -07:00
Kenneth Graunke
be000b4d19 i965: Update comments about Z16 being slow.
We've learned a few things since we originally disabled Z16; this attempts
to summarize the issue.  I am no expert on this subject, though, so the
comment may not be totally accurate.

I did some benchmarking on GM45 and Ironlake, and discovered that for
GLBenchmark 2.7 EgyptHD, using Z16 was 3% slower on GM45 (n=15), and
4.5% slower on Ironlake (n=95).  So, we can drop the "on Ivybridge"
aspect of the comment - it's always slower.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Chia-I Wu <olv@lunarg.com>
2014-04-15 02:15:11 -07:00
Michel Dänzer
313104e8d5 r600g/radeonsi: Use caching buffer manager for textures as well
Significantly reduces BO allocation / destruction overhead for transfers,
e.g. measurable via x11perf -shm{ge,pu}t* with glamor.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-04-15 11:34:56 +09:00
Jordan Justen
24c773fb06 i965/gen8: add debug code to show FS disasm with jump locations
Copied from similar code in gen8_vec4_generator.cpp.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-14 10:32:42 -07:00
Chia-I Wu
73a4761058 ilo: remove GPE state size estimation
Use size defines from genhw.
2014-04-14 20:45:04 +08:00
Chia-I Wu
8fa8e9b1b8 ilo: remove GPE command size estimation
Use size defines from genhw.
2014-04-14 20:45:04 +08:00
Chia-I Wu
bdd0546d7c ilo: remove unused headers
Remove intel_*.h.  brw_*.h is still needed by the state dumper and
disassembler.
2014-04-14 20:45:04 +08:00
Chia-I Wu
e55e1610e5 ilo: use only defines from genhw headers
Stop including classic driver headers in genhw.h, with some formatting fixes.
2014-04-14 20:45:04 +08:00
Chia-I Wu
6c6bd796ad ilo: scripted conversion to genhw headers
Hopefully my four hundred line sed script is correct.
2014-04-14 20:45:04 +08:00
Chia-I Wu
01e3e82a56 ilo: add genhw headers
All except genhw.h are generated by https://github.com/olvaffe/envytools/.
intel_chipset.h is deprecated.
2014-04-14 20:45:03 +08:00
Chia-I Wu
d75a8799fd ilo: avoid brw_wm_barycentric_interp_mode in compiler
In preparation for genhw.
2014-04-14 20:45:03 +08:00
Chia-I Wu
ad39b991ce ilo: add TOY_OPCODE_DO
We used to give BRW_OPCODE_DO a special meaning, while we should have used
TOY_OPCODE_DO.
2014-04-14 20:45:03 +08:00
Vinson Lee
36fb36aa36 gtest: Update to 1.7.0.
This patch fixes gtest build errors on Mac OS X 10.9.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=73106
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Tested-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Ian Romanick <ian.d.romanick@intel.com>
2014-04-14 00:06:53 -07:00
Chris Forbes
936dda08ee mesa: Consider gl_VertexID and gl_InstanceID active attribs
Fixes piglit's spec/gl-3.2/get-active-attrib-returns-all-inputs.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-13 19:27:01 +12:00
Chris Forbes
ca5c8d6cd4 mesa: Extract is_active_attrib() in shaderapi
The rules are about to get a bit more complex to account for
gl_InstanceID and gl_VertexID, which are system values.

Extracting this first avoids introducing duplication.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-13 19:26:56 +12:00
Chris Forbes
aeb03f8aea glsl: Fix typo in interface block comment
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
2014-04-13 17:02:11 +12:00
Simone Scanzoni
c3b701d63c egl-static: fix build after recent radeon winsys changes
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
2014-04-13 02:37:36 +02:00
Chris Forbes
b92e7f2da9 mesa: Fix typo in error message
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
2014-04-13 12:38:24 +12:00
Iago Toral Quiroga
a5957f7bc5 i965: glClearBuffer() should only clear a single buffer.
glClearBuffer() is currently clearing all active draw color buffers (all
buffers that have not been set to GL_NONE when calling glDrawBuffers) instead
of only clearing the one it receives as parameter. Altough brw_clear()
receives a bit mask indicating the color buffers that should be cleared,
this mask is ignored when calling brw_blorp_clear_color().

This was breaking the 'fbo-drawbuffers-none glClearBuffer' piglit test.

The patch provides the bit mask to brw_blorp_clear_color() so it can limit
clearing to the color buffers present in the mask.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76832
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-04-13 12:28:25 +12:00
Chris Forbes
26224d3e00 i965: Add comment to explain the weird-looking shadow compares.
This always looks crazy when I stumble across it, until I remember
what the hardware is doing. Describing it ought to short-circuit
that process next time :)

V2: Fix indents to 6 spaces, not 7.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-13 08:51:46 +12:00
Kenneth Graunke
857f3a68ea glsl: Ignore loop-too-large heuristic if there's bad variable indexing.
Many shaders use a pattern such as:

for (int i = 0; i < NUM_LIGHTS; i++) {
   ...access a uniform array, or shader input/output array...
}

where NUM_LIGHTS is a small constant (such as 2, 4, or 8).

The expectation is that the compiler will unroll those loops, turning
the array access into constant indexing, which is more efficient, and
which may enable array splitting and other optimizations.

In many cases, our heuristic fails - either there's another tiny nested
loop inside, or the estimated number of instructions is just barely
beyond the threshold.  So, we fail to unroll the loop, leaving the
variable indexing in place.

Drivers which don't support the particular flavor of variable indexing
will call lower_variable_index_to_cond_assign(), which generates piles
and piles of immensely inefficient code.  We'd like to avoid generating
that.

This patch detects unsupported forms of variable-indexing in loops, where
the array index is a loop induction variable.  In that case, it bypasses
the loop-too-large heuristic and forces unrolling.

Improves performance in various microbenchmarks: Gl32PSBump8 by 47%,
Gl32ShMapVsm by 80%, and Gl32ShMapPcf by 27%.  No changes in shader-db.

v2: Check ir->array for being an array or matrix, rather than the
    ir_dereference_array itself.
v3: Fix and expand statistics in commit message.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-04-11 17:41:43 -07:00
Kenneth Graunke
2231db5598 glsl: Rename loop_unroll_count::fail to "nested_loop."
The "fail" flag is set if loop_unroll_count encounters a nested loop;
calling the flag "nested_loop" is a bit clearer.

The original reasoning was that count is inaccurate (too small) if there
are nested loops, as we don't do any sort of analysis on the inner loop.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-04-11 17:41:41 -07:00
Kenneth Graunke
8268a2f347 glsl: Pass gl_shader_compiler_optimizations to unroll_loops().
Loop unrolling will need to know a few more options in the future.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-04-11 17:41:39 -07:00
Kenneth Graunke
da22221aa3 glsl: Drop do_common_optimization's max_unroll_iterations parameter.
Now that we pass in gl_shader_compiler_options, it makes sense to just
use options->MaxUnrollIterations, rather than passing a separate
parameter.

Half of the invocations already passed options->MaxUnrollIterations,
while the other half passed in a hardcoded value of 32.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-04-11 17:41:37 -07:00
Kenneth Graunke
f00a6483e9 i965: Use EmitNoIndirect flags in lower_variable_index_to_cond_assign.
This will prevent the two from getting out of sync again.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-04-11 17:41:36 -07:00
Kenneth Graunke
320e0c5205 i965: Correct EmitNoIndirect shader compiler option flags.
These were out of sync with the flags used to control
lower_variable_index_to_cond_assign in brw_shader.cpp.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-04-11 17:41:25 -07:00
Matt Turner
509b2a6523 i965/fs: Reset reg_from when we can't coalesce.
Not setting this would prevented coalescing after a failed attempt if
the sources for both MOVs were the same.

total instructions in shared programs: 1654531 -> 1650224 (-0.26%)
instructions in affected programs:     423167 -> 418860 (-1.02%)
GAINED:                                2
LOST:                                  0

Reviewed-by: Eric Anholt <eric@anholt.net>
2014-04-11 15:27:46 -07:00
Eric Anholt
7e034a8d77 i965: Fill in a bunch of gen7/hsw data cache-related disasm.
This gets us disasm of atomic ops.

v2: Fix fallthrough on pre-gen7.  (bug caught by Ilia Mirkin).

Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-04-11 13:38:53 -07:00
Eric Anholt
99442bc7b2 i965: Stop setting up a 1:1 "attrib" member in our vertex inputs.
It's just the array index, so we can just go look at the array and see
which element we are.

No significant performance difference (n=140)

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-04-11 13:38:53 -07:00
Eric Anholt
9a5d19d680 i965: Skip a bunch of IB BO refcount twiddling.
Improves cairo performance on glamor by 1.64828% +/- 1.04742% (n=65).

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-04-11 13:38:52 -07:00
Eric Anholt
3f9440cfbb i965/gen7: Skip repeated NULL depth/stencil state emits.
Improves cairo performance on glamor by 2.87752% +/- 0.966977 (n=57).

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-04-11 13:38:52 -07:00
Chris Forbes
fe4f373eb4 docs: Fix ubo indexing description
Ian points out that this being unrestricted was an oversight in the
spec, and is corrected in GLSL4.40.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
2014-04-12 08:31:05 +12:00
Brian Paul
e5f306e3ff draw: remove unused 'start' variable in draw_stats_clipper_primitives()
It was computed, but never actually used.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-04-11 13:54:17 -06:00
Kenneth Graunke
ae2a03b573 glsl: Try vectorizing when seeing a repeated assignment to a channel.
When considering assignment expressions like:

    v.x += u.x;
    v.x += u.x;

the vectorizer would incorrectly keep going, attempting to find more
instructions to vectorize.  It would overwrite the saved assignment
to point at the second one, and increment channels a second time,
resulting in try_vectorize thinking the expression was a vec2 instead of
a float.

Instead, if we see a repeated assignment to a channel, just try to
vectorize everything we've found so far.  This clears the saved state
so it will start over.

Fixes Piglit's repeated-channel-assignments.vert.

Cc: "10.1" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-04-11 12:39:37 -07:00
Ian Romanick
625cf8c874 glsl: Propagate explicit binding information from the AST all the way to the linker
Information about the binding was not being properly communicated from
the front-end compiler to the linker.  As a result, the linker never
knew that any UBOs had explicit bindings!

Fixes the piglit test arb_shading_language_420pack-binding-layout.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76323
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: github@socker.lepus.uberspace.de [v0]
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
Cc: github@socker.lepus.uberspace.de
2014-04-11 12:26:01 -07:00
Ian Romanick
25a6656875 linker: Set binding for all elements of UBO array
Previously, a UBO like

    layout(binding=2) uniform U {
        ...
    } my_constants[4];

wouldn't get any bindings set.  The code would try to set the binding of
U, but that would fail.  It should instead set the bindings for U[0],
U[1], ...

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76323
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
Cc: github@socker.lepus.uberspace.de
2014-04-11 12:26:01 -07:00
Ian Romanick
cc42717b50 linker: Set block bindings based on UniformBlocks rather than UniformStorage
For blocks, gl_shader_program::UniformStorage isn't very useful.  The
names stored there are the names of the elements of the block, so
finding blocks with an instance name is hard.  There is also only one
entry in ::UniformStorage for each element of a block array, and that is
a deal breaker.

Using ::UniformBlocks is what _mesa_GetUniformBlockIndex does.  I
contemplated sharing code between set_block_binding and
_mesa_GetUniformBlockIndex, but building the stand-alone compiler and
the unit tests make this hard.  I plan to return to this effort shortly.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76323
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
Cc: github@socker.lepus.uberspace.de
2014-04-11 12:26:01 -07:00
Ian Romanick
157391a41b linker: Clean up "unused parameter" warnings
../../src/glsl/link_uniform_initializers.cpp:87:1: warning: unused parameter 'mem_ctx' [-Wunused-parameter]
../../src/glsl/link_uniform_initializers.cpp:87:1: warning: unused parameter 'type' [-Wunused-parameter]
../../src/glsl/link_uniform_initializers.cpp:127:1: warning: unused parameter 'mem_ctx' [-Wunused-parameter]
../../src/glsl/link_uniform_initializers.cpp:127:1: warning: unused parameter 'type' [-Wunused-parameter]

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76323
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
Cc: github@socker.lepus.uberspace.de
2014-04-11 12:26:01 -07:00
Ian Romanick
943b2d52bf linker: Fold set_uniform_binding into call site
In the next patch, we'll see that using
gl_shader_program::UniformStorage is not correct for uniform blocks.
That means we can't use ::UniformStorage to select between the sampler
path and the block path.  Instead we want to just use the type of the
variable.  That's never passed to set_uniform_binding, and it's easier
to just remove the function (especially for later patches in the series)
than to add another parameter.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76323
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
Cc: github@socker.lepus.uberspace.de
2014-04-11 12:26:01 -07:00
Ian Romanick
881c52f13f linker: Various trivial clean-ups in set_sampler_binding
- Remove the spurious block left from the previous commit and re-indent.

- Constify elements.

- Make the spec reference in the code look like other spec references in
  the compiler.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76323
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
Cc: github@socker.lepus.uberspace.de
2014-04-11 12:26:01 -07:00
Ian Romanick
6e2f63b69e linker: Split set_uniform_binding into separate functions for blocks and samplers
The two code paths are quite different, and there are some problems in
the handling of uniform blocks.  Future changes will cause these paths
to diverge further.  Ultimately, selecting between the two functions
will happen at the set_uniform_binding call site, and
set_uniform_binding will be deleted.

NOTE: This patch just moves code around.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76323
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
Cc: github@socker.lepus.uberspace.de
2014-04-11 12:26:01 -07:00
Heinrich Janzing
c8e7568f97 softpipe: fix shadow sampling
And remove nonsensical approximation of linear interpolation behavior
for shadow samplers.

Reviewed-by: Brian Paul <brianp@vmware.com>
Tested-by: Brian Paul <brianp@vmware.com>
2014-04-11 11:47:32 -06:00
Brian Paul
86b8843e9c softpipe: add PIPE_CAP_MIN/MAX_TEXTURE_GATHER_OFFSET query cases
To silence compiler warnings.

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-04-11 11:47:31 -06:00
Brian Paul
f61edd509b mesa: use _mesa_get_srgb_format_linear() in sRGB texstore functions
Instead of switch statements.

Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-04-11 11:47:31 -06:00
Brian Paul
c5631b341e swrast: use macros to initialize texfetch_funcs[] table
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-04-11 11:47:31 -06:00
Brian Paul
4da1efb370 swrast: fix more fetch_texel function names
These were missed/typo'd in the previous patch series:
s/R8G8B8A/R8G8B8A8/
s/rgba_16/RGBA_UNORM16/
s/rgba_uint/RGBA_UINT/
s/rgba_int/RGBA_SINT/

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-04-11 11:47:31 -06:00
José Fonseca
9d36a8d4d2 egl-static: Fix missing radeon_surface.h includes.
Fixes

  fatal error: radeon_surface.h: No such file or directory

when libdrm is not present, or non-Linux OSes.

Trivial.
2014-04-11 16:46:02 +01:00
Knut Andre Tidemann
5ac3435a47 gallium/radeon: fix missing winsys include in pipe-loader.
The commit 3b0b44f7de introduced a build
error:

error: dereferencing pointer to incomplete type

This patch fixes this issue in all the affected files.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-04-11 19:22:17 -04:00
Christian König
68bba1801e st/omx/enc: separate input buffer private and task structure
Keep tasks as linked list, this way we can associate
more than one encoding task with each buffer.

Signed-off-by: Christian König <christian.koenig@amd.com>
2014-04-11 11:35:03 +02:00
Christian König
7806dbeb70 radeon/vce: implement B-frame support
Signed-off-by: Slava Grigorev <slava.grigorev@amd.com>
Signed-off-by: Christian König <christian.koenig@amd.com>
2014-04-11 11:35:03 +02:00
Christian König
a56fa0e83b radeon/vce: add proper CPB backtrack
Remember what frames we encoded at which position.

Signed-off-by: Christian König <christian.koenig@amd.com>
2014-04-11 11:35:03 +02:00
Christian König
d7d41ce133 vl: add interface for H264 B-frame encoding
Signed-off-by: Christian König <christian.koenig@amd.com>
2014-04-11 11:35:03 +02:00
Christian König
ee4439c562 radeon/vce: remove RVCE_NUM_CPB_EXTRA_FRAMES
Doesn't seems to be needed any more.

Signed-off-by: Christian König <christian.koenig@amd.com>
2014-04-11 11:35:02 +02:00
Chris Forbes
ce57c8e925 docs/relnotes: Fix consistency, add i965 to ARB_buffer_storage.
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
2014-04-11 21:20:13 +12:00
Kenneth Graunke
227049098b i965: Fix missing _NEW_SCISSOR in Broadwell SF_CLIP_VIEWPORT state.
The _Xmin/_Xmax/_Ymin/_Ymax values need to be guarded by _NEW_SCISSOR.

Fixes Piglit's scissor-many, and rendering in GNOME Shell.
Hopefully fixes similar issues with Unity and ChromeOS.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=75879
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Tested-by: James Ausmus <james.ausmus@intel.com>
Tested-by: Timo Aaltonen <tjaalton@ubuntu.com>
2014-04-10 23:38:10 -07:00
Ilia Mirkin
31640f4c38 mesa/st: set min/max texture gather offset to driver-reported value
It was always getting set to -8/7 unconditionally.  Use the
driver-reported value instead.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-04-10 20:42:48 -04:00
Ilia Mirkin
c2f9ad5289 gallium: add a way to query min/max texture gather offsets
Defaults to providing the same offsets as MIN/MAX_TEXEL_OFFSET. For
nvc0, the offset can be -32/31.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-04-10 20:42:36 -04:00
Marek Olšák
8291f6d5c5 configure.ac: require libdrm_radeon 2.4.53
We need latest radeon_drm.h.
2014-04-10 21:24:50 +02:00
Marek Olšák
3b0b44f7de winsys/radeon: fix a race condition in initialization of radeon_winsys::screen
Create the screen in the winsys while the mutex is locked.
This also results in a nice code cleanup!

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2014-04-10 20:50:17 +02:00
Marek Olšák
ac330d4130 winsys/radeon: fix a race condition between winsys_create and winsys_destroy
This also hides the reference count from drivers.

v2: update the reference count while the mutex is locked in winsys_create

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2014-04-10 20:50:17 +02:00
Marek Olšák
7c57b01564 winsys/radeon: fix a race condition between 2 calls to radeon_winsys_create
This fixes random crashes of: piglit/glx-multithread-shader-compile.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2014-04-10 20:50:17 +02:00
Marek Olšák
b5ebfc33b8 winsys/radeon: remove unused radeon_info variables, move backend_map
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2014-04-10 20:50:17 +02:00
Marek Olšák
9b8449ae90 winsys/radeon: unify radeon_bo::flink and radeon_bo::name
Both contained the GEM flink name.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2014-04-10 20:50:17 +02:00
Marek Olšák
34564c8753 winsys/radeon: remove definitions already present in radeon_drm.h
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2014-04-10 20:50:17 +02:00
Marek Olšák
e3e05c6db9 winsys/radeon: handle squared micro tiling from GEM_GET_TILING
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2014-04-10 20:50:17 +02:00
Marek Olšák
38858207a1 gallium/u_gen_mipmap: rewrite using pipe->blit (v2)
This replaces u_gen_mipmap with an extremely simple implementation based
on pipe->blit. st/mesa is also cleaned up.

Pros:
- less code
- correct mipmap generation for NPOT 3D textures (u_blitter uses a better
  formula)
- queries are not affected by mipmap generation if drivers disable them

v2: add "first_layer", "last_layer" parameters, drop "face"
v2.1: add format
v2.2: document the format parameter
2014-04-10 20:50:16 +02:00
Marek Olšák
26c41398cc st/mesa: properly implement MapTextureImage with multiple mapped slices (v2)
This is needed by _mesa_generate_mipmap.

This adds an array of pipe_transfers to st_texture_image. Each transfer is
for mapping a single layer.

v2: allocate the array of transfers on demand
2014-04-10 20:50:16 +02:00
Brian Paul
5206d4bc09 mesa: remove the MALLOC, CALLOC and FREE macros
No longer used anywhere.  These also caused trouble in the Gallium
state tracker code where we include both core Mesa and Gallium util
headers (and the macros were defined differently in each world.)
Removing these macros should help avoid macro mix-ups in the future.

Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-10 07:53:12 -06:00
Brian Paul
7e55050301 xlib: s/FREE/free/
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-10 07:53:11 -06:00
Brian Paul
3b323c4d40 mesa: s/FREE/free/ in vdpau code
Reviewed-by: Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Christian König <christian.koenig@amd.com>
2014-04-10 07:53:11 -06:00
Brian Paul
00f31bdd32 mesa: s/FREE/free/ in _mesa_free_errors_data()
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-10 07:53:10 -06:00
Brian Paul
7fbb8ba499 mesa: use malloc/free instead of MALLOC/FREE in attrib stack code
We moved away from MALLOC/FREE in the rest of core Mesa a while ago.

Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-10 07:53:05 -06:00
Brian Paul
f9985db0bc st/mesa: fix sampler_view REALLOC/FREE macro mix-up
We were using REALLOC() from u_memory.h but FREE() from imports.h.
This mismatch caused us to trash the heap on Windows after we
deleted a texture object.

This fixes a regression from commit 6c59be7776.

Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2014-04-10 07:53:05 -06:00
Chris Forbes
87502bbcd7 docs: Expand ARB_gpu_shader5 to describe status of individual features
This extension is a huge grab-bag of "stuff that's in DX11". Break it
apart to make it clear what still needs to be done.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-04-10 18:52:03 +12:00
Chris Forbes
0d653b948f docs: Mark off ARB_texture_view and add to release notes for 10.2.
V4: Don't claim Gen8 yet.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Eric Anholt <eric@anholt.net>
2014-04-10 18:27:42 +12:00
Chris Forbes
2a2f8cd9d2 i965: Enable ARB_texture_view on Gen7
V4: Don't enable this for Gen8 yet -- that still needs wired up.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Eric Anholt <eric@anholt.net>
2014-04-10 18:27:42 +12:00
Chris Forbes
ea477817d7 i965: Account for view parameters in blit CTSI path
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Eric Anholt <eric@anholt.net>
2014-04-10 18:27:41 +12:00
Chris Forbes
01d6a2ad16 i965: Account for MinLayer/MinLevel in blorp CTSI path
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Eric Anholt <eric@anholt.net>
2014-04-10 18:27:41 +12:00
Chris Forbes
058f353a15 i965: Account for view parameters in fast depth clears
V2: - No need for layer_multiplier; multisampled depth surfaces are IMS.
    - Remove unused num_layers.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Eric Anholt <eric@anholt.net>
2014-04-10 18:27:41 +12:00
Chris Forbes
540d53d9b0 i965/blorp: Account for nonzero MinLayer in layered clears.
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Eric Anholt <eric@anholt.net>
2014-04-10 18:27:41 +12:00
Chris Forbes
d581247569 i965/blorp: Use irb->layer_count in clear
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Eric Anholt <eric@anholt.net>
2014-04-10 18:27:41 +12:00
Chris Forbes
98328e4c19 i965: Add layer_count to intel_renderbuffer
This is the effective layer count, for clears etc. This differs from the
depth of the miptree level when views are involved.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Eric Anholt <eric@anholt.net>
2014-04-10 18:27:41 +12:00
Chris Forbes
0a08147fcb i965: Pull out layer_multiplier in intel_update_renderbuffer_wrapper
We're about to need this in another place.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Eric Anholt <eric@anholt.net>
2014-04-10 18:27:41 +12:00
Chris Forbes
a76cde35d8 i965: Add layered parameter to intel_update_renderbuffer_wrapper
We're about to need this so we can determine the layer count of the
wrapper.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Eric Anholt <eric@anholt.net>
2014-04-10 18:27:41 +12:00
Chris Forbes
85dda825fe i965: Adjust renderbuffer wrapper to account for MinLevel/MinLayer
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Eric Anholt <eric@anholt.net>
2014-04-10 18:27:41 +12:00
Chris Forbes
24f490fb37 i965: Enable texture upload fast path with MinLevel
We'll still avoid MinLayer here since the fast path doesn't understand
arrays at all, but it's straightforward to do levels.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Eric Anholt <eric@anholt.net>
2014-04-10 18:27:41 +12:00
Chris Forbes
5de52541e5 i965: Account for MinLevel in texture upload fast path
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Eric Anholt <eric@anholt.net>
2014-04-10 18:27:41 +12:00
Chris Forbes
ba3499ba01 i965: Adjust map/unmap code for MinLevel/MinLayer
This allows core mesa's TexSubImage paths etc to work correctly
with views which have nonzero MinLevel or MinLayer.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Eric Anholt <eric@anholt.net>
2014-04-10 18:27:41 +12:00
Chris Forbes
ca1d1b2fc1 i965: Don't try to use fast upload path for nontrivial views
This will eventually be relaxed, but we'll get the fallback path
working first.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Eric Anholt <eric@anholt.net>
2014-04-10 18:27:41 +12:00
Chris Forbes
c9c08867ed i965: Adjust surface_state emission to account for view parameters
V4: Comment style, remove magic shift.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Eric Anholt <eric@anholt.net>
2014-04-10 18:27:41 +12:00
Chris Forbes
771c2ae0af i965: Add _Format to intel_texobj.
This is the actual mesa_format to use. In non-view cases this is always
the same as the mt's format.

V4: Comment style

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Eric Anholt <eric@anholt.net>
2014-04-10 18:27:41 +12:00
Chris Forbes
b7f011fdc9 i965: Add driver hook for TextureView
We need to wire the original texture's mt into the view. All the hard
work of setting up an appropriate tree of gl_texture_image structures
has already been done by core mesa.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Eric Anholt <eric@anholt.net>
2014-04-10 18:27:41 +12:00
Chris Forbes
93fa16bdd1 i965: Ensure that texture validation is skipped for immutable textures.
If we were to relayout the miptree, we'd break any views that are
sharing it.

(Simplified based on suggestions from Eric)

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Eric Anholt <eric@anholt.net>
2014-04-10 18:27:41 +12:00
Chris Forbes
a98b675945 i965: refactor format selection for unsupported ETC* formats
We will need to call this to munge view formats.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Eric Anholt <eric@anholt.net>
2014-04-10 18:27:40 +12:00
Chris Forbes
14c116433d i965: refactor format munging for separate stencil
We will need this for munging the view's format.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Eric Anholt <eric@anholt.net>
2014-04-10 18:27:40 +12:00
Chris Forbes
215c9432b9 i965: Include #slices in miptree debug
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Eric Anholt <eric@anholt.net>
2014-04-10 18:27:40 +12:00
Chris Forbes
c1b017472b mesa: Adjust _MaxLevel computation to account for views
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Eric Anholt <eric@anholt.net>
2014-04-10 18:27:40 +12:00
Chris Forbes
61e264f4fc mesa: Prefer non-swizzled formats for most sized internalformats
These formats can be cast to others (with different component types or
sizes) via ARB_texture_view or ARB_shader_image_load_store. We want
them to be laid out consistently so that we can just reinterpret the
memory with a different format.

In V1, this was done conditionally on a 'prefer_no_swizzle' flag which
was set in TexStorage/TextureView paths, but we need the same behavior
for ARB_shader_image_load_store (which also works with images created
via TexImage, so we don't want it to be conditional.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Eric Anholt <eric@anholt.net>
2014-04-10 18:27:40 +12:00
Chris Forbes
58790043bb i965: Render R8G8B8X8 as R8G8B8A8
The sampler can handle R8G8B8X8 (and substitute 1.0 for the fourth
component) but we can't use it as a render target.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Eric Anholt <eric@anholt.net>
2014-04-10 18:27:40 +12:00
Chris Forbes
50eed4eed5 i965: Pretend we don't support BRW_SURFACEFORMAT_R16G16B16_FLOAT for textures.
None of the other 3-component 16bpc formats are directly supported, so
they get promoted to XRGB equivalents. *Not* promoting RGB16F the same
way makes texture views much more fiddly -- we don't want to have to do
crazy copying behind the scenes.

(with my other master + my experimental ARB_texture_view support) fixes
the piglit test: `spec/ARB_texture_view/view compare 48bit formats`

No regressions in gpu.tests on Haswell.

V4: Don't alter the formats table -- just don't match it to a mesa_format. [Kenneth]

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Eric Anholt <eric@anholt.net>
2014-04-10 18:27:40 +12:00
Chris Forbes
66b0554fa6 i965: Enable R10G10B10A2_UNORM format
This is supported by all generations, and is required for memory layout
consistency for texture_view.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Eric Anholt <eric@anholt.net>
2014-04-10 18:27:40 +12:00
Chris Forbes
932a1eeac8 i965: Enable R8G8B8A8_UNORM_SRGB format
Now this is the preferred format for GL_SRGB8_ALPHA8.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Eric Anholt <eric@anholt.net>
2014-04-10 18:27:40 +12:00
Chris Forbes
6ef7205613 swrast: Add support for fetching from MESA_FORMAT_R10G10B10A2_UNORM
V4: Fix rebase conflicts with Brian's renaming of the texfetch
functions.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Acked-by: Eric Anholt <eric@anholt.net>
2014-04-10 18:27:40 +12:00
Chris Forbes
a421be1dcb mesa: fix packing of float texels to GL_SHORT/GL_BYTE
Previously, we would unpack the texels to floats using *_TO_FLOAT_TEX,
and then pack them into the desired format using FLOAT_TO_*. Unfortunately,
this isn't quite the inverse operation, and so some texel values would
end up off-by-one.

This fixes the GL_RGB8_SNORM and GL_RGB16_SNORM subcases in piglit's
arb_texture_view-format-consistency-get test on i965. The similar 1-, 2-
and 4-component cases already worked because they took the memcpy path
rather than repacking.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Eric Anholt <eric@anholt.net>
2014-04-10 18:27:40 +12:00
Michel Dänzer
ee2bcf38a4 r600g: Don't leak bytecode on shader compile failure
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=74868

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-04-10 14:00:43 +09:00
Emil Velikov
55f9bbd46c build: force .so extension for the gallium dri modules
While linux uses .so as a default extension for shared libraries that is
not the case for other platforms. The loader in libGL (and others) assumes
that the dri module will always have a .so extension, thus it will fail
to load on the affected platforms.

Spotted-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-04-09 22:12:36 +01:00
Jon TURNEY
92d0786f88 Partially revert bba9c28 "configure: use LIB_EXT rather than hardcoded .so"
Filenames passed to dlopen() don't need to use the platform's default extension
for shared libraries.

Using the '.so' extension when dlopen()ing DRI drivers is hardcoded into mesa
and the X server, so it should be hardcoded here in the Makefile as well.

A similar fix is probably also needed for gallium DRI drivers.

(Consider that if we were starting from scratch, perhaps we would use a custom
extension like .dri instead)

Cc: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-04-09 22:12:36 +01:00
Emil Velikov
56f531657c Partially revert "st/xa: Fix advertized version number and try to avoid future discrepancies"
This reverts commit 61bedc3d6b.

As the header is the one defining the API/ABI and is distributed
during installation, we should be using it rather than re-defining
the XA version in configure.ac.

Bump the version in the header to 2.2.0, to reflect what was the
original intent of commit 42158926c6.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
2014-04-09 22:12:35 +01:00
Emil Velikov
f9832f960f glx: drop obsolete _XUnlock_Mutex in __glXInitialize error path
With commit 1f1928db001(glx: Drop _Xglobal_lock while we create and
initialize glx display) we've split the big _Xglobal_lock handling in
a more fine grained manner.

Unfortunatelly we forgot to drop the unlock_mutex on the error paths,
leading to undefined behaviour as the mutex is already unlocked.

Cc: Kristian Høgsberg <krh@bitplanet.net>
Cc: "9.2 10.0 10.1"  <mesa-stable@lists.freedesktop.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-04-09 22:12:35 +01:00
Rob Clark
6afd7be132 freedreno/a3xx: assert() -> debug_assert()
We hit this assert with some piglit tests.  Which appears to be a bug
outside of freedreno.  Previously we were relying on assert() being
redefined to debug_assert() so that we didn't crash in release builds.
Somehow that stopped working.  So just use debug_assert() directly.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-04-09 16:37:04 -04:00
Brian Paul
e853ade544 svga: move LIST_INITHEAD(dirty_buffers) earlier in svga_context_create()
Fixes a crash in svga_context_flush_buffers() if we use the 'draw' module
for AA lines (when the device doesn't support that feature).  We need to
initialize this list before we setup the swtnl pieces.

Found/fixed by Charmaine Lee.

Cc: "10.0" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2014-04-09 12:02:03 -06:00
Kenneth Graunke
26ae030fcc i965: Stop advertising GL_MESA_ycbcr_texture.
The "new" fragment shader backend has never supported the necessary
color conversion code for this to work.  We began using the new backend
in Mesa 7.10 for GLSL (commit a81d423d93, October 2010),
and for ARB_fragment_program in Mesa 9.1 (commit 97615b2d8c,
August 2012).

I haven't heard any complaints, so I don't think anyone will miss this
feature.  I believe mplayer used it at one point, but these days
defaults to other paths anyway.

Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <idr@freedesktop.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-04-09 08:28:25 -07:00
Rob Clark
4a92c12232 freedreno/a3xx/compiler: add CEIL
fixes piglit glsl-fs-ceil

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-04-09 10:59:18 -04:00
Rob Clark
9604e31dc9 freedreno/a3xx/compiler: fix neg mov's
create_mov() was fixed up to handle neg/abs properly for interal mov's,
using absneg.f, but forgot to fix it for TGSI MOV's.  The problem with
using add.f to handle negated mov's is that we can only take a single
const reg src.  So:

  MOV TEMP[n], -CONST[m]

would turn into:

  add.f Rdst, (neg)CONST[m], 0.0

which would not work.  Anyways, just remove the extra code and always
use create_mov() which DTRT.

This fixes piglit vs-op-neg-int test.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-04-09 10:59:18 -04:00
Marek Olšák
4d641803e8 radeonsi: allow fast color clear and Hyper-Z with 1D-tiled surfaces on CIK
This depends on my kernel fix. Hyper-Z is still disabled by default.
2014-04-09 01:45:16 +02:00
Marek Olšák
fb5cf3490e r600g,radeonsi: add a bunch of useful queries for the HUD 2014-04-09 01:45:16 +02:00
Marek Olšák
4a5519f1e0 r600g,radeonsi: set correct initial domain for shared resources 2014-04-09 01:45:16 +02:00
Marek Olšák
5f7faff61b gallium/radeon: fix warnings 2014-04-09 01:45:16 +02:00
Iago Toral Quiroga
1a92637c68 tnl: Merge _tnl_vbo_draw_prims() into _tnl_draw_prims().
This should help prevent situations where we render without proper index
bounds. For example: https://bugs.freedesktop.org/show_bug.cgi?id=59455

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-04-08 15:10:10 -07:00
Topi Pohjolainen
2ffb50d77b i965: Remove unused sampler key fields
Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-08 13:34:59 -07:00
Brian Paul
6f059725fa mesa: move declaration before code in etc2_unpack_rgb8()
To fix MSVC build since cb4ad13685.
2014-04-08 14:17:40 -06:00
Kenneth Graunke
ec1baea95a i965: Delete "fast color clear unsupported" performance warning.
Applications frequently clear to colors other than 0.0 or 1.0, which
prevents us from doing fast color clears.  In that case, we issue this
performance warning on basically every glClear call, resulting in so
much spam that it's nearly impossible to see any other messages.

Plus, I don't think it's useful.  We aren't suggesting a better way to
do what the application developers want---we're just telling them it
would be faster to do something they don't want.

Driver developers have no control over the clear color, so this message
is totally useless to them.

A better alternative to get this sort of information is to use
INTEL_DEBUG=blorp, which tells you whether color clears were fast,
simd16 repdata, or slow.

v2: Rebase on has_color_component changes.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-04-08 13:09:46 -07:00
Rob Clark
ee839cc6ef freedreno/a3xx: deal with optimized tex instructions
Keep track of whether we actually have any sam instructions in the
resulting shader, rather than using TGSI SAMP declarations.  If the sam
instruction is optimized out, because the result is not used, we don't
want to emit texture state, etc.  In fact emitting sampler state and/or
setting PIXLODENABLE bit when there are no texture fetches seems to
cause lockup.

In theory this should never happen for a "normal" shader, unless the
state tracker is wonky.  But it is a very real possibility for binning
pass shaders.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-04-08 16:06:49 -04:00
Courtney Goeltzenleuchter
cb4ad13685 mesa: add bounds checking to eliminate buffer overrun
Decompressing ETC2 textures was causing intermitent segfault
by copying resulting 4x4 texel block to the destination texture
regardless of the size of the destination texture. Issue found
via application crash in GLBenchmark 3.0's Manhattan test.

v2: add more detail comment. Compute limit outside inner loops.
v3: add bugzilla reference
v4: Correct cc syntax in commit log
v5: really grab the right patch

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=74988
Cc: "9.2 10.0 10.1" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> [v1, suggested v2-3]
2014-04-08 12:55:25 -07:00
Leo Liu
a22d944fdb st/omx/enc: cleanup omx/vid_enc.c
cleanup by moving each step into a separate function

Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2014-04-08 17:51:19 +02:00
Christian König
5f374826f8 st/omx/enc: allocate input buffer private on demand
v2: move allocation to a function as first step
    to clean vid_enc_EncodeFrame

Signed-off-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Leo Liu <leo.liu@amd.com>
2014-04-08 17:51:15 +02:00
Brian Paul
9bb2ec6fd1 svga: replace sampler assertion with conditional
For TEX instructions, the set of samplers and sampler views should
be consistent.  The XA state tracker sometimes passes an inconsistent
set of samplers and sampler views.  Rather than assert and die, issue
a warning.

v2: add debugging code to detect inconsistent state.
v3: also check for null sampler in svga_state_tss.c

Cc: "10.0" "10.1" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
2014-04-08 08:45:18 -06:00
Chia-I Wu
4ddf51db6a i965/vec4: fix record clearing in copy propagation
Given

  mov vgrf7, vgrf9.xyxz
  add vgrf9.xyz, vgrf4.xyzw, vgrf5.xyzw
  add vgrf10.x, vgrf6.xyzw, vgrf7.wwww

the last instruction would be wrongly changed to

  add vgrf10.x, vgrf6.xyzw, vgrf9.zzzz

during copy propagation.

The issue is that when deciding if a record should be cleared, the old code
checked for

  inst->dst.writemask & (1 << ch)

instead of

  inst->dst.writemask & (1 << BRW_GET_SWZ(src->swizzle, ch))

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76749
Signed-off-by: Chia-I Wu <olv@lunarg.com>
Cc: Jordan Justen <jljusten@gmail.com>
Cc: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romainck <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Cc: "10.1" <mesa-stable@freedesktop.org>
2014-04-08 21:04:22 +08:00
Eric Anholt
57d6e7b7ee i965/vec4: Add a test for copy propagation behavior.
I thought I was seeing a bug in the code while reviewing, but it's not
there.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-04-08 00:59:48 -07:00
Eric Anholt
6230b646a5 i965/fs: Track whether we're doing dual source in a more obvious way.
I'm going to be turning dual_src_output into an array in a moment.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-08 00:59:48 -07:00
Eric Anholt
14b85e3a47 i965/fs: Add a couple more global special regs to special[]
Nothing bad came of this because they weren't used after visitor running,
but leaving them in a bad state seems like a recipe for pain later.

Suggested-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-08 00:59:48 -07:00
Eric Anholt
4303d26f93 i965/fs: Handle arrays of special regs more cleanly.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-08 00:59:48 -07:00
Eric Anholt
72b845e640 i965/fs: Fix dump_instructions() on uniforms.
All of a vec4 uniform was being printed as "u0"

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-08 00:59:48 -07:00
Eric Anholt
caa2605db5 i965/fs: Fix vgrf0 live interval when no interpolation was done.
When you've got a simple solid-color shader that doesn't generate
pixel_x/y interpolation, we were deciding that the first vgrf was both the
undefined pixel_x and pixel_y, and extending its live interval to avoid
the stride problem.  That tricked other optimization that tries to see if
a particular instruction is the last use of a variable.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-08 00:59:48 -07:00
Eric Anholt
cf40ebacb1 i965: Drop pointless check for variable declarations in splitting.
We're walking the whole instruction stream, so we know the declaration
will be found.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-08 00:59:48 -07:00
Eric Anholt
66b15ad9db i965: Remove stale comment.
We stopped doing variable index lowering for uniforms in
a64c1eb9b1, 5 months after the comment was
added.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-08 00:59:48 -07:00
Eric Anholt
8c2bfbc6b9 glsl: Move tree grafting's debug output to stderr.
The rest of our compiler dumps are there, now.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-08 00:59:48 -07:00
Eric Anholt
e9822f77a9 glsl: Skip making a temporary for assignments when we don't need one.
While we wish our optimization passes could identify all the cases where
we can coalesce our variables, we miss out on a lot of opportunities.

total instructions in shared programs: 1673849 -> 1673166 (-0.04%)
instructions in affected programs:     299521 -> 298838 (-0.23%)
GAINED:                                7
LOST:                                  0

Note that many programs are "hurt".  The notable ones are where we produce
unrolling in cases we didn't before (presumably just because of the lower
instruction count).  But there are also some cases where pushing things
right into the variables prevents copy propagation and tree grafting,
since we don't split our variable usage webs apart.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-08 00:59:47 -07:00
Iago Toral Quiroga
dff3439fef i915: Fix build error.
is_power_of_two() is now provided by mesa so its definition must be removed
from the i915 driver code.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-08 00:29:59 -07:00
Kenneth Graunke
73f80c20f6 glsl: Pass ctx->Const.NativeIntegers to do_algebraic.
The next patch will introduce an optimization that only works when
integers are not represented as floating point values.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-04-08 00:02:06 -07:00
Kenneth Graunke
169c645f12 glsl: Pass ctx->Const.NativeIntegers to do_common_optimization().
The next few patches will introduce an optimization that only works when
integers are not represented as floating point values.

v2: Re-word-wrap a line, as requested by Ian Romanick.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-04-08 00:02:03 -07:00
Kenneth Graunke
40d9337406 glsl: Validate that base types match for a number of binops.
The IR is not supposed to support implicit type conversions; we just
failed to validate it.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-04-08 00:02:01 -07:00
Kenneth Graunke
e14b93371c glsl: Fix lack of i2u in lower_ubo_reference.
ir_binop_ubo_load takes unsigned integer operands.  However, the array
index used to compute these offsets may be a signed integer.  (For
example, see Piglit's spec/glsl-1.40/uniform_buffer/fs-bvec-array).

For some reason, we were missing an ir_binop_i2u cast, and ir_validator
was failing to catch that.

Without this change, ir_builder's type inference code broke for me when
writing a new optimization pass.

Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-04-08 00:01:58 -07:00
Kenneth Graunke
4311f9878d i965/fs: Skip emitting MACH/MOV for small integers.
The vector backend already implemented this optimization, but
surprisingly, we never bothered to implement it in the scalar backend.

In addition to saving two instructions, this eliminates a use of the
accumulator as an explicit source, which is unsupported in SIMD16 mode
on Gen7+, which could help us gain SIMD16 programs.

Cuts 19.23% of the instructions in dolphin/efb2ram.shader_test.

v2: Rebase on is_16bit_integer_constant -> is_uint16_constant rename.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-04-08 00:01:55 -07:00
Kenneth Graunke
7540be22d1 glsl: Make is_16bit_constant from i965 an ir_constant method.
The i965 MUL instruction doesn't natively support 32-bit by 32-bit
integer multiplication; additional instructions (MACH/MOV) are required.
However, we can avoid those if we know one of the operands can be
represented in 16 bits or less.  The vector backend's is_16bit_constant
static helper function checks for this.

We want to be able to use it in the scalar backend as well, which means
moving the function to a more generally-usable location.  Since it isn't
i965 specific, I decided to make it an ir_constant method, in case it
ends up being useful to other people as well.

v2: Rename from is_16bit_integer_constant to is_uint16_constant, as
    suggested by Ilia Mirkin.  Update comments to clarify that it does
    apply to both int and uint types, as long as the value is
    non-negative and fits in 16-bits.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-04-08 00:01:53 -07:00
Kenneth Graunke
bd69f65f90 mesa: Move is_power_of_two() function from brw_context.h to macros.h.
This makes the function available from core Mesa code, including the
GLSL compiler.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-04-08 00:01:51 -07:00
Kenneth Graunke
6bda3a5267 i965: Fix "SIMD16 unsupported" messages via KHR_debug.
Performance warnings are logged via KHR_debug in addition to when the
INTEL_DEBUG=perf environment variable is set.  Without this, messages in
debug contexts would have "(null)" for the reason.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-04-08 00:01:34 -07:00
Kenneth Graunke
ee12a03805 i965: Fix missing dirty bits in the gen8_sbe_state atom.
These are clearly needed---the comments in the function are even present
for each one of them.   I originally had two separate state atoms for
3DSTATE_SBE and 3DSTATE_SBE_SWIZ.  When I combined the functions, I must
have forgotten to add the atoms for 3DSTATE_SBE_SWIZ.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-04-07 23:37:18 -07:00
Kenneth Graunke
47682f2ca1 i965: Drop BRW_NEW_RASTERIZER_DISCARD flag from Broadwell SOL atom.
Nothing actually uses this---we handle rasterizer discard in the
clipper in order for statistics counters to work.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-04-07 23:37:16 -07:00
Kenneth Graunke
f68353c57c i965: Use the correct program when uploading Broadwell SOL state.
This is the equivalent of commit 43e77215b1.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-04-07 23:36:19 -07:00
Thomas Hellstrom
47f60cbb71 st/xa: Make sure unused samplers are set to NULL
renderer_copy_prepare was setting the first sampler but never telling
the cso code how many samplers were actually used. Fix this.

Cc: "10.1" <mesa-stable@freedesktop.org>
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-04-07 22:34:10 -07:00
Thomas Hellstrom
e5d2c5b899 st/xa: Bind destination before setting new state
Binding a new destination may cause the svga driver to emit draw calls
while propagating the surface. Make sure this doesn't happen in the middle
of sampler state setup where state may be incosistent.

In practice, surface propagation should never happen here and even if it did,
it wouldn't be a valid reason for the svga driver to emit partially set up
state, but to avoid future uncertainties, make sure this doesn't happen
anyway.

Found while auditing the state tracker for inconsistent sampler state /
sampler view setup.

Cc: "10.1" <mesa-stable@freedesktop.org>
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2014-04-07 22:34:10 -07:00
Eric Anholt
34f15903d6 glapi: Fix libglapi build.
This line appears to have been accidentally dropped from the last commit,
and the resulting libglapi was missing symbols.
2014-04-07 14:34:49 -07:00
Matt Turner
144bbb7b78 glapi/build: Add headers to distribution.
Acked-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-04-07 09:45:26 -07:00
Matt Turner
fbca1ab780 glapi/gen: Ship more Python files
Acked-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-04-07 09:45:19 -07:00
Matt Turner
b0f37a6bd2 glapi/gen: Ship XML and Python files
Acked-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-04-07 09:43:21 -07:00
Matt Turner
f76ac9c9a6 glapi/gen: Add missing XML files to API_XML
Also (re)move XML files from COMMON to API_XML.

Acked-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-04-07 09:43:21 -07:00
Matt Turner
cdc3a6bb21 src/build: Add getopt to distribution.
Acked-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-04-07 09:41:02 -07:00
Matt Turner
a97611313d gbm/build: Add headers to distribution.
Acked-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-04-07 09:41:01 -07:00
Matt Turner
3f64c3d591 egl/build: Sort egl sources alphabetically.
Acked-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-04-07 09:41:00 -07:00
Matt Turner
5ae2f28ca7 egl/build: Remove unused -DXF86VIDMODE.
Acked-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-04-07 09:40:58 -07:00
Matt Turner
5074117928 egl/build: Include headers and XML in distribution.
Acked-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-04-07 09:40:57 -07:00
Matt Turner
1d4007fbd9 egl/build: Drop two unnecessary Makefiles.
Acked-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-04-07 09:40:31 -07:00
Matt Turner
5c770ba919 i965/fs: Remove left-over 'removed' variable.
I think this was used for coalescing out partly dead large virtual
registers, but the patch that enabled that caused regressions and didn't
make it upstream.

Reviewed-by: Eric Anholt <eric@anholt.net>
2014-04-07 10:29:43 -07:00
Matt Turner
99437b730f i965/fs: Check for interference after finding all channels.
It's more likely that we won't find writes to all channels than one will
interfere, and calculating interference is more expensive. This change
will also help prepare for coalescing load_payload instructions'
operands.

Also update the live intervals for all channels, and not just the last
that we saw.

Reviewed-by: Eric Anholt <eric@anholt.net>
2014-04-07 10:29:22 -07:00
Jordan Justen
70285f607c i965: initialize more device info fields for Cherryview
The intent in 9b6b084eb7 was
for urb .size and .min_vs_entries fields to use the values
from the GEN8_FEATURES macro.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-07 09:52:32 -07:00
Brian Paul
d3ef6f5427 swrast: reindent s_texfetch_temp.h, remove trailing whitespace
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-04-07 09:21:27 -06:00
Brian Paul
a19d60faef swrast: remove out of date comments in s_texfetch_tmp.h
The comments were out of date and redundant (the functions are
pretty much self-explanatory).

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-04-07 09:21:27 -06:00
Brian Paul
56db16fb5b swrast: rename texture fetch functions (pt. 7)
sed commands:
s/f_z24_s8/S8_UINT_Z24_UNORM/g
s/f_s8_z24/Z24_UNORM_S8_UINT/g
s/f_z16/Z_UNORM16/g
s/f_z32/Z_UNORM32/g
s/z32f_x24s8/Z32_FLOAT_S8X24_UINT/g
s/f_ycbcr_rev/YCBCR_REV/g
s/f_ycbcr/YCBCR/g
s/dudv8/DUDV8/g

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-04-07 09:21:27 -06:00
Brian Paul
d41fe0aec2 swrast: rename texture fetch functions (pt. 6)
sed commands:
s/rgb9_e5/R9G9B9E5_FLOAT/g
s/r11_g11_b10f/R11G11B10_FLOAT/g
s/f_alpha_f16/A_FLOAT16/g
s/f_alpha_f32/A_FLOAT32/g
s/f_luminance_f16/L_FLOAT16/g
s/f_luminance_f32/L_FLOAT32/g
s/f_luminance_alpha_f16/LA_FLOAT16/g
s/f_luminance_alpha_f32/LA_FLOAT32/g
s/f_intensity_f16/I_FLOAT16/g
s/f_intensity_f32/I_FLOAT32/g
s/f_r_f16/R_FLOAT16/g
s/f_r_f32/R_FLOAT32/g
s/f_rg_f16/RG_FLOAT16/g
s/f_rg_f32/RG_FLOAT32/g
s/f_rgb_f16/RGB_FLOAT16/g
s/f_rgb_f32/RGB_FLOAT32/g
s/f_rgba_f16/RGBA_FLOAT16/g
s/f_rgba_f32/RGBA_FLOAT32/g
s/xbgr16161616_float/RGBX_FLOAT16/g
s/xbgr32323232_float/RGBX_FLOAT32/g

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-04-07 09:21:26 -06:00
Brian Paul
9eb45114fd swrast: rename texture fetch functions (pt. 5)
sed commands:
s/srgba8/A8B8G8R8_SRGB/g
s/sargb8/B8G8R8A8_SRGB/g
s/sabgr8/R8G8B8A8_SRGB/g
s/sxbgr8/R8G8B8X8_SRGB/g
s/sla8/L8A8_SRGB/g
s/sl8/L_SRGB8/g
s/srgb8/BGR_SRGB8/g

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-04-07 09:21:26 -06:00
Brian Paul
faa8a8e8b2 swrast: rename texture fetch functions (pt. 4)
sed commands:
s/signed_rg1616/R16G16_SNORM/g
s/signed_rg88_rev/R8G8_SNORM/g
s/signed_al88/L8A8_SNORM/g
s/signed_a8/A_SNORM8/g
s/signed_a16/A_SNORM16/g
s/signed_l8/L_SNORM8/g
s/signed_l16/L_SNORM16/g
s/signed_i8/I_SNORM8/g
s/signed_i16/I_SNORM16/g
s/signed_r8/R_SNORM8/g
s/signed_r16/R_SNORM16/g
s/signed_al1616/LA_SNORM16/g
s/signed_rgb_16/RGB_SNORM16/g
s/signed_rgba_16/RGBA_SNORM16/g

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-04-07 09:21:26 -06:00
Brian Paul
a401362019 swrast: rename texture fetch functions (pt. 3)
Rename functions to match format names.

sed commands:
s/f_rg1616_rev/G16R16_UNORM/g
s/f_rg1616/R16G16_UNORM/g
s/f_argb2101010/B10G10R10A2_UNORM/g
s/f_a8/A_UNORM8/g
s/f_a16/A_UNORM16/g
s/f_i8/I_UNORM8/g
s/f_i16/I_UNORM16/g
s/f_r8/R_UNORM8/g
s/f_r16/R_UNORM16/g
s/f_rgb888/BGR_UNORM8/g
s/f_bgr888/RGB_UNORM8/g
s/f_l8/L_UNORM8/g
s/f_l16/L_UNORM16/g
s/xbgr16161616_unorm/RGBX_UNORM16/g

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-04-07 09:21:26 -06:00
Brian Paul
e4ebb24b35 swrast: rename texture fetch functions (pt. 2)
Rename functions to match format names.

sed commands:
s/f_al1616_rev/A16L16_UNORM/g
s/f_al1616/L16A16_UNORM/g
s/f_rgb565_rev/R5G6B5_UNORM/g
s/f_rgb565/B5G6R5_UNORM/g
s/f_argb4444_rev/A4R4G4B4_UNORM/g
s/f_argb4444/B4G4R4A4_UNORM/g
s/f_rgba5551/A1B5G5R5_UNORM/g
s/f_argb1555_rev/A1R5G5B5_UNORM/g
s/f_al88_rev/A8L8_UNORM/g
s/f_al88/L8A8_UNORM/g
s/f_gr88/R8G8_UNORM/g
s/f_rg88/G8R8_UNORM/g
s/f_al44/L4A4_UNORM/g
s/f_rgb332/B2G3R3_UNORM/g

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-04-07 09:21:25 -06:00
Brian Paul
fde3258389 swrast: rename texture fetch functions (pt. 1)
Rename functions to match format names.

sed commands:
s/signed_rgba8888_rev/R8G8B8A8_SNORM/g
s/signed_rgba8888/A8B8G8R8_SNORM/g
s/f_rgba8888_rev/R8G8B8A_UNORM/g
s/f_rgba8888/A8B8G8R8_UNORM/g
s/f_rgbx8888_rev/R8G8B8X8_UNORM/g
s/f_rgbx8888/X8B8G8R8_UNORM/g
s/f_argb8888_rev/A8R8G8B8_UNORM/g
s/f_argb8888/B8G8R8A8_UNORM/g
s/f_xrgb8888_rev/X8R8G8B8_UNORM/g
s/f_xrgb8888/B8G8R8X8_UNORM/g
s/signed_rgbx8888/X8B8G8R8_SNORM/g

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-04-07 09:21:25 -06:00
Brian Paul
e0fafd1913 mesa: rename stencil/Z functions in format_unpack.c
So the function names match the format names.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-04-07 09:21:24 -06:00
Ilia Mirkin
89c5b56be6 nouveau: fix firmware check on nvd7/nvd9
The kernel driver expects the class to be based on chipset generation
rather than VP generation. Make sure to pass 90b1 for NVDX chipsets
instead of 95b1.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77102
Fixes: 40dd777b33
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.1 10.0" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@ubunutu.com>
2014-04-07 08:58:15 -04:00
Thomas Hellstrom
2f6fcd65f2 winsys/svga: Fix prime surface references also for guest-backed surfaces
Implement guest-backed surface sharing using prime fds. Previously only
legacy surfaces could use this functionality. Also use the vmwgfx 2.6
single-ioctl prime fd reference if available.

Cc: "10.1" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2014-04-07 03:34:52 -07:00
Thomas Hellstrom
0887b499e9 winsys/svga: Update the vmwgfx_drm.h header to latest version from kernel
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2014-04-07 03:34:47 -07:00
Ilia Mirkin
159cec9dec docs: mark ARB_texture_gather as done on nvc0
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-04-07 01:06:19 -04:00
Ilia Mirkin
f6579e4b17 nvc0: add support for texture gather
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-04-07 01:06:19 -04:00
Ilia Mirkin
91900c6d33 docs: mark ARB_texture_query_lod as done for nv50, nvc0
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-04-07 01:06:18 -04:00
Ilia Mirkin
423f64e83a nvc0: enable texture query lod
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-04-07 01:06:18 -04:00
Ilia Mirkin
d5faf8e786 nv50: enable texture query lod
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-04-07 01:06:18 -04:00
Dave Airlie
4dc13e3c71 st/mesa: add support for ARB_texture_query_lod
Add support for the LODQ texture instruction.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-04-07 01:06:18 -04:00
Dave Airlie
be5276ae7d gallium: add support for LODQ opcodes.
This opcode provide support for GL_ARB_texture_query_lod,

Signed-off-by: Dave Airlie <airlied@redhat.com>
[imirkin: rebase, docs update]
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-04-07 01:06:18 -04:00
Matt Turner
5d0b3ec4ae i965/vec4: Allow constant propagation into dot product.
total instructions in shared programs: 1667088 -> 1667055 (-0.00%)
instructions in affected programs:     3362 -> 3329 (-0.98%)

Reviewed-by: Eric Anholt <eric@anholt.net>
2014-04-05 09:52:54 -07:00
Matt Turner
34ec1a24d6 glsl: Optimize (x + y cmp 0) into (x cmp -y).
Cuts a small handful of instructions in Serious Sam 3:

instructions in affected programs:     4692 -> 4666 (-0.55%)

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-04-05 09:47:37 -07:00
Matt Turner
6499ecafa5 i965/fs: Split out can_coalesce_vars() function.
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-04-05 09:47:37 -07:00
Matt Turner
29841fbe20 i965/fs: Split out is_coalesce_candidate() function.
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-04-05 09:47:37 -07:00
Matt Turner
0fbcdec2f6 i965/fs: Split fs_visitor::register_coalesce() into its own file.
The function has gotten large, and brw_fs.cpp is the largest source file
in the driver.

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-04-05 09:47:37 -07:00
Matt Turner
8b1ab5c93b i965/fs: Mark appropriate fs_inst members as const.
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-04-05 09:47:36 -07:00
Matt Turner
39ecfca121 i965: Mark is_tex() and friends as const.
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-04-05 09:47:36 -07:00
Matt Turner
92d03f7f28 i965/fs: Don't propagate saturation modifiers if there are source modifiers.
Which would lead to translating

   mad     vgrf9:F,  vgrf3:F, u0:F, vgrf6:F
   mov.sat vgrf7:F, -vgrf9:F

into

   mad.sat vgrf9:F,  vgrf3:F, u0:F, vgrf6:F
   mov     vgrf7:F, -vgrf9:F

Fixes some lighting effects in Dota2.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76749
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-04-05 09:47:36 -07:00
Matt Turner
7a7b8a02be i965/fs: Don't propagate saturate modifiers into partial writes.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-04-05 09:47:36 -07:00
Matt Turner
86ae6f477d i965/fs: Fix off-by-one in saturate propagation.
ip needs to be initialized to start_ip - 1, since the first thing in the
main loop is ip++. Otherwise we would incorrectly propagate the saturate
from the mov to the mad:

   mad     a, b, c, d
   mov.sat x, a
   add     y, z, a

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-04-05 09:47:36 -07:00
Matt Turner
20dee82a75 i965/vec4: Consider sources of non-GRF-dst instructions for dead channels.
Previously we'd ignore the sources of instructions with non-GRF
destinations when calculating calculating the dead channels. This would
lead to us incorrectly removing the first instruction in this sequence:

   mov vgrf11, ...
   cmp.ne.f0 null, vgrf11, 1.0
   mov vgrf11, ...

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76616
2014-04-05 09:47:36 -07:00
Matt Turner
63d57f3b08 i965/fs: Name temporary ralloc contexts something other than mem_ctx.
Or else poor programmers might mistakenly use the temporary mem_ctx,
instead of the fs_visitor's mem_ctx and wonder why their code is
crashing.

Also remove the parenting. These contexts are local to the optimization
passes they're in and are freed at the end.
2014-04-05 09:44:54 -07:00
Matt Turner
26012c1673 i965/fs: Recalculate live intervals in calculate_register_pressure().
Otherwise calling dump_instructions() after declaring a new fs_reg would
segfault when calculate_register_pressure()'s loop over reg walked off
the end of the virtual_grf_start[] array that calculate_live_intervals()
would have reallocated for you, if it had known there was a new
register.
2014-04-05 09:44:54 -07:00
Jonathan Gray
c973e440d5 egl/dri2: use drm macros to construct device name
Don't hardcode /dev/dri/card0 but instead use the drm
macros which allows the correct /dev/drm0 device to be
opened on OpenBSD.

v2: use snprintf and fallback to /dev/dri/card0
v3: check for snprintf truncation

Signed-off-by: Jonathan Gray <jsg@jsg.id.au>
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-04-05 13:36:29 +01:00
Jonathan Gray
81799c82e4 configure: don't require libudev for gbm or egl drm/wayland
After the loader changes libudev is no longer required for
gbm or the egl drm/wayland platforms.  Lets these build/run
on OpenBSD.

v2: preserve the libudev requirement for Linux as suggested
by Emil Velikov.

Signed-off-by: Jonathan Gray <jsg@jsg.id.au>
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-04-05 13:35:25 +01:00
Jonathan Gray
0295953c5d egl/dri2: don't require libudev to build drm/wayland platforms
After the loader changes libudev is no longer required to
build gbm or the egl drm/wayland platforms.

Remove a libudev ifdef which allows the the drm egl driver
to be loaded on OpenBSD.

Signed-off-by: Jonathan Gray <jsg@jsg.id.au>
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-04-05 13:33:48 +01:00
Jonathan Gray
11623be934 automake: don't enable -Wl,--no-undefined on OpenBSD
OpenBSD does not have DT_NEEDED entries for libc by design,
over concerns how the symbols would be referenced after
changing the major version of the library.

So avoid -no-undefined checks on OpenBSD as they will fail.

v2: don't include the -no-undefined libtool option in the variable
    and change -Wl,--no-undefined references in Automake.inc as well.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76856
Signed-off-by: Jonathan Gray <jsg@jsg.id.au>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-04-05 13:30:27 +01:00
Emil Velikov
e4bd00c1c6 targets/dri: move common libraries to GALLIUM_DRI_LIB_DEPS
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-04-05 13:02:54 +01:00
Emil Velikov
fc91e7e4ae targets/omx: use GALLIUM_COMMON_LIB_DEPS
The targets do not require expat or selinux. Use GALLIUM_COMMON_LIB_DEPS
which provides the core requirements for each gallium target.

Cc: Christian König <christian.koenig@amd.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-04-05 13:02:48 +01:00
Emil Velikov
6b41043050 targets/xvmc: use GALLIUM_COMMON_LIB_DEPS
The targets do not require expat or selinux. Use GALLIUM_COMMON_LIB_DEPS
which provides the core requirements for each gallium target.

Cc: Christian König <christian.koenig@amd.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-04-05 13:02:46 +01:00
Emil Velikov
432b5776f2 r600/omx: drop -lstdc++ hack
The build system will use g++ to link the static library due to the
dummy.cpp source(s). Thus one does not need the explicit link against
stdc++.

Cc: Christian König <christian.koenig@amd.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-04-05 13:02:30 +01:00
Emil Velikov
28a4276442 drivers/nouveau: mention dummy.cpp to use g++ linker
The build system does not know that the static library is C++.
Mention the cpp file to trigger generation of the proper variable
and drop the hacky stdc++ linking.

Cc: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-04-05 13:00:32 +01:00
Emil Velikov
16372969c7 drivers/nouveau: use GALLIUM_COMMON_LIB_DEPS
Cc: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-04-05 13:00:14 +01:00
Emil Velikov
c8129604ef drivers/r300: use GALLIUM_COMMON_LIB_DEPS
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76848
Tested-by: Vinson Lee <vlee@freedesktop.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-04-05 13:00:07 +01:00
Emil Velikov
ba5eba5008 automake: introduce GALLIUM_COMMON_LIB_DEPS
Rather than copying the core four dependencies all over gallium,
introduce the above variable to avoid all the duplication.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76848
Tested-by: Vinson Lee <vlee@freedesktop.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-04-05 13:00:02 +01:00
Emil Velikov
16c13aaeb8 automake: move GALLIUM_DRI_LIB_DEPS to Automake.inc
With recent commit we started de-duplicating all of the compiler/
linker flags moving their handling inside Automake.inc.

This did not take into consideration that the above variable was set
at configure time, leading to issues on certain build combinations.

Move the variable to where it's used/handled thus cleaning up
configure.ac.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76848
Tested-by: Vinson Lee <vlee@freedesktop.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-04-05 12:59:44 +01:00
Johannes Nixdorf
476db98e03 configure.ac: fix the detection of expat with pkg-config
The pkg-config module was called "EXPAT" instead of "expat" in
PKG_CHECK_EXISTS. This seems to have been wrong because the wrong
argument was copied from PKG_CHECK_MODULES.

Cc: "10.0" "10.1" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-04-05 12:24:01 +01:00
Jonathan Gray
1cc742d912 megadriver_stub.c: don't use _GNU_SOURCE to gate the compat code
_GNU_SOURCE is only set/required for linux*|*-gnu*|gnu*) and as the
functionality is available on other systems check for RTLD_DEFAULT instead.

Signed-off-by: Jonathan Gray <jsg@jsg.id.au>
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-04-05 12:21:31 +01:00
Jonathan Gray
380f05ccc3 loader: don't limit the non-udev path to only android
Platforms that lack libudev (OpenBSD and possibly others) need
this change in order to load the correct dri driver.
Under linux we unconditionally require libudev, thus this code
will never get build.

v2: Add commit message (Emil Velikov)

Signed-off-by: Jonathan Gray <jsg@jsg.id.au>
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-04-05 12:17:28 +01:00
Jonathan Gray
727f54a76e loader: use 0 instead of FALSE which isn't defined
Signed-off-by: Jonathan Gray <jsg@jsg.id.au>
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-04-05 12:16:45 +01:00
Francisco Jerez
4ccff1499c clover: Document that the *obj*() helpers already take care of object validation. 2014-04-05 12:18:29 +02:00
Matt Turner
489cb0b2d1 i965: Mark SNB GT1 as a GT1.
brw->gt only seems to be used on gen >= 7, so this shouldn't have any
effect.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-04-04 15:07:41 -07:00
Marek Olšák
78f754b739 gallium/u_blitter: implement scaled blitting in the Z direction
So that pipe->blit can be used for 3D mipmap generation.
2014-04-04 19:38:36 +02:00
Marek Olšák
8ab7bb4707 gallium/u_blitter: don't adjust cubemap coordinates by a small number
It may cause issues with mipmap generation.
I think it was used to make some piglit tests pass on r300g.
2014-04-04 19:38:36 +02:00
Leo Liu
0817182b2f Revert "radeon: just don't map VRAM buffers at all"
This reverts commit 96e8b916a7.
In the case of VCE encoding with raw YUV file, CPU load directly
to VRAM is faster than combination of CPU writing to GTT and
then blit to VRAM with GPU.

Reviewed-by: Christian König <christian.koenig@amd.com>
2014-04-04 16:21:04 +02:00
Leo Liu
de1a59b7a7 radeon/vce: cleanup cpb handling
v2: fix whitespace errors, minor coding style changes

Signed-off-by: Leo Liu <leo.liu@amd.com>
Signed-off-by: Christian König <christian.koenig@amd.com>
2014-04-04 12:35:55 +02:00
Christian König
6c59be7776 st/mesa: improve sampler view handling
Keep a dynamically increasing array of all the views
created for a texture instead of just the last one.

v2: add comments, fix array size calculation,
    release only the first sampler view found

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-04-04 10:25:35 +02:00
Thomas Hellstrom
61bedc3d6b st/xa: Fix advertized version number and try to avoid future discrepancies
The xa version number had to be set in two places. In configure.ac and in
xa_tracker.h. Furthermore, xa_tracker.h is an installed header so we can't
use mesa internal defines. So therefore, at configure time, modify the
xa_tracker.h header to use the version given by configure.ac

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Rob Clark <robdclark@gmail.com>
2014-04-04 08:33:43 +02:00
Ian Romanick
4fa58ae5c7 glapi: Fix make check
/me puts a paper bag on his head and sits in the corner.

This was supposed to be included in 5a68f731, which added
glPointSizePointerOES back to the list of functions exposed by
libGLESv1_CM.  It looks like it was an uncommitted change in my tree
when I sent the patch out.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-04-03 20:12:19 -07:00
Brian Paul
177c9be615 llvmpipe: remove no-op checks in sampler, sampler_view functions
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2014-04-03 20:05:56 -06:00
Brian Paul
61a3e9936c softpipe: remove no-op checks in sampler, sampler_view functions
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2014-04-03 19:39:23 -06:00
Brian Paul
4105ad825f svga: remove no-op checks in sampler, sampler_view functions
We are checking for no-ops in the CSO module for both of these items
so there's no reason to do it in the driver.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2014-04-03 19:39:23 -06:00
Brian Paul
5a2f8b2c48 cso: check for no sampler view changes in cso_set_sampler_views()
As we do for sampler states in single_sampler_done() and many other
CSO functions.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-04-03 19:39:23 -06:00
Timothy Arceri
ffa39ab067 docs: Add note about updating tests to dev info
Signed-off-by: Timothy Arceri <t_arceri@yahoo.com.au>
2014-04-04 06:48:11 +11:00
José Fonseca
c6050ce7da st/wgl: Remove wgl*Gallium*MESA().
These were only used by the Python state tracker, which was removed, hence
they have no practical use.

Reviewed-by: Brian Paul <brianp@vmware.com>
2014-04-03 12:52:09 +01:00
Ian Romanick
572a25be2f glapi: Fix scons build
Put the -c in the correct place (and match Makefile.am).

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76960
Tested-by: Vinson Lee <vlee@freedesktop.org>
Signed-off-by: José Fonseca <jfonseca@vmware.com>
2014-04-03 12:52:09 +01:00
Adel Gadllah
d120506e15 glx: Do not advertise buffer_age on dri2
Previously GLX_EXT_buffer_age has always been advertised as supported because
both client_glx_support and client_glx_only where set. So it did not matter
that direct_support is only set when running dri3 and we ended up always
advertising it.

Fix that by not setting client_glx_only for buffer_age in known_glx_extensions.

Signed-off-by: Adel Gadllah <adel.gadllah@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-04-02 21:28:26 +01:00
Brian Paul
2355a64414 cso: fix sampler view count in cso_set_sampler_views()
We want to call pipe->set_sampler_views() with count being the
maximum of the old number of sampler views and the new number.
This makes sure we null-out any old sampler views.

We already do the same thing for sampler states in single_sampler_done().
Fixes some assertions seen in the VMware driver with XA tracker.

Cc: "10.0" "10.1" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
Tested-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-04-02 13:58:05 -06:00
Ian Romanick
5a68f73102 glapi: Add static dispatch for glPointSizePointerOES
The OpenGL ES 1.1 conformance tests expect this function to be
statically available form libGLESv1_CM.so.  The comment "required for
es1.1" in the XML file should have been a clue.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76926
Reviewed-by: Matt Turner <mattst88@gmail.com>
Tested-by: Lu Hua <huax.lu@intel.com>
2014-04-02 11:30:52 -07:00
Ian Romanick
065ca63043 Revert "Revert "glapi/es1: Don't mark core functions as static_dispatch=false""
This reverts commit 526e49290c.

The original build problem should be fixed by the previous commit.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Tested-by: Brian Paul <brianp@vmware.com>
Tested-by: Lu Hua <huax.lu@intel.com>
2014-04-02 11:30:49 -07:00
Ian Romanick
cecffa08d1 glapi: Enable ES compatibility mode
Ages ago Chia-I added an ES compatibility flag to several of the various
generator scripts.  The intention was to bridge differences between ES
and desktop in Mesa builds without ES.  It doesn't appear that it has
ever been used.  Recent changes to static_dispatch status of several ES1
functions caused problems in desktop-only, non-shared-glapi builds.
Enabling the ES compatibility mode appears to fix these build problems.

This is kind of a duct tape solution to this problem.  As I mentioned in
the cover letter for the series that triggered the build problem, I
would like to make some major changes to the generator architecture and
the XML.  The whole point of the proposed architecture changes is to
better handle the differences between desktop GL and ES.  I think duct
tape is okay for now.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76869
Tested-by: Brian Paul <brianp@vmware.com>
Tested-by: Lu Hua <huax.lu@intel.com>
Cc: Vinson Lee <vlee@freedesktop.org>
Cc: Chia-I Wu <olv@lunarg.com>
2014-04-02 11:30:45 -07:00
Ian Romanick
8e3a7c6204 glapi: Fix build break in 'make check' on non-shared-glapi builds
Commit fb78fa58 made the GL_ARB_debug_output functions aliases of the
GL_KHR_debug output functions.  As a result, the function names in
struct _glapi_table also changed.  The table in check_table.cpp used the
ARB names.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Timothy Arceri <t_arceri@yahoo.com.au>
Tested-by: Brian Paul <brianp@vmware.com>
Tested-by: Lu Hua <huax.lu@intel.com>
Cc: Vinson Lee <vlee@freedesktop.org>
2014-04-02 11:30:42 -07:00
Ian Romanick
4e18279fae glapi: Remove support for "short string" mode
C89 has a fairly short minimum-maximum string length.  To support
compilers limited by the C89 limits, this script had a mode where it
would generate a character array instead of a giant string.  These were
functionally the same, but the code generated for the character array is
HUGE and difficult to read.

As far as I can tell, nothing in Mesa uses '-m short' any more.  The
generated files used to be tracked in revision control, but I think we
stopped using '-m short' when we stopped tracking the generated files.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Tested-by: Brian Paul <brianp@vmware.com>
Tested-by: Lu Hua <huax.lu@intel.com>
Cc: Vinson Lee <vlee@freedesktop.org>
2014-04-02 11:30:37 -07:00
Juha-Pekka Heikkila
0f641b2d50 mesa: remove redundant running of check_symbol_table()
Nested for loops running through tables against which they
finally do an assert were ran also with optimized builds.

Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-04-02 19:54:37 +03:00
Juha-Pekka Heikkila
17e7cbe078 mesa: Add missing null check in _mesa_parse_arb_program()
Add missing null check in program_parse.tab.c through
program_parse.y

Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-04-02 19:54:37 +03:00
Juha-Pekka Heikkila
68a45b130e mesa: Prevent negative indexing on noise2, noise3 and noise4
% operator could return negative value which would cause
indexing before perm table. Change %256 to &0xff

Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-04-02 19:54:37 +03:00
Juha-Pekka Heikkila
1056c50d57 glx: add extra null check in getFBConfigs
Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-04-02 19:54:37 +03:00
Juha-Pekka Heikkila
88976daea9 glx: remove unused __glXClientInfo()
Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-04-02 19:54:37 +03:00
Tapani Pälli
e14cc504f3 i965/vec4: do not trim dead channels on gen6 for math
Do not set a writemask on Gen6 for math instructions, those are
executed using align1 mode that does not support a destination mask.

v2: cleanups, better comment (Matt)

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76883

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-04-02 19:50:48 +03:00
Thomas Hellstrom
5dc206525b winsys/svga: Replace the query mm buffer pool with a slab pool v3
This is to avoid running out of query buffer space due to winsys
limitations. Instead of a fixed size per screen pool of query buffers,
use a slab allocator that allocates a new slab if we run out of space
in the first one.

v2: Correct email addresses.
v3: s/8192/VMW_QUERY_POOL_SIZE/. Improve documentation and log message.

Reported-and-tested-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
2014-04-02 18:32:44 +02:00
Dave Airlie
76ba50a25a mesa/soft/llvmpipe: add fake MSAA support
This adds a gallium cap that allows us to fake GL3.0 by
not exposing MSAA on sw rendering.
It also forces the extra extensions needed for GL3.2.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-04-02 12:12:04 +10:00
Kristian Høgsberg
882b46a42e gbm: Add gbm_bo_get_fd to gbm-symbols-check script 2014-04-01 14:08:38 -07:00
Kristian Høgsberg
a43d286ef7 gbm: Add import from fd
Add a new import type that lets us create a gbm bo from a
DMA-BUF file descriptor.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
2014-04-01 12:27:26 -07:00
Kristian Høgsberg
f54f5891be gbm: Add gbm_bo_get_fd()
Add gbm function to get a DMA-BUF file descriptor for a gbm bo.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
2014-04-01 12:27:13 -07:00
Jordan Justen
7c379ebe17 include/GLES3: add OpenGL ES 3.1 Headers
From:
http://www.khronos.org/registry/gles/api/GLES3/gl31.h
http://www.khronos.org/registry/gles/api/GLES2/gl2ext.h
http://www.khronos.org/registry/gles/api/GLES3/gl3platform.h

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-04-01 09:30:32 -07:00
Brian Paul
526e49290c Revert "glapi/es1: Don't mark core functions as static_dispatch=false"
This reverts commit f6e290f80c.

To fix the broken build.  The DRI-enabled build seems OK after reverting.
Th non-DRI/gallium build is still suffering from an unrelated issue in
the pipe-loader code.
2014-04-01 08:42:15 -06:00
Iago Toral Quiroga
f5904b732e mesa: Allow setting GL_TEXTURE_MAX_LEVEL to 0 with GL_TEXTURE_RECTANGLE.
Currently, we raise an error when doing this which breaks a conformance
test from the OpenGL samples pack. Even if this is a bit silly it is not
an error.

From http://www.opengl.org/wiki/Rectangle_Texture:

"Rectangle textures contain exactly one image; they cannot have mipmaps.
Therefore, any texture parameters that depend on LODs are irrelevant
when used with rectangle textures; attempting to set these parameters to
any value other than 0 will result in an error."

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76496

Reviewed-by: Brian Paul <brianp@vmware.com>
2014-04-01 08:37:06 -06:00
Ilia Mirkin
c13ff5a763 gallium/docs: fix silent math failures due to ~ and &
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-04-01 10:17:13 -04:00
Ilia Mirkin
b4cf180695 gallium/docs: line up some of the equations
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-04-01 10:17:13 -04:00
Ilia Mirkin
05d0223da3 gallium/docs: fix incorrect/missing references
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-04-01 10:17:13 -04:00
Ilia Mirkin
45e383bfae gallium/docs: fix use of _ in math sections
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-04-01 10:17:13 -04:00
Ilia Mirkin
2f14e5eb09 gallium/docs: add format to index
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-04-01 10:17:13 -04:00
Ilia Mirkin
4ca110a7b9 gallium/docs: fix a lot of bad formatting
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-04-01 10:17:13 -04:00
Chia-I Wu
5d76e44643 glsl: remove UBO fields from _mesa_glsl_parse_state
They are not needed since 514f8c7ec7.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-04-01 13:41:20 +08:00
Ilia Mirkin
010171b562 nv50: implement clear_buffer to accelerate ARB_clear_buffer_object
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-03-31 21:55:03 -04:00
Ilia Mirkin
f5ba1a1f7f mesa/st: Accelerate ARB_clear_buffer_object with clear_buffer
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-03-31 21:21:11 -04:00
Ilia Mirkin
24b86cb304 gallium: add interface to clear buffers
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-03-31 21:20:02 -04:00
Ian Romanick
4c035706dc mapi_abi: Remove ABI-check work arounds for functions that are no longer exported
The previous commit stopped exporting 21 libGLESv2 and 88 libGLESv1_CM
functions.  This removes the work-arounds for those functions from
ABI-check.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Acked-by: Chad Versace <chad.versace@linux.intel.com>
2014-03-31 14:47:25 -07:00
Ian Romanick
1a59f9a131 mapi_abi: Make ES1 and ES2 static_dispatch=false functions hidden
This has been a long standing issue with the ES libraries.  Functions
marked in the XML with 'static_dispatch=false' were still incorrectly
exported.  ABI-check is supposed to detect this case, but we have to
paper over failures every time a new extension is added.

This change will cause a big pile of functions to disappear from
libGLESv2 and libGLESv1_CM.

libGLESv2 loses (20 functions):

    glBindVertexArrayOES
    glCompressedTexImage3DOES
    glCompressedTexSubImage3DOES
    glCopyTexSubImage3DOES
    glDeleteVertexArraysOES
    glDiscardFramebufferEXT
    glDrawBuffersNV
    glFlushMappedBufferRangeEXT
    glFramebufferTexture3DOES
    glGenVertexArraysOES
    glGetBufferPointervOES
    glGetProgramBinaryOES
    glIsVertexArrayOES
    glMapBufferOES
    glMapBufferRangeEXT
    glProgramBinaryOES
    glReadBufferNV
    glTexImage3DOES
    glTexSubImage3DOES
    glUnmapBufferOES

libGLESv1_CM loses (88 functions):

    glAlphaFuncxOES
    glBindFramebufferOES
    glBindRenderbufferOES
    glBlendEquationOES
    glBlendEquationSeparateOES
    glBlendFuncSeparateOES
    glCheckFramebufferStatusOES
    glClearColorxOES
    glClearDepthfOES
    glClearDepthxOES
    glClipPlanefOES
    glClipPlanexOES
    glColor4xOES
    glDeleteFramebuffersOES
    glDeleteRenderbuffersOES
    glDepthRangefOES
    glDepthRangexOES
    glDiscardFramebufferEXT
    glDrawTexfOES
    glDrawTexfvOES
    glDrawTexiOES
    glDrawTexivOES
    glDrawTexsOES
    glDrawTexsvOES
    glDrawTexxOES
    glDrawTexxvOES
    glFlushMappedBufferRangeEXT
    glFogxOES
    glFogxvOES
    glFramebufferRenderbufferOES
    glFramebufferTexture2DOES
    glFrustumfOES
    glFrustumxOES
    glGenerateMipmapOES
    glGenFramebuffersOES
    glGenRenderbuffersOES
    glGetBufferPointervOES
    glGetClipPlanefOES
    glGetClipPlanexOES
    glGetFixedvOES
    glGetFramebufferAttachmentParameterivOES
    glGetLightxvOES
    glGetMaterialxvOES
    glGetRenderbufferParameterivOES
    glGetTexEnvxvOES
    glGetTexGenfvOES
    glGetTexGenivOES
    glGetTexGenxvOES
    glGetTexParameterxvOES
    glIsFramebufferOES
    glIsRenderbufferOES
    glLightModelxOES
    glLightModelxvOES
    glLightxOES
    glLightxvOES
    glLineWidthxOES
    glLoadMatrixxOES
    glMapBufferOES
    glMapBufferRangeEXT
    glMaterialxOES
    glMaterialxvOES
    glMultiTexCoord4xOES
    glMultMatrixxOES
    glNormal3xOES
    glOrthofOES
    glOrthoxOES
    glPointParameterxOES
    glPointParameterxvOES
    glPointSizePointerOES
    glPointSizexOES
    glPolygonOffsetxOES
    glQueryMatrixxOES
    glRenderbufferStorageOES
    glRotatexOES
    glSampleCoveragexOES
    glScalexOES
    glTexEnvxOES
    glTexEnvxvOES
    glTexGenfOES
    glTexGenfvOES
    glTexGeniOES
    glTexGenivOES
    glTexGenxOES
    glTexGenxvOES
    glTexParameterxOES
    glTexParameterxvOES
    glTranslatexOES
    glUnmapBufferOES

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Chia-I Wu <olv@lunarg.com>
Cc: Paul Berry <stereotype441@gmail.com>
2014-03-31 14:47:00 -07:00
Ian Romanick
dfccd5ccd7 mapi: Hack around glGetInternalformativ not being hidden in GLES
This is hella ugly.  The same-named function in desktop OpenGL is
hidden, but it needs to be exposed by libGLESv2 for OpenGL ES 3.0.
There's no way to express in the XML that a function should be be hidden
in one API but exposed in another.

This won't affect any change now, but it will prevent a regression in a
later patch.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2014-03-31 14:46:48 -07:00
Ian Romanick
f6e290f80c glapi/es1: Don't mark core functions as static_dispatch=false
Functions that are part of OpenGL ES 1.0 or 1.1 should have static
dispatch functions in libGLESv1_CM.  This doesn't affect any change yet,
but it will prevent later regressions.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Acked-by: Chad Versace <chad.versace@linux.intel.com>
2014-03-31 14:46:39 -07:00
Ian Romanick
d457eb193c glapi: Mark all GL_ARB_separate_shader_objects functions with static_dispatch=false
This prevents the entrypoints from being (incorrectly) advertised by
libGL.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Acked-by: Chad Versace <chad.versace@linux.intel.com>
2014-03-31 14:46:32 -07:00
Ian Romanick
5ccc4e7a8d glapi: Remove some duplicate ignore="true" lines
It looks like these were added accidentally by Paul in commit 1a1db174.
From the commit message and the look of the patch, I think this was just
some sed-job left overs.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2014-03-31 14:45:37 -07:00
Matt Turner
3a8bd97241 i965/vec4: Don't trim writemasks of texture instructions.
It was my understanding that the writemask works in SIMD4x2 mode for
texturing instructions and doesn't require a message header. Some bit of
this logic must be wrong, so disable it until it's understood.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76617
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-03-31 10:24:10 -07:00
Emil Velikov
d681b22ed7 automake: ask the linker to do garbage collection
By doing GC the linker removes all the symbols that are not referenced
and/or used by the final library. This results in a saving of ~100K
up-to ~600K per (stripped) binary (classic vs gallium drivers).

If interested one can ask the compiler to print the sections that are
removed using -Wl,--print-gc-sections.

v2: Check if ld supports the flag before using it.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Acked-by: Matt Turner <mattst88@gmail.com> (v1)
2014-03-31 14:56:14 +01:00
Emil Velikov
d187a150d4 automake: add -Wl,--no-undefined to all libraries
... apart from the dri drivers.
With this final change we can build mesa without fear that
the resulting libraries will have unresolved symbols.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-03-31 13:09:23 +01:00
Emil Velikov
902dc61f88 gallium/targets: add missing library dependencies
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-03-31 13:08:55 +01:00
Emil Velikov
354a5cad74 pipe-loader: reorder PIPE_LIBS
Reorder -lm, -lrt, -lpthreads and -ldl to be consistent with the
rest of mesa.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-03-31 13:05:36 +01:00
Emil Velikov
0177ff0039 pipe-loader: use PTHREAD_LIBS over -lpthread
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-03-31 13:02:47 +01:00
Emil Velikov
501af7a1a0 dri/i965: use CLOCK_LIBS over -lrt
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-03-31 13:01:10 +01:00
Emil Velikov
5503c227d9 automake: consistently use -no-undefined
Set the flag for all but the dri targets. They have missing
glapi symbols which are required for the normal operation with
the X server.

Jon, I fear that you'll need to carry the "no-undefined" hunk
locally when building the dri drivers under cygwin.

Cc: Jon TURNEY <jon.turney@dronecode.org.uk>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-03-31 12:59:16 +01:00
Emil Velikov
6c8d8119ca targets/egl-static: move the common LDFLAGS into AM_LDFLAGS
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-03-31 12:56:25 +01:00
Emil Velikov
c323273201 targets/omx: do not link against the trace driver
Unused due to the missing GALLIUM_TRACE define.

Requested-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2014-03-31 12:55:29 +01:00
Emil Velikov
0484b8446a gallium/targets: explicitly include a dummy.cpp and remove all the LINK mayhem
Explicitly setting the linker variable was required for old and broken
build toolchains. At this point this should no longer be needed, and
setting the sources lists will trigger generation of the correct LINK
variables.

Explicitly include dummy.cpp to use g++ to link the static library which
in most cases is based upon C++ code.

v2: Reword commit message.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-03-31 12:26:47 +01:00
Emil Velikov
2d9c33009a gallium/targets: move LLVM_LIBS handling inside Automake.inc
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-03-31 12:26:32 +01:00
Emil Velikov
2328900f66 gallium/targets: fold LLVM_LDFLAGS inside Automake.inc
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-03-31 12:26:16 +01:00
Emil Velikov
1ea1767f72 targets/omx: use GALLIUM_OMX_LINKER_FLAGS
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2014-03-31 12:25:34 +01:00
Emil Velikov
e6f8db1e56 targets/omx: introduce GALLIUM_OMX_LIB_DEPS
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2014-03-31 12:25:04 +01:00
Emil Velikov
55bc658e4b targets/pipe-loader: move LLVM_LIBS handling inside PIPE_LIBS
This lets us have only one if HAVE_MESA_LLVM block, rather than
one for each driver.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-03-31 12:23:59 +01:00
Emil Velikov
e36cc99880 targets/pipe-loader: include dummy.cpp irrespective of HAVE_MESA_LLVM
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-03-31 12:22:58 +01:00
Emil Velikov
029bc4510b targets/pipe-loader: compact duplicating LDFLAGS
Every library uses the same libtool/linker flags. Compact those
into AM_LDFLAGS and append the version script to it.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-03-31 12:22:30 +01:00
Joakim Sindholt
e6545aaaeb pipe-loader/swrast: add soft/llvmpipe defines
Or it compiles them in, but pretends they don't exist

v2: Rebase (Emil)

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-03-31 12:22:08 +01:00
Emil Velikov
613b4d59e4 targets/xa: drop libudev references from automake build
Mesa does _not_ link against libudev. Additionally the only place
that deals with it is the loader, thus we can drop the CFLAGS.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-03-31 12:21:47 +01:00
Emil Velikov
f5466b7b93 dri/common: LIBDRM_LIBS is not a linker/libtool flag, add it to LIBADD
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-03-31 12:21:42 +01:00
Emil Velikov
46ae286b9d drivers/x11: GL_LIB_DEPS is not a linker/libtool flag, add it to LIBADD
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-03-31 12:21:36 +01:00
Emil Velikov
e62b7d38a1 configure: autodetect video state-trackers when non swrast driver is present
It makes little sense to enable the vdpau, xvmc and omx state-trackers
as they do not make use of (don't work with) the software driver.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-03-31 12:21:30 +01:00
Emil Velikov
3dc174e85e configure: use grep in quiet mode, rather than piping stderr/stdout to /dev/null
grep -q is easier to read and consistent with the rest of configure.ac.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-03-31 12:20:10 +01:00
Emil Velikov
e8e1158ac3 configure: error out when building gallium-osmesa without softpipe
Gallium osmesa links against the softpipe driver, thus the build
will fail if it's missing.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Acked-by: Matt Turner <mattst88@gmail.com>
2014-03-31 12:18:39 +01:00
Emil Velikov
4d8267ef20 Partially revert "automake: allow only shared builds"
Evidently at least static OSMesa is still used as shared one
causes substantial increase in the load time for some programs
that use it (from seconds up-to ~30min).

Rather than forcing everyone to use shared mesa, revert commit
a6efbac9fb and default to shared
build when both shared and static are disabled.

v2: Whitespace cleanup, drop silly comment.

Reported-by: Burlen Loring <burlen.loring@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-03-31 12:18:17 +01:00
Emil Velikov
23740ed031 configure: enable dri3 only for linux
Currently only linux can make use of dri3, so it would make sense to
enable it explicitly for the platform.
Drop a duplicated libudev check while we're at it.

v3: Properly handle dri3 and reword commit message.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76377
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-03-31 12:11:37 +01:00
Chris Forbes
ec4b8d1697 mesa: Fix format matching checks for GL_INTENSITY* internalformats.
GL_INTENSITY has never been valid as a pixel format -- to get the memcpy
pack/unpack paths, the app needs to specify GL_RED as the pixel format
(or GL_RED_INTEGER for the integer formats).

Note: This was briefly merged before, but exposed some breakage in gallium, so
was reverted. Hopefully it will stick this time.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-04-01 11:56:48 +13:00
Chris Forbes
e3cdbdb14b st: fix st_choose_matching_format to ignore intensity
_mesa_format_matches_format_and_type() returns true for
GL_RED/GL_RED_INTEGER (with an appropriate type) into an intensity
mesa_format.

We want the `red`-based format instead, regardless of the order we find
them in our walk of the mesa formats list.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-04-01 11:56:18 +13:00
Chris Forbes
3196c53c5d mesa: fix texstore for MESA_FORMAT_R8G8B8A8_SRGB
The case for this was in the wrong function, and this format's store
func was not set in the table at all.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-04-01 11:54:56 +13:00
Rob Clark
db414c4686 freedreno/a3xx/compiler: fix RECT textures
Whether or not the coords are normalized is handled in the texture
state.  But we otherwise need to treat RECT sample instructions as 2D.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-03-30 12:10:26 -04:00
Rob Clark
83808a90be freedreno/a3xx/compiler: avoid negative register ids
In some cases, we need a register to be assigned up to three components
before the base.  Since we can't have negative register #'s, just shift
everything up.  May increase register usage for trivial shaders, but I
don't think we are shader limited in those cases.  A proper solution is
going to require a better register assignment algorithm (which is on the
TODO list), this is just a hack to get us by until then.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-03-30 09:53:32 -04:00
Rob Clark
2346ea6347 freedreno/a3xx: missing wfi
RB_FRAME_BUFFER_DIMENSION is not a banked context register, so we need
to wait for the GPU to idle before updating it.  But we'd rather not
have unnecessary WFI's, so actually keep track if we need to emit it or
not.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-03-30 09:50:24 -04:00
Rob Clark
ae5efaf285 freedreno/a3xx: little extra debug
Catch things which should not happen in debug builds.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-03-30 09:40:00 -04:00
Rob Clark
92141afd0e freedreno: handle null sampler
This is something that XA triggers.  In some cases it will only use
SAMP[1] (composite mask) but not SAMP[0] (composite src).

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-03-30 09:38:16 -04:00
Kenneth Graunke
9b6b084eb7 i965: Add Cherryview support.
Based on a patch by Ville Syrjälä.

As usual, these are placeholder values; actual values will come later.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2014-03-28 17:10:09 -07:00
Ian Romanick
4047263cb1 glsl: Clean up "unused parameter" warnings
../../src/glsl/builtin_functions.cpp:72:1: warning: unused parameter 'state' [-Wunused-parameter]

../../src/glsl/ir_clone.cpp:31:1: warning: unused parameter 'ht' [-Wunused-parameter]

../../src/glsl/ir_equals.cpp:44:1: warning: unused parameter 'ir' [-Wunused-parameter]
../../src/glsl/ir_equals.cpp:50:1: warning: unused parameter 'ignore' [-Wunused-parameter]
../../src/glsl/ir_equals.cpp:68:1: warning: unused parameter 'ignore' [-Wunused-parameter]

../../src/glsl/ir_print_visitor.cpp:149:6: warning: unused parameter 'ir' [-Wunused-parameter]
../../src/glsl/ir_print_visitor.cpp:556:1: warning: unused parameter 'ir' [-Wunused-parameter]
../../src/glsl/ir_print_visitor.cpp:562:1: warning: unused parameter 'ir' [-Wunused-parameter]

../../src/glsl/link_uniforms.cpp:213:1: warning: unused parameter 'record_type' [-Wunused-parameter]

../../src/glsl/loop_analysis.cpp:225:1: warning: unused parameter 'ir' [-Wunused-parameter]

../../src/glsl/loop_unroll.cpp:73:30: warning: unused parameter 'ir' [-Wunused-parameter]
../../src/glsl/loop_unroll.cpp:79:30: warning: unused parameter 'ir' [-Wunused-parameter]
../../src/glsl/loop_unroll.cpp:85:30: warning: unused parameter 'ir' [-Wunused-parameter]

../../src/glsl/opt_copy_propagation_elements.cpp:189:1: warning: unused parameter 'ir' [-Wunused-parameter]

../../src/glsl/opt_cse.cpp:402:1: warning: unused parameter 'ir' [-Wunused-parameter]

../../src/glsl/opt_dead_code_local.cpp:117:30: warning: unused parameter 'ir' [-Wunused-parameter]

../../src/glsl/opt_redundant_jumps.cpp:53:1: warning: unused parameter 'ir' [-Wunused-parameter]

../../src/glsl/opt_vectorize.cpp:301:1: warning: unused parameter 'ir' [-Wunused-parameter]

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-03-28 10:57:58 -07:00
Ian Romanick
1b28c8d77a mesa: Clean up "unused parameter" warnings
program/ir_to_mesa.cpp:2008:1: warning: unused parameter 'ir' [-Wunused-parameter]
program/ir_to_mesa.cpp:2272:1: warning: unused parameter 'ir' [-Wunused-parameter]
program/ir_to_mesa.cpp:2278:1: warning: unused parameter 'ir' [-Wunused-parameter]

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-03-28 10:57:55 -07:00
Ian Romanick
1bdf65f743 mesa/program: Constify find_variable_storage
Also clean up an old whitespace blooper.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-03-28 10:57:53 -07:00
Ian Romanick
22128e30f3 glsl: Move Doxygen block closing ot the correct place
This is the closing for the "\defgroup IR Intermediate representation
nodes" all the way at the top of the file.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-03-28 10:57:49 -07:00
Iago Toral Quiroga
029ccd773d i965: Make sure we always compute valid index bounds before drawing.
When doing software rendering (i.e. rendering to the selection buffer) we need
to make sure that we have valid index bounds before calling _tnl_draw_prims(),
otherwise we can crash.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=59455
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-03-28 08:48:14 -07:00
Chia-I Wu
e7f7574598 glsl: remove {add,get}_type_ast from glsl_symbol_table
They are not needed since 0da1a2cc36.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-03-28 10:59:49 +08:00
Brian Paul
e341856294 mesa: fix glMultiDrawArrays inside a display list
The underlying glDrawArrays() calls weren't getting compiled into
the display list.  We simply need to use the current dispatch table
so the CALL_DrawArrays() is routed to the display list save function.

This patch also fixes glMultiModeDrawArraysIBM and
glMultiModeDrawElementsIBM.

Fixes the new piglit gl-1.4-dlist-multidrawarrays test.

Cc: "10.0" "10.1" <mesa-stable@lists.freedesktop.org>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-03-27 11:09:30 -06:00
Brian Paul
12b959c351 st/mesa: overhaul texture / sample swizzle code
Previously we only examined the GL_DEPTH_MODE state to determine the
sampler view swizzle for depth textures.  Now we also consider the
texture base format for color textures too.

The basic idea is if we're sampling from a RGB texture we always
want to get A=1, even if the actual hardware format might be RGBA.
We had assumed that the texture's A values were always one since that's
what Mesa's texstore code does.  But if we render to the RGBA texture,
the A values might not be 1.  Subsequent sampling didn't return the
right values.

Now we examine the user-specified texture base format vs. the actual
gallium format to determine the right swizzle.

Fixes several fbo-blending-formats, fbo-clear-formats and fbo-tex-rgbx
failures with VMware/svga driver (and possibly other drivers).
No other piglit regressions with softpipe or VMware/svga.

Reviewed-by: Marek Olšák <maraeo@gmail.com>
2014-03-27 09:45:25 -06:00
Brian Paul
0151707cfc st/mesa: simplify apply_depthmode()
In preparation for following changes.

I used a temporary test harness to compare the old code to the new
for all possible swizzle inputs.  No change in results.
2014-03-27 08:08:26 -06:00
Eric Anholt
b02bcea715 i965: Use intel_upload_space() for pull constant uploads.
This also happens to fix a leak of the current GS pull constant BO on
context destroy, by just not holding on to the pull const bos after the
surface state is generated.

No statistically significant performance difference on GLB2.7 on HSW at
1024x768 (n=40) or 320x240 (n=44), or on BYT at 320x240 (n=47).

v2: Rebase on intel_upload simplification.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-03-26 13:14:57 -07:00
Eric Anholt
3b57988290 i965: Massively simplify the intel_upload implementation.
The implementation kept a page-sized area for uploading data, and
uploaded chunks from that to a 64kb-sized streamed buffer.  This wasted
cache footprint (and extra state tracking to do so) when we want to just
write our data into the buffer immediately.

Instead, build it around an interface like brw_state_batch() that just
gets you a pointer to BO memory to upload your stuff immediately.

Improves OpenArena on HSW by 1.62209% +/- 0.355299% (n=61) and on BYT by
1.7916% +/- 0.415743% (n=31).

v2: Rebase on Mesa master, drop old prototypes.  Re-do performance
    comparison on a kernel that doesn't punish CPU efficiency
    improvements.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-03-26 13:13:26 -07:00
Zack Rusin
b1909b260f draw/llvm: improve debugging output a bit
it's useful to know what the llvmbuildstore arguments are going to
be before executing it because it can crash and make sure to
print out the inputs only if we're not generating a gs because
it fetches inputs differently.

Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-03-26 15:58:59 -04:00
Zack Rusin
a3c0fa2d22 draw/gs: reduce the size of the gs output buffer
We used to overallocate the output buffer sometimes running out
of memory with applications rendering large geometries. The actual
maximum number of vertices out is simply the maximum number of
primitives in (number of gs invocations) multiplied by the maximum
number of output vertices per gs input primitive (i.e. gs invocation).

Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-03-26 15:58:32 -04:00
Brian Paul
c875d6e57a svga: add work-around for Sauerbraten Z fighting issue
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2014-03-26 10:31:13 -06:00
Brian Paul
070951b6ba svga: null out query's hwbuf pointer after destroying
Just to be extra safe.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2014-03-26 10:31:13 -06:00
Brian Paul
8bbc84d1e5 svga: add some debug_printf() calls in the query object code
To help debug failures.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2014-03-26 10:31:13 -06:00
Brian Paul
488d4c4826 st/mesa: add null pointer checking in query object functions
Don't pass null query object pointers into gallium functions.
This avoids segfaulting in the VMware driver (and others?) if the
pipe_context::create_query() call fails and returns NULL.

Cc: "10.0" "10.1" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-03-26 10:31:13 -06:00
Brian Paul
82246f7939 svga: fix a comment (sampler vs. sampler_view) 2014-03-26 10:31:13 -06:00
Brian Paul
1f4ebfaa88 mesa: fix unpack_Z32_FLOAT_X24S8() / unpack_Z32_FLOAT() mix-up
And use the z32f_x24s8 helper struct in unpack_Z32_FLOAT_X24S8().
Cc: "10.0" "10.1" <mesa-stable@lists.freedesktop.org>

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-03-26 10:31:13 -06:00
Brian Paul
c1377ed464 mesa: fix indentation, formatting, etc in fbobject.c 2014-03-26 10:31:13 -06:00
Brian Paul
f5e0d024d1 mesa: rename format_(un)pack.c functions to match format names (pt. 7)
sed commands:
s/z_Z24_S8\b/S8_UINT_Z24_UNORM/g
s/z_S8_Z24\b/Z24_UNORM_S8_UINT/g
s/z_Z16\b/Z_UNORM16/g
s/z_Z32\b/Z_UNORM32/g
s/z_Z32_FLOAT/Z_FLOAT32/g

Reviewed-by: Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-03-26 10:29:12 -06:00
Brian Paul
7f37802c8a mesa: rename format_(un)pack.c functions to match format names (pt. 6)
sed commands:
s/ARGB2101010_UINT\b/B10G10R10A2_UINT/g
s/ABGR2101010_UINT\b/R10G10B10A2_UINT/g

Reviewed-by: Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-03-26 10:29:12 -06:00
Brian Paul
e51c3f9523 mesa: rename format_(un)pack.c functions to match format names (pt. 5)
sed commands:
s/SIGNED_R_UNORM8\b/R_SNORM8/g
s/SIGNED_RG88_REV\b/R8G8_SNORM/g
s/SIGNED_RGBX8888\b/X8B8G8R8_SNORM/g
s/SIGNED_A8B8G8R8_UNORM\b/A8B8G8R8_SNORM/g
s/SIGNED_R8G8B8A8_UNORM\b/R8G8B8A8_SNORM/g
s/SIGNED_R_UNORM16\b/R_SNORM16/g
s/SIGNED_R16G16_UNORM\b/R16G16_SNORM/g
s/SIGNED_RGB_16\b/RGB_SNORM16/g
s/SIGNED_RGBA_16\b/RGBA_SNORM16/g
s/SIGNED_A_UNORM8\b/A_SNORM8/g
s/SIGNED_L_UNORM8\b/L_SNORM8/g
s/SIGNED_L8A8_UNORM\b/L8A8_SNORM/g
s/SIGNED_L_UNORM8\b/I_SNORM8/g
s/SIGNED_A_UNORM16\b/A_SNORM16/g
s/SIGNED_L_UNORM16\b/L_SNORM16/g
s/SIGNED_L16A16_UNORM\b/LA_SNORM16/g
s/SIGNED_L_UNORM16\b/I_SNORM16/g
s/XBGR16161616_SNORM\b/RGBX_SNORM16/g
s/SIGNED_G8R8_UNORM\b/G8R8_SNORM/g
s/SIGNED_G16R16_UNORM\b/G16R16_SNORM/g
s/SIGNED_I_UNORM8\b/I_SNORM8/g
s/SIGNED_I_UNORM16\b/I_SNORM16/g

Reviewed-by: Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-03-26 10:29:12 -06:00
Brian Paul
f10f5b8822 mesa: rename format_(un)pack.c functions to match format names (pt. 4)
sed commands:
s/SRGBA_UNORM8\b/A8B8G8R8_SRGB/g
s/SABGR_UNORM8\b/R8G8B8A8_SRGB/g
s/SARGB8\b/B8G8R8A8_SRGB/g
s/XBGR8888_SRGB\b/R8G8B8X8_SRGB/g
s/XRGB8888_SRGB\b/B8G8R8X8_SRGB/g
s/SL_UNORM8\b/L_SRGB8/g
s/SLA_UNORM8\b/L8A8_SRGB/g

manually changed SRGB8 -> BGR_SRGB8

Reviewed-by: Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-03-26 10:29:12 -06:00
Brian Paul
be9eee3bcf mesa: rename format_(un)pack.c functions to match format names (pt. 3)
sed commands:
s/LUMINANCE_FLOAT32\b/L_FLOAT32/g
s/LUMINANCE_FLOAT16\b/L_FLOAT16/g
s/LUMINANCE_ALPHA_FLOAT32\b/LA_FLOAT32/g
s/LUMINANCE_ALPHA_FLOAT16\b/LA_FLOAT16/g
s/ALPHA_FLOAT32\b/A_FLOAT32/g
s/ALPHA_FLOAT16\b/A_FLOAT16/g
s/XBGR32323232_FLOAT\b/RGBX_FLOAT32/g
s/RGB9_E5_FLOAT\b/R9G9B9E5_FLOAT/g
s/R11_G11_B10_FLOAT\b/R11G11B10_FLOAT/g
s/INTENSITY_FLOAT16\b/I_FLOAT16/g
s/INTENSITY_FLOAT32\b/I_FLOAT32/g

v2: removed a few redundant/no-op substitutions

Reviewed-by: Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-03-26 10:29:12 -06:00
Brian Paul
a49f46b15a mesa: rename format_(un)pack.c functions to match format names (pt. 2)
sed commands:
s/ABGR2101010\b/R10G10B10A2_UNORM/g
s/XRGB2101010_UNORM\b/B10G10R10X2_UNORM/g
s/XBGR16161616_UNORM\b/RGBX_UNORM16/g
s/ABGR2101010\b/R10G10B10A2_UNORM/g
s/I8\b/I_UNORM8/g
s/I16\b/I_UNORM16/g

Reviewed-by: Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-03-26 10:29:12 -06:00
Brian Paul
5c619ace6f mesa: rename format_(un)pack.c functions to match format names (pt. 1)
sed commands:
s/RGBA8888\b/A8B8G8R8_UNORM/g
s/RGBA8888_REV\b/R8G8B8A8_UNORM/g
s/ARGB8888\b/B8G8R8A8_UNORM/g
s/ARGB8888_REV\b/A8R8G8B8_UNORM/g
s/RGBA8888\b/X8B8G8R8_UNORM/g
s/RGBA8888_REV\b/R8G8B8X8_UNORM/g
s/XRGB8888\b/B8G8R8X8_UNORM/g
s/XRGB8888_REV\b/X8R8G8B8_UNORM/g
s/RGB888\b/BGR_UNORM8/g
s/BGR888\b/RGB_UNORM8/g
s/RGB565\b/B5G6R5_UNORM/g
s/RGB565_REV\b/R5G6B5_UNORM/g
s/ARGB4444\b/B4G4R4A4_UNORM/g
s/ARGB4444_REV\b/A4R4G4B4_UNORM/g
s/RGBA5551\b/A1B5G5R5_UNORM/g
s/ARGB1555\b/B5G5R5A1_UNORM/g
s/ARGB1555_REV\b/A1R5G5B5_UNORM/g
s/AL44\b/L4A4_UNORM/g
s/AL88\b/L8A8_UNORM/g
s/AL88_REV\b/A8L8_UNORM/g
s/AL1616\b/L16A16_UNORM/g
s/AL1616_REV\b/A16L16_UNORM/g
s/RGB332\b/B2G3R3_UNORM/g
s/A8\b/A_UNORM8/g
s/A16\b/A_UNORM16/g
s/L8\b/L_UNORM8/g
s/L16\b/L_UNORM16/g
s/L8\b/I_UNORM8/g
s/L16\b/I_UNORM16/g
s/R8\b/R_UNORM8/g
s/GR88\b/R8G8_UNORM/g
s/RG88\b/G8R8_UNORM/g
s/R16\b/R_UNORM16/g
s/GR1616\b/R16G16_UNORM/g
s/RG1616\b/G16R16_UNORM/g
s/ARGB2101010\b/B10G10R10A2_UNORM/g

Reviewed-by: Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-03-26 10:29:12 -06:00
Zack Rusin
bbdefabfc9 llvmpipe: Fix llvmpipe_create_gs_state.
Revert unintended behaviour change from commit
b995a010e6.

Tested-by: José Fonseca <jfonseca@vmware.com>
2014-03-26 16:11:28 +00:00
Christian König
aa2274c1d2 st/omx/dec: fix possible segfault at eos
Signed-off-by: Christian König <christian.koenig@amd.com>
2014-03-26 16:29:20 +01:00
José Fonseca
2de70fe23f mapi/glapi: Use ElementTree instead of libxml2.
It is quite hard to meet the dependency of the libxml2 python bindings
outside Linux, and in particularly on MacOSX; whereas ElementTree is
part of Python's standard library.  ElementTree is more limited than
libxml2: no DTD verification, defaults from DTD, or XInclude support,
but none of these limitations is serious enough to justify using
libxml2.

In fact, it was easier to refactor the code to use ElementTree than to
try to get libxml2 python bindings.

In the process, gl_item_factory class was refactored so that there is
one method for each kind of object to be created, as it simplifies
things substantially.

I confirmed that precisely the same output is generated for GL/GLX/GLES.

v2: Remove m4/ax_python_module.m4 as suggested by Matt Turner.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-03-26 13:51:32 +00:00
José Fonseca
b761dfa0c3 mapi/glapi: Remove glX_doc.py.
As suggested by Ian Romanick, given it's no longer used.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-03-26 12:32:57 +00:00
Christian König
d117ddbe31 st/mesa: fix sampler view handling with shared textures v4
Release the references to the sampler views before
destroying the pipe context.

v2: remove TODO and unrelated change
v3: move to st_texture.[ch], rename callback, add comment
v4: fix rebase mess up and add further cleanups

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Cc: "10.0 10.1" <mesa-stable@lists.freedesktop.org>
2014-03-26 12:06:43 +01:00
Roland Scheidegger
3b421daf32 gallivm: fix no-op n:n lp_build_resize()
This can get called in some circumstances if both src type and dst type
have same width (seen with float32->unorm32). While this particular case
was bogus anyway let's just fix that as it can work trivially (due to the
way it was called it actually worked anyway apart from the assert).

Reviewed-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2014-03-26 01:44:23 +01:00
Kevin Rogovin
fe635d51ff i965: For fast color clears, only check the color of live channels.
When deciding if a clear color is suitable for fast clear,
take into account if a color channel is active in the
buffer format.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-03-25 15:34:28 -07:00
Kenneth Graunke
ee4484be3d i965: Set Broadwell MOCS values everywhere it's possible.
This patch introduces two pre-canned MOCS values: BDW_MOCS_WB
(write-back, all caches) and BDW_MOCS_WT (write-through, all caches).

We use write-through caching for render targets, and write-back for
all other data.  (At least on Haswell, I believe write-back LLC/eLLC
didn't work for scan-out buffers, while write-through did.)

No performance analysis has been done on the impact of this patch.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Eric Anholt <eric@anholt.net>
2014-03-25 15:14:08 -07:00
Kenneth Graunke
1afe335925 mesa: In core profile, refuse to draw unless a VAO is bound.
Core profile requires a non-default VAO to be bound.  Currently, calls
to glVertexAttribPointer raise INVALID_OPERATION unless a VAO is bound,
and we never actually get any vertex data set.  Trying to draw without
any vertex data can only cause problems.  In i965, it causes a crash.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76400
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Cc: mesa-stable@lists.freedesktop.org
2014-03-25 15:13:49 -07:00
Ilia Mirkin
29bcc73d4d Revert "build: llvm libs may not be in system search path, add rpath"
This reverts commit d9b983519c.

Unfortunately it seems like rpath is evaluated before LD_LIBRARY_PATH,
so this breaks e.g. steam, as well as any other user of that env var,
if the llvm path happens to be where other libs also reside.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76082
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-03-25 17:18:46 -04:00
Chris Forbes
4002daf095 Revert "mesa: Fix format matching checks for GL_INTENSITY* internalformats."
This reverts commit 40d7b51953.
2014-03-26 10:06:10 +13:00
Brian Paul
64278b36d6 mesa: move GLbitfield any_valid_stages declaration before code
To fix MSVC build.
2014-03-25 13:33:10 -06:00
Ian Romanick
c4cec40883 glsl: Clean up "unused parameter" warnings
../../src/glsl/ir_constant_expression.cpp:486:1: warning: unused parameter 'variable_context' [-Wunused-parameter]
../../src/glsl/ir_constant_expression.cpp:1633:1: warning: unused parameter 'variable_context' [-Wunused-parameter]
../../src/glsl/ir_constant_expression.cpp:1752:1: warning: unused parameter 'variable_context' [-Wunused-parameter]
../../src/glsl/ir_constant_expression.cpp:1761:1: warning: unused parameter 'variable_context' [-Wunused-parameter]
../../src/glsl/ir_constant_expression.cpp:1769:1: warning: unused parameter 'variable_context' [-Wunused-parameter]

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-03-25 12:09:36 -07:00
Ian Romanick
f3ab987b70 glsl: Minor clean ups in constant_referenced
These could probably be squashed into one of the previous commits.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-03-25 12:09:36 -07:00
Ian Romanick
6429d6276d glsl: Remove ir_dereference::constant_referenced
All of the functionality is implemented in a private function in the one
file where it is used.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-03-25 12:09:36 -07:00
Ian Romanick
bb0d6db974 glsl: Fold implementation of ir_dereference_array::constant_referenced into wrapper
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-03-25 12:09:36 -07:00
Ian Romanick
35bf94f901 glsl: Fold implementation of ir_dereference_record::constant_referenced into wrapper
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-03-25 12:09:36 -07:00
Ian Romanick
b66319b006 glsl: Fold implementation of ir_dereference_variable::constant_referenced into wrapper
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-03-25 12:09:36 -07:00
Ian Romanick
14f0faacb6 glsl: Add wrapper function that calls ir_dereference::constant_referenced
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-03-25 12:09:36 -07:00
Ian Romanick
c11c7e4f01 glsl: Group all of the constant_referenced functions together
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-03-25 12:09:36 -07:00
Gwenole Beauchesne
3bd65dc8a1 i965: fix dma_buf import with non-zero offset.
Fix eglCreateImage() from a packed dma_buf surface with a non-zero offset
to pixels data. In particular, this fixes support for planar YUV surfaces
when they are individually mapped on a per-plane basis, i.e. when the
OES_EGL_image_external is not used and user application wants to use its
own shader code for composition, or processing on individual plane (OCL).

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-03-25 18:56:41 +01:00
Gregory Hainaut
1c29068074 mesa/sso: Implement ValidateProgramPipeline
Implementation note:
I don't use context for ralloc (don't know how).

The check on PROGRAM_SEPARABLE flags is also done when the pipeline
isn't bound.  It doesn't make any sense in a DSA style API.

Maybe we could replace _mesa_validate_program by
_mesa_validate_program_pipeline.  For example we could recreate a dummy
pipeline object.  However the new function checks also the
TEXTURE_IMAGE_UNIT number not sure of the impact.

V2:
Fix memory leak with ralloc_strdup
Formatting improvement

V3 (idr):
* Actually fix the leak of the InfoLog. :)
* Directly generate logs in to gl_pipeline_object::InfoLog via
  ralloc_asprintf isntead of using a temporary buffer.
* Split out from previous uber patch.
* Change spec references to include section numbers, etc.
* Fix a bug in checking that a different program isn't active in a stage
  between two stages that have the same program.  Specifically,

 if (pipe->CurrentVertexProgram->Name == pipe->CurrentGeometryProgram->Name &&
     pipe->CurrentGeometryProgram->Name != pipe->CurrentVertexProgram->Name)

should have been

 if (pipe->CurrentVertexProgram->Name == pipe->CurrentFragmentProgram->Name &&
     pipe->CurrentGeometryProgram->Name != pipe->CurrentVertexProgram->Name)

v4 (idr): Rework to use CurrentProgram array in loops.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-03-25 10:25:26 -07:00
Gregory Hainaut
95426b28ac mesa/sso: Add _mesa_sampler_uniforms_pipeline_are_valid
This is much like _mesa_sampler_uniforms_are_valid, but it operates
across an entire pipeline object.

This function differs from _mesa_sampler_uniforms_are_valid in that it
directly creates the gl_pipeline_object::InfoLog instead of writing to
some temporary buffer.

This was originally included in another patch, but it was split out by
Ian Romanick.

v2 (idr): Fix the loop bounds.  shProg isn't an array, so
ARRAY_SIZE(shProg) was 1, so only the vertex program was validated.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-03-25 10:25:26 -07:00
Gregory Hainaut
aa46ad26b1 mesa/sso: Add gl_pipeline_object::InfoLog support
V2 (idr):
* Keep the behavior of other info logs in Mesa: and empty info log
  reports a GL_INFO_LOG_LENGTH of zero.
* Use a NULL pointer to denote an empty info log.
* Split out from previous uber patch.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-03-25 10:25:26 -07:00
Gregory Hainaut
658eaa3229 mesa/sso: Implement GL_PROGRAM_PIPELINE_BINDING for glGet
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-03-25 10:25:26 -07:00
Gregory Hainaut
9e9fac4714 mesa/sso: Implement _mesa_BindProgramPipeline
Test become green in piglit:

The updated ext_transform_feedback-api-errors:useprogstage_noactive useprogstage_active bind_pipeline
arb_separate_shader_object-GetProgramPipelineiv
arb_separate_shader_object-IsProgramPipeline

For the moment I reuse Driver.UseProgram but I guess it will be better
to create a UseProgramStages functions. Opinion is welcome

V2: formatting & rename

V3 (idr):
* Change spec references to core OpenGL versions instead of issues in the
  extension spec.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-03-25 10:25:25 -07:00
Gregory Hainaut
78578b7599 mesa/sso: Implement _mesa_UseProgramStages
Now arb_separate_shader_object-GetProgramPipelineiv should pass.

V3 (idr):
* Change spec references to core OpenGL versions instead of issues in
  the extension spec.
* Split out from previous uber patch.

v4 (idr): Use _mesa_has_geometry_shaders in _mesa_UseProgramStages to
detect availability of geometry shaders.

v5 (idr): Whitespace cleanup, use _mesa_lookup_shader_program_err
instead of open-coding it again, and update some comments at the end of
_mesa_UseProgramStages.  All suggested by Eric.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-03-25 10:25:25 -07:00
Gregory Hainaut
4caa9db71c mesa/sso: Add gl_pipeline_object parameter to _mesa_use_shader_program
Extend use_shader_program to support a different target. Allow to reuse the
function to update the pipeline state. Note I bypass the flush when target
isn't current. Maybe it would be better to create a new UseProgramStages
driver function

This was originally included in another patch, but it was split out by
Ian Romanick.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-03-25 10:25:25 -07:00
Gregory Hainaut
de4f85f52d meta/sso: Update meta to save and restore SSO state.
save and restore _Shader/Pipeline binding point. Rational we don't want any
conflict when the program will be unattached.

V2: formatting improvement

V3 (idr):
* Build fix.  The original patch added calls to _mesa_use_shader_program
  with 4 parameters, but the fourth parameter isn't added to that
  function until a much later patch.  Just drop that parameter for now.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-03-25 10:25:25 -07:00
Gregory Hainaut
c03477050a mesa/sso: rename Shader to the pointer _Shader
Basically a sed but shaderapi.c and get.c.
get.c => GL_CURRENT_PROGAM always refer to the "old" UseProgram behavior
shaderapi.c => the old api stil update the Shader object directly

V2: formatting improvement

V3 (idr):
* Rebase fixes after a block of code was moved from ir_to_mesa.cpp to
  shaderapi.c.
* Trivial reformatting.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-03-25 10:25:25 -07:00
Gregory Hainaut
b2bddaf7a0 mesa/sso: replace Shader binding point with _Shader
To avoid NULL pointer check a default pipeline object is installed in
_Shader when no program is current

The spec say that UseProgram/UseShaderProgramEXT/ActiveProgramEXT got an
higher priority over the pipeline object. When default program is
uninstall, the pipeline is used if any was bound.

Note: A careful rename need to be done now...

V2: formating improvement

V3 (idr):
* Build fix.  The original patch added calls to _mesa_use_shader_program
  with 4 parameters, but the fourth parameter isn't added to that
  function until a much later patch.  Just drop that parameter for now.
* Trivial reformatting.
* Updated comment of gl_context::_Shader

v4 (idr): Reformat spec quotations to look like spec quotations.  Update
comments describing what gl_context::_Shader can point to.  Bot
suggested by Eric.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-03-25 10:25:25 -07:00
José Fonseca
b995a010e6 llvmpipe: Simplify vertex and geometry shaders.
Eliminate lp_vertex_shader, as it added nothing over draw_vertex_shader.

Simplify lp_geometry_shader, as most of the incoming state is unneeded.
(We could also just use draw_geometry_shader if we were willing to peek
inside the structure.)

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Zack Rusin <zackr@vmware.com>
2014-03-25 12:54:39 +00:00
José Fonseca
ee89432a47 draw: Duplicate TGSI tokens in draw_pipe_pstipple module.
As done in draw_pipe_aaline and draw_pipe_aapoint modules.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Zack Rusin <zackr@vmware.com>
Cc: "10.0 10.1" <mesa-stable@lists.freedesktop.org>
2014-03-25 12:54:39 +00:00
Alexander von Gluck IV
7683fce878 haiku: Fix build through scons corrections and viewport fixes
* Add HAVE_PTHREAD, we do have pthread support wrappers now for
  non-native Haiku threaded applications.
* Viewport changed behavior recently breaking the build.
  We fix this by looking at the gl_context ViewportArray
  (Thanks Brian for the idea)

Acked-by: Brian Paul <brianp@vmware.com>
2014-03-24 19:01:53 -05:00
Kenneth Graunke
eccad18bd8 i965: For color clears, only disable writes to components that exist.
The SIMD16 replicated FB write message only works if we don't need the
color calculator to mask our framebuffer writes.  Previously, we bailed
on it if color_mask wasn't <true, true, true, true>.  However, this was
needlessly strict for formats with fewer than four components - only the
components that actually exist matter.

WebGL Aquarium attempts to clear a BGRX texture with the ColorMask set
to <true, true, true, false>.  This will work perfectly fine with the
replicated data message; we just bailed unnecessarily.

Improves performance of WebGL Aquarium on Iris Pro (at 1920x1080) by
abound 50%, and Bay Trail (at 1366x768) by over 70% (using Chrome 24).

v2: Use _mesa_format_has_color_component() to properly handle ALPHA
    formats (and generally be less fragile).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Tested-by: Dylan Baker <baker.dylan.c@gmail.com>
2014-03-24 14:46:05 -07:00
Kenneth Graunke
630bf288de mesa: Skip clearing color buffers when color writes are disabled.
WebGL Aquarium in Chrome 24 actually hits this.

v2: Move to core Mesa (wisely suggested by Ian); only consider
    components which actually exist.

v3: Use _mesa_format_has_color_component to determine whether components
    actually exist, fixing alpha format handling.

v4: Add a comment, as requested by Brian.  No actual code changes.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Tested-by: Dylan Baker <baker.dylan.c@gmail.com>
2014-03-24 14:45:03 -07:00
Kenneth Graunke
92234b1b2a mesa: Introduce a _mesa_format_has_color_component() helper.
When considering color write masks, we often want to know whether an
RGBA component actually contains any meaningful data.  This function
provides an easy way to answer that question, and handles luminance,
intensity, and alpha formats correctly.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Tested-by: Dylan Baker <baker.dylan.c@gmail.com>
2014-03-24 14:38:51 -07:00
Eric Anholt
0d99aef6c8 i965: Fix compiler warning about signed/unsigned.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-03-24 11:16:38 -07:00
Eric Anholt
4545ec1691 i965/gen8: Change the winsys MSAA blits from blorp to meta.
This gets us equivalent code paths on BDW and pre-BDW, except for stencil
(where we don't have MSAA stencil resolve code yet)

Improves MSAA-forced citybench by 7.94496% +/- 2.38429% (n=16).  Reduces
DRI2 MSAA glxgears performance by -12.3559% +/- 1.52845% (n=9).

v2: Move the new meta code to brw_meta_updownsample.c, name it
    brw_meta_updownsample(), add a comment about
    intel_rb_storage_first_mt_slice(), and rename that function and move
    the RB generation into it (review ideas by Ken).
v3: Fix 2 src vs dst pasteos in previous change.
v4: Skip this path pre-gen8 for now, until we can analyze the glxgears
    performance delta some more.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-03-24 11:15:05 -07:00
Eric Anholt
7ccb26fdec mesa: Stop skipping the FinishRenderTexture calls for winsys FBOs.
Now that BindRenderbufferTexImage() is a thing that drivers can do, winsys
FBOs *can* have NeedsFinishRenderTexture set.

v2: Keep the short-circuit for non-BindRenderbufferTexImage() drivers
    (review by Ken).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-03-24 11:15:04 -07:00
Eric Anholt
dd4b226184 i965: Skip reallocating the private MSAA miptree, unless it's resized.
Even if the singlesample_mt got reopened from DRI due to
pageflipping/buffer swapping, our private miptree shouldn't need any
changes.

Improves performance of a little swapbuffers-loving microbenchmark with
MSAA forced on, by 1.2371% +/- 0.624802% (n=102)

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-03-24 11:15:04 -07:00
Eric Anholt
44e944c87c i965: Simplify the no-reopening-the-winsys-buffer tests.
The formatting was weird, and the tests were duplicated, and it is
guaranteed that mt->region exists.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-03-24 11:15:04 -07:00
Eric Anholt
e07e7e9f89 i965: Don't forget to free the old singlesample_mt.
Fixes a memory leak with MSAA winsys buffers since my move of
singlesample_mt to the rb in 4e0924c5de

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-03-24 11:15:04 -07:00
Eric Anholt
41033509f2 i965: Add an env var for forcing window system MSAA.
Sometimes it would be nice to benchmark some app with MSAA versus not, but
it doesn't offer the controls you want.  Just provide a handy knob to
force the issue.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-03-24 11:15:04 -07:00
Matt Turner
764e25d79d i965/vec4: Eliminate dead writes to the flag register.
For each write, search previous instructions for unread writes to the
flag register and remove them. Note that this will not eliminate the
last unread write.

total instructions in shared programs: 788074 -> 788004 (-0.01%)
instructions in affected programs:     4930 -> 4860 (-1.42%)

Reviewed-by: Eric Anholt <eric@anholt.net>
2014-03-24 11:06:26 -07:00
Matt Turner
9cd51bb0c4 i965/vec4: Eliminate writes that are never read.
With an awful O(n^2) algorithm that searches previous instructions for
dead writes.

total instructions in shared programs: 805582 -> 788074 (-2.17%)
instructions in affected programs:     144561 -> 127053 (-12.11%)

Reviewed-by: Eric Anholt <eric@anholt.net>
2014-03-24 11:06:26 -07:00
Matt Turner
1b8f143a23 i965/vec4: Factor code out of DCE into a separate function.
Will be reused in the next commit.

Reviewed-by: Eric Anholt <eric@anholt.net>
2014-03-24 11:06:26 -07:00
Matt Turner
9630ba6c6e i965/vec4: Let dead code eliminate trim dead channels.
That is, modify

   mad dst, a, b, c

to be

   mad dst.xyz, a, b, c

if dst.w is never read.

total instructions in shared programs: 811869 -> 805582 (-0.77%)
instructions in affected programs:     168287 -> 162000 (-3.74%)

Reviewed-by: Eric Anholt <eric@anholt.net>
2014-03-24 11:06:26 -07:00
Matt Turner
dc0f5099fa i965/vec4: Track live ranges per-channel, not per vgrf.
Will be squashed with the next patch.

Reviewed-by: Eric Anholt <eric@anholt.net>
2014-03-24 11:06:26 -07:00
Matt Turner
89ccd11eeb i965/vec4: Don't dead code eliminate instructions writing the flag.
A future patch adds support for removing dead writes to the flag
register. This patch simplifies the logic until then.

total instructions in shared programs: 811813 -> 811869 (0.01%)
instructions in affected programs:     3378 -> 3434 (1.66%)

Reviewed-by: Eric Anholt <eric@anholt.net>
2014-03-24 11:06:26 -07:00
Matt Turner
3a12f50f9c i965/vec4: Preparatory clean up of dead_code_eliminate().
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-03-24 11:06:26 -07:00
Matt Turner
10dd6eca89 i965/vec4: Add is_null() method to dst_reg.
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-03-24 11:06:25 -07:00
Matt Turner
0884ce8f42 i965/vec4: Print the predicate in dump_instructions().
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-03-24 11:06:25 -07:00
Matt Turner
a6367dfc15 i965/vec4: Rename depends_on_flags() to reads_flag().
To be consistent with the fs backend.

Reviewed-by: Eric Anholt <eric@anholt.net>
2014-03-24 11:06:25 -07:00
Matt Turner
de4692f56c i965/vec4: Add and use vec4_instruction::writes_flag().
To be consistent with the fs backend. Also the instruction scheduler
incorrectly considered SEL with a conditional modifier to read the flag
register.

Reviewed-by: Eric Anholt <eric@anholt.net>
2014-03-24 11:06:25 -07:00
Matt Turner
b0d3205c2a i965/vec4: Add missing doxygen close brace.
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-03-24 11:06:25 -07:00
Chris Forbes
a419a1c565 mesa: Generate FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT earlier
The ARB_framebuffer_object spec lists this case before the
FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER and
FRAMEBUFFER_INCOMPLETE_READ_BUFFER cases.

Fixes two broken cases in piglit's fbo-incomplete test, if
ARB_ES2_compatibility is not advertised. (If it is, this is masked
because the FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER /
FRAMEBUFFER_INCOMPLETE_READ_BUFFER cases are removed by that extension)

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-03-25 06:49:25 +13:00
Chris Forbes
40d7b51953 mesa: Fix format matching checks for GL_INTENSITY* internalformats.
GL_INTENSITY has never been valid as a pixel format -- to get the memcpy
pack/unpack paths, the app needs to specify GL_RED as the pixel format
(or GL_RED_INTEGER for the integer formats).

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-03-25 06:47:50 +13:00
Christian König
92e543c45d st/mesa: recreate sampler view on context change v3
With shared glx contexts it is possible that a texture is create and used
in one context and then used in another one resulting in incorrect
sampler view usage.

v2: avoid template copy
v3: add XXX comment

Signed-off-by: Christian König <christian.koenig@amd.com>
Cc: "10.0 10.1" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-03-24 17:50:38 +01:00
Kenneth Graunke
eabfadf4af i965: Report the type of color clear in INTEL_DEBUG=blorp.
It's useful to know whether a clear is fast (MCS-based), using the
SIMD16 repdata message, or slow.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-03-23 00:32:53 -07:00
Marek Olšák
011569b5b7 radeonsi: disable fast color clear for 1D-tiled surfaces on CIK
This will be re-enabled once my kernel fix lands.
2014-03-22 18:44:58 +01:00
Kenneth Graunke
4c79f088c0 Revert "i965: For color clears, only disable writes to components that exist."
This reverts commit 2919c3fdb4.

For formats like BGRX, looping through 0..num_components works fine.
But for formats like XRGB, we'd check the color mask for X and fail to
check it for B.
2014-03-21 17:03:20 -07:00
Kenneth Graunke
2919c3fdb4 i965: For color clears, only disable writes to components that exist.
The SIMD16 replicated FB write message only works if we don't need the
color calculator to mask our framebuffer writes.  Previously, we bailed
on it if color_mask wasn't <true, true, true, true>.  However, this was
needlessly strict for formats with fewer than four components - only the
components that actually exist matter.

WebGL Aquarium attempts to clear a BGRX texture with the ColorMask set
to <true, true, true, false>.  This will work perfectly fine with the
replicated data message; we just bailed unnecessarily.

Improves performance of WebGL Aquarium on Iris Pro (at 1920x1080) by
abound 40%, and Bay Trail (at 1366x768) by over 70% (using Chrome 24).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Tested-by: Dylan Baker <baker.dylan.c@gmail.com>
2014-03-21 15:35:08 -07:00
Kenneth Graunke
a63db538ad i965: Print number of multisamples in INTEL_DEBUG=blorp output.
This lets us distinguish MSAA resolves from other ordinary blits.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2014-03-21 15:34:59 -07:00
Kenneth Graunke
9834058a91 i965: Drop BLT TexSubImage Y-tiling restriction on Gen6+.
Currently, we don't use this path on Sandybridge because we suspect
other paths will be faster.  But we potentially could.  If we do, we
should allow it to support Y-tiled BLTs.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-03-21 15:31:45 -07:00
Chris Forbes
351e13c5ad i965: Enable ARB_vertex_type_10f_11f_11f_rev for Gen4/5 also.
Tested on ILK and CTG (with the GL3isms taken out of the piglits).

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-03-22 09:19:55 +13:00
Tom Stellard
8d8d0cb09e clover: Fix typo in validate_object()
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2014-03-21 19:12:12 +01:00
Roland Scheidegger
9477d8c862 llvmpipe: add support for b5g6r5_srgb
The conversion code for srgb was tuned for n x 4x8bit AoS -> 4 x nxfloat SoA
(and vice versa), fix this to handle also 16bit 565-style srgb formats.
Still not really all that generic, things like r10g10b10a2_srgb or
r4g4b4a4_srgb wouldn't work (the latter trivial to fix, the former would not
require more work to not crash but near certainly need some higher precision
calculation) but not needed right now.
The code is not fully optimized for this (could use more direct calculation
instead of expanding to 8-bit range first) but should be good enough.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2014-03-21 17:23:38 +01:00
Roland Scheidegger
2aa77f2777 gallium: add b5g6r5 srgb format
GL generally doesn't seem to allow srgb formats with less (or more) than 8 bit
for the rgb channels, though some hw could easily do it (typically for formats
with up to 10 bits for the rgb channels, at least for formats with less than 8
bits support is likely widespread even). While it may be true there aren't
really any benefits for such formats, we need for it for d3d, though luckily
only for b5g6r5_srgb it seems.
So add this format along with the util code for conversion - since that util
code is heavily tuned for 8bit srgb this isn't really all that well optimized
and rounding doesn't seem right but at least it should give some halfway
meaningful results.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2014-03-21 17:23:38 +01:00
Ilia Mirkin
19ba573a57 nvc0/ir: move sample id to second source arg to fix sampler2DMS
The nvc0 texfetch instruction expects the sample id to be in the second
source (usually used for the offset) rather than as part of the texture
coordinate.

This fixes all the sampler2DMS/Array tests on nvc0.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Christoph Bumiller <e0425955@student.tuwien.ac.at>
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
2014-03-20 20:47:47 -04:00
Marek Olšák
e5f6b6d0fe st/mesa: drop the lowering of quad strips to triangle strips
This fallback to triangle strips is silly and should be done in drivers
if they need it.

This should fix the case when quad strips are used with flatshading that is
enabled by the "flat" GLSL varying modifier. It also fixes primitive restart
for quad strips.

This fixes piglit:
  NV_primitive_restart/primitive-restart-draw-mode-quad_strip

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-03-21 00:50:53 +01:00
Marek Olšák
2706448a10 gallium/u_gen_mipmap: remove the software fallback
The last changes to it are from 2008 and 2009.
It doesn't support most texture formats and some texture targets.
Nobody can possibly be using this.

Reviewed-by: Brian Paul <brianp@vmware.com>
2014-03-21 00:50:53 +01:00
Marek Olšák
db722bdcab st/mesa: fix generating mipmaps for cube arrays
Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-03-21 00:50:53 +01:00
Marek Olšák
91df26842f mesa: fix software fallback for generating mipmaps for 3D textures
It didn't use the driver-provided src/dstRowStride at all.
This was broken for the cases when stride != width*bpp.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-03-21 00:50:53 +01:00
Marek Olšák
78c60d1b63 mesa: fix software fallback for generating mipmaps for cube arrays
Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-03-21 00:50:53 +01:00
Marek Olšák
185ad78ffd mesa: allow generating mipmaps for cube arrays
Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-03-21 00:50:53 +01:00
Marek Olšák
55cf320ed8 mesa: fix texture border handling for cube arrays
Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-03-21 00:50:53 +01:00
Marek Olšák
54690a5f3b r600g: use more appropriate names for async DMA functions
*_dma_copy calls either *_dma_copy_buffer or *_dma_copy_tile.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-03-20 19:03:40 +01:00
Marek Olšák
6c487ff3bd r600g: deobfuscate async DMA code
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-03-20 18:56:11 +01:00
Marek Olšák
2c703ee8ad r600g: don't flush the gfx IB explicitly before doing DMA
It's flushed by calling r600_context_bo_reloc.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-03-20 18:41:18 +01:00
Marek Olšák
e914d0052f winsys/radeon: only add duplicate relocations for DMA if VM isn't supported
Also rewrite the comment for it to be readable and reorder the code.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2014-03-20 18:41:17 +01:00
Niels Ole Salscheider
71254732db radeonsi: Implement DMA blit
This code is a slightly modified version of evergreen_dma_blit (and
evergreen_dma_copy as well as evergreen_dma_copy_tile).
It would be nice to share some of the code in the long term.

I have reused some "cik"-prefixed functions that also return the right
value for SI. I am not sure if they should be renamed.

v2: Marek> removed gfx.flush in si_dma_copy_tile

Signed-off-by: Niels Ole Salscheider <niels_ole@salscheider-online.de>
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
2014-03-20 17:21:16 +01:00
Niels Ole Salscheider
acf55e7325 radeon: Move r600_need_dma_space to common code
Signed-off-by: Niels Ole Salscheider <niels_ole@salscheider-online.de>
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
2014-03-20 17:21:16 +01:00
Richard Sandiford
f4b3430a36 llvmpipe: Tighten check for alpha-only formats
The AoS version of ld_build_blend_factor was assuming that if the first
channel was alpha, there were no rgb components.

Fixes glean/blendFunc on System z.  No piglit regressions on x86_64.
The shortcut is still used in tests like spec/ARB_framebuffer_object/
fbo-alpha.

Signed-off-by: Richard Sandiford <rsandifo@linux.vnet.ibm.com>
2014-03-20 16:50:40 +01:00
Jonathan Gray
8044fd6769 nouveau: don't assume libdrm include prefix
drm headers may be installed in a different directory

Signed-off-by: Jonathan Gray <jsg@jsg.id.au>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-03-20 08:32:12 -04:00
Jonathan Gray
8fbc9d9b6f nouveau: use DLOPEN_LIBS instead of -ldl
libdl does not exist on many platforms which have dlopen in libc.

Signed-off-by: Jonathan Gray <jsg@jsg.id.au>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-03-20 08:32:12 -04:00
Brian Paul
eaf9affa5e c11/threads: don't include assert.h if the assert macro is already defined
In the gallium code, the assert() macro could come from either the
system's assert.h file (via c11/threads.h) or from gallium's u_debug.h.
It looks like all known assert.h files unconditionally #undef assert
before defining their own version.  So the assert you get depends on
whether threads.h or u_debug.h was included last.

In the gallium code we really want to use the assert() from u_debug.h
(it behaves better on Windows).  In gallium, c11/threads.h is only
included after u_debug.h in the os_thread.h wrapper.  So Adding
an #ifndef assert test in the threads*.h files avoids using the system's
assert().

Cc: "10.1" <mesa-stable@lists.freedesktop.org>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2014-03-19 17:13:31 -06:00
Ilia Mirkin
e58071355e nouveau: there may not have been a texture if the fbo was incomplete
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Cc: "10.0 10.1" <mesa-stable@lists.freedesktop.org>
2014-03-19 18:20:29 -04:00
Ilia Mirkin
b676df9abf nouveau: add forgotten GL_COMPRESSED_INTENSITY to texture format list
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Cc: "10.0 10.1" <mesa-stable@lists.freedesktop.org>
2014-03-19 18:17:40 -04:00
Ilia Mirkin
18690995a6 mesa/main: condition GL_DEPTH_STENCIL on ARB_depth_texture
EXT_packed_depth_stencil is supported by all drivers, but
ARB_depth_texture isn't (notably nouveau_vieux). This should avoid
passing unexpected values down to ChooseTextureFormat.

The EXT_packed_depth_stencil spec does not make any explicit references
to requiring ARB_depth_texture in order to allow textures with that
format, however if there is no dependency, ARB_depth_texture would be
practically implied by the extension.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Cc: "10.0 10.1" <mesa-stable@lists.freedesktop.org>

Note for 10.0 backport: This will produce a conflict, the solution is to
move the surrounding if as well.
2014-03-19 18:17:40 -04:00
Ilia Mirkin
51989817e6 loader: add special logic to distinguish nouveau from nouveau_vieux
There are a lot of different pci ids supported by nouveau, and more are
added all the time. The relevant distinguisher between drivers is the
chipset id.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
2014-03-19 18:17:40 -04:00
Matt Turner
c049dd4396 glsl: Allow dot() on scalars, and throw out dotlike().
In all uses of dotlike() we're writing generic code that operates on 1-4
component vectors. That our IR requires ir_binop_dot expressions'
operands to be 2+ component vectors is an implementation detail that's
not important when implementing built-in functions with dot(), which is
defined for scalar floats in GLSL.

Reviewed-by: Eric Anholt <eric@anholt.net>
2014-03-18 23:20:29 -07:00
Matt Turner
6cbc64c3cb glsl: Optimize pow(x, 2) into x * x.
Cuts two instructions out of SynMark's Gl32VSInstancing benchmark.

Reviewed-by: Eric Anholt <eric@anholt.net>
2014-03-18 23:20:29 -07:00
Matt Turner
9a9eaaa79a glsl: Match whitespace changes from previous patch.
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-03-18 23:20:29 -07:00
Matt Turner
7988b4804f glsl: Expose pack/unpack built-ins for ARB_gpu_shader5.
ARB_gpu_shader5 and ES 3.0 expose different subsets of
ARB_shading_language_packing.

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-03-18 23:20:29 -07:00
Eric Anholt
651b8baa82 i965: Drop some more dead code from the old CACHED_BATCH feature.
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-03-18 14:45:09 -07:00
Eric Anholt
512c88f826 i965: Drop special case for edgeflag thanks to Marek's change to core.
As of 780ce576bb, we end up with R8_SSCALED
anyway.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-03-18 14:45:09 -07:00
Brian Paul
f4435da940 mesa: include stdbool.h in register_allocate.h to fix build
https://bugs.freedesktop.org/show_bug.cgi?id=76331
2014-03-18 13:28:17 -06:00
Ian Romanick
f74cf5f80e i965: Enable EWA anisotropic filtering algorithm
Volume 4, part 1 of the Ivybridge PRM says, "Generally, the EWA
approximation algorithm results in higher image quality than the legacy
algorithm."  Using a classic anisotropic filtering "tunnel" demo, it
appears that there is *no* anisotropic filtering on IVB without this bit
set.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-03-18 10:56:38 -07:00
Kenneth Graunke
dd2e5d3999 i965: Actually initialize simd16_unsupported and no16_msg.
I meant to include this fixes in v3 of commit
de7ad2c88f, but accidentally pushed a
previous version.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2014-03-18 10:50:48 -07:00
Kenneth Graunke
91f4528da6 i965/upload: Refactor open-coded ALIGN-like computations.
Sadly, we can't use actual ALIGN(), since that only supports
power-of-two values for the alignment parameter.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-03-18 10:39:04 -07:00
Kenneth Graunke
b8b4e280b4 i965: Fix indentation in brw_upload_indices().
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-03-18 10:38:48 -07:00
Kenneth Graunke
051edcc144 i965: Consolidate code for setting brw->ib.start_vertex_offset.
This was set identically in three places.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-03-18 10:38:44 -07:00
Kenneth Graunke
7a0fd3ca1d i965: Allocate register sets at screen creation, not context creation.
Register sets depend on the particular hardware generation, but don't
depend on anything in the actual OpenGL context.  Computing them is
fairly expensive, and they take up a large amount of memory.  Putting
them in the screen allows us to compute/allocate them once for all
contexts, saving both time and space.

Improves the performance of a context creation/destruction
microbenchmark by about 3x on my Haswell i7-4750HQ.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-03-18 10:35:53 -07:00
Kenneth Graunke
b3e4b769dd i965: Allocate the screen using ralloc rather than calloc.
This will allow us to use the screen as a memory context.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-03-18 10:31:12 -07:00
Eric Anholt
41097db91b ra: Convert another bool array to bitsets.
This one saves about 2MB peak allocation in glsl-fs-algebraic-add-add-1,
with no performance difference on timing short shader-db runs (n=9/10,
warmup outlier removed).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-03-18 10:20:28 -07:00
Kenneth Graunke
da1cce2d68 ra: Use a bitset for storing which registers belong to a class.
This should use 1/8 the memory.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Christoph Brill <egore911@gmail.com>
2014-03-18 10:15:24 -07:00
Kenneth Graunke
8d856c3937 ra: Create a reg_belongs_to_class() helper function.
This is a little easier to read.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Christoph Brill <egore911@gmail.com>
2014-03-18 10:15:23 -07:00
Kenneth Graunke
786a647245 ra: Use bool instead of GLboolean.
This isn't the GL API, so there's no reason to use GLboolean.

Using bool is safer: any non-zero value is treated as "true".  When
converting a value to a GLboolean, all but the low byte is discarded,
which means that values like 256 will be incorrectly rendered as false.

Done via the following vim commands:
:%s/GLboolean/bool/g
:%s/GL_TRUE/true/g
:%s/GL_FALSE/false/g
and one line of manual whitespace tidying.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-03-18 10:15:18 -07:00
Kenneth Graunke
de7ad2c88f i965: Accurately bail on SIMD16 compiles.
Ideally, we'd like to never even attempt the SIMD16 compile if we could
know ahead of time that it won't succeed---it's purely a waste of time.
This is especially important for state-based recompiles, which happen at
draw time.

The fragment shader compiler has a number of checks like:

   if (dispatch_width == 16)
      fail("...some reason...");

This patch introduces a new no16() function which replaces the above
pattern.  In the SIMD8 compile, it sets a "SIMD16 will never work" flag.
Then, brw_wm_fs_emit can check that flag, skip the SIMD16 compile, and
issue a helpful performance warning if INTEL_DEBUG=perf is set.  (In
SIMD16 mode, no16() calls fail(), for safety's sake.)

The great part is that this is not a heuristic---if the flag is set, we
know with 100% certainty that the SIMD16 compile would fail.  (It might
fail anyway if we run out of registers, but it's always worth trying.)

v2: Fix missing va_end in early-return case (caught by Ilia Mirkin).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz> [v1]
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> [v1]
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-03-18 10:11:38 -07:00
Kenneth Graunke
b207e88b25 i965/fs: Support pull parameters in SIMD16 mode.
This is just a matter of reusing the pull/push constant information set
up by the SIMD8 compile.

This gains us 78 SIMD16 programs in shader-db.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-03-18 10:11:36 -07:00
Kenneth Graunke
229319e0f0 i965/fs: Use a single instance of the pull_constant_loc[] array.
Now that we don't renumber uniform registers, assign_constant_locations
and move_uniform_array_access_to_pull_constants use the same names.
So, they can share a single copy of the pull_constant_loc[] array.

This simplifies the code considerably.  assign_constant_locations()
doesn't need to walk through pull_params[] to rediscover reladdr
demotions; it just has that information in pull_constant_loc[].  We also
only need to rewrite the instruction stream once, instead of twice.

Even better, we now have a single array describing the layout of
all pull parameters, which we can pass to the SIMD16 program.

This actually hurts a few shaders in Serious Sam 3, and one in KWin:
total instructions in shared programs: 1841957 -> 1842035 (0.00%)
instructions in affected programs:     1165 -> 1243 (6.70%)
Comparing dump_instructions() before and after the pull constant
transformations with and without this patch, it appears that there is
a uniform array with variable indexing (reladdr) and constant indexing
(of array element 0).  Previously, we uploaded array element 0 as both
a pull constant (for reladdr) /and/ a push constant.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-03-18 10:11:32 -07:00
Kenneth Graunke
542f2e47f2 i965/fs: Don't renumber UNIFORM registers.
Previously, remove_dead_constants() would renumber the UNIFORM registers
to be sequential starting from zero, and the resulting register number
would be used directly as an index into the params[] array.

This renumbering made it difficult to collect and save information about
pull constant locations, since setup_pull_constants() and
move_uniform_array_access_to_pull_constants() used different names.

This patch generalizes setup_pull_constants() to decide whether each
uniform register should be a pull constant, push constant, or neither
(because it's unused).  Then, it stores mappings from UNIFORM register
numbers to params[] or pull_params[] indices in the push_constant_loc
and pull_constant_loc arrays.  (We already did this for pull constants.)

Then, assign_curb_setup() just needs to consult the push_constant_loc
array to get the real index into the params[] array.

This effectively folds all the remove_dead_constants() functionality
into assign_constant_locations(), while being less irritable to work
with.

v2: Add assert(remapped <= i), requested by Topi.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-03-18 10:11:29 -07:00
Kenneth Graunke
d9f339eccd i965/fs: Split pull parameter decision making from mechanical demoting.
move_uniform_array_access_to_pull_constants() and setup_pull_constants()
both have two parts:

1. Decide which UNIFORM registers to demote to pull constants, and
   assign locations.
2. Mechanically rewrite the instruction stream to pull the uniform
   value into a temporary VGRF and use that, eliminating the UNIFORM
   file access.

In order to support pull constants in SIMD16 mode, we will need to make
decisions exactly once, but rewrite both instruction streams.
Separating these two tasks will make this easier.

This patch introduces a new helper, demote_pull_constants(), which
takes care of rewriting the instruction stream, in both cases.

For the moment, a single invocation of demote_pull_constants can't
safely handle both reladdr and non-reladdr tasks, since the two callers
still use different names for uniforms due to remove_dead_constants()
remapping of things.  So, we get an ugly boolean parameter saying
which to do.  This will go away.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-03-18 10:11:26 -07:00
Kenneth Graunke
2163e0fd5a i965/fs: Record pull constant locations for all array elements.
When demoting a variably indexed uniform array to pull constants, we
only recorded the location for the base of the array (element 0).

Recording locations for all array elements is a trivial amount of code
and will make subsequent refactoring easier.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-03-18 10:11:24 -07:00
Kenneth Graunke
7c7627781f i965/fs: Save push constant location information.
Previously, both move_uniform_array_access_to_pull_constants() and
setup_pull_constants() maintained stack-local arrays with this
information.  Storing this information will allow it to be used from
multiple functions, allowing us to split and move code around.

We'll also eventually want to pass pull constant location information
to the SIMD16 compile.  Saving this information will help us do that.

Unfortunately, the two functions *cannot* share the contents of the
array just yet.  remove_dead_constants() renumbers all the UNIFORM
registers to be contiguous starting at zero, so the two functions
talk about uniforms using different names.  We can't even remap them,
since move_uniform_array_access_to_pull_constants() deletes UNIFORM
registers that are only accessed with reladdr, so remove_dead_constants
can't even see them.

This situation will improve in the next few patches.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-03-18 10:11:21 -07:00
Kenneth Graunke
de77efde91 i965/fs: Delete dead code to fail compiles with SIMD16 pull parameters.
The SIMD8 compile will determine whether pull parameters are necessary.
If so, it will set prog_data->nr_pull_params to a value greater than 0.

brw_wm_fs_emit checks if nr_pull_params > 0 and skips the SIMD16 compile
altogether.  So, this code should never occur.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-03-18 10:11:08 -07:00
Brian Paul
63e7b51912 gallium/docs: update SLT, SGE, SFL, STR opcode docs
To emphasize that the result is floating point 1.0 or 0.0, to match
other opcodes like SLE and SEQ.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-03-18 08:03:27 -06:00
Charmaine Lee
81f342ce64 glx: Fix incorrect pdp assignment in dri2_bind_context().
pdp should be set to dpyPriv->dri2Display.
Fixes blank frame failure running glretrace ClearView.

Reviewed-by: Brian Paul <brianp@vmware.com>
2014-03-18 08:03:27 -06:00
Maarten Lankhorst
8fe888fafd nvc0: Handle user mapped vertex buffer for edgeflag
Handle mapping edgeflag data similar to the code around it.
This fixes a crash in piglit test gl-2.0-edgeflag.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
2014-03-18 14:51:06 +01:00
Francisco Jerez
d70ad1a4f9 clover: Fix region size error checking in some buffer transfer commands.
Tested-by: Tom Stellard <thomas.stellard@amd.com>
2014-03-18 12:14:46 +01:00
Ilia Mirkin
c8309cde30 nv50/ir/gk110: add postfactor support for fmul
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-03-18 05:56:55 -04:00
Ilia Mirkin
d8e0d1e882 nv50/ir/gk110: set not modifier on first source of logic op
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-03-18 05:56:55 -04:00
Ilia Mirkin
b56e50b8af nv50/ir/gk110: use shl/shr instead of lshf/rshf so that c[] is supported
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-03-18 05:56:55 -04:00
Ilia Mirkin
34bf5e27c6 nv50/ir/gk110: add 64/128-bit fetch/export support
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-03-18 05:56:55 -04:00
Ilia Mirkin
3c40be2615 nv50/ir/gk110: fix handling of OP_SUB for floating point ops
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-03-18 05:56:54 -04:00
Ilia Mirkin
72310869f0 nv50/ir/gk110: presin/preex2 take their source at bit 23
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-03-18 05:56:54 -04:00
Ilia Mirkin
48a9ba63f5 nv50/ir/gk110: add implementations of div u32/s32
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-03-18 05:56:54 -04:00
Ilia Mirkin
4bb14aca29 nv50/ir/gk110: implement quadop
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-03-18 05:56:54 -04:00
Ilia Mirkin
67cb8a6996 nv50/ir/gk110: fill in mov from predicate
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-03-18 05:56:54 -04:00
Ilia Mirkin
563083ef57 nv50/ir/gk110: handle derivAll flag, fix useOffsets for non-txf
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-03-18 05:56:54 -04:00
Ilia Mirkin
ece734b3c1 nv50/ir/gk110: fix setting texture for txd/txf/txq
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-03-18 05:56:54 -04:00
Ilia Mirkin
08505549ab nv50/ir/gk110: add texcsaa implementation
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-03-18 05:56:54 -04:00
Ilia Mirkin
c17f7247ec nv50/ir/gk110: add pfetch support
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-03-18 05:56:54 -04:00
Ilia Mirkin
15b1f420d0 nv50/ir/gk110: add emit/restart implementations
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-03-18 05:56:53 -04:00
Ilia Mirkin
1b68009466 nv50/ir/gk110: add missing break in sched emit
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-03-18 05:56:53 -04:00
Ilia Mirkin
76554d2d1f nv50/ir/gk110: implement partial txq support
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-03-18 05:56:53 -04:00
Ilia Mirkin
cb3dcb1430 nv50/ir/gk110: fill out texture instruction support
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-03-18 05:56:53 -04:00
Ilia Mirkin
ce75a3e8d3 nv50/ir/gk110: fix control flow opcode emission, add sat flag
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-03-18 05:56:34 -04:00
Chad Versace
468cc866b4 egl/main: Enable Linux platform extensions
Enable EGL_EXT_platform_base and the Linux platform extensions layered
atop it: EGL_EXT_platform_x11, EGL_EXT_platform_wayland,
and EGL_MESA_platform_gbm.

Tested with Piglit's EGL_EXT_platform_base tests under an X11 session.
To enable running the Wayland and GBM tests, windowed Weston was running
and the kernel had render nodes enabled.

I regression tested my EGL_EXT_platform_base patch set with Piglit on
Ivybridge under X11/EGL, standalone Weston, and GBM with rendernodes. No
regressions found.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2014-03-17 15:49:06 -07:00
Chad Versace
9a40ee16d0 egl/wayland: Emit EGL_BAD_PARAMETER for eglCreatePlatformPixmapSurface
From the EGL_EXT_wayland_spec, version 3:

  It is not valid to call eglCreatePlatformPixmapSurfaceEXT with a <dpy>
  that belongs to Wayland. Any such call fails and generates
  EGL_BAD_PARAMETER.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2014-03-17 15:39:23 -07:00
Chad Versace
1787f5632f egl/gbm: Emit EGL_BAD_PARAMETER for eglCreatePlatformPixmapSurface
From the EGL_MESA_platform_gbm spec, version 5:

  It is not valid to call eglCreatePlatformPixmapSurfaceEXT with a <dpy>
  that belongs to the GBM platform. Any such call fails and generates
  EGL_BAD_PARAMETER.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2014-03-17 15:39:23 -07:00
Chad Versace
6d1f83ec09 egl/main: Stop using EGLNative types internally
Internally, much of the EGL code uses EGLNativeDisplayType,
EGLNativeWindowType, and EGLPixmapType. However, the EGLNative type
often does not match the variable's actual type.

The concept of EGLNative types are a bad match for Linux, as explained
below. And the EGL platform extensions don't use EGLNative types at all.
Those extensions attempt to solve cross-platform issues by moving the
EGL API away from the EGLNative types.

The core of the problem is that eglplatform.h can define each EGLNative
type once only, but Linux supports multiple EGL platforms.

To work around the problem, Mesa's eglplatform.h contains multiple
definitions of each EGLNative type, selected by feature macros. Mesa
expects EGL clients to set the feature macro approrpiately. But the
feature macros don't work when a single codebase must be built with
support for multiple EGL platforms, *such as Mesa itself*.

When building libEGL, autotools chooses the EGLNative typedefs based on
the first element of '--with-egl-platforms'. For example,
'--with-egl-platforms=x11,drm,wayland' defines the following:

    typedef Display* EGLNativeDisplayType;
    typedef Window   EGLNativeWindowType;
    typedef Pixmap   EGLNativePixmapType;

Clearly, this doesn't work well for Wayland and GBM.  Mesa works around
the problem by casting the EGLNative types to different things in
different files.

For sanity's sake, and to prepare for the EGL platform extensions, this
patch removes from egl/main and egl/dri2 all internal use of the
EGLNative types. It replaces them with 'void*' and checks each explicit
cast with a static assertion. Also, the patch touches egl_gallium the
minimal amount to keep it compatible with eglapi.h.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2014-03-17 15:39:23 -07:00
Chad Versace
cefa06cd69 egl: Add STATIC_ASSERT() macro
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2014-03-17 15:39:23 -07:00
Chad Versace
eef68a9094 egl/dri2: Dispatch eglCreateImageKHR by display, not driver
Add dri2_egl_display_vtbl::create_image, set it for each platform, and
let egl_dri2 dispatch eglCreateImageKHR to that.

To remove ambiguity, rename egl_dri2.c:dri2_create_image() to
dri2_create_image_from_dri().

This prepares for the EGL platform extensions.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2014-03-17 15:39:23 -07:00
Chad Versace
88b9e600a6 egl/dri2/x11: Don't clobber _EGLDriver::API
dri2_initialize_x11_swrast() does a strange thing. For some extensions
it doesn't support, it sets the corresponding functions in
_EGLDriver::API to NULL. The intention here is clear, but misplaced.

NULL or not, the function pointers never get called because their
extensions aren't supported.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2014-03-17 15:39:23 -07:00
Chad Versace
eadd5e0c0a egl/dri2: Dispatch eglCreateWaylandBufferFromImageWL by display, not driver
Add dri2_egl_display_vtbl::create_wayland_buffer_from_image, set it for
each platform, and let egl_dri2 dispatch
eglCreateWaylandBufferFromImageWL to that.

This prepares for the EGL platform extensions.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2014-03-17 15:39:22 -07:00
Chad Versace
f506ef6784 egl/dri2: Consolidate eglTerminate
egl_dri2.c:dri2_terminate() handled terminating X11 and DRM displays.
The Wayland platform implemented its own dri2_wl_terminate(), which was
nearly a copy of the common one.

To implement the EGL platform extensions, we either need to dispatch
eglTerminate per display or define a common implementation for all
platforms. This patch chooses consolidation.  It removes
dri2_wl_terminate() by folding it into the common dri2_terminate().

It was necessary to invert the `if (disp->PlatformDisplay == NULL)` and
the switch statement because, unlike DRM and X11, Wayland's terminator
performed action even when EGL didn't own the native display. In the
inversion, I replaced `disp->PlatformDisplay == NULL` with
`dri2_dpy->own_device` because the two expressions are synonymous, but
the latter's meaning is clearer.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2014-03-17 15:39:22 -07:00
Chad Versace
31cd0fee31 egl/dri2/x11: Set dri2_dpy->own_device
When the user calls eglGetDisplay(EGL_DEFAULT_DISPLAY), the Wayland and
DRM platforms set dri2_dpy->own_device=true. This patch makes the X11
platform do the same for consistency.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2014-03-17 15:39:22 -07:00
Chad Versace
688a0e8e73 egl/dri2: Dispatch eglPostSubBufferNV by display, not driver
Add dri2_egl_display_vtbl::post_sub_buffer, set it for each
platform, and let egl_dri2 dispatch eglPostSubBufferNV to that.

This prepares for the EGL platform extensions.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2014-03-17 15:36:04 -07:00
Chad Versace
75d398ed93 egl/dri2: Dispatch eglSwapBuffersRegionNOK by display, not driver
Add dri2_egl_display_vtbl::swap_buffers_region, set it for each
platform, and let egl_dri2 dispatch eglSwapBuffersRegionNOK to that.

This prepares for the EGL platform extensions.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2014-03-17 15:36:04 -07:00
Chad Versace
bc2cbc0951 egl/dri2: Dispatch eglCopyBuffers by display, not driver
Add dri2_egl_display_vtbl::copy_buffers, set it for each
platform, and let egl_dri2 dispatch eglCopyBuffers to that.

This prepares for the EGL platform extensions.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2014-03-17 15:36:04 -07:00
Chad Versace
3fdfbd2572 egl/dri2: Dispatch API.QueryBufferAge by display, not driver
Add dri2_egl_display_vtbl::query_buffer_age, set it for each
platform, and let egl_dri2 dispatch API.QueryBufferAge to that.

This prepares for the EGL platform extensions.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2014-03-17 15:36:04 -07:00
Chad Versace
958dd80c40 egl/dri2: Dispatch eglDestroySurface by display, not driver
Add dri2_egl_display_vtbl::destroy_surface, set it for each
platform, and let egl_dri2 dispatch eglDestroySurface to that.

This prepares for the EGL platform extensions.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2014-03-17 15:36:04 -07:00
Chad Versace
bf20076baf egl/dri2: Dispatch eglCreatePbufferSurface by display, not driver
Add dri2_egl_display_vtbl::create_pbuffer_surface, set it for each
platform, and let egl_dri2 dispatch eglCreatePbufferSurface to that.

This prepares for the EGL platform extensions.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2014-03-17 15:36:04 -07:00
Chad Versace
bc8b07a657 egl/dri2: Dispatch eglCreatePixmapSurface by display, not driver
Add dri2_egl_display_vtbl::create_pbuffer_surface, set it for each
platform, and let egl_dri2 dispatch eglCreatePixmapSurface to that.

This prepares for the EGL platform extensions.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2014-03-17 15:36:04 -07:00
Chad Versace
0a0c881a13 egl/dri2: Dispatch eglCreateWindowSurface by display, not driver
Add dri2_egl_display_vtbl::create_window_surface, set it for each
platform, and let egl_dri2 dispatch eglCreateWindowSurface to that.

This prepares for the EGL platform extensions.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2014-03-17 15:36:03 -07:00
Chad Versace
d03948a766 egl/dri2: Dispatch eglSwapBuffersWithDamage by display, not driver
Add dri2_egl_display_vtbl::swap_buffers_with_damage, set it for each
platform, and let egl_dri2 dispatch eglSwapBuffersWithDamageEXT to that.

This prepares for the EGL platform extensions.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2014-03-17 15:36:03 -07:00
Chad Versace
ad173bcfdb egl/dri2: Dispatch eglSwapBuffers by display, not driver
Add dri2_egl_display_vtbl::swap_buffers, set it for each platform, and
let egl_dri2 dispatch eglSwapBuffers to that.

This prepares for the EGL platform extensions.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2014-03-17 15:36:03 -07:00
Chad Versace
8b9298af0a egl/dri2: Dispatch eglSwapInterval by display, not driver
Add dri2_egl_display_vtbl::swap_interval, set it for each platform, and
let egl_dri2 dispatch eglSwapInterval to that.

This prepares for the EGL platform extensions.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2014-03-17 15:36:03 -07:00
Chad Versace
a218765478 egl/wl,x11: Call dri2_swap_interval() statically
Don't call it through the driver dispatch table. Just call it
statically.

This prepares for the EGL platform extensions.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2014-03-17 15:36:03 -07:00
Chad Versace
d019cd81b5 egl/dri2: Put platform func names into proper namespaces
Each of the egl_dri2 platforms (except Android) prefix their function
names with "dri2", not "dri2_${platform}". This means many function
names have three separate definitions in the egl_dri2 directory: one in
each of platform_drm.c, platform_wayland.c, and platform_x11.c. For
example, each of the three files defines dri2_create_window_surface().

The name collisions make it difficult to review patches for correctness
("Is this patch hunk calling a platform_x11 function or a global
egl_dri2 function?"), complicate debugging, and confuse code navigation
tools.

For each function in platform_x11.c prefixed with 'dri2', this patch
changes its prefix to 'dri2_x11'. Likewise for platform_drm.c and
'dri2_drm'; and platform_wayland.c and 'dri2_wl'.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2014-03-17 15:36:03 -07:00
Chad Versace
90502b18b2 egl/dri2: Move dri2_egl_display virtual funcs to vtbl
dri2_egl_display has only one virtual function, 'authenticate'.  Define
dri2_egl_display::vtbl and move 'authenticate' there.

This prepares for the EGL platform extensions, which will add many
more virtual functions to dri2_egl_display.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2014-03-17 15:36:03 -07:00
Chad Versace
38848b6217 egl: Update to revision 24567 of eglext.h
This pulls in EGL_EXT_platform_base, EGL_EXT_platform_wayland,
EGL_EXT_platform_x11, and EGL_MESA_platform_gbm.

This patch has a lot of churn because Khronos recently changed its
method of generating headers. Khronos now generates it headers from XML.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2014-03-17 15:36:03 -07:00
Michel Dänzer
7e0396dd73 winsys/radeon: Store GPU virtual memory addresses of BOs in a hash table
This allows retrieving the existing BO and incrementing its reference count,
instead of creating a separate winsys representation for it, when the kernel
reports that the BO was already assigned a virtual memory address.

This fixes problems with XWayland using radeonsi and the
xf86-video-wlglamor driver, which calls GEM flink outside of the radeon
winsys code and creates BOs from the flinked names using the same DRM file
descriptor.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-03-17 11:53:59 +09:00
Chia-I Wu
361902ec04 targets/dri-ilo: make the driver installable
install-gallium-links.mk fails to create the compat link for ilo_dri.so
because it looks for dri_LTLIBRARIES instead of noinst_LTLIBRARIES.  Fix this
by switching to dri_LTLIBRARIES (and make the driver installable).

Since pci_id_driver_map.h and the DDX both tell libGL.so to look for "i965",
ilo_dri.so will never be loaded even enabled and installed.  The change should
not create any more confusion.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-03-16 13:26:22 +08:00
Marek Olšák
2e361160ff mesa: mark GL_RGB9_E5 as not color-renderable
The GL 4.4 spec says it's not color-renderable and not accepted
by RenderBufferStorage. The EXT_texture_shared_exponent spec says
it's not color-renderable but it's accepted by RenderBufferStorageEXT.
This seems to be a bug in the extension spec.

Let's do what GL 4.4 says.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-03-15 18:39:50 +01:00
Aaron Watry
ec1ada7327 radeonsi/compute: Fix memory leak
Free shader buffer object for all kernels when deleting compute state.

Signed-off-by: Aaron Watry <awatry@gmail.com>
2014-03-15 11:59:19 -05:00
Marek Olšák
8199d149ed st/mesa: remove _NEW_POLYGON dependency from vertex shader
We can just check the polygon mode when updating the edge flag state.
Also, we can just flag ST_NEW_VERTEX_PROGRAM directly, which makes
ST_NEW_EDGEFLAGS_DATA useless.
2014-03-15 17:47:36 +01:00
Marek Olšák
4e634c5240 st/mesa: implement zero-stride edge flag by culling primitives
This was unimplemented.
2014-03-15 17:47:36 +01:00
Marek Olšák
3d42696d10 st/mesa: fix per-vertex edge flags and GLSL support (v2)
This fixes piglit/gl-2.0-edgeflag.

v2: use StrideB to recognize per-vertex edge flags

Cc: mesa-stable@lists.freedesktop.org
2014-03-15 17:47:35 +01:00
Kenneth Graunke
7554539d7e i965/fs: Invalidate live intervals when demoting uniforms to pull params.
Normally, nothing uses live intervals at this point, so this isn't
necessary.  However, dump_instructions() calculates them and uses them
to show register pressure.  So, calling dump_instructions() in this area
of the code would segfault due to the arrays being the wrong size.

This is not a candidate for stable branches because it only serves to
fix internal debugging code that you manually have to invoke by altering
the source code or using gdb.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-03-14 13:18:46 -07:00
Kenneth Graunke
13782dcf9d i965/fs: Print "+reladdr" on variably-indexed uniform arrays.
Previously, dump_instruction() would print output such as:
   {  2}    3: mov vgrf1:F, u0:F
   {  3}    4: mov vgrf7:F, u0:F
   {  4}    5: mov vgrf8:F, u0:F
which looked like either a scalar access or perhaps a constant-indexed
access of element 0, when it was really a variable index.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-03-14 13:17:57 -07:00
Kenneth Graunke
01d9023a9b i965: Fix register types in dump_instructions(), again.
In commit e57d77280e, I fixed this for
destinations in the Vec4 backend, and sources in the scalar backend.
But not both types in both backends.

To prevent this mess from continuing, make the reg_encoding table
static, so only the disassembler can use it.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-03-14 13:17:57 -07:00
Kenneth Graunke
4d2e79269a i965/fs: Fix register comparisons in saturate propagation.
opt_saturate_propagation_local compares scan_inst->dst.reg/reg_offset
with inst->src[0].reg/reg_offset, and ensures that scan_inst->dst.file
is GRF.  But nothing ensured that inst->src[0].file was GRF.

In the following program, this resulted in u1:F matching vgrf1:UW,
and a saturate being incorrectly propagated from instruction 8 to
instruction 1.

{  1}    0: add vgrf0:UW, hw_reg1+8:UW, hw_reg0:V
{  1}    1: add vgrf1:UW, hw_reg1+10:UW, hw_reg0:V
{  1}    2: linterp vgrf6:F, hw_reg2:F, hw_reg3:F, hw_reg0:F
{  2}    3: linterp vgrf27:F, hw_reg2:F, hw_reg3:F, hw_reg0+16:F
{  4}    4: mov vgrf10+0.0:F, vgrf6:F
{  3}    5: mov vgrf10+1.0:F, vgrf27:F
{  6}    6: tex vgrf8+0.0:F, vgrf10+0.0:F
{  5}    7: mov vgrf32:F, u1:F
{  5}    8: mov.sat vgrf12:F, u1:F

From shader-db:
   total instructions in shared programs: 1841932 -> 1841957 (0.00%)
   instructions in affected programs:     5823 -> 5848 (0.43%)
I inspected two of the 25 hurt shaders, and concluded that they were
both hitting this bug, and not legitimately optimized.

This fixes bugs in Left 4 Dead 2 and Team Fortress 2, possibly among
others.  The optimization pass didn't exist in 10.0, so this is only
a candidate for 10.1.

Cc: "10.1" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2014-03-14 13:17:57 -07:00
Eric Anholt
2dbebbd37d glsl: Improve debug output and variable names for opt_dead_code_local.
I know this code has confused others, and it confused me 3 years later,
too.

Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-03-14 13:02:05 -07:00
Eric Anholt
2f879356b5 i965: Add support for GL_ARB_buffer_storage.
It turns out we can allow COHERENT storage/mappings all the time,
regardless of LLC vs non-LLC.  It just means never using temporary
mappings to avoid GPU stalls, and on non-LLC we have to use the GTT intead
of CPU mappings.  If we were to use CPU maps on non-LLC (which might be
useful if apps end up using buffer_storage on PBO reads, to avoid WC read
slowness), those would be PERSISTENT but not COHERENT, but doing that
would require us driving the clflushes from userspace somehow.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-03-14 12:56:22 -07:00
Eric Anholt
1990da2568 i965: Always use CPU mappings for BOs on LLC platforms.
It looks like there's no big difference for write-only workloads, but
using a CPU map means that if they happen to read without having set the
MAP_READ_BIT, they get 100x the performance for those reads.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-03-14 12:56:22 -07:00
Eric Anholt
bb63df0c2d i965: Drop the system-memory temporary allocations for flush explicit.
While in expected usage patterns nobody will ever hit this path, doubling
our bandwidth used seems like a waste, and it cost us extra code too.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-03-14 12:56:22 -07:00
Eric Anholt
ea93246c00 i965: Switch mapping modes for non-explicit-flush blit-temporary maps.
On LLC, it should always be better to use a cached mapping than the GTT.
On non-LLC, it seems pretty silly to try to optimize read performance for
the INVALIDATE_RANGE_BIT case.  This will make the buffer_storage logic
easier.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-03-14 12:56:21 -07:00
Jeff Muizelaar
ff1e850eec gallivm: optimize repeat linear npot code in the aos int path
Similar to the other cases, shift some weight/coord calculations to int
space. This should be slightly faster (on x86 sse it should actually safe one
instruction, and generally int instructions are cheaper).
2014-03-14 19:41:18 +01:00
Roland Scheidegger
9954f01497 gallivm: use correct rounding for nearest wrap mode (in the aos int path)
The previous code used coords which were calculated as
(int) (f_coord * tex_size * 256) >> 8.
This is not only unnecessarily complex but can give the wrong texel due to
rounding for negative coords (as an example, after denormalization coords
from -1.0 to 0.0 should give -1, but this will give -1 for numbers from
-1.0-1/256 - 0.0-1/256.
Instead, juse use ifloor, dropping the shift stuff.
Unfortunately, this will most likely be slower - with arch rounding available
it shouldn't be too bad (trades a int shift for a round but also saves an int
mul (which is shared by all coords) but otherwise it's a mess.
2014-03-14 19:41:18 +01:00
Jeff Muizelaar
88637e5764 gallivm: use correct rounding for linear wrap mode (in the aos int path)
The previous method for converting coords to ints was sligthly inaccurate
(effectively losing 1bit from the 8bit lerp weight). This is probably
especially noticeable when trying to draw a pixel-aligned texture.
As an example, for a 100x100 texture after dernormalization the texture
coords in this case would turn up as
0.5, 1.5, 2.5, 3.5, 4.5, ...
After the mul by 256, conversion to int and 128 subtraction, they end up as
0, 256, 512, 768, 1024, ...
which gets us the correct coords/weights of
0/0, 1/0, 2/0, 3/0, 4/0, ...
But even LSB errors (which are unavoidable) in the input coords may cause
these coords/weights to be wrong, e.g. for a coord of 3.49999 we'd get a
coord/weight of 2/255 instead.

Fix this by using round-to-nearest int instead of FPToSi (trunc). Should be
equally fast on x86 sse though other archs probably suffer a little.
2014-03-14 19:41:18 +01:00
Brian Paul
6757ec3f8e glapi: restore _glthread_GetID() function
This partially reverts patch 02cb04c68f.  This fixes an unresolved
symbol error when using older builds of libGL.

Tested-by: Chia-I Wu <olv@lunarg.com>
2014-03-14 12:12:07 -06:00
Niels Ole Salscheider
f9901f1ab2 radeonsi: flush the dma ring in si_flush_from_st
Signed-off-by: Niels Ole Salscheider <niels_ole@salscheider-online.de>
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
2014-03-14 15:01:14 +01:00
Niels Ole Salscheider
087b0ff1c1 radeon: Move DMA ring creation to common code
Signed-off-by: Niels Ole Salscheider <niels_ole@salscheider-online.de>
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
2014-03-14 15:01:14 +01:00
Emil Velikov
a9cf3aa208 mesa: return v.value_int64 when the requested type is TYPE_INT64
Fixes "Operands don't affect result" defect reported by Coverity.

Cc: "9.2 10.0 10.1"  <mesa-stable@lists.freedesktop.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-03-14 13:01:47 +00:00
Emil Velikov
f064bcdfbf nvc0: minor cleanups in stream output handling
Constify the offsets parameter to silence gcc warning 'assignment
from incompatible pointer type' due to function prototype miss-match.

Use a boolean changed as a shorthand for target != current_target.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-03-14 13:00:01 +00:00
Emil Velikov
ad4a44ebfc nouveau: honor fread return value in the nouveau_compiler
There is little point of continuing if fread returns zero, as it
indicates that either the file is empty or cannot be read from.
Bail out if fread returns zero after closing the file.

Cc: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-03-14 13:00:01 +00:00
Emil Velikov
ae7d236172 nouveau: typecast the prime_fd handle when calling nouveau_bo_set_prime
Core drm defines that the handle is of type int, while all drivers
treat it as uint internally. Typecast the value to silence gcc
warning messages and be consistent amongst all drivers.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-03-14 13:00:01 +00:00
Emil Velikov
c26b488088 nv50: add missing brackets when handling the samplers array
Commit 3805a864b1d(nv50: assert before trying to out-of-bounds access
samplers) introduced a series of asserts as a precausion of a previous
illegal memory access.

Although it failed to encapsulate loop within nv50_sampler_state_delete
effectively failing to clear the sampler state, apart from exadurating
the illegal memory access issue.

Fixes gcc warning "array subscript is above array bounds" and
"Nesting level does not match indentation" and "Out-of-bounds read"
defects reported by Coverity.

Cc: "10.1" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-03-14 13:00:01 +00:00
Anuj Phogat
4d0e30accd i965: Fix build warning of unused variable
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Tested-by: Kenneth Graunke <kenneth@whitecape.org>
2014-03-14 02:57:00 -07:00
Adel Gadllah
a69fabc76c dri3: Add GLX_EXT_buffer_age support
v2: Indent according to Mesa style, reuse sbc instead of making a new
    swap_count field, and actually get a usable back before returning the
    age of the back (fixing updated piglit tests).  Changes by anholt.

Signed-off-by: Adel Gadllah <adel.gadllah@gmail.com>
Reviewed-by: Robert Bragg <robert@sixbynine.org> (v1)
Reviewed-by: Adel Gadllah <adel.gadllah@gmail.com> (v2)
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-03-13 14:19:21 -07:00
Eric Anholt
0b02d8a633 dri3: Prefer the last chosen back when finding a new one.
With the buffer_age code, I need to be able to potentially call this more
than once per frame, and it would be bad if a new special event showing up
meant I chose a different back mid-frame.  Now, once we've chosen a back
for the frame, another find_back will choose it again since we know that
it won't have ->busy set until swap.

Note that this makes find_back return a buffer id instead of a backbuffer
index.  That's kind of a silly distinction anyway, since it's an identity
mapping between the two (it's the front buffer that is at an offset).

Reviewed-By: Adel Gadllah <adel.gadllah@gmail.com>
2014-03-13 14:19:16 -07:00
Neil Roberts
551d459af4 Add the EGL_MESA_configless_context extension
This extension provides a way for an application to render to multiple
surfaces with different buffer formats without having to use multiple
contexts. An EGLContext can be created without an EGLConfig by passing
EGL_NO_CONFIG_MESA. In that case there are no restrictions on the surfaces
that can be used with the context apart from that they must be using the same
EGLDisplay.

_mesa_initialze_context can now take a NULL gl_config which will mark the
context as ‘configless’. It will memset the visual to zero in that case.
Previously the i965 and i915 drivers were explicitly creating a zeroed visual
whenever 0 is passed for the EGLConfig. Mesa needs to be aware that the
context is configless because it affects the initial value to use for
glDrawBuffer. The first time the context is bound it will set the initial
value for configless contexts depending on whether the framebuffer used is
double-buffered.

Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-03-12 14:40:47 -07:00
Neil Roberts
4b17dff3e5 eglCreateContext: Remove the check for whether config == 0
In eglCreateContext there is a check for whether the config parameter is zero
and in this case it will avoid reporting an error if the
EGL_KHR_surfacless_context extension is supported. However there is nothing in
that extension which says you can create a context without a config and Mesa
breaks if you try this so it is probably better to leave it reporting an
error.

The original check was added in b90a3e7d8b based on the API-specific
extensions EGL_KHR_surfaceless_opengl/gles1/gles2. This was later changed to
refer to EGL_KHR_surfacless_context in b50703aea5. Perhaps the original
extensions specified a configless context but the new one does not.

Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-03-12 14:40:47 -07:00
Neil Roberts
4954518125 Fix the initial value of glDrawBuffers for GLES
Under GLES 3 it is not valid to pass GL_FRONT to glDrawBuffers. Instead,
GL_BACK has a magic interpretation which means it will render to the front
buffer on single-buffered contexts and the back buffer on double-buffered. We
were incorrectly setting the initial value to GL_FRONT for single-buffered
contexts. This probably doesn't really matter at the moment except that
presumably it would be exposed in the API via glGetIntegerv.

When we switch to configless contexts this is more important because in that
case we always want to rely on the magic interpretation of GL_BACK in order to
automatically switch between the front and back buffer when a new surface with
a different number of buffers is bound. We also do this for GLES 1 and 2
because the internal value doesn't matter in that case and it is convenient to
use the same code to have the magic interpretation of GL_BACK.

Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-03-12 14:40:47 -07:00
Neil Roberts
0c58c96e54 Use the magic behaviour of GL_BACK in GLES 1 and 2 as well as 3
In GLES 3 it is not possible to select rendering to the front buffer and
instead selecting GL_BACK has the magic interpretation that it is either the
front buffer on single-buffered configs or the back buffer on double-buffered.
GLES 1 and 2 have no way of selecting the draw buffer at all. In that case we
were initialising the draw buffer to either GL_FRONT or GL_BACK depending on
the context's config and then leaving it at that.

When we switch to having configless contexts we ideally want Mesa to
automatically switch between the front and back buffer whenever a double-
or single-buffered surface is bound. To make this happen we can just allow
the magic behaviour from GLES 3 in GLES 1 and 2 as well. It shouldn't matter
what the internal value of the draw buffer is in GLES 1 and 2 because there
is no way to query it from the external API.

Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-03-12 14:40:46 -07:00
Ian Romanick
87c66a4ff7 glsl: Fix typo
Remove extra "any" and re-word-wrap the comment.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-03-12 11:16:50 -07:00
Ian Romanick
6bdc1d96c3 glsl: Rewrite unrolled link_invalidate_variable_locations calls as a loop
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-03-12 11:16:50 -07:00
Carl Worth
7b8acb9026 docs: Import 10.0.4 release notes, add news item. 2014-03-12 10:22:22 -07:00
Mike Stroyan
6e627b49f9 mesa: Release gl_debug_state when destroying context.
Commit 6e8d04a caused a leak by allocating ctx->Debug but never freeing it.
Release the memory in _mesa_free_errors_data when destroying a context.
Use FREE to match CALLOC_STRUCT from _mesa_get_debug_state.

Reviewed-by: Brian Paul <brianp@vmware.com>
2014-03-12 09:43:05 -06:00
Niels Ole Salscheider
2c886eba78 r600g: compute memory pool size is given in dw
Multiply the dw value by 4 in order to map the complete buffer.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Signed-off-by: Niels Ole Salscheider <niels_ole@salscheider-online.de>
2014-03-11 19:00:08 -07:00
Eric Anholt
d3eb709ded meta: Always restore the framebuffers and current renderbuffer.
The few paths that were playing with framebuffers and renderbuffer were
saving and restoring them.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-03-11 12:47:46 -07:00
Eric Anholt
feb3d8dacd i965: Drop intel_check_front_buffer_rendering().
This was being applied in a subset of the places that
intel_prepare_render() was called, to set the same flag that
intel_prepare_render() was setting.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-03-11 12:47:44 -07:00
Eric Anholt
ec542d7457 i965: Drop broken front_buffer_reading/drawing optimization.
The flag wasn't getting updated correctly when the ctx->DrawBuffer or
ctx->ReadBuffer changed.  It usually ended up working out because most
apps only have one window system framebuffer, or if they have more than
one and they have any front read/drawing, they will have called
glReadBuffer()/glDrawBuffer() on it when they get started on the new
buffer.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-03-11 12:47:41 -07:00
Eric Anholt
66073ef438 intel: When checking for updating front buffer reading, use the right fb.
It's the ctx->ReadBuffer that gets read from, not the ctx->DrawBuffer.
So, if you happened to have a ctx->ReadBuffer that was the winsys buffer,
and it had previously been intel_prepare_render()ed but not invalidated
since then, and you called glReadBuffer() to switch to front buffer
instead of back buffer reading on the winsys fbo while your drawbuffer was
a user FBO, you'd never get the front buffer's miptree fetched, and
segfault.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-03-11 12:46:59 -07:00
Marek Olšák
e1a9a54464 r600g,radeonsi: attempt to fix racy multi-context apps calling BufferData
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=75061

v2: minimize the window where cs_buf != new_buf
2014-03-11 19:18:02 +01:00
Marek Olšák
74d95adea0 r600g,radeonsi: fix broken buffer download
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-03-11 19:18:02 +01:00
Marek Olšák
4ca3486b19 r600g,radeonsi: use a fallback in dma_copy instead of failing
v2: - allow byte-aligned DMA buffer copies on Evergreen
    - fix piglit/texsubimage regression
    - use the fallback for 3D copies (depth > 1) as well
2014-03-11 19:18:02 +01:00
Marek Olšák
de5094d102 radeonsi: small cleanup in get_param
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-03-11 18:51:20 +01:00
Marek Olšák
e219842282 radeonsi: set correct alignment for texture buffers and constant buffers
I think these are all equivalent to vertex buffer fetches which should be
dword-aligned. Scalar loads are also dword-aligned.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-03-11 18:51:20 +01:00
Marek Olšák
f549129564 r600g, radeonsi: fix primitives-generated query with disabled streamout
Buffers are disabled by VGT_STRMOUT_BUFFER_CONFIG, but the query only works
if VGT_STRMOUT_CONFIG.STREAMOUT_0_EN is enabled.

This moves VGT_STRMOUT_CONFIG to its own state. The register is set to 1
if either streamout or the primitives-generated query is enabled.

However, the primitives-emitted query is also incremented, so it's disabled
by setting VGT_STRMOUT_BUFFER_SIZE to 0 when there is no buffer bound.

This fixes piglit:
  ARB_transform_feedback2/counting with pause
  EXT_transform_feedback/primgen-query transform-feedback-disabled

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-03-11 18:51:20 +01:00
Marek Olšák
958ef47a6d r600g,radeonsi: don't add streamout.num_dw_for_end twice
It's already added in need_cs_space.

Also don't calculate anything if there are no buffers.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-03-11 18:51:20 +01:00
Marek Olšák
4f1f32306a r600g,radeonsi: fix MAX_TEXTURE_3D_LEVELS and MAX_TEXTURE_ARRAY_LAYERS limits
CB_COLORi_VIEW.SLICE_MAX can be at most 2047.

This fixes the maxlayers piglit test.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-03-11 18:51:20 +01:00
Marek Olšák
8bd7a6f48c st/dri: flush drawable textures before unreferencing
This fixes piglit/fbo-sys-blit with fast clear on radeonsi.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-03-11 18:51:20 +01:00
Marek Olšák
a38e1fd78b radeonsi: implement fast color clear
This works for both multi-sample and single-sample color buffers.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-03-11 18:51:20 +01:00
Marek Olšák
28eb0bcf19 r600g: move fast color clear code to a common place
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-03-11 18:51:20 +01:00
Marek Olšák
d3c1be530a r600g,radeonsi: move CMASK register values from r600_surface to r600_texture
When doing fast clear for single-sample color buffers for the first time,
a CMASK buffer has to be allocated and the CMASK state in all pipe_surfaces
referencing the color buffer must be updated. Updating all surfaces is kinda
silly, so let's move the values to r600_texture instead.

This is only for Evergreen and later. R600-R700 don't have fast clear.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-03-11 18:51:20 +01:00
Marek Olšák
61a2fac199 radeonsi: convert the framebuffer state to atom-based
This looks like r600g. The shared Cayman MSAA code is used here.

The real motivation for this is that I need the ability to change values
of color registers after the framebuffer state is set. The PM4 state cannot
be modified easily after it's generated. With this, I can just change
r600_surface::cb_color_xxx and set framebuffer.atom.dirty=true and it's done.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-03-11 18:51:20 +01:00
Marek Olšák
946d1cfe39 r600g: move cayman MSAA setup to a common place
I will use this in radeonsi.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-03-11 18:51:20 +01:00
Marek Olšák
6a5499b9d9 radeonsi: move framebuffer-related state to a new struct si_framebuffer
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-03-11 18:51:20 +01:00
Marek Olšák
bee2b96b02 r600g,radeonsi: set priorities for relocations 2014-03-11 18:51:19 +01:00
Marek Olšák
3edb3b86b2 r300g,uvd,vce: set priorities for relocations
This updates all occurences of cs_add_reloc.
2014-03-11 18:51:19 +01:00
Marek Olšák
db1a7f78c2 winsys/radeon: add interface for setting a priority number for each relocation
The cs_add_reloc change is commented out not to break compilation.
The highest priority of all cs_add_reloc calls is send to the kernel.
2014-03-11 18:51:19 +01:00
Jonathan Gray
0d6f573f6e glsl: Link glsl_compiler with pthreads library.
Fixes the following build error on OpenBSD:

./.libs/libglsl.a(builtin_functions.o)(.text+0x973): In function `mtx_lock':
../../include/c11/threads_posix.h:195: undefined reference to `pthread_mutex_lock'
./.libs/libglsl.a(builtin_functions.o)(.text+0x9a5): In function `mtx_unlock':
../../include/c11/threads_posix.h:248: undefined reference to `pthread_mutex_unlock'

Signed-off-by: Jonathan Gray <jsg@jsg.id.au>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-03-11 08:47:12 -06:00
Jonathan Gray
40214267ab gallium: add endian detection for OpenBSD
Cc: "10.0" "10.1" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-03-11 08:47:12 -06:00
Emil Velikov
a6efbac9fb automake: allow only shared builds
Static and shared builds were possible in the good old days
of static makefiles. Currently the build system does not
distinguish nor does anything special when one requests a
static build.

Print a warning message for the packager that static builds
are not supported and continue building shared libs.

Currently only Debian and derivatives use static build, and
they use it for building a Xlib powered libGL. This patch
will only change the warning message they are seeing but
the binaries produced will be identical.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2014-03-11 12:50:44 +00:00
Emil Velikov
065b6ca52b configure: update enable-llvm-shared-libs comments
- As of commit cb080a10b68(configure.ac: Don't require shared LLVM when
building OpenCL) opencl does not mandate using shared llvm.
 - Add a warning message that building with static llvm may cause
compilation problems.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-03-11 12:50:44 +00:00
Emil Velikov
e267e4318c st/dri: build the drm backend when libdrm is present
Prevent build issues on systems lacking libdrm.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2014-03-11 12:50:44 +00:00
Emil Velikov
f41a65397b glx: cleanup unneeded headers
- xf86dri.h is the old dri1 header, not required by dri2 nor dri3
 - fold xf86drm.h inclusiong inside dri2.h
 - dri3_glx does not have any drm specific dependencies
 - glapi.h is not required by the dri2 and dri3 codepaths

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-03-11 12:50:43 +00:00
Jon TURNEY
e5214dd8f1 glx/tests: honor enable-driglx-direct configure flag
Recent commit fixed build issues in dri2_query_renderer.c by
wrapping in defined(direct_rendering) && !defined(applegl)

This patch targets the query_renderer tests, so that make check
passes on platforms such as hurd and cygwin.

v2: (Emil)
 - Rebase and update commit message.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-03-11 12:50:43 +00:00
Emil Velikov
254aafba3e configure: read libomxil-bellagio.pc only when it exists
Currenly configure.ac will print a warning when one is missing the package.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Christian König <christian.koenig@amd.com>
2014-03-11 12:50:43 +00:00
Emil Velikov
22c133546a automake: create compat symlinks only for linux systems
The primary users of these are linux developers, although
it can be extended for *BSD and others if needed.

Fixes make install for Cygwin and OpenBSD at least.

v2:
 - Wrap vdpau targets as well.
v3:
 - Fold HAVE_COMPAT_SYMLINKS conditional within install*links.mk

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=63269
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk> (v1)
Reviewed-by: Christian König <christian.koenig@amd.com>
2014-03-11 12:50:43 +00:00
Emil Velikov
bba9c28215 configure: use LIB_EXT rather than hardcoded .so
Some platforms different library extension - dll, dylib, a.
Honor that when we are creating the required links.

Rename LIB_EXTENSION to LIB_EXT while we're here.

With libglapi linking aside, building classic drivers on
non-linux platforms should be possible now.

v2: Resolve conflicts.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2014-03-11 12:50:43 +00:00
Emil Velikov
020bc0d0dd automake: do not use symbols names for static glapi.la
In the cases where one links against the static glapi.la there
is no need to create temporary variables only to explicitly
link agaist it.

Instead use SHARED_GLAPI_LIB to explicitly indicate when one
is building and linking with the shared glapi provider.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2014-03-11 12:50:43 +00:00
Emil Velikov
3c5599b276 configure: remove old makefile variables
All the variables were used before the automake conversion
and do not make sense (nor are used) currently.

Replace GL_LIB_NAME with lib$(GL_LIB).$(LIB_EXTENSION) for
apple-glx. The build has been broken for ages, but this will
ease the recovery process as it happens.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2014-03-11 12:50:43 +00:00
Emil Velikov
49d7bcea82 gallium/targets: use install-gallium-targets.mk
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2014-03-11 12:50:42 +00:00
Emil Velikov
f3595b6748 gallium/targets: drop link generation for non DRI targets
All three (xvmc and omx) do not have an alternative loading
similar to the dri modules. Thus one needs to explicitly install
them in order to use/test them.

v2:
 - Keep vdpau targets, as an equivalent of LIBGL_DRIVERS_PATH
is being worked on.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2014-03-11 12:50:42 +00:00
Emil Velikov
d8ba951ad6 targets/vdpau: use install-gallium-links.mk
Drop the duplication across all vdpau targets.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2014-03-11 12:50:42 +00:00
Emil Velikov
ce24bcd394 targets/dri: use install-gallium-links.mk
Drop the duplication across all dri targets.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2014-03-11 12:50:42 +00:00
Emil Velikov
bbae65e25c automake: introduce install-gallium-links.mk
This helper script will be used to minimise the duplication
during link generation across all gallium targets.

v2:
 - Handle vdpau_LTLIBRARIES. Requested by Christian König.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2014-03-11 12:50:42 +00:00
Emil Velikov
7b4ccad33d automake: use install-lib-links.mk across all classic mesa
Use the handy script and minimise the boilerplate in the makefiles.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2014-03-11 12:50:42 +00:00
Emil Velikov
b496ab0567 automake: make install-lib-links less chatty
There is little point in echoing everything that the script does
to stdout. Wrap it in AM_V_GEN so that a reasonable message is
printed as a indication of it's invocation.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2014-03-11 12:50:42 +00:00
Emil Velikov
90a4ffdea5 automake: use only the folder name if it's a subfolder of the present one
v2: Resolve rebase conflicts.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2014-03-11 12:50:41 +00:00
Emil Velikov
b15b1fbb51 automake: silence folder creation
There is little gain in printing whenever a folder is created.

v2:
 - Use $(AM_V_at) over @ to have control in verbose builds.
Suggested by Erik Faye-Lund.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2014-03-11 12:50:41 +00:00
Emil Velikov
c690f8dd9b automake: use MKDIR_P when possible
Use the automake predefined macro over hardcoding mkdir -p everywhere.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2014-03-11 12:50:41 +00:00
Vinson Lee
e6c565fcc5 radeon: Fix build.
Fix build error introduced with commit
dfa25ea5cd.

  CC       r600_streamout.lo
r600_streamout.c:108:6: error: conflicting types for 'r600_set_streamout_targets'
void r600_set_streamout_targets(struct pipe_context *ctx,
     ^
./r600_pipe_common.h:413:6: note: previous declaration is here
void r600_set_streamout_targets(struct pipe_context *ctx,
     ^

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76009
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
2014-03-10 22:54:59 -07:00
Zack Rusin
dfa25ea5cd gallium: allow setting of the internal stream output offset
D3D10 allows setting of the internal offset of a buffer, which is
in general only incremented via actual stream output writes. By
allowing setting of the internal offset draw_auto is capable
of rendering from buffers which have not been actually streamed
out to. Our interface didn't allow. This change functionally
shouldn't make any difference to OpenGL where instead of an
append_bitmask you just get a real array where -1 means append
(like in D3D) and 0 means do not append.

Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-03-07 12:49:33 -05:00
Brian Paul
7d5903980e meta: use non-ARB shader/program create/delete functions
The non-ARB versions take GLuint ids, not GLhandleARB.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-03-10 17:07:05 -06:00
Brian Paul
d96ed5c088 mesa: s/GLhandleARB/GLuint/ for glGetUniform functions
The GL specs say the parameter is GLuint, not GLhandleARB.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-03-10 17:06:57 -06:00
Brian Paul
a19b19fb94 mesa: rename MESA_FORMAT_X8Z24_UNORM -> MESA_FORMAT_X8_UINT_Z24_UNORM
To follow the example of MESA_FORMAT_Z24_UNORM_X8_UINT.

Reviewed-by: Michel Dänzer <michel@daenzer.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-03-10 16:11:54 -06:00
Brian Paul
9b5fff2dd7 mesa: reorder MESA_FORMAT enums
The MESA_FORMAT_x enums in formats.h weren't declared in any sort
of reasonable order.  Now it should be a little more logical.
This also required reordering tables in formats.c and s_texfetch.c

Reviewed-by: Michel Dänzer <michel@daenzer.net>
Acked-by: Eric Anholt <eric@anholt.net>
2014-03-10 16:11:50 -06:00
Brian Paul
10738727ae mesa: trim down format.h comments
There's no real reason to list all the formats in the comments.

Reviewed-by: Michel Dänzer <michel@daenzer.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-03-10 16:11:45 -06:00
Matt Turner
3330dec90c i965/vec4: Don't fix-up scalar uniforms for 3 src instructions.
Removes unnecessary MOV instructions in L4D2, TF2, Dota2, and many other
Steam games.

total instructions in shared programs: 1668126 -> 1657509 (-0.64%)
instructions in affected programs:     242235 -> 231618 (-4.38%)

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-03-10 14:13:45 -07:00
Matt Turner
b823d5df0f i965: Disassemble 3 src instructions' rep_ctrl field.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-03-10 14:13:45 -07:00
Matt Turner
dafcc1b7c4 i965: Disassemble 3-src operands widths' correctly.
<4,1,1> isn't a real thing. We meant <4,4,1>, i.e., each component of
the whole register.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-03-10 14:13:45 -07:00
Eric Anholt
30259856a8 i965: Move binding table update packets to binding table setup time.
This keeps us from needing to reemit all the other stage state just
because a surface changed.

Improves unoptimized glamor x11perf -f8text by 1.10201% +/- 0.489869%
(n=296). [v1]

v2:
 - Drop binding table packets from Gen8 unit state as well.
 - Pass _3DSTATE_BINDING_TABLE_POINTERS_XS to brw_upload_binding_table,
   cutting even more code.
v3: Don't forget to drop them from 3DSTATE_GS (botched refactor in v2).

Signed-off-by: Eric Anholt <eric@anholt.net> [v1]
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> [v1]
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> [v2, v3]
Reviewed-by: Eric Anholt <eric@anholt.net> [v3]
2014-03-10 13:05:12 -07:00
Kenneth Graunke
db26253a48 i965: Reorganize the code in brw_upload_binding_tables.
This makes both the empty and non-empty binding table paths exit through
the bottom of the function, which gives us a place to share code.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-03-10 13:05:12 -07:00
Maarten Lankhorst
8c136b53b7 fix vdpau interop when using -Bsymbolic-functions in ldflags
Explicitly add radeon_drm_winsys_create and nouveau_drm_screen_create to
the dynamic list. This will ensure vdpau interop still works even when
the user links with -Bsymbolic-functions in hardened builds.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Tested-by: Rachel Greenham <rachel@strangenoises.org>
Reported-by: Peter Frühberger <peter.fruehberger@gmail.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2014-03-10 17:08:19 +01:00
Chia-I Wu
952fda4d3f ilo: do not set I915_EXEC_NO_RELOC
This reverts most of commit d80f0c34b7.  Upon a
closer reading, having the presumed offsets written is not enough to set the
flag.  EXEC_OBJECT_NEEDS_GTT and/or EXEC_OBJECT_WRITE of the reloc entries
must also be set appropriately.
2014-03-10 19:04:43 +08:00
Chia-I Wu
5ecdd7ba22 ilo: add support for PIPE_QUERY_PIPELINE_STATISTICS 2014-03-10 16:43:53 +08:00
Chia-I Wu
8fc2f0c874 ilo: add ILO_3D_PIPELINE_WRITE_STATISTICS
The command writes statistics registers to the specified bo.
2014-03-10 16:43:53 +08:00
Chia-I Wu
d8b2e3c25e ilo: add some MI commands to GPE
We will need MI commands that load/store registers.
2014-03-10 16:43:53 +08:00
Chia-I Wu
0f41f9c63d ilo: set PIPE_CONTROL_GLOBAL_GTT_WRITE automatically
Set the flag automatically in gen6_emit_PIPE_CONTROL(), and set it only for
GEN6.
2014-03-10 16:43:53 +08:00
Chia-I Wu
345bf92f13 ilo: print a warning when PPGTT is disabled
Despite what the PRMs say, the driver appears to work fine when PPGTT is
disabled.  But at least print a warning in that case.
2014-03-10 16:42:42 +08:00
Chia-I Wu
747627d045 ilo: require hardware logical context support
The code paths are not tested for a while, and have some known issues.
2014-03-10 16:42:42 +08:00
Chia-I Wu
72956ed374 ilo: protect the decode context with a mutex
The decode context is not thread safe.
2014-03-10 16:42:42 +08:00
Chia-I Wu
d80f0c34b7 ilo: set I915_EXEC_NO_RELOC when available
The winsys makes it clear that the pipe drivers should write presumed offsets.
We can always set I915_EXEC_NO_RELOC when the kernel supports it.
2014-03-10 16:42:42 +08:00
Chia-I Wu
0b462d3ab1 ilo: move ring types to winsys
It results in less code despite that i915_drm.h specifies the ring type as
part of the execution flags.
2014-03-10 16:42:42 +08:00
Chia-I Wu
42c1ce4c03 ilo: winsys may limit the batch buffer size
The maximum batch buffer size is determined at the time of
drm_intel_bufmgr_gem_init().  Make sure the pipe driver does not exceed the
limit.
2014-03-10 16:42:42 +08:00
Chia-I Wu
a434ac045e ilo: PIPE_CAP_QUERY_TIMESTAMP may not be supported
Reading TIMESTAMP register may fail, depending on both kernel and hardware.
2014-03-10 16:42:42 +08:00
Chia-I Wu
249b1ad984 ilo: rework winsys batch buffer functions
Rename

  intel_winsys_check_aperture_size() to intel_winsys_can_submit_bo(),
  intel_bo_exec() to intel_winsys_submit_bo(), and
  intel_winsys_decode_commands() to intel_winsys_decode_bo().

Make a semantic change to ignore intel_context when the ring is not the render
ring.
2014-03-10 16:42:42 +08:00
Chia-I Wu
3e324f99d3 ilo: replace bo alloc flags by initial domains
The only alloc flag is INTEL_ALLOC_FOR_RENDER, which can as well be expressed
by specifying the initial write domain.  The change makes it obvious that we
failed to set INTEL_ALLOC_FOR_RENDER in several places.
2014-03-10 16:42:42 +08:00
Chia-I Wu
76713ed5d6 ilo: remove intel_bo_get_size()
Commit bfa8d21759 uses it to work around a
hardware limitation.  But there are other ways to do it without the need for
intel_bo_get_size().
2014-03-10 16:42:42 +08:00
Chia-I Wu
790c32ec75 ilo: remove intel_bo_get_virtual()
Make the map functions return the pointer directly.
2014-03-10 16:42:42 +08:00
Chia-I Wu
90786613e9 ilo: rework winsys bo reloc functions
Rename

  intel_bo_emit_reloc() to intel_bo_add_reloc(),
  intel_bo_clear_relocs() to intel_bo_truncate_relocs(), and
  intel_bo_references() to intel_bo_has_reloc().

Besides, we need intel_bo_get_offset() only to get the presumed offset afer
adding a reloc entry.  Remove the function and make intel_bo_add_reloc()
return the presumed offset.  While at it, switch to gem_bo->offset64 from
gem_bo->offset.
2014-03-10 16:42:42 +08:00
Chia-I Wu
76ed4f75dd ilo: add a wrapper to cast struct intel_bo
It is just drm_intel_bo, but having a wrapper makes the code cleaner.
2014-03-10 16:42:42 +08:00
Chia-I Wu
4491f0a971 ilo: fix DRM_API_HANDLE_TYPE_FD export
It can be exported by drm_intel_bo_gem_export_to_prime().  The code is already
in winsys, just not enabled.
2014-03-10 16:42:42 +08:00
Chia-I Wu
276348e85a ilo: improve winsys documentation/comments
Document the interface, and add comments as to why some features are enabled
and why some checks are made.
2014-03-10 16:42:41 +08:00
Chia-I Wu
f2aabecbb0 ilo: remove intel_winsys_enable_reuse()
It should be an (winsys) implementation detail.
2014-03-10 16:42:41 +08:00
Tapani Pälli
56b1be4399 mesa/glsl: introduce a remap table for uniform locations
Patch adds a remap table for uniforms that is used to provide a mapping
from application specified uniform location to actual location in the
UniformStorage. Existing UniformLocationBaseScale usage is removed as
table can be used to set sequential values for array uniform elements.

This mapping helps to implement GL_ARB_explicit_uniform_location so that
uniforms locations can be reorganized and handled in a more easy manner.

v2: small fixes + rename parameters for merge and split functions (Ian)
    improve documentation, remove old check for location bounds (Eric)

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-03-10 09:46:24 +02:00
Tapani Pälli
aa0d95a08d mesa: remove _mesa_symbol_table_iterator structure
Nothing uses this structure, removal fixes Klocwork error about
the possible oom condition in _mesa_symbol_table_iterator_ctor.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-03-10 09:45:41 +02:00
Michel Dänzer
678cf9618f radeonsi: Use proper member name for deleting export shader PM4 state
Fixes double-free with some piglit tests using geometry shaders.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-03-10 12:21:50 +09:00
Marek Olšák
9c2a3934c5 r600g: document why texture offset emulation is needed 2014-03-10 00:19:59 +01:00
Ilia Mirkin
897f40f25d Revert nvc0 part of "nv50: adjust blit_3d handling of ms output textures"
The nvc0 bits don't appear to work, and I thought I had removed them
from the commit. Oops.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.0 10.1" <mesa-stable@lists.freedesktop.org>
2014-03-09 01:38:10 -05:00
Ilia Mirkin
253314d487 nv50: adjust blit_3d handling of ms output textures
This fixes some unwanted scaling when the output is multisampled.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Christoph Bumiller <e0425955@student.tuwien.ac.at>
Cc: "10.0 10.1" <mesa-stable@lists.freedesktop.org>
2014-03-09 01:32:06 -05:00
Ilia Mirkin
507f0230d4 nouveau: fix fence waiting logic in screen destroy
nouveau_fence_wait has the expectation that an external entity is
holding onto the fence being waited on, not that it is merely held onto
by the current pointer. Fixes a use-after-free in nouveau_fence_wait
when used on the screen's current fence.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=75279
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Christoph Bumiller <e0425955@student.tuwien.ac.at>
Cc: "9.2 10.0 10.1" <mesa-stable@lists.freedesktop.org>
2014-03-09 01:31:59 -05:00
Ilia Mirkin
5bf90cb521 nouveau: add valid range tracking to nouveau_buffer
This logic is borrowed from the radeon code. The transfer logic will
only get called for PIPE_BUFFER resources, so it shouldn't be necessary
to worry about them becoming render targets.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Christoph Bumiller <e0425955@student.tuwien.ac.at>
2014-03-09 01:31:21 -05:00
Julien Cristau
cf1c52575d gbm: make 'devices' array static
It's only used in this one file as far as I can tell, and exporting a
symbol named 'devices' from a shared library is a recipe for trouble.

Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-03-08 20:43:54 +00:00
Emil Velikov
330a3799d0 automake: make clean the correct git_sha1.h.tmp
When building out of tree, the file ends up dangling which
may result in a binary with the old git sha.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-03-08 20:40:56 +00:00
Christian König
6a402359fd radeonsi: fix freeing descriptor buffers
That structure member is a pointer, so the loop with
the Elements macro only freed up the first entry.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-03-08 16:08:15 +01:00
Christian König
58d2afa223 radeonsi: fix leaking the bound state on destruction v2
v2: rebased on stale pointer fixes

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-03-08 16:08:15 +01:00
Christian König
1fa2acba61 radeonsi: avoid stale state pointers
Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-03-08 16:08:15 +01:00
Christian König
1a8c66023b radeonsi: avoid stale pointers in si_delete_shader_selector
Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-03-08 16:08:15 +01:00
Marek Olšák
c1a06da465 Revert "winsys/radeon: if there's VRAM-only usage, keep it"
This reverts commit 67aef6dafa.

It caused GPU hangs. The question is why.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=75900
2014-03-08 16:00:25 +01:00
Christian König
a995f564c7 radeon/vce: fix memory leak
Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-03-08 14:43:53 +01:00
Sir Anthony
6e39a8f6ec glcpp: Do not remove spaces to preserve locations.
After preprocessing by glcpp all adjacent spaces were replaced by
single one and glsl parser received column-shifted shader source.
It negatively affected ast location set up and produced wrong error
messages for heavily-spaced shaders.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-03-08 01:38:32 -08:00
Sir Anthony
da2275cd9b glsl: Change locations from yylloc to appropriate tokens positions.
Reviewed-by: Carl Worth <cworth@cworth.org>
2014-03-08 01:29:00 -08:00
Sir Anthony
5656775cf6 glsl: Add ast_node method to set location range.
Reviewed-by: Carl Worth <cworth@cworth.org>
2014-03-08 01:29:00 -08:00
Sir Anthony
654ee41cd3 glsl: Make ast_node location comments more informative.
Reviewed-by: Carl Worth <cworth@cworth.org>
2014-03-08 01:29:00 -08:00
Sir Anthony
433d562ac6 glsl: Extend ast location structure to hande end token position.
Reviewed-by: Carl Worth <cworth@cworth.org>
2014-03-08 01:29:00 -08:00
Sir Anthony
6984aa4350 glsl: Update lexers in glsl and glcpp to hande end position of token.
Reviewed-by: Carl Worth <cworth@cworth.org>
2014-03-08 01:29:00 -08:00
Vinson Lee
98fb8c95c0 scons: Add drivers/common/meta_generate_mipmap.c to src/mesa/SConscript.
This patch fixes this SCons build error introduced with commit
70e7905608.

build/linux-x86_64-debug/mesa/libmesa.a(driverfuncs.os): In function `_mesa_init_driver_functions':
src/mesa/drivers/common/driverfuncs.c:99: undefined reference to `_mesa_meta_GenerateMipmap'

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
2014-03-07 23:39:29 -08:00
Kenneth Graunke
14ca611258 meta: Support GenerateMipmaps on 1DArray textures.
I don't know how many people care about this case, but it's easy enough
to do, so we may as well.  The tricky part is that for some reason Mesa
stores the number of array slices in Height, not Depth.

I thought the easiest way to handle that here was to make Height = 1
(the actual height), and srcDepth = srcImage->Height.  This requires
some munging when calling _mesa_prepare_mipmap_level, so I created a
wrapper that sorts it out for us.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-03-07 22:45:25 -08:00
Kenneth Graunke
158a7440c3 meta: Use srcWidth/Height/Depth rather than srcImage->Width and such.
This is equivalent for now, and will differ once we add 1DArray support.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-03-07 22:45:19 -08:00
Kenneth Graunke
ec23d5197e meta: Support GenerateMipmaps on 2DArray textures.
This is largely a matter of looping over the number of slices/layers,
and not minifying depth (presumably that code exists for the unfinished
3D texture support).

Normally, I would have made the loop over array slices the outermost
loop.  I suspect that would make it trickier to support 3D textures
someday, though, so I didn't.  The advantage is that we would only have
one BufferData call per slice, rather than one per miplevel and slice.

However, a GenerateMipmaps microbenchmark indicates that either way is
basically just as fast.  So I'm not sure it's worth bothering.

Improves performance in a GenerateMipmaps microbenchmark by nearly 5x.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-03-07 22:45:17 -08:00
Kenneth Graunke
15b2f69b9c meta: Add a 'layer' argument to bind_fbo_image().
For array textures and 3D textures, this represents the layer to use.
Just pass 0 for now.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-03-07 22:45:16 -08:00
Kenneth Graunke
be84d53d44 meta: Refactor code for binding a texture image to the FBO.
Almost the exact same code appeared twice, and it needs to expand to
handle additional texture targets.  Refactor it to tidy up the code and
avoid duplicating more work in the future.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-03-07 22:45:14 -08:00
Kenneth Graunke
45ee1b30d7 meta: Use minify() in GenerateMipmaps code.
This is what the macro is for.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-03-07 22:45:13 -08:00
Kenneth Graunke
9afca91984 meta: Drop redundant FBO creation code in GenerateMipmaps.
fallback_required() already creates the FBO in order to check whether we
can render to the format.  So it's guaranteed to exist.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-03-07 22:45:11 -08:00
Kenneth Graunke
1285bc87ac meta: Replace GLboolean with bool in fallback_required().
This doesn't interact with the GL API, so we shouldn't use GL types.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-03-07 22:45:10 -08:00
Kenneth Graunke
092b7edb3f meta: Make _mesa_meta_check_generate_mipmap_fallback static.
This was only ever used in one place; there's no reason for it to be
non-static.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-03-07 22:45:09 -08:00
Kenneth Graunke
70e7905608 meta: Split GenerateMipmap() into its own file.
Putting the implementation of each GL function in its own file makes it
much easier not to get lost.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-03-07 22:45:07 -08:00
Kenneth Graunke
3a7f3d843a meta: De-static setup_texture_coords().
This will be used in multiple files soon.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-03-07 22:45:04 -08:00
Timothy Arceri
1308d21fbf glapi: Add KHR_debug.xml 2014-03-08 15:45:26 +11:00
Timothy Arceri
6c3f5abc2d mesa: add missing DebugMessageControl types
Signed-off-by: Timothy Arceri <t_arceri@yahoo.com.au>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-03-08 15:38:31 +11:00
Timothy Arceri
fb78fa58d2 mesa: make ARB_debug_output functions an alias of
KHR_debug

Also update dispatch sanity removing ARB_debug_output checks and
removing KHR_debug placeholders as the checks have already been added

V2: Make sure we exit case statements with conditional breaks rather than
just dropping through.

Signed-off-by: Timothy Arceri <t_arceri@yahoo.com.au>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-03-08 15:38:31 +11:00
Timothy Arceri
0608d346aa glapi: move KHR_debug into its own file
Signed-off-by: Timothy Arceri <t_arceri@yahoo.com.au>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-03-08 15:31:59 +11:00
Adel Gadllah
b972e55684 glx_pbuffer: Refactor GetDrawableAttribute
Move the pdraw != NULL check out so that they don't
have to be duplicated.

Signed-off-by: Adel Gadllah <adel.gadllah@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-03-07 16:59:57 -08:00
Adel Gadllah
6b13cd1f7f glx: Update glxext.h to revision 25407
Signed-off-by: Adel Gadllah <adel.gadllah@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-03-07 16:59:57 -08:00
Tom Stellard
a1b189ac90 radeon: Include radeon_elf_util.c in the list of LLVM_C_FILES v2
This fixes the a build breakage caused by
6974eb9076 on build configurations where
all the following are true:

1. radeonsi is not being built
2. r600g is being built
3. opencl is disabled
4. --enable-r600-llvm-compiler is not being used
5. libelf is not installed

v2:
  - Add $(RADEON_CFLAGS) to libllvmradeon_la_CFLAGS

Tested-by: Brian Paul <brianp@vmware.com>
2014-03-07 18:06:59 -05:00
Brian Paul
9b322d540a st/mesa: only mark framebuffer as sRGB capable if Mesa supports the format
Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-03-07 15:43:36 -07:00
Tom Stellard
6974eb9076 radeon/llvm: Factor elf parsing code out into its own function
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-03-07 13:31:52 -05:00
Tom Stellard
1f4a9fc84e radeon: Rename struct radeon_llvm_binary to radeon_shader_binary v2
And move its definition into r600_pipe_common.h;  This struct is a just
a container for shader code and has nothing to do with LLVM.

v2:
  - Drop unrelated Makefile change

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-03-07 13:31:51 -05:00
Marek Olšák
d8fde8ffed gallium: rename R4A4 and A4R4 formats to match their swizzle
Like L4A4.

Reviewed-by: Brian Paul <brianp@vmware.com>
2014-03-07 18:07:05 +01:00
Marek Olšák
780ce576bb mesa: fix the format of glEdgeFlagPointer
Softpipe expects a float in the vertex shader, which is what glEdgeFlag
generates.

This fixes piglit/gl-2.0-edgeflag.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-03-07 18:07:05 +01:00
Marek Olšák
472ac0db08 radeonsi: fix blit compressed texture workaround to support 2D arrays
We don't have a piglit test for this, but I think it's correct.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-03-07 18:07:05 +01:00
Marek Olšák
fcdf6fa86c r600g: fix blitting the last 2 mipmap levels for Evergreen
This fixes a lot of compressedteximage piglit tests.

R600-R700 don't have this issue.

Cc: mesa-stable@lists.freedesktop.org
2014-03-07 18:07:05 +01:00
Marek Olšák
8a08051e2a r600g: fix texelFetchOffset GLSL functions
Cc: mesa-stable@lists.freedesktop.org
2014-03-07 18:07:05 +01:00
Marek Olšák
67aef6dafa winsys/radeon: if there's VRAM-only usage, keep it 2014-03-07 18:07:05 +01:00
Niels Ole Salscheider
f112ba03bb radeon: Use upload manager for buffer downloads
Using DMA for reads is much faster.

Signed-off-by: Niels Ole Salscheider <niels_ole@salscheider-online.de>
Signed-off by: Marek Olšák <marek.olsak@amd.com>
2014-03-07 18:07:05 +01:00
Brian Paul
b46e8622f1 glapi: use 'Mesa' in error messages
A user would have no idea what "_glthread_" is.  This removes the
last remaining instance of the _glthread_ string in Mesa.

Reviewed-by: Chia-I Wu <olv@lunarg.com>
2014-03-07 09:04:01 -07:00
Brian Paul
6d2dffe8b1 st/mesa: add test_format_conversion() debug function
To check that the st_mesa_format_to_pipe_format() and
st_pipe_format_to_mesa_format() functions correctly convert
all corresponding Mesa/Gallium formats.

This found that MESA_FORMAT_YCBCR_REV was missing in
st_mesa_format_to_pipe_format().  Fixed that too.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-03-07 07:31:29 -07:00
Brian Paul
d8f7e3d79e st/mesa: add MESA_FORMAT_R8G8B8A8_SRGB in st_mesa_format_to_pipe_format()
v2: rename patch after rebasing on top of Jose's changes.

Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
2014-03-07 07:31:18 -07:00
José Fonseca
b3689adf51 mesa/st: Fix PIPE_FORMAT_R8G8B8A8_SRGB -> MESA_FORMAT_ conversion.
Copy'n'past typo introduced in my
1d8e3067fd commit.

This fixes swapped RB channels I was seeing in my test machines.

Trivial.
2014-03-07 13:35:24 +00:00
Kusanagi Kouichi
7233d4479e st/vdpau: Add rotation v2
v2: add static asserts

Signed-off-by: Kusanagi Kouichi <slash@ac.auone-net.jp>
Reviewed-by: Christian König <christian.koenig@amd.com>
2014-03-07 09:20:11 +01:00
Kusanagi Kouichi
e7e207658c vl: Add rotation v3
v2: rotate in gen_rect_verts instead
v3: clear rotate in vl_compositor_clear_layers,
    update calc_drawn_area as well

Signed-off-by: Kusanagi Kouichi <slash@ac.auone-net.jp>
Signed-off-by: Christian König <christian.koenig@amd.com>
2014-03-07 09:20:11 +01:00
Christian König
53d1d879d5 st/omx/enc: fix crash on destruction
Signed-off-by: Christian König <christian.koenig@amd.com>
2014-03-07 08:55:57 +01:00
Kenneth Graunke
378c6f2246 mesa: Drop unused hash_table::mem_ctx field.
It's never used, and it's equivalent to ralloc_parent(ht) if you really
need it.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-03-06 20:55:34 -08:00
Michel Dänzer
9ceee5f4be clover: Fix build against LLVM SVN r203065 or newer
llvm/Linker.h was moved to llvm/Linker/Linker.h.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-03-07 11:12:12 +09:00
Brian Paul
0f0c16b238 mesa: add MESA_FORMAT_R8G8B8A8_SRGB
To match PIPE_FORMAT_R8G8B8A8_SRGB.
v2: fix component name copy&paste bugs

Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-03-06 18:17:14 -07:00
Matt Turner
8d3f739383 mesa: Wrap SSE4.1 code in #ifdef __SSE4_1__.
Because people insist on doing things like explicitly disabling SSE 4.1.

Cc: "10.0 10.1" <mesa-stable@lists.freedesktop.org>
Tested-by: David Heidelberger <david.heidelberger@ixit.cz>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=71547
2014-03-06 15:46:54 -08:00
Eric Anholt
c10896b593 i965: Fix render-to-texture in non-FinishRenderTexture cases.
We've had several problems now with FinishRenderTexture not getting called
enough, and we're ready to just give up on it ever doing what we need.  In
particular, an upcoming Steam title had rendering bugs that could be fixed
by always_flush_cache=true.

Instead of hoping Mesa core can figure out when we need to flush our
caches, just track what BOs we've rendered to in a set, and when we render
from a BO in that set, emit a flush and clear the set.

There's some overhead to keeping this set, but most of that is just
hashing the pointer -- it turns out our set never even gets very large,
because cache flushes are so common (even on cairo-gl).

No statistically significant performance difference in cairo-gl (n=100),
despite spending ~.5% CPU in these set operations.

v1: (Original patch by Eric Anholt.)
v2: (Changes by Ken Graunke.)
  - Rebase forward from May 7th 2013 -> March 4th 2014.
  - Drop the FinishRenderTexture hook entirely; after rebasing the
    patch, the hook was just an empty function.
  - Move the brw_render_cache_set_clear() call from
    intel_batchbuffer_emit_flush() to brw_emit_pipe_control_flush().
    In theory, this could catch more cases where we've flushed.
  - Consider stencil as a possible texturing source.
v3: (changes by anholt):
  - Move set_clear() back to emit_mi_flush() -- it means we can drop
    more forced flushes from the code.  In the previous location, it
    wouldn't have been called when we wanted pre-gen6.
  - Move the set clear from batch init to reset -- it should be empty at
    the start of every batch, since the kernel handled any inter-batch
    flush for us.
v4: Drop the debug code in set.c that I accidentally committed.

Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Dylan Baker <baker.dylan.c@gmail.com> [v2]
2014-03-06 11:35:17 -08:00
Brian Paul
1e25aa4cdb mesa: fix copy & paste bugs in pack_ubyte_SRGB8()
Cc: "10.0" "10.1" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-03-06 11:39:41 -07:00
Brian Paul
9493fc729e mesa: fix copy & paste bugs in pack_ubyte_SARGB8()
Cc: "10.0" "10.1" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2014-03-06 11:16:15 -07:00
Aaron Watry
fb78152678 gallium/util: Fix memory leak
Fix a leaked vertex shader in u_blitter.c

Signed-off-by: Aaron Watry <awatry@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>

CC: "10.1" <mesa-stable@lists.freedesktop.org>
2014-03-06 11:38:26 -06:00
José Fonseca
1d8e3067fd st/mesa: Add R8G8B8A8_SRGB case to st_pipe_format_to_mesa_format.
With the recent SRGB changes all my automated OpenGL llvmpipe tests
(piglit, conform, glretrace) start asserting with the backtrace below.

I'm hoping this change will fix it.  I'm not entirely sure, as this
doesn't happen in my development machine (the bug probably depends on
the exact X visual).

Anyway, it seems the sensible thing to do here.

   Program terminated with signal 5, Trace/breakpoint trap.
   #0  _debug_assert_fail (expr=expr@entry=0x7fa324df2ed7 "0", file=file@entry=0x7fa324e3fc30 "src/mesa/state_tracker/st_format.c", line=line@entry=758, function=function@entry=0x7fa324e40160 <__func__.34798> "st_pipe_format_to_mesa_format") at src/gallium/auxiliary/util/u_debug.c:281
   #0  _debug_assert_fail (expr=expr@entry=0x7fa324df2ed7 "0", file=file@entry=0x7fa324e3fc30 "src/mesa/state_tracker/st_format.c", line=line@entry=758, function=function@entry=0x7fa324e40160 <__func__.34798> "st_pipe_format_to_mesa_format") at src/gallium/auxiliary/util/u_debug.c:281
   No locals.
   #1  0x00007fa3241d22b3 in st_pipe_format_to_mesa_format (format=format@entry=PIPE_FORMAT_R8G8B8A8_SRGB) at src/mesa/state_tracker/st_format.c:758
           __func__ = "st_pipe_format_to_mesa_format"
   #2  0x00007fa3241c8ec5 in st_new_renderbuffer_fb (format=format@entry=PIPE_FORMAT_R8G8B8A8_SRGB, samples=0, sw=<optimised out>) at src/mesa/state_tracker/st_cb_fbo.c:295
           strb = 0x19e8420
   #3  0x00007fa32409d355 in st_framebuffer_add_renderbuffer (stfb=stfb@entry=0x19e7fa0, idx=<optimised out>) at src/mesa/state_tracker/st_manager.c:314
           rb = <optimised out>
           format = PIPE_FORMAT_R8G8B8A8_SRGB
           sw = <optimised out>
   #4  0x00007fa32409e635 in st_framebuffer_create (st=0x19e7fa0, st=0x19e7fa0, stfbi=0x19e7a30) at src/mesa/state_tracker/st_manager.c:458
           stfb = 0x19e7fa0
           mode = {rgbMode = 1 '\001', floatMode = 0 '\000', colorIndexMode = 0 '\000', doubleBufferMode = 0, stereoMode = 0, haveAccumBuffer = 0 '\000', haveDepthBuffer = 1 '\001', haveStencilBuffer = 1 '\001', redBits = 8, greenBits = 8, blueBits = 8, alphaBits = 8, redMask = 0, greenMask = 0, blueMask = 0, alphaMask = 0, rgbBits = 32, indexBits = 0, accumRedBits = 0, accumGreenBits = 0, accumBlueBits = 0, accumAlphaBits = 0, depthBits = 24, stencilBits = 8, numAuxBuffers = 0, level = 0, visualRating = 0, transparentPixel = 0, transparentRed = 0, transparentGreen = 0, transparentBlue = 0, transparentAlpha = 0, transparentIndex = 0, sampleBuffers = 0, samples = 0, maxPbufferWidth = 0, maxPbufferHeight = 0, maxPbufferPixels = 0, optimalPbufferWidth = 0, optimalPbufferHeight = 0, swapMethod = 0, bindToTextureRgb = 0, bindToTextureRgba = 0, bindToMipmapTexture = 0, bindToTextureTargets = 0, yInverted = 0, sRGBCapable = 1}
           idx = <optimised out>
   #5  st_framebuffer_reuse_or_create (st=st@entry=0x19dfce0, fb=<optimised out>, stfbi=stfbi@entry=0x19e7a30) at src/mesa/state_tracker/st_manager.c:728
   No locals.
   #6  0x00007fa32409e8cc in st_api_make_current (stapi=<optimised out>, stctxi=0x19dfce0, stdrawi=0x19e7a30, streadi=0x19e7a30) at src/mesa/state_tracker/st_manager.c:747
           st = 0x19dfce0
           stdraw = 0x640064
           stread = 0x1300000006
           ret = <optimised out>
   #7  0x00007fa324074a20 in XMesaMakeCurrent2 (c=c@entry=0x195bb00, drawBuffer=0x19e7e90, readBuffer=0x19e7e90) at src/gallium/state_trackers/glx/xlib/xm_api.c:1194
   No locals.
   #8  0x00007fa3240783c8 in glXMakeContextCurrent (dpy=0x194e900, draw=8388610, read=8388610, ctx=0x195bac0) at src/gallium/state_trackers/glx/xlib/glx_api.c:1177
           drawBuffer = <optimised out>
           readBuffer = <optimised out>
           xmctx = 0x195bb00
           glxCtx = 0x195bac0
           firsttime = 0 '\000'
           no_rast = 0 '\000'
   #9  0x00007fa32407852f in glXMakeCurrent (dpy=<optimised out>, drawable=<optimised out>, ctx=<optimised out>) at src/gallium/state_trackers/glx/xlib/glx_api.c:1211
   No locals.

Acked-by: Brian Paul <brianp@vmware.com>
2014-03-06 17:23:17 +00:00
Brian Paul
84094a273e glapi: remove u_mutex wrapper code, use c99 thread mutexes directly
v2: fix initializer mistake spotted by Chia-I Wu.

Reviewed-by: Chia-I Wu <olv@lunarg.com>
2014-03-06 07:53:06 -07:00
Brian Paul
846a7e8630 glapi: rename u_current dispatch table functions
Put "table" in the names to make things more understandable.

Reviewed-by: Chia-I Wu <olv@lunarg.com>
2014-03-06 07:47:12 -07:00
Brian Paul
280e065707 glapi: replace 'user' with 'context' in u_current.[ch] code
To make the functions more understandable.

Reviewed-by: Chia-I Wu <olv@lunarg.com>
2014-03-06 07:47:05 -07:00
Brian Paul
ef8a19ed4f glsl: fix compiler warnings in link_uniforms.cpp
With a non-debug build, gcc has two complaints:
1. 'found' var not used.  Silence with '(void) found;'
2. 'id' not initialized.  It's assigned by the UniformHash->get()
   call, actually.  But init it to zero to silence gcc.

Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-03-06 07:45:36 -07:00
Ilia Mirkin
3649800009 mesa/st: only compare the one scissor
sizeof(scissor) returns the size of the full array rather than a single
element. Fix it to consider just the one element.

Fixes: 0705fa35 ("st/mesa: add support for GL_ARB_viewport_array (v0.2)")
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Dave Airlie <airlied@redhat.com>
2014-03-05 22:51:58 -05:00
Chia-I Wu
4c68c6dcff st/mesa: make winsys fbo sRGB-capable when supported
The texture formats of winsys fbo are always linear becase the st manager
(st/dri for example) could not know the colorspace used.  But it does not mean
that we cannot make the fbo sRGB-capable.  By

 - setting rb->Visual.sRGBCapable to GL_TRUE when the pipe driver supports the
   format in sRGB colorspace,
 - giving rb an sRGB internal format, and
 - updating code to check rb->Format instead of strb->texture->format,

we should be good.

Fixed bug 75226 for at least llvmpipe and ilo, with no piglit regression.

v2: do not set rb->Visual.sRGBCapable for GLES contexts to avoid surprises

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=75226

Reviewed-by: Brian Paul <brianp@vmware.com>
Tested-by: Michel Dänzer <michel.daenzer@amd.com>
2014-03-06 10:59:25 +08:00
Chia-I Wu
6d23ca1621 st/mesa: add mappings for MESA_FORMAT_B8G8R8X8_SRGB
The format is mapped to PIPE_FORMAT_B8G8R8X8_SRGB.

Reviewed-by: Brian Paul <brianp@vmware.com>
2014-03-06 10:59:25 +08:00
Chia-I Wu
5a27491a76 mesa: add MESA_FORMAT_B8G8R8X8_SRGB
The format is needed to represent an RGB-only winsys framebuffer that is
sRGB-capable.

Reviewed-by: Brian Paul <brianp@vmware.com>
2014-03-06 10:59:25 +08:00
Brian Paul
48a9094b69 mesa: fix packing/unpacking for MESA_FORMAT_A4R4G4B4_UNORM
Spotted by Chia-I Wu.
v2: also fix unpack_ubyte_ARGB4444_REV()

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Chia-I Wu <olv@lunarg.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-03-05 16:06:54 -07:00
Eric Anholt
171ec9585f i965: Fix predicated-send-based discards with MRT.
We need the header setup to not be predicated on which pixels are
undiscarded.  I'm not sure originally if I had thought that the mask
disable implied predicate disable, or if I had just misread the mask
disable as predicate disable.  Either way, I know I had spent more time
thinking about this in the gen8 generator than the gen7 generator.

Plus, it turns out that I had mis-implemented the "the GPU will use the
predicate unless this header is present" comment, by skipping setting up
the pixel mask when the header was present.

Fixes GPU hangs in piglit glsl-fs-discard-mrt, Trine, Trine 2 and
preusmably MLL.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=75207
Tested-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-03-05 13:37:33 -08:00
Eric Anholt
9856d658ce configure: Fix bashism.
/bin/sh defaults to dash on debian.

Reviewed-by: Brian Paul <brianp@vmware.com>
2014-03-05 13:37:33 -08:00
Andreas Boll
c1958911f1 docs: update 10.2 release notes 2014-03-05 22:20:48 +01:00
Brian Paul
02cb04c68f mesa: remove remaining uses of _glthread_GetID()
It was really only used in the radeon driver for a debug printf.
And evidently, libGL.so referenced it just to work around some sort
of linker issue.

This patch removes the two calls to the function and the function
itself.

Fixes undefined _glthread_GetID symbol in libGL reported by 'nm'.
Though, the missing symbol doesn't cause any issues on my system but
it does cause glxinfo to fail on one of our test systems.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2014-03-05 11:05:48 -07:00
Brian Paul
0b0114cc3b mesa: new init_teximage_fields_ms() function to init MS texture images
Before, it was kind of ugly to set the multisample fields with
assignments after we called _mesa_init_teximage_fields().

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-03-05 11:05:47 -07:00
Rob Clark
4de1e5eddc WIP: freedreno/a3xx: incorrect scissor for binning pass
If scissor optimization is used (to avoid bringing scissored portions of
the render target into GMEM and then back out to system memory) in
combination with hw binning pass, the result would be a scissor mismatch
between binning pass and rendering pass.  This would cause rendering
bugs in some scenarios with (for example) gnome-shell.

I would have expected that simply using the correct screen-scissor
during the binning pass would be enough, but seems like there is
something else missing.  So for now disable binning pass if scissor
optimization is used.
2014-03-05 12:37:21 -05:00
Topi Pohjolainen
12d55d5f19 i965: Mark invariants in backend_visitor as constants
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-03-05 10:31:57 +02:00
Topi Pohjolainen
a290cd039c i965: Merge resolving of shader program source
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-03-05 10:31:44 +02:00
Topi Pohjolainen
81494ec613 i965: Merge initialisation of backend_visitor
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-03-05 10:20:21 +02:00
Topi Pohjolainen
afed5354aa i965/wm: Use resolved miptree consistently in surface setup
Most of the logic refers to the local variable 'mt' directly but
a few cases use 'intelObj->mt' instead. These are the same for
now but will be different once stencil miptree gets used.

v2 (Ian): fixed also indentation in surrounding lines

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-03-05 10:19:19 +02:00
Topi Pohjolainen
9b169a1893 i965/vec4: Mark invariant members as constants in vec4_visitor
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-03-05 10:13:57 +02:00
Topi Pohjolainen
8a9b4ade03 i965: Mark sources for offset getters as constants
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-03-05 10:13:05 +02:00
Ian Romanick
8f049dc298 docs: Import 10.1 release notes, add news item.
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2014-03-05 09:32:26 +02:00
Ilia Mirkin
c74783abfa nv50,nvc0: add 11f_11f_10f vertex support
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-03-04 21:54:54 -05:00
Kenneth Graunke
dfa1ab0e52 i965: Implement ARB_stencil_texturing on Gen8+.
On earlier hardware, we had to implement math in the shader to translate
Y-tiled or untiled coordinates to W-tiled coordinates (which is what
BLORP does today in order to texture from stencil buffers).

On Broadwell, we can simply state that it's W-tiled in SURFACE_STATE,
and adjust the pitch.  This is much easier.

In the surface state code, I chose to handle the "should we sample depth
or stencil?" question separately from the setup for sampling from
stencil.  This should make it work with the BindRenderbufferTexImage
hook as well, and hopefully be reusable for GL_ARB_texture_stencil8
someday.

v2: Update docs/GL3.txt (caught by Matt).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-03-04 17:23:03 -08:00
Kenneth Graunke
23e81b93bb mesa: Add core API support for GL_ARB_stencil_texturing (from 4.3).
While the GL_ARB_stencil_texturing extension does not allow the creation
of stencil textures, it does allow shaders to sample stencil values
stored in packed depth/stencil textures.

Specifically, applications can call glTexParameter* with a pname of
GL_DEPTH_STENCIL_TEXTURE_MODE and value of either GL_DEPTH_COMPONENT or
GL_STENCIL_INDEX to select which component they wish to sample.  The
default value is GL_DEPTH_COMPONENT (for traditional depth sampling).

Shaders should use an unsigned integer sampler (presumably usampler2D)
to access stencil data.  Otherwise, results are undefined.  Using shadow
samplers with GL_STENCIL_INDEX selected also is undefined behavior.

This patch creates a new gl_texture_object field, StencilSampling, to
indicate that stencil should be sampled rather than depth.  (I chose to
use a boolean since I figured it would be more convenient for drivers.)
It also introduces the [Get]TexParameter code to get and set the value,
and of course the extension plumbing.

v2: Also consider textures incomplete when sampling stencil with
    non-NEAREST min/mag filters (caught by Eric Anholt).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-03-04 17:21:06 -08:00
Dieter Nützel
5f23a2d9c2 radeon/uvd: fix typo in documentation
s/grap/grab/

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2014-03-04 17:54:07 -05:00
Eric Anholt
b959fd9674 dri: Require libudev-dev for building DRI on Linux.
The loader infrastructure for everything but DRI2 requires that udev be
present, so we can figure out an appropriate driver from the fd.  We don't
have a portable solution yet, but presumably it will have similar lookup
based on the device node.

It will also be even more required for krh's udev-based hwdb support,
which lets us have a loader that actually loads DRI drivers not included
in the loader's source distribution.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=75212
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-03-04 14:32:52 -08:00
Tom Stellard
262e15fdd4 clover: Use correct LLVM version in #if for DataLayout construction
Spotted by Michel Dänzer.
2014-03-04 16:22:09 -05:00
Zack Rusin
1dd84357ec translate: fix buffer overflows
Because in draw we always inject position at slot 0 whenever
fragment shader would take the maximum number of inputs (32) it
meant that we had PIPE_MAX_ATTRIBS + 1 slots to translate, which
meant that we were crashing with fragment shaders that took
the maximum number of attributes as inputs. The actual max number
of attributes we need to translate thus is PIPE_MAX_ATTRIBS + 1.

Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Matthew McClure <mcclurem@vmware.com>
2014-03-04 15:56:04 -05:00
Zack Rusin
08f174daa4 draw/llvm: fix generation of the VS with GS present
draw_current_shader_* functions return a final output when considering
both the geometry shader and the vertex shader. But when code generating
vertex shader we can not be using output slots from the geometry shader
because, obviously, those can be completely different. This fixes a
number of very non-obvious crashes.
A side-effect of this bug was that sometimes the vertex shading code
could save some random outputs as position/clip when the geometry
shader was writing them and vertex shader had different outputs at
those slots (sometimes writing garbage and sometimes something correct).

Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Matthew McClure <mcclurem@vmware.com>
2014-03-04 15:37:52 -05:00
Anuj Phogat
079bff5a99 mesa: Allow GL_DEPTH_COMPONENT and GL_DEPTH_STENCIL combinations in glTexImage{123}D()
From OpenGL 3.3 spec, page 141:
   "Textures with a base internal format of DEPTH_COMPONENT or DEPTH_STENCIL
    require either depth component data or depth/stencil component data.
    Textures with other base internal formats require RGBA component data.
    The error INVALID_OPERATION is generated if one of the base internal
    format and format is DEPTH_COMPONENT or DEPTH_STENCIL, and the other
    is neither of these values."

Fixes Khronos OpenGL CTS test failure: proxy_textures_invalid_size

Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-03-04 11:23:04 -08:00
Anuj Phogat
0f6f92e284 mesa: Use clear_teximage_fields() in place of _mesa_init_teximage_fields()
This patch makes no functional changes to the code.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-03-04 11:22:58 -08:00
Anuj Phogat
063980151e mesa: Set initial internal format of a texture to GL_RGBA
From OpenGL 4.0 spec, page 398:
   "The initial internal format of a texel array is RGBA
    instead of 1. TEXTURE_COMPONENTS is deprecated; always
    use TEXTURE_INTERNAL_FORMAT."

Fixes Khronos OpenGL CTS test failure: proxy_textures_invalid_size

Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-03-04 11:22:39 -08:00
Vinson Lee
f2d724c686 scons: Build with C++11 with LLVM >= 3.5.
Starting with llvm-3.5svn r202574, LLVM expects C+11 mode.

commit f8bc17fadc8f170c1126328d203f0dab78960137
Author: Chandler Carruth <chandlerc@gmail.com>
Date:   Sat Mar 1 06:31:00 2014 +0000

    [C++11] Turn off compiler-based detection of R-value references, relying
    on the fact that we now build in C++11 mode with modern compilers. This
    should flush out any issues. If the build bots are happy with this, I'll
    GC all the code for coping without R-value references.

    git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202574 91177308-0d34-0410-b5e6-96231b3b80d8

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
2014-03-04 10:12:20 -08:00
Brian Paul
cbacee207f st/osmesa: check buffer size when searching for buffers
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=75543
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
2014-03-04 08:49:15 -07:00
José Fonseca
3d7c8836a6 configure: s/--with-llvm-shared-libs/--enable-llvm-shared-libs/
`--enable-llvm-shared-libs` option was recently renamed as
`--with-llvm-shared-libs`, but several error messages still mention the
old option, causing confusing.

Trivial.
2014-03-04 14:09:37 +00:00
José Fonseca
a61d859519 c11/threads: Don't implement thrd_current on Windows.
GetCurrentThread() returns a pseudo-handle (a constant which only makes
sense when used within the calling thread) and not a real handle.

DuplicateHandle() will return a real handle, but it will create a new
handle every time we call.  Calling DuplicateHandle() here means we will
leak handles, which can cause serious problems.

In short, the Windows implementation of thrd_t needs a thorough make
over, and it won't be pretty.  It looks like C11 committee
over-simplified things: it would be much better to have seperate objects
for threads and thread IDs like C++11 does.

For now, just comment out the thrd_current() implementation, so we get
build errors if anybody tries to use it.

Thanks to Brian Paul for spotting and diagnosing this problem.

Cc: "10.0" "10.1" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-03-04 12:05:23 +00:00
José Fonseca
e8d85034da mapi/u_thread: Use GetCurrentThreadId
u_thread_self() expects thrd_current() to return a unique numeric ID
for the current thread, but this is not feasible on Windows.

Cc: "10.0" "10.1" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-03-04 12:05:23 +00:00
José Fonseca
f34d75d6f6 c11/threads: Fix nano to milisecond conversion.
Per https://gist.github.com/yohhoy/2223710/#comment-710118

Cc: "10.0" "10.1" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Michel Dänzer <michel@daenzer.net>
2014-03-04 12:05:23 +00:00
Marek Olšák
1337da5115 r600g: implement edge flags
Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2014-03-04 12:26:16 +01:00
Marek Olšák
ac35ded473 r600g: port color buffer format conversion from radeonsi
r600_translate_colorformat is rewritten to look like radeonsi.
r600_translate_colorswap is shared with radeonsi.
r600_colorformat_endian_swap is consolidated.

This adds some formats which were missing. Future "plain" formats will
automatically be supported.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2014-03-04 12:26:16 +01:00
Marek Olšák
dff3eccd15 radeonsi: move translate_colorswap to common code
Also translate the Y__X swizzle.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2014-03-04 12:26:16 +01:00
Emil Velikov
1a568e0f2b Revert "configure: use enable_dri_glx local variable"
This reverts commit dfe8cb48fc.

Accidently pushed this commit, over 1bb23abe065(configure: disable
shared glapi when building xlib powered glx).
2014-03-04 02:13:48 +00:00
Emil Velikov
1bb23abe06 configure: disable shared glapi when building xlib powered glx
With commit 0432aa064b(configure: use shared-glapi when more than one
gl* API is used) we removed "disable shared-glapi when building without
dri" hunk.

In the good old days of classic mesa, dri and xlib-glx were mutually
exclusive thus the hunk made sense.

Currently enable-dri is used as a synonym for a range of things thus
it's more appropriate to handle xlib-glx explicitly.

Fixes a missing symbol '_glapi_Dispatch' in a xlib powered libGL,
build using the following

 ./autogen.sh --enable-xlib-glx --disable-dri --with-gallium-drivers=swrast

Cc: Brian Paul <brianp@vmware.com>
Reported-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-03-04 02:13:14 +00:00
Brian Paul
1e3bdb35a6 mesa: remove unneeded glthread.c file
The _glthread_GetID() function is also defined in mapi_glapi.c

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2014-03-03 13:09:00 -07:00
Brian Paul
db806cacfd mesa: remove empty glthread.h file
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2014-03-03 13:08:59 -07:00
Brian Paul
94dc91d7ec mesa: remove unused glthread/TSD macros
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2014-03-03 13:08:59 -07:00
Brian Paul
bc76e9f28d xlib: remove unneeded context tracking code
This removes the only use of _glthread_Get/SetTSD(), etc.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2014-03-03 13:08:59 -07:00
Brian Paul
c00b250c80 xlib: simplify context handling
Get rid of the fake_glx_context struct.  Now, an XMesaContext is the
same as a GLXContext.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2014-03-03 13:08:59 -07:00
Brian Paul
9b8e267976 xlib: remove unused realglx.[ch] files
At one point in time, the xlib driver could call the real GLX functions.
But that's long dead.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2014-03-03 13:08:59 -07:00
Brian Paul
afbc9b3537 mesa: remove unused _glthread_*MUTEX() macros
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2014-03-03 13:08:59 -07:00
Brian Paul
f19000550d glsl: switch to c11 mutex functions
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2014-03-03 13:08:58 -07:00
Brian Paul
d129ea7fa2 mesa: switch to c11 mutex functions
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2014-03-03 13:08:58 -07:00
Brian Paul
2706db701d xlib: switch to c11 mutex functions
The _glthread_LOCK/UNLOCK_MUTEX() macros are just wrappers around
the c11 mutex functions.  Let's start getting rid of those wrappers.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2014-03-03 13:08:58 -07:00
Brian Paul
657436da7e mesa: update packed format layout comments
Update the comments for the packed formats to accurately reflect the
layout of the bits in the pixel.  For example, for the packed format
MESA_FORMAT_R8G8B8A8, R is in the least significant position while A
is in the most-significant position of the 32-bit word.

v2: also fix MESA_FORMAT_A1B5G5R5_UNORM, per Roland.
2014-03-03 13:08:58 -07:00
Hans
837da9bdae mesa: don't define c99 math functions for MSVC >= 1800
Signed-off-by: Brian Paul <brianp@vmware.com>
Cc: "10.0" "10.1" <mesa-stable@lists.freedesktop.org>
2014-03-03 11:56:33 -07:00
Hans
bf25660325 util: don't define isfinite(), isnan() for MSVC >= 1800
Signed-off-by: Brian Paul <brianp@vmware.com>
Cc: "10.0" "10.1" <mesa-stable@lists.freedesktop.org>
2014-03-03 11:56:30 -07:00
Brian Paul
aff7c5e78a mesa: don't call ctx->Driver.ClearBufferSubData() if size==0
Fixes failed assertion when trying to map zero-length region.

https://bugs.freedesktop.org/show_bug.cgi?id=75660
Cc: "10.0" "10.1" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-03-03 10:41:42 -07:00
Brian Paul
465b2c42bc softpipe: use 64-bit arithmetic in softpipe_resource_layout()
To avoid 32-bit integer overflow for large textures.  Note: we're
already doing this in llvmpipe.

Cc: "10.0" "10.1" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-03-03 10:41:42 -07:00
Grigori Goronzy
070036ca39 NV_vdpau_interop: fix IsSurfaceNV return type
The spec incorrectly used void as return type, when it should have
been GLboolean. This has now been fixed. According to Nvidia, their
implementation always used GLboolean.

Reviewed-by: Christian König <christian.koenig@amd.com>
2014-03-03 18:37:59 +01:00
Grigori Goronzy
86c06871a2 st/vdpau: fix possible NULL dereference
Reviewed-by: Christian König <christian.koenig@amd.com>
2014-03-03 18:37:35 +01:00
Christian König
bd6654aa38 st/omx: always advertise all components
omx_component_library_Setup should return all entrypoints the library
implements, independent of what is available on the current hardware.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=74944

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
2014-03-03 18:22:38 +01:00
Bruno Jiménez
79c83837c9 clover: Fix building with latest llvm
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-03-03 17:16:58 +01:00
Bruno Jiménez
089d0660c7 configure: Remove more flags from llvm-config
This way, we are left with only the preprocessor flags and '-std=X'

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-03-03 17:16:52 +01:00
Fabio Pedretti
8a8dd86edc configure.ac: consolidate dependencies version check
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-03-03 16:45:16 +01:00
Julien Cristau
6f0e2731e8 glx/dri2: fix build failure on HURD
Patch from Debian package.

Cc: "10.0 10.1" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-03-03 16:44:44 +01:00
Dave Airlie
15b4ff3f4e st/dri: add support for dma-buf importer (DRIimage v8)
This is just a simple implementation that stores the extra values into the DRIimage
struct and just uses the fd importer. I haven't looked into what is required
to import YUV or deal with the extra parameters.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-03-03 11:14:38 +10:00
Dave Airlie
3fd081d1a5 st/dri: move fourcc->format conversion to a common place
Before I cut-n-paste this a 3rd time lets consolidate it.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-03-03 11:14:38 +10:00
Kenneth Graunke
c95ec27a4a mesa: Move MESA_GLSL=dump output to stderr.
i965 recently moved debug printfs to use stderr, including ones which
trigger on MESA_GLSL=dump.  This resulted in scrambled output.

For drivers using ir_to_mesa, print_program was already using stderr,
yet all the code around it was using stdout.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-03-02 13:37:09 -08:00
Kenneth Graunke
3f37dd913f glsl: Fix broken LRP algebraic optimization.
opt_algebraic was translating lrp(x, 0, a) into add(x, -mul(x, a)).

Unfortunately, this references "x" twice, which is invalid in the IR,
leading to assertion failures in the validator.

Normally, cloning IR solves this.  However, "x" could actually be an
arbitrary expression tree, so copying it could result in huge piles
of wasted computation.  This is why we avoid reusing subexpressions.

Instead, transform it into mul(x, add(1.0, -a)), which is equivalent
but doesn't need two references to "x".

Fixes a regression since d5fa8a9562, which isn't in any stable
branches.  Fixes 18 shaders in shader-db (bastion and yofrankie).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-03-02 13:35:03 -08:00
Rob Clark
ecb71cfa66 freedreno/a3xx/compiler: overflow in trans_endif
The logic to count number of block outputs was out of sync with the
actual array construction.  But to simplify / make things less fragile,
we can just allocate the arrays for worst case size.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-03-02 11:26:35 -05:00
Rob Clark
e0007f733d freedreno/a3xx/compiler: fix for resolving PHI's
A value may be assigned on only one side of an if/else.  In this case we
can simply substitute a mov.f32f32.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-03-02 11:26:35 -05:00
Rob Clark
26530716ab freedreno/lowering: two-sided-color
Add option to generate fragment shader to emulate two sided color.
Additional inputs are added to shader for BCOLOR's (on corresponding to
each COLOR input).  CMP instructions are used to select whether to use
COLOR or BCOLOR.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-03-02 11:26:35 -05:00
Rob Clark
8dd70125fc freedreno/a3xx/compiler: add SSG
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-03-02 11:26:35 -05:00
Rob Clark
44c8f96b0d freedreno/a3xx: fix gl_PointSize
If vertex writes pointsize, there are a few extra bits we need to turn
on in the cmdstream here and there.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-03-02 11:26:35 -05:00
Rob Clark
05a9bda971 freedreno: resync generated headers
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-03-02 11:26:35 -05:00
Rob Clark
cb540c21f2 freedreno/a3xx: binning-pass vertex shader variant
Now that we have the infrastructure for shader variants, add support to
generate an optimized shader for hw binning pass (with varyings/outputs
other than position/pointsize removed).  This exposes the possibility
that the shader uses fewer constants than what is bound, so we have to
take care to not emit consts beyond what the shader uses, lest we
provoke the wrath of the HLSQ lockup!

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-03-02 11:26:35 -05:00
Rob Clark
664045752f freedreno/a3xx: add support for frag coord/face
Fixes anything that tries to use gl_FrontFacing/gl_FragCoord.  Also,
face support is needed to emulate two sided color.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-03-02 11:26:35 -05:00
Rob Clark
76924e3b51 freedreno/a3xx: fix for unused inputs
An unused input might not have a register assigned.  We don't want bogus
regid to result in impossibly high max_reg..

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-03-02 11:26:35 -05:00
Chris Forbes
befbda56a2 i965: Validate (and resolve) all the bound textures.
BRW_MAX_TEX_UNIT is the static limit on the number of textures we
support per-stage, not in total.

Core's `Unit` array is sized by MAX_COMBINED_TEXTURE_IMAGE_UNITS, which
is significantly larger, and across the various shader stages, up to
ctx->Const.MaxCombinedTextureImageUnits elements of it may be actually
used.

Fixes invisible bad behavior in piglit's max-samplers test (although
this escalated to an assertion failure on HSW with texture_view, since
non-immutable textures only have _Format set by validation.)

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Cc: "9.2 10.0 10.1" <mesa-stable@lists.freedesktop.org>
Cc: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-03-02 21:14:56 +13:00
Chris Forbes
590920f93e i965: Widen sampler key bitfields for 32 samplers
Previously the `high` 16 samplers on Haswell+ would not get sampler
workarounds applied.

Don't bother widening YUV fields, since they're ignored and going away
soon anyway.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
Cc: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-03-02 21:14:18 +13:00
Emil Velikov
fc25956bad dri/i9*5: correctly calculate the amount of system memory
The variable name states megabytes, while we calculate the amount in
kilobytes. Correct this by dividing with the correct amount.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Cc: "10.0 10.1" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-03-01 08:49:59 -08:00
Ilia Mirkin
f19271c7bf gallium/util: add missing u_math include
This is needed for MIN2/MAX2

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-02-28 20:00:34 -05:00
Brian Paul
a12d4d0398 mesa: add unpacking code for MESA_FORMAT_Z32_FLOAT_S8X24_UINT
Fixes glGetTexImage() when converting from MESA_FORMAT_Z32_FLOAT_S8X24_UINT
to GL_UNSIGNED_INT_24_8.  Hit by the piglit
ext_packed_depth_stencil-getteximage test.

Cc: "10.0" "10.1" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-02-28 17:16:37 -07:00
Siavash Eliasi
2a399d9eae glx/apple: Fixed glx context memory leak in case of failure.
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Jeremy Huddleston Sequoia: <jeremyhu@apple.com>
2014-02-28 15:57:15 -08:00
Siavash Eliasi
f4416323fc gbm/dri: Fixed buffer object memory leak in case of failure.
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-02-28 15:57:15 -08:00
Siavash Eliasi
0fe8d71667 r300g/tests: Added missing fclose for FILE resource.
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-02-28 15:57:15 -08:00
Ian Romanick
ff2cbf9e0c i915: Allocate the sys_buffer using _mesa_align_malloc
Though it won't matter on Linux, use _mesa_align_free to release it.
Since i965 doesn't have sys_buffer, I overlooked this in the
GL_ARB_map_buffer_alignment work a few months ago.  Fixes i915 (and
presumably i830) regressions in ARB_map_buffer_range tests and the
failure in arb_map_buffer_alignment-sanity_test.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=74960
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-02-28 15:05:39 -08:00
Ian Romanick
8ba157006f i915: Only allow 8 vertex texture units
There's no reason to have more vertex texture units than fragment
texture units on this hardware.  Since increasing the default maximum
number of texture units from 16 to 32, this has triggered some segfault
in i915 driver.  There's probably some array or bitfield that isn't
properly sized now.  This really papers over the bug, but I don't think
I'll lose any sleep over that.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=74071
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-02-28 15:05:38 -08:00
Petri Latvala
59989a4a92 i965: Assert array index on access to vec4_visitor's arrays.
v2: vec4_visitor::pack_uniform_registers(): Use correct comparison in the
  assert, this->uniforms is already adjusted. Compare the actual value used to
  index uniform_size and uniform_vector_size instead.

Signed-off-by: Petri Latvala <petri.latvala@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-02-28 15:05:38 -08:00
Petri Latvala
7189fce237 i965: Allocate vec4_visitor's uniform_size and uniform_vector_size arrays dynamically.
v2: Don't add function parameters, pass the required size in
prog_data->nr_params.

v3:
- Use the name uniform_array_size instead of uniform_param_count.
- Round up when dividing param_count by 4.
- Use MAX2() instead of taking the maximum by hand.
- Don't crash if prog_data passed to vec4_visitor constructor is NULL

v4: Rebase for current master

v5 (idr): Trivial whitespace change.

Signed-off-by: Petri Latvala <petri.latvala@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=71254
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-02-28 15:05:38 -08:00
Marek Chalupa
96f324e229 gbm: export gbm_device_is_format_supported
Probably depending on compiler settings, the definition can be hidden,
so undefined reference error can be encountred during linking.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=75528
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-02-28 22:57:30 +00:00
Emil Velikov
dfe8cb48fc configure: use enable_dri_glx local variable
GLX can be either dri or xlib based, while enable_dri is
used in a variety of contexts.

With enable_dri_glx the context is clearly visible.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-02-28 22:56:33 +00:00
Emil Velikov
4687b0a1a7 configure: enable the drm pipe-loader for non swrast drivers
All hardware drivers including the virtual vmwgfx require
the drm pipe-loader in order to be properly loaded by xa,
gbm and opencl.

Note this does _not_ add support for the above three it only
allows the pipe driver to be loaded by the library.

Eg. GBM will now properly open the pipe-i915 driver, should
one be working on the such hardware.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=75453
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-02-28 22:48:38 +00:00
Emil Velikov
e283e96666 configure: error out when building xa only with swrast
Building to provide accelration using swrast does not make
sense.

Note: update your build script to explicitly mention svga
in the gallium drivers list, if you are building the vmwgfx
xa library.

v2: Update error message to provide more clarify, add an example.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-02-28 22:47:56 +00:00
Emil Velikov
2e830bba21 configure: avoid setting variables as empty strings
Recent patch converted our logic to use test -n and test -z.
An emptry string variable (empty_str="") return true for both
thus making the check unreliable.

Fix this by correctly setting the variable when applicable.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-02-28 22:34:50 +00:00
Emil Velikov
f42333b6b6 configure: avoid constantly building megadrivers 'core'
The issue is caused by a thinko that an empty string will be
considered of zero length by 'test'. This is not the case,
thus we were building the 'core' of megadrivers even when no
classic drivers were built.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-02-28 22:34:50 +00:00
Tom Stellard
f61e382f0a r600g/compute: PIPE_CAP_COMPUTE should be false for pre-evergreen GPUs
This prevents clover from using unsupported devices.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>

CC: "10.0 10.1" <mesa-stable@lists.freedesktop.org>
2014-02-28 16:17:34 -05:00
Matt Turner
4bd7f1d044 glsl: Don't vectorize horizontal expressions.
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=75224
2014-02-28 10:37:52 -08:00
Matt Turner
5eff8576ba glsl: Add is_horizontal() method to ir_expression.
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
2014-02-28 10:37:46 -08:00
Matt Turner
d5fa8a9562 glsl: Optimize lrp(x, 0, a) into x - (x * a).
Helps one program in shader-db:

instructions in affected programs:     96 -> 92 (-4.17%)

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-02-28 10:36:12 -08:00
Matt Turner
ecc6c3d4ab glsl: Optimize lrp(0, y, a) into y * a.
Helps two programs in shader-db:

instructions in affected programs:     254 -> 234 (-7.87%)

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-02-28 10:36:06 -08:00
Brian Paul
43dee0295e mesa: do depth/stencil format conversion in glGetTexImage
glGetTexImage(GL_DEPTH_STENCIL, GL_UNSIGNED_INT_24_8) was just
using memcpy() instead of _mesa_unpack_uint_24_8_depth_stencil_row()
to convert texels from the hardware format to the GL format.

Fixes issue reported by David Meng at Intel.  The new piglit
ext_packed_depth_stencil-getteximage test checks for this bug.

Also, add some format/type assertions.  We don't yet handle the
GL_FLOAT_32_UNSIGNED_INT_24_8_REV type.  That should be fixed in
a follow-on patch.

Reviewed-by: Eric Anholt <eric@anholt.net>
Cc: "10.0" "10.1" <mesa-stable@lists.freedesktop.org>
2014-02-28 07:02:55 -07:00
Brian Paul
84787aae95 mesa: fix depth/stencil comments in formats.h 2014-02-28 07:02:36 -07:00
Thomas Hellstrom
f5e681f3fa winsys/svga: Avoid calling drm getparam for max surface size on older kernels
This avoids the kernel driver spewing out errors about the param not being
supported.

Also correct the max surface size used when the kernel does not support the
query.

Reported-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
2014-02-28 11:11:21 +01:00
Kenneth Graunke
085f61bd4e meta: Drop ctx->API checks.
API is always API_OPENGL_COMPAT (since commit 4e4a537ad5,
"meta: Push into desktop GL mode when doing meta operations."),
so most of these checks do nothing.

We could instead check save->API to only bother setting/restoring
relevant GL state, but I'm not sure saving a few _mesa_set_enable
calls is worth the complexity.  My understanding is the point of
the ctx->API guards was to avoid raising GL errors.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2014-02-27 10:07:40 -08:00
Kenneth Graunke
cf719a0204 meta: Restore API at the end of _mesa_meta_end(), not the start.
In _mesa_meta_begin(), we switch to API_OPENGL_COMPAT, then munge a lot
of state (including some that doesn't exist in the actual API - like
PolygonStipple in API_OPENGL_CORE).

It seems reasonable that in _mesa_meta_end(), we should restore it,
then switch back to the original API.  This at least makes it symmetric.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2014-02-27 10:07:40 -08:00
Roland Scheidegger
612a1d5be1 util/u_format: don't crash in util_format_translate if we can't do translation
Some formats can't be handled - in particular cannot handle ints/uints formats,
which lack the pack_rgba_float/unpack_rgba_float functions. Instead of trying
to call these (and crash) return an error (I'm not sure yet if we should try
to translate such formats too here might not make much sense).

v2: suggested by Jose, use separate checks for pack/unpack of rgba_8unorm and
rgba_float functions (right now if one exists the other should as well).

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2014-02-27 17:56:10 +01:00
Kenneth Graunke
80c1b9349c i965: Convert VUE map generation checks to if rather than switch.
There are currently only two VUE map layouts: one for Gen4-5, and one
for everything else.  We keep having to add new "case N+1" labels for
every new hardware generation, and so far it's always been the same.

This patch makes it so we only have to do work in the case where
something actually changes.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-02-27 00:05:55 -08:00
Kenneth Graunke
9b1a6745f6 i965: Only emit VS state pipe control workaround on IVB and BYT.
According to the BSpec's 3D workarounds page, this is unnecessary on
shipping Haswell hardware, and was never necessary on Broadwell.  It
unfortunately doesn't say anything about Baytrail.

The workaround database confirms those results for Ivybridge, Haswell,
and Broadwell.  Baytrail is less clear - one page says it's necessary,
while the other says it isn't.  For now, be conservative and leave it
enabled.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-02-27 00:05:48 -08:00
Ilia Mirkin
51fc093421 nouveau: add a nouveau_compiler binary to compile TGSI into shader ISA
This makes it easy to compare output between different cards, especially
for ones that you don't have (and/or not in the current machine).

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-02-26 23:35:48 -05:00
Ilia Mirkin
dd370f0af6 nv30: remove nv30_context use from nvfx_*prog
This should pave the way to being able to use the compiler without a
context. Also leads to cleaner code.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-02-26 23:35:47 -05:00
Ilia Mirkin
41dbc4c444 nv30: remove unused sprite flipping parameter
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-02-26 23:35:47 -05:00
Ilia Mirkin
fe2738f998 nv30: remove unused render_mode and hw_pointsprite_control
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-02-26 23:35:46 -05:00
Ilia Mirkin
8f23d08928 nv30: remove use_nv4x, it is identical to is_nv4x
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-02-26 23:35:45 -05:00
Ilia Mirkin
734fe2d246 docs: update nvc0 state
ARB_texture_buffer_object_rgb32 has been supported for a while already.
2014-02-26 23:35:45 -05:00
Michel Daenzer
59936a49dd radeonsi: Prevent geometry shader from emitting too many vertices 2014-02-27 10:27:55 +09:00
Anuj Phogat
b3094d9927 i965: Fix the region's pitch condition to use blitter
intelEmitCopyBlit uses a signed 16-bit integer to represent
buffer pitch, so it can only handle buffer pitches < 32k.

Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-02-26 13:43:00 -08:00
Brian Paul
863a1f7757 glsl: add switch case for MESA_SHADER_COMPUTE
To fix warning about unhandled enum value.

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-02-26 13:29:16 -07:00
Kenneth Graunke
fe8f3bef31 meta: Use a #define for the vector type to avoid %svec4 everywhere.
By adding "#define gvec4 %svec4" to the top of our fragment shader, we
can write generic code without needing to specialize it to vec4, ivec4,
or uvec4 via asprintf.

This also makes the INT and UNSIGNED_INT merge function code identical,
so I combined those two cases.

It's not a big savings, but a little bit tidier.

v2: Rebase on Vinson's MSVC build fixes.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-02-26 02:33:58 -08:00
Kenneth Graunke
f896e82301 i965: Don't try to dump shader source for fixed-function FS programs.
sh->Source is NULL and this will segfault.

Fixes MESA_GLSL=dump with "The Swapper".

Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-02-26 02:31:24 -08:00
Kenneth Graunke
b18871c863 i965: Don't forget to subtract mt->first_level in minify calls.
This fixes fbo-clear-formats GL_ARB_depth_texture on Ironlake, which
regressed since commit f128bcc7c2
("i965: Drop mt->levels[].width/height.")  intel_miptree_copy_slice was
calling minify(.., 7) on a 2x2 texture with mt->first_level == 7.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=75292
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-02-26 02:29:44 -08:00
Kenneth Graunke
ac0a8b9540 glsl: Delete LRP_TO_ARITH lowering pass flag.
Tt's kind of a trap---calling do_common_optimization() after
lower_instructions() may cause opt_algebraic() to reintroduce
ir_triop_lrp expressions that were lowered, effectively defeating the
point.  Because of this, nobody uses it.

v2: Delete more code (caught by Ian Romanick).

Cc: "10.1" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Acked-by: Eric Anholt <eric@anholt.net>
2014-02-26 02:16:56 -08:00
Kenneth Graunke
2fdea48e21 i965: Stop lowering ir_triop_lrp.
Both the vector and scalar backends now support it natively, so there's
no point in lowering it.

Cc: "10.1" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Acked-by: Eric Anholt <eric@anholt.net>
2014-02-26 02:16:55 -08:00
Kenneth Graunke
56879a7ac4 i965/vec4: Handle ir_triop_lrp on Gen4-5 as well.
When the vec4 backend encountered an ir_triop_lrp, it always emitted an
actual LRP instruction, which only exists on Gen6+.  Gen4-5 used
lower_instructions() to decompose ir_triop_lrp at the IR level.

Since commit 8d37e9915a ("glsl: Optimize open-coded lrp into lrp."),
we've had an bug where lower_instructions translates ir_triop_lrp into
arithmetic, but opt_algebraic reassembles it back into a lrp.

To avoid this ordering concern, just handle ir_triop_lrp in the backend.
The FS backend already does this, so we may as well do likewise.

v2: Add a comment reminding us that we could emit better assembly if we
    implemented the infrastructure necessary to support using MAC.
    (Assembly code provided by Eric Anholt).

Cc: "10.1" <mesa-stable@lists.freedesktop.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=75253
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Acked-by: Eric Anholt <eric@anholt.net>
2014-02-26 02:16:53 -08:00
Kenneth Graunke
ffde483f3c i965/vec4: Add a brw->gen >= 6 assertion in three-source emitters.
Three source instructions didn't exist until Gen6.  vec4_generator has
assertions to catch this, but catching it in the visitor provides a
nicer backtrace.

Cc: "10.1" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Acked-by: Eric Anholt <eric@anholt.net>
2014-02-26 02:16:34 -08:00
Chia-I Wu
bb9c8071ea ilo: create u_upload_mgr last
Similar to u_blitter, u_upload_mgr is now a client of the pipe context.  Its
creation needs to be delayed until the context has been (almost) initialized.
2014-02-26 11:33:37 +08:00
Fredrik Höglund
3616e862f2 glx: Fix the GLXFBConfig attrib sort priorities
The sort priorites for GLX_SAMPLES and GLX_SAMPLE_BUFFERS are
not defined in GL_ARB_multisample, but they are defined in
the GLX 1.4 specification.

Cc: "9.2 10.0 10.1" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-02-26 02:17:12 +01:00
Fredrik Höglund
f41c2f6c33 glx: Fix the default values for GLXFBConfig attributes
The default values for GLX_DRAWABLE_TYPE and GLX_RENDER_TYPE are
GLX_WINDOW_BIT and GLX_RGBA_BIT respectively, as specified in
the GLX 1.4 specification.

This fixes the glx-choosefbconfig-defaults piglit test.

Cc: "9.2 10.0 10.1" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-02-26 02:16:42 +01:00
Tom Stellard
54df6a0491 Re-commit 'clover: Fix build with LLVM 3.5'
This was accidentally reverted in 9dfd7c5f75
2014-02-25 14:43:26 -08:00
Vinson Lee
f094866d93 mesa: Add GL_ARB_buffer_storage to dispatch_sanity.cpp.
Fixes 'make check' failure introduced with commit
119ffa7307.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=75503
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-02-25 14:00:08 -08:00
Timothy Arceri
9dfd7c5f75 Revert "Merge branch 'master' of git+ssh://git.freedesktop.org/git/mesa/mesa"
This reverts commit 1b79582f32, reversing
changes made to 376a98d345.
2014-02-26 08:46:08 +11:00
Timothy Arceri
1b79582f32 Merge branch 'master' of git+ssh://git.freedesktop.org/git/mesa/mesa
ry,
2014-02-26 08:39:32 +11:00
Tom Stellard
fcd499730b clover: Fix build with LLVM 3.5 2014-02-25 13:32:37 -08:00
Timothy Arceri
376a98d345 glsl: removed unused dimension_count varible
This variable is no longer needed after the cleanup to the
code prior to the first arrays of array series

Signed-off-by: Timothy Arceri <t_arceri@yahoo.com.au>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-02-26 08:31:25 +11:00
Ilia Mirkin
d9b983519c build: llvm libs may not be in system search path, add rpath
On my gentoo system, llvm libs are in /usr/lib64/llvm, and llvm-config
--ldflags does not provide the rpath (it does, of course, provide a -L).
This adds the llvm dir to the rpath. It should be harmless if the path
is a system path, and should make things work when it's not.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Tested-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-02-25 15:30:13 -05:00
Eric Anholt
42c2366de5 i965: Fix segfaults since the buffer_storage changes. 2014-02-25 12:19:15 -08:00
Ilia Mirkin
6417cabd9c docs: update nv50 support
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-02-25 14:42:35 -05:00
Ilia Mirkin
d1b1329c3a nv50: enable txg where supported
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-02-25 14:42:34 -05:00
Ilia Mirkin
0e71c65db0 nv50: enable cube map array texture support
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-02-25 14:42:34 -05:00
Brian Paul
5a3dc449a9 libgl-xlib: add -Isrc/gallium/winsys flag
So that sw/xlib/xlib_sw_winsys.h can be found.  Fixes a build break.

Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-02-25 12:35:07 -07:00
Brian Paul
c88a0b6af3 st/mesa: add comment to explain _min(), _maxf(), etc. functions
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-02-25 12:35:07 -07:00
Marek Olšák
9855477e90 r600g,radeonsi: consolidate create_surface and surface_destroy
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-02-25 16:08:26 +01:00
Marek Olšák
b9aa8ed009 radeonsi: inline util_blitter_copy_texture
This will be used for changing texture properties without modifying
pipe_resource like r600g, but not in this series. For now, this change
allows consolidation of pipe_surface functions.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-02-25 16:08:22 +01:00
Marek Olšák
f7176d700f radeonsi: remove useless psbox variable from resource_copy_region
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-02-25 16:08:20 +01:00
Marek Olšák
80eb377a37 radeonsi: compute depth surface registers only once
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-02-25 16:08:18 +01:00
Marek Olšák
629b019a40 radeonsi: compute color surface registers only once
Same as r600g.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-02-25 16:08:17 +01:00
Marek Olšák
6b4e03216a r600g: remove r600_resource.h
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-02-25 16:08:15 +01:00
Marek Olšák
ec266d06d0 r600g: remove r600_surface::htile_enabled
v2: use one of the htile registers instead

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-02-25 16:08:12 +01:00
Marek Olšák
7fc6ece40e r600g: use r600_surface::db_z_info
db_z_info was unused. This just renames the variable to match the register
name.

Now, db_depth_info is unused on Evergreen.
Both variables will be needed on SI though.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-02-25 16:08:10 +01:00
Marek Olšák
40b9812a76 r600g,radeonsi: share r600_surface
I'm gonna use this in radeonsi.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-02-25 16:08:08 +01:00
Marek Olšák
933eaeee25 radeonsi: move PA_SU_POLY_OFFSET_DB_FMT_CNTL to framebuffer state
It doesn't depend on anything else.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-02-25 16:08:05 +01:00
Marek Olšák
dca350201e mesa: allow buffers to be mapped multiple times
OpenGL allows a buffer to be mapped only once, but we also map buffers
internally, e.g. in the software primitive restart fallback, for PBOs,
vbo_get_minmax_index, etc. This has always been a problem, but it will
be a bigger problem with persistent buffer mappings, which will prevent
all Mesa functions from mapping buffers for internal purposes.

This adds a driver interface to core Mesa which supports multiple buffer
mappings and allows 2 mappings: one for the GL user and one for Mesa.

Note that Gallium supports an unlimited number of buffer and texture
mappings, so it's not really an issue for Gallium.

v2: fix unmapping in xm_dd.c, remove the GL errors there
v3: fix the intel driver (by Fredrik)

Reviewed-by: Fredrik Höglund <fredrik@kde.org>
2014-02-25 16:07:33 +01:00
Marek Olšák
86e68b0f1f docs: update ARB_buffer_storage status
Reviewed-by: Fredrik Höglund <fredrik@kde.org>
2014-02-25 16:07:33 +01:00
Marek Olšák
04fb4bf61b gallium/upload_mgr: remove useless variable "size"
Reviewed-by: Fredrik Höglund <fredrik@kde.org>
2014-02-25 16:07:33 +01:00
Marek Olšák
7ea3f6bce5 gallium/upload_mgr: don't unmap buffers if persistent mappings are supported
Reviewed-by: Fredrik Höglund <fredrik@kde.org>
2014-02-25 16:07:33 +01:00
Marek Olšák
db8886ed09 gallium: the other drivers don't support ARB_buffer_storage
Reviewed-by: Fredrik Höglund <fredrik@kde.org>
2014-02-25 16:07:33 +01:00
Marek Olšák
6381dd7e9d r300g,r600g,radeonsi: add support for ARB_buffer_storage
All GTT memory mappings are coherent and therefore can be persistent.

Reviewed-by: Fredrik Höglund <fredrik@kde.org>
2014-02-25 16:05:41 +01:00
Marek Olšák
dfa0b8d9b8 st/mesa: implement ARB_buffer_storage
Reviewed-by: Fredrik Höglund <fredrik@kde.org>
2014-02-25 16:05:41 +01:00
Marek Olšák
5f61f052b5 gallium: add interface for persistent and coherent buffer mappings
Required for ARB_buffer_storage.
2014-02-25 16:05:41 +01:00
Marek Olšák
d26a065b74 mesa: allow buffers mapped with the persistent flag to be used by the GPU
v2: also fixed InvalidateBufferData, added citations from the 4.4 spec

Reviewed-by: Fredrik Höglund <fredrik@kde.org>
2014-02-25 16:04:22 +01:00
Marek Olšák
4f78e17f6d mesa: add error checks to glMapBufferRange, glMapBuffer for ARB_buffer_storage
Reviewed-by: Fredrik Höglund <fredrik@kde.org>
2014-02-25 16:04:22 +01:00
Marek Olšák
119ffa7307 glapi: add ARB_buffer_storage
Reviewed-by: Fredrik Höglund <fredrik@kde.org>
2014-02-25 16:04:22 +01:00
Marek Olšák
e592f11227 mesa: implement glBufferStorage, immutable buffers; add extension enable flag
Reviewed-by: Fredrik Höglund <fredrik@kde.org>

v2: dropped the error that DYNAMIC_STORAGE is required for MAP_WRITE_BIT,
    the error is removed in the latest revision of GL 4.4
2014-02-25 16:04:22 +01:00
Marek Olšák
7e548d0507 mesa: add storage flags parameter to Driver.BufferData
It will be used by glBufferStorage. The parameters are chosen according
to ARB_buffer_storage.

Reviewed-by: Fredrik Höglund <fredrik@kde.org>
2014-02-25 16:04:22 +01:00
Marek Olšák
aea4933287 mesa: remove unused driver hook BindBuffer
Reviewed-by: Fredrik Höglund <fredrik@kde.org>
2014-02-25 16:04:21 +01:00
Emil Velikov
882070cc81 nv50: correctly calculate the number of vertical blocks during transfer map
Cc: "10.0 10.1" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-02-25 12:19:07 +00:00
Dave Airlie
7c3138acb9 st/mesa: add texture gather support. (v2)
This adds support for GL_ARB_texture_gather, and one step of
support for GL_ARB_gpu_shader5.

This adds support for passing the TG4 instruction, along
with non-constant texture offsets, and tracking them for the
optimisation passes.

This doesn't support native textureGatherOffsets hw, to do that
you'd need to add a CAP and if set disable the lowering pass,
and bump the MAX offsets to 4, then do the i0,j0 sampling using
those.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-02-25 13:29:37 +10:00
Dave Airlie
2fcbec48d7 gallium: add texture gather support to gallium (v3)
This adds support to gallium for a TG4 instruction,
and two CAPs. The first CAP is required for GL_ARB_texture_gather.

The second CAP is required to expose GL_ARB_gpu_shader5.

However so far we haven't found any hardware that natively
exposes the textureGatherOffsets feature from GL, so just
lower it for now. If hardware appears for this we can add
another CAP to allow TG4 to take 4 offsets.

v2: add component selection src and a cap to say
hw can do it. (st can use to help control
GL_ARB_gpu_shader5/GLSL 4.00). Add docs.

v3: rename to SM5, add docs.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-02-25 13:29:17 +10:00
Dave Airlie
122c3b9486 glsl/i965: move lower_offset_array up to GLSL compiler level.
This lowering pass will be useful for gallium drivers as well, in order to support
the GL TG4 oddity that is textureGatherOffsets.

Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-02-25 13:28:57 +10:00
Tom Stellard
945d87f958 clover: Pass buffer offsets to the driver in set_global_binding() v3
The offsets will be stored in the handles parameter.  This makes
it possible to use sub-buffers.

v2:
  - Style fixes
  - Add support for constant sub-buffers
  - Store handles in device byte order

v3:
  - Use endian helpers

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2014-02-24 12:56:27 -08:00
Tom Stellard
eac7236042 radeonsi: Use SI_BIG_ENDIAN now that it exists
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-02-24 12:56:27 -08:00
Tom Stellard
8f3bcedde2 r600g: Use util_cpu_to_le32() instead of bswap32() on big-endian systems
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-02-24 12:56:27 -08:00
Tom Stellard
195ee10673 radeonsi: Use util_cpu_to_le32() instead of bswap32() on big-endian systems
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-02-24 12:56:27 -08:00
Tom Stellard
9f30685fae util: Add util_cpu_to_le* helpers
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2014-02-24 12:56:27 -08:00
Tom Stellard
a9f88e2ae8 util: Add util_bswap64() v3
v2:
  - Use __builtin_bswap64()
  - Remove unnecessary mask
  - Add util_le64_to_cpu() helper

v3:
  - Remove unnecessary AC_SUBST

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-02-24 12:56:27 -08:00
Tom Stellard
f8ba0f55d3 configure.ac: Use AX_GCC_BUILTIN to check availability of __builtin_bswap32 v2
v2:
  - Remove unnecessary AC_SUBST

Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-02-24 12:56:26 -08:00
Emil Velikov
73b46136b0 targets/opencl: resolve undefined symbols at link time
Current automake build does not try to resolve undefined
symbols thus we could end up with a broken library.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2014-02-24 14:59:39 +00:00
Emil Velikov
1ad9534337 gallium/targets: resolve undefined reference to pipe_loader_sw_probe_dri
With the introduction of the pipe_loader_sw_probe_dri helper we
require the sw/dri winsys during linking stage despite it being
unused by any of the targets. This will cause a minor increase
in the resulting library which will be cleaned up via linker
options with upcoming patches.

v2: Link with libswdri.la only when available.

Reported-and-tested-by: Tom Stellard <thomas.stellard@amd.com> (v1)
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-02-24 14:59:34 +00:00
Emil Velikov
61973ffe5b configure: correctly report if we're building the sw/xlib winsys
While looking at bug 75356, I've noticed that the presence of
x11 egl platform pulls in sw/xlib as "needed" but fails to
report so at the end of configure.

Tested-by: Tom Stellard <thomas.stellard@amd.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-02-24 14:57:41 +00:00
Emil Velikov
3445e8bb92 pipe-loader: wrap pipe_loader_sw_probe_xlib within HAVE_PIPE_LOADER_XLIB
The above function implies using the the xlib winsys, which
has additional library dependencies that should not be forced.

Make the software xlib pipe loader optional thus avoid all
the dependency hell. A user that wishes to use the particular
pipe-loader would need to set the following within configure.ac.

 enable_gallium_xlib_loader=yes

v2:
 - Wrap sw/xlib/xlib_sw_winsys.h to handle compilation on systems
lacking X11 headers. Spotted by Christian Prochaska.

Tested-by: Tom Stellard <thomas.stellard@amd.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=75356
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-02-24 14:52:27 +00:00
Emil Velikov
0e7c30233f targets/gbm: exit gracefully if pipe_loader_drm_probe_fd is not available
When one builds without gallium_drm_loader, the above function will
not be available, thus we'll segfault in gallium_screen_create due
to memory access violation.

Tested-by: Tom Stellard <thomas.stellard@amd.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=75335
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-02-24 14:51:45 +00:00
Kenneth Graunke
73c78c514f i965: Don't try to use the hardware blitter for multisampled miptrees.
The blitter is completely ignorant of MSAA buffer layouts, so any
attempt to use BLT paths with MSAA buffers is likely to break
spectacularly.

In most cases, BLORP handles MSAA blits, so we never hit this bug.
Until recently, it also wasn't worth fixing, since Meta couldn't handle
MSAA either, so there was nothing to fall back to.  But now there is.

+143 piglit tests on Broadwell (which doesn't have BLORP support).
Surprisingly, three also start failing.  Since non-IMS MSAA buffers
store samples in successive array slices, using the blitter ought to
access sample 0 and ignore the rest, which is apparently good enough for
a few not-very-picky Piglit tests.  Presumably the meta replacement code
is still broken.

No Piglit changes on Ivybridge.

v2: Move the early return to the top of the function (suggested by
    Paul).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2014-02-23 20:19:00 -08:00
Rob Clark
3f7239ca0e freedreno/a3xx/compiler: half-precision output
Using generic shaders caused a measurable fps drop, which was isolated to
use of full precision (vs half precision) output.  This is an attempt to
regain that lost performance by using half precision solid/blit shaders
(when the output format is not float32).

Note: for the built-in shaders, I would not expect them to be register
starved.  And in fact it is the solid frag shader that seems to have the
biggest impact.  So I suspect you get double the pixel pipe units (or
half the cycles) when the output is half precision.  So there may be
some gain to using half precision output for application shaders as
well, even though the rest of register usage is still full precision.
But for half precision to work for more complex shaders, we need to deal
with some constraints, like cat2 needing same precision for it's two src
registers.  So for now it is not enabled by default except for the
built-in shaders.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-02-23 14:58:24 -05:00
Rob Clark
141ae71671 freedreno/a3xx: add shader variants
Start putting in place infrastructure to deal with multiple shader
variants.  Initially we'll use this for two sided color (frag) and
binning pass (vert) shaders.  Possibly need for others later (such
as YUV vs RGB eglImage?).

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-02-23 14:58:23 -05:00
Rob Clark
9bbfae6265 freedreno/a3xx/compiler: collapse nop's with repeat
Easier than making more extensive use of rpt, and the more compact
shaders seem to bring some bit of performance boost.  (Perhaps repeat
flag benefits are more than just instruction cache, possibly it saves
on instruction decode as well?)

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-02-23 14:58:23 -05:00
Rob Clark
bb255fdf06 freedreno/a3xx: drop hand-coded blit/solid shaders
Instead in the common code, construct these shaders from TGSI.  For now
we let a2xx keep it's hand coded shaders, as it's compiler isn't quite
up to the job yet.  All the same it is a net drop in code size and gets
rid of special cases.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-02-23 14:58:23 -05:00
Rob Clark
1c953b7cda freedreno/lowering: cleanup api
Make things configurable, and tweak the API a bit to avoid an extra
tgsi_shader_scan().  Getting closer to something generic which can be
moved out of freedreno and shaderd by other drivers.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-02-23 14:58:23 -05:00
Rob Clark
67cea4b32a freedreno/a3xx: add float 16 and 32bit formats
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-02-23 14:58:23 -05:00
Rob Clark
e819885b99 freedreno: resync generated headers
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-02-23 14:58:23 -05:00
Emil Velikov
f92fbba11b glx/drisw: use the implemented version of __DRIswrastLoaderExtension
... over the one provided by the headers.
Explicitly set extension members to improve clarity.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-02-23 16:42:17 +00:00
Emil Velikov
f6537d0608 glx/dri: use the implemented version of __DRIdamageExtension
... over the one provided by the headers.
Explicitly set extension members to improve clarity.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-02-23 16:42:17 +00:00
Emil Velikov
ef342aad80 glx/dri_common: use the implemented version of __DRIsystemTimeExtension
... over the one provided by the headers.
Explicitly set extension members to improve clarity.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-02-23 16:42:17 +00:00
Emil Velikov
fbbf5ec471 glx/dri: use the implemented version of __DRIgetDrawableInfoExtension
... over the one provided by the headers.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-02-23 16:42:17 +00:00
Emil Velikov
15db8c0801 dri_util: use the implemented version of __DRIimageDriverExtension
... over the one provided by the headers.

Currently both versions are identical, but that is not
guaranteed to be the case in the future.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-02-23 16:42:17 +00:00
Emil Velikov
e9eb3ec331 glx/dri3: set the implemented version of __DRIimageLoaderExtension
... over the one provided by the spec.
Currently both versions are identical, but that is not
guaranteed to be the case in the future.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-02-23 16:42:17 +00:00
Emil Velikov
4e229a6e86 gbm: explicitly set __DRIimageLoaderExtension members
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-02-23 16:42:17 +00:00
Emil Velikov
9e627ccc0d egl/wayland: explicitly set __DRIimageLoaderExtension members
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>y
2014-02-23 16:42:16 +00:00
Emil Velikov
73b35b913e drivers/dri: explicitly set __DRI2flushExtension members
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>y
2014-02-23 16:42:16 +00:00
Emil Velikov
8b45bc0ad5 gbm: explicitly set __DRIdri2LoaderExtension members
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>y
2014-02-23 16:42:16 +00:00
Emil Velikov
92273962f5 glx/dri2: set the implemented version of __DRIdri2LoaderExtension
... over the version number provided by the headers.
Explicitly set extension members to improve clarity.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-02-23 16:42:16 +00:00
Emil Velikov
6dffab2092 dri_interface: note introduction of __DRIdri2LoaderExtension members
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-02-23 16:42:16 +00:00
Emil Velikov
c9fff0740e dri_interface: note introduction of various __DRItexBufferExtension members
Note the member function releaseTexBuffer was added without
bumping spec version, and currently no drivers implement it.

v2: releaseTexBuffer was introduced by version 3

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-02-23 16:42:16 +00:00
Emil Velikov
acf2fae64e dri_interface: Note the version introducing __DRIswrastLoaderExtensionRec::putImage2
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-02-23 16:42:16 +00:00
Emil Velikov
13e5daf2da dri_util: explicitly set __DRIcopySubBufferExtension members
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-02-23 16:42:15 +00:00
Emil Velikov
01814734e6 dri_util: explicitly set __DRIswrastExtension members.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-02-23 16:42:15 +00:00
Kenneth Graunke
5e639a5f59 glsl: Pass stdout to _mesa_print_ir from st_glsl_to_tgsi.
Fixes the Gallium build since commit 1e3bd9f9a5.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=75389
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2014-02-22 22:10:11 -08:00
Eric Anholt
83daa88035 i965: Move the remaining driver debug over to stderr.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-02-22 19:23:21 -08:00
Eric Anholt
a76e5dce4f i965: Move compiler debugging output to stderr.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-02-22 19:23:21 -08:00
Eric Anholt
1e3bd9f9a5 glsl: Add a file argument to the IR printer.
While we want to be able to print to stdout for glsl_compiler, for
debugging drivers we want to be able to dump to stderr because that's
where other driver debug (like LIBGL_DEBUG) tends to go, and because some
apps actually close stdout to shut up their own messages (such as the X
Server, or NWN).

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-02-22 19:23:21 -08:00
Eric Anholt
f28c920865 i965: Refactor debug dumping of GLSL IR.
This was only going to get worse when tesselation shows up, and was
causing too much extra duplication in my stderr changes coming up.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-02-22 19:23:21 -08:00
Eric Anholt
9ac9d133ed intel: Remove some dead code I noticed in intel_screen.c.
It was present in the initial i915tex import.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-02-22 19:23:20 -08:00
Eric Anholt
fdcf6c8fad i965: Use the object label when available for INTEL_DEBUG=vs,gs,fs output.
Note that this requires updated run.py in shader_db.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-02-22 19:23:20 -08:00
Eric Anholt
f474ced0d1 i965: Use the object label when available for shader_time output.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-02-22 19:23:20 -08:00
Eric Anholt
0e2c7e2f6e meta: Set some object labels on our meta shaders.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-02-22 19:23:20 -08:00
Ilia Mirkin
6152ba0894 nv50: make sure to clear _all_ layers of all attachments
Unfortunately there's only one RT_ARRAY_MODE setting for all
attachments, so clears were previously truncated to the minimum number
of layers any attachment had. Instead set the RT_ARRAY_MODE to 512 (the
max number of layers) before doing the clear. This fixes
gl-3.2-layered-rendering-clear-color-mismatched-layer-count.

Also fix clears of individual layered rt/zeta, in case it ever happens.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Christoph Bumiller <e0425955@student.tuwien.ac.at>
Cc: 10.1 <mesa-stable@lists.freedesktop.org>
2014-02-22 18:42:31 -05:00
Chia-I Wu
d5cbd73d21 ilo: fix and enable fast depth clear
Use tex->bo_format instead of zs->format in ilo_blitter_rectlist_clear_zs()
because the latter may be combined depth/stencil format.  hiz_can_clear_zs()
is no-op for GEN7+, but move the GEN check so that the assertions are tested.

Finally, call the fast depth clear function from ilo_clear().
2014-02-22 22:45:13 +08:00
Chia-I Wu
f57bddc7e4 ilo: add slice clear value
It is needed for 3DSTATE_CLEAR_PARAMS, and can also be used to track what
value the slice has been cleared to.
2014-02-22 22:45:13 +08:00
Chia-I Wu
4afb8a7fb5 ilo: better readability and doc for texture flags
Improve comments for the flags, and explicitly separate their uses in slice
flags and resolve flags.
2014-02-22 22:45:13 +08:00
Chia-I Wu
cb8a0d2be1 ilo: fix for stencil only rectlist ops
3DSTATE_STENCIL_BUFFER inherits some states from 3DSTATE_DEPTH_BUFFER.  We
need to emit both even the surface is stencil only.
2014-02-22 22:45:13 +08:00
Chia-I Wu
409add30b3 ilo: fix a false assertion failure on GEN6
Layer offsetting is possible when it is level 0, layer 0.
2014-02-22 22:45:12 +08:00
Chia-I Wu
e7307fe708 ilo: pipe_texture::usage is not a bitfield
It happens to work because PIPE_USAGE_STAGING is 0x100.
2014-02-22 22:45:12 +08:00
Chia-I Wu
f8d19a58dc ilo: set ILO_TEXTURE_CPU_WRITE for imported textures
Assume the bo has been written by another process, which will trigger a HiZ
resolve.
2014-02-22 22:45:12 +08:00
Christoph Bumiller
1f4bfb8797 nv50/ir/ra: fix SpillCodeInserter::offsetSlot usage
We were turning non-memory spill slots into NULL.

Cc: 10.1 <mesa-stable@lists.freedesktop.org>
2014-02-22 13:17:23 +01:00
Matt Turner
7770b02693 Revert "i965/fs: Make fs_reg's type an enum for better debugging."
This reverts commit 5ceadd29b0.

I rebased and apparently failed to build test.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=75355
2014-02-21 23:53:36 -08:00
Kenneth Graunke
760c6777a0 i965/fs: Drop the emit(fs_inst) overload.
Using this emit function implicitly creates three copies, which
is pointlessly inefficient.

1. Code creates the original instruction.
2. Calling emit(fs_inst) copies it into the function.
3. It then allocates a new fs_inst and copies it into that.

The second could be eliminated by changing the signature to

   fs_inst(const fs_inst &)

but that wouldn't eliminate the third.  Making callers heap allocate the
instruction and call emit(fs_inst *) allows us to just use the original
one, with no extra copies, and isn't much more of a burden.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2014-02-21 22:51:33 -08:00
Matt Turner
326fc60ee9 i965/fs: Pass fs_regs by constant reference where possible.
These functions (modulo emit_lrp, necessitating the small fix-up) pass
these arguments by value unmodified to other functions. No point in
making an additional copy.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-02-21 22:51:33 -08:00
Matt Turner
070f20272f i965/fs: Move setting opcode = NOP to its one useful location.
All other callers of init() immediately set opcode to something else.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-02-21 22:51:33 -08:00
Matt Turner
4fbebd6e65 i965/fs: Use a bitfield for fs_inst's bool fields.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-02-21 22:51:33 -08:00
Matt Turner
d91035a8f6 i965/fs: Reorder fs_inst's fields for better packing.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-02-21 22:51:33 -08:00
Matt Turner
109c211ffd i965/fs: Reduce the sizes of some fs_inst members.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-02-21 22:51:33 -08:00
Matt Turner
0fc1a77e14 i965/fs: Reorder fs_reg for better packing.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-02-21 22:51:33 -08:00
Matt Turner
5ceadd29b0 i965/fs: Make fs_reg's type an enum for better debugging.
Since the enum is marked as packed, it'll still take only one byte.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-02-21 22:51:32 -08:00
Matt Turner
3f6baf5755 i965/fs: Reduce the sizes of some fs_reg members.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-02-21 22:51:32 -08:00
Matt Turner
98e2654880 i965: Mark brw_reg_type and register_file enums as PACKED.
The C99 spec says the type of an enum is implementation defined (but can
be char, signed int, or unsigned int). gcc appears to always give enums
four bytes, even when they can fit in less. It does so because this is
what other compilers seem to do [0] and therefore to maintain ABI
compatibility with them.

gcc has an -fshort-enum flag that tells the compiler to use only as much
space as needed for an enum. Adding __attribute__((__packed__)) to an
enum definition has the same behavior, but on a per-enum basis.

brw_reg_type and register_file are not part of the ABI, so we can safely
mark them as PACKED so that they'll take only a byte, rather than four.

[0] http://gcc.gnu.org/onlinedocs/gcc/Non-bugs.html#index-fshort-enums-3868

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2014-02-21 22:51:32 -08:00
Matt Turner
00c567e897 i965: Reduce predicate field of backend_instruction to uint8_t.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-02-21 22:51:32 -08:00
Vinson Lee
079773d1cb libgl-xlib: Fix xlib_sw_winsys.h include path.
This patch fixes this SCons build error introduced with commit
4f37e52f37.

  Compiling src/gallium/targets/libgl-xlib/xlib.c ...
src/gallium/targets/libgl-xlib/xlib.c:35:42: fatal error: state_tracker/xlib_sw_winsys.h: No such file or directory
 #include "state_tracker/xlib_sw_winsys.h"
                                          ^

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=75347
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
2014-02-21 19:56:17 -08:00
Vinson Lee
24ce678f83 mesa: Move declarations before code.
This patch fixes these MSVC build errors.

  Compiling src\mesa\drivers\common\meta_blit.c ...
meta_blit.c
src\mesa\drivers\common\meta_blit.c(255) : error C2143: syntax error : missing ';' before 'type'
src\mesa\drivers\common\meta_blit.c(255) : error C2143: syntax error : missing ')' before 'type'
src\mesa\drivers\common\meta_blit.c(255) : error C2065: 'i' : undeclared identifier
src\mesa\drivers\common\meta_blit.c(255) : warning C4552: '<' : operator has no effect; expected operator with side-effect
src\mesa\drivers\common\meta_blit.c(255) : error C2059: syntax error : ')'
src\mesa\drivers\common\meta_blit.c(255) : error C2143: syntax error : missing ';' before '{'
src\mesa\drivers\common\meta_blit.c(258) : error C2065: 'i' : undeclared identifier
src\mesa\drivers\common\meta_blit.c(263) : error C2143: syntax error : missing ';' before 'type'
src\mesa\drivers\common\meta_blit.c(263) : error C2143: syntax error : missing ')' before 'type'
src\mesa\drivers\common\meta_blit.c(263) : error C2065: 'step' : undeclared identifier
src\mesa\drivers\common\meta_blit.c(263) : warning C4552: '<=' : operator has no effect; expected operator with side-effect
src\mesa\drivers\common\meta_blit.c(263) : error C2059: syntax error : ')'
src\mesa\drivers\common\meta_blit.c(263) : error C2143: syntax error : missing ';' before '{'
src\mesa\drivers\common\meta_blit.c(264) : error C2143: syntax error : missing ';' before 'type'
src\mesa\drivers\common\meta_blit.c(264) : error C2143: syntax error : missing ')' before 'type'
src\mesa\drivers\common\meta_blit.c(264) : error C2065: 'i' : undeclared identifier
src\mesa\drivers\common\meta_blit.c(264) : warning C4552: '<' : operator has no effect; expected operator with side-effect
src\mesa\drivers\common\meta_blit.c(264) : error C2059: syntax error : ')'
src\mesa\drivers\common\meta_blit.c(264) : error C2065: 'step' : undeclared identifier
src\mesa\drivers\common\meta_blit.c(264) : error C2143: syntax error : missing ';' before '{'
src\mesa\drivers\common\meta_blit.c(268) : error C2065: 'step' : undeclared identifier
src\mesa\drivers\common\meta_blit.c(268) : error C2065: 'i' : undeclared identifier
src\mesa\drivers\common\meta_blit.c(269) : error C2065: 'step' : undeclared identifier
src\mesa\drivers\common\meta_blit.c(269) : error C2065: 'i' : undeclared identifier
src\mesa\drivers\common\meta_blit.c(270) : error C2065: 'step' : undeclared identifier
src\mesa\drivers\common\meta_blit.c(270) : error C2065: 'i' : undeclared identifier
src\mesa\drivers\common\meta_blit.c(559) : warning C4244: 'function' : conversion from 'const GLint' to 'GLfloat', possible loss of data
src\mesa\drivers\common\meta_blit.c(723) : warning C4244: 'function' : conversion from 'const GLint' to 'GLfloat', possible loss of data
src\mesa\drivers\common\meta_blit.c(773) : warning C4244: 'function' : conversion from 'const GLint' to 'GLfloat', possible loss of data

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
2014-02-21 19:40:00 -08:00
Emil Velikov
dcbf404c0d pipe-loader: introduce pipe_loader_sw_probe_null helper function
v2: Handle null_sw_create failure, add missing function return type

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com> (v1)
2014-02-22 03:26:29 +00:00
Emil Velikov
969e8d15b7 pipe-loader: introduce pipe_loader_sw_probe_dri helper
Will be used in the following commits.

v2: Link gallium tests against the library.
v3: Handle dri_create_sw_winsys failure
v4: Rebase on top of the targets/xa changes

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com> (v2)
2014-02-22 03:26:29 +00:00
Emil Velikov
cc3aeacab6 pipe-loader: introduce pipe_loader_sw_probe_xlib helper
Will be used in the upcoming patches.

v2: handle xlib_create_sw_winsys failure, drop unneeded header

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com> (v1)
2014-02-22 03:26:29 +00:00
Emil Velikov
6325fdd6cf pipe-loader: use bool type for pipe_loader_drm_probe_fd()
v2: Rebase on top of the rendernode changes.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com> (v1)
Reviewed-by: Francisco Jerez <currojerez@riseup.net> (v1)
2014-02-22 03:26:29 +00:00
Emil Velikov
4f37e52f37 winsys/xlib: move xlib_create_sw_winsys within the winsys
v2: Rebase on top of vl_winsys_xsp.c removal
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com> (v1)
2014-02-22 03:26:28 +00:00
Emil Velikov
b4e8572bca pipe-loader: handle memory allocation failure
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2014-02-22 03:26:28 +00:00
Emil Velikov
1fb750f7f7 pipe-loader: build pipe_loader_drm_x_auth whenever HAVE_PIPE_LOADER_XCB is defined
Currently HAVE_PIPE_LOADER_XCB is defined, rather than being set to 1/0.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2014-02-22 03:26:28 +00:00
Emil Velikov
ed092a8e1f pipe-loader: destroy sw_winsys on sw_release
The sw pipe-loader implicitly handles winsys_create, thus we
it would make sense to implicitly destroy it upon releasing
the loader.

Currently we leak the sw_winsys when releasing the pipe-loader.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2014-02-22 03:26:28 +00:00
Emil Velikov
636ac989b2 vl/winsys_dri: cleanup vl_screen_create error path
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2014-02-22 03:26:27 +00:00
Emil Velikov
0c9912b266 targets/pipe-loader: link pipe-nouveau against libdrm
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2014-02-22 03:26:27 +00:00
Kenneth Graunke
6984a6be5c meta: Eliminate samplers[] array in favor of using vec4_prefix.
We don't need an array mapping the shader index to "sampler2DMS",
"isampler2DMS", and so on.  We can simply do "%ssampler2DMS" and pass in
vec4_prefix, which is "", "i", or "u".

This eliminates the use of C99 array initializers and should fix the
MSVC build.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=75344
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-02-21 19:18:07 -08:00
Kenneth Graunke
119aa50929 i965: Delete the fabulous target_to_target() function.
gl_texture_object's Target field is never a cube face enumeration, so
target_to_target is just the identity function.  Aptly named, at least.

I verified this by putting an assert(!"ZOMG, CUBES!") in the cube face
case, and running Piglit.  Nothing ever hit it.  Beyond that, I
inspected the code in mesa/main.

This could probably also be deleted from i915, but I haven't tested
there.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-02-21 19:17:55 -08:00
Kenneth Graunke
82f9ad8c60 i965: Fix S8 and X8 reversal in brw_depthbuffer_format refactor.
In commit 09d9a8913e, I accidentally
botched the X8 and S8 cases.  (I wrote this patch before realizing that
X8 and S8 had been swapped in the big MESA_FORMAT rename, and apparently
didn't rebase it properly after fixing that...)

Fixes regressions in 13 Piglit tests on Ironlake.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=75291
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-02-21 19:17:50 -08:00
Vinson Lee
5a0b08e9ea mesa: Move declarations before code.
This patch fixes these MSVC build errors introduced with
73b78f9c9f.

  Compiling src\mesa\main\uniforms.c ...
uniforms.c
src\mesa\main\uniforms.c(291) : error C2143: syntax error : missing ';' before 'type'
src\mesa\main\uniforms.c(294) : error C2065: 'shProg' : undeclared identifier
src\mesa\main\uniforms.c(294) : warning C4047: 'function' : 'gl_shader_program *' differs in levels of indirection from 'int'
src\mesa\main\uniforms.c(294) : warning C4024: '_mesa_uniform' : different types for formal and actual parameter 2
src\mesa\main\uniforms.c(306) : error C2143: syntax error : missing ';' before 'type'
src\mesa\main\uniforms.c(309) : error C2065: 'shProg' : undeclared identifier
src\mesa\main\uniforms.c(309) : warning C4047: 'function' : 'gl_shader_program *' differs in levels of indirection from 'int'
src\mesa\main\uniforms.c(309) : warning C4024: '_mesa_uniform' : different types for formal and actual parameter 2
src\mesa\main\uniforms.c(322) : error C2143: syntax error : missing ';' before 'type'
src\mesa\main\uniforms.c(325) : error C2065: 'shProg' : undeclared identifier
src\mesa\main\uniforms.c(325) : warning C4047: 'function' : 'gl_shader_program *' differs in levels of indirection from 'int'
src\mesa\main\uniforms.c(325) : warning C4024: '_mesa_uniform' : different types for formal and actual parameter 2
src\mesa\main\uniforms.c(345) : error C2143: syntax error : missing ';' before 'type'
src\mesa\main\uniforms.c(348) : error C2065: 'shProg' : undeclared identifier
src\mesa\main\uniforms.c(348) : warning C4047: 'function' : 'gl_shader_program *' differs in levels of indirection from 'int'
src\mesa\main\uniforms.c(348) : warning C4024: '_mesa_uniform' : different types for formal and actual parameter 2
src\mesa\main\uniforms.c(360) : error C2143: syntax error : missing ';' before 'type'
src\mesa\main\uniforms.c(363) : error C2065: 'shProg' : undeclared identifier
src\mesa\main\uniforms.c(363) : warning C4047: 'function' : 'gl_shader_program *' differs in levels of indirection from 'int'
src\mesa\main\uniforms.c(363) : warning C4024: '_mesa_uniform' : different types for formal and actual parameter 2
src\mesa\main\uniforms.c(376) : error C2143: syntax error : missing ';' before 'type'
src\mesa\main\uniforms.c(379) : error C2065: 'shProg' : undeclared identifier
src\mesa\main\uniforms.c(379) : warning C4047: 'function' : 'gl_shader_program *' differs in levels of indirection from 'int'
src\mesa\main\uniforms.c(379) : warning C4024: '_mesa_uniform' : different types for formal and actual parameter 2
src\mesa\main\uniforms.c(588) : error C2143: syntax error : missing ';' before 'type'
src\mesa\main\uniforms.c(591) : error C2065: 'shProg' : undeclared identifier
src\mesa\main\uniforms.c(591) : warning C4047: 'function' : 'gl_shader_program *' differs in levels of indirection from 'int'
src\mesa\main\uniforms.c(591) : warning C4024: '_mesa_uniform' : different types for formal and actual parameter 2
src\mesa\main\uniforms.c(603) : error C2143: syntax error : missing ';' before 'type'
src\mesa\main\uniforms.c(606) : error C2065: 'shProg' : undeclared identifier
src\mesa\main\uniforms.c(606) : warning C4047: 'function' : 'gl_shader_program *' differs in levels of indirection from 'int'
src\mesa\main\uniforms.c(606) : warning C4024: '_mesa_uniform' : different types for formal and actual parameter 2
src\mesa\main\uniforms.c(619) : error C2143: syntax error : missing ';' before 'type'
src\mesa\main\uniforms.c(622) : error C2065: 'shProg' : undeclared identifier
src\mesa\main\uniforms.c(622) : warning C4047: 'function' : 'gl_shader_program *' differs in levels of indirection from 'int'
src\mesa\main\uniforms.c(622) : warning C4024: '_mesa_uniform' : different types for formal and actual parameter 2

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
2014-02-21 19:11:58 -08:00
Vinson Lee
aaefc85f3b mesa/sso: Change CreateShaderProgramv return type from uint to GLuint.
This patch fixes this MinGW build error.

  Compiling src/mapi/glapi/glapi_dispatch.c ...
In file included from src/mapi/glapi/glapi_dispatch.c:41:0:
build/windows-x86_64-debug/mapi/glapi/glapitable.h:930:4: error: expected specifier-qualifier-list before 'uint'
    uint (GLAPIENTRYP CreateShaderProgramv)(GLenum type, GLsizei count, const GLchar * const * strings); /* 886 */
    ^

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
2014-02-21 18:05:40 -08:00
Vinson Lee
34587e4a00 scons: Add main/pipelineobj.c to src/mesa/SConscript.
This patch fixes this SCons build error.

build/linux-x86_64-debug/mesa/libmesa.a(context.os): In function `init_attrib_groups':
src/mesa/main/context.c:815: undefined reference to `_mesa_init_pipeline'

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
2014-02-21 17:00:47 -08:00
Vinson Lee
897a5fa360 mesa/sso: Fix typo of 'unsigned'.
Fix build error introduced with commit f4c13a890f.

  CC       pixeltransfer.lo
main/pipelineobj.c: In function '_mesa_delete_pipeline_object':
main/pipelineobj.c:59:4: error: unknown type name 'unsinged'
    unsinged i;
    ^

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
2014-02-21 16:41:04 -08:00
Gregory Hainaut
4719ad79ec mesa/sso: Implement _mesa_GetProgramPipelineiv
This was originally included in another patch, but it was split out by
Ian Romanick.

v2 (idr):
* Trivial reformatting.
* Remove GL_COMPUTE_SHADER.  Compute shaders don't participate in pipeline
  objects anyway.  Suggested by Matt Turner.

v3 (idr):
* Use _mesa_has_geometry_shaders.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-02-21 15:41:03 -08:00
Gregory Hainaut
c171834b49 mesa/sso: Implement _mesa_ActiveShaderProgram
This was originally included in another patch, but it was split out by
Ian Romanick.

v2 (idr): Return early from _mesa_ActiveShaderProgram if
_mesa_lookup_shader_program_err returns an error.  Suggested by Jordan.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> [v2]
2014-02-21 15:41:03 -08:00
Gregory Hainaut
e9ff3b9918 mesa/sso: Implement _mesa_CreateShaderProgramv
This was originally included in another patch, but it was split out by
Ian Romanick.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-02-21 15:41:03 -08:00
Gregory Hainaut
3659eade53 mesa/sso: Refactor implementation of _mesa_CreateShaderProgramEXT
This will allow the guts of the implementation to be shared with
_mesa_CreateShaderProgramv.

This was originally included in another patch, but it was split out by
Ian Romanick.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-02-21 15:41:03 -08:00
Gregory Hainaut
8ed8592fd6 mesa/sso: Add support for GL_PROGRAM_SEPARABLE query
This was originally included in another patch, but it was split out by
Ian Romanick.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-02-21 15:41:02 -08:00
Gregory Hainaut
4177d39c1e mesa/sso: Implement _mesa_IsProgramPipeline
Implement IsProgramPipeline based on the VAO code.

This was originally included in another patch, but it was split out by
Ian Romanick.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-02-21 15:41:02 -08:00
Gregory Hainaut
0c26552662 mesa/sso: Implement _mesa_GenProgramPipelines
Implement GenProgramPipelines based on the VAO code.

This was originally included in another patch, but it was split out by
Ian Romanick.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-02-21 15:41:02 -08:00
Gregory Hainaut
55311557fd mesa/sso: Implement _mesa_DeleteProgramPipelines
Implement DeleteProgramPipelines based on the VAO code.

This was originally included in another patch, but it was split out by
Ian Romanick.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-02-21 15:41:02 -08:00
Gregory Hainaut
f4c13a890f mesa/sso: Add pipeline container/state
V1:
* Extend gl_shader_state as pipeline object state
* Add a new container gl_pipeline_shader_state that contains
   binding point of the previous object
* Update mesa init/free shader state due to the extension of
   the attibute
* Add an init/free pipeline function for the context

V2:
* Rename gl_shader_state to gl_pipeline_object
* Rename Pipeline.PipelineObj to Pipeline.Current
* Formatting improvement

V3 (idr):
* Split out from previous uber patch.
* Remove '#if 0' debug printfs.

V4 (idr):
* Fix some errors in comments.  Suggested by Jordan.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-02-21 15:41:02 -08:00
Gregory Hainaut
0f137a1d73 mesa: Add a mutex and refcounting to gl_shader_state
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-02-21 15:41:02 -08:00
Gregory Hainaut
47476fa673 mesa: Make get_shader_flags publicly available
Future patches will use this function outside shaderapi.c.

This was originally included in another patch, but it was split out by
Ian Romanick.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-02-21 15:41:02 -08:00
Gregory Hainaut
73b78f9c9f mesa/sso: Add extension entry points for GL_ARB_separate_shader_objects
Nothings implemented yet but glProgramUniform* which are mostly a
copy/paste of the older function glUniform*

I create dedicated pipelineobj.[ch] file that will contains function
related to the "new" pipeline container object.

V2: formatting improvement

V3:
* indentation fix
* Update copyright
* Add a comment on ProgramParameteri already present in another extension
* Remove TODO, will be readded on correct patch

V4 (idr):
* Fix dispatch_sanity unit test
* Make extension string available in core profiles (instead of just
  compatibility).
* Trivial reformating

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-02-21 15:41:02 -08:00
Ian Romanick
4d14b190bb glsl/sso: Add parser and AST-to-HIR support for separate shader object layouts
GL_ARB_separate_shader_objects adds the ability to specify location
layouts for interstage inputs and outputs.

In addition, this extension makes 'in' and 'out' generally available for
shader inputs and outputs.  This mimics the behavior of
GL_ARB_explicit_attrib_location.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-02-21 15:41:02 -08:00
Ian Romanick
f3b184590f mesa/sso: Add extension tracking for ARB_separate_shader_objects
This adds the necessary bits for both the API and the GLSL compiler.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-02-21 15:41:02 -08:00
Ian Romanick
79146065f9 mesa: Refactor per-stage link check to its own function
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-02-21 15:41:01 -08:00
Emil Velikov
68bc1e2025 specs: MESA_query_renderer.spec resolve a couple of typos
Cc: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-02-21 22:52:46 +00:00
Emil Velikov
0432aa064b configure: use shared-glapi when more than one gl* API is used
Current behaviour states that shared-glapi is usefull when building
with dri, which is not the case. Shared-glapi is used to dispatch
the gl* functions across the one or more gl api's which can be dri
based but do not need to be.

Fixed the following build

 ./configure --enable-gles2 --disable-dri --enable-gallium-egl \
      --with-egl-platforms=fbdev --with-gallium-drivers=swrast

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=75098
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-02-21 22:48:50 +00:00
Emil Velikov
9eae750317 configure: use default dri drivers whenever opengl and dri are enabled
Commit ee55500c22a(configure: cleanup classic dri drivers handling)
cleaned up the logic handling autodetection of dri drivers, but missed
the case when one can explicitly disable dri, and still request opengl.

Fixes build issues for the following
./autogen.sh --disable-dri --with-gallium-drivers=swrast

While we're here, explicitly clear with_dri_drivers whenever building
without such drivers to prevent choking later on.

v2: Simplify with_dri_drivers handling.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=75126
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-02-21 22:47:51 +00:00
Eric Anholt
c2ebbe2728 i965: Stop throwing away our double precision for time calculations.
Fixes negative times being reported in our perf debug.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-02-21 10:43:50 -08:00
Eric Anholt
f2f337c6d5 meta: Add support for integer blits.
Compared to i965, the code generated doesn't use the AVG instruction.  But
I'm not sure that multisampled integer resolves are really that important
to worry about.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-02-21 10:43:38 -08:00
Eric Anholt
b0a8d0ee40 meta: Add support for doing MSAA to MSAA blits.
These are non-stretched, non-resolving blits, so it's just a matter of
sampling once from our gl_SampleID and storing that to our color/depth.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-02-21 10:43:38 -08:00
Eric Anholt
eb55b01eef meta: Save and restore a bunch of MSAA state.
We're disabling GL_MULTISAMPLE, so we didn't need to worry about a lot of
that state.  But to do MSAA to MSAA blits, we need to start handling more
state.

v2: Fix pasteo caught by Kenneth.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-02-21 10:43:38 -08:00
Eric Anholt
f7f15d3c2d meta: Try to do blending of sRGB values in linear colorspace.
Blending of values would occur when doing GL_LINEAR filtering with
scaling, and in an upcoming commit when doing MSAA resolves.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-02-21 10:43:38 -08:00
Eric Anholt
7d2f73e737 meta: Add support for doing multisample resolves.
Note that this doesn't handle GL_EXT_multisample_scaled_blit yet.  The
i965 code for that extension bakes in knowledge of the sample positions
(well, knowledge of the sample positions aligned to a lower-resolution
grid), which we would have to do at runtime somehow for meta.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-02-21 10:43:38 -08:00
Eric Anholt
aba85d960e i965: Fix miptree matching for multisampled, non-interleaved miptrees.
We haven't been executing this code before the meta-blit case, because
we've been flagging the miptree as validated at texstorage time, and never
having to revalidate.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-02-21 10:43:38 -08:00
Courtney Goeltzenleuchter
941769be81 mesa: Remove unnecessary condition.
Identified by Valgrind memory check. Initialized block-opaque in a
different patch. This test seems unnecessary. If opaque must be true,
just set to true.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Courtney Goeltzenleuchter <courtney@LunarG.com>
2014-02-21 10:16:10 -08:00
Francisco Jerez
9b2fe7cf96 clover: Unabbreviate a few data accessor names for consistency.
Tested-by: Tom Stellard <thomas.stellard@amd.com>
2014-02-21 12:51:23 +01:00
Francisco Jerez
a0d99937a0 clover: Replace the transfer(new ...) idiom with a safer create(...) helper function.
Tested-by: Tom Stellard <thomas.stellard@amd.com>
2014-02-21 12:51:22 +01:00
Francisco Jerez
c4578d2277 clover: Migrate a bunch of pointers and references in the object tree to smart references.
Tested-by: Tom Stellard <thomas.stellard@amd.com>
2014-02-21 12:51:22 +01:00
Francisco Jerez
d82b39ce38 clover: Allow storing a range into a container of different (but compatible) element type.
Tested-by: Tom Stellard <thomas.stellard@amd.com>
2014-02-21 12:51:22 +01:00
Francisco Jerez
1b9fb2fd91 clover: Define an intrusive smart reference class.
Tested-by: Tom Stellard <thomas.stellard@amd.com>
2014-02-21 12:51:22 +01:00
Francisco Jerez
9ae0bd3829 clover: Some improvements for the intrusive pointer class.
Define some additional convenience operators, clean up the
implementation slightly, and rename it to 'intrusive_ptr' for reasons
that will be obvious in the next commit.

Tested-by: Tom Stellard <thomas.stellard@amd.com>
2014-02-21 12:51:22 +01:00
Francisco Jerez
198cd136b9 clover: Fix up NULL constant pointer arguments.
Tested-by: Tom Stellard <thomas.stellard@amd.com>
2014-02-21 12:29:05 +01:00
Jordan Justen
c97763ca2d tgsi_ureg: add property_gs_invocations
Fixes a build break in state_tracker/st_program.c

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=75278
Reviewed-by: Dave Airlie <airlied@redhat.com>
2014-02-20 16:41:01 -08:00
Kenneth Graunke
1336ccb7dd i965: Enable Broadwell support.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-02-20 15:51:38 -08:00
Kenneth Graunke
808952a095 i965/fs: Implement FS_OPCODE_[UN]PACK_HALF_2x16_SPLIT[_XY] opcodes.
I'd neglected to port these to Broadwell.  Most of this code is copy
and pasted from Gen7, but instead of using F32TO16/F16TO32, we just
use MOV with HF register types.

Fixes fs-packHalf2x16 and fs-unpackHalf2x16 tests (both the ARB
extension and ES 3.0 variants).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-02-20 15:50:59 -08:00
Kenneth Graunke
850e372fc7 i965: Drop bogus F32TO16/F16TO32 instructions on Broadwell - use MOV.
Broadwell removed the F32TO16 and F16TO32 instructions.  However, it has
actual support for HF values, so they're actually just MOV.

Fixes vs-packHalf2x16 and vs-unpackHalf2x16 tests (both the ARB
extension and ES 3.0 variants).

v2: Emulate F32TO16's align16 zeroing bug, since Chad's front end code
    relies on it happening.  We can probably refactor this code to be
    better later.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-02-20 15:50:57 -08:00
Kenneth Graunke
3663bbe773 i965: Create a hardware context before initializing state module.
brw_init_state() calls brw_upload_initial_gpu_state().  If hardware
contexts are enabled (brw->hw_ctx != NULL), this will upload some
initial invariant state for the GPU.  Without hardware contexts, we
rely on this state being uploaded via atoms that subscribe to the
BRW_NEW_CONTEXT bit.

Commit 46d3c2bf4d accidentally moved
the call to brw_init_state() before creating a hardware context.
This meant brw_upload_initial_gpu_state would always early return.
Except on Gen6+, we stopped uploading the initial GPU state via
state atoms, so it never happened.

Fixes a regression since 46d3c2bf4d.

Cc: "10.0 10.1" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-02-20 15:50:08 -08:00
Kenneth Graunke
e3823147a5 i965/fs: Implement scratch read/write support for Broadwell.
To make sure that both the Gen4 and Gen7 style messages work, I
initially disabled the SHADER_OPCODE_GEN7_SCRATCH_READ optimization,
ran Piglit, re-enabled it, and ran Piglit again.  Both worked fine.

Fixes 40 Piglit tests (most of the varying-packing category).

v2: Move num_regs assertion from gen8_fs_generator to
    gen8_set_dp_scratch_message() (suggested by Eric).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-02-20 15:50:08 -08:00
Kenneth Graunke
29a6974403 i965: Add Gen8 assembly support for DP Scratch messages.
The new accessors will make it easy to do Gen7-style scratch messages.

v2: Move num_regs assertion from gen8_fs_generator into
    gen8_set_dp_scratch_message() (suggested by Eric).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-02-20 15:50:08 -08:00
Kenneth Graunke
a5e54c91a3 i965: Store absolute thread count in max_wm_threads on Broadwell.
In the past, 3DSTATE_PS took an absolute number of threads.  Conversely,
on Broadwell you always program 64, and it implicitly scales based on
the GT-level with no special programming.  So, I stored 64 in
brw_device_info::max_wm_threads.

However, I didn't realize that we also use max_wm_threads to compute the
size of the scratch space buffer.  In that case, we really need the
absolute number of threads.

This patch hardcodes 3DSTATE_PS to use the value it expects, and changes
max_wm_threads back to a (completely fake) absolute thread count (once
again copied from Haswell).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-02-20 15:50:08 -08:00
Kenneth Graunke
dca84b4b5b i965: Use MOV, not OR for setting URB write channel enables on Gen8+.
On Broadwell, g0.5 contains the "Scratch Space Pointer"; using OR
puts some bits of that into "ignored" sections of our message header.

While this doesn't hurt, it's also not terribly /useful/.  Using MOV
is sufficient to set the only interesting bits in this part of the
message header.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-02-20 15:50:07 -08:00
Kenneth Graunke
e643c7d036 i965: Implement a CS stall workaround on Broadwell.
According to the latest documentation, any PIPE_CONTROL with the
"Command Streamer Stall" bit set must also have another bit set,
with five different options:

   - Render Target Cache Flush
   - Depth Cache Flush
   - Stall at Pixel Scoreboard
   - Post-Sync Operation
   - Depth Stall

I chose "Stall at Pixel Scoreboard" since we've used it effectively
in the past, but the choice is fairly arbitrary.

Implementing this in the PIPE_CONTROL emit helpers ensures that the
workaround will always take effect when it ought to.

Apparently, this workaround may be necessary on older hardware as well;
for now I've only added it to Broadwell as it's absolutely necessary
there.  Subsequent patches could add it to older platforms, provided
someone tests it there.

v2: Only flag "Stall at Pixel Scoreboard" when none of the other bits
    are set (suggested by Ian Romanick).

v3: Prefix the function with "gen8" (requested by Eric).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> (v2)
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-02-20 15:50:07 -08:00
Jordan Justen
741782b594 i965: support instanced GS on gen7
v3:
 * Properly prevent dual object mode execution when
   the invocation count > 1

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-02-20 10:33:09 -08:00
Jordan Justen
008338bc4e i965: support gl_InvocationID for gen7
v2:
 * Make gl_InvocationID a system value

v3:
 * Properly shift from R0.1 into DST.4 by adding
   GS_OPCODE_GET_INSTANCE_ID

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Acked-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-02-20 10:33:09 -08:00
Jordan Justen
d099019935 glsl: add gl_InvocationID variable for ARB_gpu_shader5
v2:
 * Make gl_InvocationID a system value

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-02-20 10:33:09 -08:00
Jordan Justen
22388e2208 main/shaderapi: GL_GEOMETRY_SHADER_INVOCATIONS GetProgramiv support
v3:
 * Add check for ARB_gpu_shader5

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-02-20 10:33:09 -08:00
Jordan Justen
86d6b5546b mesa: initialize gl_geometry_program Invocations field
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-02-20 10:33:09 -08:00
Jordan Justen
313402048f glsl/linker: produce gl_shader_program Geom.Invocations
Grab the parsed invocation count, check for consistency
during linking, and finally save the result in
gl_shader_program Geom.Invocations.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-02-20 10:33:08 -08:00
Jordan Justen
02dc74fbd7 glsl: parse invocations layout qualifier for ARB_gpu_shader5
_mesa_glsl_parse_state in_qualifier->invocations will store the
invocations count.

v3:
 * Use in_qualifier to allow the primitive to be specied
   separately from the invocations count (merge_qualifiers)

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-02-20 10:33:08 -08:00
Jordan Justen
738c9c3c54 glsl: Generate error for invalid input layout declarations
Fixes various piglit tests:
spec/glsl-1.50/compiler/incorrect-in-layout-qualifier-*.geom

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-02-20 10:33:08 -08:00
Jordan Justen
0c558f9ee6 glsl: convert GS input primitive to use ast_type_qualifier
We introduce a new merge_in_qualifier ast_type_qualifier
which allows specialized handling of merging input layout
qualifiers.

By merging layout qualifiers into state->in_qualifier, we
allow multiple input qualifiers. For example, the primitive
type can be specified specified separately from the
invocations count (ARB_gpu_shader5).

state->gs_input_prim_type is moved into state->in_qualifier->prim_type

state->gs_input_prim_type_specified is still processed separately
so we can determine when the input primitive is specified. This
is important since certain scenerios are not supported until after
the primitive type has been specified in the shader code.

v4:
 * Merge with compute shader input layout qualifiers

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-02-20 10:33:08 -08:00
Eric Anholt
5bc0b2f432 i965: Fix extra return value after winsys rb update refactor.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=75172
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-02-20 10:15:13 -08:00
Eric Anholt
9245206cbf i965/vs: Use samplers for UBOs in the VS like we do for non-UBO pulls.
Improves performance of a dolphin emulator trace I had laying around by
3.60131% +/- 0.995887% (n=128).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-02-20 10:15:13 -08:00
Eric Anholt
9e3cab8881 i965/fs: Add an optimization pass to remove redundant flags movs.
We generate steaming piles of these for the centroid workaround, and this
quickly cleans them up.

total instructions in shared programs: 1591228 -> 1590047 (-0.07%)
instructions in affected programs:     26111 -> 24930 (-4.52%)
GAINED:                                0
LOST:                                  0

(Improved apps are l4d2, csgo, and dolphin)

Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-02-20 10:15:13 -08:00
Roland Scheidegger
b2b2a2c06c gallivm: add smallfloat to float conversion not relying on cpu denorm handling
The previous code relied on cpu denorm support for converting small float
formats (such r11g11b10_float and r16_float) to floats, otherwise denorms
are flushed to zero. We worked around that in llvmpipe blend code by
reenabling denorms, but this did nothing for texture sampling. Now it would
be possible to reenable it there too but I'm not really a fan of messing
with fpu flags (and it seems we can't actually do it reliably with llvm in
any case looking at some bug reports). (Not to mention if you actually have
a lot of denorms in there, you can expect some order-of-magnitude slowdown
with x86 cpus.)
So instead use code which adjusts exponents etc. directly hence not relying
on cpu denorm support for the rescaling mul.
(We still need the fpu flag handling as we can't do float-to-smallfloat
without using cpu denorms at least for now - I actually wanted to keep
both the old and new code and using one or the other depending on from where
it's called but that didn't work out as the parameter would have to be passed
through too many layers than I'd like.)

Reviewed-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: Si Chen <sichen@vmware.com>
2014-02-20 18:41:42 +01:00
Leo Liu
0206f0b3d4 st/omx/enc: add multi scaling buffers for performance improvement
Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2014-02-20 13:34:16 +01:00
Christian König
754fa3a0d2 st/omx/dec/h264: fix prevFrameNumOffset handling
Signed-off-by: Christian König <christian.koenig@amd.com>
2014-02-20 13:34:06 +01:00
Kenneth Graunke
57405605a8 i965: Actually claim to support MSAA on Broadwell.
We need to advertise 8x, 4x, and 2x multisamples.  Previously, we only
claimed to support 0/1 samples.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-02-19 15:43:22 -08:00
Kenneth Graunke
4af8c95783 i965: Update physical width/height munging for 2x IMS MSAA.
I can't find any documentation to explain what ought to be done here, so
I simply guessed based on the pattern I observed in the 4x/8x cases.
It appears to work, but it could be totally wrong.

I was able to find the Sandybridge PRM quote from the comments in the
latest documentation: Shared Functions > 3D Sampler > Multisampled
Surface Behavior.  However, it only mentions 4x MSAA - not even 8x.

After a substantial amount more digging, I was able to find a second
page (incorrectly tagged) which confirmed the formulas in our code for
8x MSAA.  However, that page didn't mention 2x MSAA at all.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-02-19 15:43:22 -08:00
Kenneth Graunke
51145a24f7 i965: Enable smooth points when multisampling without point sprites.
According to the "Point Multisample Rasterization" of the OpenGL
specification (3.0 or later), smooth points are supposed to be enabled
implicitly when multisampling, regardless of the GL_POINT_SMOOTH flag.

However, if GL_POINT_SPRITE is enabled, you get square points no matter
what.  Core contexts always enable point sprites, so this effectively
makes smooth points go away, even in the case of multisampling.

Fixes Piglit's EXT_framebuffer_multisample/point-smooth tests.
(Yes, that's right folks, we actually have Piglit tests for this.)

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-02-19 15:43:22 -08:00
Kenneth Graunke
a3d70580b5 i965: Thwack multisample enable bit in 3DSTATE_RASTER.
The meaning and effects of this bit are surprisingly complicated.

See Rasterization > Windower > Multisampling > Multisample ModesState.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-02-19 15:43:22 -08:00
Kenneth Graunke
0c5873c9b9 i965: Only use the SIMD16 program for per-sample shading on Broadwell.
This restriction carries forward from earlier platforms.  The code is
ported straight from gen7_wm_state.c.

v2: Actually do it right.
v3: Add missing _NEW_MULTISAMPLE bit (caught by Eric).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-02-19 15:42:54 -08:00
Kenneth Graunke
61d7ea4b16 i965: Set "Position XY Offset Select" bits in 3DSTATE_PS on Broadwell.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-02-19 15:42:16 -08:00
Kenneth Graunke
01c42b2be6 i965: Add missing sample shading bits to Gen8's 3DSTATE_PS_EXTRA.
v2: Also set the "oMask Present to Render Target" bit, which is required
    for shaders that write oMask.  Otherwise the hardware won't expect
    the extra data.

v3: Add missing _NEW_MULTISAMPLE (caught by Eric).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-02-19 15:42:02 -08:00
Kenneth Graunke
77c37ed74b i965/fs: Implement FS_OPCODE_SET_OMASK on Broadwell.
I made a few changes which I think simplify the code a bit compared to
the Gen7 implementation, but which are largely pointless.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-02-19 15:39:41 -08:00
Kenneth Graunke
5476da79f8 i965/fs: Implement FS_OPCODE_SET_SAMPLE_ID on Broadwell.
Largely cut and paste from Gen7; it works the same way.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-02-19 15:39:41 -08:00
Kenneth Graunke
80c4edfc27 i965: Disable MCS on Broadwell for now.
v2: Add a perf_debug() message to remind us to come back to this.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-02-19 15:39:21 -08:00
Kenneth Graunke
4eba0d124d i965: Use gen7_surface_msaa_bits in Broadwell SURFACE_STATE code.
We already set the number of samples, but were missing the MSAA layout
mode.  Reusing gen7_surface_msaa_bits makes it easy to set both.

This also lets us drop the Gen8 surface_num_multisamples function.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-02-19 15:35:54 -08:00
Kenneth Graunke
6eeae17c02 i965: Use ffs() for sample counting in gen7_surface_msaa_bits().
The enumerations are just log2(num_samples) shifted by 3, which we can
easily compute via ffs().

This also makes it reusable for Broadwell, which has 2x MSAA.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-02-19 15:35:53 -08:00
Kenneth Graunke
2ed5824a5d i965: Simplify Broadwell's 3DSTATE_MULTISAMPLE sample count handling.
These enumerations are simply log2 of the number of multisamples shifted
by a bit, so we can calculate them using ffs() in a lot less code.

Suggested by Eric Anholt.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-02-19 15:35:32 -08:00
Ian Romanick
7700c73cf4 glsl: Silence "type qualifiers ignored on function return type" warning
The const in

   const unsigned foo(void);

is meaningless.  Removing it silences this warning:

src/glsl/ast_to_hir.cpp:1802:56: warning: type qualifiers ignored on function return type [-Wignored-qualifiers]

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-02-19 15:08:50 -08:00
Ian Romanick
2c85fd5a96 glsl: Only warn for macro names containing __
From page 14 (page 20 of the PDF) of the GLSL 1.10 spec:

    "In addition, all identifiers containing two consecutive underscores
     (__) are reserved as possible future keywords."

The intention is that names containing __ are reserved for internal use
by the implementation, and names prefixed with GL_ are reserved for use
by Khronos.  Names simply containing __ are dangerous to use, but should
be allowed.

Per the Khronos bug mentioned below, a future version of the GLSL
specification will clarify this.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Cc: "9.2 10.0 10.1" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Tested-by: Darius Spitznagel <d.spitznagel@goodbytez.de>
Cc: Tapani Pälli <lemody@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=71870
Bugzilla: Khronos #11702
2014-02-19 15:08:50 -08:00
Ian Romanick
0bd7892630 glcpp: Only warn for macro names containing __
Section 3.3 (Preprocessor) of the GLSL 1.30 spec (and later) and the
GLSL ES spec (all versions) say:

    "All macro names containing two consecutive underscores ( __ ) are
    reserved for future use as predefined macro names. All macro names
    prefixed with "GL_" ("GL" followed by a single underscore) are also
    reserved."

The intention is that names containing __ are reserved for internal use
by the implementation, and names prefixed with GL_ are reserved for use
by Khronos.  Since every extension adds a name prefixed with GL_ (i.e.,
the name of the extension), that should be an error.  Names simply
containing __ are dangerous to use, but should be allowed.  In similar
cases, the C++ preprocessor specification says, "no diagnostic is
required."

Per the Khronos bug mentioned below, a future version of the GLSL
specification will clarify this.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Cc: "9.2 10.0 10.1" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Tested-by: Darius Spitznagel <d.spitznagel@goodbytez.de>
Cc: Tapani Pälli <lemody@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=71870
Bugzilla: Khronos #11702
2014-02-19 15:08:50 -08:00
Tom Stellard
a4c734297f configure: Use LLVM shared libraries by default
Linking with LLVM static libraries is easily broken by changes to
the llvm-config program or when LLVM adds, removes, or changes library
components.  Keeping up with these changes requires a lot of maintanence
effort to keep the build working on the master and stable branches.

Also, because of issues in the past LLVM static libraries, the release
manager is currently configuring with --with-llvm-shared-libs when
checking the build before release.  Enabling shared libraries by
default would allow the release manager to run ./configure with
no arguments, and be reasonably confident that the build would succeed.

Acked-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-02-19 14:35:49 -05:00
Francisco Jerez
8928d7860a i965/fs: Allocate the param_size array dynamically.
Useful because the total number of uniform components might exceed
MAX_UNIFORMS * 4 in some cases because of the image metadata we'll be
passing as push constants.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
2014-02-19 19:03:56 +01:00
Francisco Jerez
eef710fc53 i965/fs: Use a separate variable to keep track of the last uniform index seen.
Like the VEC4 back-end does.  It will make dynamic allocation of the
param_size array easier in a future commit.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
2014-02-19 19:03:56 +01:00
Rob Clark
9186cd39d4 freedreno: tweak ringbuffer sizes/count
Since we are now consuming two ringbuffers at a time, we probably want a
pool larger than 4.. but we don't need each individual ringbuffer to be
so large, so offset the pool size increase by reducing rb size.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-02-19 12:02:57 -05:00
Rob Clark
5993723471 freedreno/a3xx/compiler: scheduling/legalize fixes
It seems the write-after-read hazard that applies to texture fetch
instructions, also applies to sfu instructions.

Also, cat5/cat6 instructions do not have a (ss) bit, so in these
cases we need to insert a dummy nop instruction with (ss) bit set.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-02-19 12:01:26 -05:00
Francisco Jerez
bbf8239f92 i965: Have brw_imm_vf4() take the vector components as integer values.
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2014-02-19 16:56:57 +01:00
Francisco Jerez
51b00c5cb9 i965: Add helper function to find out the signedness of a register type.
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2014-02-19 16:56:57 +01:00
Francisco Jerez
560f10e573 i965/vec4: Use swizzle() in the ARB_vertex_program code.
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2014-02-19 16:27:25 +01:00
Francisco Jerez
8797ccf3fa i965/fs: Use offset() in the ARB_fragment_program code.
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2014-02-19 16:27:25 +01:00
Francisco Jerez
6f56d5dc60 i965/fs: Remove fs_reg::retype.
There doesn't seem to be any reason for it to be a method, and it's
surprising that the expression 'reg.retype(t)' doesn't retype its
object but rather it creates a temporary with the new type.  Use
'retype(reg, t)' instead.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
2014-02-19 16:27:25 +01:00
Francisco Jerez
3b03273275 i965/vec4: Trivial improvements to the with_writemask() function.
Add assertion that the register is not in the HW_REG or IMM file,
calculate the conjunction of the old and new mask instead of replacing
the old [consistent with the behavior of brw_writemask(), causes no
functional changes right now], make it static inline to let the
compiler do a slightly better job at optimizing things, and shorten
its name.

v2: Assert that the new writemask is not zero to avoid undefined
    hardware behaviour.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
2014-02-19 16:27:25 +01:00
Francisco Jerez
42b226ef82 i965: Make sure that backend_reg::type and brw_reg::type are consistent for fixed regs.
And define non-mutating helper functions to retype fixed and normal
regs with a common interface.  At some point we may want to get rid of
::fixed_hw_reg completely and have fixed regs use the normal register
data members (e.g. backend_reg::reg to select a fixed GRF number,
src_reg::swizzle to store the swizzle, etc.), I have the feeling that
this is not the last headache we're going to get because of the
multiple ways to represent the same thing and the different register
interface depending on the file a register is stored in...

Reviewed-by: Paul Berry <stereotype441@gmail.com>
2014-02-19 16:27:25 +01:00
Francisco Jerez
98306e727b i965/vec4: Add non-mutating helper functions to modify src_reg::swizzle and ::negate.
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2014-02-19 16:27:25 +01:00
Francisco Jerez
2337820d49 i965: Add non-mutating helper functions to modify the register offset.
Yes, we could avoid having four copies of essentially the same code by
using templates here.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
2014-02-19 16:27:25 +01:00
Francisco Jerez
af25addcd0 i965/vec4: Fix off-by-one register class overallocation.
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2014-02-19 16:27:25 +01:00
Francisco Jerez
a32817f3c2 i965: Unify fs_generator:: and vec4_generator::mark_surface_used as a free function.
This way it can be used anywhere.  I need it from the visitor.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
2014-02-19 16:27:25 +01:00
Francisco Jerez
ae8b066da5 i965: Move up duplicated fields from stage-specific prog_data to brw_stage_prog_data.
There doesn't seem to be any reason for nr_params, nr_pull_params,
param, and pull_param to be duplicated in the stage-specific
subclasses of brw_stage_prog_data.  Moving their definition to the
common base class will allow some code sharing in a future commit, the
removal of brw_vec4_prog_data_compare and brw_*_prog_data_free, and
the simplification of the stage-specific brw_*_prog_data_compare.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
2014-02-19 16:27:22 +01:00
Francisco Jerez
7f00c5f1a3 i965/vec4: Add constructor of src_reg from a fixed hardware reg.
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2014-02-19 15:10:57 +01:00
Kenneth Graunke
98e048cf32 i965: Enable fast depth clears.
They work fine now, too.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-02-19 01:46:17 -08:00
Kenneth Graunke
7023786417 i965: Enable HiZ on Broadwell.
It appears to work fine.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-02-19 01:46:17 -08:00
Kenneth Graunke
8cad1c115a i965: Implement HiZ resolves on Broadwell.
Broadwell's 3DSTATE_WM_HZ_OP packet makes this much easier.

Instead of programming the whole pipeline, we simply have to emit the
depth/stencil packets, a state override, and a pipe control.  Then
arrange for the state to be put back.  This is easily done from a single
function.

v2: Use minify(mt->logical_{width,height}0, level) in 3DSTATE_WM_HZ_OP
    instead of intel_mipmap_level's width/height fields.  Those were
    based on the physical width/height, and thus wrong for MSAA buffers.
    Eric also deleted those fields.

v3: Use 0xFFFF as the sample mask regardless of what the user set (as
    this operation is unrelated); set the drawing rectangle to the
    miplevel being operated on, rather than the whole surface; remove
    unnecessary MAX2(..., 1) around mt->logical_depth0 (all suggested
    by Eric Anholt).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-02-19 01:46:17 -08:00
Kenneth Graunke
82711611cf i965: Refactor Gen8 depth packet emission.
The existing code followed the vtable function signature, which is not a
great fit: many of the parameters are unused, and the function still
inspects global state, making it less reusable.

This patch refactors the depth buffer packet emission code into a new
function which takes exactly the parameters it needs, and which uses no
global state.  It then makes the existing vtable function call the new
one.

Ideally, we would remove the vtable function, and clean up that
interface.  But that can happen once HiZ is working.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-02-19 01:46:17 -08:00
Kenneth Graunke
67f073b91c i965: Add #defines for the 3DSTATE_WM_HZ_OP packet's contents.
We're going to need these to implement HiZ.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-02-19 01:46:17 -08:00
Kenneth Graunke
577fdf1f48 i965: Bump generation check in code to disable HiZ at LODs > 0.
Broadwell's "HiZ Resolve" operation still has the restriction that the
rectangle primitive must be 8x4 aligned.  So I believe we still need
this.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-02-19 01:46:17 -08:00
Kenneth Graunke
a5d2eb6b98 i965: Program 3DSTATE_HIER_DEPTH_BUFFER properly on Broadwell.
HiZ buffers still don't exist, but when they do, we'll set them up.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-02-19 01:46:16 -08:00
Kenneth Graunke
09d9a8913e i965: Pull format conversion logic out of brw_depthbuffer_format.
brw_depthbuffer_format is not very reusable at the moment, since it
uses global state (ctx->DrawBuffer) to access a particular depth buffer.

For HiZ on Broadwell, I need a function which simply converts the
formats.  However, at least one existing user of brw_depthbuffer_format
really wants the existing interface.  So, I've created a new function.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-02-19 01:46:16 -08:00
Chia-I Wu
4695f64895 egl: clarify what _eglInitResource does
It is a helper called from the initializers of its subclasses.
2014-02-19 13:08:54 +08:00
Chia-I Wu
dc97e54d97 Revert "egl: Unhide functionality in _eglInitContext()"
This reverts commit 1456ed85f0.
_eglInitResource can and is supposed to be called on subclass objects.

Acked-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
2014-02-19 13:08:52 +08:00
Chia-I Wu
924490a747 Revert "egl: Unhide functionality in _eglInitSurface()"
This reverts commit 498d10e230.
_eglInitResource can and is supposed to be called on subclass objects.

Acked-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
2014-02-19 13:08:44 +08:00
Kenneth Graunke
c593ad6e46 i965: Bump MaxTexMbytes from 1GB to 1.5GB.
Even with the other limits raised, TestProxyTexImage would still reject
textures > 1GB in size.  This is an artificial limit; nothing prevents
us from having a larger texture.  I stayed shy of 2GB to avoid the
larger-than-aperture situation.

For 3D textures, this raises the effective limit:
 - RGBA8:   645 -> 738
 - RGBA16:  512 -> 586
 - RGBA32F: 406 -> 465

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=74130
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-02-18 18:59:24 -08:00
Kenneth Graunke
6c04423153 i965: Bump GL_MAX_CUBE_MAP_TEXTURE_SIZE to 8192.
Gen4+ supports 8192x8192 cube maps.  Ivybridge and later can actually
support 16384, but that would place GL_MAX_CUBE_MAP_TEXTURE_SIZE above
GL_MAX_TEXTURE_SIZE, which seems like a bad idea.

(Unfortunately, we can't bump GL_MAX_TEXTURE_SIZE to 16384 without
causing regressions due to awful W-tiled stencil buffer interactions.)

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=74130
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-02-18 18:59:18 -08:00
Kenneth Graunke
06b047ebc7 i965: Bump MAX_3D_TEXTURE_SIZE to 2048.
It's highly unlikely that there will be enough memory in the system to
allocate enough space for this, but we should still expose the hardware
limit.  It's what the Intel Windows driver does, and it seems most other
vendors do likewise.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=74130
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-02-18 18:58:57 -08:00
Ian Romanick
f0fdee5095 docs: Trivial updates to MESA_query_renderer.spec
Fix the version and the status before sending to Khronos for listing in
the registry.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2014-02-18 15:25:04 -08:00
Sinclair Yeh
6c9d6898fd Prevent zero sized wl_egl_window
It is illegal to create or resize a window to zero (or negative) width
and/or height.  This patch prevents such a request from happening.
2014-02-18 14:12:11 -08:00
Anuj Phogat
03597cf802 glsl: Fix condition to generate shader link error
GL_ARB_ES2_compatibility doesn't say anything about shader linking
when one of the shaders (vertex or fragment shader) is absent. So,
the extension shouldn't change the behavior specified in GLSL
specification.

Tested the behavior on proprietary linux drivers of NVIDIA and AMD.
Both of them allow linking a version 100 shader program in OpenGL
context, when one of the shaders is absent.

Makes following Khronos CTS tests to pass:
successfulcompilevert_linkprogram.test
successfulcompilefrag_linkprogram.test

Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-02-18 11:07:09 -08:00
Anuj Phogat
6bd2472a8b mesa: Add GL_TEXTURE_CUBE_MAP_ARRAY to legal_get_tex_level_parameter_target()
Fixes failing Khronos CTS test packed_depth_stencil_init.test

Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-02-18 11:07:09 -08:00
Eric Anholt
d92f593d87 i965/fs: Use conditional sends to do FB writes on HSW+.
This drops the MOVs for header setup, which are totally mis-scheduled.

total instructions in shared programs: 1590047 -> 1589331 (-0.05%)
instructions in affected programs:     43729 -> 43013 (-1.64%)
GAINED:                                0
LOST:                                  0

glb27-trex:
x before
+ after
+-----------------------------------------------------------------------------+
|               +      x     xx        +  +    +                              |
|              ++  + xxx ++x xx + ** *x+  +  + +  x *                         |
|+x xx x*    x+++xx*x*xx+++*+*xx++** *x* x+***x*+xx+*     + *    +  +        *|
|               |__|__________MA___A___________|___|                          |
+-----------------------------------------------------------------------------+
    N           Min           Max        Median           Avg        Stddev
x  49         62.33         65.41         63.49      63.53449    0.62757822
+  50         62.28          65.4          63.7       63.6982      0.656564
No difference proven at 95.0% confidence

Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-02-18 10:11:36 -08:00
Eric Anholt
4226798354 i965/fs: Drop dead comment about the old proj_attrib_mask optimization.
The code was removed early last year.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-02-18 10:01:45 -08:00
Eric Anholt
f128bcc7c2 i965: Drop mt->levels[].width/height.
It often confused people because it was unclear on whether it was the
physical or logical, and people needed the other one as well.  We can
recompute it trivially using the minify() macro, clarifying which value is
being used and making getting the other value obvious.

v2: Fix a pasteo in intel_blit.c's dst flip.

Reviewed-by: Chris Forbes <chrisf@ijw.co.nz> (v1)
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-02-18 10:01:45 -08:00
Eric Anholt
4e0924c5de i965: Move singlesample_mt to the renderbuffer.
Since only window system renderbuffers can have a singlesample_mt, this
lets us drop a bunch of sanity checking to make sure that we're just a
renderbuffer-like thing.

v2: Fix a badly-written comment (thanks Kenneth!), drop the now trivial
    helper function for set_needs_downsample.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-02-18 10:01:45 -08:00
Eric Anholt
019560c127 i965: Drop some duplicated code in DRI winsys BO updates.
The only DRI2 vs DRI3 delta was just how to decide about frontbuffer-ness
for doing the upsample.

v2: Fix missing singlesample_mt->region->name update in the merged code,
    which would have broken the DRI2 don't-recreate-the-miptree
    optimization.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-02-18 09:56:36 -08:00
Eric Anholt
0440e677b9 i965: Simplify intel_miptree_updownsample.
Pretty silly to pass in values dereferenced out of one of the arguments.

v2: Get the destination size from the dst, even though the callers are
    always dealing with src size == dst size cases.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-02-18 09:56:34 -08:00
Eric Anholt
bbd85ad27c i965: Don't try to use the ctx->ReadBuffer when asked to blorp miptrees.
So far it's happened to be that we're only ever calling
intel_miptree_blit() (up/downsampling) from the ReadBuffer, but I stumbled
over a null ReadBuffer case when debugging later parts of the series.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-02-18 09:56:32 -08:00
Eric Anholt
af4f758a44 i965: Make the mt->target of multisample renderbuffers be 2D_MS.
Mostly mt->target == 2D_MS just results in a few checks that we don't try
to allocate multiple LODs and don't try to do slice copies with them.  But
with the introduction of binding renderbuffers to textures, we need more
consistency.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-02-18 09:56:29 -08:00
Eric Anholt
4e4a537ad5 meta: Push into desktop GL mode when doing meta operations.
This lets us simplify our shaders, and rely on GLES-prohibited
functionality (like ARB_texture_multisample) when writing these
driver-internal functions.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-02-18 09:56:27 -08:00
Eric Anholt
b3dcce65c9 meta: Fix blit shader compile on non-glsl-130 drivers.
Compare this VS to the one for the post-130 case.  Fixes piglit
glsl-lod-bias, and presumably tons of other code (I haven't done a full
piglit run on swrast).

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=74911
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-02-18 09:56:06 -08:00
Rob Clark
20d14ef263 configure: fix build error with XA
Fixes:

xa_tracker.c: In function 'xa_tracker_create':
 xa_tracker.c:147:5: error: implicit declaration of function 'pipe_loader_drm_probe_fd' [-Werror=implicit-function-declaration]

in some build configurations, as XA now implicitly depends on
gallium_drm_loader.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2014-02-18 08:12:37 -05:00
Michel Dänzer
cf0172d46a r600g,radeonsi: Consolidate logic for short-circuiting flushes
Fixes radeonsi emitting command streams to the kernel even when there
have been no draw calls before a flush, potentially powering up the GPU
needlessly.

Incidentally, this also cuts the runtime of piglit gpu.py in about half
on my Kaveri system, probably because an X11 client going away no longer
always results in a command stream being submitted to the kernel via
glamor.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=65761
Cc: "10.1" mesa-stable@lists.freedesktop.org
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-02-18 10:46:23 +09:00
Emil Velikov
adad8fb2e9 st/dri: remove #ifdef DRM_CAP_PRIME guard
Required for libdrm 2.4.37 and earlier. Both scons and automake
require version 2.4.38 now so that guard is not longer needed.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-02-18 00:08:26 +00:00
Emil Velikov
6fbd00e43a automake: remove leftover XORG and LIBKMS variables
No longer set or used since the removal of st/xorg.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-02-18 00:08:03 +00:00
Emil Velikov
4b3a4c799a scons: sync package requirements
xorg-server and libkms is no longer required since the removal
of the xorg state-tracker.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-02-18 00:04:07 +00:00
Emil Velikov
5fe47969c0 configure: bump up libdrm requirement to 2.4.38
This is the first version that introduced DRM_CAP_PRIME, which is
implicitly required by egl/wayland.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-02-18 00:04:02 +00:00
Emil Velikov
f41102b538 configure: use test -n whenever possible
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-02-18 00:00:30 +00:00
Emil Velikov
8015ffeea1 configure: use test -z whenever possible
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-02-18 00:00:23 +00:00
Emil Velikov
ee55500c22 configure: cleanup classic dri drivers handling
* Make sure that only drivers that are handled by configure.ac
are included in DRI_DIRS.
* Change with_dri_drivers default value to auto, and set enable
autodetection, when enable_opengl is on.

v2: Move "test" to the correct location.
v3: Squash DRI_DIRS handling before the switch statement.
Suggested by Ilia Mirkin

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-02-18 00:00:19 +00:00
Emil Velikov
35f6eed742 configure: compact ppc/sparc DRI_DIRS handling
Both arches have the same list of dri_dirs.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-02-18 00:00:13 +00:00
Emil Velikov
65e67b9bf7 configure: drop explicit DRI_DIRS assignment on some platforms/arches
Both x86_64|amd64 and *bsd, already set the full range of available
classic dri drivers. Drop the explicit assignment, and fall back to
the generic default.
Keep explicit list from plafroms/arches that do not handle the default
list.

Update help strings, to explicitly mention "classic" for applicable
DRI drivers.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-02-18 00:00:05 +00:00
Emil Velikov
49e93e8945 configure: cleanup switch statement
Move all the cases within one switch statement and handle
i9{1,6}5 and r{adeon,200} independently.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-02-17 23:59:25 +00:00
Kusanagi Kouichi
d23f9e3390 targets/vdpau: Don't link unused libraries
libvdpau, libselinux and libexpat are not used.

Signed-off-by: Kusanagi Kouichi <slash@ac.auone-net.jp>
2014-02-17 21:14:17 +00:00
Kusanagi Kouichi
6ba4392da2 configure: Try pkg-config first for libselinux
v2 (Emil) Add SELINUX_CFLAGS in the respective locations

Signed-off-by: Kusanagi Kouichi <slash@ac.auone-net.jp>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com> (v1)
2014-02-17 21:14:16 +00:00
Kusanagi Kouichi
61f6cddef7 targets/vdpau: Always use c++ to link
If built without llvm, the following error occurs with mplayer:

Failed to open VDPAU backend .../libvdpau_r600.so: undefined symbol: _ZTVN10__cxxabiv117__class_type_infoE
[vo/vdpau] Error when calling vdp_device_create_x11: 1

Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Kusanagi Kouichi <slash@ac.auone-net.jp>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-02-17 21:14:16 +00:00
Ilia Mirkin
6958fb341f st/xvmc: fix tests so that they pass
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Christian König <christian.koenig@amd.com>
2014-02-16 23:21:57 -05:00
Rob Clark
8b5f894e13 pipe-loader: add pipe loader for freedreno/msm
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-02-16 08:36:23 -05:00
Rob Clark
24fa96163a st/xa: missing handle type
DRM_API_HANDLE_TYPE_SHARED is zero, so doesn't actually fix anything.
But we shouldn't rely on SHARED handle type being zero.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-02-16 08:36:23 -05:00
Rob Clark
42158926c6 st/xa: use pipe-loader to get screen
This lets multiple gallium drivers use XA.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-02-16 08:36:19 -05:00
Rob Clark
a122c75599 pipe-loader: split out "client" version
Build two versions of pipe-loader, with only the client version linking
in x11 client side dependencies.  This will allow the XA state tracker
to use pipe-loader.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-02-16 08:31:10 -05:00
Rob Clark
d73b2c0517 freedreno/a3xx/compiler: use (ss) for WAR hazards
Seems texture sample instructions don't immediately consume there
src(s).  In fact, some shaders from blob compiler seem to indiciate that
it does not even count the texture sample instructions when calculating
number of delay slots to fill for non-sample instructions.  (Although so
far it seems inconclusive as to whether this is required.)

In particular, when a src register of a previous texture sample
instruction is clobbered, the (ss) bit is needed to synchronize with the
tex pipeline to ensure it has picked up the previous values before they
are overwritten.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-02-16 08:17:23 -05:00
Rob Clark
e8cca57a3f freedreno/a3xx/compiler: fix RA typo
Was supposed to be a '+', otherwise we end up with a negative offset and
choosing registers below the assigned range.

This seems to fix the scheduling mystery "solved" by adding in extra
delay slots.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-02-16 08:17:23 -05:00
Rob Clark
579473f8f8 freedreno/a3xx/compiler: handle kill properly (new compiler)
Since 'kill' does not produce a result, the new compiler was happily
optimizing them out.  We need to instead track 'kill's similar to
outputs.  But since there is no non-predicated kill instruction,
(and for flattend if/else we do want them to be predicated), we need
to track the topmost branch condition on the stack and use that as src
arg to the kill.  For a kill at the topmost level, we have to generate
an immediate 1.0 to feed into the cmps.f for setting the predicate
register.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-02-16 08:17:23 -05:00
Rob Clark
e35747b882 freedreno/a3xx/compiler: trans_cmp() sanity
Thanks to figuring out 32bit float render target, and adding regdump
test in fdre-a3xx, I can more easily play around with instructions to
figure out range of inputs/outputs/etc.  And from this I can conclude
that cmps.f works more like expected and I can do something much more
simple in trans_cmp() (compared to before which was more closely
emulating the instruction sequence of the blob compiler).

And using sel.b32 (binary 0/1) often makes more sense than sel.f32
(+/- float) or sel.u32 (+/- uint) as it can use the output directly
from cmps.f without needing the 'add.s tmp0, tmp0, -1'.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-02-16 08:17:23 -05:00
Rob Clark
89dc282581 freedreno: fix problems if no color buf bound
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-02-16 08:17:23 -05:00
Eric Anholt
1020d8937e meta: Don't try to enable FF texturing when we're using GLSL.
On a core context, this would throw an error.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-02-14 12:09:42 -08:00
Carl Worth
a92581acf2 main: Avoid double-free of shader Label
As documented, the _mesa_free_shader_program_data function:

	"Frees all the data that hangs off a shader program object, but not
	the object itself."

This means that this function may be called multiple times on the same object,
(and has been observed to). Meanwhile, the shProg->Label field was not being
set to NULL after its free(). This led to a second call to free() of the same
address on the second call to this function.

Fix this by setting this field to NULL after free(), (just as with all other
calls to free() in this function).

Reviewed-by: Brian Paul <brianp@vmware.com>

CC: mesa-stable@lists.freedesktop.org
2014-02-14 11:45:48 -08:00
Brian Paul
e4a5a9fd2f gallium/pipebuffer: change pb_cache_manager_create() size_factor to float
Requested by Marek.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
2014-02-14 09:56:55 -07:00
Thomas Hellstrom
141e39a893 svga/winsys: Propagate surface shared information to the winsys
The linux winsys needs to know whether a surface is shared.
For guest-backed surfaces we need this information to avoid allocating a
mob out of the mob cache for shared surfaces, but instead allocate a shared
mob, that is never put in the mob cache, from the kernel.

Also previously, all surfaces were given the "shareable" attribute when
allocated from the kernel. This is too permissive for client-local surfaces.
Now that we have the needed info, only set the "shareable" attribute if the
client indicates that it needs to share the surface.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
2014-02-14 08:21:44 -07:00
Brian Paul
fe6a854477 svga/winsys: implement GBS support
This is a squash commit of many commits by Thomas Hellstrom.

Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
2014-02-14 08:21:44 -07:00
Thomas Hellstrom
59e7c59621 gallium/util: Add flush/map debug utility code
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
2014-02-14 08:21:44 -07:00
Thomas Hellstrom
8af358d8bc gallium/pipebuffer: Add a cache buffer manager bypass mask
In some situations, it may be desirable to bypass the cache at buffer
creation but to insert the buffer in the cache at buffer destruction.
One such situation is where we already have a kernel representation of a
buffer that we want to use, but we also want to insert it in the cache when
it's freed up.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
2014-02-14 08:21:44 -07:00
Thomas Hellstrom
c9e9b1862b pipebuffer, winsys: Add a size match parameter to the cached buffer manager
In some situations it's important to restrict the sizes of buffers that the
cached buffer manager is allowed to return

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
2014-02-14 08:21:44 -07:00
Brian Paul
3d1fd6df53 svga: update texture code for GBS
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
2014-02-14 08:21:44 -07:00
Brian Paul
72b0e959fc svga: update buffer code for GBS
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
2014-02-14 08:21:44 -07:00
Brian Paul
e0a6fb09bd svga: add new helper functions for GBS buffers
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
2014-02-14 08:21:44 -07:00
Brian Paul
6476bcbc50 svga: remove a couple unneeded assertions
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
2014-02-14 08:21:44 -07:00
Brian Paul
f8bbd8261d svga: adjust adjustment for point coordinates
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
2014-02-14 08:21:44 -07:00
Brian Paul
d0c22a6d53 svga: track which textures are rendered to
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
2014-02-14 08:21:44 -07:00
Brian Paul
c1e60a61e8 svga: add helpers for tracking rendering to textures
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
2014-02-14 08:21:44 -07:00
Brian Paul
f84c830b14 svga: update shader code for GBS
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
2014-02-14 08:21:44 -07:00
Brian Paul
2f1fc8db10 svga: update constant buffer code for GBS
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
2014-02-14 08:21:44 -07:00
Brian Paul
31dfefc47f svga: add svga_have_gb_objects/dma() functions
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
2014-02-14 08:21:44 -07:00
Brian Paul
823fbfdca7 svga: add new GBS commands
And update some existing commands.

Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
2014-02-14 08:21:44 -07:00
Brian Paul
d993ada50c svga: update svga_winsys interface for GBS
This adds new interface functions for guest-backed surfaces and
adds a mobid parameter to the surface_relocation() function.

Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
2014-02-14 08:21:44 -07:00
Brian Paul
024711385e svga: update dumping code with new GBS commands, etc
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
2014-02-14 08:21:44 -07:00
Brian Paul
2e0c90847f svga: split / update svga3d header files
The old svga3d_reg.h file is split into separate header files and we
add new items for guest-backed surfaces.

Plus some minor code fixes because of renamed symbols.

Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
2014-02-14 08:21:43 -07:00
Grigori Goronzy
6d1cecbfd7 st/vdpau: add support for DEINTERLACE_TEMPORAL
Reviewed-by: Christian König <christian.koenig@amd.com>
2014-02-14 09:05:20 +01:00
Grigori Goronzy
af34c3fd10 vl: add motion adaptive deinterlacer
Reviewed-by: Christian König <christian.koenig@amd.com>
2014-02-14 08:55:33 +01:00
Leo Liu
f87dfc35bc st/omx/enc: fix scaling src alignment issue
Signed-off-by: Leo Liu <leo.liu@amd.com>
Signed-off-by: Christian König <christian.koenig@amd.com>
2014-02-14 08:50:32 +01:00
Alex Deucher
01e6371149 radeon: reverse DBG_NO_HYPERZ logic
Change the flag to DBG_HYPERZ and reverse the logic
so setting the flag enabled the feature.  This disables
hyperz on r600g and radeonsi by default.  It can be
enabled by setting the env var.  There are just too
many issues with certain apps so leave it disabled for
now until we sort out the issues with the problematic
apps.

Bugs:
https://bugs.freedesktop.org/show_bug.cgi?id=58660
https://bugs.freedesktop.org/show_bug.cgi?id=64471
https://bugs.freedesktop.org/show_bug.cgi?id=66352
https://bugs.freedesktop.org/show_bug.cgi?id=68799
https://bugs.freedesktop.org/show_bug.cgi?id=72685
https://bugs.freedesktop.org/show_bug.cgi?id=73088
https://bugs.freedesktop.org/show_bug.cgi?id=74428
https://bugs.freedesktop.org/show_bug.cgi?id=74803
https://bugs.freedesktop.org/show_bug.cgi?id=74863
https://bugs.freedesktop.org/show_bug.cgi?id=74892
https://bugzilla.kernel.org/show_bug.cgi?id=70411

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: "10.1" "10.0" <mesa-stable@lists.freedesktop.org>
Acked-by: Marek Olšák <marek.olsak@amd.com>
2014-02-13 20:55:54 -05:00
Tom Stellard
3c4bd95b62 pipe-loader: Add support for render nodes v2
v2:
   - Add missing call to pipe_loader_drm_release()
   - Fix render node macros
   - Drop render-node configure option
2014-02-13 19:53:15 -05:00
Tom Stellard
8481d208ce pipe-loader: Add auth_x parameter to pipe_loader_drm_probe_fd()
The caller can use this boolean parameter to tell the pipe-loader
to authenticate with the X server when probing a file descriptor.
2014-02-13 19:53:15 -05:00
Christian König
0320ba9988 st/omx/dec/h264: fix pic_order_cnt_type==2
Signed-off-by: Christian König <christian.koenig@amd.com>
2014-02-13 18:00:44 +01:00
Ilia Mirkin
0c8b165366 nouveau: fix chipset checks for nv1a by using the oclass instead
Commit f4ebcd133b ("dri/nouveau: NV17_3D class is not available for
NV1a chipset") fixed this partially by using the correct 3d class.
However there were a lot of checks left over comparing against the
chipset.

Reported-and-tested-by: John F. Godfrey <jfgodfrey@gmail.com>
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: 9.2 10.0 10.1 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2014-02-13 11:06:41 -05:00
Christian König
0ef3ce4155 st/omx: initial OpenMAX H264 encoder v7
v2 (chk): fix eos handling
v3 (leo): implement scaling configuration support
v4 (leo): fix bitrate bug
v5 (chk): add workaround for bug in Bellagio
v6 (chk): fix div by 0 if framerate isn't known,
          user separate pipe object for scale and transfer,
          always flush the transfer pipe before encoding
v7 (chk): make suggested changes, cleanup a bit more,
          only advertise encoder on supported hardware

Signed-off-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Leo Liu <leo.liu@amd.com>
2014-02-13 11:11:24 +01:00
Christian König
9ff0cf903d radeon/vce: initial VCE support v8
v2 (chk): revert feedback buffer hack
v3 (slava): fixed bitstream size calculation
v4 (chk): always create buffers in the right domain
v5 (chk): flush async
v6 (chk): rework fw interface add version check
v7 (leo): implement cropping support
v8 (chk): add hw checks

Signed-off-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Leo Liu <leo.liu@amd.com>
Signed-off-by: Slava Grigorev <slava.grigorev@amd.com>
2014-02-13 11:11:24 +01:00
Christian König
cbdd052577 radeon/winsys: add VCE support v4
v2: add fw version query
v3: add README.VCE
v4: avoid error msg when kernel doesn't support it

Signed-off-by: Christian König <christian.koenig@amd.com>
2014-02-13 11:11:24 +01:00
Ilia Mirkin
ef9a6ded10 nv50: mark scissors/viewports dirty on context switch
Commit 246ca4b001 ("nv50: implement multiple viewports/scissors, enable
ARB_viewport_array") added dirty tracking to scissors/viewports. However
it neglected to mark them all as dirty on a context switch. This fixes
an apparent regression in webgl in chrome, but probably in any
application that switches contexts.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-02-13 10:08:29 +01:00
Christian König
1ef7b9de06 gallium/vl: remove remaining softpipe video functions
Unused and unmaintained for quite a while.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
2014-02-13 09:46:54 +01:00
Ilia Mirkin
18caef953f docs: add nv50 to the ARB_viewport_array list 2014-02-12 22:14:41 -05:00
Ilia Mirkin
246ca4b001 nv50: implement multiple viewports/scissors, enable ARB_viewport_array
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Christoph Bumiller <e0425955@student.tuwien.ac.at>
2014-02-12 21:47:36 -05:00
Ilia Mirkin
a7012eede8 mesa/st: hardcode the viewport bounds range
The bound range is disconnected from the viewport dimensions. This is
the relevant bit from glViewportArray:

"""
The location of the viewport's bottom left corner, given by (x, y) is
clamped to be within the implementaiton-dependent viewport bounds range.
The viewport bounds range [min, max] can be determined by calling glGet
with argument GL_VIEWPORT_BOUNDS_RANGE. Viewport width and height are
silently clamped to a range that depends on the implementation. To query
this range, call glGet with argument GL_MAX_VIEWPORT_DIMS.
"""

Just set it to +/-16384, as that is the minimum required by
ARB_viewport_array and the value that all current drivers provide.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-02-13 12:44:36 +10:00
Brian Paul
f0e967f212 scons: add meta_blit.c to src/mesa/SConscript 2014-02-12 17:46:11 -07:00
Eric Anholt
255bd9c0b8 meta: Add acceleration for depth glBlitFramebuffer().
Surprisingly, the GLSL shaders already wrote the sampled r value to
FragDepth.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=51600
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-02-12 16:17:11 -08:00
Eric Anholt
067c7b67e8 meta: Use BindRenderbufferTexImage() for meta glBlitFramebuffer().
This avoids a CopyTexImage() on Intel i965 hardware without blorp.

v2: Move the !readAtt check up higher.
v3: Rebase on idr's changes, plus readAtt check is totally gone, and also
    fix a typo in a comment.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> (v2)
2014-02-12 16:17:11 -08:00
Eric Anholt
f29c25fc1d i965: Add a driver hook for binding renderbuffers to textures.
This will let us use meta's acceleration from renderbuffers without having
to do a CopyTexImage first.

This is like what we do for TFP, but just taking an existing renderbuffer
and binding it to a texture with whatever its format was.  The
implementation won't work for stencil renderbuffers, and it only does
non-texture renderbuffers (but then, if you're using a texture
renderbuffer, you can just pull the texture object/level/slice out of the
renderbuffer, anyway).

v2: Don't forget to propagate NumSamples to the teximage.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-02-12 16:17:11 -08:00
Eric Anholt
431decf16f meta: Do a massive unindent (and rename) of blitframebuffer_texture().
This function is only handling the color case.  We can just unindent as
long as we're willing to do the check for the bit outside of the
function.

v2: Rebase on idr's changes, drop readAtt check that's always non-null
    anyway (it's a pointer into to the statically-allocated attachments
    array in the renderbuffer).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> (v1)
2014-02-12 16:17:11 -08:00
Eric Anholt
3e4ccf499e meta: Move glBlitFramebuffer() to a separate file.
v2: Drop a bunch of unnecessary includes (by Kenneth), rebase on idr's
    changes.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> (v1)
2014-02-12 16:17:08 -08:00
Eric Anholt
81ddbdaaba meta: De-static some of meta's functions.
I want split some meta.c code off to a separate file, so these functions
can't be static any more.

v2: Rebase on idr's changes, also expose setup_blit_shader,
    blit_shader_table_cleanup, setup_vertex_objects,
    setup_ff_tnl_for_blit.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> (v1)
2014-02-12 16:16:03 -08:00
Eric Anholt
2c8f182c86 meta: Move the meta structures to the meta header.
I'd like to split some of our code to separate files, since 4k lines and
growing is pretty unreasonable for all these separate operations.

v2: Rebase on idr's changes.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> (v1)
2014-02-12 15:38:58 -08:00
Eric Anholt
cd084aa297 meta: Fold the texture setup into setup_copypix_texture().
There was this funny argument passed to setup for "did alloc decide we
need to allocate new texture storage?", which goes away if we don't have
the caller do alloc as a separate step.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-02-12 15:38:58 -08:00
Eric Anholt
397b2c3966 meta: Drop the src == dst restriction on meta glBlitFramebuffer().
From the GL_ARB_fbo spec:

    If the source and destination buffers are identical, and the
    source and destination rectangles overlap, the result of the blit
    operation is undefined.

As far as I know, that's the only thing that would have been of concern
for this.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-02-12 15:38:58 -08:00
Eric Anholt
a4f3e2ca0e mesa: Make TexImage error cases about internalFormat more informative.
I tripped over one of these when debugging meta, and it's a lot nicer to
just see the internalFormat being complained about.

v2: Drop a note in the other errors path that there is one early return.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-02-12 15:38:58 -08:00
Eric Anholt
56b031d8ae meta: Rename the "sampler" stuff to "blit shader".
While these structs are generated per GLSL sampler type, they're structs
of data-about-shaders (notably, the ID of a shader program), not
data-about-samplers.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-02-12 15:38:57 -08:00
Eric Anholt
e455c8283b meta: Drop a now-trivial helper function.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-02-12 15:38:57 -08:00
Eric Anholt
e48a6378c9 meta: Fold the glUseProgram() into the blit program generator.
Everyone was just immediately calling it and doing nothing else with the
shader program id.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-02-12 15:38:57 -08:00
Eric Anholt
b719aa3902 meta: Simplify the blit shader setup steps.
The only thing that wants to track the glsl_sampler structure is the
shader string generator.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-02-12 15:38:57 -08:00
Francisco Jerez
b424da4be0 i965/vec4: Fix confusion between SWIZZLE and BRW_SWIZZLE macros.
Most of the VEC4 back-end agrees on src_reg::swizzle being one of the
BRW_SWIZZLE macros defined in brw_reg.h, except in two places where we
use Mesa's SWIZZLE macros.  There is even a doxygen comment saying
that Mesa's macros are the right ones.  They are incompatible swizzle
representations (3 bits vs. 2 bits per component), and the code using
Mesa's works by pure luck.  Fix it.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2014-02-12 23:39:42 +01:00
Francisco Jerez
a3a55067bd i965/fs: Remove fs_reg::sechalf.
The same effect can be achieved using ::subreg_offset.  Remove the
less flexible alternative and define a convenience function to keep
the fs_reg interface sane.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2014-02-12 23:39:24 +01:00
Francisco Jerez
019bf6ed8d i965/fs: Remove fs_reg::smear.
The same effect can be achieved using a combination of ::stride and
::subreg_offset.  Remove the less flexible ::smear to keep the data
members of fs_reg orthogonal.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2014-02-12 23:07:57 +01:00
Francisco Jerez
756d37b1d6 i965/fs: Add support for specifying register horizontal strides.
v2: Some improvements for copy propagation with non-contiguous
    register strides and mismatching types.
v3: Add example of the situation that the copy propagation changes are
    intended to avoid.  Clarify that 'fs_reg::apply_stride()' is expected
    to work with zero strides too.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2014-02-12 23:07:57 +01:00
Francisco Jerez
4c7206bafd i965/fs: Add support for sub-register byte offsets to the FS back-end IR.
It would be nice if we could have a single 'reg_offset' field
expressed in bytes that would serve the purpose of both, but the
semantics of 'reg_offset' are quite complex currently (it's measured
in units of one, eight or sixteen dwords depending on the register
file and the dispatch width) and changing it to bytes would be a very
intrusive change at this stage.  Add a separate 'subreg_offset' field
for now.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2014-02-12 23:07:57 +01:00
Brian Paul
248606a5f0 glsl: rename _restrict to restrict_flag
To fix MSVC compile breakage.  Evidently, _restrict is an MSVC keyword,
though the docs only mention __restrict (with two underscores).

Note: we may want to also rename _volatile to volatile_flag to be
consistent.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=74900
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-02-12 13:37:09 -07:00
Brian Paul
fd0620ff6c mesa: assorted clean-ups in detach_shader()
Fix formatting, add new comments, get rid of extraneous indentation.
Suggested by Ian in bug 74723.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-02-12 11:21:47 -07:00
Brian Paul
23d4ff53d4 svga: replace out-of-temps assertion with debug warning
Signed-off-by: Brian Paul <brianp@vmware.com>
2014-02-12 11:21:46 -07:00
Francisco Jerez
76f95ba272 mesa: Handle binding of uniforms to image units with glUniform*().
v2: Set driver-specified flag in NewDriverState when glUniform* is
    used to bind an image unit.
v3: Abbreviate argument type check.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
2014-02-12 18:44:06 +01:00
Francisco Jerez
212122543b glsl/linker: Propagate image uniform access qualifiers to the driver.
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2014-02-12 18:44:06 +01:00
Francisco Jerez
c318a677dd glsl/linker: Assign image uniform indices.
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2014-02-12 18:44:06 +01:00
Francisco Jerez
e51158f2e7 glsl/linker: Count and check image resources.
v2: Add comment about the reason why image variables take up space
    from the default uniform block.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
2014-02-12 18:44:06 +01:00
Francisco Jerez
e8dbe430aa glsl: Add image built-in function generator.
Because of the combinatorial explosion of different image built-ins
with different image dimensionalities and base data types, enumerating
all the 242 possibilities would be annoying and a waste of .text
space.  Instead use a special path in the built-in builder that loops
over all the known image types.

v2: Generate built-ins on GLSL version 4.20 too.  Rename
    '_has_float_data_type' to '_supports_float_data_type'.  Avoid
    duplicating enumeration of image built-ins in create_intrinsics()
    and create_builtins().
v3: Use a more orthodox approach for passing image built-in generator
    parameters.
v4: Cosmetic changes.

Acked-by: Paul Berry <stereotype441@gmail.com>
2014-02-12 18:44:06 +01:00
Francisco Jerez
87acc7c650 glsl: Add built-in constants for ARB_shader_image_load_store.
v2: Add them on GLSL version 4.20 too.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
2014-02-12 18:44:05 +01:00
Francisco Jerez
6057300ec6 glcpp: Add built-in define for ARB_shader_image_load_store.
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2014-02-12 18:44:05 +01:00
Francisco Jerez
60c89f8bff glsl: Add built-in types defined by ARB_shader_image_load_store.
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2014-02-12 18:44:05 +01:00
Francisco Jerez
7af167d2be glsl/ast: Generalize some sampler variable restrictions to all opaque types.
No opaque types may be statically initialized in the shader, all
opaque variables must be declared uniform or be part of an "in"
function parameter declaration, no opaque types may be used as the
return type of a function.

v2: Add explicit check for opaque types in interface blocks.  Check
    for opaque types in ir_dereference::is_lvalue().

Reviewed-by: Paul Berry <stereotype441@gmail.com>
2014-02-12 18:44:05 +01:00
Francisco Jerez
2158749e52 glsl/ast: Forbid declaration of image variables in structures and uniform blocks.
Aggregating images inside uniform blocks is explicitly disallowed by
the standard, aggregating them inside structures is not (as of GL
4.4), but there is a similar problem as with atomic counters: image
uniform declarations require either a "writeonly" memory qualifier or
an explicit format qualifier, which are explicitly forbidden in
structure member declarations.  In the resolution of Khronos bug
#10903 the same wording applied to atomic counters was decided to mean
that they're not allowed inside structures -- Rejecting image member
declarations within structures seems the most reasonable option for
now.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
2014-02-12 18:44:05 +01:00
Francisco Jerez
6b28528d1c glsl/ast: Make sure that image argument qualifiers match the function prototype.
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2014-02-12 18:44:05 +01:00
Francisco Jerez
81c167ef1c glsl/ast: Verify that function calls don't discard image format qualifiers.
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2014-02-12 18:44:05 +01:00
Francisco Jerez
94a95e03d9 glsl/ast: Validate and apply memory qualifiers to image variables.
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2014-02-12 18:44:05 +01:00
Francisco Jerez
910311c4a6 glsl/parser: Handle image built-in types.
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2014-02-12 18:44:05 +01:00
Francisco Jerez
f9cf61df3b glsl/parser: Handle image memory qualifiers.
v2: Make the "map" array static const.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
2014-02-12 18:44:05 +01:00
Francisco Jerez
fcd869ed56 glsl/parser: Handle the early_fragment_tests input layout qualifier.
v2: Only allow the early_fragment_tests qualifier in fragment shaders.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
2014-02-12 18:44:05 +01:00
Francisco Jerez
b0b26faa25 glsl/lexer: Add new tokens for ARB_shader_image_load_store.
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2014-02-12 18:44:05 +01:00
Francisco Jerez
299e869d25 glsl/ast: Keep track of type qualifiers defined by ARB_shader_image_load_store.
v2: Add comment next to the read_only and write_only qualifier flags.
    Change temporary copies of the type qualifier mask to use uint64_t
    too.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
2014-02-12 18:44:05 +01:00
Francisco Jerez
c116541b2c glsl: Add gl_uniform_storage fields to keep track of image uniform indices.
v2: Promote anonymous struct into named struct.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
2014-02-12 18:44:05 +01:00
Francisco Jerez
bb13691d1c glsl: Add image memory and layout qualifiers to ir_variable.
v2: Add comment next to the read_only and write_only qualifier flags.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
2014-02-12 18:44:04 +01:00
Francisco Jerez
107d03a6d5 glsl: Add helper methods to glsl_type for dealing with images.
Add predicates to query if a GLSL type is or contains an image.
Rename sampler_coordinate_components() to coordinate_components().

v2: Use assert instead of unreachable.
v3: No need to use a separate code-path for images in
    coordinate_components() after merging image and sampler fields in
    the glsl_type structure.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
2014-02-12 18:43:37 +01:00
Francisco Jerez
8a2508ee07 glsl: Add image type to the GLSL IR.
v2: Reuse the glsl_sampler_dim enum for images.  Reuse the
    glsl_type::sampler_* fields instead of creating new ones specific
    to image types.  Reuse the same constructor as for samplers adding
    a new 'base_type' argument.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
2014-02-12 18:39:48 +01:00
Francisco Jerez
9e611fc72d glsl: Add ARB_shader_image_load_store extension enables.
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2014-02-12 18:39:48 +01:00
Fredrik Höglund
9afbd04d89 mesa: Preserve the NewArrays state when copying a VAO
Cc: "10.1" "10.0" <mesa-stable@lists.freedesktop.org>

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=72895
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-02-12 18:22:42 +01:00
Maarten Lankhorst
fee0686c21 nouveau: create only 1 shared screen between vdpau and opengl
This fixes bug 73200 "vdpau-GL interop fails due to different screen
objects" in the same way radeon does.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-02-12 14:57:25 +01:00
Maarten Lankhorst
572a8345bf gallium makefiles: use a linker script for building dri drivers
Only export __driDriverExtensions by default, and radeon_drm_winsys_create on radeons.
Remove -Bsymbolic which should no longer be needed.

As a side effect, it ought to fix a manifestation of bug 73200 on radeon.

Signed-off-by: Maarten Lankhorst<maarten.lankhorst@canonical.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2014-02-12 13:51:51 +01:00
Matt Turner
025d99ce3c glsl: Do not vectorize vector array dereferences.
Array dereferences must have scalar indices, so we cannot vectorize
them.

Cc: "10.1" <mesa-stable@lists.freedesktop.org>
Reported-by: Andrew Guertin <lists@dolphinling.net>
Tested-by: Andrew Guertin <lists@dolphinling.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-02-11 16:05:55 -08:00
Ian Romanick
4cffd3e791 meta: Enable cubemap array texture support to decompress_texture_image
Fixed piglit test getteximage-targets S3TC CUBE_ARRAY on systems that
don't have libtxc_dxtn installed.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-02-11 16:00:12 -08:00
Ian Romanick
daa3eea877 meta: Add cubemap array support to generic blit shader code
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-02-11 16:00:12 -08:00
Ian Romanick
e68aa12849 meta: Get the correct info log
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-02-11 16:00:12 -08:00
Ian Romanick
10f7c54477 meta: Expand texture coordinate from vec3 to vec4
This will be necessary to support cubemap array textures because they
use all four components.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-02-11 16:00:12 -08:00
Ian Romanick
b2ad3dbfa4 meta: Use GLSL to decompress 2D-array textures
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=72582
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-02-11 16:00:12 -08:00
Ian Romanick
c1417aae6c meta: Use common GLSL code for blits
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-02-11 16:00:12 -08:00
Ian Romanick
d524654c34 meta: Improve GLSL version check
We want to use the GLSL 1.30-ish path for OpenGL ES 3.0.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-02-11 16:00:12 -08:00
Ian Romanick
4825af972a meta: Add rectangle textures to the shader-per-sampler-type table
Rectangle textures were not necessary for mipmap generation (because
they cannot have mipmaps), but all of the future users of this common
code will need to support rectangle textures.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-02-11 16:00:12 -08:00
Ian Romanick
f5a477ab76 meta: Refactor shader generation code out of mipmap generation path
This is quite like code we want for blits.  Pull it out so that it can
be shared by other paths.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-02-11 16:00:12 -08:00
Ian Romanick
ed3bc38ee7 meta: Refactor the table of glsl_sampler structures
This will allow the same table of shader-per-sampler-type to be used for
paths in meta other than just mipmap generation.  This is also the
reason the declarations of the structures was moved towards the top of
the file.

v2: Code formatting change suggested by Brian.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-02-11 16:00:12 -08:00
Ian Romanick
b514f24101 meta: Use common vertex setup code for _mesa_meta_Bitmap too
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-02-11 16:00:12 -08:00
Ian Romanick
75227a0968 meta: Add storage to the vertex structure for R, G, B, and A
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-02-11 16:00:12 -08:00
Ian Romanick
5e5d87ff32 meta: Use common routine to configure fixed-function TNL state
Also... glOrtho(-1.0, 1.0, -1.0, 1.0, -1.0, 1.0) *is* the identity
matrix, so drop the unnecessary call to _mesa_Ortho.

v2: Rename setup_ff_TNL_for_blit() to setup_ff_tnl_for_blit().  Seems
    silly to capitalize one out of two to three acronyms in the name
    (change by anholt, acked by idr).

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com> (v1)
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-02-11 16:00:12 -08:00
Kenneth Graunke
35e8de383c i965: Fix General and Indirect Base Addresses on Broadwell.
I set the "address modify enable" bit in the wrong DWord.  The first
DWord is the high 16 bits of the address, while the second is the low
32-bits and enable bit.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-02-11 15:25:45 -08:00
Kenneth Graunke
b0e90ea09f i965: Drop VECTOR_MASK_ENABLE in Broadwell's 3DSTATE_VS packet.
We never set it on previous generations, but I had to set it in
3DSTATE_PS for correct behavior.  For symmetry, I set it in 3DSTATE_VS
as well, but there's no actual need to do so.  Piglit works fine either
way.  The documentation also remarks that there should never be a need
to program this.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-02-11 15:25:29 -08:00
Kenneth Graunke
4dd1002518 i965/gs: Fix EndPrimitive on Broadwell.
My earlier patch (i965: Reserve space for "Vertex Count" in GS outputs.)
incremented Global Offset for most URB writes to make room for the new
"Vertex Count" field, but failed to shift the URB writes used for
writing control bits.

Confusingly, Global Offset must be incremented by 2 here, rather than 1.
The URB writes we use for actual data are HWord writes, which treat
Global Offset as a 256-bit offset.  These are OWord writes, so it's
treated as a 128-bit offset instead.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-02-11 15:25:03 -08:00
Kenneth Graunke
5ebfac8d72 i965/vec4: Support arbitrarily large sampler indices on Broadwell+.
I added support for these on Haswell, but forgot to update the Broadwell
code before landing it.  Fixes Piglit's max-samplers test.

v2: Use get_element_ud() for the destination as well as the source.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-02-11 15:24:36 -08:00
Kenneth Graunke
b371734331 i965/fs: Support arbitrarily large sampler indices on Broadwell+.
I added support for these on Haswell, but forgot to update the Broadwell
code before landing it.  Partially fixes Piglit's max-samplers test.

v2: Use get_element_ud() consistently, rather than using it for the
    source but using brw_vec1_grf for the destination..

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-02-11 15:22:22 -08:00
Kenneth Graunke
0e21ba07f2 i965/fs: Fix Broadwell texture header setup to be uncompressed.
MOV_RAW disables masking, but doesn't force the instruction to be
uncompressed.  That needs to be done by hand.

Fixes textureGather and texture offset tests.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-02-11 15:21:10 -08:00
Ian Romanick
1edca151a0 mesa: GL_ARB_half_float_pixel is not optional
Almost every driver already supported it.  All current and future
Gallium drivers always support it, and most existing classic drivers
support it.

This only changes radeon and nouveau.

This extension only adds data types that can be passed to, for example,
glTexImage2D.  It does not add internal formats.  Since you can already
pass GL_FLOAT to glTexImage2D this shouldn't pose any additional issues
with those drivers.  Note that r200 and i915 already supported this
extension, and they don't support floating-point textures either.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-02-11 14:36:43 -08:00
Ian Romanick
6d6a290181 mesa: Fix extension dependency for half-float TexBOs
Half-float TexBOs should require both GL_ARB_half_float_pixel and
GL_ARB_texture_float.  This doesn't matter much in practice.  Every
driver that supports GL_ARB_texture_buffer_object already supports
GL_ARB_half_float_pixel.  We only expose the TexBO extension in core
profiles, and those require GL_ARB_texture_float.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-02-11 14:36:43 -08:00
Ian Romanick
54b1082828 meta: Silence unused parameter warning in _mesa_meta_CopyTexSubImage
drivers/common/meta.c: In function '_mesa_meta_CopyTexSubImage':
drivers/common/meta.c:3744:52: warning: unused parameter 'rb' [-Wunused-parameter]

Unfortunately, the parameter can't just be removed because it is part of
the dd_function_table::CopyTexSubImage interface.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-02-11 14:36:43 -08:00
Ian Romanick
d156281cfe meta: Silence unused parameter warning in setup_drawpix_texture
drivers/common/meta.c: In function 'setup_drawpix_texture':
drivers/common/meta.c:1572:30: warning: unused parameter 'texIntFormat' [-Wunused-parameter]

setup_drawpix_texture has never used this paramater.  Before the
refactor commit 04f8193aa it was used in several locations.  After that
commit, texIntFormat was only used in alloc_texture.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-02-11 14:36:43 -08:00
Ian Romanick
f34d599a5b meta: Refactor common VAO and VBO initialization code
v2: Clean up some stray binding calls

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com> (v1)
Reviewed-by: Eric Anholt <eric@anholt.net> (v2)
2014-02-11 14:24:02 -08:00
Ian Romanick
beb33fc5b7 meta: Track the _mesa_meta_DrawPixels VBO just like the others
All of the other meta routines have a particular pattern for creating
and tracking the VAO and VBO.  This one function deviated from that
pattern for no apparent reason.

Almost all of the code added in this patch will be removed shortly.

v2: Drop glDeleteBuffers() of the old, now-uninitialized vbo variable.
    Fixes getteximage-formats and fbo-mipmap-copypix regression when "2"
    landed in the variable (change by anholt).

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-02-11 14:23:55 -08:00
Ian Romanick
83c90c9239 meta: Expand the vertex structure for the GenerateMipmap and decompress paths
Final intermediate step leading to some code sharing.  Note that the new
GemerateMipmap and decompress vertex structures are the same as the new vertex
structure in BlitFramebuffer and the others.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-02-11 14:11:21 -08:00
Ian Romanick
897f975668 meta: Expand the vertex structure for the DrawPixels paths
Another step leading to some code sharing.  Note that the new DrawPixels
vertex structure is the same as the new vertex structure in BlitFramebuffer
and the others.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-02-11 14:11:21 -08:00
Ian Romanick
d7ac102c7b meta: Expand the vertex structure for the Clear paths
Another step leading to some code sharing.  Note that the new Clear
vertex structure is the same as the new BlitFramebuffer and CopyPixels
vertex structure.

The "sizeof(float) * 7" hack is temporary.  It will magically disappear
in a just a couple more patches.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-02-11 14:11:21 -08:00
Ian Romanick
545fd9bc9b meta: Expand the vertex structure for the CopyPixels paths
Another step leading to some code sharing.  Note that the new CopyPixels
vertex structure is the same as the new BlitFramebuffer vertex
structure.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-02-11 14:11:21 -08:00
Ian Romanick
9b4e659e62 meta: Expand the vertex structure for the BlitFramebuffer paths
This is the first of several steps leading to some code sharing.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-02-11 14:11:21 -08:00
Ilia Mirkin
908a711313 nv30,nvc0: only claim a single viewport
It should be possible to make this be 16 on nvc0.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-02-11 22:08:01 +00:00
Emil Velikov
82cd6e6317 st/clover: use VISIBILITY_CXXFLAGS where approapriate
Use the c++ visibility flags when building cpp files.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-02-11 21:36:52 +00:00
Emil Velikov
7ed32c9af9 omx: use VISIBILITY_CFLAGS to control exported symbols
Initial step of cleaning the exported symbols from targets/omx

 - Mark omx_component_library_Setup as public

v2: Keep export-symbols-regex

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Christian König <christian.koenig@amd.com> (v1)
2014-02-11 21:36:16 +00:00
Emil Velikov
eda9a66f7e osmesa: drop obsolete AM_CXXFLAGS
There is no cpp files during the build process, thus we
can safely drop the unused cxxflags.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-02-11 21:32:39 +00:00
Emil Velikov
927b9e8eb8 st/vdpau: automake: export only PUBLIC symbols
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2014-02-11 21:27:45 +00:00
Emil Velikov
255b39f17a st/vdpau: do not export VdpPresentationQueueTargetCreateX11
The function pointer is retrieved via VdpGetProcAddress just
like all the other vdpau functions and should not be exported.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2014-02-11 21:25:11 +00:00
Emil Velikov
d84e0eb406 wayland-egl: automake: add symbol test
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-02-11 20:19:46 +00:00
Emil Velikov
6405563783 st/egl: automake: avoid exporting all symbols
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-02-11 20:19:01 +00:00
Emil Velikov
11926e8997 targets/egl-static: automake: don't export local symbols
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-02-11 20:16:55 +00:00
Emil Velikov
5c7f75f70a gbm: automake: add symbol tests
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-02-11 19:00:09 +00:00
Emil Velikov
33b9c0d465 targets/gbm: automake: do not export internal symbols
Add VISIBILITY_CFLAGS to automake build, so that
only required symbols are exported.

v2: Rebase

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-02-11 19:00:09 +00:00
Emil Velikov
10e5ffd496 gbm: do not export _gbm_mesa_get_device
This symbol is internal and was never part of the API.
Unused by any of the gbm backends, it makes sense to
simply not export it.

Cc: Kristian Høgsberg <krh@bitplanet.net>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-02-11 19:00:09 +00:00
Emil Velikov
d00b319f40 gbm: automake: add
VISIBILITY_CFLAGS

Currently the library exports every symbol imaginable,
rather than the ones defined by the API.

Note: This may cause issues for libraries that are linking
agaist libgbm's internals.

Cc: Kristian Høgsberg <krh@bitplanet.net>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-02-11 19:00:09 +00:00
Emil Velikov
631cc6105d st/gbm: automake: do not export gbm_gallium_drm_device_create
Symbol is internal and was never meant to be exported.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-02-11 19:00:09 +00:00
Emil Velikov
90ed101322 auxiliary/pipe-loader: automake: avoid exporting all symbols
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-02-11 19:00:09 +00:00
Emil Velikov
165eecf1f6 egl/dri2/android: free driver_name in dri2_initialize_android error path
v2:
Cleanup driver name if dri2_load_driver() fails. Spotted by Chad

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-02-11 19:00:09 +00:00
Emil Velikov
76d9f6d972 dri/nouveau: Pass the API into _mesa_initialize_context
Currently we create a OPENGL_COMPAT context regardless of
what was requested by the program. Correct that by retaining
the program's request and passing it into _mesa_initialize_context.

Based on a similar commit for radeon/r200 by Ian Romanick.

Cc: "9.1 9.2 10.0" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-02-11 19:00:09 +00:00
Emil Velikov
118c36adb4 configure: cleanup libudev handling
Add the explicit note about the required version during configure.
Require the same version (151) of udev when building the pipe-loader.
Mention the udev version requirement in GBM Requires.private.

v2: Resolve a couple of silly typos. Spotted by Ilia
v3: Cleanup platfrom/platform typo. Spotten by Stefan

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-02-11 18:59:59 +00:00
Emil Velikov
31f50f3149 gbm: drop unneeded dependency of libudev
As of recently we dlopen the library, additionally the only
code that is including the libudev.h header, is the loader.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-02-11 17:17:50 +00:00
Emil Velikov
d57dc6dc30 opencl: do not link against libudev
Previously the linking was required due to dependency of udev in the
pipe-loader. Now this is no longer the case, as we dlopen the library.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-02-11 17:17:50 +00:00
Emil Velikov
e19fba7cc6 gallium/tests: do not link against libudev
Previously the linking was required due to dependency of udev in the
pipe-loader. Now this is no longer the case, as we dlopen the library.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-02-11 17:17:50 +00:00
Emil Velikov
897e1989da egl-static: stop linking against libudev
No longer required since all the udev code is in the loader.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-02-11 17:17:50 +00:00
Emil Velikov
053e095ecb egl_dri2: remove LIBUDEV_CFLAGS from Makefile.am
None of the code within builds or (explicitly) requires udev.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-02-11 17:17:50 +00:00
Emil Velikov
6fe2ca7a08 configure: drop LIBUDEV_CFLAGS from X11_INCLUDES
The cflags are explicitly included in the only Makefile that
handles udev dependant code.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-02-11 17:17:50 +00:00
Emil Velikov
7536d744ee pipe-loader: drop obsolete libudev.h include
All the udev code is in the loader, so there is no
reason for us to include this header.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-02-11 17:17:49 +00:00
Emil Velikov
929f83376a configure: error out when building radeonsi without gallium-llvm
--enable-gallium-llvm is required by radeonsi. Currently we
check only for LLVM_VERSION_INT which is 0, whenever gallium-llvm
is disabled explicitly.

./configure --with-gallium-drivers=r600,radeonsi --disable-gallium-llvm

v2: Correct typo in error message. Spotted by Tom Stellard

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-02-11 17:04:18 +00:00
Christian König
4ca8439dce omx/radeonsi: fix target
Another minor typo.

Signed-off-by: Christian König <christian.koenig@amd.com>
2014-02-11 17:10:22 +01:00
Christian König
79aa29d45e omx: fix some minor configure.ac issues
Matt Turner noted the incorrect order, but I somehow forgotten to
change it before pushing upstream. The other one is a typo during rebase.

Signed-off-by: Christian König <christian.koenig@amd.com>
2014-02-11 17:08:42 +01:00
Christian König
ee978aee94 vl: add H264 encoding interface
Signed-off-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Leo Liu <leo.liu@amd.com>
2014-02-11 13:26:13 +01:00
Kenneth Graunke
eaf3358e0a i965: Don't call abort() on an unknown device.
If we don't recognize the PCI ID, we can't reasonably load the driver.
However, calling abort() is quite rude - it means the application that
tried to initialize us (possibly the X server) can't continue via
fallback paths.  We already have a more polite mechanism - failing to
create the context.  So, just use that.

While we're at it, improve the error message.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=73024
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Tested-by: Lu Hua <huax.lu@intel.com>
2014-02-11 02:23:22 -08:00
Daniel Kurtz
b47d231526 glsl: Add locking to builtin_builder singleton
Consider a multithreaded program with two contexts A and B, and the
following scenario:

1. Context A calls initialize(), which allocates mem_ctx and starts
   building built-ins.
2. Context B calls initialize(), which sees mem_ctx != NULL and assumes
   everything is already set up.  It returns.
3. Context B calls find(), which fails to find the built-in since it
   hasn't been created yet.
4. Context A finally finishes initializing the built-ins.

This will break at step 3.  Adding a lock ensures that subsequent
callers of initialize() will wait until initialization is actually
complete.

Similarly, if any thread calls release while another thread is still
initializing, or calling find(), the mem_ctx/shader would get free'd while
from under it, leading to corruption or use-after-free crashes.

Fixes sporadic failures in Piglit's glx-multithread-shader-compile.

Bugzilla: https://bugs.freedesktop.org/69200
Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: "10.1 10.0" <mesa-stable@lists.freedesktop.org>
2014-02-11 02:21:41 -08:00
Kenneth Graunke
e95a4ed296 i965/fs: Simplify FS_OPCODE_SET_OMASK stride mashing a bit.
In the first case, we can simply call stride(mask, 16, 8, 2) rather than
creating a new register with a different stride, then immediately
changing it a second time.

In the second case, the stride was already what we wanted, so we can
just use mask without any changes at all.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-02-11 02:21:35 -08:00
Kenneth Graunke
f948ad2a07 i965/fs: Simplify FS_OPCODE_SET_SAMPLE_ID stride mashing a bit.
stride(brw_vec1_reg(...) ...) takes some register, changes the strides,
then changes the strides again.  Let's do it once.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-02-11 02:21:26 -08:00
Dave Airlie
08fd34c8a3 docs/GL3.txt: denote r600g support for ARB_viewport_array
Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-02-11 14:15:18 +10:00
Dave Airlie
6d434252e2 r600g: add support for multiple viewports.
tested on rv635 and barts.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-02-11 14:14:50 +10:00
Dave Airlie
0705fa35cd st/mesa: add support for GL_ARB_viewport_array (v0.2)
this just ties the mesa code to the pre-existing gallium interface,
I'm not sure what to do with the CSO stuff yet.

0.2: fix min/max bounds

Acked-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-02-11 14:14:50 +10:00
Dave Airlie
c116ee6042 st/mesa: add support for viewport index semantic
This adds GS output and FS input support, even though FS input
support isn't supported until GLSL 4.30 from what I can see.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-02-11 14:06:40 +10:00
Kenneth Graunke
a21552a96b i965: Program 2x MSAA sample positions.
There are only two sensible placements for 2x MSAA samples - and one is
the mirror image of the other.  I chose (0.25, 0.25) and (0.75, 0.75).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-02-10 08:18:29 -08:00
Kenneth Graunke
f4bc0ac83e i965: Store 4x MSAA sample positions in a scalar value, not an array.
Storing a single value in an array is rather pointless.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-02-10 08:18:29 -08:00
Kenneth Graunke
16f7510ad3 i965: Duplicate less code in GetSamplePositions driver hook.
The 4x and 8x cases contained identical code for extracting the X and
Y sample offset values and converting them from U0.4 back to float.

Without this refactoring, we'd have to duplicate it a third time in
order to support 2x MSAA.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-02-10 08:18:28 -08:00
Ilia Mirkin
40dd777b33 nouveau/video: make sure that firmware is present when checking caps
Apparently some players are ill-prepared for us claiming that a decoder
exists only to have creating it fail, and express this poor preparation
with crashes (e.g. flash). Check that firmware is there to increase the
chances of there being a high correlation between reported capabilities
and ability to create a decoder.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: 10.0 10.1 <mesa-stable@lists.freedesktop.org>
Tested-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-02-10 14:00:17 +01:00
Kenneth Graunke
a487ef87fe mesa: Fix MESA_FORMAT_Z24_UNORM_S8_UINT vs. X8_UINT mix-up.
In commit eeed49f5f2, Mark accidentally
renamed MESA_FORMAT_S8_Z24 to MESA_FORMAT_Z24_UNORM_X8_UINT and
MESA_FORMAT_X8_Z24 to MESA_FORMAT_Z24_UNORM_S8_UINT, reversing their
sense.  The commit message was correct, but what sed commands actually
got run didn't match that.

This patch swaps the two enum names, reversing them.  This should undo
the damage, but might break things if people have manually fixed a few
instances in the meantime...

Mark's commit also failed to mention renames:
s/MESA_FORMAT_ARGB2101010_UINT\b/MESA_FORMAT_B10G10R10A2_UINT/g
s/MESA_FORMAT_ABGR2101010\b/MESA_FORMAT_R10G10B10A2_UNORM/g
but those seem okay.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-02-09 16:57:45 -08:00
Maxence Le Doré
b903be50b0 mesa: remove duplicated init of MaxViewports
Already declared 5 lines before.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-02-09 16:45:23 -08:00
Grigori Goronzy
d34d5fddf8 gallium: add geometry shader output limits
v2: adjust limits for radeonsi and llvmpipe
v3: add documentation

Cc: "10.1" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
2014-02-09 23:31:38 +01:00
Siavash Eliasi
61bc014c96 mesa: Removed unnecessary check for NULL pointer when freeing memory
Note that it is OK to pass NULL pointers to this function since this commit:

mesa: modified _mesa_align_free() to accept NULL pointer
http://cgit.freedesktop.org/mesa/mesa/commit/?id=f0cc59d68a9f5231e8e2111393a1834858820735

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-02-09 16:16:34 +01:00
Ilia Mirkin
356aff3a5c nv30: report 8 maximum inputs
nvfx_fragprog_assign_generic only allows for up to 10/8 texcoords for
nv40/nv30. This fixes compilation of the varying-packing tests.
Furthermore it appears that the last 2 inputs on nv4x don't seem to
work in those tests, so just report 8 everywhere for now.

Tested on NV42, NV44. NV4B appears to have additional problems.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: 9.1 9.2 10.0 10.1 <mesa-stable@lists.freedesktop.org>
2014-02-08 19:06:51 -05:00
Christoph Bumiller
2e9ee44797 nv50/ir/ra: some register spilling fixes
Cc: 10.1 <mesa-stable@lists.freedesktop.org>
2014-02-09 00:04:13 +01:00
Brian Paul
c325ec8965 mesa: update assertion in detach_shader() for geom shaders
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=74723
Cc: "10.0" "10.1" <mesa-stable@lists.freedesktop.org>
Tested-by: Andreas Boll <andreas.boll.dev@gmail.com>
2014-02-08 14:21:28 -07:00
Brian Paul
6e8d04ac3e mesa: allocate gl_debug_state on demand
We don't need to allocate all the state related to GL_ARB_debug_output
until some aspect of that extension is actually needed.

The sizeof(gl_debug_state) is huge (~285KB on 64-bit systems), not even
counting the 54(!) hash tables and lists that it contains.  This change
reduces the size of gl_context alone from 431KB bytes to 145KB bytes on
64-bit systems and from 277KB bytes to 78KB bytes on 32-bit systems.

Reviewed-by: Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-02-08 11:27:58 -07:00
Brian Paul
31b2625cb5 mesa: trivial clean-ups in errors.c
Whitespace changes, 78-column rewrapping, comment clean-ups, add
some braces, etc.

Reviewed-by: Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-02-08 11:27:58 -07:00
Brian Paul
1dc209d8f2 mesa: remove _mesa_ prefix from some static functions
Reviewed-by: Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-02-08 11:27:57 -07:00
Kenneth Graunke
dcb0330d30 i965: Label JIP and UIP in Broadwell shader disassembly.
This makes it obvious which number is which.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-02-07 19:38:15 -08:00
Kenneth Graunke
8a7fe50067 i965: Don't disassemble UIP field for Broadwell WHILE instructions.
The WHILE instruction doesn't have UIP.  It only has JIP.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-02-07 19:38:12 -08:00
Kenneth Graunke
5230655a2e i965: Don't print source registers for Broadwell flow control.
The bits which normally contain the source register descriptions
actually contain the JIP/UIP jump targets, which we already printed.

Interpreting JIP/UIP as source registers results in some really creepy
looking output, like IF statements with acc14.4<0,1,0>UD sources.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-02-07 19:37:34 -08:00
Kenneth Graunke
8e0a0e4d30 i965: Fix fast depth clear values on Broadwell.
Broadwell's 3DSTATE_CLEAR_PARAMS packet expects a floating point value
regardless of format.  This means we need to stop converting it to
UNORM.

Storing the value as float would make sense, but since we already have a
uint32_t field, this patch continues shoehorning it into that.  In a
sense, this makes mt->depth_clear_value the DWord you emit in the
packet, rather than the clear value itself.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-02-07 19:36:14 -08:00
Christoph Bumiller
882e98e5e6 nvc0: handle TGSI_SEMANTIC_LAYER
Cc: 10.1 <mesa-stable@lists.freedesktop.org>
2014-02-07 23:14:00 +01:00
Christoph Bumiller
dd2229d4c6 nvc0: create the SW object
It's required for being able to use software methods now.
2014-02-07 22:53:37 +01:00
Christoph Bumiller
b7233acf78 nvc0/ir/emit: hardcode vertex output stream to 0 for now 2014-02-07 22:53:36 +01:00
Chris Forbes
0c14c5c62a i965: Enable ARB_texture_gather for one component on Gen6.
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-02-08 10:32:24 +13:00
Chris Forbes
31d1077dd2 i965/vec4: Emit shader w/a for Gen6 gather
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-02-08 10:32:23 +13:00
Chris Forbes
73b91fe05a i965/fs: Emit shader w/a for Gen6 gather
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-02-08 10:32:20 +13:00
Chris Forbes
c2d51aaa11 i965: Add surface format overrides for Gen6 gather
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-02-08 10:32:19 +13:00
Chris Forbes
2b7bbd89e8 i965: Add Gen6 gather wa to sampler key
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-02-08 10:32:06 +13:00
Eric Anholt
1e12dafcac glsl: Optimize triop_csel with all-true or all-false.
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-02-07 12:46:48 -08:00
Eric Anholt
de796b0ef0 glsl: Optimize various cases of fma (aka MAD).
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-02-07 12:46:48 -08:00
Eric Anholt
44577c4857 glsl: Optimize lrp(x, x, coefficient) --> x.
total instructions in shared programs: 1627754 -> 1624534 (-0.20%)
instructions in affected programs:     45748 -> 42528 (-7.04%)
GAINED:                                3
LOST:                                  0

(serious sam, humus domino demo)

Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-02-07 12:46:48 -08:00
Eric Anholt
d72956790f glsl: Optimize pow(x, 1) -> x.
total instructions in shared programs: 1627826 -> 1627754 (-0.00%)
instructions in affected programs:     6640 -> 6568 (-1.08%)
GAINED:                                0
LOST:                                  0

(HoN and savage2)

Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-02-07 12:46:48 -08:00
Eric Anholt
6d7c123d6c glsl: Optimize log(exp(x)) and exp(log(x)) into x.
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-02-07 12:46:47 -08:00
Eric Anholt
2c2aa35336 glsl: Optimize ~~x into x.
v2: Fix pasteo of an extra abs being inserted (caught by many).  Rewrite
    to drop the silly switch statement.

Reviewed-by: Matt Turner <mattst88@gmail.com> (v1)
2014-02-07 12:46:47 -08:00
Eric Anholt
0f6279bab2 i965: Add some informative debug when the X Server botches DRI2 GetBuffers.
We've had various bug reports over the years where miptrees are missing,
and when I screwed it up while adding DRI2 to the modesetting driver, I
figured I should put the info necessary for debug here.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-02-07 12:46:47 -08:00
Eric Anholt
b5e5f34dd2 i965: Remove redundant check in blitter-based glBlitFramebuffer().
The intel_miptree_blit() code checks the format for us now, plus it
handles xrgb vs argb for us.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-02-07 12:46:47 -08:00
Kenneth Graunke
697f401a31 i965: Fix Gen8+ disassembly of half float subregister numbers.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-02-07 12:36:38 -08:00
Kenneth Graunke
e990234ff6 i965: Use the new brw_load_register_mem helper for draw indirect.
This makes it work on Broadwell, too.

v2: Drop bogus double write to 3DPRIM_BASE_VERTEX register
    (caught by Chris Forbes).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-02-07 12:36:38 -08:00
Kenneth Graunke
b7c435b261 i965: Implement a brw_load_register_mem helper function.
This saves some boilerplate and hides the OUT_RELOC/OUT_RELOC64
distinction.

Placing the function in intel_batchbuffer.c is rather arbitrary; there
wasn't really an obvious place for it.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-02-07 12:36:38 -08:00
Kenneth Graunke
2f97119950 i965: Fix INTEL_DEBUG=vs for fixed-function/ARB programs.
Since commit 9cee3ff562, INTEL_DEBUG=vs
has caused a NULL pointer dereference for fixed-function/ARB programs.

In the vec4 generators, "prog" is a gl_program, and "shader_prog" is the
gl_shader_program.  This is different than the FS visitor.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-02-07 12:36:38 -08:00
Kenneth Graunke
2062f40d81 glsl: Don't lose precision qualifiers when encountering "centroid".
Mesa fails to retain the precision qualifier when parsing:

   #version 300 es
   centroid in mediump vec2 v;

Consider how the parser's type_qualifier production is applied.
First, the precision_qualifier rule creates a new ast_type_qualifier:

    <precision: mediump>

Then the storage_qualifier rule creates a second one:

    <flags: in>

and calls merge_qualifier() to fold in any previous qualifications,
returning:

    <flags: in, precision: mediump>

Finally, the auxiliary_storage_qualifier creates one for "centroid":

    <flags: centroid>

it then does $$ = $1 and $$.flags |= $2.flags, resulting in:

    <flags: centroid, in>

Since precision isn't stored in the flags bitfield, it is lost.  We need
to instead call merge_qualifier to combine all the fields.

Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reported-by: Kevin Rogovin <kevin.rogovin@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-02-07 12:36:38 -08:00
Brian Paul
f47e596288 st/mesa: avoid sw fallback for getting/decompressing textures
If st_GetTexImage() is to decompress the texture, avoid the fallback
path even if prefer_blit_based_texture_transfer = false.  For drivers
that returned PIPE_CAP_PREFER_BLIT_BASED_TEXTURE_TRANSFER = 0, we
were always taking the fallback path for texture decompression rather
than rendering a quad.  The later is a lot faster.

Cc: "10.0" "10.1" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-02-07 09:54:43 -07:00
Erik Faye-Lund
5125165dde gallium/tgsi: correct typo propagated from NV_vertex_program1_1
In the specification text of NV_vertex_program1_1, the upper
limit of the RCC instruction is written as 1.884467e+19 in
scientific notation, but as 0x5F800000 in binary. But the binary
version translates to 1.84467e+19 rather than 1.884467e+19 in
scientific notation.

Since the lower-limit equals 2^-64 and the binary version equals
2^+64, let's assume the value in scientific notation is a typo
and implement this using the value from the binary version
instead.

Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-02-07 08:22:23 -07:00
Erik Faye-Lund
7a49a796a4 gallium/tgsi: use CLAMP instead of open-coded clamps
Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-02-07 08:22:14 -07:00
Juha-Pekka Heikkila
498d10e230 egl: Unhide functionality in _eglInitSurface()
_eglInitResource() was used to memset entire _EGLSurface by
writing more than size of pointed target. This does work
as long as Resource is the first element in _EGLSurface,
this patch fixes such dependency.

Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-02-07 08:14:05 -07:00
Juha-Pekka Heikkila
1456ed85f0 egl: Unhide functionality in _eglInitContext()
_eglInitResource() was used to memset entire _EGLContext by
writing more than size of pointed target. This does work
as long as Resource is the first element in _EGLContext,
this patch fixes such dependency.

Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-02-07 08:14:05 -07:00
Juha-Pekka Heikkila
d530745169 glx: Add missing null check in __glX_send_client_info()
Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-02-07 08:14:05 -07:00
Juha-Pekka Heikkila
d3e948340b i965: Add missing null check in fs_visitor::dead_code_eliminate_local()
Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-02-07 08:14:05 -07:00
Juha-Pekka Heikkila
e503609e6f glx: Add some missing null checks in glx_pbuffer.c
Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-02-07 08:14:05 -07:00
Juha-Pekka Heikkila
88cad8356e glsl: Fix null access on file read error
Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-02-07 08:14:04 -07:00
Juha-Pekka Heikkila
2ae1437a8e glx: Add missing null check in __glXCloseDisplay
Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-02-07 08:14:04 -07:00
Juha-Pekka Heikkila
d28e92ff74 glx: Add missing null checks in glxcmds.c
Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-02-07 08:14:04 -07:00
Jordan Justen
020c43f401 main/get: support ARB_gpu_shader5
If a driver enables ARB_gpu_shader5 and sets Const.MaxVertexSteams >= 4,
then piglit's arb_gpu_shader5-minmax test should now pass.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-02-06 16:58:33 -08:00
Jordan Justen
60914fa80d glapi: add definitions for ARB_gpu_shader5
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-02-06 16:58:33 -08:00
Ilia Mirkin
0befbafb4b nouveau/codegen: allow tex offsets on non-TXF instructions (e.g. TXL)
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Christoph Bumiller <e0425955@student.tuwien.ac.at>
2014-02-06 18:50:19 -05:00
Ilia Mirkin
f76c7ad5b1 nv50: only over-allocate by a page for code
The pre-fetching doesn't go too far. Tested with over-allocating by only
a page, and didn't see any errors in dmesg. Saves ~512KB of VRAM.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: 10.1 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Christoph Bumiller <e0425955@student.tuwien.ac.at>
2014-02-06 18:50:19 -05:00
Ilia Mirkin
364bdd2419 nv50: fix layerid to be the fp input number rather than vp output number
In the tests they were the same so it didn't matter, but indications are
that this is the correct behaviour. Also take this opportunity to
(trivially) support using gl_Layer in fp.

Cc: 10.1 <mesa-stable@lists.freedesktop.org>
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Christoph Bumiller <e0425955@student.tuwien.ac.at>
2014-02-06 18:03:24 -05:00
Ilia Mirkin
c7373b7dc7 nv50: rework primid logic
Functionally identical but much simpler. Should also better integrate
with future layer/viewport changes/fixes.

Cc: 10.1 <mesa-stable@lists.freedesktop.org>
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Christoph Bumiller <e0425955@student.tuwien.ac.at>
2014-02-06 18:02:57 -05:00
Kristian Høgsberg
f658150639 glx: Pass NULL DRI drawables into the DRI driver for None GLX drawables
GLX_ARB_create_context allows making a GLX context current with None
drawable and readables, but this was never implemented correctly in GLX.
We would create a __DRIdrawable for the None GLX drawable and pass that
to the DRI driver and that would somehow work.  Now it's somehow broken.

The way this should have worked is that we pass a NULL DRI drawable
to the DRI driver when the GLX user calls glXMakeContextCurrent()
with None for drawable and readables.

https://bugs.freedesktop.org/show_bug.cgi?id=74143
Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
2014-02-06 14:23:42 -08:00
Christian König
db54fca9b8 st/vdpau: add flush on unmap
Flush the context when we unmap a buffer, otherwise VDPAU might
start rendering the next frame while we still reference that buffer.

Signed-off-by: Christian König <christian.koenig@amd.com>
Tested-by: StrangeNoises (rachel@strangenoises.org)
2014-02-06 20:58:38 +01:00
Marek Olšák
3f98053fc9 vdpau: flush the context before exporting the surface v2
Bugzilla (bug needs XBMC changes as well):
https://bugs.freedesktop.org/show_bug.cgi?id=73191

When VL uploads vertex buffers, it uses PIPE_TRANSFER_DONTBLOCK, which always
flushes the context in the winsys if the buffer being mapped is busy. Since
I added handling of DISCARD_RANGE, DONTBLOCK has had no effect when combined
with DISCARD_RANGE and I think the context isn't flushed anywhere else,
so no commands are submitted to the GPU until the IB is full, which takes
a lot of frames.

Using DISCARD_RANGE is not the only way to trigger this bug. The other way
is to reallocate the vertex buffer before every upload.

BTW, I'm not sure if this is the right place for flushing, but it does fix
the bug.

v2 (chk): move the flush to the right place.

Signed-off-by: Christian König <christian.koenig@amd.com>
Tested-by: StrangeNoises (rachel@strangenoises.org)
2014-02-06 20:58:07 +01:00
Matt Turner
e2ef93cf94 glsl: Initialize ubo_binding_mask flags to zero.
Missed in commit e63bb298. Caused sporadic test failures, like
incorrect-in-layout-qualifier-repeated-prim.geom.

Cc: "10.0" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-02-06 10:36:54 -08:00
Marek Olšák
559af1df10 gallium/radeon: fix warnings 2014-02-06 17:43:29 +01:00
Marek Olšák
c32114460d gallium: remove PIPE_USAGE_STATIC
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-02-06 17:37:34 +01:00
Marek Olšák
eeb5a4a50e gallium: define the behavior of PIPE_USAGE_* flags properly
STATIC will be removed in the following commit.

v2: changed the definition of IMMUTABLE

Reviewed-by: Brian Paul <brianp@vmware.com>
2014-02-06 17:30:00 +01:00
Marek Olšák
ed84fb3167 gallium: remove PIPE_RESOURCE_FLAG_GEN_MIPS
Unused.

Reviewed-by: Brian Paul <brianp@vmware.com>
2014-02-06 17:30:00 +01:00
Marek Olšák
2be5bbdd97 r600g,radeonsi: set resource domains in one place (v2)
v2: This doesn't change the behavior. It only moves the tiling check
    to r600_init_resource and removes the usage parameter.

Reviewed-by: Christian König <christian.koenig@amd.com>
2014-02-06 17:29:59 +01:00
Marek Olšák
c6dbcf10df st/mesa: fix crash when a shader uses a TBO and it's not bound
This binds a NULL sampler view in that case.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=74251

Cc: "10.1" "10.0" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-02-06 17:29:59 +01:00
Christian König
b862cc23f2 st/omx: add workaround for bug in Bellagio
Not blocking for the message thread can lead to accessing freed up memory.

Signed-off-by: Christian König <christian.koenig@amd.com>
2014-02-06 16:19:39 +01:00
Christian König
15e39ca28a st/omx: initial OpenMAX support v3
Featuring a full grown MPEG2 and H264 decoder and a couple of hundred bugs.

v2 (Leo): fix an error for pic_order_cnt_type 1
v3 (Leo): implement support for field decoding

Signed-off-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Leo Liu <leo.liu@amd.com>
2014-02-06 16:16:34 +01:00
Christian König
c9b941ff1b vl/rbsp: add H.264 RBSP implementation
Signed-off-by: Christian König <christian.koenig@amd.com>
2014-02-06 16:16:33 +01:00
Christian König
b8b28bf94a vl/vlc: add function to limit the vlc size
Signed-off-by: Christian König <christian.koenig@amd.com>
2014-02-06 16:16:33 +01:00
Christian König
9ef42a54a7 vl/vlc: add remove bits function
Signed-off-by: Christian König <christian.koenig@amd.com>
2014-02-06 16:16:33 +01:00
Christian König
fe0f9ab056 radeon: update legal notes on UVD
Signed-off-by: Christian König <christian.koenig@amd.com>
2014-02-06 16:15:58 +01:00
Christian König
96e8b916a7 radeon: just don't map VRAM buffers at all
Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-02-06 16:08:22 +01:00
Christian König
9b218dcdd7 radeon/video: directly create buffers in the right domain
Avoid moving things around on start of stream.

Signed-off-by: Christian König <christian.koenig@amd.com>
2014-02-06 15:54:14 +01:00
Christian König
7bcfb0bc8f radeon/video: seperate common video functions
Signed-off-by: Christian König <christian.koenig@amd.com>
2014-02-06 15:54:13 +01:00
Axel Davy
57f94bff71 gallium/dri2: Fix dri2_dup_image
dri2_dup_image was not copying the dri_format field.

This was causing some bugs, for example:
. we create an gbm_bo.
. we get an EGLImage from the gbm_bo.
. Bug: impossible to get again the gbm_bo from the EGLImage by
  importing. (gbm dri2 backend)

Signed-off-by: Axel Davy <axel.davy@ens.fr>
2014-02-05 22:22:00 -08:00
Chris Forbes
bba1105d52 i965/vs: Fix typo in brw_compute_vue_map
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-02-05 22:02:23 -08:00
Kenneth Graunke
e57d77280e i965: Fix register types in dump_instructions().
This regressed when I converted BRW_REGISTER_TYPE_* to be an abstract
type that doesn't match the hardware description.  dump_instruction()
was using reg_encoding[] from brw_disasm.c, which no longer matches
(and was incorrect for Gen8+ anyway).

This patch introduces a new function to convert the abstract enum values
into the letter suffix we expect.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reported-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-02-05 21:07:48 -08:00
Chad Versace
1340e24406 egl/glx: Remove egl_glx driver
Mesa now has a real, feature-rich EGL implementation on X11 via xcb.
Therefore I believe there is no longer a practical need for the egl_glx
driver.

Furthermore, egl_glx appears to be unmaintained.  The most recent
nontrivial commit to egl_glx was 6baa5f1 on 2011-11-25.

Tested by running weston-smoke in windowed Weston on X with i965.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Kristian Høgsberg <krh@bitplanet.net>
2014-02-05 18:19:26 -08:00
Dave Airlie
0224bd20f3 docs: update 10.1 relnotes to note GL 3.3 on r600 and radeonsi.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-02-06 01:13:05 +00:00
Zack Rusin
8a3c990823 tgsi/ureg: increase the number of immediates
ureg_program is allocated on the heap so we can just bump the
number of immediates that it can handle. It's needed for d3d10.

Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-02-05 19:40:53 -05:00
Zack Rusin
efb152dd04 gallivm: make sure analysis works with large number of immediates
We need to handle a lot more immediates and in order to do that
we also switch from allocating this structure on the stack to
allocating it on the heap.

Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-02-05 19:40:53 -05:00
Zack Rusin
69ee3f431f gallivm: handle huge number of immediates
We only supported up to 256 immediates, which isn't enough. We had
code which was allocating immediates as an allocated array, but it
was always used along a statically backed array for performance
reasons. This commit adds code to skip that performance optimization
and always use just the dynamically allocated immediates if the
number of them is too great.

Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-02-05 19:40:53 -05:00
Zack Rusin
8507afc97f gallivm: allow large numbers of temporaries
The number of allowed temporaries increases almost with every
iteration of an api. We used to support 128, then we started
increasing and the newer api's support 4096+. So if we notice
that the number of temporaries is larger than our statically
allocated storage would allow we just treat them as indexable
temporaries and allocate them as an array from the start.

Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-02-05 19:40:53 -05:00
Chris Forbes
5eeb12c0bc i965/fs: Assume FBO rendering in precompile if MRT.
If multiple color outputs are written, this shader is unlikely to be
useful with a winsys framebuffer.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-02-06 10:58:52 +13:00
Chris Forbes
046f8d8a6f i965/fs: Guess nr_color_regions better in precompile
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-02-06 10:58:37 +13:00
Chris Forbes
6c9de691c7 docs: Add relnotes for 10.2
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
2014-02-06 10:28:36 +13:00
Chris Forbes
87e916a240 mesa: Bump version to 10.2.0-devel
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
2014-02-06 10:15:09 +13:00
Kristian Høgsberg
44338cd826 i965: Move intel_prepare_render() above first buffer access
The driver is supposed to ensure buffers before any drawing operation, but in
do_blit_drawpixels() and do_blit_copypixels() we inspect the buffer format
before calling intel_prepare_render().  That was covered up by the
unconditional call to intel_prepare_render() in intelMakeCurrent(), but we
now only do this on the initial intelMakeCurrent call for a context
(to get the size for the initial viewport values).

https://bugs.freedesktop.org/show_bug.cgi?id=74083

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Tested-by: Alexander Monakov <amonakov@gmail.com>
2014-02-05 11:10:39 -08:00
Brian Paul
db98d238e2 st/mesa: add MESA_SHADER_COMPUTE case in shader_stage_to_ptarget()
Silences compiler warning.  Trivial.
2014-02-05 11:00:41 -07:00
Brian Paul
357faa5a36 mesa: re-wrap, fix-up comment text in formats.h
Wrap to 78 columns, fix comment formatting.
Trivial.
2014-02-05 10:43:21 -07:00
Paul Berry
25268b930d i965/cs: Allow ARB_compute_shader to be enabled via env var.
This will allow testing of compute shader functionality before it is
completed.

To enable ARB_compute_shader functionality in the i965 driver, set
INTEL_COMPUTE_SHADER=1.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-02-05 09:14:16 -08:00
Paul Berry
3bbf93045a i965/cs: Create the brw_compute_program struct, and the code to initialize it.
v2: Fix comment.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-02-05 09:05:04 -08:00
Paul Berry
1fe274b3d7 glsl/cs: Prohibit mixing of compute and non-compute shaders.
Fixes piglit test:
spec/ARB_compute_shader/linker/mix_compute_and_non_compute

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-02-05 09:05:01 -08:00
Paul Berry
5a79bdab30 glsl/cs: Prohibit user-defined ins/outs in compute shaders.
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-02-05 09:04:58 -08:00
Paul Berry
f5c5438e1f main/cs: Implement query for COMPUTE_WORK_GROUP_SIZE.
v2: Improve error message.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-02-05 09:04:55 -08:00
Paul Berry
28ce604b7f mesa/cs: Handle compute shader local size during linking.
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-02-05 09:04:20 -08:00
Paul Berry
0fa74e848f glsl/cs: Handle compute shader local_size_{x,y,z} declaration.
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-02-05 09:03:44 -08:00
Paul Berry
0398b69954 mesa/cs: Implement MAX_COMPUTE_WORK_GROUP_COUNT constant.
v2: Document that the 3-element array MaxComputeWorkGroupCount is
indexed by dimension.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-02-05 09:03:08 -08:00
Paul Berry
c85c50997f mesa/cs: Implement MAX_COMPUTE_WORK_GROUP_INVOCATIONS constant.
Reviewed-by: Matt Turner <mattst88@gmail.com>

v2: Use CONTEXT_INT rather than CONTEXT_ENUM.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-02-05 09:02:30 -08:00
Paul Berry
347dde82e6 mesa/cs: Implement MAX_COMPUTE_WORK_GROUP_SIZE constant.
v2: Document that the 3-element array MaxComputeWorkGroupSize is
indexed by dimension.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-02-05 09:01:54 -08:00
Paul Berry
47d480e3e4 mesa/cs: Create the gl_compute_program struct, and the code to initialize it.
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-02-05 09:01:18 -08:00
Paul Berry
9b34ae2e64 mesa/cs: Handle compute shaders in _mesa_use_program().
v2: do cs after the ordered pipeline stages for consistency.

Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-02-05 09:01:16 -08:00
Paul Berry
c15064c169 glsl/cs: update main.cpp to use the ".comp" extension for compute shaders.
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-02-05 09:01:13 -08:00
Paul Berry
d861c2963a glsl/cs: Populate default values for ctx->Const.Program[MESA_SHADER_COMPUTE].
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-02-05 09:01:10 -08:00
Paul Berry
c61ec8d8e3 mesa/cs: Add a MESA_SHADER_COMPUTE stage and update switch statements.
This patch adds MESA_SHADER_COMPUTE to the gl_shader_stage enum.
Also, where it is trivial to do so, it adds a compute shader case to
switch statements that switch based on the type of shader.  This
avoids "unhandled switch case" compiler warnings.

Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-02-05 09:00:34 -08:00
Paul Berry
28e526d558 glsl/cs: Change some linker loops to use MESA_SHADER_FRAGMENT as a bound.
Linker loops that iterate through all the stages in the pipeline need
to use MESA_SHADER_FRAGMENT as a bound, so that we can add an
additional MESA_SHADER_COMPUTE stage, without it being erroneously
included in the pipeline.

Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-02-05 09:00:31 -08:00
Paul Berry
79134cb516 mesa/cs: Add dispatch API stubs for ARB_compute_shader.
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-02-05 09:00:14 -08:00
Paul Berry
b7d05a58ae mesa/cs: Add extension enable flags for ARB_compute_shader.
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-02-05 08:59:37 -08:00
Roland Scheidegger
4a7da3bec5 gallivm: fix F2U opcode
Previously, we were really doing F2I. And also move it to generic section.
(Note that for llvmpipe the code generated is definitely bad, due to lack
of unsigned conversions with sse. I think though what llvm does (using scalar
conversions to 64bit signed either with x87 fpu (32bit) or sse (64bit)
including lots of domain changes is quite suboptimal, could do something like
is_large = arg >= 2^31
half_arg = 0.5 * arg
small_c = fptoint(arg)
large_c = fptoint(half_arg) << 1
res = select(is_large, large_c, small_c)
which should be much less instructions but that's something llvm should do
itself.)

This fixes piglit fs/vs-float-uint-conversion.shader_test (maybe more, needs
GL 3.0 version override to run.)

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Zack Rusin <zackr@vmware.com>
2014-02-05 17:45:31 +01:00
José Fonseca
5c975966dc tools/trace: Handle index buffer overflow gracefully.
Trivial.
2014-02-05 10:58:38 +00:00
Dave Airlie
16215a9723 docs/GL3.txt: update r600 status
This updates the r600 driver status to 3.3 being fully supported.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-02-05 10:56:58 +10:00
Dave Airlie
79ea0f4506 r600g: add support for geom shaders to r600/r700 chipsets (v2)
This is my first attempt at enabling r600/r700 geometry shaders,
the basic tests pass on both my rv770 and my rv635,

It requires this kernel patch:
http://www.spinics.net/lists/dri-devel/msg52745.html

v2: address Alex comments.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2014-02-05 10:49:43 +10:00
Dave Airlie
ccea799ee3 r600g: enable GLSL 3.30 on evergreen GPUs
This throws the switch to enable GL 3.3 and GLSL 330.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2014-02-05 10:49:43 +10:00
Dave Airlie
c6cfc54db0 r600g: properly propogate clip dist write value
This moves the value from the GS shader to the copy shader so the registers
are setup correctly.

fixes tests/spec/glsl-1.50/execution/geometry/clip-distance-out-values.shader_test

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2014-02-05 10:49:43 +10:00
Dave Airlie
b209afb153 r600g: calculate a better value for array_size (v2)
attempt to calculate a better value for array size to avoid breaking apps.

v2: use 0xfff like streamout, suggested by Grigori

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2014-02-05 10:49:42 +10:00
Dave Airlie
ce9e939144 r600g: fix CAYMAN geometry shader support
cayman has a different end of program bit, so do that properly.

fixes hangs with geom shader tests on cayman.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2014-02-05 10:49:42 +10:00
Dave Airlie
7ec5e883f2 r600g: fix up shader out misc stuff for copy shader
set the correct values so the misc out register is setup correctly
for the copy shader.

This also updates the state for the gs copy shader so the hw
gets programmed correctly.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2014-02-05 10:49:42 +10:00
Dave Airlie
7863611de3 r600g: port the layered surface rendering patch from radeonsi
This just makes r600 and evergreen do what the radeonsi codepaths do
for layered rendering. This makes the 2d amd_vertex_shader_layer test
pass on evergreen.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2014-02-05 10:49:41 +10:00
Dave Airlie
f89394be98 r600g: initial VS output layer support
This just adds support for emitting the proper value in the VS out misc.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2014-02-05 10:49:41 +10:00
Dave Airlie
5191937352 r600g: setup const texture buffers for geom shaders
This just enables the workarounds we have for vertex/pixel shaders
for geom shaders as well.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2014-02-05 10:49:41 +10:00
Dave Airlie
afce47fb0b r600g: calculate correct cut value
This selects the cut value depending on the shader selected.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2014-02-05 10:49:41 +10:00
Dave Airlie
0d79d5da40 r600g: fix dynamic_input_array_index.shader_test
This follows what fglrx does, it unpacks the input we are
going to indirect into a bunch of registers and indirects
inside them.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2014-02-05 10:49:40 +10:00
Dave Airlie
e12147e9f6 r600g: add support for indirect geom ring writes
We need to be able to write to the ring using a base register
for when we emit vertices in a loop, in theory the SB compiler
could collapse these indirect writes to direct writes if the
register value is constant and known, but that is outside my
pay grade.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2014-02-05 10:49:40 +10:00
Dave Airlie
cda63db780 r600g: write proper output prim type
Vadim's code derived it from the info.mode, but it needs
to be takes from the geometry shader output primitive.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2014-02-05 10:49:40 +10:00
Dave Airlie
2b0be2015d r600g: enable instance cnt register with new enough kernel
The instance cnt register was missing for a few kernels,
with a new enough kernel we can output it.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2014-02-05 10:49:39 +10:00
Dave Airlie
f4652babbd r600g: add primitive input support for gs
only enable prim id if gs uses it

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2014-02-05 10:49:39 +10:00
Dave Airlie
b0e842bd9f r600g: emit streamout from dma copy shader
This enables streamout with GS in the mix, from the
VS dma shader.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2014-02-05 10:49:39 +10:00
Dave Airlie
20adc7449c r600g/gs: fix cases where number of gs inputs != number of gs outputs
this fixes a bunch of the geom shader built-in tests

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2014-02-05 10:49:39 +10:00
Dave Airlie
defebc0293 r600g: increase array base for exported parameters
Trivial fix to Vadim's code.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2014-02-05 10:49:38 +10:00
Dave Airlie
d9954e402f r600g: initialise the geom shader loop registers.
As we do for vertex and pixel shaders.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2014-02-05 10:49:38 +10:00
Dave Airlie
461c463bb2 r600g: emit NOPs at end of shaders in more cases
If the shader has no CF clauses at all emit an nop
If the last instruction is an ENDLOOP add a NOP for the LOOP to go to
if the last instruction is CALL_FS add a NOP

These fix a bunch of hangs in the geometry shader tests.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2014-02-05 10:49:38 +10:00
Dave Airlie
c4782a58c3 r600g: don't enable SB for geom shaders
SB needs fixes for three GS instructions it seems to raise
them outside loops etc despite my best efforts.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2014-02-05 10:49:37 +10:00
Dave Airlie
5758a76d04 r600g/sb: add MEM_RING support
Although we don't use SB on geom shaders, the VS copy shader will use it
so we might as well implement MEM_RING support in sb.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2014-02-05 10:49:37 +10:00
Dave Airlie
eeead9b8ed r600g: don't fail if we can't map VS->GS ring entries
This can happen in normal operation, so don't report an error on it,
just continue.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2014-02-05 10:49:37 +10:00
Vadim Girlin
1371d65a7f r600g: initial support for geometry shaders on evergreen (v2)
This is Vadim's initial work with a few regression fixes squashed in.

v2: (airlied)
fix regression in glsl-max-varyings - need to use vs and ps_dirty
fix regression in shader exports from rebasing.
whitespace fixing.
v2.1: squash fix assert

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2014-02-05 10:49:11 +10:00
Vadim Girlin
34ee1d0f9f r600g: add hw register definitions for GS block setup
Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2014-02-05 10:40:42 +10:00
Vadim Girlin
a144bc29b5 r600g: defer shader variant selection and depending state updates
[airlied: fix dropped streamout line - fix for master]

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2014-02-05 10:40:38 +10:00
Dave Airlie
ae29a098ea r600g/bc: add support for indexed memory writes.
It looks like we need these for geom shaders in the future.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2014-02-05 10:40:33 +10:00
Vadim Girlin
552aae7e47 r600g: move barrier and end_of_program bits from output to cf struct (v2)
v2: fix regression on r600 NOP instructions.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-02-05 10:40:23 +10:00
Dave Airlie
29a43cb0b6 r600g: split streamout emit code into a separate function
For geometry shaders we need to call this code from a second place.

Just move it out for now to keep future patches cleaner.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-02-05 10:40:17 +10:00
Marek Olšák
07075cf350 r600g,radeonsi: skip unnecessary buffer_is_busy call, add a comment 2014-02-04 20:19:16 +01:00
Marek Olšák
08f0344cf3 r600g,radeonsi: skip busy-checking for DISCARD_RANGE if it has been done already 2014-02-04 20:19:16 +01:00
Marek Olšák
796e2fba8c r600g,radeonsi: treat DYNAMIC and STREAM usage as STAGING 2014-02-04 20:19:16 +01:00
Marek Olšák
0354b769c2 gallium: remove PIPE_CAP_MAX_COMBINED_SAMPLERS
This can be derived from the shader caps.

All GPUs from ATI/AMD, NVIDIA, and INTEL have separate texture slots
for each shader stage.
2014-02-04 20:19:16 +01:00
Brian Paul
82c0914266 mesa: remove stray bits of GL_EXT_cull_vertex
GL_EXT_cull_vertex was removed back in 2010 in commit 02984e3536
but these bits still lingered.

Reviewed-by: Eric Anholt <eric@anholt.net>
2014-02-04 11:53:21 -07:00
Paul Berry
7f5740899f glsl: Fix continue statements in do-while loops.
From the GLSL 4.40 spec, section 6.4 (Jumps):

    The continue jump is used only in loops. It skips the remainder of
    the body of the inner most loop of which it is inside. For while
    and do-while loops, this jump is to the next evaluation of the
    loop condition-expression from which the loop continues as
    previously defined.

Previously, we incorrectly treated a "continue" statement as jumping
to the top of a do-while loop.

This patch fixes the problem by replicating the loop condition when
converting the "continue" statement to IR.  (We already do a similar
thing in "for" loops, to ensure that "continue" causes the loop
expression to be executed).

Fixes piglit tests:
- glsl-fs-continue-inside-do-while.shader_test
- glsl-vs-continue-inside-do-while.shader_test
- glsl-fs-continue-in-switch-in-do-while.shader_test
- glsl-vs-continue-in-switch-in-do-while.shader_test

Cc: mesa-stable@lists.freedesktop.org

Acked-by: Carl Worth <cworth@cworth.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-02-04 09:06:09 -08:00
Paul Berry
56790856b3 glsl: Make condition_to_hir() callable from outside ast_iteration_statement.
In addition to making it public, we also need to change its first
argument from an ir_loop * to an exec_list *, so that it can be used
to insert the condition anywhere in the IR (rather than just in the
body of the loop).

This will be necessary in order to make continue statements work
properly in do-while loops.

Cc: mesa-stable@lists.freedesktop.org

Acked-by: Carl Worth <cworth@cworth.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-02-04 09:06:09 -08:00
Topi Pohjolainen
933be19cdf i965/blorp: do not use unnecessary hw-blending support
This is really not needed as blorp blit programs already sample
XRGB normally and get alpha channel set to 1.0 automatically by
the sampler engine. This is simply copied directly to the payload
of the render target write message and hence there is no need for
any additional blending support from the pixel processing pipeline.

The blending formula is anyway broken for color components, it
multiplies the color component with itself (blend factor is the
component itself).
Alpha blending in turn would not fix the alpha to one independent
of the source but simply used the source alpha as is instead
(1.0 * src_alpha + 0.0 * dst_alpha).

Quoting Eric:

 "If we want to actually make the no-alpha-bits-present thing work,
  we need to override the bits in the surface state or in the
  generated code.  In the normal draw path, it's done for sampling
  by the swizzling code in brw_wm_surface_state.c, and the blending
  overrides is just to fix up the alpha blending stage which
  doesn't pay attention to that for the destination surface."

If one modifies piglit test gl-3.2-layered-rendering-blit to use
color component values other than zero or one, this change will
kick in on IVB. No regressions on IVB.

This is effectively revert of c0554141a9:

    i965/blorp: Support overriding destination alpha to 1.0.

    Currently, Blorp requires the source and destination formats to be
    equal.  However, we'd really like to be able to blit between XRGB and
    ARGB formats; our BLT engine paths have supported this for a long time.

    For ARGB -> XRGB, nothing needs to occur: the missing alpha is already
    interpreted as 1.0.  For XRGB -> ARGB, we need to smash the alpha
    channel to 1.0 when writing the destination colors.  This is fairly
    straightforward with blending.

    For now, this code is never used, as the source and destination formats
    still must be equal.  The next patch will relax that restriction.

    NOTE: This is a candidate for the 9.1 branch.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-02-04 16:39:23 +02:00
Christian König
c3c24c3acc radeon/uvd: fix feedback buffer handling v2
Without the correct feedback buffer size UVD runs
into an error on each frame, reducing the maximum FPS.

v2: fixing Michels comments

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Cc: "10.1" "10.0" "9.2" <mesa-stable@lists.freedesktop.org>
2014-02-04 13:10:50 +01:00
Kenneth Graunke
adaa5a6ca6 i965: Use brw_bo_map[_gtt]() in intel_miptree_map_raw().
This moves the intel_batchbuffer_flush before the drm_intel_bo_busy
call, which is a change in behavior.  However, the old behavior was
broken.

In the future, we may want to only flush in the batchbuffer references
the BO being mapped.  That's certainly more typical.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Carl Worth <cworth@cworth.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-02-03 16:16:38 -08:00
Kenneth Graunke
e396674d5f i965: Use brw_bo_map() in intel_texsubimage_tiled_memcpy().
This additionally measures the time stalled, while also simplifying the
code.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Carl Worth <cworth@cworth.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-02-03 16:16:35 -08:00
Kenneth Graunke
d613bafe91 i965: Create drm_intel_bo_map wrappers with performance warnings.
Mapping a buffer is a common place where we could stall the CPU.

In a few places, we've added special code to check whether a buffer is
busy and log the stall as a performance warning.  Most of these give no
indication of the severity of the stall, though, since measuring the
time is a small hassle.

This patch introduces a new brw_bo_map() function which wraps
drm_intel_bo_map, but additionally measures the time stalled and reports
a performance warning.  If performance debugging is not enabled, it
simply maps the buffer with negligable overhead.

We also add a similar wrapper for drm_intel_gem_bo_map_gtt().

This should make it easy to add performance warnings in lots of places.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Carl Worth <cworth@cworth.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-02-03 16:16:26 -08:00
Rob Clark
1b886078db freedreno: enabling binning and opt by default
Hw binning pass doesn't seem to have broken anything.  And optimizing
compiler fixes a lot of shaders and doesn't seem to break anything.  So
re-org slightly FD_MESA_DEBUG params and make both hw binning and
optimizer enabled by default.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-02-03 18:26:53 -05:00
Rob Clark
554f1ac00c freedreno/a3xx/compiler: new compiler
The new compiler generates a dependency graph of instructions, including
a few meta-instructions to handle PHI and preserve some extra
information needed for register assignment, etc.

The depth pass assigned a weight/depth to each node (based on sum of
instruction cycles of a given node and all it's dependent nodes), which
is used to schedule instructions.  The scheduling takes into account the
minimum number of cycles/slots between dependent instructions, etc.
Which was something that could not be handled properly with the original
compiler (which was more of a naive TGSI translator than an actual
compiler).

The register assignment is currently split out as a standalone pass.  I
expect that it will be replaced at some point, once I figure out what to
do about relative addressing (which is currently the only thing that
should cause fallback to old compiler).

There are a couple new debug options for FD_MESA_DEBUG env var:

  optmsgs - enable debug prints in optimizer
  optdump - dump instruction graph in .dot format, for example:

http://people.freedesktop.org/~robclark/a3xx/frag-0000.dot.png
http://people.freedesktop.org/~robclark/a3xx/frag-0000.dot

At this point, thanks to proper handling of instruction scheduling, the
new compiler fixes a lot of things that were broken before, and does not
appear to break anything that was working before[1].  So even though it
is not finished, it seems useful to merge it in it's current state.

[1] Not merged in this commit, because I'm not sure if it really belongs
in mesa tree, but the following commit implements a simple shader
emulator, which I've used to compare the output of the new compiler to
the original compiler (ie. run it on all the TGSI shaders dumped out via
ST_DEBUG=tgsi with various games/apps):

163b6306b1

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-02-03 18:26:53 -05:00
Rob Clark
f0e2d7ab46 freedreno/a3xx/compiler: split out old compiler
For the time being, keep old compiler as fallback for things that the
new compiler does not support yet.  Split out as it's own commit to make
the later new-compiler commits easier to follow.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-02-03 18:26:53 -05:00
Rob Clark
a418573c4d freedreno/a3xx/compiler: prepare for new compiler
Shuffle things around to prepare for new compiler.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-02-03 18:26:53 -05:00
Rob Clark
f08d2b1c0f freedreno/a3xx: remove useless reg tracking in disasm-a3xx
Not really used for anything anymore.  So strip it out and avoid
conflicting symbols with upcoming new-compiler.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-02-03 18:26:53 -05:00
Carl Worth
1597788d12 docs: Add release notes for 10.0.3
Which was just made.
2014-02-03 13:55:24 -08:00
Brian Paul
fc3fcd1e01 draw: fix incorrect color of flat-shaded clipped lines
When we clipped a line weren't copying the provoking vertex
color to the second vertex.  We also weren't checking for
first vs. last provoking vertex.

Fixes failures found with the new piglit line-flat-clip-color test.

Cc: "10.0, 10.1" <mesa-stable@lists.freedesktop.org>

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2014-02-03 12:50:04 -07:00
Brian Paul
349b76a553 mesa: change GL_ALL_ATTRIB_BITS to 0xFFFFFFFF
This has been wrong for many years.  It was originally 0x000FFFFF and long
ago there was discussion about whether GL_ALL_ATTRIB_BITS should include
the then-new GL_MULTISAMPLE_BIT bit.  Eventually the ARB decided that
glPushAttrib(GL_ALL_ATTRIB_BITS) should save all current and future
attribute groups (hence ~0).  Unfortunately, Mesa's gl.h was never updated.

This was just recently spotted by Eric Anholt and reported as a bug to the
ARB.  Ian, Jon Leech and I discussed it at the ARB meeting and decided to
change Mesa's value to reflect the ARB's decision.

Acked-by: Eric Anholt <eric@anholt.net>
2014-02-03 12:50:03 -07:00
Brian Paul
307fd76053 gallium/auxiliary/indices: replace free() with FREE()
To match the CALLOC_STRUCT() call.

Cc: "10.0, 10.1" <mesa-stable@lists.freedesktop.org>

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2014-02-03 12:49:55 -07:00
Brian Paul
97fdace6d7 svga: check shader size against max command buffer size
If the shader is too large, plug in a dummy shader.  This patch also
reworks the existing dummy shader code.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2014-02-03 12:40:13 -07:00
Brian Paul
4686f610b1 svga: refactor some shader code
Put common code in new svga_shader.c file.  Considate separate vertex/
fragment shader ID generation.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2014-02-03 12:40:13 -07:00
Zack Rusin
9bace99d77 gallivm: fix opcode and function nesting
gallivm soa code supported only a single level of nesting for
control flow opcodes (if, switch, loops...) but the d3d10 spec
clearly states that those are nested within functions. To support
nesting of conditionals inside functions we need to store the
nesting data inside function contexts and keep a stack of those.
Furthermore we make sure that if nesting for subroutines is deeper
than 32 then we simply ignore all subsequent 'call' invocations.

Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-02-03 13:29:14 -05:00
Kenneth Graunke
595bcf38a6 mesa: Drop unnecessary (void) ctx from VAO code.
ctx is always used, even on release builds.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-02-03 00:53:16 -08:00
Kenneth Graunke
4323b92479 mesa: Remove "APPLE" from some VAO error messages.
Chances are, people will be using the core names these days.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-02-03 00:53:15 -08:00
Kenneth Graunke
cf62e59673 mesa: Update some comments relating to VAOs.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-02-03 00:53:13 -08:00
Kenneth Graunke
e1b1f2a687 mesa: Rename ElementArrayBufferObj to IndexBufferObj.
DirectX and most hardware documentation use the term "Index Buffer" to
refer to a buffer containing indexes into arrays of vertex data, which
allows random access to vertex data, rather than sequential access.

OpenGL uses a different term for this concept: "Element Array Buffer".
However, "Index Buffer" has become much more widespread.  A quick
Google search shows 29,300 hits for "Element Array Buffer" vs.
82,300 hits for "Index Buffer."

Arguably, "Index Buffer" is clearer: an "element of an array" (or list)
usually refers to an actual item stored in the array, not the index used
to refer to it.

The terminology is also already used in Mesa: some VBO module code for
dealing with ElementArrayBufferObj names local variables "ib".

Completely generated by:
$ find . -type f -print0 | xargs -0 sed -i \
  's/ElementArrayBufferObj/IndexBufferObj/g'

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-02-03 00:53:11 -08:00
Kenneth Graunke
0354e50798 mesa: Rename _mesa_lookup_arrayobj to _mesa_lookup_vao.
For consistency with the previous renames.

Completely generated by:
$ find . -type f -print0 | xargs -0 sed -i \
  's/_mesa_lookup_arrayobj/_mesa_lookup_vao/g'

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-02-03 00:53:09 -08:00
Kenneth Graunke
de47fd2668 mesa: Rename _mesa_..._array_obj functions to _mesa_..._vao.
_mesa_update_vao_client_arrays() is less of a mouthful than
_mesa_update_array_object_client_arrays(), and generally clearer.

Generated by:
$ find . -type f -print0 | xargs -0 sed -i \
  's/_mesa_\([^_]*\)_array_object/_mesa_\1_vao/g'
with manual whitespace and indentation fixes applied.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-02-03 00:53:07 -08:00
Kenneth Graunke
aac1415b66 mesa: Rename "struct gl_array_object" to gl_vertex_array_object.
I considered replacing it with "gl_vao", but spelling it out seemed to
fit better with Mesa's traditional style.  Mesa doesn't shy away from
long type names - consider gl_transform_feedback_object,
gl_fragment_program_state, gl_uniform_buffer_binding, and so on.

Completely generated by:
$ find . -type f -print0 | xargs -0 sed -i \
  's/gl_array_object/gl_vertex_array_object/g'

v2: Rerun command to resolve conflicts with Ian's meta patches.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-02-03 00:53:05 -08:00
Kenneth Graunke
94e07c1960 mesa: Rename "arrayObj" local variables to "vao".
Now that the field is named "VAO" instead of "ArrayObj", it makes sense
to call the local variables "vao" instead of "arrayObj".

Completely generated by:
$ find . -type f -print0 | xargs 0 sed -i 's/arrayObj/vao/g'

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-02-03 00:53:02 -08:00
Kenneth Graunke
0dfe50f1a6 mesa: Rename ArrayObj to VAO and DefaultArrayObj to DefaultVAO.
When reading through the Mesa drawing code, it's not immediately obvious
to me that "ArrayObj" (gl_array_object) is the Vertex Array Object (VAO)
state.  The comment above the structure explains this, but readers still
have to remember this and translate accordingly.

Out of context, "array object" is a fairly vague.  Even in context,
"array" has a lot of meanings: glDrawArrays, vertex data stored in user
arrays, gl_client_arrays, gl_vertex_attrib_arrays, and so on.

Using the term "VAO" immediately associates these fields with the OpenGL
concept, clarifying the situation and aiding programmer sanity.

Completely generated by:
$ find . -type f -print0 | xargs -0 sed -i \
  -e 's/ArrayObj;/VAO;/g'                  \
  -e 's/->ArrayObj/->VAO/g'                \
  -e 's/Array\.ArrayObj/Array.VAO/g'       \
  -e 's/Array\.DefaultArrayObj/Array.DefaultVAO/g'

v2: Rerun command to resolve conflicts with Ian's meta patches.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-02-03 00:52:58 -08:00
Ian Romanick
81144c049b meta: Silence several 'unused parameter' warnings
Silences many GCC warnings of the form:

drivers/common/meta.c: In function 'cleanup_temp_texture':
drivers/common/meta.c:1208:41: warning: unused parameter 'ctx' [-Wunused-parameter]
drivers/common/meta.c: In function 'setup_ff_blit_framebuffer':
drivers/common/meta.c:1453:46: warning: unused parameter 'ctx' [-Wunused-parameter]
drivers/common/meta.c: In function 'meta_glsl_blit_cleanup':
drivers/common/meta.c:1998:43: warning: unused parameter 'ctx' [-Wunused-parameter]
drivers/common/meta.c: In function 'meta_glsl_clear_cleanup':
drivers/common/meta.c:2287:44: warning: unused parameter 'ctx' [-Wunused-parameter]
drivers/common/meta.c: In function 'setup_ff_generate_mipmap':
drivers/common/meta.c:3365:45: warning: unused parameter 'ctx' [-Wunused-parameter]
drivers/common/meta.c: In function 'meta_glsl_generate_mipmap_cleanup':
drivers/common/meta.c:3556:54: warning: unused parameter 'ctx' [-Wunused-parameter]

There are a couple other similar warnings, but they are less trivial.  I
want to investigate these further before axing them.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-02-02 16:49:09 +01:00
Ian Romanick
2bf4db1697 meta: Don't use fixed-function to decompress array textures
Array textures can't be used with fixed-function, so don't.  Instead,
just drop the decompress request on the floor.  This is no worse than
what was done previously because generating the GL error (in
_mesa_set_enable) broke everything anyway.

A later patch will get GL_TEXTURE_2D_ARRAY targets working.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-02-02 16:49:09 +01:00
Ian Romanick
eb65d4b84d meta: Use NDC in decompress_texture_image
There is no need to use pixel coordinates, and using NDC directly will
simplify the GLSL paths.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-02-02 16:49:09 +01:00
Ian Romanick
abfa65ca81 meta: Consistenly use non-Apple VAO functions
For these objects, meta was already using the non-Apple function to
delete the objects.  Everywhere else in the file uses
_mesa_GenVertexArrays and _mesa_BindVertexArrays.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Cc: "9.1 9.2 10.0" <mesa-stable@lists.freedesktop.org>
2014-02-02 16:49:09 +01:00
Ian Romanick
070f55d893 meta: Fallback to software for GetTexImage of compressed GL_TEXTURE_CUBE_MAP_ARRAY
The hardware decompression path isn't even close to being able to handle
this.  This converts the crash (assertion failure) in
"EXT_texture_compression_s3tc/getteximage-targets S3TC CUBE_ARRAY" to a
plain old failure.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Cc: "9.1 9.2 10.0" <mesa-stable@lists.freedesktop.org>
2014-02-02 16:49:09 +01:00
Ian Romanick
fcb498302b meta: Release resources used by _mesa_meta_DrawPixels
_mesa_meta_DrawPixels creates a VAO and (potentially) two fragment
programs, but none of them are ever released.  Leaking piles of memory
is generally frowned upon.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Cc: "9.1 9.2 10.0" <mesa-stable@lists.freedesktop.org>
2014-02-02 16:49:08 +01:00
Ian Romanick
2d3f92e881 meta: Release resources used by decompress_texture_image
decompress_texture_image creates an FBO, an RBO, a VBO, a VAO, and a
sampler object, but none of them are ever released.  Later patches will
add program objects, exacerbating the problem.  Leaking piles of memory
is generally frowned upon.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Cc: "9.1 9.2 10.0" <mesa-stable@lists.freedesktop.org>
2014-02-02 16:49:08 +01:00
Ian Romanick
a722454dac mesa: Use common _mesa_tex_target_to_index in tex param code
TEXTURE_BUFFER_INDEX has to be specially called out because it is not
allowed in any of the glTexParameter or glGetTexParameter functions.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-02-02 16:49:08 +01:00
Ian Romanick
35e7027dab mesa: Make target_enum_to_index available outside texobj.c
The next patch will use this function in another file.

v2: Rename _mesa_target_enum_to_index to _mesa_tex_target_to_index.
Suggested by Brian.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-02-02 16:49:08 +01:00
Brian Paul
9451281aca mesa: make several FBO functions static
The four functions in question weren't called from any other file.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-02-02 06:52:38 -07:00
Brian Paul
3abd4f4d90 mesa: move glGenerateMipmap() code into new genmipmap.c file
Mipmap generation has nothing to do with FBOs.
v2: update gl_genexec.py too (not api_exec.c)

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2014-02-02 06:52:37 -07:00
Brian Paul
bfcb9bb204 mesa: move glBlitFramebuffer code into new blit.c file
Just for better organization.
v2: update gl_genexec.py too (not api_exec.c)

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2014-02-02 06:52:37 -07:00
Brian Paul
20fedfd80a mesa: don't signal _NEW_TEXTURE in TexSubImage() functions
glTexSubImage(), glCopyTexSubImage() and glCompressedTexSubImage()
only change the texel data, not other state like texture size or format.
If a driver really needs do something special it can hook into the
corresponding driver functions or Map/UnmapTextureImage().

This should avoid some needless state validation effort.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-02-02 06:52:37 -07:00
Brian Paul
c55e3e6811 mesa: add some comments about mipmap generation
Trivial.
2014-02-02 06:52:37 -07:00
Brian Paul
e286b63c8f mesa: simplify comment in texstorage.c
Trivial.
2014-02-02 06:52:37 -07:00
Brian Paul
8b3e383820 mesa: formatting fixes, 78-column wrappings in dd.h
Trivial.
2014-02-02 06:52:37 -07:00
Brian Paul
deb9dd6e27 mesa: remove target param from ctx->Driver.TexParameter()
Not really used anywhere.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-02-02 06:52:37 -07:00
Brian Paul
c20b48c48e gallivm: add a few const qualifiers
Trivial.
2014-02-02 06:52:36 -07:00
Brian Paul
c6d94648cf translate: reindent translate_sse.c
Trivial.
2014-02-02 06:52:36 -07:00
Brian Paul
8689076925 mesa: make _mesa_get_proxy_target() static
Wasn't used in any other file.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-02-02 06:47:32 -07:00
Brian Paul
9eaed3eb6e mesa: remove unused _mesa_select_tex_object() function
The _mesa_get_current_tex_object() function is now used everywhere that
_mesa_select_tex_object() was formerly used.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-02-02 06:47:32 -07:00
Brian Paul
d5df28381e swrast: use _mesa_get_current_tex_object() in swrastSetTexBuffer2()
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-02-02 06:47:32 -07:00
Brian Paul
ed72115891 st/mesa: use _mesa_get_current_tex_object() in st_context_teximage()
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-02-02 06:47:32 -07:00
Brian Paul
f09a1261ad mesa: use _mesa_get_current_tex_object() in GetTexLevelParameteriv()
And update a related comment.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-02-02 06:47:32 -07:00
Brian Paul
8b4f6fada2 radeon: use _mesa_get_current_tex_object() in radeonSetTexBuffer2()
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-02-02 06:47:32 -07:00
Brian Paul
76c33e383c r200: use _mesa_get_current_tex_object() in r200SetTexBuffer2()
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-02-02 06:47:32 -07:00
Paul Seidler
1cdeeef6c4 build: move ARCH_LIBS definition outside of ASM definition
_mesa_streaming_load_memcpy is also needed even if assembling is disabled

Cc: "10.0" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-02-01 15:01:06 -08:00
Eric Anholt
c849ecc19a dri: Add a useful error message if someone's packages missed libudev deps.
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-02-01 10:09:11 -08:00
Eric Anholt
63546b8e3d dri: Also support the loader with libudev.so.0.
As far as I know, this should be safe.  If not, we have to decide whether
to have variable lookup of the functions, or just drop support for .so.0
(which is a year and a half old it looks like)

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=74127
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-02-01 10:08:36 -08:00
Rob Clark
dc00ec154b freedreno: better manage our WFI's
Updates to non-banked registers, CP_LOAD_STATE, etc, need a WFI if there
is potentially pending rendering.  Track this better, and add fd_wfi()
calls everywhere that might potentially need CP_WAIT_FOR_IDLE.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-02-01 12:10:17 -05:00
Rob Clark
1fe9df8f29 freedreno/a3xx: add logicop
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-02-01 11:59:25 -05:00
Rob Clark
8d27be2633 freedreno/a3xx: handle frag z write
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-02-01 11:58:47 -05:00
Rob Clark
083b27a1b1 freedreno: resync generated headers
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-02-01 11:57:39 -05:00
Rob Clark
98c1111462 freedreno/a3xx: fix const confusion
Gallium can leave const buffers bound above what is used by the current
shader.  Which can have a couple bad effects:

1) write beyond const space assigned, which can trigger HLSQ lockup
2) double emit of immed consts, first with bound const buffer vals
followed by with actual immed vals.  This seems to be a sort of
undefined condition.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-02-01 11:57:09 -05:00
Rob Clark
5c6961efae freedreno/a3xx/compiler: compiler cleanups
Drop color/pos/psize_regid, plus a few compiler and IR cleanups.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-02-01 11:53:21 -05:00
Rob Clark
69eca28dd0 freedreno/compiler/a3xx: remove lowered instructions
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-02-01 11:52:27 -05:00
Rob Clark
0f2df4ff90 freedreno: add tgsi lowering pass
Currently lowers the following instructions:

   DST, XPD, SCS, LRP, FRC, POW, LIT, EXP, LOG, DP4,
   DP3, DPH, DP2

translating these into equivalent simpler TGSI instructions.

This probably should be moved to util so other drivers can use
it, but just adding under freedreno for now so that I can clear
out a lot of the lowering code in a3xx compiler before beginning
to add new compiler.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-02-01 11:50:10 -05:00
Rob Clark
7524756199 freedreno/a3xx/compiler: add CLAMP
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-02-01 11:49:31 -05:00
Rob Clark
fafe16a8a0 freedreno/a3xx/compiler: various fixes
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-02-01 11:49:06 -05:00
Rob Clark
4971628bae freedreno: ctx should hold ref to dev
The ctx should hold ref to dev to avoid problems if screen is destroyed
before ctx.  Doesn't really fix the egl/glx issues, but at least it
prevents things from getting much worse.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-02-01 11:47:08 -05:00
Rob Clark
303df12db8 freedreno: add prims-emitted driver query
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-02-01 11:45:19 -05:00
Kenneth Graunke
80bf1fbaf6 i965: Silence unused variable 'ctx' warning.
Somehow I missed this before pushing the Broadwell PS state upload code.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2014-01-31 21:40:27 -08:00
Kenneth Graunke
e1cdafe6f7 i965: Fix math instruction hstride assertions on Broadwell.
In the final revision of my gen8_generator patch, I updated the MATH
instruction's assertion from (dst.hstride == 1) to check that source and
destination hstride matched.  Unfortunately, I didn't test this enough,
and many Piglit tests fail this test.

The documentation indicates that "scalar source is also supported",
which we believe means <0,1,0> access mode (hstride == 0).  If hstride
is non-zero, then it must match the destination register.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-01-31 17:50:09 -08:00
Kenneth Graunke
d8878055f5 i965: Add (disabled) Broadwell PCI IDs.
This puts the PCI IDs in place so it's easy to enable support.  However,
it doesn't actually enable support since it's very preliminary still,
and a few crucial pieces (such as BLORP) are still missing.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Eric Anholt <eric@anholt.net>
2014-01-31 17:50:08 -08:00
Kenneth Graunke
3ade766684 i965: Disable 3DSTATE_WM_HZ_OP fields.
Eric believes this to be wrong and unnecessary, as the command is
supposed to emit an implicit rectangle primitive.  However, empirically
the pixel pipeline is completely unreliable without it.  So for now, it
stays until someone comes up with a better solution.

We'll need to do better than this when we implement multisampling, HiZ,
or fast clears...but for now, this will do.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Eric Anholt <eric@anholt.net>
2014-01-31 17:50:08 -08:00
Kenneth Graunke
4c4e0ed64b i965: Update GS state for Broadwell.
This is quite similar to the Gen7 code.  The main changes:
 - 48-bit relocations
 - Thread count is specified as U/2-1 instead of U-1.
 - An extra DWord (DW9) with clip planes, URB entry output length/offsets
 - We need to program the "Expected Vertex Count" (VerticesIn)

v2: Set the number of binding table entries so they can be prefetched
    (requested by Eric Anholt).
v3: Add a WARN_ONCE for a missing workaround.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-01-31 17:50:08 -08:00
Kenneth Graunke
a0d4311072 i965: Update multisampling state for Broadwell.
On previous platforms, 3DSTATE_MULTISAMPLE contained the number of
samples, pixel location, and the positions of each sample within a pixel
for each multisampling mode (4x and 8x).  It was also a non-pipelined
command, presumably since changing the sample positions is fairly
drastic.

Broadwell improves upon this by splitting the sample positions out into
a separate non-pipelined state packet, 3DSTATE_SAMPLE_PATTERN.  With
that removed, 3DSTATE_MULTISAMPLE becomes a pipelined state packet.

Broadwell also supports 2x and 16x multisampling, in addition to the 4x
and 8x supported by Gen7.  This patch, however, does not implement 2x
and 16x.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-01-31 17:50:08 -08:00
Kenneth Graunke
9cd65e3289 i965: Update 3DSTATE_{DEPTH,STENCIL,...}_BUFFER and such for Broadwell.
The amount of cut and paste from Gen7 is rather ugly, and should
probably be cleaned up in the future.  Even the Gen7 code is in need of
some tidying though; many of the function parameters aren't used on
platforms that use level/layer rather than tile offsets.  Tidying both
can be left to a future patch series.  This at least gets things going.

v2: Rebase on Paul's rename of NumLayers -> MaxNumLayers.

v3: Shift QPitch by 2 when storing it in the packet.  Bits 14:0 store
    bits 16:2 of the actual value.  Fixes tests.

v4: Add missing stencil buffer QPitch.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Eric Anholt <eric@anholt.net>
2014-01-31 17:50:08 -08:00
Kenneth Graunke
2fce1e3c69 i965: Update BLEND_STATE for Broadwell.
v2: Allow logic ops on all surface types.  The UNORM restriction was
    lifted with Haswell and I simply hadn't noticed.  Also, add missing
    BRW_NEW_STATE_BASE_ADDRESS dirty bit.  Both caught by Eric Anholt.

v3: Fix swapped per-RT DWord pairs.  Eliminates bizarre hacks.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-01-31 17:50:08 -08:00
Kenneth Graunke
460e0df330 i965: Update SF_CLIP_VIEWPORT for Broadwell.
It has additional fields to support clipping to the viewport even if
guardband clipping is enabled.

v2: Update for viewport array changes.
v3: No, seriously, update for viewport array changes.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net> [v1]
2014-01-31 17:50:08 -08:00
Kenneth Graunke
dcbf25969e i965: Rework SURFACE_STATE entries for Broadwell.
v2: Add missing SCS setting in gen8_emit_buffer_surface_state (caught by
    Eric Anholt).

v3: Use stored QPitch rather than recomputing it.

v4: Shift QPitch by 2 when setting it in the packet; bits 14:0 store
    bits 16:2 of the actual value (fixes myriads of cube and array
    texturing tests).  Also, only enable cube face bits for cubemaps
    (matches Chris Forbes' commit on master).  Port to use offset64.

v5: s/gl_format/mesa_format/g

v6: Fix DW5 of renderbuffer state, which neglected to subtract
    irb->mt->first_level.  Use vertical_alignment() rather than
    hardcoding 4.  Use ffs for multisample counts rather than a
    large switch statement (all caught/suggested by Eric).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-01-31 17:50:07 -08:00
Kenneth Graunke
990aaf87c4 i965: Update SOL state for Broadwell.
Unlike on Gen7, we can directly set the offset via the state packet.
We also -have- to: the kernel SOL reset code won't work anymore.

v2: Fix copy and paste mistake in buffer stride setup; drop stale
    comment (caught by Eric Anholt).  Add a perf_debug for missing
    MOCS setup.

v3: Rebase on Paul Berry's changes to CurrentVertexProgram.

v4: Fix SO Write Offset handling.  We need to set bits 20 and 21 so the
    hardware both loads and saves the offset.  There's also a
    restriction that 3DSTATE_SO_BUFFER can only be programmed once per
    buffer between primitives, so the "reset to zero" code needed
    reworking.  Fixes most of the transform feedback Piglit tests.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net> [v2]
2014-01-31 17:50:07 -08:00
Kenneth Graunke
fd91ab662d i965: Update the code that disables unused shader stages for Broadwell.
v2: Also disable 3DSTATE_WM_CHROMAKEY for safety.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net> [v1]
2014-01-31 17:50:07 -08:00
Kenneth Graunke
3d3c351cfb i965: Update 3DSTATE_CLIP for Broadwell.
Broadwell's winding order, polygon fill, and viewport Z test fields have
moved to DWord 1 of 3DSTATE_RASTER.

v2: Add a perf_debug for a future optimization and improve commit
    message (both suggested by Eric Anholt).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-01-31 17:50:07 -08:00
Kenneth Graunke
5c0d7dbcb9 i965: Rework vertex uploads for Broadwell.
v2: Emit a dummy 3DSTATE_VF_SGVS packet when not needed.

v3: Add WARN_ONCE and perf_debugs requested by Eric Anholt.

v4: Program 3DSTATE_SGVS even in the no-elements case so gl_VertexID
    continues working.  Fix 3DSTATE_VF_INSTANCING to not use an
    element index to access the buffers array.  Some ARB_draw_indirect
    prep work.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-01-31 17:50:07 -08:00
Kenneth Graunke
08a4714959 i965: Update STATE_BASE_ADDRESS for Broadwell.
v2: Fix missing "change" bit on instruction state base address
    (caught by Haihao Xiang).

v3: Add a perf_debug for missing MOCS setup, requested by Eric.

v4: Fix buffer sizes.  The value, specified at bit 12 and up, is
    actually measured in 4k pages.  We need to round up to the
    next multiple of 4k.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net> [v3]
Reviewed-by: Matt Turner <mattst88@gmail.com> [v4]
2014-01-31 17:50:07 -08:00
Kenneth Graunke
f3c6d6f1e1 i965: Update 3DSTATE_PS, 3DSTATE_WM, and add 3DSTATE_PS_EXTRA.
v2: Fix setting of GEN8_PSX_ATTRIBUTE_ENABLE after rebases.

v3: Add missing binding table entry counts.  Don't worry about alpha
    testing or alpha to coverage when setting the "Kill Pixel" bit;
    those are specified in 3DSTATE_PS_BLEND (caught by Eric Anholt).
    Drop unused _NEW_BUFFERS.  Tidy comments.

v4: Rebase on Paul Berry's changes to CurrentFragmentProgram.

v5: Re-enable line stippling.  It doesn't crash or anything.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net> [v3]
2014-01-31 17:50:07 -08:00
Kenneth Graunke
20d9286f71 i965: Rework 3DSTATE_VS for Broadwell.
v2: Remove incorrect MOCS shifts; rename urb_entry_write_offset to
    urb_entry_output_offset to closer match the documentation.

v3: Only emit a non-zero constant buffer read length when active.

v4: Add missing binding table counts (caught by Eric).

v5: Rebase on Paul Berry's changes to CurrentVertexProgram.

v6: Drop bogus SBE read length/offset field code.  We were programming
    the wrong values, and our 3DSTATE_SBE code overrides any value we
    put here anyway with the correct one.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net> [v4]
2014-01-31 17:50:06 -08:00
Kenneth Graunke
c96686a6cc i965: Add the new 3DSTATE_PS_BLEND state packet.
v2: Only set GEN8_PS_BLEND_HAS_WRITEABLE_RT if color buffer writes are
    enabled (caught by Eric Anholt).

v3: Set non-blending flags (writeable RT, alpha test, alpha to coverage)
    for integer formats too.  +14 Piglits.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net> [v2]
2014-01-31 17:50:06 -08:00
Kenneth Graunke
17768bb7b4 i965: Replace DEPTH_STENCIL_STATE with Gen8's 3DSTATE_WM_DEPTH_STENCIL.
v2: Use stencil->_WriteEnabled instead of setting
    GEN8_WM_DS_STENCIL_BUFFER_WRITE_ENABLE twice (suggested by Eric).

v3: Mask stencil->WriteMask and stencil->ValueMask with 0xff.  The field
    is only 8-bits, so we'd trip the new SET_FIELD assertion when core
    Mesa gave us a value like 0xFFFFFFFF.  The Gen7 code uses structure
    field widths to implicitly do this truncation.  Fixes Piglit tests.

v4: Use uint32_t for dw1/dw2, not uint8_t.  Worst. Typo. Ever.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net> [v2]
2014-01-31 17:50:06 -08:00
Kenneth Graunke
90fff1354b i965: Update SF, SBE, and RASTER state for Broadwell.
The attribute override portion of 3DSTATE_SBE was split out into
3DSTATE_SBE_SWIZ; various bits of 3DSTATE_SF were split out into
3DSTATE_RASTER.

v2: Set Force URB Read Offset bit.  Eventually the URB read offset
    should be set in 3DSTATE_VS, but that will require some refactoring.

v3: Rebase on viewport array changes.

v4: Improve comments about URB read length/offset overrides.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-01-31 17:50:06 -08:00
Kenneth Graunke
4552a22f04 i965: Bump generation assertions on workaround flushes.
I haven't investigated whether these are necessary on Broadwell or not,
but for paranoia's sake, we may as well continue doing them for now.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2014-01-31 17:50:06 -08:00
Kenneth Graunke
2184b519cd i965: Duplicate gen7_atoms to gen8_atoms.
It's going to diverge significantly.  Starting out with a copy allows
future patches to change atoms one by one.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-01-31 17:50:06 -08:00
Brian Paul
f51ca46f0c radeon: move driContextSetFlags(ctx) call after ctx var is initialized
CC: "10.0" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2014-01-31 17:09:44 -07:00
Brian Paul
2d6d69bab6 r200: move driContextSetFlags(ctx) call after ctx var is initialized
Otherwise, ctx was a garbage value.

CC: "10.0" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2014-01-31 17:09:44 -07:00
Roland Scheidegger
1d53603f1f llvmpipe: fix denorm handling for r11g11b10_float format when blending
The code re-enabling denorms for small float formats did not recognize
this format due to format handling hacks (mainly, the lp_type doesn't have
the floating bit set).

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2014-01-31 19:51:06 +01:00
Matt Turner
606544214e glsl: Expand non-expr & non-swizzle scalar rvalues in vectorizing. 2014-01-31 10:21:50 -08:00
Matt Turner
3f49a8c9a5 glcpp: Reject #version after the version has been resolved.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=74166
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Carl Worth <cworth@cworth.org>
2014-01-31 10:21:50 -08:00
Carl Worth
9d4a6bd6bb glcpp: Rename the variable used to enable debugging.
The -p option we now use when calling bison means that this variable will be
named glcpp_parser_debug not yydebug. This was not caught when the -p option
was added because this variable isn't used in the code as committed. (I prefer
the declaration to remain since it allows a developer to easily find this
variable name to enable debugging.)
2014-01-31 10:02:58 -08:00
Carl Worth
2dc93bd5d1 glcpp: Add "make check" test for comment-parsing bug
This is the innocent-looking but killer test case to verify the bug fixed in
the preceding commit.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-01-31 10:02:54 -08:00
Carl Worth
71978cf66f glcpp: Don't enter lexer's NEWLINE_CATCHUP start state for single-line comments
In commit 6005e9cb28 a new start state of NEWLINE_CATCHUP was added to the
lexer. This start state is used whenever the lexer is emitting a NEWLINE token
to emit additional NEWLINE tokens for any newline characters that were skipped
by an immediately preceding multi-line comment.

However, that commit erroneously entered the NEWLINE_CATCHUP state for
single-line comments. This is not desired since in the case of a single-line
comment, the lexer is not emitting any NEWLINE token. The result is that the
lexer will remain in the NEWLINE_CATCHUP state and proceed to fail to emit a
NEWLINE token for the subsequent newline character, (since the case to match \n expects only the INITIAL start state).

The fix is quite simple, remove the "BEGIN NEWLINE_CATCHUP" code from the
single-line comment case, (preserving it only in exactly the cases where the
lexer is actually emitting a NEWLINE token).

Many thanks to Petri Latvala for reporting this bug and for providing the
minimal test case to exercise it. The bug showed up only with a multi-line
comment which was followed immediately by a single-line comment (without any
intervening newline), such as:

	/*
        */ // Kablam!

Since 6005e9cb28, and before this commit, that very innocent-looking
combination of comments would yield a parse failure in the compiler.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=72686

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-01-31 10:02:36 -08:00
Brian Paul
df21f31788 mesa: use _mesa_align_free() in _mesa_delete_buffer_object()
To match _mesa_align_malloc() call in _mesa_buffer_data().
Found by Colin Harrison <colin.harrison@virgin.net>

Signed-off-by: Brian Paul <brianp@vmware.com>
2014-01-31 09:52:11 -07:00
Michel Dänzer
db8b6fb2df st/dri: Fix tests for no draw/read buffers in dri_make_current()
Fixes piglit glx/GLX_ARB_create_context/current with no framebuffer.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-01-31 11:06:26 +09:00
Keith Packard
3fbd1b0cb5 dri3: Track current Present swap mode and adjust buffer counts
This automatically adjusts the number of buffers that we want based on
what swapping mode the X server is using and the current swap interval:

        swap mode       interval        buffers
        copy            > 0             1
        copy            0               2
        flip            > 0             2
        flip            0               3

Note that flip with swap interval 0 is currently limited to twice the
underlying refresh rate because of how the kernel manages flipping. Moving
from 3 to 4 buffers would help, but that seems ridiculous.

v2: Just update num_back at the point that the values that change num_back
    change.  This means we'll have the updated value at the point that the
    freeing of old going-to-be-unused backbuffers happens, which might not
    have been the case before (change by anholt, acked by keithp).

Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-01-30 17:29:33 -08:00
Keith Packard
aea4757eb4 dri3, i915, i965: Add __DRI_IMAGE_FOURCC_SARGB8888
The __DRIimage createImageFromFds function takes a fourcc code, but there was
no fourcc code that match __DRI_IMAGE_FORMAT_SARGB8. This adds a define for
that format, adds a translation in DRI3 from __DRI_IMAGE_FORMAT_SARGB8 to
__DRI_IMAGE_FOURCC_SARGB8888 and then adds translations *back* to
__IMAGE_FORMAT_SARGB8 in both the i915 and i965 drivers.

I'll refrain from comments on whether I think having two separate sets of
format defines in dri_interface.h is a good idea or not...

Fixes piglit glx-tfp and glx-visuals-depth

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-01-30 17:29:23 -08:00
Keith Packard
f12d6d613a dri3: Flush XCB before blocking for special events
XCB doesn't flush the output buffer automatically, so we have to call
xcb_flush ourselves before waiting.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-01-30 16:40:25 -08:00
Keith Packard
09d6c19720 dri3: Enable GLX_INTEL_swap_event
Now that we're tracking SBC values correctly, and the X server has the
ability to send the GLX swap events from a PresentPixmap request, enable
this extension.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-01-30 16:40:06 -08:00
Keith Packard
1525474ead dri3: Fix dri3_wait_for_sbc to wait for completion of requested SBC
Eric figured out that glXWaitForSbcOML wanted to block until the requested
SBC had been completed, which means to wait until the
PresentCompleteNotify event for that SBC had been received.

This replaces the simple sleep(1) loop (which was bogus) with a loop that
just checks to see if we've seen the specified SBC value come back in a
PresentCompleteNotify event yet.

The change is a bit larger than that as I've broken out a piece of common
code to wait for and process a single Present event for the target
drawable.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-01-30 16:38:36 -08:00
Keith Packard
71d614250e dri3: Track full 64-bit SBC numbers, instead of just 32-bits
Tracking the full 64-bit SBC values makes it clearer how those values are
being used, and simplifies the wait_msc code. The only trick is in
re-constructing the full 64-bit value from Present's 32-bit serial number
that we use to pass the SBC value from request to event.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-01-30 16:35:00 -08:00
Mark Mueller
34a8a0820f mesa: Add warning to _REV pack/unpack functions with incorrect behavior
Signed-off-by: Mark Mueller <MarkKMueller@gmail.com>
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
2014-01-31 00:51:36 +01:00
Siavash Eliasi
03065ea05c r600g: Removed unnecessary positivity check for unsigned int variable.
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
2014-01-31 00:50:08 +01:00
Michel Dänzer
9f26ad00d7 st/dri: Allow creating OpenGL 3.3 core contexts
Enables OpenGL 3.3 piglit tests.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-01-30 10:30:41 +09:00
Kristian Høgsberg
cbecd958a7 build: Share the all-local rule for linking libraries into the build dir
This consolidates how we link the libraries into the build directory.
It works for lib_LTLIBRARIES but not custom shared libraries like DRI
drivers or gallium state trackers which needs special casing (cf dri
mega drivers, for example)

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-01-29 12:58:13 -08:00
Emil Velikov
7965908976 loader: do not print the pci id during normal operation
Spamming the pci id is not beneficial. Make sure it's printed
only when needed.

v2: Change severity to _LOADER_DEBUG, rather than removing
the message.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-01-29 19:55:02 +00:00
Emil Velikov
780dfc1fec loader: print WARNING and FATAL messages using the default logger
Lower values are used for more severe cases.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-01-29 19:53:53 +00:00
Emil Velikov
4c35e32594 glsl: s/_NDEBUG/NDEBUG/
The former symbol is never defined within mesa. Based on the code
it seems that the original intent was to use NDEBUG.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-01-29 19:52:35 +00:00
Kristian Høgsberg
e3afbe3ad7 dir-locals.el: Set indent-tabs-mode true for makefile-mode
Makefiles need hard tabs, let's not make that harder than it needs to be.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-01-29 11:45:49 -08:00
Courtney Goeltzenleuchter
3e894e213b mesa: Return after ScissorArrayv or ScissorIndexed detect a parameter error
Fixes piglit arb_viewport_array-scissor-ignore.

Signed-off-by: Courtney Goeltzenleuchter <courtney@LunarG.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jon Ashburn <jon@lunarg.com>
2014-01-29 09:40:02 -07:00
Ian Romanick
ca385bffa6 docs: Add GL_ARB_map_buffer_alignment status to GL3.txt and release notes
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2014-01-29 09:11:40 -07:00
Siavash Eliasi
7fd6ad7adc mesa: GL_ARB_map_buffer_alignment is not optional
Every driver supports it.  All current and future Gallium drivers always
support it, and all existing classic drivers support it.

v2: Making GL_ARB_map_buffer_alignment a desktop OpenGL extension only.

v3: Squash two commits together.

v4 (idr): MIN_MAP_BUFFER_ALIGNMENT queries don't have any dependencies.
In previous versions of the patch it depended on EXTRA_API_GL which
would prevent the query from working in core profile contexts.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2014-01-29 09:11:39 -07:00
Siavash Eliasi
b9aaa96ec3 nouveau: Use gl_constants::MinMapBufferAlignment as the alignment in nouveau_bo_new
This driver does not support GL_ARB_map_buffer_range, so no special
treatment is needed for unaligned offsets in the mapping.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-01-29 09:11:39 -07:00
Siavash Eliasi
d38867d80c radeon / r200: Use gl_constants::MinMapBufferAlignment as the alignment in radeon_bo_open
These drivers do not support GL_ARB_map_buffer_range, so no special
treatment is needed for unaligned offsets in the mapping.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-01-29 09:11:39 -07:00
Siavash Eliasi
f772d51c25 mesa: Use _mesa_align_malloc in _mesa_buffer_data
v2: Fixed memory leak.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-01-29 09:11:39 -07:00
Siavash Eliasi
689b20cfe0 mesa: Set gl_constants::MinMapBufferAlignment to 64 by default
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-01-29 09:11:39 -07:00
Siavash Eliasi
6bb27ee51c mesa/st: Unconditionally enable ARB_map_buffer_alignment.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-01-29 09:11:39 -07:00
Ian Romanick
25c14f40f3 freedreno: Set PIPE_CAP_MIN_MAP_BUFFER_ALIGNMENT to 64
Allocations actually have page alignment, but 64 is still a reasonable
value.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Rob Clark <robclark@freedesktop.org>
2014-01-29 09:11:39 -07:00
Siavash Eliasi
205e624048 ilo: Set PIPE_CAP_MIN_MAP_BUFFER_ALIGNMENT to 64
Ian manually ran the map_buffer_range* tests and the
arb_map_buffer_alignment-* tests, but he did not do a full piglit run.

v2 (idr): Use 64 instead of 4096

Tested-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
2014-01-29 09:11:39 -07:00
Siavash Eliasi
75081391a4 svga: Set PIPE_CAP_MIN_MAP_BUFFER_ALIGNMENT to 64
v2: Fixed setting switch cases prior to
PIPE_CAP_MIN_MAP_BUFFER_ALIGNMENT incorrectly.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-01-29 09:11:39 -07:00
Siavash Eliasi
d273fe72df i915g: Set PIPE_CAP_MIN_MAP_BUFFER_ALIGNMENT to 64
v2: Fixed setting switch cases prior to
PIPE_CAP_MIN_MAP_BUFFER_ALIGNMENT incorrectly.
2014-01-29 09:11:39 -07:00
Siavash Eliasi
4329e99b23 i915g: Use alignment of 64 instead of 16 for buffer allocation
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-01-29 09:09:41 -07:00
Siavash Eliasi
809d3a7d25 llvmpipe: Set PIPE_CAP_MIN_MAP_BUFFER_ALIGNMENT to 64
v2: Fixed setting switch cases prior to
PIPE_CAP_MIN_MAP_BUFFER_ALIGNMENT incorrectly.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-01-29 09:09:41 -07:00
Siavash Eliasi
6317664de0 llvmpipe: Use alignment of 64 instead of 16 for buffer allocation
v2: Changed allocation alignment of llvmpipe_displaytarget_layout.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-01-29 09:09:41 -07:00
Siavash Eliasi
c83b34c43b softpipe: Set PIPE_CAP_MIN_MAP_BUFFER_ALIGNMENT to 64
v2: Fixed setting switch cases prior to
PIPE_CAP_MIN_MAP_BUFFER_ALIGNMENT incorrectly.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-01-29 09:09:41 -07:00
Siavash Eliasi
e36759a81e softpipe: Use alignment of 64 instead of 16 for buffer allocation
v2: Changed allocation alignment in softpipe_displaytarget_layout.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-01-29 09:09:41 -07:00
Stéphane Marchesin
023a50dd9b i915g: support more PIPE_CAPs 2014-01-28 18:56:54 -08:00
Michel Dänzer
f8e16010e5 radeonsi: Put GS ring buffer descriptors with streamout buffer descriptors
And mark the constant buffers as read only for the GPU again.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-01-29 11:09:26 +09:00
Michel Dänzer
d7c68e2dc1 radeonsi: Enable OpenGL 3.3
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-01-29 11:09:14 +09:00
Michel Dänzer
db9d6af862 radeonsi: Geometry shader micro-optimizations
Move parameter loads out of loops, and use the instruction offset
instead of a VGPR for the vertex attribute offset when writing to the
ESGS ring buffer.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-01-29 11:09:04 +09:00
Michel Dänzer
3b3687adcb radeonsi: We don't support indirect addressing of geometry shader inputs
Fixes piglit spec/glsl-1.50/execution/geometry/dynamic_input_array_index

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-01-29 11:08:54 +09:00
Michel Dänzer
b4e14931a9 radeonsi: Pass VS resource descriptors to the HW ES shader stage as well
This makes sure constants and samplers work in the vertex shader even
when a geometry shader is active.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-01-29 11:08:43 +09:00
Michel Dänzer
67e385b3b7 radeonsi: Fix streamout from geometry shader
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-01-29 11:08:33 +09:00
Michel Dänzer
d88a375229 radeonsi: Simplify shader PM4 state handling
Just always bind the current states before drawing.

Besides the simplification, as a bonus this makes sure the VS hardware
shader stage always uses the GS copy shader when a geometry shader is
active, fixing a number of GS related piglit tests.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-01-29 11:08:21 +09:00
Michel Dänzer
e884c560a6 radeonsi: Properly match ES outputs to GS inputs
Fixes piglit vs-gs-arrays-within-blocks-pass.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-01-29 11:08:10 +09:00
Michel Dänzer
e1df0d45c4 radeonsi: Really dump TGSI code before any TGSI->LLVM conversion attempt
While we're at it, use the local variable 'sel'.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-01-29 11:07:58 +09:00
Michel Dänzer
7b19c391f4 radeonsi: Also export clip distances with geometry shader
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-01-29 11:07:48 +09:00
Michel Dänzer
8afde9fa23 radeonsi: Take GS into account for VS state in more places
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-01-29 11:07:35 +09:00
Michel Dänzer
28630713b2 radeonsi: Handle adjacency primitives
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-01-29 11:07:23 +09:00
Michel Dänzer
d8b3d806fc radeonsi: Handle TGSI_SEMANTIC_PRIMID
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-01-29 11:07:11 +09:00
Michel Dänzer
7c7d7380f1 radeonsi: Generalize counting of shader parameters
Now it covers ES->GS as well as VS->PS.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-01-29 11:06:58 +09:00
Michel Dänzer
f07a96dad1 radeonsi: Fix handling of geometry shader output vertex ID
It needs to increment at shader runtime, not at shader compile time, as
the geometry shader can emit vertices in loops. LLVM automagically
converts the ID back to an immediate value if its value can be
determined at compile time.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-01-29 11:06:45 +09:00
Michel Dänzer
404b29d765 radeonsi: Initial geometry shader support
Partly based on the corresponding r600g work by Vadim Girlin and Dave
Airlie.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-01-29 11:06:28 +09:00
Michel Dänzer
51f89a03e1 radeonsi: Refactor shader input / output handling code
In preparation for adding geometry shader support.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-01-29 11:05:58 +09:00
Matt Turner
947c828d5c i965/fs: Add a saturation propagation optimization pass.
Transforms, for example,

mul     vgrf3, vgrf2, vgrf1
mov.sat vgrf4, vgrf3

into

mul.sat vgrf3, vgrf2, vgrf1
mov     vgrf4, vgrf3

which gives register_coalescing an opportunity to remove the MOV
instruction.

total instructions in shared programs: 1515039 -> 1504634 (-0.69%)
instructions in affected programs:     798586 -> 788181 (-1.30%)
GAINED:                                0
LOST:                                  4

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-01-28 17:47:41 -08:00
Matt Turner
39d7ec2c9a i965: Add can_do_saturate() method to backend_instruction.
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-01-28 17:47:41 -08:00
Anuj Phogat
3303475558 mesa: Generate correct error code in glDrawBuffers()
OpenGL 3.3 spec expects GL_INVALID_OPERATION:
 "For both the default framebuffer and framebuffer objects, the
  constants FRONT, BACK, LEFT, RIGHT, and FRONT AND BACK are not
  valid in the bufs array passed to DrawBuffers, and will result
  in the error INVALID OPERATION."

But OpenGL 4.0 spec changed the error code to GL_INVALID_ENUM:
 "For both the default framebuffer and framebuffer objects, the
  constants FRONT, BACK, LEFT, RIGHT, and FRONT_AND_BACK are not
  valid in the bufs array passed to DrawBuffers, and will result
  in the error INVALID_ENUM."

This patch changes the behaviour to match OpenGL 4.0 spec
Fixes Khronos OpenGL CTS draw_buffers_api.test.

V2: Update the comment in code.

Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-01-28 15:30:55 -08:00
Dave Airlie
faee376869 loader: fix running with --disable-egl builds
I sometimes build without EGL just for speed purposes, however
it no longer finds my drivers when I do due to the HAVE_LIBUDEV
defines being wrong.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-01-28 21:51:21 +00:00
Anuj Phogat
dc2f94bc78 i965: Ignore 'centroid' interpolation qualifier in case of persample shading
I missed this change in commit f5cfb4a. It fixes the incorrect
rendering caused in Dolphin Emulator.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=73915

Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Tested-by: Markus Wick <wickmarkus@web.de>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-01-28 13:32:20 -08:00
Matt Turner
10dc994e09 gbm: Make libgbm.so.1 symlink.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-01-28 07:29:14 -08:00
Kevin Rogovin
1db9ed6495 mesa: Allow depth = 0 parameter for TexImage3D.
Fixes the tests for the depth parameter for TexImage3D calls when the
target type is GL_TEXTURE_2D_ARRAY or GL_TEXTURE_CUBE_MAP_ARRAY
so that a depth value of 0 is accepted. Previously, the check
incorrectly required the depth argument to be atleast 1.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-01-28 07:29:14 -08:00
Tom Stellard
7b4592a489 r600g,radeonsi: Don't set resource_create in r600_common_screen_init()
r600g and radeonsi have different implementations of resource_create.

https://bugs.freedesktop.org/show_bug.cgi?id=74139

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-01-28 07:24:11 -08:00
José Fonseca
f29968b270 c11: Add missing stdlib.h include.
For malloc/free.

Silences gcc mingw warnings.
2014-01-28 14:35:04 +00:00
Emil Velikov
61c825e862 loader: include dlfcn.h when building with HAVE_LIBUDEV
The code depending on the definitions is already wrapped
in the same conditional so go ahead and wrap the include.

Otherwise we'll brake compilation on platforms that are
missing the header. Add assert.h in there as well, as it
is introduced and used in the same fashon.

Cc: Eric Anholt <eric@anholt.net>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=74122
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-01-28 14:32:03 +00:00
José Fonseca
2eddf91faf gallivm: Workaround http://llvm.org/PR18600
We have code generation paths that carry out swizzles of AoS vectors via
bitwise shifts, as these tend to generate more efficient code than
straightforward byte shuffles.  But when the input is a constant the
additional bitwise arithmetic operations somehow don't really get
constant propagated properly, evenutally causing assertion failure in
InstCombine pass.

Therefore avoid the bug by using the trivial shuffles for constant
inputs.

Although the sample LLVM IR can cause a crash with any LLVM version,
this was only seen in practice with LLVM 3.2.

Reviewed-by: Matthew McClure <mcclurem@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-01-28 14:27:27 +00:00
Matt Turner
37f1903e00 glsl: Avoid combining statements from different basic blocks.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=74113
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-01-27 21:15:35 -08:00
Matt Turner
8e2b8bd0e6 glsl: Set proper swizzle when a channel is missing in vectorizing.
Previously, for example if the x channel was missing from a series of
assignments we were attempting to vectorize, the wrong swizzle mask
would be applied.

   a.y = b.y;
   a.z = b.z;
   a.w = b.w;

would be incorrectly transformed into

   a.yzw = b.xyz;

Fixes two transform feedback tests in the ES3 conformance suite.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=73978
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=73954
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-01-27 21:15:35 -08:00
Matt Turner
57109d57f8 glsl: Use bitfieldInsert in ldexp() lowering.
Shaves a few instructions off of lowered ldexp().

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-01-27 21:15:35 -08:00
Matt Turner
3ea64f9093 glsl: Add constant evaluation of ir_binop_bfm.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-01-27 21:15:35 -08:00
Matt Turner
c59a605c70 glcpp: Resolve implicit GLSL version to 100 if the API is ES.
Fixes a regression since b2d1c579 where ES shaders without a #version
declaration would fail to compile if their precision declaration was
wrapped in the standard #ifdef GL_ES check.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=74066
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-01-27 21:15:35 -08:00
Matt Turner
3e0e9e3bf9 glcpp: Check version_resolved in the proper place.
The check was in the wrong place, such that if a shader incorrectly put
a preprocessor token before the #version declaration, the version would
be resolved twice, leading to a segmentation fault when attempting to
redefine the __VERSION__ macro.

 #extension GL_ARB_sample_shading: require
 #version 130
 void main() {}

Also, rename glcpp_parser_resolve_version to
             glcpp_parser_resolve_implicit_version to avoid confusion.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Carl Worth <cworth@cworth.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-01-27 21:15:35 -08:00
Michel Dänzer
a818bf481a r600g: s/r600_llvm_gpu_string/r600_get_llvm_processor_name/
Fixes build failure introduced by commit
65dc588bfd ('r600g,radeonsi: consolidate
get_compute_param'), which consolidated the former into the latter.
2014-01-28 10:12:32 +09:00
Marek Olšák
7209703432 radeonsi: cleanup includes, add missing license
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-01-28 01:40:13 +01:00
Marek Olšák
2942124db8 radeonsi: remove open-coded PS_PARTIAL_FLUSH event
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-01-28 01:40:10 +01:00
Marek Olšák
8a4d7c296f radeonsi: move some inline functions from si_pipe.h to si_state.c
And si_tex_aniso_filter is unused.

v2: remove INLINE occurences

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-01-28 01:40:05 +01:00
Marek Olšák
530348680a radeonsi: remove si_resource.h
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-01-28 01:40:04 +01:00
Marek Olšák
6e38a3de8a radeonsi: remove si.h
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-01-28 01:40:02 +01:00
Marek Olšák
27a73a1b94 radeonsi: move si_upload_const_buffer to a better place
This gets rid of another file.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-01-28 01:39:59 +01:00
Marek Olšák
9f5c037ab9 radeonsi: inline si_translate_index_buffer
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-01-28 01:39:57 +01:00
Marek Olšák
0932f0ff14 radeonsi: inline si_upload_index_buffer
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-01-28 01:39:53 +01:00
Marek Olšák
ed42e95404 r600g,radeonsi: consolidate remaining obviously duplicated pipe_screen code
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-01-28 01:39:50 +01:00
Marek Olšák
65dc588bfd r600g,radeonsi: consolidate get_compute_param
v2: added fprintf to r600_get_llvm_processor_name

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-01-28 01:39:48 +01:00
Marek Olšák
d41bd71bcf r600g,radeonsi: consolidate get_paramf and get_video_param
radeonsi now reports PIPE_VIDEO_CAP_SUPPORTS_PROGRESSIVE = true if UVD support
isn't available. It's what all the other drivers do.

Also, some #include directives were missing in radeon_uvd.h.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-01-28 01:39:46 +01:00
Marek Olšák
a4c218f398 r600g,radeonsi: consolidate variables for CS tracing
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-01-28 01:39:42 +01:00
Marek Olšák
ba0c16f7b2 r600g,radeonsi: consolidate get_timestamp, get_driver_query_info
This enables more queries for the Gallium HUD with radeonsi.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-01-28 01:39:39 +01:00
Marek Olšák
4df3f25fa2 r600g,radeonsi: consolidate get_name and get_vendor queries
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-01-28 01:39:37 +01:00
Marek Olšák
f4612105e8 radeon: place context-related functions first in r600_pipe_common.c
To follow the unwritten convention of r600g and radeonsi.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-01-28 01:39:27 +01:00
Marek Olšák
a9ae7635b7 r600g,radeonsi: consolidate the contents of r600_resource.c
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-01-28 01:39:25 +01:00
Marek Olšák
8739c60796 radeonsi: advertise the pipeline statistics query
Implemented by the common code. You can now visualize the statistics
with the HUD, see GALLIUM_HUD=help for all available queries. For example:

GALLIUM_HUD=clipper-primitives-generated

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-01-28 01:39:15 +01:00
Marek Olšák
62d55c0a2d radeonsi: use queries from r600g
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-01-28 01:39:10 +01:00
Marek Olšák
c53b8de335 r600g: remove a no-op while loop
for (;;) {

} while ();

I was surprised to see such a statement.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-01-28 01:39:08 +01:00
Marek Olšák
aa90f17126 r600g: convert query emission code to radeon_emit
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-01-28 01:39:03 +01:00
Marek Olšák
dc76eea22c r600g: only emit NOP relocations for queries if VM is disabled
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-01-28 01:38:59 +01:00
Marek Olšák
4e5c70e066 r600g: move queries to drivers/radeon
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-01-28 01:38:56 +01:00
Mark Mueller
f5bd5568ab mesa: Fix Type A _INT formats to MESA_FORMAT naming standard
Replace Type A _INT formats names with _SINT to match naming spec,
and update type C formats as follows:
    s/MESA_FORMAT_R_INT8\b/MESA_FORMAT_R_SINT8/g
    s/MESA_FORMAT_R_INT16\b/MESA_FORMAT_R_SINT16/g
    s/MESA_FORMAT_R_INT32\b/MESA_FORMAT_R_SINT32/g
    s/MESA_FORMAT_RG_INT8\b/MESA_FORMAT_RG_SINT8/g
    s/MESA_FORMAT_RG_INT16\b/MESA_FORMAT_RG_SINT16/g
    s/MESA_FORMAT_RG_INT32\b/MESA_FORMAT_RG_SINT32/g
    s/MESA_FORMAT_RGB_INT8\b/MESA_FORMAT_RGB_SINT8/g
    s/MESA_FORMAT_RGB_INT16\b/MESA_FORMAT_RGB_SINT16/g
    s/MESA_FORMAT_RGB_INT32\b/MESA_FORMAT_RGB_SINT32/g
    s/MESA_FORMAT_RGBA_INT8\b/MESA_FORMAT_RGBA_SINT8/g
    s/MESA_FORMAT_RGBA_INT16\b/MESA_FORMAT_RGBA_SINT16/g
    s/MESA_FORMAT_RGBA_INT32\b/MESA_FORMAT_RGBA_SINT32/g
    s/\bMESA_FORMAT_RED_RGTC1\b/MESA_FORMAT_R_RGTC1_UNORM/g
    s/\bMESA_FORMAT_SIGNED_RED_RGTC1\b/MESA_FORMAT_R_RGTC1_SNORM/g
    s/\bMESA_FORMAT_RG_RGTC2\b/MESA_FORMAT_RG_RGTC2_UNORM/g
    s/\bMESA_FORMAT_SIGNED_RG_RGTC2\b/MESA_FORMAT_RG_RGTC2_SNORM/g
    s/\bMESA_FORMAT_L_LATC1\b/MESA_FORMAT_L_LATC1_UNORM/g
    s/\bMESA_FORMAT_SIGNED_L_LATC1\b/MESA_FORMAT_L_LATC1_SNORM/g
    s/\bMESA_FORMAT_LA_LATC2\b/MESA_FORMAT_LA_LATC2_UNORM/g
    s/\bMESA_FORMAT_SIGNED_LA_LATC2\b/MESA_FORMAT_LA_LATC2_SNORM/g
2014-01-27 14:34:04 -08:00
Mark Mueller
8b47b6bc32 mesa: Fix MESA_FORMAT names containg SIGNED
Update comments. Replace format names containing SIGNED with
SNORM appended w/decoration per the format name spec:

    s/MESA_FORMAT_SIGNED_R8\b/MESA_FORMAT_R_SNORM8/g
    s/MESA_FORMAT_SIGNED_RG88_REV\b/MESA_FORMAT_R8G8_SNORM/g
    s/MESA_FORMAT_SIGNED_RGBX8888\b/MESA_FORMAT_X8B8G8R8_SNORM/g
    s/MESA_FORMAT_SIGNED_RGBA8888\b/MESA_FORMAT_A8B8G8R8_SNORM/g
    s/MESA_FORMAT_SIGNED_RGBA8888_REV\b/MESA_FORMAT_R8G8B8A8_SNORM/g
    s/MESA_FORMAT_SIGNED_R16\b/MESA_FORMAT_R_SNORM16/g
    s/MESA_FORMAT_SIGNED_GR1616\b/MESA_FORMAT_R16G16_SNORM/g
    s/MESA_FORMAT_SIGNED_RGB_16\b/MESA_FORMAT_RGB_SNORM16/g
    s/MESA_FORMAT_SIGNED_RGBA_16\b/MESA_FORMAT_RGBA_SNORM16/g
    s/MESA_FORMAT_SIGNED_A8\b/MESA_FORMAT_A_SNORM8/g
    s/MESA_FORMAT_SIGNED_I8\b/MESA_FORMAT_I_SNORM8/g
    s/MESA_FORMAT_SIGNED_L8\b/MESA_FORMAT_L_SNORM8/g
    s/MESA_FORMAT_SIGNED_A16\b/MESA_FORMAT_A_SNORM16/g
    s/MESA_FORMAT_SIGNED_I16\b/MESA_FORMAT_I_SNORM16/g
    s/MESA_FORMAT_SIGNED_L16\b/MESA_FORMAT_L_SNORM16/g
    s/MESA_FORMAT_SIGNED_AL88\b/MESA_FORMAT_L8A8_SNORM/g
    s/MESA_FORMAT_SIGNED_RG88\b/MESA_FORMAT_G8R8_SNORM/g
    s/MESA_FORMAT_SIGNED_RG1616\b/MESA_FORMAT_G16R16_SNORM/g
2014-01-27 14:33:29 -08:00
Mark Mueller
2e02e195fe mesa: Fix MESA_FORMAT names with ALPH, INTENSITY, and LUMINANCE
Compressed spelled out color components ALPHA, INTENSITY, and LUMINANCE to A, I, and L:
    s/MESA_FORMAT_ALPHA_UINT8\b/MESA_FORMAT_A_UINT8/g'
    s/MESA_FORMAT_ALPHA_UINT16\b/MESA_FORMAT_A_UINT16/g'
    s/MESA_FORMAT_ALPHA_UINT32\b/MESA_FORMAT_A_UINT32/g'
    s/MESA_FORMAT_ALPHA_INT32\b/MESA_FORMAT_A_SINT32/g'
    s/MESA_FORMAT_ALPHA_INT16\b/MESA_FORMAT_A_SINT16/g'
    s/MESA_FORMAT_ALPHA_INT8\b/MESA_FORMAT_A_SINT8/g'
    s/MESA_FORMAT_INTENSITY_UINT8\b/MESA_FORMAT_I_UINT8/g'
    s/MESA_FORMAT_INTENSITY_UINT16\b/MESA_FORMAT_I_UINT16/g'
    s/MESA_FORMAT_INTENSITY_UINT32\b/MESA_FORMAT_I_UINT32/g'
    s/MESA_FORMAT_INTENSITY_INT32\b/MESA_FORMAT_I_SINT32/g'
    s/MESA_FORMAT_INTENSITY_INT16\b/MESA_FORMAT_I_SINT16/g'
    s/MESA_FORMAT_INTENSITY_INT8\b/MESA_FORMAT_I_SINT8/g'
    s/MESA_FORMAT_LUMINANCE_UINT8\b/MESA_FORMAT_L_UINT8/g'
    s/MESA_FORMAT_LUMINANCE_UINT16\b/MESA_FORMAT_L_UINT16/g'
    s/MESA_FORMAT_LUMINANCE_UINT32\b/MESA_FORMAT_L_UINT32/g'
    s/MESA_FORMAT_LUMINANCE_INT32\b/MESA_FORMAT_L_SINT32/g'
    s/MESA_FORMAT_LUMINANCE_INT16\b/MESA_FORMAT_L_SINT16/g'
    s/MESA_FORMAT_LUMINANCE_INT8\b/MESA_FORMAT_L_SINT8/g'
    s/MESA_FORMAT_LUMINANCE_ALPHA_UINT8\b/MESA_FORMAT_LA_UINT8/g'
    s/MESA_FORMAT_LUMINANCE_ALPHA_UINT16\b/MESA_FORMAT_LA_UINT16/g'
    s/MESA_FORMAT_LUMINANCE_ALPHA_UINT32\b/MESA_FORMAT_LA_UINT32/g'
    s/MESA_FORMAT_LUMINANCE_ALPHA_INT32\b/MESA_FORMAT_LA_SINT32/g'
    s/MESA_FORMAT_LUMINANCE_ALPHA_INT16\b/MESA_FORMAT_LA_SINT16/g'
    s/MESA_FORMAT_LUMINANCE_ALPHA_INT8\b/MESA_FORMAT_LA_SINT8/g'
    s/MESA_FORMAT_ALPHA_FLOAT16\b/MESA_FORMAT_A_FLOAT16/g'
    s/MESA_FORMAT_ALPHA_FLOAT32\b/MESA_FORMAT_A_FLOAT32/g'
    s/MESA_FORMAT_INTESITY_FLOAT16\b/MESA_FORMAT_I_FLOAT16/g'
    s/MESA_FORMAT_INTESITY_FLOAT32\b/MESA_FORMAT_I_FLOAT32/g'
    s/MESA_FORMAT_INTENSITY_FLOAT16\b/MESA_FORMAT_I_FLOAT16/g'
    s/MESA_FORMAT_INTENSITY_FLOAT32\b/MESA_FORMAT_I_FLOAT32/g'
    s/MESA_FORMAT_LUMINANCE_FLOAT16\b/MESA_FORMAT_L_FLOAT16/g'
    s/MESA_FORMAT_LUMINANCE_FLOAT32\b/MESA_FORMAT_L_FLOAT32/g'
    s/MESA_FORMAT_LUMINANCE_ALPHA_FLOAT16\b/MESA_FORMAT_LA_FLOAT16/g'
    s/MESA_FORMAT_LUMINANCE_ALPHA_FLOAT32\b/MESA_FORMAT_LA_FLOAT32/g'
2014-01-27 14:32:41 -08:00
Mark Mueller
eeed49f5f2 mesa: Change many Type P MESA_FORMATs to meet naming spec
Conversion of Type P formats as follows (w/related comment fixes):
    s/MESA_FORMAT_RGB565\b/MESA_FORMAT_B5G6R5_UNORM/g
    s/MESA_FORMAT_RGB565_REV\b/MESA_FORMAT_R5G6B5_UNORM/g
    s/MESA_FORMAT_ARGB4444\b/MESA_FORMAT_B4G4R4A4_UNORM/g
    s/MESA_FORMAT_ARGB4444_REV\b/MESA_FORMAT_A4R4G4B4_UNORM/g
    s/MESA_FORMAT_RGBA5551\b/MESA_FORMAT_A1B5G5R5_UNORM/g
    s/MESA_FORMAT_XBGR8888_SNORM\b/MESA_FORMAT_R8G8B8X8_SNORM/g
    s/MESA_FORMAT_XBGR8888_SRGB\b/MESA_FORMAT_R8G8B8X8_SRGB/g
    s/MESA_FORMAT_ARGB1555\b/MESA_FORMAT_B5G5R5A1_UNORM/g
    s/MESA_FORMAT_ARGB1555_REV\b/MESA_FORMAT_A1R5G5B5_UNORM/g
    s/MESA_FORMAT_AL44\b/MESA_FORMAT_L4A4_UNORM/g
    s/MESA_FORMAT_RGB332\b/MESA_FORMAT_B2G3R3_UNORM/g
    s/MESA_FORMAT_ARGB2101010\b/MESA_FORMAT_B10G10R10A2_UNORM/g
    s/MESA_FORMAT_Z24_S8\b/MESA_FORMAT_S8_UINT_Z24_UNORM/g
    s/MESA_FORMAT_S8_Z24\b/MESA_FORMAT_Z24_UNORM_S8_UINT/g
    s/MESA_FORMAT_X8_Z24\b/MESA_FORMAT_Z24_UNORM_X8_UINT/g
    s/MESA_FORMAT_Z24_X8\b/MESA_FORMAT_X8Z24_UNORM/g
    s/MESA_FORMAT_RGB9_E5_FLOAT\b/MESA_FORMAT_R9G9B9E5_FLOAT/g
    s/MESA_FORMAT_R11_G11_B10_FLOAT\b/MESA_FORMAT_R11G11B10_FLOAT/g
    s/MESA_FORMAT_Z32_FLOAT_X24S8\b/MESA_FORMAT_Z32_FLOAT_S8X24_UINT/g
    s/MESA_FORMAT_ABGR2101010_UINT\b/MESA_FORMAT_R10G10B10A2_UINT/g
    s/MESA_FORMAT_XRGB4444_UNORM\b/MESA_FORMAT_B4G4R4X4_UNORM/g
    s/MESA_FORMAT_XRGB1555_UNORM\b/MESA_FORMAT_B5G5R5X1_UNORM/g
    s/MESA_FORMAT_XRGB2101010_UNORM\b/MESA_FORMAT_B10G10R10X2_UNORM/g
    s/MESA_FORMAT_AL88\b/MESA_FORMAT_L8A8_UNORM/g
    s/MESA_FORMAT_AL88_REV\b/MESA_FORMAT_A8L8_UNORM/g
    s/MESA_FORMAT_AL1616\b/MESA_FORMAT_L16A16_UNORM/g
    s/MESA_FORMAT_AL1616_REV\b/MESA_FORMAT_A16L16_UNORM/g
    s/MESA_FORMAT_RG88\b/MESA_FORMAT_G8R8_UNORM/g
    s/MESA_FORMAT_GR88\b/MESA_FORMAT_R8G8_UNORM/g
    s/MESA_FORMAT_GR1616\b/MESA_FORMAT_R16G16_UNORM/g
    s/MESA_FORMAT_RG1616\b/MESA_FORMAT_G16R16_UNORM/g
    s/MESA_FORMAT_SRGBA8\b/MESA_FORMAT_A8B8G8R8_SRGB/g
    s/MESA_FORMAT_SARGB8\b/MESA_FORMAT_B8G8R8A8_SRGB/g
    s/MESA_FORMAT_SLA8\b/MESA_FORMAT_L8A8_SRGB/g

Conflicts:
	src/mesa/drivers/dri/i965/brw_surface_formats.c
	src/mesa/main/format_pack.c
	src/mesa/main/format_unpack.c
	src/mesa/main/formats.c
	src/mesa/main/texformat.c
	src/mesa/main/texstore.c
2014-01-27 14:31:55 -08:00
Mark Mueller
50a01d2aca mesa: Change many Type A MESA_FORMATs to meet naming standard
Update comments. Conversion of the following Type A formats:
    s/MESA_FORMAT_RGB888\b/MESA_FORMAT_BGR_UNORM8/g
    s/MESA_FORMAT_BGR888\b/MESA_FORMAT_RGB_UNORM8/g
    s/MESA_FORMAT_A8\b/MESA_FORMAT_A_UNORM8/g
    s/MESA_FORMAT_A16\b/MESA_FORMAT_A_UNORM16/g
    s/MESA_FORMAT_L8\b/MESA_FORMAT_L_UNORM8/g
    s/MESA_FORMAT_L16\b/MESA_FORMAT_L_UNORM16/g
    s/MESA_FORMAT_I8\b/MESA_FORMAT_I_UNORM8/g
    s/MESA_FORMAT_I16\b/MESA_FORMAT_I_UNORM16/g
    s/MESA_FORMAT_R8\b/MESA_FORMAT_R_UNORM8/g
    s/MESA_FORMAT_R16\b/MESA_FORMAT_R_UNORM16/g
    s/MESA_FORMAT_Z16\b/MESA_FORMAT_Z_UNORM16/g
    s/MESA_FORMAT_Z32\b/MESA_FORMAT_Z_UNORM32/g
    s/MESA_FORMAT_S8\b/MESA_FORMAT_S_UINT8/g
    s/MESA_FORMAT_SRGB8\b/MESA_FORMAT_BGR_SRGB8/g
    s/MESA_FORMAT_RGBA_16\b/MESA_FORMAT_RGBA_UNORM16/g
    s/MESA_FORMAT_SL8\b/MESA_FORMAT_L_SRGB8/g
    s/MESA_FORMAT_Z32_FLOAT\b/MESA_FORMAT_Z_FLOAT32/g
    s/MESA_FORMAT_XBGR16161616_UNORM\b/MESA_FORMAT_RGBX_UNORM16/g
    s/MESA_FORMAT_XBGR16161616_SNORM\b/MESA_FORMAT_RGBX_SNORM16/g
    s/MESA_FORMAT_XBGR16161616_FLOAT\b/MESA_FORMAT_RGBX_FLOAT16/g
    s/MESA_FORMAT_XBGR16161616_UINT\b/MESA_FORMAT_RGBX_UINT16/g
    s/MESA_FORMAT_XBGR16161616_SINT\b/MESA_FORMAT_RGBX_SINT16/g
    s/MESA_FORMAT_XBGR32323232_FLOAT\b/MESA_FORMAT_RGBX_FLOAT32/g
    s/MESA_FORMAT_XBGR32323232_UINT\b/MESA_FORMAT_RGBX_UINT32/g
    s/MESA_FORMAT_XBGR32323232_SINT\b/MESA_FORMAT_RGBX_SINT32/g
    s/MESA_FORMAT_XBGR8888_UINT\b/MESA_FORMAT_RGBX_UINT8/g
    s/MESA_FORMAT_XBGR8888_SINT\b/MESA_FORMAT_RGBX_SINT8/g
2014-01-27 14:30:50 -08:00
Mark Mueller
ef145ba4de mesa: Rename 4 color component unsigned byte MESA_FORMATs
Change all 4 color component unsigned byte formats to meet spec for P
Type formats:
    s/MESA_FORMAT_RGBA8888\b/MESA_FORMAT_A8B8G8R8_UNORM/g
    s/MESA_FORMAT_RGBA8888_REV\b/MESA_FORMAT_R8G8B8A8_UNORM/g
    s/MESA_FORMAT_ARGB8888\b/MESA_FORMAT_B8G8R8A8_UNORM/g
    s/MESA_FORMAT_ARGB8888_REV\b/MESA_FORMAT_A8R8G8B8_UNORM/g
    s/MESA_FORMAT_RGBX8888\b/MESA_FORMAT_X8B8G8R8_UNORM/g
    s/MESA_FORMAT_RGBX8888_REV\b/MESA_FORMAT_R8G8B8X8_UNORM/g
    s/MESA_FORMAT_XRGB8888\b/MESA_FORMAT_B8G8R8X8_UNORM/g
    s/MESA_FORMAT_XRGB8888_REV\b/MESA_FORMAT_X8R8G8B8_UNORM/g
2014-01-27 14:29:13 -08:00
Mark Mueller
71fe943716 mesa: change gl_format to mesa_format
s/\bgl_format\b/mesa_format/g. Use better name for Mesa Formats enum
2014-01-27 14:28:46 -08:00
Ian Romanick
bc0ed68275 docs: Update GL3.txt due to recent work
v2: Note that Fredrik Höglund is working on GL_ARB_multi_bind, not
Maxence Le Doré.  Suggested by Matt.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2014-01-27 14:35:19 -07:00
Ian Romanick
6901c278ca glcpp: Make sure GL_AMD_shader_trinary_minmax is defined
The define was only available if
gl_extensions::AMD_shader_trinary_minmax was set, but no driver set it.
Since the extension is advertised by default, remove that field too.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Cc: Maxence Le Doré <maxence.ledore@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-01-27 14:28:24 -07:00
Ian Romanick
764be9f9e8 mesa: Clean up bad code formatting left from previous commit
Also s/_EXT// on enums that are now part of core.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-01-27 14:21:43 -07:00
Ian Romanick
a6729731af mesa: GL_EXT_framebuffer_blit is not optional
Every driver supports it.  All current and future Gallium drivers always
support it, and all existing classic drivers support it.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-01-27 14:21:43 -07:00
Ian Romanick
71cc510ef6 radeon: Enable GL_EXT_framebuffer_blit
The dd_function_table::BlitFramebuffer is already initialized to
_mesa_meta_BlitFramebuffer, so it should just work.

Tested on a Radeon 7500 (OpenGL renderer string: Mesa DRI R100 (RV200
5157) TCL DRI2).  I couldn't do a full piglit run because it would tank
the system with or without this patch.  I just ran all the blit tests
(-t blit to piglit-run.py).  Only fbo-sys-sub-blit failed.  All of the
other tests that weren't skipped (i.e., all the multisample and sRGB
tests skip) passed.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-01-27 14:21:43 -07:00
Ian Romanick
bed51a4858 r200: Enable GL_EXT_framebuffer_blit
The dd_function_table::BlitFramebuffer is already initialized to
_mesa_meta_BlitFramebuffer, so it should just work.

Tested on a FireGL 8800 (OpenGL renderer string: Mesa DRI R200 (R200
5148) TCL DRI).

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-01-27 14:21:43 -07:00
Ian Romanick
33214679bb radeon / r200: Pass the API into _mesa_initialize_context
Otherwise an application that requested an OpenGL ES 1.x context would
actually get a desktop OpenGL context.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Cc: "9.1 9.2 10.0" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-01-27 14:21:43 -07:00
Ian Romanick
af0b34783e mesa: Validate internalFormat with target in glTexStorage paths
Fixes the glTexStorage3D failure in
ext_packed_depth_stencil-depth-stencil-texture and
oes_packed_depth_stencil-depth-stencil-texture_gles2.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-01-27 14:21:43 -07:00
Ian Romanick
421b5958eb mesa: Refactor internalFormat / target checks to a separate function
We need almost identical code in the glTexStorage path.

v2: Fix typo in a comment noticed by Topi.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-01-27 14:21:42 -07:00
Ian Romanick
88db6ad7db mesa: Generate the correct error for a depth format with a 3D texture
All versions of the OpenGL spec are quite clear that
GL_INVALID_OPERATION should be generated.  I added a quotation from the
3.3 core profile spec.

Fixes the glTexImage3D subcases of
ext_packed_depth_stencil-depth-stencil-texture and
oes_packed_depth_stencil-depth-stencil-texture_gles2.  The same subtests
of oes_packed_depth_stencil-depth-stencil-texture_gles1 fail, but they
fail with a different wrong error code.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-01-27 14:21:42 -07:00
Matt Turner
3f3aafbfee glx: Update glxext.h to revision 24777.
It readds the GLXContextID typedef, but under #ifndef GLX_VERSION_1_3
and glx.h already defines GLX_VERSION_1_3.

Bugzilla: https://cvs.khronos.org/bugzilla/show_bug.cgi?id=11454
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-01-27 09:57:12 -08:00
Emil Velikov
a6031a82f9 loader: Add missing \n on message printing
Cover both loader and glx/dri_glx
Drop \n from the default loader logger

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-01-27 09:37:29 -08:00
Eric Anholt
867d7c0e10 dri: Reuse dri_message to implement our other message handlers.
Reviewed-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-01-27 09:37:29 -08:00
Eric Anholt
4a8da40fc0 dri: Fix the logger error message handling.
Since the loader changes, there has been a compiler warning that the
prototype didn't match.  It turns out that if a loader error message was
ever thrown, you'd segfault because of trying to use the warning level as
a format string.

Reviewed-by: Keith Packard <keithp@keithp.com>
Tested-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-01-27 09:37:29 -08:00
Eric Anholt
7bd95ec437 dri2: Trust our own driver name lookup over the server's.
This allows Mesa to choose to rename driver .sos (or split drivers),
without needing a flag day with the corresponding 2D driver.

v2: Undo the loader-only-for-dri3 change.

Reviewed-by: Keith Packard <keithp@keithp.com> [v1]
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net> [v1]
2014-01-27 09:37:10 -08:00
Eric Anholt
be7a6976a8 dri2: Open the fd before loading the driver.
I want to stop trusting the server for the driver name, and instead decide
on our own based on the fd, so I needed this code motion.

Reviewed-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-01-27 09:36:24 -08:00
Eric Anholt
378e7ad26f dri3: Fix two little memory leaks.
Noticed when valgrinding an unrelated bug.

Reviewed-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-01-27 09:36:24 -08:00
Eric Anholt
4556c73470 loader: Use dlsym to get our udev symbols instead of explicit linking.
Steam links against libudev.so.0, while we're linking against
libudev.so.1.  The result is that the symbol names (which are the same in
the two libraries) end up conflicting, and some of the usage of .so.1
calls the .so.0 bits, which have different internal structures, and
segfaults happen.

By using a dlopen() with RTLD_LOCAL, we can explicitly look for the
symbols we want, while they get the symbols they want.

Reviewed-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Tested-by: Alexandre Demers <alexandre.f.demers@gmail.com>
Tested-by: Mike Lothian <mike@fireburn.co.uk>
2014-01-27 09:36:24 -08:00
Tom Stellard
d51dbe048a r600g/compute: Emit DEALLOC_STATE on cayman after dispatching a compute shader.
This is necessary to prevent the next SURFACE_SYNC packet from
hanging the GPU.

https://bugs.freedesktop.org/show_bug.cgi?id=73418

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>

CC: "9.2" "10.0" <mesa-stable@lists.freedesktop.org>
2014-01-27 11:09:15 -05:00
Ilia Mirkin
3518606c14 docs: sync up nv50/nvc0 status on GL4.x extensions
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-01-27 16:40:43 +01:00
Ilia Mirkin
59e334194b docs: update GL3.txt, relnotes to reflect current nv50/nvc0 status
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-01-27 16:40:43 +01:00
Ilia Mirkin
839bd3cff7 nv50, nvc0: update reported glsl version to 330
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-01-27 16:40:43 +01:00
Christoph Bumiller
3efed4cd05 mesa/st: expose ARB_texture_rgb10_a2ui if R10G10B10A2_UINT is supported v2
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-01-27 16:40:43 +01:00
Christoph Bumiller
c7b14ba23f nv50: add more RGB10A2 formats 2014-01-27 16:40:43 +01:00
Christoph Bumiller
f3bd2bc7b2 st/mesa: fix GS varyings for PIPE_CAP_TGSI_TEXCOORD 2014-01-27 16:40:43 +01:00
Ilia Mirkin
dc8da4c29b nv50: enable seamless cube maps on all hw
Some of the hardware support is missing. The NVIDIA-provided driver,
which claims seamless cube map support fails the relevant tests as well.
As this is the last extension before we can have OpenGL 3.2, doing this
allows us to expose geometry shaders without doing the additional
work involved in supporting ARB_geometry_shader4.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-01-27 16:40:43 +01:00
Ilia Mirkin
b9b7cfbabf nv50: report glsl 1.50 now that gp tests pass
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-01-27 16:40:43 +01:00
Ilia Mirkin
3bd40073b9 nv50: add support for texelFetch'ing MS textures, ARB_texture_multisample
Creates two areas in the AUX constbuf:
 - Sample offsets for MS textures
 - Per-texture MS settings

When executing a texelFetch with a MS sampler, looks up that texture's
settings and adjusts the parameters given to the texfetch instruction.

With this change, all the ARB_texture_multisample piglits pass, so turn
on PIPE_CAP_TEXTURE_MULTISAMPLE.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-01-27 16:40:43 +01:00
Ilia Mirkin
a6cf950ba2 nv50: copy nvc0's get_sample_position implementation
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-01-27 16:40:43 +01:00
Ilia Mirkin
b87f5abd21 nv50: add comments about CB_AUX contents
Updates a few inconsistencies as well, like the size of the buffer,
location of the runout, etc.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-01-27 16:40:43 +01:00
Ilia Mirkin
250e7c835e nvc0: don't forget to also clear additional layers
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-01-27 16:40:43 +01:00
Ilia Mirkin
e3247355cc nv50: don't forget to also clear additional layers
Fixes most of the tests/spec/gl-3.2/layered-rendering/* piglits.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-01-27 16:40:43 +01:00
Ilia Mirkin
d98b85b507 nv50: allocate an extra code bo to avoid dmesg spam
Each code BO is a heap that allocates at the end first, and so GPs are
allocated at the very end of the allocated space. When executing, we see
PAGE_NOT_PRESENT errors for the next page. Just over-allocate to make
sure that there's something there.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-01-27 16:40:43 +01:00
Ilia Mirkin
58589f6c6d nv50: GP_REG_ALLOC_RESULT must be positive
Set max_out to 1 when there are no outputs.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-01-27 16:40:42 +01:00
Ilia Mirkin
006095b38a nv50: VP_RESULT_MAP_SIZE has to be positive
Make sure that we never try to use a 0-sized map. This can happen when
using a gp, so add a dummy mapping when computing vp_gp_mapping in that
case.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-01-27 16:40:42 +01:00
Ilia Mirkin
c4adbd5a57 nv50: enable primitive id generation when it is an FP input without GP
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-01-27 16:40:42 +01:00
Ilia Mirkin
70a07ac352 nv50: handle gl_Layer writes in GP
Marks gl_Layer as only having one component, and makes sure to keep
track of where it is and emit it in the output map, since it is not an
input to the FP.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-01-27 16:40:42 +01:00
Ilia Mirkin
7c624148a6 nv50: properly set the PRIMITIVE_ID enable flag when it is a gp input.
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-01-27 16:40:42 +01:00
Ilia Mirkin
6f3219a8f3 nv50/ir: add support for gl_PrimitiveIDIn
Note that the primitive id is stored in a[0x18], while usually the
geometry instructions are of the form a[$a1 + 0x4] which gets mapped to
p[] space. We need to avoid the change from a[] to p[] here, so it's
keyed on whether the access is indirect or not.

Note that there's also a use-case for accessing e.g. a[$r1], however
that's not supported for now. (Could be added by checking the register
file of the indirect parameter.)

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-01-27 16:40:42 +01:00
Ilia Mirkin
f77069419a nv50/ir: fix support for shader input + immediate in gp
This only works for up to $a3, hopefully we won't go that high.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-01-27 16:40:42 +01:00
Ilia Mirkin
45b7f1701e nv50/ir: disallow shader input + cbuf in same instruction in gp
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-01-27 16:40:42 +01:00
Ilia Mirkin
42dc414cc6 nv50/ir: disallow predicates on emit/restart ops 2014-01-27 16:40:42 +01:00
Ilia Mirkin
20929963d3 nv50: allow vert_count to be >255
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-01-27 16:40:42 +01:00
Bryan Cain
02b317a0d6 nv50: add support for geometry shaders
Layer output probably doesn't work yet, but other than that everything seems
to be working.

Signed-off-by: Bryan Cain <bryancain3@gmail.com>
[calim: fix up minor bugs, code formatting]
Signed-off-by: Christoph Bumiller <e0425955@student.tuwien.ac.at>
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-01-27 16:40:42 +01:00
Bryan Cain
b3f82e1a63 nv50/ir: delay calculation of indirect addresses
Instead of emitting an SHL 4 io an address register on the TGSI ARL and UARL
instructions, emit the shift when the loaded address is actually used.  This
is necessary because input vertex and attribute indices in geometry shaders on
nv50 need to be shifted left by 2 instead of 4.

Signed-off-by: Bryan Cain <bryancain3@gmail.com>
[calim: various updates to the indirect address logic]
Signed-off-by: Christoph Bumiller <e0425955@student.tuwien.ac.at>
[imirkin: remove OP_MAD change that calim made, add OP_RESTART handling
          same as OP_EMIT for code flow analysis]
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-01-27 16:40:42 +01:00
Christoph Bumiller
67250acbab nv50/ir: fix PFETCH and add RDSV to get VSTRIDE for GPs 2014-01-27 16:40:42 +01:00
Ilia Mirkin
2689b59cab nv50/ir: txg not available on nvaa/nvac
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-01-27 16:40:42 +01:00
Ilia Mirkin
e05de038bf nv50, nvc0: only clear out the buffers that we were asked to clear
Fixes fbo-drawbuffers-none glClearBuffer piglit test.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-01-27 16:40:42 +01:00
Ilia Mirkin
c75eeab609 nv50, nvc0: clear out RT on a null cbuf
This is needed since commit 9baa45f78b (st/mesa: bind NULL colorbuffers
as specified by glDrawBuffers).

This implementation is highly based on a larger commit by
Christoph Bumiller <e0425955@student.tuwien.ac.at> in his gallium-nine
branch.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-01-27 16:40:42 +01:00
Ilia Mirkin
3f264e16e2 nv50: don't leak heap on tls alloc failure
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-01-27 16:40:42 +01:00
Ilia Mirkin
18d97a8df7 nouveau/codegen: set dType to S32 for OP_NEG U32
It doesn't make sense to do an OP_NEG from U32 to U32. This was
manifested on nv50 in glsl-fs-atan-3 which was generating a

UMAD TEMP[0].x, TEMP[0].xxxx, -TEMP[5].xxxx, TEMP[0].xxxx

instruction. (For some reason, nvc0 causes a different shader to be
generated.) This led to a

cvt neg u32 $r1 u32 $r1

Which did not yield the desired result. This changes the final output to

cvt neg s32 $r1 u32 $r1

which produces the desired output and the piglit tests passes. My
assumption is that this is also what we want on nvc0, but could not test
as there was no suitable shader that generated the problem instruction.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-01-27 16:40:42 +01:00
Ilia Mirkin
45b64e52f4 util/u_vbuf: correct map offset calculation for crazy offsets
When the min_index is very large (or very negative), the multipliation
can overflow 32 bits and result in an incorrect map pointer
modification.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-01-27 16:40:42 +01:00
Ilia Mirkin
3de97ce920 translate: deal with size overflows by casting to ptrdiff_t
This was discovered as a result of the draw-elements-base-vertex-neg
piglit test, which passes very negative offsets in, followed up by large
indices. The nouveau code correctly adjusts the pointer, but the
translate code needs to do the proper inverse correction. Similarly fix
up the SSE code to do a 64-bit multiply to compute the proper offset.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-01-27 16:40:42 +01:00
Emil Velikov
4dd445f1cf gallium/rtasm: handle mmap failures appropriately
For a variety of reasons mmap (selinux and pax to name
a few) and can fail and with current code. This will
result in a crash in the driver, if not worse.

This has been the case since the inception of the
gallium copy of rtasm.

Cc: 9.1 9.2 10.0 <mesa-stable@lists.freedesktop.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=73473
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2014-01-27 13:24:51 +00:00
Alexander von Gluck IV
e5e4120723 haiku: change atomic int to non-volatile
* Our atomic calls changed recently and no longer want atomic int
  pointers to be volatile
* Spellcheck
2014-01-26 18:56:05 -06:00
Kenneth Graunke
07149f0252 i965: Don't store qpitch / 4 as mt->qpitch for compressed surfaces.
Broadwell requires software to specify QPitch in a bunch of packets,
so we decided to store it in the miptree.  However, when I did that
refactoring, I missed a subtlety: the hardware expects QPitch to be
"in units of rows in the uncompressed surface".

This is the value we originally compute.  However, for compressed
surfaces, we then divided it by 4 (the block height), to obtain the
physical layout.  This is no longer the QPitch Broadwell expects.

So, store the original undivided value in mt->qpitch, but continue to
use the divided value in brw_miptree_layout_texture_array().  For
non-Broadwell platforms, this should have no impact at all.

Helps fix Piglit's "getteximage-targets S3TC CUBE" test on Broadwell.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-01-25 19:20:17 -08:00
Vinson Lee
a487b4d0e3 c11: Do not use pthread_mutex_timedlock on NetBSD.
This patch fixes the NetBSD build.

NetBSD does not have pthread_mutex_timedlock.

  CC       glapi_dispatch.lo
threads_posix.h: In function 'mtx_timedlock':
threads_posix.h:216:5: error: implicit declaration of function 'pthread_mutex_timedlock'

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
2014-01-24 18:20:42 -08:00
Kenneth Graunke
6709f0549f glsl: Simplify built-in generator functions for min3/max3/mid3.
The type of all three parameters are identical, so we don't need to
specify it three times.  The predicate is always identical too, so we
don't need to make it a parameter, either.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-01-24 14:18:15 -08:00
Kenneth Graunke
44a86e2b4f glsl: Fix chained assignments of vector channels.
Simple shaders such as:

    void splat(vec2 v, float f) {
        v[0] = v[1] = f;
    }

failed to compile with the following error:
error: value of type vec2 cannot be assigned to variable of type float

First, we would process v[1] = f, and transform:
LHS: (expression float vector_extract (var_ref v) (constant int (1)))
RHS: (var_ref f)
into:
LHS: (var_ref v)
RHS: (expression vec2 vector_insert (var_ref v) (constant int (1))
                 (var_ref f))

Note that the LHS type is now vec2, not a float.  This is surprising,
but not the real problem.

After emitting assignments, this ultimately becomes:
(declare (temporary) vec2 assignment_tmp)
(assign (xy)
  (var_ref assignment_tmp)
  (expression vec2 vector_insert (var_ref v) (constant int (1))
              (var_ref f)))
  (assign (xy) (var_ref v) (var_ref assignment_tmp))

We would then return (var_ref assignment_tmp) as the rvalue, which has
the wrong type---it should be float, but is instead a vec2.

To fix this, we simply return (vector_extract (var_ref assignment_temp)
<the appropriate channel>) to pull out the desired float value.

Fixes Piglit's chained-assignment-with-vector-constant-index.vert and
chained-assignment-with-vector-dynamic-index.vert tests.

Cc: mesa-stable@lists.freedesktop.org
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=74026
Reported-by: Dan Ginsburg <dang@valvesoftware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2014-01-24 14:18:15 -08:00
Kenneth Graunke
6c158e110c glsl: Rename "expr" to "lhs_expr" in vector_extract munging code.
When processing assignments, we have both an LHS and RHS.  At a glance,
"lhs_expr" clearly refers to the LHS, while a generic name like "expr"
is ambiguous.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2014-01-24 14:18:15 -08:00
Paul Berry
eab32bb8f1 Update .gitignore for Catalan translations build artifacts
Causes git to ignore the new build artifacts introduced by commit
d5e5367e89 (driconf: Add Catalan
translations).
2014-01-24 13:45:16 -08:00
Ian Romanick
c11d76c51a mesa: Increment the list pointer while freeing instruction data
Since the list pointer was never incremented when a OPCODE_PIXEL_MAP
opcode was encountered, the data for the instruction would get freed
over and over and over... resulting in a crash.

Fixes gl-1.0-beginend-coverage.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=72214
Reviewed-by: Brian Paul <brianp@vmware.com>
Cc: Lu Ha <huax.lu@intel.com>
2014-01-24 13:43:10 -08:00
Brian Paul
a44554870e svga: rename "tex_usage" to "bindings", add comments
Trivial.
2014-01-24 13:33:29 -07:00
Brian Paul
e2dd240e32 st/mesa: add a simple sanity check assertion in st_validate_attachment()
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-01-24 13:33:13 -07:00
Paul Berry
43e77215b1 i965/gen7: Use to the correct program when uploading transform feedback state.
Transform feedback may come from either the geometry shader or the
vertex shader, so we can't use
ctx->Shader.CurrentProgram[MESA_SHADER_VERTEX] to find the current
post-link transform feedback information.  Fortunately we can use
ctx->TransformFeedback.CurrentObject->shader_program.

Cc: 10.0 <mesa-stable@lists.freedesktop.org>

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-01-23 13:41:36 -08:00
Paul Berry
e190709119 mesa: Ensure that transform feedback refers to the correct program.
Previous to this patch, the _mesa_{Begin,Resume}TransformFeedback
functions were using ctx->Shader.CurrentProgram[MESA_SHADER_VERTEX] to
find the program that would be the source of transform feedback data.
This isn't correct--if there's a geometry shader present it should be
ctx->Shader.CurrentProgram[MESA_SHADER_GEOMETRY].  (These might be
different if separate shader objects are in use).

This patch creates a function get_xfb_source(), which figures out the
correct program to use based on GL state, and updates
_mesa_{Begin,Resume}TransformFeedback to call it.  get_xfb_source() is
written in terms of the gl_shader_stage enum, so it should not need
modification when we add tessellation shaders in the future.  It also
creates a new driver flag, NewTransformFeedbackProg, which is flagged
whenever this program changes.

To reduce future confusion, this patch also rewords some comments and
error message text to avoid referring to vertex shaders.

Cc: 10.0 <mesa-stable@lists.freedesktop.org>

v2: make the for loop in get_xfb_source() clearer.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-01-23 13:41:01 -08:00
Paul Berry
9cee3ff562 i965: Remove *_generator::shader field; use prog field instead.
The "shader" field in fs_generator, vec4_generator, and gen8_generator
was only used for one purpose; to figure out if we were compiling an
assembly program or a GLSL shader (shader is NULL for assembly
programs).  And it wasn't being used properly: in vec4 shaders we were
always initializing it based on
prog->_LinkedShaders[MESA_SHADER_FRAGMENT], regardless of whether we
were compiling a geometry shader or a vertex shader.

This patch simplifies things by using the "prog" field instead; this
is also NULL for assembly programs.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-01-23 13:40:55 -08:00
Matt Turner
00c672086c gles3: Update gl3.h to revision 24614.
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-01-23 11:33:22 -08:00
Matt Turner
d519ebb34c gles2: Update gl2ext.h to revision 24614.
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-01-23 11:33:22 -08:00
Matt Turner
117d8ce27b gles2: Update gl2.h to revision 24614.
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-01-23 11:33:22 -08:00
Matt Turner
66ef8feb4d glcpp: Define GL_EXT_shader_integer_mix in both GL and ES.
Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-01-23 11:33:22 -08:00
Matt Turner
73c3c7e37d glcpp: Remove unused gl_api bits.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-01-23 11:33:22 -08:00
Matt Turner
b2d1c579bb glcpp: Set extension defines after resolving the GLSL version.
Instead of defining preprocessor macros in glcpp_parser_create based on
the GL API, wait until the shader version has been resolved. Doing this
allows us to correctly set (and not set) preprocessor macros for
extensions allowed by the API but not the shader, as in the case of
ARB_ES3_compatibility.

The shader version has been resolved when the preprocessor encounters
the first preprocessor token, since the GLSL spec says

   "The #version directive must occur in a shader before anything else,
    except for comments and white space."

Specifically, if a #version token is found the version is known
explicitly, and if any other preprocessor token is found then the GLSL
version is implicitly 1.10.

Cc: mesa-stable@lists.freedesktop.org
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=71630
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-01-23 11:33:22 -08:00
Anuj Phogat
c907595ba7 glsl: Disable ARB_texture_rectangle in shader version 100.
OpenGL with ARB_ES2_compatibility allows shaders that specify #version
100.

This fixes the Khronos OpenGL test(Texture_Rectangle_Samplers_frag.test)
failure.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-01-23 11:33:22 -08:00
Matt Turner
e0648015e9 glsl: Mark GLSL 4.40 as a known version.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-01-23 11:33:22 -08:00
Brian Paul
f7c118ffbf st/mesa: fix glReadBuffer(GL_NONE) segfault
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=73956
Cc: 10.0 <mesa-stable@lists.freedesktop.org>
Tested-by: Ahmed Allam <ahmabdabd@hotmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-01-23 11:08:40 -07:00
Brian Paul
349efdbba1 svga: fix PS output register setup regression
Fixes glean fragProg1 regression caused by commit b9f68d927e
(implement TGSI_PROPERTY_FS_COLOR0_WRITES_ALL_CBUFS).  This bug
only appears when the fragment shader emits fragment.Z before
color outputs.  The bug was caused by confusion between register
indexes and semantic indexes.

Also added some comments to better explain register indexing.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2014-01-23 11:08:40 -07:00
Emil Velikov
c6b6916b9a glx: link loader util lib only when building with dri3
Otherwise we pull libudev as a dependency and crash
games/programs that ship their own version of libudev.

Either way we should link the loader lib only when needed.
This fixes a regression caused by
commit eac776cf77
Author: Emil Velikov <emil.l.velikov@gmail.com>
Date:   Sat Jan 11 02:24:43 2014 +0000

    glx: use the loader util lib

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=73854
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-01-23 18:04:22 +00:00
Alex Henrie
d5e5367e89 driconf: Add Catalan translations
See the instructions in Makefile.am under "Adding new translations".

Reviewed-by: Eric Anholt <eric@anholt.net>
2014-01-23 09:10:19 -08:00
Alex Henrie
84529a5ddb driconf: Correct and update Spanish translations
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-01-23 09:10:18 -08:00
Alex Henrie
822b4315b7 driconf: Synchronize po files
See the instructions in Makefile.am under "Updating existing
translations".

Reviewed-by: Eric Anholt <eric@anholt.net>
2014-01-23 09:10:18 -08:00
Ian Romanick
e4fcae0755 mesa: Set gl_constants::MinMapBufferAlignment
Leaving it set to zero isn't really correct since every allocation has
at least an alignment of 1 byte.  It also caused a problem in the i965
driver after I removed the MAX(64, ...) from the alignment calculation.
That's what I get for changing a patch without retesting it. :(

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=73907
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: Lu Hua <huax.lu@intel.com>
2014-01-23 08:50:58 -08:00
Ian Romanick
7a0f26dec9 radeon / r200: Eliminate BEGIN_BATCH_NO_AUTOSTATE
Sed job:

    grep -lr BEGIN_BATCH_NO_AUTOSTATE src/mesa/drivers/dri/ | while read f
    do
        cat $f | sed 's/BEGIN_BATCH_NO_AUTOSTATE/BEGIN_BATCH/g' > x
        mv x $f
    done

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Cc: Marek Olšák <marek.olsak@amd.com>
2014-01-23 08:50:58 -08:00
Ian Romanick
2d5fd20690 radeon / r200: Remove unused 'dostate' parameter
This parameter hasn't been used since January 2010 (commit 29e02c7).
Fixes the following warning in both radeon and r200:

radeon_common.c: In function 'r200_rcommonBeginBatch':
radeon_common.c:762:14: warning: unused parameter 'dostate' [-Wunused-parameter]

Note that now BEGIN_BATCH and BEGIN_PATCH_NO_AUTOSTATE are identical.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Cc: Marek Olšák <marek.olsak@amd.com>
2014-01-23 08:50:58 -08:00
Ian Romanick
5b4c12972c radeon / r200: Fix 'empty body' warning
radeon_common.c: In function 'radeon_draw_buffer':
radeon_common.c:237:3: warning: suggest braces around empty body in an 'if' statement [-Wempty-body]

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Cc: Marek Olšák <marek.olsak@amd.com>
2014-01-23 08:50:58 -08:00
Ian Romanick
b790bed21e radeon / r200: Fix incompatible pointer type warning
When parameters were removed from dd_function_table::Viewport (commit
065bd6ff), radeon_viewport (in both radeon and r200) started generating
a warning.

radeon_common.c: In function 'r200_radeon_viewport':
radeon_common.c:415:15: warning: assignment from incompatible pointer type [enabled by default]
radeon_common.c:419:23: warning: assignment from incompatible pointer type [enabled by default]

I didn't notice this initially, and it's harmless because the function is
never called through the incorrectly typed pointer.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Cc: Marek Olšák <marek.olsak@amd.com>
2014-01-23 08:50:58 -08:00
José Fonseca
840154dc50 draw: Save original driver functions earlier.
Otherwise they will be NULL when stage destroy is invoked prematurely,
(i.e, on out of memory).

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-01-23 15:49:32 +00:00
Brian Paul
1a44180578 mesa: whitespace fixes in glformats.c
Reindent _mesa_get_nongeneric_internalformat() to match other functions.
Remove extraneous empty lines in _mesa_get_linear_internalformat().

Trivial.
2014-01-23 08:31:21 -07:00
Brian Paul
a15eb19676 svga: minor code movement in svga_tgsi_insn.c
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2014-01-23 08:23:01 -07:00
Brian Paul
f12954e1cb svga: whitespace, formatting fixes in svga_state_framebuffer.c
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2014-01-23 08:23:01 -07:00
Brian Paul
56b876ecd0 svga: simplify common immediate value construction
Use some new helper functions to make the code much more readable.
And fix wrong value for XPD's w result.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2014-01-23 08:23:01 -07:00
Brian Paul
023020d740 svga: add comments, etc to svga_tgsi_insn.c code
To make things a little easier to understand for newcomers.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2014-01-23 08:23:01 -07:00
Brian Paul
fe043ae554 svga: assorted cleanups in shader code
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2014-01-23 08:23:00 -07:00
Brian Paul
2a30379dcd svga: rename shader_result -> variant
To be more consisten with other parts of gallium.  Plus, update/add
various comments.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2014-01-23 08:22:58 -07:00
Brian Paul
35ddd2cc5d mesa: rename unbind_texobj_from_imgunits()
... to unbind_texobj_from_image_units() and change a local var's type
to silence an MSVC warning.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-01-23 08:13:14 -07:00
Brian Paul
1f2007429e glsl: silence a couple warnings in find_active_atomic_counters()
Silence unitialized variable 'id' warning.  Silence unused 'found' warning.
Only seen in release builds.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-01-23 08:13:14 -07:00
Brian Paul
5306ee736e mesa: initialize "is_layered" variable to silence warning
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-01-23 08:13:14 -07:00
Brian Paul
b98fa6fe6f mesa: fix/add some cases in _mesa_get_linear_internalformat()
In some cases we were converting generic formats to sized formats
and vice versa.  The point is to simply convert sRGB formats to
corresponding linear formats.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-01-23 08:13:13 -07:00
Brian Paul
91567b83bf mesa: add missing ETC2_SRGB cases in formats.c
In the _mesa_get_format_color_encoding() and _mesa_get_srgb_format_linear()
functions.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-01-23 08:13:13 -07:00
José Fonseca
ab6f9fccd4 radeon: More missing stdio.h includes. 2014-01-23 14:20:20 +00:00
José Fonseca
fa75cc4b89 os/os_thread: Revert pipe_barrier pre-processing logic.
Whitelist platforms instead of blacklisting, as several pthread
implementations are missing pthread_barrier_t, in particular MacOSX.
2014-01-23 13:44:10 +00:00
José Fonseca
cd978ce26a c11: Fix missing pthread_mutex_timedlock declaration warnings on MacOSX. 2014-01-23 13:42:38 +00:00
José Fonseca
6b6fdb6aa9 radeon: Adding missing stdio.h include.
Became apparent with the C11 thread changes.  Unfortunately I didn't
have all dependencies to build the driver, and only noticed
this issue on build server.
2014-01-23 13:23:43 +00:00
José Fonseca
ab5dc45b2f mapi: Prevent cast from pointer to integer of different size.
On Windows64.
2014-01-23 13:21:52 +00:00
José Fonseca
799f30f385 c11: Update docs/license.html and include verbatim copy of Boost license. 2014-01-23 12:55:55 +00:00
José Fonseca
f298720cbc egl: Use C11 thread abstractions.
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2014-01-23 12:55:55 +00:00
José Fonseca
54876afcf0 mapi: Use C11 thread abstractions.
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2014-01-23 12:55:55 +00:00
José Fonseca
fd33a6bcd7 gallium: Use C11 thread abstractions.
Note that PIPE_ROUTINE now returns an int.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2014-01-23 12:55:55 +00:00
José Fonseca
ecaa81bd96 c11: Import threads.h emulation library.
Implementation is based of https://gist.github.com/2223710 with the
following modifications:
- inline implementatation
- retain XP compatability
- add temporary hack for static mutex initializers (as they are not part
  of the stack but still widely used internally)
- make TIME_UTC a conditional macro (some system headers already define
  it, so this prevents conflict)
- respect HAVE_PTHREAD macro

Reviewed-by: Brian Paul <brianp@vmware.com>
Acked-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Chad Versace <chad.versace@linux.intel.com>
2014-01-23 12:55:55 +00:00
José Fonseca
349f0a94ae os: Remove pipe_static_condvar.
Never used.

Reviewed-by: Brian Paul <brianp@vmware.com>
2014-01-23 12:55:55 +00:00
Timothy Arceri
815e064fb6 docs: Mark ARB_arrays_of_arrays as started
Signed-off-by: Timothy Arceri <t_arceri@yahoo.com.au>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2014-01-23 23:37:37 +11:00
Timothy Arceri
b0c64d3cc6 glsl: remove remaining is_array variables
Previously the reason we needed is_array was because we used array_size == NULL to
 represent both non-arrays and unsized arrays.  Now that we use a non-NULL
array_specifier to represent an unsized array, is_array is redundant.

Signed-off-by: Timothy Arceri <t_arceri@yahoo.com.au>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2014-01-23 23:37:37 +11:00
Timothy Arceri
61a5846099 glsl: create type name for arrays of arrays
We need to insert outermost dimensions in the correct spot otherwise
 the dimension order will be backwards

Signed-off-by: Timothy Arceri <t_arceri@yahoo.com.au>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2014-01-23 23:37:36 +11:00
Timothy Arceri
3d492f19f6 glsl: Allow arrays of arrays as input to vertex shader
Signed-off-by: Timothy Arceri <t_arceri@yahoo.com.au>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2014-01-23 23:37:36 +11:00
Timothy Arceri
3dc932d450 glsl: only call mark_max_array if we are assigning an
array

This change does not help fix or prevent any bugs
it just seems reasonable to do

Signed-off-by: Timothy Arceri <t_arceri@yahoo.com.au>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2014-01-23 23:37:36 +11:00
Timothy Arceri
bfb48750f0 glsl: Add ARB_arrays_of_arrays support to yacc definition and ast
Adds array specifier object to hold array information

Signed-off-by: Timothy Arceri <t_arceri@yahoo.com.au>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2014-01-23 23:31:10 +11:00
Timothy Arceri
72288e0c7b mesa: Add ARB_arrays_of_arrays
Signed-off-by: Timothy Arceri <t_arceri@yahoo.com.au>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2014-01-23 23:15:29 +11:00
Topi Pohjolainen
bda88f121b i965/blorp: switch eu-emitter to use FS IR and fs_generator
No regressions on IVB (piglit quick + unit tests).

v2 (Paul):
  - no need to patch the unit tests anymore. Original logic
    was altered and unit tests updated to match the
    fs-generator
  - lrp emission moves from the blorp compiler core into the
    emitter here (previously there was a separate refactoring
    patch which is not really needed anymore as the lrp logic
    got refactored when the original lrp logic got fixed).
  - pass 'BRW_BLORP_RENDERBUFFER_BINDING_TABLE_INDEX' to the
    generator in fs_inst::target instead of hardcoding it

Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2014-01-23 08:47:12 +02:00
Topi Pohjolainen
8f3e5363ad i965/fs: add support for BRW_OPCODE_AVG in fs_generator
Needed for compiling blorp blit programs.

Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2014-01-23 08:47:12 +02:00
Topi Pohjolainen
9927d7ae68 i965/fs: introduce blorp specific rt-write for fs_generator
The compiler for blorp programs likes to emit instructions for
the message construction itself meaning that the generator needs
to skip any such when blorp programs are translated for the hw.
In addition, the binding table control is special for blorp
programs and the generator does not need to update the binding
tables associated with the compiler bookkeeping (this in fact
gets thrown away as the blorp compiler sets the program data
in its own way).

v2 (Paul): do not hardcode the binding table index but use
           fs_inst::target instead.

Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2014-01-23 08:46:57 +02:00
Topi Pohjolainen
85fc724df5 i965/fs: allow unit tests to dump the final patched assembly
Unit tests comparing generated blorp programs to known good need
to have the dump in designated file instead of in default
standard output. The comparison also expects the jump counters
of if-else-instructions to be correctly set and hence the dump
needs to be taken _after_ 'patch_IF_ELSE()' is run (the default
dump of the fs_generator does this before).

v2 (Paul): dropped the redundant 'dump_enabled' argument

Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2014-01-23 08:45:57 +02:00
Topi Pohjolainen
757b4cf011 i965/blorp: wrap brw_IF/ELSE/ENDIF() into eu-emitter
v2 (Paul): renamed emit_if() to emit_cmp_if()

Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2014-01-23 08:45:53 +02:00
Topi Pohjolainen
8c0030678a i965/blorp: wrap RNDD (/brw_RNDD(&func, /emit_rndd(/)
Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2014-01-23 08:45:51 +02:00
Topi Pohjolainen
44524cb42f i965/blorp: wrap FRC (/brw_FRC(&func, /emit_frc(/)
Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2014-01-23 08:45:49 +02:00
Topi Pohjolainen
f9d875926e i965/blorp: wrap MUL (/brw_MUL(&func, /emit_mul(/)
Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2014-01-23 08:45:47 +02:00
Topi Pohjolainen
bbab8068d2 i965/blorp: wrap OR (/brw_OR(&func, /emit_or(/)
Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2014-01-23 08:45:44 +02:00
Topi Pohjolainen
de6ea2fe25 i965/blorp: wrap SHL (/brw_SHL(&func, /emit_shl(/)
Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2014-01-23 08:45:42 +02:00
Topi Pohjolainen
d256a5f843 i965/blorp: wrap SHR (/brw_SHR(&func, /emit_shr(/)
Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2014-01-23 08:45:39 +02:00
Topi Pohjolainen
0df1f5ce4e i965/blorp: wrap ADD (/brw_ADD(&func, /emit_add(/)
In addition, the special case requiring explicit execution size
control is wrapped manually.

Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2014-01-23 08:45:37 +02:00
Topi Pohjolainen
c777e72bd8 i965/blorp: wrap AND (/brw_AND(&func, /emit_and(/)
Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2014-01-23 08:45:34 +02:00
Topi Pohjolainen
8b5fd98043 i965/blorp: wrap MOV (/brw_MOV(&func, /emit_mov(/)
In addition, the two special cases requiring explicit execution
size control are wrapped manually.

Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2014-01-23 08:45:30 +02:00
Topi Pohjolainen
250494f742 i965/blorp: wrap emission of if-equal-assignment
Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2014-01-23 08:45:28 +02:00
Topi Pohjolainen
9e9617f797 i965/blorp: wrap emission of conditional assignment
Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2014-01-23 08:45:25 +02:00
Topi Pohjolainen
8c42ade7a4 i965/blorp: move emission of sample combining into eu-emitter
v2 (Paul): pass the combining opcode as an argument to emit_combine().
           This keeps manual_blend_average() selfcontained
           documentation wise.

Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2014-01-23 08:45:16 +02:00
Topi Pohjolainen
ecf795615c i965/blorp: move emission of rt-write into eu-emitter
Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2014-01-23 08:45:13 +02:00
Topi Pohjolainen
aac6bace9f i965/blorp: move emission of texture lookup into eu-emitter
Resolving of the hardware message type is moved into the
emitter also in preparation for switching to use fs_generator.
The generator wants to translate the high level op-code into
the message type and hence the emitter needs to know the
original op-code.

Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2014-01-23 08:45:10 +02:00
Topi Pohjolainen
41d397f22b i965/fs: introduce non-compressed equivalent of tex_cms
v2: introduces 'SHADER_OPCODE_TXF_UMS' also for gen8

Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2014-01-23 08:45:04 +02:00
Topi Pohjolainen
ce527a6722 i965: rename tex_ms to tex_cms
Prepares for the introduction of non-compressed multi-sampled
lookup used in the blorp programs.

v2: now also taking into account gen8

Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2014-01-23 08:44:58 +02:00
Topi Pohjolainen
3c44e43357 i965/blorp: move emission of pixel kill into eu-emitter
The combination of four separate comparison operations and
and the masked "and" require special treatment when moving
to FS LIR.

Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2014-01-23 08:44:52 +02:00
Topi Pohjolainen
f031487dcb i965/blorp: introduce separate eu-emitter for blit compiler
Prepares for presenting blorp blit programs using FS IR that
allows EU-assembly generation using i965 glsl-compiler
backend (fs_generator).

v2: rebased on top of endif-jump counter fix (moving the
    added brw_set_uip_jip() into the emitter)

Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2014-01-23 08:44:44 +02:00
Kenneth Graunke
d8c7740dda i965: Support 32 texture image units on Haswell+.
The Intel closed source OpenGL driver recently began supporting 32
texture image units on Haswell.  This makes the open source driver
support 32 as well.

Earlier generations don't have the message header field required to
support more than 16 sampler states, so we continue to advertise 16
there.

On Haswell, this causes us to advertise:
- GL_MAX_TEXTURE_IMAGE_UNITS = 32
- GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS = 32
- GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS = 96
instead of the old values of 16, 16, and 48.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-01-22 17:18:58 -08:00
Kenneth Graunke
5a51a26804 i965/fs: Switch from BRW_MAX_TEX_UNIT to the actual limit.
BRW_MAX_TEX_UNIT is about to grow, but only Gen7+ will be able to
support the new larger value.  On older platforms, we don't want to
allocate the extra space - it would just be a waste.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-01-22 17:18:56 -08:00
Kenneth Graunke
50ce6f682d mesa: Bump MAX_TEXTURE_IMAGE_UNITS to 32.
This allows drivers to optionally support more than 16 texture units.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-01-22 17:18:55 -08:00
Kenneth Graunke
15fc919491 i965/vec4: Support arbitrarily large sampler state indices on Haswell+.
Like the scalar backend, we add an offset to the "Sampler State Pointer"
field to select a group of 16 samplers, then use the "Sampler Index"
field to select within that group.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-01-22 17:18:53 -08:00
Kenneth Graunke
d58e03fe4f i965/vec4: Refactor sampler message setup.
The next patch adds an additional case where the message header is
necessary.  So we want to do the g0 copy if inst->header_present is set,
rather than inst->texture_offset.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-01-22 17:18:51 -08:00
Kenneth Graunke
e0a5602911 i965/vec4: Don't set header_present if texel offsets are all 0.
In theory, a shader might use textureOffset() but set all the texel
offsets to zero.  In that case, we don't actually need to set up the
message header - zero is the implicit default.

By moving the texture_offset setup before the header_present setup, we
can easily only set header_present when there are non-zero texel offset
values.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-01-22 17:18:49 -08:00
Kenneth Graunke
6943ac0bd9 i965/fs: Support arbitrarily large sampler state indices on Haswell+.
The message descriptor's "Sampler Index" field is only 4 bits (on all
generations of hardware), so it can only represent indices 0 through 15.

Haswell introduced a new field in the message header - "Sampler State
Pointer".  Normally, this is copied straight from g0, but we can also
add a byte offset (as long as it's a multiple of 32).

This patch uses a "Sampler State Pointer" offset to select a group of
16 sampler states, and then uses the "Sampler Index" field to select
the state within that group.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-01-22 17:18:48 -08:00
Kenneth Graunke
d7450e52e6 i965/fs: Plumb sampler index into emit_texture_gen7.
We'll need this in the next patch.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-01-22 17:18:46 -08:00
Kenneth Graunke
ebfe43d5ad i965/fs: Refactor sampler message header to duplicate less code.
Previously, the code to copy g0 to the message header existed in two
places - one for the texture offset case, and one for any other case.

By treating texture_offset as a special case of header_present, we can
remove this duplication and shorten the code.  Future patches which add
new header fields also won't have to add additional duplication.

This also clarifies a confusing construct.  The old code contained:

   } else if (inst->header_present) {
      if (brw->gen >= 7) {
         ...explicit copy from g0 to the message header...
      } else {
         /* Set up an implied move from g0 to the MRF. */
      }
   }

This looks like it might set up an implied move on Sandybridge, which
doesn't support those.  However, Sandybridge only uses a message header
for texture offsets, so it would never hit this code path.  The new code
avoids this implicit knowledge by only setting up an implied move on
Gen4-5.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-01-22 17:18:42 -08:00
Kenneth Graunke
87e7326735 i965: Use get_element_ud to shorten texture header access.
This is shorter, easier to read, and further from the 80 column limit.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-01-22 17:18:18 -08:00
Marek Olšák
d40532f260 gallium/util: util_format_srgb should not return FORMAT_NONE for sRGB formats
This fixes a serious regression introduced
in 4e549ddb50.

Cc: 9.2 10.0 <mesa-stable@lists.freedesktop.org>

Reviewed-by: Brian Paul <brianp@vmware.com>
2014-01-23 01:47:14 +01:00
Marek Olšák
d382e90614 gallium: remove PIPE_CAP_SCALED_RESOLVE
If any driver doesn't support this, it can use a blit after resolving
the samples.

Reviewed-by: Brian Paul <brianp@vmware.com>
2014-01-23 01:47:14 +01:00
Marek Olšák
a8930adbf8 radeonsi: use hardware scissors correctly
Use the WINDOW and VPORT scissors for the framebuffer and scissor test,
respectively. The other two scissors are disabled (they cover the max fb size).

We actually have 16 VPORT scissors, which will map well to ARB_viewport_array.

Also, we don't need to write SC_WINDOW_OFFSET with this commit, because it's
disabled everywhere.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2014-01-23 01:47:14 +01:00
Marek Olšák
69c29cb147 radeonsi: handle R600_CONTEXT_PS_PARTIAL_FLUSH in si_emit_cache_flush
For consistency only, This is unused by radeonsi currently.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-01-23 01:47:14 +01:00
Marek Olšák
5dfb10b2f5 r600g,radeonsi: if discarding whole buffer range, discard whole resource instead
Also set the unsynchronized flag if the whole resource was discarded
to avoid doing buffer-busy checks again.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-01-23 01:47:14 +01:00
Marek Olšák
ee0dc659c8 gallium/u_upload_mgr: don't expose u_upload_flush
It's unused and shouldn't be used at all in my opinion.

If some driver doesn't support the unsynchronized flag, u_upload_mgr should
avoid the synchronization by other means, e.g. by using the DONTBLOCK flag.
2014-01-23 01:47:14 +01:00
Marek Olšák
0c20bff4b6 gallium/hud: just unmap the upload vertex buffer instead of recreating it 2014-01-23 01:47:14 +01:00
Marek Olšák
2b033f3aab gallium/vl: use u_upload_mgr to upload vertices for vl_compositor
This is the recommended way for streaming vertices. Always use this if you
need to upload vertices every frame.

Reviewed-by: Christian König <christian.koenig@amd.com>
2014-01-23 01:47:14 +01:00
Kristian Høgsberg
11baad3508 intel: Fix initial MakeCurrent for single-buffer drawables
Commit 05da4a7a5e attempts to eliminate the
call to intel_update_renderbuffer() in the case where we already have a
drawbuffer for the drawable.  Unfortunately this only checks the
back left renderbuffer, which breaks in case of single buffer drawables.

This means that the initial viewport will not be set in that case.  Instead,
we now check whether the initial viewport has not been set, in which case
we call out to intel_update_renderbuffer().

https://bugs.freedesktop.org/show_bug.cgi?id=73862

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
2014-01-22 12:30:59 -08:00
Paul Berry
0da1a2cc36 glsl: Simplify aggregate type inference to prepare for ARB_arrays_of_arrays.
Most of the time it is not necessary to perform type inference to
compile GLSL; the type of every expression can be inferred from the
contents of the expression itself (and previous type declarations).
The exception is aggregate initializers: their type is determined by
the LHS of the variable being assigned to.  For example, in the
statement:

   mat2 foo = { { 1, 2 }, { 3, 4 } };

the type of { 1, 2 } is only known to be vec2 (as opposed to, say,
ivec2, uvec2, int[2], or a struct) because of the fact that the result
is being assigned to a mat2.

Previous to this patch, we handled this situation by doing some type
inference during parsing: when parsing a declaration like the one
above, we would call _mesa_set_aggregate_type(), which would infer the
type of each aggregate initializer and store it in the corresponding
ast_aggregate_initializer::constructor_type field.  Since this
happened at parse time, we couldn't do the type inference using
glsl_type objects; we had to use ast_type_specifiers, which are much
more awkward to work with.  Things are about to get more complicated
when we add support for ARB_arrays_of_arrays.

This patch simplifies things by postponing the call to
_mesa_set_aggregate_type() until ast-to-hir time, when we have access
to glsl_type objects.  As a side benefit, we only need to have one
call to _mesa_set_aggregate_type() now, instead of six.

Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-01-22 11:08:30 -08:00
Jan Vesely
6ec210989f clover: Don't crash on NULL global buffer objects.
Specs say "If the argument is a buffer object, the arg_value
pointer can be NULL or point to a NULL value in which case a NULL
value will be used as the value for the argument declared as a
pointer to __global or __constant memory in the kernel."

So don't crash when somebody does that.

v2: Insert NULL into input buffer instead of buffer handle pair
    Fix constant_argument too
    Drop r600 driver changes

v3: Fix inserting NULL pointer

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2014-01-22 13:30:35 +01:00
Vinson Lee
6caf34b97e meta: Move loop variable declaration outside loop.
Fixes MSVC build error introduced with commit
69b258cb46.

meta.c(618) : error C2143: syntax error : missing ';' before 'type'
meta.c(618) : error C2143: syntax error : missing ')' before 'type'
meta.c(618) : error C2065: 'i' : undeclared identifier
meta.c(618) : warning C4552: '<' : operator has no effect; expected operator with side-effect
meta.c(618) : error C2059: syntax error : ')'
meta.c(618) : error C2143: syntax error : missing ';' before '{'
meta.c(619) : error C2065: 'i' : undeclared identifier
meta.c(620) : error C2065: 'i' : undeclared identifier

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
2014-01-21 22:59:16 -08:00
Topi Pohjolainen
8b16b0255b i965/blorp: use BRW_COMPRESSION_2NDHALF for second half LPR
No known bugs fixed but this is now in line with fs-generator.
No regresssions on IVB.

Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-01-22 08:13:32 +02:00
Topi Pohjolainen
89347dd61b i965/blorp: patch jump counters also for endif
No known bugs fixed but this is now in line with fs-generator.
No regresssions on IVB.

Eric further explained that:

  "The endif jump, since it's forward, is just an optimization to
   have set right -- otherwise, the GPU will just step forward
   instruction by instruction until it hits something else that
   updates the per-channel PC."

Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-01-22 08:13:32 +02:00
Paul Berry
1032c33cb9 mesa: Change redundant code into loops in texstate.c.
This is possible now that ctx->Shader.CurrentProgram is an array.

Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-01-21 20:25:52 -08:00
Paul Berry
6ac2e1e199 mesa: Change redundant code into loops in shaderapi.c.
This is possible now that ctx->Shader.CurrentProgram is an array.

Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-01-21 20:25:49 -08:00
Paul Berry
5808c44bab mesa: Remove ad-hoc arrays of gl_shader_program.
Now that we have a ctx->Shader.CurrentProgram array, we can just use
it directly.

Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-01-21 20:25:47 -08:00
Paul Berry
69b258cb46 meta: Replace save_state::{Vertex,Geometry,Fragment}Shader with an array.
Since ctx->Shader.Current{Vertex,Geometry,Fragment}Program is an
array, this allows some meta code to be rolled up into loops.

Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-01-21 20:25:44 -08:00
Paul Berry
b4b70674ea i965: Fix comments to refer to the new ctx->Shader.CurrentProgram array.
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-01-21 20:25:41 -08:00
Paul Berry
1aef45578c mesa: Fold long lines introduced by the previous patch.
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-01-21 20:25:38 -08:00
Paul Berry
3b22146dc7 mesa: Replace ctx->Shader.Current{Vertex,Fragment,Geometry}Program with an array.
These are replaced with
ctx->Shader.CurrentProgram[MESA_SHADER_{VERTEX,FRAGMENT,GEOMETRY}].
In patches to follow, this will allow us to replace a lot of ad-hoc
logic with a variable index into the array.

With the exception of the changes to mtypes.h, this patch was
generated entirely by the command:

    find src -type f '(' -iname '*.c' -o -iname '*.cpp' ')' \
    -print0 | xargs -0 sed -i \
    -e 's/\.CurrentVertexProgram/.CurrentProgram[MESA_SHADER_VERTEX]/g' \
    -e 's/\.CurrentGeometryProgram/.CurrentProgram[MESA_SHADER_GEOMETRY]/g' \
    -e 's/\.CurrentFragmentProgram/.CurrentProgram[MESA_SHADER_FRAGMENT]/g'

Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-01-21 20:25:02 -08:00
Paul Berry
cd18ba1c7a glsl/linker: Refactor in preparation for adding more shader stages.
Rather than maintain separately named arrays and counts for vertex,
geometry, and fragment shaders, just maintain these as arrays indexed
by the gl_shader_type enum.

v2: When there is neither a vertex nor a geometry shader, set
prog->LastClipDistanceArraySize = 0, and clarify that the values is
not used.

Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-01-21 20:24:59 -08:00
Paul Berry
4a91675b26 mesa: use _mesa_validate_shader_target() more frequently.
This patch replaces code in _mesa_new_shader() and delete_shader_cb()
that checks the type of a shader with calls to
_mesa_validate_shader_target().  This has two advantages: it allows
for a more thorough check (since _mesa_validate_shader_target()
doesn't permit shader targets that aren't supported by the back-end),
and it reduces the amount of code that will need to be modified when
adding new shader stages.

Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-01-21 20:24:56 -08:00
Paul Berry
020919b2ae main: Allow ctx == NULL in _mesa_validate_shader_target().
This will allow this function to be used in circumstances where there
is no context available, such as when building built-in GLSL
functions.

Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-01-21 20:24:54 -08:00
Paul Berry
6ab2a6148a mesa: Make validate_shader_target() non-static.
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-01-21 20:24:49 -08:00
Paul Berry
46d210d38f mesa: Replace _mesa_program_index_to_target with _mesa_shader_stage_to_program.
In my recent zeal to refactor Mesa's handling of the gl_shader_stage
enum, I accidentally wound up with two functions that do the same
thing: _mesa_program_index_to_target(), and
_mesa_shader_stage_to_program().

This patch keeps _mesa_shader_stage_to_program(), since its name is
more consistent with other related functions.  However, it changes the
signature so that it accepts an unsigned integer instead of a
gl_shader_stage--this avoids awkward casts when the function is called
from C++ code.

Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-01-21 20:24:43 -08:00
Dave Airlie
2212a97fe3 llvmpipe: dump geometry shaders when using LP_DEBUG=tgsi
for consistency with vs and fs dumpers.

Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-01-22 14:08:03 +10:00
Ian Romanick
178c1bf1ad mesa: Generate GL_INVALID_OPERATION for unsupported DSA TexStorage functions
We have to make the functions available to work around a GLEW bug (see
comments already in the code), but if an application calls one of these
functions we should still generate GL_INVALID_OPERATION.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-01-21 15:39:54 -08:00
Ian Romanick
17594dccfd mesa: Silence many unused parameter warnings
main/texstorage.c: In function '_mesa_alloc_texture_storage':
main/texstorage.c:240:53: warning: unused parameter 'width' [-Wunused-parameter]
main/texstorage.c:241:37: warning: unused parameter 'height' [-Wunused-parameter]
main/texstorage.c:241:53: warning: unused parameter 'depth' [-Wunused-parameter]
main/texstorage.c: In function '_mesa_TextureStorage1DEXT':
main/texstorage.c:464:34: warning: unused parameter 'texture' [-Wunused-parameter]
main/texstorage.c:464:50: warning: unused parameter 'target' [-Wunused-parameter]
main/texstorage.c:464:66: warning: unused parameter 'levels' [-Wunused-parameter]
main/texstorage.c:465:34: warning: unused parameter 'internalformat' [-Wunused-parameter]
main/texstorage.c:466:35: warning: unused parameter 'width' [-Wunused-parameter]
main/texstorage.c: In function '_mesa_TextureStorage2DEXT':
main/texstorage.c:473:34: warning: unused parameter 'texture' [-Wunused-parameter]
main/texstorage.c:473:50: warning: unused parameter 'target' [-Wunused-parameter]
main/texstorage.c:473:66: warning: unused parameter 'levels' [-Wunused-parameter]
main/texstorage.c:474:34: warning: unused parameter 'internalformat' [-Wunused-parameter]
main/texstorage.c:475:35: warning: unused parameter 'width' [-Wunused-parameter]
main/texstorage.c:475:50: warning: unused parameter 'height' [-Wunused-parameter]
main/texstorage.c: In function '_mesa_TextureStorage3DEXT':
main/texstorage.c:483:34: warning: unused parameter 'texture' [-Wunused-parameter]
main/texstorage.c:483:50: warning: unused parameter 'target' [-Wunused-parameter]
main/texstorage.c:483:66: warning: unused parameter 'levels' [-Wunused-parameter]
main/texstorage.c:484:34: warning: unused parameter 'internalformat' [-Wunused-parameter]
main/texstorage.c:485:35: warning: unused parameter 'width' [-Wunused-parameter]
main/texstorage.c:485:50: warning: unused parameter 'height' [-Wunused-parameter]
main/texstorage.c:485:66: warning: unused parameter 'depth' [-Wunused-parameter]

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-01-21 15:39:54 -08:00
Anuj Phogat
f5cfb4ae21 i965: Ignore 'centroid' interpolation qualifier in case of persample shading
This patch handles the use of 'centroid' qualifier with 'in' variables
in a fragment shader when persample shading is enabled. Per sample
shading for the whole fragment shader can be enabled by:
glEnable(GL_SAMPLE_SHADING) or using {gl_SamplePosition, gl_SampleID}
builtin variables in fragment shader. Explaining it below in more
detail.

/* Enable sample shading using OpenGL API */
glEnable(GL_SAMPLE_SHADING);
glMinSampleShading(1.0);

Example fragment shader:
in vec4 a;
centroid in vec4 b;
main()
{
  ...
}

Variable 'a' will be interpolated at sample location. But, what
interpolation should we use for variable 'b' ?

ARB_sample_shading recommends interpolation at sample position for
all the variables. GLSL 400 (and earlier) spec says that:

"When an interpolation qualifier is used, it overrides settings
established through the OpenGL API."
But, this text got deleted in later versions of GLSL.

NVIDIA's and AMD's proprietary linux drivers (at OpenGL 4.3)
interpolates at sample position. This convinces me to use
the similar approach on intel hardware.

Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-01-21 14:42:28 -08:00
Anuj Phogat
a92e5f7cf6 i965: Use sample barycentric coordinates with per sample shading
Current implementation of arb_sample_shading doesn't set 'Barycentric
Interpolation Mode' correctly. We use pixel barycentric coordinates
for per sample shading. Instead we should select perspective sample
or non-perspective sample barycentric coordinates.

It also enables using sample barycentric coordinates in case of a
fragment shader variable declared with 'sample' qualifier.
e.g. sample in vec4 pos;

A piglit test to verify the implementation has been posted on piglit
mailing list for review.

V2: Do not interpolate all the 'in' variables at sample position
    if fragment shader uses 'sample' qualifier with one of them.
    For example we have a fragment shader:
    #version 330
    #extension ARB_gpu_shader5: require
    sample in vec4 a;
    in vec4 b;
    main()
    {
      ...
    }

    Only 'a' should be sampled at sample location, not 'b'.

Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-01-21 14:42:27 -08:00
Anuj Phogat
3313cc269b i965: Add an option to ignore sample qualifier
This will be useful in my next patch which depends on a functionality
of _mesa_get_min_invocations_per_fragment() to ignore the sample
qualifier (prog->IsSample) based on a flag passed to it.

Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-01-21 14:42:27 -08:00
Matt Turner
78d65476b6 mesa/x86: Remove dead read_rgba_span_x86.h.
Dead since 304f7a13.
2014-01-21 14:20:44 -08:00
Matt Turner
bf0773aeca i965/fs: Optimize LRP with x == y into a MOV.
total instructions in shared programs: 1487331 -> 1485988 (-0.09%)
instructions in affected programs:     45638 -> 44295 (-2.94%)
GAINED:                                7
LOST:                                  0

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-01-21 14:20:44 -08:00
Jordan Justen
8d37e9915a glsl: Optimize open-coded lrp into lrp.
total instructions in shared programs: 1498191 -> 1487051 (-0.74%)
instructions in affected programs:     669388 -> 658248 (-1.66%)
GAINED:                                1
LOST:                                  0

Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
2014-01-21 14:20:44 -08:00
Matt Turner
13100ac142 i965: Enable AOS optimizations for the geometry shader.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-01-21 14:20:44 -08:00
Matt Turner
4bd6e0d7c6 glsl: Vectorize multiple scalar assignments
Reduces vertex shader instruction counts in DOTA2 by 6.42%, L4D2 by
4.61%, and CS:GO by 5.71%.

total instructions in shared programs: 1500153 -> 1498191 (-0.13%)
instructions in affected programs:     59919 -> 57957 (-3.27%)

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-01-21 14:20:44 -08:00
Matt Turner
5e82d8a9da glsl: Add parameter to .equals() to ignore an IR type.
Only implemented for ir_swizzles currently, but perhaps will be useful
for other IR types in the future.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-01-21 14:20:44 -08:00
Matt Turner
ebf91993c1 mesa: rename PreferDP4 to OptimizeForAOS.
This flag was really just a proxy for determining whether the backend
was vector (AOS) or scalar (SOA). It will be used to apply a future
optimization only for vector backends.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-01-21 14:20:44 -08:00
Matt Turner
413622fbef i965/fs: Print the maximum register pressure.
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-01-21 14:20:44 -08:00
Kenneth Graunke
391eaa59bd i965/fs: Show register pressure in dump_instructions() output.
Dumping the number of live registers at each IP allows us to see
register pressure and identify any local maxima.  This should
aid in debugging passes designed to reduce register pressure, as
well as optimizations that suddenly trigger spilling.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-01-21 14:20:44 -08:00
Kenneth Graunke
3b74f4b233 i965: Compute the number of live registers at each IP.
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2014-01-21 14:20:44 -08:00
Matt Turner
0ea600ef1a i965/fs: Call opt_peephole_sel later in the optimization loop.
Calling it after value numbering (added in the next commit) prevents
some instruction count regressions.

total instructions in shared programs: 1524387 -> 1523905 (-0.03%)
instructions in affected programs:     13112 -> 12630 (-3.68%)
GAINED:                                0
LOST:                                  3

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-01-21 14:09:33 -08:00
Matt Turner
ede6c341f6 i965/fs: Calculate interference better in register_coalesce.
Previously we simply considered two registers whose live ranges
overlapped to interfere. Cases such as

   set A     ------
   ...             |
   mov B, A  --    |
   ...         | B | A
   use B     --    |
   ...             |
   use A     ------

would be considered to interfere, even though B is an unmodified copy of
A whose live range fit wholly inside that of A.

If no writes to A or B occur between the mov B, A and the use of B then
we can safely coalesce them.

Instead of removing MOV instructions, we make them NOPs and remove them
at once after the main pass is finished in order to avoid recomputing
live intervals (which are needed to perform the previous step).

total instructions in shared programs: 1543768 -> 1513077 (-1.99%)
instructions in affected programs:     951563 -> 920872 (-3.23%)
GAINED:                                46
LOST:                                  22

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-01-21 14:09:33 -08:00
Matt Turner
4a7d0c550e i965/fs: Support coalescing registers of size > 1.
total instructions in shared programs: 1550048 -> 1549880 (-0.01%)
instructions in affected programs:     1896 -> 1728 (-8.86%)

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-01-21 14:09:33 -08:00
Matt Turner
78fa6172e1 i965/fs: Assert that var < num_vars.
Helped to track down a problem in a version of the next commit.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-01-21 14:09:33 -08:00
Matt Turner
9bb4d71fd2 i965/fs: Add a comment explaining how register coalescing works.
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-01-21 14:09:33 -08:00
Matt Turner
2dfb067139 i965/fs: Add and use MAX_SAMPLER_MESSAGE_SIZE definition.
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-01-21 14:09:33 -08:00
Matt Turner
81d52419cf mesa: Add STRINGIFY macro.
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-01-21 14:09:33 -08:00
Matt Turner
80b949f16b i965/fs: Fix the example about overwriting uniforms in SIMD16.
mov takes only a single source argument. Example instruction
inexplicably changed from add to mov in commit f10f5e49.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-01-21 14:09:33 -08:00
Matt Turner
71bc11a375 i965: Print reg_offset for vgrf of size > 1 in dump_instruction().
Previously we wouldn't print the +0 for the first part of a VGRF of size
greater than 1.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-01-21 14:09:33 -08:00
Grigori Goronzy
955c93dc08 glsl: Match unnamed record types across stages.
Unnamed record types are assigned to separate types per stage, e.g. if

uniform struct { ... } a;

is defined in both vertex and fragment shader, two separate types will
result with different names. When linking the shader, this results in a
type conflict. However, there is no reason why this should not be
allowed according to GLSL specifications. Compare and match record types
when linking shader stages to avoid this conflict.

Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-01-21 14:01:09 -08:00
Grigori Goronzy
41c9bf884f glsl: Extract function for record comparisons.
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-01-21 14:01:09 -08:00
Brian Paul
6d8cf5181a docs: remove some ancient README.* files
None of this info is relevant anymore.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-01-21 10:53:51 -08:00
Brian Paul
b9f68d927e svga: implement TGSI_PROPERTY_FS_COLOR0_WRITES_ALL_CBUFS
Fixes several colorbuffer tests, including piglit "fbo-drawbuffers-none"
for "gl_FragColor" and "glDrawPixels" cases.

v2: rework patch to only avoid creating extra shader variants when
TGSI_PROPERTY_FS_COLOR0_WRITES_ALL_CBUFS is not specified.  Per Jose.
Use a write_color0_to_n_cbufs key field to replicate color0 to N
color buffers only when N > 0 and WRITES_ALL_CBUFS is set.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2014-01-21 10:53:51 -08:00
Brian Paul
384fd64ab1 svga: rename color output variables
Just to be bit more readable.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2014-01-21 10:53:51 -08:00
Brian Paul
f6bc7d6586 svga: fix clearing for null color buffers
Fixes piglit "fbo-drawbuffers-none glClear" test.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2014-01-21 10:53:51 -08:00
Brian Paul
ff59b3d9ee mesa: add missing TYPE_DOUBLEN_2 cases in get.c
The new TYPE_DOUBLEN_2 type was added in 0e60d850 but the code to
return values of that type wasn't completed.

Fixes conform's default state test.  glGetFloatv(GL_DEPTH_RANGE)
wasn't returning anything.

v2: remove stray 'break' statements.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2014-01-21 10:53:12 -08:00
Paul Berry
51000c2ff8 i965: Modify some error messages to refer to "vec4" instead of "vs".
These messages are in code that is shared between the VS and GS
back-ends, so use the terminology "vec4" to avoid confusion.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-01-21 09:05:33 -08:00
Paul Berry
a4d68e9ee9 i965: Add GS support to INTEL_DEBUG=shader_time.
Previously, time spent in geometry shaders would be counted as part of
the vertex shader time.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-01-21 09:05:12 -08:00
Roland Scheidegger
e23e4f67be draw: fix points with negative w coords for d3d style point clipping
Even with depth clipping disabled, vertices which have negative w coords
must be discarded. And since we don't have a proper guardband implementation
yet (relying on driver to handle all values except infs/nans in rasterization
for such points) we need to kill them off manually (as they can end up with
coordinates inside viewport otherwise).

v2: use 0.0f instead of 0 (spotted by Brian).

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-01-21 17:49:02 +01:00
Kenneth Graunke
ad04e396fa i965: Reserve space for "Vertex Count" in GS outputs.
v2: Also increment ir->offset in the GS visitor, rather than at the
    final assembly generation stage (requested by Paul).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2014-01-21 00:20:14 -08:00
Kenneth Graunke
94c0a11b19 i965: Update blitter code for 48-bit addresses.
v2: Rebase on Eric's SET_FIELD changes.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net> [v1]
2014-01-20 16:21:52 -08:00
Kenneth Graunke
23827756f3 i965: Update PIPE_CONTROL packet lengths for Broadwell.
On Broadwell, PIPE_CONTROL needs an extra DWord to accomodate the
48-bit addressing.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-01-20 15:38:24 -08:00
Kenneth Graunke
f7e76e00b6 i965: Re-combine the Gen4-5 and Gen6+ write_depth_count functions.
Now that we have a helper function that handles the PIPE_CONTROL
variations between the various platforms, these are basically the same.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-01-20 15:38:23 -08:00
Kenneth Graunke
f5dd608db2 i965: Create a helper function for emitting PIPE_CONTROL writes.
There are a lot of places that use PIPE_CONTROL to write a value to a
buffer (either an immediate write, TIMESTAMP, or PS_DEPTH_COUNT).
Creating a single function to do this seems convenient.

As part of this refactor, we now set the PPGTT/GTT selection bit
correctly on Gen7+.  Previously, we set bit 2 of DW2 on all platforms.
This is correct for Sandybridge, but actually part of the address on
Ivybridge and later!

Broadwell will also increase the length of these packets by 1; with the
refactoring, we should have to adjust that in substantially fewer
places, giving us confidence that we've hit them all.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-01-20 15:38:23 -08:00
Kenneth Graunke
35458a99c0 i965: Use full-length PIPE_CONTROL packets for workaround writes.
I believe that PIPE_CONTROL uses the length field to decide whether to
do 32-bit or 64-bit writes.  A length of 4 would do a 32-bit write,
while a length of 5 would do a 64-bit write.  (I haven't verified this,
though.)

For workaround writes, we don't care what value gets written, or how
much data.  We're only writing something because hardware bugs mandate
that do so.  So using a 64-bit write should be fine.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-01-20 15:38:23 -08:00
Kenneth Graunke
4b9e5c985c i965: Emit full-length PIPE_CONTROLs for (non-write) flushes.
The PIPE_CONTROL packet actually has 5 DWords on Gen6+:
1. Header
2. Flags
3. Address
4. Immediate Data: Lower DWord
5. Immediate Data: Upper DWord

We just never emitted the last one.  While it appears to work, it's
probably safer to emit the entire thing.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-01-20 15:38:23 -08:00
Kenneth Graunke
9420b577dd i965: Create a helper function for emitting PIPE_CONTROL flushes.
These days, we need to emit PIPE_CONTROL flushes all over the place.
Being able to do that via a single function call seems convenient.

Broadwell will also increase the length of these packets by 1; with the
refactoring, we should have to do this in substantially fewer places.

v2: Add back forgotten intel_emit_post_sync_nonzero_flush (caught by
    Eric Anholt).  Drop unlikely() from BLT_RING check.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-01-20 15:38:16 -08:00
Kenneth Graunke
ded5674689 i965: Fix MI_STORE_REGISTER_MEM for Broadwell.
It now takes a 48-bit address.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-01-20 15:12:23 -08:00
Kenneth Graunke
f11c1feaf7 i965: Introduce an OUT_RELOC64 macro.
Broadwell uses 48-bit addresses.  The first DWord is the low 32 bits,
and the second DWord is the high 16 bits.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-01-20 15:12:23 -08:00
Kenneth Graunke
67ebcb4711 i965: Use the new drm_intel_bo offset64 field.
libdrm 2.4.52 introduces a new 'uint64_t offset64' field, intended to
replace the old 'unsigned long offset' field.  To preserve ABI, libdrm
continues to store the presumed offset in both locations.

On Broadwell, a 64-bit kernel may place BOs at "high" (> 4G) addresses.
However, with a 32-bit userspace, the 'unsigned long offset' field will
only be 32-bit, which is not large enough to hold this value.  We need
to use a proper uint64_t (like the kernel does).

Technically, a lot of this code doesn't affect Broadwell, so we could
leave it using the old field.  But it makes sense to just switch to the
new, properly typed field.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-01-20 15:12:23 -08:00
Kenneth Graunke
77425ef91a build: Require libdrm 2.4.52 for Intel.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2014-01-20 15:12:23 -08:00
Kenneth Graunke
5f4eed3575 i965: Delete intel_batchbuffer_emit_reloc_fenced.
Nothing in i965 uses it.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-01-20 15:12:12 -08:00
Ian Romanick
4cd8011907 i915: Silence warning: unused parameter warning in intel_bufferobj_buffer
intel_buffer_objects.c: In function 'old_intel_bufferobj_buffer':
intel_buffer_objects.c:471:17: warning: unused parameter 'flag' [-Wunused-parameter]

The parameter hasn't been used since the i915 and i965 drivers had their
breakup.  i965 got the flags, and i915 got to cry itself to sleep.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-01-20 11:40:46 -08:00
Ian Romanick
8468f437e8 i915: Ensure that intel_bufferobj_map_range meets alignment guarantees
Not actually tested, but the changes are identical to the i965 changes
that are tested.

v2: Remove MAX2(64, ...).  Suggested by Ken (in the i965 version of this
patch).

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Cc: Siavash Eliasi <siavashserver@gmail.com>
2014-01-20 11:40:41 -08:00
Ian Romanick
1ec663ab19 i965: Ensure that intel_bufferobj_map_range meets alignment guarantees
No piglit regressions on IVB.

With minor tweaks to the arb_map_buffer_alignment-map-invalidate-range
test (disable the extension check, set alignment to 64 instead of
querying), the i965 driver would fail the test without this patch (as
predicted by Eric).  With this patch, it passes.

v2: Remove MAX2(64, ...).  Suggested by Ken.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Cc: Siavash Eliasi <siavashserver@gmail.com>
2014-01-20 11:40:34 -08:00
Ian Romanick
c2352a88ed docs: Note that GL_ARB_viewport_array is done on i965
At least for GEN7+, anyway.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-01-20 11:32:05 -08:00
Courtney Goeltzenleuchter
7837f425e7 i965: Enable ARB_viewport_array
v2 (idr): Only enable the extension on GEN7+ w/core profile because it
requires geometry shaders.

v3 (idr): Add some casting to fix setting of ViewportBounds.Min.
Negating an unsigned value, then casting to float doesn't do what you
might think it does.

Signed-off-by: Courtney Goeltzenleuchter <courtney@LunarG.com>
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-01-20 11:32:05 -08:00
Ian Romanick
d3ee8ba346 i965: Consider all viewports before enabling guardband clipping
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-01-20 11:32:05 -08:00
Ian Romanick
bdff9a6e47 i965: Consider only the scissor rectangle for viewport 0 for clears
noop_scissor (correctly) only examines the scissor rectangle for
viewport 0.  Therefore, it should only be called when that scissor
rectangle is enabled.

v2: Remove spurious change to radeon code.  Noticed by Ken.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-01-20 11:32:01 -08:00
Ian Romanick
2c27f1d47a i965: Set all the supported scissor rectangles for GEN7
Currently MaxViewports is still 1, so this won't affect any change.

v2: Minor code reformatting suggested by Ken.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-01-20 11:32:01 -08:00
Ian Romanick
a2b946cb35 mesa: Refactor bounding-box calculation out of _mesa_update_draw_buffer_bounds
Drivers that currently use _Xmin and friends to set their scissor
rectangle will need to use this code directly once they are updated for
GL_ARB_viewport_array.

v2: Use different bit-test idiom and fix mixed tabs and spaces.  Both
were suggested by Ken.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-01-20 11:32:01 -08:00
Ian Romanick
d989c4b134 i965: Set all the supported viewports for GEN7
Currently MaxViewports is still 1, so this won't affect any change.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-01-20 11:32:01 -08:00
Ian Romanick
fceb8b55c0 i965: Emit writes to viewport index
This variable is handled in a fashion identical to gl_Layer.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-01-20 11:32:01 -08:00
Ian Romanick
37f65b0751 i965: Set the maximum VPIndex
At various stages the hardware clamps the gl_ViewportIndex to these
values.  Setting them to zero effectively makes gl_ViewportIndex be
ignored.  This is acutally useful in blorp (so that we don't have to
modify all of the viewport / scissor state).

v2: Use INTEL_MASK to create GEN6_CLIP_MAX_VP_INDEX_MASK.  Suggested by
Ken.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-01-20 11:32:01 -08:00
Courtney Goeltzenleuchter
9ef16befd0 mesa: Add ARB_viewport_array plumbing
Define API connections to extension entry points added in previous
commits. Update entry points to use floating point arguments as
required by the extension.
Add get tokens for ARB_viewport_array state.

v2: Include review feedback.

v3 (idr): Fix 'make check'.  Add missing Get infrastructure (some was
culled from other pathces).

Signed-off-by: Courtney Goeltzenleuchter <courtney@LunarG.com>
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-01-20 11:32:00 -08:00
Courtney Goeltzenleuchter
c2eefb06aa glsl: Add gl_ViewportIndex built-in variable
v2 (idr): Fix copy-and-paste bug... s/LAYER/VIEWPORT/

Signed-off-by: Courtney Goeltzenleuchter <courtney@LunarG.com>
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-01-20 11:32:00 -08:00
Ian Romanick
5439964270 glsl: Add extension infrastructure for ARB_viewport_array
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-01-20 11:32:00 -08:00
Ian Romanick
3815264d7d mesa: Add varying slot for viewport index
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-01-20 11:32:00 -08:00
Courtney Goeltzenleuchter
86231c4ab3 mesa: Add new viewport and depth-range entry points for GL_ARB_viewport_array
v2 (idr): Use set_viewport_no_notify / set_depth_range_no_notify (and
manually notify the driver) instead of calling _mesa_set_viewporti /
_mesa_set_depthrangei.  Refactor bodies of _mesa_ViewportIndexed and
_mesa_ViewportIndexedv into a shared function.  Remove spurious CLAMP
calls in _mesa_DepthRangeArrayv and _mesa_DepthRangeIndexed.

v3 (idr): Add some missing return-statements after calls to _mesa_error.

v4 (idr): Only perform the ViewportBounds.Min / ViewportBounds.Max
clamping in set_viewport_no_notify if GL_ARB_viewport_array is enabled.
Otherwise the driver may not have set ViewportBounds, and the clamping
will do bad things.

Signed-off-by: Courtney Goeltzenleuchter <courtney@LunarG.com>
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-01-20 11:32:00 -08:00
Courtney Goeltzenleuchter
0a7baa68a8 mesa: Add new scissor entry points for GL_ARB_viewport_array
v2 (idr): Use set_scissor_no_notify (and manually notify the driver)
instead of calling _mesa_set_scissori.  Refactory bodies of
_mesa_ScissorIndexed and _mesa_ScissorIndexedv into a shared function.
Perform parameter validation in the same order in all three functions.
Pull MaxViewports comparison fix (in _mesa_ScissorArrayv) from the next
patch to this patch.

Signed-off-by: Courtney Goeltzenleuchter <courtney@LunarG.com>
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-01-20 11:32:00 -08:00
Courtney Goeltzenleuchter
917db0bc3d mesa: Add custom get function for SCISSOR_TEST to _mesa_IsEnabledi
Now that the scissor enable state is a bitfield need a custom function
to extract the correct value from gl_context.  Modeled
Scissor.EnableFlags after Color.BlendEnabled.

Signed-off-by: Courtney Goeltzenleuchter <courtney@LunarG.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-01-20 11:32:00 -08:00
Courtney Goeltzenleuchter
6d9c0011a0 mesa: Add new get entrypoints for ARB_viewport_array
v2 (idr): Fix several "comparison between signed and unsigned integer
expressions" warnings.

Signed-off-by: Courtney Goeltzenleuchter <courtney@LunarG.com>
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-01-20 11:32:00 -08:00
Ian Romanick
a4bc73f7ba mesa: Change parameter to _mesa_set_viewport to float
This matches the expectations of GL_ARB_viewport_array and the storage
type where the values will land.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-01-20 11:32:00 -08:00
Ian Romanick
91ad851876 meta: Restore all scissor state
Previously the restore code would enable all scissor rectangles if any
scissor rectangles were enabled on entry to meta.  When there is only
one scissor rectangle, this is fine.  As soon as a driver supports
multiple viewports, this will be a problem.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-01-20 11:31:59 -08:00
Ian Romanick
6d3b1dc150 mesa: Set all scissor rects
In _mesa_Scissor, make sure that ctx->Driver.Scissor is only called once
instead of once per scissor rectangle.

v2: Use MAX_VIEWPORTS instead of ctx->Const.MaxViewports because the
driver may not set ctx->Const.MaxViewports yet.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-01-20 11:31:59 -08:00
Ian Romanick
454cec4299 mesa: Set all viewports from _mesa_Viewport and _mesa_DepthRange
In _mesa_Viewport and _mesa_DepthRange, make sure that
ctx->Driver.Viewport is only called once instead of once per viewport or
depth range.

v2: Make _mesa_DepthRange actually set all of the depth ranges (instead
of just index 0).  Noticed by Ken.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-01-20 11:31:59 -08:00
Ian Romanick
562f353434 mesa: Restore all the viewports in _mesa_PopAttrib
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-01-20 11:31:59 -08:00
Ian Romanick
c65db3ebed mesa: Restore all the scissor rectangles in _mesa_PopAttrib
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-01-20 11:31:59 -08:00
Ian Romanick
9de863603d mesa: Initialize all the viewports
v2: Use MAX_VIEWPORTS instead of ctx->Const.MaxViewports because the
driver may not set ctx->Const.MaxViewports yet.

v3: Handle all viewport entries in update_viewport_matrix and
_mesa_copy_context too.  This was previously in an earlier patch.
Having the code in the earlier patch could cause _mesa_copy_context to
access a matrix that hadn't been constructed.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> [v2]
2014-01-20 11:31:59 -08:00
Ian Romanick
f6d7cd4a11 mesa: Add an index parameter to _mesa_set_scissor
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-01-20 11:31:59 -08:00
Ian Romanick
5232a7ded0 mesa: Refactor scissor rectangle setting even more
Create an internal function that just writes data into the scissor
rectangle.  In future patches this will see more use because we only
want to call dd_function_table::Scissor once after setting all of the
scissor rectangles instead of once per scissor rectangle.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-01-20 11:31:59 -08:00
Ian Romanick
799265aadc mesa: Refactor viewport setting even more
Create an internal function that just writes data into the viewport.  In
future patches this will see more use because we only want to call
dd_function_table::Viewport once after setting all of the viewport
instead of once per viewport.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-01-20 11:31:59 -08:00
Ian Romanick
42f916e150 mesa: Refactor depth range setting even more
Create an internal function that just writes data into the depth range.
In future patches this will see more use because we only want to call
dd_function_table::DepthRange once after setting all of the depth ranges
instead of once per depth range.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-01-20 11:31:58 -08:00
Ian Romanick
3eb135d1c7 mesa: Add an index parameter to _mesa_set_viewport
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-01-20 11:31:58 -08:00
Courtney Goeltzenleuchter
cbb271a488 mesa: Convert gl_context::Viewport to gl_context::ViewportArray
Only element 0 of the array is used anywhere at this time, so there
should be no changes.

v4: Split out from a single megapatch.  Suggested by Ken.

Signed-off-by: Courtney Goeltzenleuchter <courtney@LunarG.com>
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-01-20 11:31:56 -08:00
Courtney Goeltzenleuchter
5b84226c31 mesa: Converty gl_viewport_attrib::X, ::Y, ::Width, and ::Height to float
v4: Split out from a single megapatch.  Suggested by Ken.  Also make
meta's save_state::ViewportX, ::ViewportY, ::ViewportW, and ::ViewportH
to match gl_viewport_attrib.

Signed-off-by: Courtney Goeltzenleuchter <courtney@LunarG.com>
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-01-20 11:31:53 -08:00
Courtney Goeltzenleuchter
d4dc359875 mesa: Convert gl_viewport_attrib::Near and ::Far to double
v4: Split out from a single megapatch.  Suggested by Ken.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-01-20 11:31:50 -08:00
Courtney Goeltzenleuchter
0e60d85029 mesa: Allow glGet of values that are 2 doubles
This will be used when the viewport near and far plane are stored as
doubles instead of as floats.

v4 (idr): Split out from a single megapatch.  Suggested by Ken.  Also
drop value_double_4.  It's never used anywhere in the patch series.

Signed-off-by: Courtney Goeltzenleuchter <courtney@LunarG.com>
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-01-20 11:31:47 -08:00
Ian Romanick
83bd850cc7 mesa: Move parameter validation from _mesa_set_viewport to _mesa_Viewport
Internal callers should do the right thing.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-01-20 11:29:42 -08:00
Courtney Goeltzenleuchter
a9c73fb778 mesa: Update gl_scissor_attrib to support ARB_viewport_array
Update Mesa and drivers to access updated gl_scissor_attrib.
Now have an enable bitfield and array of gl_scissor_rects.
Drivers have been updated to the new scissor enable state
attribute (gl_context.scissor.EnableFlags) but still treat it
as a single boolean which is okay as mesa will only use
bit 0 when communicating with a driver that does not support
ARB_viewport_array.

v2 (idr): Rebase fixes.

v3 (idr): Small code formatting fix suggsted by Ken.

Signed-off-by: Courtney Goeltzenleuchter <courtney@LunarG.com>
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-01-20 11:29:42 -08:00
Ian Romanick
1f59e963b4 mesa: Add new constants related to GL_ARB_viewport_array
These limits will be queryable by GL_MAX_VIEWPORTS,
GL_VIEWPORT_SUBPIXEL_BITS, and GL_VIEWPORT_BOUNDS_RANGE.  Drivers that
actually implement the extension must set values for these constants
that comply with the minimum-maximums from the spec.

Most of these changes were part of other patches.  They were separated out
because it make reordering of later patches easier.  Also, MaxViewports wasn't
set by that patch, and I completely overlooked it in review.  It's now obvious
that it's set. :)

v2 (idr): Split these changes out from the original patches.  Keep
MaxViewportWidth and MaxViewportHeight as GLuint.

Signed-off-by: Courtney Goeltzenleuchter <courtney@LunarG.com>
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-01-20 11:29:41 -08:00
Courtney Goeltzenleuchter
b39bfa4f49 mesa: Add extension tracking bit for ARB_viewport_array
v2 (idr): Split these changes out from the original patch.  Only
advertise GL_ARB_viewport_array in a core profile because it requires
geometry shaders.

Signed-off-by: Courtney Goeltzenleuchter <courtney@LunarG.com>
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-01-20 11:29:41 -08:00
Brian Paul
d6b6ab51d4 draw: use some cast wrappers in draw_pt_fetch_shade_pipeline*.c
Trivial.
2014-01-20 11:01:48 -08:00
Brian Paul
807cbb9023 draw: whitespace and formatting fixes in draw_pt_fetch_shade_pipeline*.c
Trivial.
2014-01-20 11:00:32 -08:00
Brian Paul
ad814d04ca draw: fix incorrect vertex size computation in LLVM drawing code
We were calling draw_total_vs_outputs() too early.  The call to
draw_pt_emit_prepare() could result in the vertex size changing.
So call draw_total_vs_outputs() after draw_pt_emit_prepare().

This fix would seem to be needed for the non-LLVM code as well,
but it's not obvious.  Instead, I added an assertion there to
try to catch this problem if it were to occur there.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=72926
Cc: 10.0 <mesa-stable@lists.freedesktop.org>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2014-01-20 10:57:20 -08:00
Brian Paul
3a4255148b docs: note reduced display list memory usage in 10.1 relnotes 2014-01-20 10:52:11 -08:00
Roland Scheidegger
8c0368abb9 draw: clean up d3d style point clipping
Instead of skipping x/y clipping completely if there's point_tri_clip points
use guard band clipping. This should be easier (previously we could not disable
generating the x/y bits in the clip mask for llvm path, hence requiring custom
clip path), and it also allows us to enable this for tris-as-points more easily
too (this would require custom tri clip filtering too otherwise). Moreover,
some unexpected things could have happen if there's a NaN or just a huge number
in some tri-turned-point, as the driver's rasterizer would need to deal with it
and that might well lead to undefined behavior in typical rasterizers (which
need to convert these numbers to fixed point). Using a guardband should hence
be more robust, while "usually" guaranteeing the same results. (Only "usually"
because unlike hw guardbands draw guardband is always just twice the vp size,
hence small vp but large points could still lead to different results.)
Unfortunately because the clipmask generated is completely unaffected by guard
band clipping, we still need a custom clip stage for points (but not for tris,
as the actual clipping there takes guard band into account).

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2014-01-20 17:45:53 +01:00
Brian Paul
799abb271a swrast: check for null/-1 when mapping renderbuffers
Fixes fbo-drawbuffers-none crash (but test still fails).
https://bugs.freedesktop.org/show_bug.cgi?id=73757

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-01-20 08:18:21 -08:00
Brian Paul
3ede8dd5f1 softpipe: fix crash when accessing null colorbuffer
Fixes piglit fbo-missing-attachment-blit test.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=73755

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-01-20 08:18:21 -08:00
Brian Paul
33ae0c24d0 st/vdpau: s/surface/resource/ to fix compiler warning
Reviewed-by: Christian König <christian.koenig@amd.com>
2014-01-20 07:54:42 -08:00
José Fonseca
a1e528a0f0 i915,r200,radeon,vega: Change vendor from "VMware, Inc." to "Mesa Project".
These are components which were originally developed by Tungsten Graphics,
which was in turn acquired by VMware, but are de facto now being maintained
by third-party contributors of the Mesa open-source community.

This matches what's reported by swrast driver and a few other components.

Suggested by Ian Romanick.
2014-01-20 14:15:27 +00:00
José Fonseca
f0c2662b12 logger: Remove unused variable.
Silences gcc "unused variable ‘buf’" warning.

Trivial.
2014-01-20 13:58:11 +00:00
José Fonseca
d43260b59e logger: s/\<log\>/log_/
Currently the MSVC build is broken because of conflicting definitions of
'log' function.  I didn't investigate thoroughly, but I suspect the
it is conflicting standard math.h's log.

log_ is admittedly not a great name, but it is better than a broken build.
A better one can be used in a follow-on build.
2014-01-20 13:57:12 +00:00
Topi Pohjolainen
9ab553cf52 i965/blorp: reduce the scope of the explicit compression control
By highlighting these special cases makes it clearer to switch
to the fs-generator as the wider scoped compression control
settings used in the current implementation can be simply
dropped.

No regressions on IVB (piglit quick + unit tests).

v2 (Ian): typo in a comment

Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-01-20 09:42:36 +02:00
Topi Pohjolainen
d0f63b3757 i965/blorp: remove dependency to compression control state
Effectively only the mask control bit gets altered for the single
addition in question and hence there is no real need to use a
fresh state control level for it -- that is more useful when
multiple intructions share the same mask and compression settings.

This is a preparation step for removing the explicit compression
control modifiers in the blit compiler. After this patch there
are no nested state control levels making the constant nature of
the compression settings more apparent.

No regressions on IVB (piglit quick + unit tests).

v2 (Matt, Ian): use temporary variable instead of assigning
                directly on the same line with a function call.

Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-01-20 09:42:27 +02:00
Kristian Høgsberg
05da4a7a5e i965: Only update renderbuffers on initial intelMakeCurrent
We call intel_prepare_render() in intelMakeCurrent() to make sure we have
renderbuffers before calling _mesa_make_current().  The only reason we
do this is so that we can have valid defaults for width and height.
If we already have buffers for the drawable we're making current, we
don't need this step.

In itself, this is a small optimization, but it also avoids a round trip
that could block on the display server in a unexpected place.

https://bugs.freedesktop.org/show_bug.cgi?id=72540
https://bugs.freedesktop.org/show_bug.cgi?id=72612

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2014-01-19 20:48:19 -08:00
Ilia Mirkin
f5788e042a st/vdpau: check surface params before creating surfaces
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Christian König <christian.koenig@amd.com>
2014-01-19 20:02:10 -05:00
Ilia Mirkin
813ce219c8 st/vdpau: fix bogus error handling in output/bitmap creation
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Christian König <christian.koenig@amd.com>
2014-01-19 20:02:10 -05:00
Ilia Mirkin
00e4314f6d st/vdpau: don't return a device if the screen doesn't support NPOT
NV3x cards don't support NPOT textures. Technically this restriction
could be worked around, but since it also doesn't expose any video
decoding hw, just turn it off entirely.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: 10.0 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Christian König <christian.koenig@amd.com>
2014-01-19 20:01:48 -05:00
Armin K
ad3c99e22a pipe-loader: Fix build
pipe_loader_drm.c: In function 'pipe_loader_drm_probe_fd':
pipe_loader_drm.c:120:4: error: implicit declaration of function 'loader_get_pci_id_for_fd' [-Werror=implicit-function-declaration]

Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-01-19 15:20:58 +00:00
Emil Velikov
26d380da69 loader: ifdef libdrm specific code and include
Mesa provides the flexibility of building without the
need to have libdrm present on the system. The situation
has regressed with the recent commit

commit 8c2e7fd846
Author: Emil Velikov <emil.l.velikov@gmail.com>
Date:   Fri Jan 10 23:36:16 2014 +0000

    loader: introduce the loader util lib

By isolating libdrm code by #ifndef __NOT_HAVE_DRM_H we
can have libdrm-less builds on across all build systems.

This patch converts Android's _EGL_NO_DRM to __NOT_HAVE_DRM_H
to provide consistency with the other cases within mesa, allows
compilation of libloader on libdrm-less scons and conditionally
links against libdrm if present under automake.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=73776
BUgzilla: https://bugs.freedesktop.org/show_bug.cgi?id=73777
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-01-19 15:17:00 +00:00
Kenneth Graunke
a33d1339d5 i965: Double the push constant space multipliers on Broadwell too.
Broadwell has 2Kb push constant size increments like Haswell GT3.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-01-18 21:58:13 -08:00
Kenneth Graunke
4c6a1d380a i965: Update invariant state for Broadwell.
The only difference is that STATE_SIP takes a 48-bit address, so we need
to output two zeroes.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-01-18 21:57:59 -08:00
Kenneth Graunke
37e9b5e305 i965: Use the Sandybridge VUE format on Broadwell as well.
It hasn't changed.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2014-01-18 21:56:23 -08:00
Kenneth Graunke
11f6882e1d i965: Create a new fragment shader backend for Broadwell.
This replaces the old fs_generator backend.

v2: Port to the C-based representation of assembly instructions.
    Fix texturing after the texture-grf merge.

v3: Add high quality derivative support.  Fix SET_SIMD4X2_OFFSET.

v4: Pass brw_context to gen8_instruction functions as required.

v5: Fixes for MRT, as well as zero render targets (alpha test only).

v6: Replace n-wide with SIMDn in comments and messages; port over
    Topi's blorp-generator changes; add missing TXF_MCS opcode,
    fix missing high quality derivatives for DDX; fix typo (all caught
    by Eric).  Simplify ADDC/SUBB handling; drop "Used only on Gen6+"
    comment (caught by Matt).  Emit SIMD16 versions of three source
    instructions (caught by both Eric and Matt).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-01-18 21:56:08 -08:00
Kenneth Graunke
9eb568d753 i965: Create a new vec4 backend for Broadwell.
This replaces the old vec4_generator backend.

v2: Port to use the C-based instruction representation.  Also, remove
    Geometry Shader offset hacks - the visitor will handle those instead
    of this code.

v3: Texturing fixes (including adding textureGather support).

v4: Pass brw_context to gen8_instruction functions as required.

v5: Add SHADER_OPCODE_TXF_MCS support; port DUAL_INSTANCED gs fixes
    (caught by Eric).  Simplify ADDC/SUBB handling; add comments to
    gen8_set_dp_message calls (suggested by Matt).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-01-18 21:56:02 -08:00
Kenneth Graunke
f8035ba036 i965: Add a new infrastructure for generating Broadwell shader assembly.
This replaces the brw_eu_emit.c layer for Broadwell.  It will be
used by both the vector and scalar shader backends.

v2: Port to use the C-based instruction representation.

v3: Fix destination register type for CMP.

v4: Pass brw to gen8_instruction functions (required by rebase).

v5: Remove bogus assertion on math instructions (caught by Piglit).

v6: Remove more restrictions on math instructions (caught by Eric).
    Make ADDC and SUBB helpers set accumulator writes, like MAC and
    MACH (caught by Matt).

v7: Don't implicitly force ALU3 operations to SIMD8 (we've been able
    to do SIMD16 versions since Haswell, but didn't when I originally
    wrote this code).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-01-18 21:55:54 -08:00
Kenneth Graunke
8ea4b16eea i965: Implement a disassembler for Broadwell's new instruction encoding.
Heavily based on Keith Packard's existing brw_disasm.c code.  I've tried
to go through most of the pieces (like SFIDs) and update the lists to
include features added in recent generations.

v2: Port to use the C-based instruction emitters.  This allows us to use
    C99 array initializers, which tidies up some of the code.

v3: Improve decoding of render target write messages.

v4: Update for BRW_REGISTER_TYPE becoming an abstraction.

v5: Rebase on Chris Forbes' SFID message defines.

v6: Fix disassembly of UV immediates; remove silly casts.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-01-18 21:55:45 -08:00
Kenneth Graunke
0923dad90a i965: Add a new representation for Broadwell shader instructions.
Broadwell significantly changes the EU instruction encoding.  Many of
the fields got moved to different bit positions; some even got split
in two.

With so many changes, it was infeasible to continue using struct
brw_instruction.  We needed a new representation.

This new approach is a bit different: rather than a struct, I created a
class that has four DWords, and helper functions that read/write various
bits.  This has several advantages:

1. We can create several different names for the same bits.  For
   example, conditional modifiers, SFID for SEND instructions, and the
   MATH instruction's function opcode are all stored in bits 27:24.

   In each situation, we can use the appropriate setter function:
   set_sfid(), set_math_function(), or set_cond_modifier().  This
   is much easier to follow.

2. Since the fields are expressed using the original 128-bit numbers,
   the code to create the getter/setter functions follows the table in
   the documentation very closely.

To aid in debugging, I've enabled -fkeep-inline-functions when building
gen8_instruction.c.  Otherwise, these functions cannot be called by
gdb, making it insanely difficult to print out anything.

Kenneth Graunke wrote most of this code.  Damien Lespiau ported it to
C99.  Xiang Haihao added media fields.  Zhao Yakui added indirect
addressing support.  Eric Anholt added an assertion to make sure that
values fit in the alloted number of bits.

v2: Update for brw_reg_type_to_hw_type(), which necessitates passing
    brw_context pointers around everywhere.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Acked-by: Matt Turner <mattst88@gmail.com>
2014-01-18 21:55:37 -08:00
Kenneth Graunke
f4cf231cac i965: Add SFID #defines for media stuff.
While we probably won't ever use these, having them makes it easy to
share disassembler code between intel-gpu-tools and Mesa.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-01-18 21:55:31 -08:00
Kenneth Graunke
9e7da0c716 i965: Add #defines for new Broadwell math functions.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-01-18 21:55:25 -08:00
Chris Forbes
45607b5c5f i965: add struct and SFID for pixel interpolator messages
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-01-18 21:55:17 -08:00
Chris Forbes
566e0ddfd0 i965/Gen7: Only emit cube face enables for cubes.
This is not observed to actually fix anything, but the PRM says this
field must be zero for other surface types.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-01-19 11:22:34 +13:00
Chris Forbes
b0042f2c23 i965: Improve dumping of Gen7 SURFACE_STATE
Previously this was missing many interesting fields. Having them decoded
makes debugging views much easier.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-01-19 11:22:32 +13:00
Chris Forbes
9b5eda8544 i965: Add masks for more SURFACE_STATE fields
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-01-19 11:22:00 +13:00
Emil Velikov
66fd5057d3 nv50: drop obsolete check from error path
At 'out_err' the nv50_context has been calloc-ated.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-01-18 19:17:45 +00:00
Emil Velikov
e1e30f6dfb nv50: assert before trying to out-of-bounds access framebuffer.cbufs
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-01-18 19:17:41 +00:00
Emil Velikov
3805a864b1 nv50: assert before trying to out-of-bounds access samplers
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-01-18 19:17:37 +00:00
Emil Velikov
6a53b81086 nv50: assert before trying to out-of-bounds access textures
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-01-18 19:17:34 +00:00
Emil Velikov
19069803be nv50: pass vtxbuf index as unsigned
The index passed to the function is already unsigned, and internally
we threat it as unsigned.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-01-18 19:17:28 +00:00
Emil Velikov
1773611c52 nv50: assert before trying to out-of-bounds access vtxbuf
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-01-18 19:17:24 +00:00
Emil Velikov
741e935a72 nv50: typecast the result of ffs() to unsigned
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-01-18 19:17:20 +00:00
Emil Velikov
5e130f2371 nv50: assert before trying to out-of-bounds access constbuf
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-01-18 19:17:15 +00:00
Emil Velikov
12e744abbb nv50: access only the available amount of constbuf
The textures array is defined as a number of NV50_MAX_PIPE_CONSTBUFS
per shader stage. Currently the nv50 driver handles only 3 shader
stages, thus we wreck chaos when accessing array-out-of-bounds.

Cc: 9.1 9.2 10.0 <mesa-stable@lists.freedesktop.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-01-18 19:17:09 +00:00
Emil Velikov
d606ca37eb nv50: access only the available amount of textures
The textures array is defined as a number of PIPE_MAX_SAMPLERS per shader stage.
Currently nv50 driver handles only 3 shader stages, thus we wreck chaos when
accessing array-out-of-bounds.

Fixes a segfault in piglit/bin/arb_texture_buffer_object-data-sync -fbo -auto

Cc: 9.1 9.2 10.0 <mesa-stable@lists.freedesktop.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-01-18 19:16:16 +00:00
Rob Clark
bf70c238a7 loader: fallback to drmGetVersion() for non-pci devices
Use the kernel driver name are returned by drmGetVersion() for
non-pci(platform) devices.

Signed-off-by: Rob Clark <robclark@freedesktop.org>

v2 (Emil): Rebased and weaked commit message.
Reviewed-by: Rob Clark <robdclark@gmail.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-01-18 18:52:07 +00:00
Emil Velikov
26458420d8 pipe-loader: add support for non-pci (platform) devices
Culled out of the "loader: refactor duplicated code into loader util lib"
patch by Rob Clark.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Rob Clark <robdclark@gmail.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-01-18 18:52:07 +00:00
Emil Velikov
3d3ae75c86 pci_ids: no not include loader.h
As per original approach by Rob, each user of the loader lib should include
loader.h and the pci_id_driver_map.h header will be used exclusively by the
loader.

Add back the include guard __IS_LOADER and remove no longer needed include
folder in the scons build.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Rob Clark <robdclark@gmail.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-01-18 18:51:54 +00:00
Emil Velikov
8d4357b5ba egl_dri2: use loader util lib
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Rob Clark <robdclark@gmail.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-01-18 18:47:49 +00:00
Emil Velikov
a0a1c60fb0 pipe-loader: use loader util lib
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Rob Clark <robdclark@gmail.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-01-18 18:47:49 +00:00
Emil Velikov
0e78c35234 st/egl: use loader util lib
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Rob Clark <robdclark@gmail.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-01-18 18:47:48 +00:00
Emil Velikov
a980024224 egl-static: use loader util lib
v2
* Drop the no longer used _EGL_NO_DRM from Android.mk.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Rob Clark <robdclark@gmail.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-01-18 18:47:48 +00:00
Emil Velikov
fae0dfa59b gbm: use the loader util lib
Additionally this commit removes the following exported functions

   _gbm_udev_device_new_from_fd()
   _gbm_fd_get_device_name()
   _gbm_log()

All three were erroneously marked as exported since their inception.
Neither of them has ever been a part of the API thus there should be
no users of them.

Cc: Chad Versace <chad.versace@linux.intel.com>
Cc: Kristian Høgsberg <krh@bitplanet.net>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Rob Clark <robdclark@gmail.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-01-18 18:47:48 +00:00
Emil Velikov
eac776cf77 glx: use the loader util lib
v2
* Set logger to ErrorMessageF. Spotted by Kristian

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Rob Clark <robdclark@gmail.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-01-18 18:47:48 +00:00
Emil Velikov
8c2e7fd846 loader: introduce the loader util lib
All the various window system integration layers duplicate roughly the
same code for figuring out device and driver name, pci-id's, etc.  Which
is sad.  So extract it out into a loader util lib.

v2 (Emil)
* Separate the introduction of libloader from the code de-duplication.
* Strip out non-pci devices support.
* Add scons + Android build system support.
* Add VISIBILITY_CFLAGS to avoid exporting the loader funcs.

v3 (Emil)
* PIPE_OS_ANDROID is undefined at this scope, use ANDROID
* Make sure we define _EGL_NO_DRM when building only swrast

Signed-off-by: Rob Clark <robclark@freedesktop.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Rob Clark <robdclark@gmail.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-01-18 18:47:27 +00:00
Kenneth Graunke
1c5e2965a0 i965: Remove CACHED_BATCH support altogether.
Using an unoptimized variant of glamor spending 50% of its CPU time in
brw_draw_prims() (and hitting the cache *very* frequently):

    N           Min           Max        Median           Avg        Stddev
x 200         29200         40500         34900         34750     958.43256
+ 200         31000         40300         34700         34622     916.35941
No difference proven at 95.0% confidence

Similarly, no difference on GLB2.7:

    N           Min           Max        Median           Avg        Stddev
x  63          64.1         71.36         70.69     70.113175     1.6782026
+  63          63.6         71.18         70.75     70.223651     1.6044186
No difference proven at 95.0% confidence

v2: Rebase on master (by anholt)
v3: Add a missing BEGIN_BATCH(3) to aa_line_parameters -- CACHED_BATCH
    didn't have the asserts about batchbuffer usage that ADVANCE_BATCH
    does, so we started assertion failing.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-01-17 13:21:11 -08:00
Eric Anholt
746e3e3b3a i965: Replace 8-wide and 16-wide with SIMD8 and SIMD16.
Those are the terms used in the docs, and think "n-wide" was something I
just happened to say.  Note that shader-db needs updating for the
INTEL_DEBUG=fs parsing.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-01-17 12:58:43 -08:00
Eric Anholt
26a3bf5c72 i965: Stop doing our optimization on a copy of the GLSL IR.
The original intent was that we'd keep a driver-private copy, and there
would be the normal copy for swrast to make use of without the tuning (or
anything more invasive we might do) specific to i965.  Only, we don't
generate swrast code any more, because swrast can't render current shaders
anyway.  Thus, our private copy is rather a waste, and we can just do our
backend-specific operations on the linked shader.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-01-17 12:58:37 -08:00
José Fonseca
8771285054 s/Tungsten Graphics/VMware/
Tungsten Graphics Inc. was acquired by VMware Inc. in 2008.  Leaving the
old copyright name is creating unnecessary confusion, hence this change.

This was the sed script I used:

    $ cat tg2vmw.sed
    # Run as:
    #
    #   git reset --hard HEAD && find include scons src -type f -not -name 'sed*' -print0 | xargs -0 sed -i -f tg2vmw.sed
    #

    # Rename copyrights
    s/Tungsten Gra\(ph\|hp\)ics,\? [iI]nc\.\?\(, Cedar Park\)\?\(, Austin\)\?\(, \(Texas\|TX\)\)\?\.\?/VMware, Inc./g
    /Copyright/s/Tungsten Graphics\(,\? [iI]nc\.\)\?\(, Cedar Park\)\?\(, Austin\)\?\(, \(Texas\|TX\)\)\?\.\?/VMware, Inc./
    s/TUNGSTEN GRAPHICS/VMWARE/g

    # Rename emails
    s/alanh@tungstengraphics.com/alanh@vmware.com/
    s/jens@tungstengraphics.com/jowen@vmware.com/g
    s/jrfonseca-at-tungstengraphics-dot-com/jfonseca-at-vmware-dot-com/
    s/jrfonseca\?@tungstengraphics.com/jfonseca@vmware.com/g
    s/keithw\?@tungstengraphics.com/keithw@vmware.com/g
    s/michel@tungstengraphics.com/daenzer@vmware.com/g
    s/thomas-at-tungstengraphics-dot-com/thellstom-at-vmware-dot-com/
    s/zack@tungstengraphics.com/zackr@vmware.com/

    # Remove dead links
    s@Tungsten Graphics (http://www.tungstengraphics.com)@Tungsten Graphics@g

    # C string src/gallium/state_trackers/vega/api_misc.c
    s/"Tungsten Graphics, Inc"/"VMware, Inc"/

Reviewed-by: Brian Paul <brianp@vmware.com>
2014-01-17 20:00:32 +00:00
José Fonseca
27307a73e5 trace: Re-license trace.xsl under MIT license.
I was the sole author, as Tungsten Graphics employee, which was since
then acquired by VMware Inc.

Reviewed-by: Brian Paul <brianp@vmware.com>
2014-01-17 20:00:32 +00:00
Brian Paul
3618ac4f20 svga: fix crash when clearing null color buffer
Fixes regression since 9baa45f78b
but some of the piglit fbo-drawbuffers-none tests still don't
pass.

v2: use the right pointer type for 'h'

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2014-01-17 08:52:37 -08:00
Brian Paul
d6fa71fbb0 llvmpipe: handle NULL color buffer pointers
Fixes regression from 9baa45f78b

v2: incorporate a few small changes suggested by Roland.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-01-17 08:52:11 -08:00
Brian Paul
7b4ceec0b7 softpipe: handle NULL color buffer pointers
Fixes regression from 9baa45f78b

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-01-17 08:52:11 -08:00
Roland Scheidegger
3b64714da4 llvmpipe: fix large point rasterization with point_quad_rasterization
The whole round-pointsize-to-int stuff must only be done with GL legacy
rules (no point_quad_rasterization) or all the wrong edges are lit up.
This was previously in a private branch (d3d pointsprite test complains
loudly otherwise) and got lost in a merge. However, it should certainly
apply to GL point sprite rasterization as well.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2014-01-17 17:01:01 +01:00
Roland Scheidegger
4b9bcf31f4 gallium: add bits for clipping points as tris (d3d-style)
OpenGL does whole-point clipping, that is a large point is either fully
clipped or fully unclipped (the latter means it may extend beyond the
viewport as long as the center is inside the viewport). d3d9 (d3d10 has
no large points) however requires points to be clipped after they are
expanded to a rectangle. (Note some IHVs are known to ignore GL rules at
least with some hw/drivers.)
Hence add a rasterizer bit indicating which way points should be clipped
(some drivers probably will always ignore this), and add the draw interaction
this requires. Drivers wanting to support this and using draw must support
large points on their own as draw doesn't implement vp clipping on the
expanded points (it potentially could but the complexity doesn't seem
warranted), and the driver needs to do viewport scissoring on such points.

Conflicts:

	src/gallium/drivers/llvmpipe/lp_context.c
	src/gallium/drivers/llvmpipe/lp_state_derived.c

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2014-01-17 17:01:01 +01:00
Ilia Mirkin
739dc95e67 mesa: fix GL_COLOR_SUM enum for drivers without ARB_vertex_program
Commit c13970808 (mesa: GL_EXT_secondary_color is not optional) changed

CHECK_EXTENSION2(EXT_secondary_color, ARB_vetex_program, cap)

to

CHECK_EXTENSION(ARB_vertex_program, cap)

However CHECK_EXTENSION2 checks that either extension is available, not
both. Remove the extension check entirely since the intent was for it to
always be enabled.

v2: Fix glGet*(GL_COLOR_SUM) too.  Suggested by Ian.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Cc: 9.2 10.0 <mesa-stable@lists.freedesktop.org>
2014-01-16 16:42:33 -08:00
Zack Rusin
93b953d139 llvmpipe: do constant buffer bounds checking in shaders
It's possible to bind a smaller buffer as a constant buffer, than
what the shader actually uses/requires. This could cause nasty
crashes. This patch adds the architecture to pass the maximum
allowable constant buffer index to the jit to let it make
sure that the constant buffer indices are always within bounds.
The behavior follows the d3d10 spec, which says the overflow
should always return all zeros, and overflow is only defined
as access beyond the size of the currently bound buffer. Accesses
beyond the declared shader constant register size are not
considered an overflow and expected to return garbage but consistent
garbage (we follow the behavior which some wlk tests expect which
is to return the actual values from the bound buffer).

Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-01-16 16:33:57 -05:00
Ilia Mirkin
dd687fb8d0 nv50, nvc0: initialize ctx->sample_mask to ~0
Commit 95bf222603 (cso_context: Fix cso_context::sample_mask initial
value.) fixed the cso sample mask to be initialized to ~0. The cso code
is also careful not to needlessly call set_sample_mask, so we ended up
with the ctx->sample_mask never being set. This broke a number of
EXT_framebuffer_multisample piglit tests.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-01-16 19:26:05 +01:00
Aaron Watry
188383591d mesa/main: Free ctx->DrawIndirectBuffer during teardown
ctx->DrawIndirectBuffer wasn't being free'd in _mesa_free_buffer_objects

With this patch, "valgrind --leak-check=full glxgears" on evergreen (CEDAR)
now shows:

LEAK SUMMARY:
   definitely lost: 0 bytes in 0 blocks
   indirectly lost: 0 bytes in 0 blocks
     possibly lost: 0 bytes in 0 blocks
   still reachable: 70,228 bytes in 651 blocks
        suppressed: 0 bytes in 0 blocks

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-01-16 10:10:04 -06:00
Aaron Watry
ce3528896b st/dri: prevent leak of dri option default values
v2: Change comment style

CC: "10.0" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-01-16 10:10:04 -06:00
Aaron Watry
5ac3229f76 radeon: Move gfx/dma cs cleanup to r600_common_context_cleanup
The radeonsi code was not cleaning up either of these items leading to
leaked memory.

v2: Move cleanup to r600_common_context_cleanup instead of duplicating
    the logic for SI

CC: "10.0" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-01-16 10:10:04 -06:00
Ian Romanick
a05c596a00 mesa: Eliminate parameters to dd_function_table::Scissor
The i830 and i915 drivers used them, but they didn't really need to.
They will just be annoying in future patches.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-01-15 10:02:48 -08:00
Ian Romanick
6dbab6b2bb mesa: Eliminate parameters to dd_function_table::DepthRange
No driver uses them.  They will just be annoying in future patches.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-01-15 10:02:48 -08:00
Ian Romanick
065bd6ffc2 mesa: Eliminate parameters to dd_function_table::Viewport
No driver uses them.  They will just be annoying in future patches.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-01-15 10:02:48 -08:00
Ian Romanick
fbc0c9a553 radeon: Remove dead code
A future patch will rename some of the fields of gl_viewport_attrib, and
I don't want to update dead code that I can't test.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: Dave Airlie <airlied@redhat.com>
2014-01-15 10:02:47 -08:00
Ian Romanick
4fcdb75268 i915: Remove spurious calls to DepthRange
For both i830 and i915, the driver DepthRange function just calls
intelCalcViewport.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: Eric Anholt <eric@anholt.net>
2014-01-15 10:02:47 -08:00
Ian Romanick
0a75909b3f mesa: Add COMPRESSED_RGBA_S3TC_DXT1_EXT to COMPRESSED_TEXTURE_FORMATS for GLES
The ES and desktop GL specs diverge here.  Yay!

In desktop OpenGL, the driver can perform online compression of
uncompressed texture data.  GL_NUM_COMPRESSED_TEXTURE_FORMATS and
GL_COMPRESSED_TEXTURE_FORMATS give the application a list of formats
that it could ask the driver to compress with some expectation of
quality.  The GL_ARB_texture_compression spec calls this "suitable for
general-purpose usage."  As noted above, this means
GL_COMPRESSED_RGBA_S3TC_DXT1_EXT is not included in the list.

In OpenGL ES, the driver never performs compression.
GL_NUM_COMPRESSED_TEXTURE_FORMATS and GL_COMPRESSED_TEXTURE_FORMATS give
the application a list of formats that the driver can receive from the
application.  It is the *complete* list of formats.  The
GL_EXT_texture_compression_s3tc spec says:

    "New State for OpenGL ES 2.0.25 and 3.0.2 Specifications

        The queries for NUM_COMPRESSED_TEXTURE_FORMATS and
        COMPRESSED_TEXTURE_FORMATS include COMPRESSED_RGB_S3TC_DXT1_EXT,
        COMPRESSED_RGBA_S3TC_DXT1_EXT, COMPRESSED_RGBA_S3TC_DXT3_EXT,
        and COMPRESSED_RGBA_S3TC_DXT5_EXT."

Note that the addition is only to the OpenGL ES specification!

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
See-also: http://lists.freedesktop.org/archives/mesa-dev/2013-October/047439.html
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Cc: "10.0" <mesa-stable@lists.freedesktop.org>
2014-01-15 10:02:47 -08:00
Brian Paul
bf27d02390 scons: add new shaderimage.c file to the build 2014-01-15 09:17:04 -07:00
Francisco Jerez
bd62666224 clover: Fix clover::keys and ::values to deal with r-value references properly.
Returning a reference is incorrect if the specified pair was a
temporary -- Instead of that, use decltype() to deduce the correct
return type qualifiers.  Fixes a crash in clCreateProgramWithBinary().

Reported-and-tested-by: "Dorrington, Albert" <albert.dorrington@lmco.com>
2014-01-15 16:48:37 +01:00
Francisco Jerez
5662602ba0 clover: Don't try to build programs created from a binary again.
According to the spec it's allowed to call clBuildProgram() on a
program created from a user-specified binary.  We don't need to do
anything to build the program in that case.

Reported-and-tested-by: "Dorrington, Albert" <albert.dorrington@lmco.com>
2014-01-15 16:48:05 +01:00
Francisco Jerez
5195f1d9c6 clover: Add missing fields to the clover::module serialization code.
Tested-by: "Dorrington, Albert" <albert.dorrington@lmco.com>
2014-01-15 16:46:12 +01:00
Francisco Jerez
efcc84f425 clover: Store map result into a temporary vector in clCreateProgramWithBinary.
This avoids the inefficient multiple evaluation of the map result in
the code below.  It should cause no functional changes.

Tested-by: "Dorrington, Albert" <albert.dorrington@lmco.com>
2014-01-15 16:45:05 +01:00
Francisco Jerez
83db4a30b8 docs: Mark ARB_shader_image_load_store as work in progress.
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2014-01-15 16:42:08 +01:00
Francisco Jerez
647344bf3e mesa: Validate image units when the texture state changes.
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2014-01-15 16:42:08 +01:00
Francisco Jerez
ace31f4bc0 mesa: Unbind deleted textures from the shader image units.
From ARB_shader_image_load_store:

   If a texture object bound to one or more image units is deleted by
   DeleteTextures, it is detached from each such image unit, as though
   BindImageTexture were called with <unit> identifying the image unit
   and <texture> set to zero.

Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2014-01-15 16:42:08 +01:00
Francisco Jerez
902f9df36b mesa: Add image parameter queries for ARB_shader_image_load_store.
v2: Fix off-by-one error in index parameter bound checking.

Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2014-01-15 16:42:08 +01:00
Francisco Jerez
eb0de7c432 mesa: Add ARB_shader_image_load_store to the extension table.
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2014-01-15 16:42:08 +01:00
Francisco Jerez
a167e354e7 glapi: Update dispatch XML files for ARB_shader_image_load_store.
And uncomment the relevant lines of the dispatch sanity test.

Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2014-01-15 16:42:08 +01:00
Francisco Jerez
bcc49e17ff mesa: Implement the GL entry points defined by ARB_shader_image_load_store.
v2: Name image format classes consistently, fix array and 3D teximage
    selection with layered = GL_FALSE, make sure that the
    user-specified layer is less than the number of texture layers,
    add some asserts.

Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2014-01-15 16:42:07 +01:00
Francisco Jerez
7510c10209 mesa: Add MESA_FORMAT_SIGNED_RG88 and _RG1616.
Including pack/unpack and texstore code.  ARB_shader_image_load_store
requires support for the GL_RG8_SNORM and GL_RG16_SNORM formats, which
map to MESA_FORMAT_SIGNED_GR88 and MESA_FORMAT_SIGNED_GR1616 on
little-endian hosts, and MESA_FORMAT_SIGNED_RG88 and
MESA_FORMAT_SIGNED_RG1616 respectively on big-endian hosts -- only the
former were already present, add support for the latter.

Acked-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2014-01-15 16:42:07 +01:00
Francisco Jerez
87942749a3 mesa: Add MESA_FORMAT_ABGR2101010.
Including pack/unpack and texstore code.  This texture format is a
requirement for ARB_shader_image_load_store.

Acked-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2014-01-15 16:42:07 +01:00
Francisco Jerez
16070716bc mesa: Add driver interface for ARB_shader_image_load_store.
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2014-01-15 16:42:07 +01:00
Francisco Jerez
7a98741ef2 mesa: Add state data structures required for ARB_shader_image_load_store.
v2: Increase MAX_IMAGE_UNITS to what i965 wants and add a separate
    MAX_IMAGE_UNIFORMS define, clarify a couple of comments.

Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2014-01-15 16:42:07 +01:00
Francisco Jerez
d9b0b4e960 mesa: Define helper function to get the number of texture layers.
And to check if it can have layers at all.  This will be used by the
implementation of ARB_shader_image_load_store.

v2: Fix constness of texobj argument, use assert and return reasonable
    default rather than calling unreachable() in default switch case.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-01-15 16:42:07 +01:00
Emil Velikov
bfcf78c110 st/mesa: use signed temporary variable to store _ColorDrawBufferIndexes
The temporary variable used to store _ColorDrawBufferIndexes must be
signed (GLint), otherwise the following conditional will be incorrectly
evaluated. Leading to crashes in the driver/mesa or accessing/writing
to arbitrary memory location. The bug dates back to 2009.

Cc: 10.0 9.2 9.1 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-01-15 14:33:28 +00:00
Emil Velikov
3515a648a9 automake: include the git sha in the opengl version string for oot builds
Acked-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-01-15 14:32:24 +00:00
Emil Velikov
10368e1446 mesa: use signed temporary variable to store _ColorDrawBufferIndexes
_ColorDrawBufferIndexes is defined as GLint* and using a GLuint*
will result in the first part of the conditional to be evaluated to
true always.

Unintentionally introduced by the following commit, this will result
in a driver segfault if one is using an old version of the piglit test

    bin/clearbuffer-mixed-format -auto -fbo

commit 03d848ea10
Author: Marek Olšák <marek.olsak@amd.com>
Date:   Wed Dec 4 00:27:20 2013 +0100

    mesa: fix interpretation of glClearBuffer(drawbuffer)

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

Cc: Marek Olšák <marek.olsak@amd.com>
Cc: 10.0 9.2 9.1 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-01-15 14:31:04 +00:00
Ilia Mirkin
716b512dcf nouveau: add framebuffer validation callback
Fixes assertions when trying to attach textures to fbs with formats not
supported by the render engines.

See https://bugs.freedesktop.org/show_bug.cgi?id=73459

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2014-01-15 12:12:00 +01:00
Francisco Jerez
e457aca7fa clover: Use cl_ulong in the maximum allocation size calculation to avoid overflow. 2014-01-14 22:10:24 +01:00
Kenneth Graunke
8c4a9f631d i965: Emit 3DSTATE_VF on Broadwell too.
It's not just for Haswell.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-01-14 00:59:03 -08:00
Kenneth Graunke
eadabec4cd i965: Disable workaround flush for push constants on Broadwell.
If it wasn't necessary for Haswell, it's likely not to be necessary for
Broadwell either.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-01-14 00:59:03 -08:00
Kenneth Graunke
8618407d15 i965: Enable native ETC texture support on Broadwell.
Broadwell, like Baytrail, has native ETC texture support.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-01-14 00:58:17 -08:00
Chia-I Wu
fa772aa92b ilo: handle NULL renderbuffers correctly
Renderbuffers may be NULL since 9baa45f78b.
2014-01-14 16:27:57 +08:00
Chia-I Wu
7fdab3b201 ilo: disable HiZ for misaligned levels
We need to disable HiZ for non-8x4 aligned levels, except for level 0, layer
0.  For the very first layer we can adjust Width and Height fields of
3DSTATE_DEPTH_BUFFER to make it aligned.

Specifically, add ILO_TEXTURE_HIZ and set the flag only for properly aligned
levels.  ilo_texture_can_enable_hiz() is updated to check for the flag.

In tex_layout_validate(), align the depth bo to 8x4 so that we can adjust
Width/Height of 3DSTATE_DEPTH_BUFFER without introducing out-of-bound access.

Finally in rectlist blitter, add the ability to adjust 3DSTATE_DEPTH_BUFFER.
2014-01-14 15:43:20 +08:00
Chia-I Wu
18645d1533 ilo: use a helper to determine if HiZ is enabled
Add ilo_texture_can_enable_hiz and replace all checks for tex->hiz.bo by calls
to ilo_texture_can_enable_hiz().
2014-01-14 15:43:20 +08:00
Chia-I Wu
1427c3f79f ilo: decide on hiz first in texture allocation
Add tex_layout_init_hiz() before tex_layout_init_format() to decide whether
HiZ should be enabled.

On GEN6, because of layer offsetting, HiZ is enabled only when the texture is
non-mipmapped and non-array.  PIPE_USAGE_STAGING is also taken as a hint to
disable HiZ.
2014-01-14 15:43:20 +08:00
Chia-I Wu
194a61cd39 ilo: emit gen7_wa_pipe_control_wm_max_threads_stall on Haswell
Rename the workaround, as it is for 3DSTATE_PS instead of 3DSTATE_WM, and emit
it on Haswell too.

This does not fix any app, but an assertion failure.
2014-01-14 15:43:19 +08:00
Chia-I Wu
c6605c51de ilo: use HALIGN_4 on GEN7 for depth buffers
The comment was no longer true since 6642381e75.
2014-01-14 15:42:53 +08:00
Chia-I Wu
e90e3e39c2 ilo: OOM for HiZ is fatal on GEN6
On GEN6, HiZ and Separate Stencil Buffer must be enabled at the same time.
2014-01-14 15:19:41 +08:00
Chia-I Wu
5b1c516080 ilo: fix a HiZ bo leakage
Dereference the HiZ bo when the texture is destroyed.
2014-01-14 15:19:41 +08:00
Chia-I Wu
af57378e59 ilo: simplify ilo_texture_set_slice_flags()
Call ilo_texture_get_slice() for the last slice so that we can get rid of the
duplicated assert().
2014-01-14 15:19:41 +08:00
Vinson Lee
8f9b70fa3c egl-static: Fix build error.
Fix build regression introduced with commit
786af2f963.

egl_pipe.c:46:38: fatal error: radeonsi/radeonsi_public.h: No such file or directory
 #include "radeonsi/radeonsi_public.h"
                                      ^

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=73578
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
2014-01-13 15:54:26 -08:00
Andreas Hartmetz
aa7ae4fd6e radeonsi: Rename the commonly occurring rscreen variable.
The "r" stands for R600.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-01-14 00:07:14 +01:00
Andreas Hartmetz
8662e66bf2 radeonsi: Rename the commonly occurring rctx/r600 variables.
The "r" stands for R600.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-01-14 00:07:14 +01:00
Andreas Hartmetz
44d27ce2b2 radeonsi: Rename r600_trace_emit->si_trace_emit.
I had previously considered that unsafe.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-01-14 00:07:13 +01:00
Andreas Hartmetz
0b57fc15e1 radeonsi: Rename R600->SI in some remaining defines.
I had previously considered that unsafe.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-01-14 00:07:13 +01:00
Andreas Hartmetz
1b79764f49 radeonsi: Rename radeonsi->si remaining identifiers in si_uvd.c.
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-01-14 00:07:13 +01:00
Andreas Hartmetz
b902298615 radeonsi: Rename r600->si remaining identifiers in si_state_draw.c.
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-01-14 00:07:13 +01:00
Andreas Hartmetz
3a4b87511e radeonsi: Rename r600->si remaining identifiers in si_resource.c.
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-01-14 00:07:13 +01:00
Andreas Hartmetz
5d068f734c radeonsi: Rename r600->si remaining identifiers in si_query.c.
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-01-14 00:07:13 +01:00
Andreas Hartmetz
eb0ddb6d5b radeonsi: Rename r600->si remaining identifiers in si_pipe.c.
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-01-14 00:07:13 +01:00
Andreas Hartmetz
238427625f radeonsi: Rename r600->si remaining identifier in si_hw_context.c.
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-01-14 00:07:13 +01:00
Andreas Hartmetz
3160aa4877 radeonsi: Rename radeonsi->si remaining identifiers in si_compute.c.
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-01-14 00:07:13 +01:00
Andreas Hartmetz
7b7eb4dd1f radeonsi: Rename r600->si remaining identifiers in si_blit.c.
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-01-14 00:07:13 +01:00
Andreas Hartmetz
45578def71 radeonsi: Rename r600->si for functions in si_pipe.h.
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-01-14 00:07:13 +01:00
Andreas Hartmetz
280c360c02 radeonsi: Rename r600->si for functions in si.h.
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-01-14 00:07:13 +01:00
Andreas Hartmetz
f2a21ed8b9 radeonsi: Rename r600->si for functions in si_resource.h.
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-01-14 00:07:13 +01:00
Andreas Hartmetz
a88f46bc9b radeonsi: Rename r600->si for structs in si_resource.h.
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-01-14 00:07:13 +01:00
Andreas Hartmetz
3e81883a42 radeonsi: Rename r600->si for structs in si.h.
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-01-14 00:07:13 +01:00
Andreas Hartmetz
238aeabce0 radeonsi: Rename r600->si for structs in si_pipe.h.
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-01-14 00:07:13 +01:00
Andreas Hartmetz
786af2f963 radeonsi: Apply si_* file naming scheme.
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-01-14 00:07:13 +01:00
Michał Górny
5ea2376334 Use AC_PATH_TOOL instead of AC_PATH_PROG for llvm-config.
This should help with cross-compiling and multilib when $CHOST-specific
llvm-config is expected rather than build host default one.

It will help us a bit in Gentoo where we've started using
i686-pc-linux-gnu-llvm-config for 32-bit multilib LLVM.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Signed-off-by: Michał Górny <mgorny@gentoo.org>
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=73100

CC: "10.0" <mesa-stable@lists.freedesktop.org>
2014-01-13 14:37:55 -08:00
Tom Stellard
6a19bb56e0 configure: Disable xvmc by default
The xvmc unit tests are failing on r300g and r600g.

Reviewed-by: Vinson Lee <vlee@freedesktop.org>
2014-01-13 14:37:55 -08:00
Kenneth Graunke
277dbf08b0 glsl: Remove exec_list iterators now that nothing uses them.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-01-13 11:49:47 -08:00
Kenneth Graunke
826d9fb8c0 glsl: Replace iterators in ir_reader.cpp with ad-hoc list walking.
These can't use foreach_list since they want to skip over the first few
list elements.  Just doing the ad-hoc list walking isn't too bad.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-01-13 11:49:45 -08:00
Kenneth Graunke
48d0faaa43 glsl: Use a new foreach_two_lists macro for walking two lists at once.
When handling function calls, we often want to walk through the list of
formal parameters and list of actual parameters at the same time.
(Both are guaranteed to be the same length.)

Previously, we used a pattern of:

   exec_list_iterator 1st_iter = <1st list>.iterator();
   foreach_iter(exec_list_iterator, 2nd_iter, <2nd list>) {
      ...
      1st_iter.next();
   }

This was awkward, since you had to manually iterate through one of
the two lists.

This patch introduces a foreach_two_lists macro which safely walks
through two lists at the same time, so you can simply do:

   foreach_two_lists(1st_node, <1st list>, 2nd_node, <2nd list>) {
      ...
   }

v2: Rename macro from foreach_list2 to foreach_two_lists, as suggested
    by Ian Romanick.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-01-13 11:49:42 -08:00
Kenneth Graunke
02ff2a2758 glsl: Statically cast parameter exec_node to ir_variable.
Formal function parameters are always ir_variable objects, not an
arbitrary ir_instruction.  So there's no need to dynamically cast here.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-01-13 11:38:19 -08:00
Kenneth Graunke
8050584096 glsl: Cast ir_call parameters to ir_rvalue, not ir_instruction.
A function call's parameters are always rvalues.  ir_rvalue may not
always be a subclass of ir_instruction in the future, so we should use
the right one.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-01-13 11:38:19 -08:00
Kenneth Graunke
2e113dfab8 glsl: Replace foreach_iter and iter.remove() with foreach_list_safe.
foreach_list_safe allows you to safely remove the current node.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-01-13 11:38:19 -08:00
Kenneth Graunke
838a6871bb glsl: Convert piles of foreach_iter to foreach_list_safe.
In these cases, we edit the list (or at least might be), so we use the
foreach_list_safe variant.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-01-13 11:38:19 -08:00
Kenneth Graunke
5f7e778fa1 glsl: Convert piles of foreach_iter to the newer foreach_list macro.
foreach_iter and exec_list_iterators have been deprecated for some time now;
we just hadn't ever bothered to convert code to the newer foreach_list
and foreach_list_safe macros.

In these cases, we aren't editing the list, so we can use foreach_list
rather than foreach_list_safe.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-01-13 11:38:19 -08:00
Paul Berry
fb6d9798a0 i965: Ensure that all necessary state is re-emitted if we run out of aperture.
Prior to this patch, if we ran out of aperture space during
brw_try_draw_prims(), we would rewind the batch buffer pointer
(potentially throwing some state that may have been emitted by
brw_upload_state()), flush the batch, and then try again.  However, we
wouldn't reset the dirty bits to the state they had before the call to
brw_upload_state().  As a result, when we tried again, there was a
danger that we wouldn't re-emit all the necessary state.  (Note: prior
to the introduction of hardware contexts, this wasn't a problem
because flushing the batch forced all state to be re-emitted).

This patch fixes the problem by leaving the dirty bits set at the end
of brw_upload_state(); we only clear them after we have determined
that we don't need to rewind the batch buffer.

Cc: 10.0 9.2 <mesa-stable@lists.freedesktop.org>

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-01-13 09:44:39 -08:00
Marek Olšák
df918b5b90 r600g: fix glClearBuffer by handling PIPE_CLEAR_COLORi flags correctly
also restructure the code
2014-01-13 15:48:08 +01:00
Marek Olšák
6e98a17551 r600g: handle NULL colorbuffers correctly on R600-R700 2014-01-13 15:48:08 +01:00
Marek Olšák
07032d4068 r600g: handle NULL colorbuffers correctly on Evergreen 2014-01-13 15:48:08 +01:00
Marek Olšák
a86de9a72f radeonsi: handle NULL colorbuffers correctly
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-01-13 15:48:08 +01:00
Marek Olšák
9677cfab32 gallium/util: easy fixes for NULL colorbuffers
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-01-13 15:48:08 +01:00
Marek Olšák
9baa45f78b st/mesa: bind NULL colorbuffers as specified by glDrawBuffers
An example why it is required:

    Let's say there's a fragment shader writing to gl_FragData[0..1].
    The user calls: glDrawBuffers(2, {GL_NONE, GL_COLOR_ATTACHMENT0});

    That means gl_FragData[0] is unused and gl_FragData[1] is written
    to GL_COLOR_ATTACHMENT0.

st/mesa was skipping the GL_NONE draw buffer, therefore gl_FragData[0]
was written to GL_COLOR_ATTACHMENT0, which was wrong.

This commit fixes it, but drivers must also be fixed not to crash when
binding NULL colorbuffers. There is also a new set of piglit tests for this.

The MSAA state also had to be fixed not to crash when reading fb->cbufs[0].

Reviewed-by: Brian Paul <brianp@vmware.com>
2014-01-13 15:48:07 +01:00
Marek Olšák
9bf9578c1b mesa: handle GL_NONE draw buffers correctly in glClear
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-01-13 15:48:07 +01:00
Marek Olšák
4e549ddb50 st/mesa: use sRGB formats for MSAA resolving if destination is sRGB
Copied from the i965 driver, including the big comment.

Cc: 9.2 10.0 <mesa-stable@lists.freedesktop.org>
2014-01-13 15:48:07 +01:00
Marek Olšák
355686a69f st/mesa: check depth and stencil writemask before clearing 2014-01-13 15:25:31 +01:00
Marek Olšák
9ea3f88c0a st/mesa: always prefer pipe->clear over clear_with_quad (v2)
v2: clear depth and stencil together
2014-01-13 15:25:31 +01:00
Martin Andersson
c156d24525 st/egl: Flush resources before presentation
Fixes wayland regression on r600g due to fast clear introduced by commit
edbbfac6.

Signed-off-by: Marek Olšák <marek.olsak@amd.com>
2014-01-13 15:25:31 +01:00
Tapani Pälli
99abb87c63 dri: set yInverted default to GL_TRUE
yInverted is used by EGL_NOK_texture_from_pixmap to indicate that
window system rendering is y-inverted compared to OpenGL texture
representation. This extension is only known to be used with X11
window system where sane default is GL_TRUE.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=73371

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2014-01-13 08:00:37 +02:00
Tapani Pälli
f8c5b8a17d egl_dri2: call dri2_add_configs_for_visuals after extensions set
dri2_add_config makes decisions based on NOK_texture_from_pixmap so
it needs to be enabled before calling dri2_add_configs_for_visuals.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2014-01-13 07:59:56 +02:00
Ian Romanick
2dc35a619c mesa: Set the correct error in _mesa_BeginConditionalRender
Piglit was recently changed to expect the correct error code (piglit
commit 271b998), so it started failing on Mesa.  This corrects that
failing and adds some spec quotations to justify the errrors set.

The code was rearranged a little bit to match the order listed in the
spec.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-01-10 17:19:48 -08:00
Kenneth Graunke
db1dc21a75 i965: Delete duplicate write_timestamp function.
brw_queryobj.c needs a version of write_timestamp that works on all
generations for the QueryCounter() driver hook.  So there's no point in
duplicating it in gen6_queryobj.c.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-01-10 15:35:01 -08:00
Paul Berry
532b1fecd9 i965: Fix clears of layered framebuffers with mismatched layer counts.
Previously, Mesa enforced the following rule (from
ARB_geometry_shader4's list of criteria for framebuffer completeness):

  * If any framebuffer attachment is layered, all attachments must have
    the same layer count.  For three-dimensional textures, the layer count
    is the depth of the attached volume.  For cube map textures, the layer
    count is always six.  For one- and two-dimensional array textures, the
    layer count is simply the number of layers in the array texture.
    { FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_ARB }

However, when ARB_geometry_shader4 was adopted into GL 3.2, this rule
was dropped; GL 3.2 permits different attachments to have different
layer counts.  This patch brings Mesa in line with GL 3.2.

In order to ensure that layered clears properly clear all layers, we
now have to keep track of the maximum number of layers in a layered
framebuffer.

Fixes the following piglit tests in spec/!OpenGL 3.2/layered-rendering:
- clear-color-all-types 1d_array mipmapped
- clear-color-all-types 1d_array single_level
- clear-color-mismatched-layer-count
- framebuffer-layer-count-mismatch

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-01-10 05:58:49 -08:00
Paul Berry
28af1dc217 main: check texture target when validating layered framebuffers.
From section 4.4.4 (Framebuffer Completeness) of the GL 3.2 spec:

    If any framebuffer attachment is layered, all populated
    attachments must be layered. Additionally, all populated color
    attachments must be from textures of the same target.

We weren't checking that the attachments were from textures of the
same target.

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-01-10 05:58:46 -08:00
Chad Versace
90368875e7 i965/gen6/blorp: Remove redundant HiZ workaround
Commit 1a92881 added extra flushes to fix a HiZ hang in
WebGL Google Maps. With the extra flushes emitted by the previous two
patches, the flushes added by 1a92881 are redundant.

Tested with the same criteria as in 1a92881: by zooming in and out
continuously for 2 hours on Sandybridge Chrome OS (codename
Stumpy) without a hang.

CC: Kenneth Graunke <kenneth@whitecape.org>
CC: Stéphane Marchesin <marcheu@chromium.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2014-01-09 15:02:45 -08:00
Chad Versace
6a5c86f486 i965/gen6/blorp: Set need_workaround_flush at top of blorp
Unconditionally set brw->need_workaround_flush at the top of gen6 blorp
state emission.

The art of emitting workaround flushes on Sandybridge is mysterious and
not fully understood. Ken and I believe that
intel_emit_post_sync_nonzero_flush() may be required when switching from
regular drawing to blorp.  This is an extra safety measure to prevent
undiscovered difficult-to-diagnose gpu hangs.

I verified that on ChromeOS, pre-patch, need_workaround_flush was not
set at the top of blorp, as Paul expected. To verify, I inserted the
following debug code at the top of gen6_blorp_exec(), restarted the ui,
and inspected the logs in /var/log/ui. The abort gets triggered so early
that the browser never appears on the display.

    static void
    gen6_blorp_exec(...)
    {
        if (!brw->need_workaround_flush) {
            fprintf(stderr, "chadv: %s:%d\n", __FILE__, __LINE__);
            abort();
        }
        ...
    }

CC: Kenneth Graunke <kenneth@whitecape.org>
CC: Stéphane Marchesin <marcheu@chromium.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2014-01-09 15:02:39 -08:00
Chad Versace
5e0cd58de4 i965/gen6/blorp: Set need_workaround_flush immediately after primitive
This patch makes the workaround code in gen6 blorp follow the pattern
established in the regular draw path. It shouldn't result in any
behavioral change.

On gen6, there are two places where we emit 3D_CMD_PRIM: brw_emit_prim()
and gen6_blorp_emit_primitive().  brw_emit_prim() sets
need_workaround_flush immediately after emitting the primitive, but
blorp does not. Blorp sets need_workaround_flush at the bottom of
brw_blorp_exec().

This patch moves the need_workaround_flush from brw_blorp_exec() to
gen6_blorp_emit_primitive().  There is no need to set
need_workaround_flush in gen7_blorp_emit_primitive() because the
workaround applies only to gen6.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2014-01-09 15:02:36 -08:00
Carl Worth
3587fbc586 docs: Import 10.0.2 release notes, add news item. 2014-01-09 12:05:53 -08:00
Brian Paul
513a324b88 mesa: add missing SNORM formats in _mesa_base_fbo_format()
We weren't handling the LUMINANCE_SNORM, LUMINANCE_ALPHA_SNORM and
INTENSITY_SNORM cases.  Note that adding these cases here does not
require a driver to support rendering to these surface types.  If
the driver can't do it we'll report an incomplete framebuffer.

NVIDIA doesn't support GL_EXT_texture_snorm but their driver
accepts these formats in glRenderBufferStorage().

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2014-01-09 11:35:52 -07:00
Brian Paul
689ec8dfb2 mesa: remove dead geom shader code
I doubt the swrast-based drivers will ever support GS.

Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-01-09 11:35:52 -07:00
Brian Paul
c47207d517 docs: minor updates to VMware SVGA3D driver page
Signed-off-by: Brian Paul <brianp@vmware.com>
2014-01-09 11:35:50 -07:00
Brian Paul
d046fd731a mesa: check bits per channel for GL_RGBA_SIGNED_COMPONENTS_EXT query
If a channel has zero bits it's not signed.

v2: also check for luminance and intensity format bits.  Bruce
Merry's proposed piglit test hits the luminance case.

Bugzilla: http://bugs.freedesktop.org/show_bug.cgi?id=73096
Cc: 10.0 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-01-09 11:35:50 -07:00
Brian Paul
0fc8d7c66e mesa: check for MESA_FORMAT_RGB9_E5_FLOAT in _mesa_is_format_signed()
This packed floating point format only stores positive values.

Bugzilla: http://bugs.freedesktop.org/show_bug.cgi?id=73096
Cc: 10.0 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-01-09 11:35:50 -07:00
Brian Paul
d81d263eeb st/mesa: fix breakage from gl_constant::Program[] change 2014-01-09 11:35:13 -07:00
Paul Berry
8668eaaa00 mesa: Use functions to convert gl_shader_stage to PROGRAM enum or pipe target.
Suggested-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>

v2: Improve assert message.
2014-01-09 09:31:27 -08:00
Paul Berry
e654216ac7 main: Change init_program_limits() to use gl_shader_stage.
This allows the caller to execute it in a loop rather than
hand-rolling a separate call for each stage.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-01-09 09:31:23 -08:00
Paul Berry
bce8bc0b25 glsl: Index into ctx->Const.Program[] rather than using ad-hoc code.
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-01-09 09:31:19 -08:00
Paul Berry
b539385789 mesa: Index into ctx->Const.Program[] rather than using ad-hoc code.
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-01-09 09:31:16 -08:00
Paul Berry
84732a982c mesa: replace ctx->Const.{Vertex,Fragment,Geomtery}Program with an array.
These are replaced with
ctx->Const.Program[MESA_SHADER_{VERTEX,FRAGMENT,GEOMETRY}].  In
patches to follow, this will allow us to replace a lot of ad-hoc logic
with a variable index into the array.

With the exception of the changes to mtypes.h, this patch was
generated entirely by the command:

    find src -type f '(' -iname '*.c' -o -iname '*.cpp' -o -iname '*.py' \
    -o -iname '*.y' ')' -print0 | xargs -0 sed -i \
    -e 's/Const\.VertexProgram/Const.Program[MESA_SHADER_VERTEX]/g' \
    -e 's/Const\.GeometryProgram/Const.Program[MESA_SHADER_GEOMETRY]/g' \
    -e 's/Const\.FragmentProgram/Const.Program[MESA_SHADER_FRAGMENT]/g'

Suggested-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-01-09 09:31:01 -08:00
José Fonseca
9b96be595b llvmpipe: Honour pipe_rasterizer::point_quad_rasterization.
Commit eda21d2a30 fixed the rasterization
of points for Direct3D but ended up breaking the rasterization of OpenGL
non-sprite points, in particular conform's pntrast.c test.

The only way to get both working is to properly honour
pipe_rasterizer::point_quad_rasterization, and follow the weird OpenGL
rule when it is false.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-01-09 12:35:11 +00:00
Eric Anholt
f46563fe1c i965: Don't do the temporary-and-blit-copy for INVALIDATE_RANGE maps.
We definitely want to fall through to the unsynchronized map case, instead
of wasting bandwidth on a copy.  Prevents a -43.2407% +/- 1.06113% (n=49)
performance regression on aa10perf when teaching glamor to provide the
GL_INVALIDATE_RANGE_BIT information.

This is a performance fix, which I usually wouldn't cherry-pick to stable.
But this was really was just a bug in the code, its presence would
discourage developers from giving us the best information they can, and I
think we've got fairly high confidence in the unsynchronized map path
already.

Cc: 10.0 9.2 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-01-09 15:39:20 +08:00
Eric Anholt
e186b927b8 i965: Fix handling of MESA_pack_invert in blit (PBO) readpixels.
Fixes piglit GL_MESA_pack_invert/readpixels and GPU hangs with glamor and
cairo-gl.

Cc: 10.0 9.2 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-01-09 15:30:33 +08:00
Eric Anholt
a4b222ac13 i965: Fix incorrect bounds tracking for blit readpixels's GPU access.
While incorrect, it probably wouldn't affect anyone ever: You'd have to do
an appropriately-formatted readpixels into a PBO, then overwrite the tail
end of the updated area of the PBO with glBufferSubData(), and you
wouldn't get appropriate synchronization.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-01-09 15:30:32 +08:00
Eric Anholt
66524daf17 i965: Use SET_FIELD to safety check our x/y offsets in blits.
The earlier assert made sure that our math didn't exceed our bounds, but
this makes sure that we don't overflow from the high bits X into the low
bits of Y.  We've already put checks in intel_miptree_blit(), but I've
wanted to expand the type in our protoype from short to uint32_t, and we
could get in trouble with intel_emit_linear_blit() if we did.

v2: Add Ken's comment about the funny language extension used.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> (v1)
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com> (v1)
2014-01-09 15:30:11 +08:00
Eric Anholt
5d2e86924e i965: Add an assert for when SET_FIELD's value exceeds the field size.
This was one of the things we always wanted to do to this, to make it more
useful than just (value << FIELD_MASK).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-01-09 15:23:27 +08:00
Eric Anholt
98cdb2ceed i965: Add a safety check for emitting blits.
With all of the flipping and pitch twiddling and miptree layout involved
in our blits, there are lots of ways for us to scribble outside of a
buffer.  Put in a check that we're not about to do so.

This catches a bug that glamor was running into.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-01-09 15:23:23 +08:00
Eric Anholt
bdc5241af4 i965: Don't call the blitter on addresses it can't handle.
Noticed by tex3d-maxsize on my next commit to check that our addresses
don't overflow.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-01-09 15:23:00 +08:00
Thomas Sondergaard
e8ff08edd8 mesa: Namespace qualify fma to override ambiguity with fma from math.h
MSVC 2013 version of math.h includes an fma() function.

Cc: "10.0" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-01-08 17:33:07 -07:00
Thomas Sondergaard
8fcddd325c mesa: Work around internal compiler error
This small rearrangement avoids MSVC 2013 ICE. Also, this should be
a better memory access order.

Cc: "10.0" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-01-08 17:33:06 -07:00
Thomas Sondergaard
067ad6e53e mesa: Fix compile error with MSVC 2013
This fixes the following compile error:
src\glsl\ir_constant_expression.cpp(1405) : error C2666: 'copysign' : 3
overloads have similar conversions

Cc: "10.0" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-01-08 17:33:06 -07:00
Thomas Sondergaard
20e65c92c7 mesa: Preliminary support for MSVC_VERSION=12.0
Cc: "10.0" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-01-08 17:33:06 -07:00
Rob Clark
646c16af6e freedreno: add basic query support
Add for now some simple/basic query support (ie. things not actually
requiring the GPU).  Might change around a bit when I actually add
GPU queries, but for now this enables some useful performance info
in the GALLIUM_HUD.  For example:

  GALLIUM_HUD=fps+batches+batches-sysmem+batches-gmem+restores,draw-calls

The driver specific specific queries are:

  + draw-calls
  + batches - number of batches per second, sum of batches-sysmem
    plus batches-gmem
  + batches-gmem - render a set of tiles in GMEM, for each tile
    (optionally) system mem -> gmem (restore), plus N draws,
    plus gmem -> system mem (resolve) per second
  + batches-sysmem - N draws to system memory (GMEM bypass) per
    second
  + restores - number of GMEM batches that required restore per
    second

Ideally for GMEM rendering, you want batches-gmem to equal fps.  If
the app is doing something that triggers multiple passes (ie. requires
extra round trip gmem <-> system memory) then the # of batches per
second will go up relative to fps.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-01-08 16:30:18 -05:00
Rob Clark
725d736f6a freedreno/a3xx: use cs patch instead of RFI+RMW
Since we now have the cmdstream patch mechanism needed for hw binning,
might as well also use it for RB_RENDER_CONTROL updates.  This avoids
the need to use RMW (and associated WFI) to update RB_RENDER_CONTROL.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-01-08 16:30:18 -05:00
Rob Clark
c0766528ba freedreno/a3xx: support for hw binning pass
The binning pass sorts vertices into which bins/tiles they apply to.
The visibility information generated during the binning pass can be
used to speed up the rendering pass by filtering out vertices which
do not apply to the current tile.  See:

 https://github.com/freedreno/freedreno/wiki/Adreno-tiling#optimized-approach

This brings a significant fps boost.  A rough assortment of tests
(supertuxkart, etracer, tremulous, glmark2 'build' test, etc) seems
to yield a ~35-45% fps improvement.

For now, to be conservative, the binning pass is not enabled yet by
default.  To enable it use:

  FD_MESA_DEBUG=binning

So far I haven't found anything that breaks with binning enabled,
but I'd like a bit more testing before I enable it as default.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-01-08 16:30:18 -05:00
Rob Clark
bfb44c24bc freedreno: be more clever about gmem usage
Only need to leave room for depth/stencil if it is actually used, etc.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-01-08 16:30:18 -05:00
Rob Clark
42c5e2a2ed freedreno: resync generated headers
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-01-08 16:30:18 -05:00
Chris Forbes
9e99735f30 i965: fold offset into coord for textureOffset(gsampler2DRect)
The hardware is broken with nonzero texel offsets and unnormalized
coordinates; instead of doing correct offsetting, we get garbage.

This just extends the existing workaround for ir_txf and
ir_tg4+gsampler2DRect to also consider ir_tex+gsampler2DRect.

Fixes broken rendering in 'tesseract' when 'mesa_texrectoffset_bug' is
not enabled; also fixes the new piglit test
'tests/spec/glsl-1.30/execution/fs-textureOffset-Rect'.

Has been broken ~forever; suggesting including this in only 10.0 because
the lowering pass doesn't exist in 9.2 or earlier so would require quite
a different patch.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: Lee Salzman <lsalzman@gmail.com>
Cc: "10.0" <mesa-stable@lists.freedesktop.org>
2014-01-09 10:09:01 +13:00
Paul Berry
31ec2f8338 mesa: Remove _mesa_progshader_enum_to_string(), which is no longer used.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-01-08 07:32:14 -08:00
Paul Berry
acfc58a7e5 glsl: Make more use of gl_shader_stage enum in ir_set_program_inouts.cpp.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-01-08 07:32:01 -08:00
Paul Berry
2adb9fea77 glsl: Make more use of gl_shader_stage enum in lower_clip_distance.cpp.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-01-08 07:31:58 -08:00
Paul Berry
80ee24823f glsl: Make more use of gl_shader_stage enum in link_varyings.cpp.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>

v2: Also rename "shaderType" param of is_varying_var() to "stage".

Reviewed-by: Brian Paul <brianp@vmware.com>
2014-01-08 07:31:55 -08:00
Paul Berry
9110078209 glsl: Change _mesa_glsl_parse_state ctor to use gl_shader_stage enum.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>

v2: Also rename "target" param to "stage".

Reviewed-by: Brian Paul <brianp@vmware.com>
2014-01-08 07:31:49 -08:00
Paul Berry
e3b86f07da mesa: Use gl_shader::Stage instead of gl_shader::Type where possible.
This reduces confusion since gl_shader::Type is sometimes
GL_SHADER_PROGRAM_MESA but is more frequently
GL_SHADER_{VERTEX,GEOMETRY,FRAGMENT}.  It also has the advantage that
when switching on gl_shader::Stage, the compiler will alert if one of
the possible enum types is unhandled.  Finally, many functions in
src/glsl (especially those dealing with linking) already use
gl_shader_stage to represent pipeline stages; using gl_shader::Stage
in those functions avoids the need for a conversion.

Note: in the process I changed _mesa_write_shader_to_file() so that if
it encounters an unexpected shader stage, it will use a file suffix of
"????" rather than "geom".

Reviewed-by: Brian Paul <brianp@vmware.com>

v2: Split from patch "mesa: Store gl_shader_stage enum in gl_shader objects."

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-01-08 07:31:45 -08:00
Paul Berry
65511e5f22 mesa: Store gl_shader_stage enum in gl_shader objects.
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-01-08 07:31:28 -08:00
Paul Berry
1722f5e73e mesa: Move declaration of gl_shader_stage earlier in mtypes.h.
Also move the related #define MESA_SHADER_STAGES.  This will allow
gl_shader_stage to be used in struct gl_shader.

Reviewed-by: Brian Paul <brianp@vmware.com>

v2: Split from patch "mesa: Store gl_shader_stage enum in gl_shader objects."

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-01-08 07:30:54 -08:00
Paul Berry
72a995d307 glsl: make _mesa_shader_stage_to_string() available to non-C++ code.
Reviewed-by: Brian Paul <brianp@vmware.com>

v2: Split from patch "mesa: Store gl_shader_stage enum in gl_shader objects."

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-01-08 07:30:48 -08:00
Paul Berry
665b8d7b6d mesa: Clean up nomenclature for pipeline stages.
Previously, we had an enum called gl_shader_type which represented
pipeline stages in the order they occur in the pipeline
(i.e. MESA_SHADER_VERTEX=0, MESA_SHADER_GEOMETRY=1, etc), and several
inconsistently named functions for converting between it and other
representations:

- _mesa_shader_type_to_string: gl_shader_type -> string
- _mesa_shader_type_to_index: GLenum (GL_*_SHADER) -> gl_shader_type
- _mesa_program_target_to_index: GLenum (GL_*_PROGRAM) -> gl_shader_type
- _mesa_shader_enum_to_string: GLenum (GL_*_{SHADER,PROGRAM}) -> string

This patch tries to clean things up so that we use more consistent
terminology: the enum is now called gl_shader_stage (to emphasize that
it is in the order of pipeline stages), and the conversion functions are:

- _mesa_shader_stage_to_string: gl_shader_stage -> string
- _mesa_shader_enum_to_shader_stage: GLenum (GL_*_SHADER) -> gl_shader_stage
- _mesa_program_enum_to_shader_stage: GLenum (GL_*_PROGRAM) -> gl_shader_stage
- _mesa_progshader_enum_to_string: GLenum (GL_*_{SHADER,PROGRAM}) -> string

In addition, MESA_SHADER_TYPES has been renamed to MESA_SHADER_STAGES,
for consistency with the new name for the enum.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>

v2: Also rename the "target" field of _mesa_glsl_parse_state and the
"target" parameter of _mesa_shader_stage_to_string to "stage".

Reviewed-by: Brian Paul <brianp@vmware.com>
2014-01-08 07:30:30 -08:00
José Fonseca
eda21d2a30 llvmpipe: Fix the bottom_edge_rule adjustment for points.
The adjustment needs to be applied to the y coordinates and not the x
coordinates, just like the equivalent code for lines and triangles in
lp_setup_line.c and lp_setup_tri.c.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Zack Rusin <zackr@vmware.com>
2014-01-08 12:18:17 +00:00
José Fonseca
37de6b0682 llvmpipe: Respect bottom_edge_rule when computing the rasterization bounding boxes.
This was inadvertently forgotten when replacing gl_rasterization_rules
with lower_left_origin and half_pixel_center (commit
2737abb44e).

This makes a difference when lower_left_origin != half_pixel_center, e.g,
D3D10.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Zack Rusin <zackr@vmware.com>
2014-01-08 12:18:17 +00:00
Chia-I Wu
76edf44f9e ilo: enable HiZ
The support is still early.  Fast depth buffer clear is not enabled yet.

HiZ can be forced off with ILO_DEBUG=nohiz.
2014-01-08 18:11:36 +08:00
Chia-I Wu
e7b4219e22 ilo: resolve Z/HiZ correctly
When the depth buffer is to be read, perform a Depth Buffer Resolve if it has
been rendered.  When the depth buffer is to be rendered, perform a HiZ Buffer
Resolve when the depth buffer is modified externally.
2014-01-08 18:11:35 +08:00
Chia-I Wu
77e3db464f ilo: add flags to texture slices
The flags are used to mark who (CPU, BLT, or RENDER) has accessed the resource
and how (READ or WRITE).
2014-01-08 18:11:35 +08:00
Chia-I Wu
846f70a6ef ilo: rename and add an accessor for texture slices
Rename ilo_texture::slice_offsets to ilo_texture::slices and add an accessor,
ilo_texture_get_slice().
2014-01-08 18:11:35 +08:00
Chia-I Wu
127fbc086b ilo: add HiZ op support to the pipelines
Add blitter functions to perform Depth Buffer Clear, Depth Buffer Resolve, and
Hierarchical Depth Buffer Resolve.  Those functions set ilo_blitter up and
pass it to the pipelines to emit the commands.
2014-01-08 18:11:35 +08:00
Chia-I Wu
546416d495 ilo: add support for HiZ allocation
Add tex_create_hiz() to create HiZ bo.  It is not really called yet.
2014-01-08 18:11:35 +08:00
Chia-I Wu
e372819589 ilo: refactor separate stencil allocation
Move separate stencil allocation code to tex_create_separate_stencil to keep
tex_create sane.
2014-01-08 18:11:35 +08:00
Chia-I Wu
82676f5d34 ilo: assorted GPE fixes for HiZ
Allow HiZ op to be specified in 3DSTATE_WM.  Pass depth format directly in
gen7_emit_3DSTATE_SF.  Use tex->hiz.bo to determine if HiZ exists.  Fix
3DSTATE_SF for the case when there is no ilo_rasterizer_state.  Fix
3DSTATE_PS for the case when there is no ilo_shader_state.
2014-01-08 18:11:35 +08:00
Chia-I Wu
6642381e75 ilo: no layer offsetting on GEN7+
Even though the Ivy Bridge PRM lists some restrictions that require layer
offsetting as the Sandy Bridge PRM does, it seems they are actually lifted.
2014-01-08 18:11:34 +08:00
Chia-I Wu
011fde4bf2 ilo: offset to layers only when necessary
GEN6 has several requirements regarding the LOD/Depth/Width/Height of the
render targets and the depth buffer.  We used to offset to the layers in
question unconditionally to meet the requirements.  With this commit,
offseting is done only when the requirements are not met.
2014-01-08 18:11:34 +08:00
Chia-I Wu
0a2a221d01 ilo: allow ilo_zs_surface to skip layer offsetting
Make offset to layer optional in ilo_gpe_init_zs_surface.
2014-01-08 18:11:34 +08:00
Chia-I Wu
8d9f5d57e2 ilo: allow ilo_view_surface to skip layer offsetting
Make offset to layer optional in ilo_gpe_init_view_surface_for_texture.
render_cache_rw is always the same as is_rt and is replaced.
2014-01-08 18:11:34 +08:00
Tapani Pälli
0978a6966a i965/fs: do SEL optimization only when src type for MOV matches
Fixes a bug where then branch operates with ivec4 while else uses vec4.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=72379

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-01-08 07:06:45 +02:00
Kenneth Graunke
847bc36a38 glsl: Optimize pow(2, x) --> exp2(x).
On Haswell, POW takes 24 cycles, while EXP2 only takes 14.  Plus, using
POW requires putting 2.0 in a register, while EXP2 doesn't.

I believe that EXP2 will be faster than POW on basically all GPUs, so
it makes sense to optimize it.

Looking at the savage2 subset of shader-db:
total instructions in shared programs: 113225 -> 113179 (-0.04%)
instructions in affected programs:     2139 -> 2093 (-2.15%)
instances of 'math pow':               795 -> 749 (-6.14%)
instances of 'math exp':               389 -> 435 (11.8%)

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-01-07 12:54:57 -08:00
Kenneth Graunke
5e3fd6a9db glsl: Refactor is_zero/one/negative_one into an is_value() method.
This patch creates a new generic is_value() method, which checks if an
ir_constant has a particular value.  (For vectors, it must have the
single value repeated across all components.)

It then rewrites the is_zero/is_one/is_negative_one methods to use this
generic helper.  All three were basically identical except for the value
they checked for.  The other difference is that is_negative_one rejects
boolean types.  The new is_value function maintains this behavior, only
allowing boolean types when checking for 0 or 1.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-01-07 12:54:57 -08:00
Kenneth Graunke
d6c1d66d3a glsl: Optimize pow(1.0, X) --> 1.0.
Surprisingly, this helps one vertex shader in 3DMMES.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-01-07 12:54:57 -08:00
Kenneth Graunke
05fbb021a6 mesa: Use get_local_param_pointer in glProgramLocalParameters4fvEXT().
Using the get_local_param_pointer helper ensures that the LocalParams
arrays have actually been allocated before attempting to use them.

glProgramLocalParameters4fvEXT needs to do a bit of extra checking,
but it can be simplified since the helper has already validated the
target.

Fixes crashes in programs that use Cg (for example, Awesomenauts,
Rocketbirds: Hardboiled Chicken, and Tiny and Big: Grandpa's Leftovers)
since commit e5885c119d
(mesa: Dynamically allocate the storage for program local parameters.)

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=73136
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Tested-by: Laurent Carlier <lordheavym@gmail.com>
2014-01-07 12:50:23 -08:00
José Fonseca
2d368b982a llvmpipe: Basic implementation of pipe_context::set_sample_mask.
We don't support MSAA (ie, number of samples is always one) therefore
sample_mask boils down to a synonym of the rasterizer_discard flag.

Also, this change makes setup actually use the value received in
lp_setup_set_rasterizer_discard instead of reaching out to llvmpipe
upper layers to re-fetch it.

Based on Si Chen's draft.

With this patch `wgf11multisample Coverage passes 100%` on the UMD
D3D10 state tracker.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Si Chen <sichen@vmware.com>
2014-01-07 16:04:42 +00:00
José Fonseca
95bf222603 cso_context: Fix cso_context::sample_mask initial value.
The initial value of cso_context::sample_mask_saved is irrelevant as it
will be overwritten with cso_context::sample_mask in
cso_save_sample_mask.  Therefore it is cso_context::sample_mask that
needs to be properly initialized.

This fixes regressions in blits and mipmap generation after adding
support for sample_mask to llvmpipe.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-01-07 16:04:42 +00:00
Si Chen
72c6d0e506 llvmpipe: Implement alpha_to_coverage for non-MSAA framebuffers.
Implement Alpha to Coverage by discarding a fragment alpha component is
less than 0.5.  This is a joint work of Jose and Si.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-01-07 16:04:42 +00:00
Andreas Fänger
2a0fb946e1 swrast: fix delayed texel buffer allocation regression for OpenMP
Commit 9119269ca1 moved the texel
buffer allocation to _swrast_texture_span(), however, when compiled
with OpenMP support this code already runs multi-threaded so a
critical section is required to prevent multiple allocations and
rendering errors.

Cc: "10.0" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-01-07 08:03:49 -07:00
Dave Airlie
aa4e2243a2 gallium/draw: remove double semicolon
code cleanup.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-01-07 18:52:46 +10:00
Brian Paul
8d1400fe12 glsl: rename min(), max() functions to fix MSVC build
Evidently, there's some other definition of "min" and "max" that
causes MSVC to choke on these function names.  Renaming to min2()
and max2() fixes things.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-01-06 16:57:49 -07:00
Kenneth Graunke
f6b10544cd i965: Remove unused PIPE_CONTROL defines.
Both brw_defines.h and intel_reg.h defined PIPE_CONTROL fields, which
had similar names, but couldn't be used in the same way.  (One had
built-in shifts, and the other didn't...)

Delete the unused set to preserve sanity.

(Eric wrote an almost identical patch back in August, so I believe he
approves.)

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2014-01-06 15:45:42 -08:00
Vinson Lee
f8432832a7 mesa: Remove GLXContextID typedef from glxext.h.
This patch fixes this build error with gcc <= 4.5 and clang <= 3.1.

  CC     clientattrib.lo
In file included from ../../include/GL/glx.h:333:0,
                 from glxclient.h:45,
                 from clientattrib.c:32:
../../include/GL/glxext.h:275:13: error: redefinition of typedef 'GLXContextID'
../../include/GL/glx.h:171:13: note: previous declaration of 'GLXContextID' was here

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=70591
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-01-06 14:57:23 -08:00
Maxence Le Doré
a44ca3595e docs/relnotes/10.1.html: report AMD_shader_trinary_minmax support
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-01-06 14:28:11 -08:00
Maxence Le Doré
1a9e8c23eb mesa: enable AMD_shader_trinary_minmax
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-01-06 14:28:10 -08:00
Maxence Le Doré
eb5dc75601 glsl: implement mid3 built-in function
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-01-06 14:28:09 -08:00
Maxence Le Doré
73c7451587 glsl: implement max3 built-in function
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-01-06 14:28:08 -08:00
Maxence Le Doré
ce46e14729 glsl: Implement min3 built-in function
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-01-06 14:28:08 -08:00
Maxence Le Doré
61c450fc81 glsl: add min() and max() functions to builder.cpp
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-01-06 14:28:07 -08:00
Maxence Le Doré
cf70d2a7c0 glsl: add a shader_trinary_minmax predicate
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-01-06 14:28:06 -08:00
Maxence Le Doré
ff50493bb3 glsl: Add extension tracking for AMD_shader_trinary_minmax
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-01-06 14:28:02 -08:00
Alexander von Gluck IV
61ef697afc haiku libGL: Move from gallium target to src/hgl
* The Haiku renderers need to link to libGL to function properly
  in all usage contexts. As mesa drivers build before gallium
  targets, we couldn't properly link the mesa swrast driver to
  the gallium libGL target for Haiku.
* This is likely better as it mimics how glx is laid out ensuring
  the Haiku libGL is better understood.
* All renderers properly link in libGL now.

Acked-by: Brian Paul <brianp@vmware.com>
2014-01-06 15:50:21 -06:00
Alexander von Gluck IV
b236314a11 haiku: Fix missing HaikuGL header paths
Acked-by: Brian Paul <brianp@vmware.com>
2014-01-06 15:50:15 -06:00
Brian Paul
3486f6f31b mesa: implement missing glGet(GL_RGBA_SIGNED_COMPONENTS_EXT) query
This is part of the GL_EXT_packed_float extension.

Bugzilla: http://bugs.freedesktop.org/show_bug.cgi?id=73096
Cc: 10.0 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-01-06 13:37:00 -07:00
Eric Anholt
7db56ddee0 i965: Warning fix
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-01-06 10:54:22 -08:00
Kenneth Graunke
242ca9acb4 i965: Delete unused INTEL_WRITE_{PART,FULL} and INTEL_READ #defines.
These are just software flag values (not hardware specific values), and
aren't used anywhere.  Delete them to avoid confusion.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2014-01-06 10:52:43 -08:00
Marek Olšák
346b6abab9 radeonsi: calculate NUM_BANKS for DB correctly on CIK
NUM_BANKS is not constant on CIK.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2014-01-06 18:40:42 +01:00
Marek Olšák
bf3c361113 radeonsi: set correct pipe config for Hawaii in DB
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-01-06 18:40:42 +01:00
Marek Olšák
2748b7da7e radeonsi: disable HTILE for 1D-tiled depth-stencil buffers
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-01-06 18:40:41 +01:00
Juha-Pekka Heikkila
d41f5396f3 glx: check memory allocations in __glXInitVertexArrayState()
Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-01-06 10:23:26 -07:00
Juha-Pekka Heikkila
0c04cca0e1 glx: Add missing null check in __glXNewIndirectAPI()
Add extra null check in auto generated indirect_init.c via
src/mapi/glapi/gen/glX_proto_send.py

Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-01-06 10:23:12 -07:00
Nathan Kidd
0691b37732 docs: fix misspellings
Fixed what I noticed; no warranty for exhaustiveness.

Signed-off-by: Nathan Kidd <nkidd@opentext.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-01-06 09:55:38 -07:00
Chris Forbes
a61ae2aa01 i965: set size of txf_mcs payload vgrf properly
Previously we left the size of this vgrf as 1, which caused register
allocation to be subtly broken. If we were lucky we would explode in
the post-alloc instruction scheduler; if we were unlucky we'd just stomp
on someone else and get broken rendering.

Fixes crash when running `tesseract` with the following settings:

   msaa 4
   glineardepth 0

Also fixes the piglit test:

  arb_sample_shading-builtin-gl-sample-id

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Cc: Anuj Phogat <anuj.phogat@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=72859
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-01-04 20:24:29 +13:00
Erik Faye-Lund
eb212c5a30 glcpp: error on multiple #else/#elif directives
The preprocessor currently accepts multiple else/elif-groups
per if-section. The GLSL-preprocessor is defined by the C++
specification, which defines the following parse-rule:

if-section:
	if-group elif-groups(opt) else-group(opt) endif-line

This clearly only allows a single else-group, that has to come
after any elif-groups.

So let's modify the code to follow the specification. Add test
to prevent regressions.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Carl Worth <cworth@cworth.org>

Cc: 10.0 <mesa-stable@lists.freedesktop.org>
2014-01-02 14:22:58 -08:00
Carl Worth
6005e9cb28 glcpp: Replace multi-line comment with a space (even as part of macro definition)
The preprocessor has always replaced multi-line comments with a single space
character, (as required by the specification), but as of commit
bd55ba568b the lexer also emitted a NEWLINE
token for each newline within the comment, (in order to preserve line
numbers).

The emitting of NEWLINE tokens within the comment broke the rule of "replace a
multi-line comment with a single space" as could be exposed by code like the
following:

	#define FOO a/*
	*/b

	FOO

Prior to commit bd55ba568b, this code defined
the macro FOO as "a b" as desired. Since that commit, this code instead
defines FOO as "a" and leaves a stray "b" in the output.

In this commit, we fix this by not emitting the NEWLINE tokens while lexing
the comment, but instead merely counting them in the commented_newlines
variable. Then, when the lexer next encounters a non-commented newline it
switches to a NEWLINE_CATCHUP state to emit as many NEWLINE tokens as
necessary (so that subsequent parsing stages still generate correct line
numbers).

Of course, it would have been more clear if we could have written a loop to
emit all the newlines, but flex conventions prevent that, (we must use
"return" for each token we emit).

It similarly would have been clear to have a new rule restricted to the
<NEWLINE_CATCHUP> state with an action much like the body of this if
condition. The problem with that is that this rule must not consume any
characters. It might be possible to write a rule that matches a single
lookahead of any character, but then we would also need an additional rule to
ensure for the <EOF> case where there are no additional characters available
for the lookahead to match.

Given those considerations, and given that the SKIP-state manipulation already
involves a code block at the top of the lexer function, before any rules, it
seems best to me to go with the implementation here which adds a similar
pre-rule code block for the NEWLINE_CATCHUP.

Finally, this commit also changes the expected output of a few, existing glcpp
tests. The change here is that the space character resulting from the
multi-line comment is now emitted before the newlines corresponding to that
comment. (Previously, the newlines were emitted first, and the space character
afterward.)

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=72686

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-01-02 14:15:51 -08:00
Carl Worth
61cea49014 glcpp: Add a more descriptive comment for the SKIP state manipulation
Two things make this code confusing:

	1. The uncharacteristic manipulation of lexer start state outside of
	   flex rules.

	2. The confusing semantics of the skip_stack (including the
	   "lexing_if" override and the SKIP_NO_SKIP state).

This new comment is intended to bring a bit more clarity for any readers.

There is no intended beahvioral change to the code here. The actual code
changes include better indentation to avoid an excessively-long line, and
using the more descriptive INITIAL rather than 0.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-01-02 14:15:24 -08:00
Courtney Goeltzenleuchter
5a51c1b01a i965: Enhance intel_texsubimage_tiled_memcpy() to support all levels
Support all levels of a supported texture format.

Using 1024x1024, RGBA 8888 source, mipmap
internal-format	Before (MB/sec)     mipmap (MB/sec)
GL_RGBA		627.15		615.90
GL_RGB		456.35		611.53

512x512
GL_RGBA		597.00		619.95
GL_RGB		440.62		611.28

256x256
GL_RGBA		487.80		587.42
GL_RGB		376.63		585.00

Benchmark has been sent to mesa-dev list: teximage_enh

Signed-off-by: Courtney Goeltzenleuchter <courtney@LunarG.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2013-12-30 14:57:49 -08:00
Courtney Goeltzenleuchter
85784fd832 i965: Add XRGB to intel_texsubimage_tiled_memcpy()
MESA_FORMAT_XRGB8888 is equivalent to MESA_FORMAT_ARGB8888 in terms
of storage on the device, so okay to use this optimized copy routine.

This series builds on work from Frank Henigman to optimize the
process of uploading a texture to the GPU. This series adds support for
MESA_XRGB_8888 and full miptrees where were found to be common activities
in the Smokin' Guns game. The issue was found while profiling the app
but that part is not benchmarked. Smokin-Guns uses mipmap textures with
an internal format of GL_RGB (MESA_XRGB_8888 in the driver).

These changes need a performance tool to run against to show how they
improve execution performance for specific texture formats. Using this
benchmark I've measured the following improvement on my Ivybridge
Intel(R) Xeon(R) CPU E3-1225 V2 @ 3.20GHz.

1024x1024 texture size
internal-format	Before (MB/sec)     XRGB (MB/sec)
GL_RGBA		628.15		    627.15
GL_RGB		265.95	 	    456.35

512x512 texture size
internal-format	Before (MB/sec)     XRGB (MB/sec)
GL_RGBA		600.23	  	    597.00
GL_RGB		255.50		    440.62

256x256 texture size
internal-format	Before (MB/sec)     XRGB (MB/sec)
GL_RGBA		489.08		    487.80
GL_RGB		229.03	  	    376.63

Benchmark has been sent to mesa-dev list: teximage

Signed-off-by: Courtney Goeltzenleuchter <courtney@LunarG.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2013-12-30 14:57:48 -08:00
Paul Berry
77c74c647b glsl: Fix gl_type of usamplerCube built-in type.
I'm not aware of any piglit tests that this fixes, but the old code
was obviously wrong.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-12-30 11:21:39 -08:00
Paul Berry
7e0b4b5e9b mesa: Add an assertion to _mesa_program_index_to_target().
Only a Mesa bug could cause this function to be called with an
out-of-range index, so raise an assertion if that ever happens.

Reviewed-by: Brian Paul <brianp@vmware.com>
2013-12-30 11:21:33 -08:00
Paul Berry
99e822fa18 mesa: Improve static error checking of arrays sized by MESA_SHADER_TYPES.
This patch replaces the following pattern:

    foo bar[MESA_SHADER_TYPES] = {
       ...
    };

With:

    foo bar[] = {
       ...
    };
    STATIC_ASSERT(Elements(bar) == MESA_SHADER_TYPES);

This way, when a new shader type is added in a future version of Mesa,
we will get a compile error to remind us that the array needs to be
updated.

Reviewed-by: Brian Paul <brianp@vmware.com>
2013-12-30 11:21:27 -08:00
Paul Berry
b30e25f297 glsl: Remove extraneous shader_type argument from analyze_clip_usage().
This argument was carrying the name of the shader target (as a
string).  We can get this just as easily by calling
_mesa_shader_enum_to_string().

Reviewed-by: Brian Paul <brianp@vmware.com>
2013-12-30 11:21:24 -08:00
Paul Berry
d343e3d98c glsl: Get rid of hardcoded arrays of shader target names.
We already have a function for converting a shader type index to a
string: _mesa_shader_type_to_string().

Reviewed-by: Brian Paul <brianp@vmware.com>
2013-12-30 11:21:21 -08:00
Paul Berry
89c35c59a4 main: Remove unused function _mesa_shader_index_to_type().
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-12-30 11:21:14 -08:00
Paul Berry
26707abe56 Rename overloads of _mesa_glsl_shader_target_name().
Previously, _mesa_glsl_shader_target_name() had an overload for GLenum
and an overload for the gl_shader_type enum, each of which behaved
differently.  However, since GLenum is a synonym for unsigned int, and
unsigned ints are often used in place of gl_shader_type (e.g. in loop
indices), there was a big risk of calling the wrong overload by
mistake.  This patch gives the two overloads different names so that
it's always clear which one we mean to call.

Reviewed-by: Brian Paul <brianp@vmware.com>
2013-12-30 11:21:08 -08:00
Kenneth Graunke
f425d56ba4 Revert "mesa: Remove GLXContextID typedef from glx.h."
This reverts commit 136a12ac98.

According to belak51 on IRC, this commit broke Allegro, which would no
longer compile.  Applications apparently expect the GLXContextID typedef
to exist in glx.h; removing it breaks them.  A bit of searching around
the internet revealed other complaints since upgrading to Mesa 10.

Cc: "10.0" <mesa-stable@lists.freedesktop.org>
2013-12-29 23:23:33 -08:00
Kenneth Graunke
da031f83f7 i965: Remove unused depth_mode parameter from translate_tex_format().
According to git blame, this hasn't been used in over two years:

    commit d2235b0f46
    Author: Eric Anholt <eric@anholt.net>
    Date:   Thu Nov 17 17:01:58 2011 -0800

        i965: Always handle GL_DEPTH_TEXTURE_MODE through the shader.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2013-12-29 23:18:24 -08:00
Topi Pohjolainen
597a7ccc72 i965/blorp: unit test compiling integer typed texture fetches
Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2013-12-27 11:59:45 +02:00
Topi Pohjolainen
1c76b53482 i965/blorp: unit test compiling simple gen6 zero-src sampled
Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2013-12-27 11:59:38 +02:00
Topi Pohjolainen
118c093d56 i965/blorp: unit test compiling gen6 msaa-8 cms alpha blend
Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2013-12-27 11:59:34 +02:00
Topi Pohjolainen
b03319ddb1 i965/blorp: unit test compiling bilinear filtered
Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2013-12-27 11:59:31 +02:00
Topi Pohjolainen
b928e345e4 i965/blorp: unit test compiling simple zero-src sampled
Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2013-12-27 11:59:27 +02:00
Topi Pohjolainen
001b92c112 i965/blorp: unit test compiling unaligned msaa-8
Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2013-12-27 11:59:23 +02:00
Topi Pohjolainen
0f89ebacbb i965/blorp: unit test compiling msaa-8 cms alpha blend
Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2013-12-27 11:59:19 +02:00
Topi Pohjolainen
90dcf31631 i965/blorp: unit test compiling msaa-4 ums to cms
Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2013-12-27 11:59:15 +02:00
Topi Pohjolainen
11d2986a53 i965/blorp: unit test compiling msaa-8 cms to cms
Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2013-12-27 11:59:11 +02:00
Topi Pohjolainen
28d2c969e7 i965/blorp: unit test compiling msaa-8 ums to cms
Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2013-12-27 11:59:07 +02:00
Topi Pohjolainen
812f1e94c0 i965/blorp: unit test compiling blend and scaled
Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2013-12-27 11:59:03 +02:00
Topi Pohjolainen
a7757bf518 i965/blorp: allow unit tests to compile and dump assembly
Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2013-12-27 11:58:59 +02:00
Topi Pohjolainen
1cb22f0da2 i965: dump the disassembly to the given file
instead of ignoring the argument and always dumping to
standard output.

Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2013-12-27 11:58:52 +02:00
Topi Pohjolainen
1958a9bbdf i965/fs: allow fs-generator use without gl_fragment_program
Prepares the generator to accept hand-crafted blorp programs.

Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2013-12-27 11:58:46 +02:00
Topi Pohjolainen
ca53704f4b i965/fs: generate fs programs also without any 8-width instructions
Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2013-12-27 11:58:36 +02:00
Rob Clark
8ab47b4353 freedreno/a3xx: fix blend state corruption issue
Using RMW on banked context registers is not safe.  The value read
could be the wrong one.  So if there has been a DRAW_IDX launched,
the RMW must be preceded by a WAIT_FOR_IDLE to ensure the read part
of RMW sees the correct value.

To avoid unnecessary WFI's, keep track if there is a need for WFI,
and only emit one if needed.  Furthermore, keep track if we even
need to update the register in the first place.

And to cut down on the amount of RMW to avoid excessive WFI's, at the
tiling/GMEM level we can always overwrite RB_RENDER_CONTROL, as the
state at beginning of draw/clear cmds (which we IB to) is always
undefined.  In the draw/clear commands, we always still use RMW (with
WFI if needed), but only if the register value actually changes.  (At
points where the current value cannot be known, the saved value is
reset to ~0, which includes bits outside of RBRC_DRAW_STATE, so there
never is chance for confusion.)

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2013-12-26 12:13:42 -05:00
Rob Clark
be01d7a905 freedreno: prepare for hw binning
Actually assign VSC_PIPE's properly, which will be needed for tiling.
And introduce fd_tile for per-tile state (including the assignment of
tile to VSC_PIPE).  This gives us the proper pipe setup that we'll
need for hw binning pass, and also cleans things up a bit by not having
to pass so many parameters around.  And will also make it easier to
introduce different tiling patterns (since we may no longer render
tiles in a simple left-to-right top-to-bottom pattern).

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2013-12-26 12:06:29 -05:00
Rob Clark
64fe067066 freedreno: resync generated headers
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2013-12-26 12:06:29 -05:00
Alex Deucher
e2d53fac1c r600g: fix SUMO2 pci id
0x9649 is sumo2, not sumo.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
CC: "9.2" "10.0" <mesa-stable@lists.freedesktop.org>
2013-12-24 15:22:31 -05:00
Vinson Lee
35a3414302 scons: Add system library linker flags on LLVM 3.5.
llvn-3.5svn r197664 split out the linker flags from ldflags to
system-libs.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
2013-12-23 11:33:29 -08:00
Aaron Watry
3ddabe0d52 r600/pipe: Stop leaking context->start_compute_cs_cmd.buf on EG/CM
Found while tracking down memory leaks in VDPAU playback

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>

CC: "10.0" <mesa-stable@lists.freedesktop.org>
2013-12-23 07:24:50 -06:00
Aaron Watry
20446d0e53 st/vdpau: Destroy context when initialization fails
Prevents a potential memory leak found when tracking down something else.

Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>

CC: "10.0" <mesa-stable@lists.freedesktop.org>
2013-12-23 07:24:50 -06:00
Aaron Watry
767b0f82c3 radeon/llvm: Free target data at end of optimization
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>

CC: "10.0" <mesa-stable@lists.freedesktop.org>
2013-12-23 07:24:50 -06:00
Aaron Watry
0bd858d7ff r600/compute: Use the correct FREE macro when deleting compute state
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>

CC: "10.0" <mesa-stable@lists.freedesktop.org>
2013-12-23 07:24:50 -06:00
Aaron Watry
e19717d075 r600/compute: Free compiled kernels when deleting compute state
v2: Remove unnecessary null pointer check

CC: "10.0" <mesa-stable@lists.freedesktop.org>
2013-12-23 07:24:50 -06:00
Aaron Watry
8c9a9205d9 radeon/compute: Stop leaking LLVMContexts in radeon_llvm_parse_bitcode
Previously we were creating a new LLVMContext every time that we called
radeon_llvm_parse_bitcode, which caused us to leak the context every time
that we compiled a CL program.

Sadly, we can't dispose of the LLVMContext at the point that it was being
created because evergreen_launch_grid (and possibly the SI equivalent) was
assuming that the context used to compile the kernels was still available.

Now, we'll create a new LLVMContext when creating EG/SI compute state, store
it there, and pass it to all of the places that need it.

The LLVM Context gets destroyed when we delete the EG/SI compute state.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>

CC: "10.0" <mesa-stable@lists.freedesktop.org>
2013-12-23 07:24:50 -06:00
Aaron Watry
a7653c19a3 pipe_loader/sw: close dev->lib when initialization fails
Prevents a memory leak.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>

CC: "10.0" <mesa-stable@lists.freedesktop.org>
2013-12-23 07:24:50 -06:00
Aaron Watry
862f55c29c clover: Remove unused variable
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>

CC: "10.0" <mesa-stable@lists.freedesktop.org>
2013-12-23 07:24:50 -06:00
Jonathan Liu
7990ab58fa llvmpipe: use pipe_sampler_view_release() to avoid segfault
This fixes another case of faulting when freeing a pipe_sampler_view
that belongs to a previously destroyed context.

Cc: "10.0" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Jonathan Liu <net147@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-12-22 07:07:56 -07:00
Jonathan Liu
670be71bd8 st/mesa: use pipe_sampler_view_release()
This fixes a crash where old_view->context was already freed in the
pipe_sampler_view_reference function contained in
src/gallium/auxiliary/utils/u_inlines.h. As a result, the
sampler_view_destroy function pointer contained 0xfeeefeee indicating
freed heap memory.

Cc: "10.0" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Jonathan Liu <net147@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-12-22 07:07:07 -07:00
Henri Verbeet
b094b3b9f4 i915: Add support for gl_FragData[0] reads.
Similar to 556a47a262, without this reading from
gl_FragData[0] would cause a software fallback.

Bugzilla: https://bugs.winehq.org/show_bug.cgi?id=33964
Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
Cc: 10.0 9.2 9.1 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-12-22 11:55:39 +01:00
Andreas Hartmetz
2efe7927d3 radeonsi: Use htile_buffer for depth only when there is no stencil.
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
2013-12-22 01:41:03 +01:00
Niels Ole Salscheider
900ac63ee8 winsys/radeon: remove superfluous distinction of cases
Signed-off-by: Niels Ole Salscheider <niels_ole@salscheider-online.de>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
2013-12-22 01:41:02 +01:00
Mark Mueller
852db050b9 mesa: inline r200 radeon texture format macros to facility search and replace
Signed-off-by: Mark Mueller <MarkKMueller@gmail.com>
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
2013-12-21 15:27:29 +01:00
Lauri Kasanen
fcefdc9a59 mesa: Fix build to properly check for supported compiler flags
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=72708
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Lauri Kasanen <cand@gmx.com>
2013-12-20 17:00:57 -08:00
Ian Romanick
79f268978d mesa: It is not possible to have GLSL < 1.20
This hasn't been possible for a long time.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-12-20 16:43:08 -08:00
Ian Romanick
4949322462 mesa: Clean up bad code formatting left from previous commit
Also s/_EXT// on enums that are now part of core.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-12-20 16:43:08 -08:00
Ian Romanick
a92b9e60ab mesa: GL_EXT_packed_depth_stencil is not optional
Every driver supports it.  All current and future Gallium drivers always
support it, and all existing classic drivers support it.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-12-20 16:43:08 -08:00
Ian Romanick
b66edff435 radeon: Sort list of enabled extensions
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-12-20 16:43:08 -08:00
Ian Romanick
1bf436e014 r200: Sort list of enabled extensions
Note that ARB_occlusion_query was previously enabled twice.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-12-20 16:43:08 -08:00
Lauri Kasanen
fe2079c4c0 glx: Simplify __glxGetMscRate, it only needs the screen, not a drawable
Useful in its own right, but also needed for adaptive vsync.

No regressions in the piglit glx-oml-sync-control-getmscrate test.

Signed-off-by: Lauri Kasanen <cand@gmx.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Tested-by: Ian Romanick <ian.d.romanick@intel.com>
2013-12-20 16:43:08 -08:00
Keith Packard
6b51113981 dri3: Rename DRI3_MAX_BACK to DRI3_NUM_BACK
It is the maximum number of back buffers, but the name is confusing and is
easily read as the maximum back buffer index. Chage to DRI3_NUM_BACK to make
the intended usage a bit clearer.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-12-20 16:31:09 -08:00
Keith Packard
547bcc4b57 i965: Set fast color clear mcs_state on newly allocated image miptrees
Just copying code from the dri2 path to set up the fast color clear state.

This also removes a couple of bogus intel_region_reference calls.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-12-20 16:19:52 -08:00
Keith Packard
c426fb08cf i965: Correct check for re-bound buffer in intel_update_image_buffer
The buffer-object is the persistent thing passed through the loader, so when
updating an image buffer, check to see if it is already bound to the provided
bo. The region, on the other hand, is allocated separately for the miptree,
and so will never be the same as that passed back from the loader.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-12-20 16:18:37 -08:00
Keith Packard
ca2012a912 dri3: Clean up struct dri3_drawable
Move the depth field up with width and height.

Remove unused previous_time and frames fields.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-12-20 16:18:11 -08:00
Keith Packard
95b04850d0 dri3: Free resources when drawable is destroyed.
Always nice to clean up after ourselves.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-12-20 16:17:59 -08:00
Keith Packard
568a27588d dri3: Switch to libxshmfence version 1.1
libxshmfence v1.0 foolishly used 'int32_t *' for the fence type, which
works when the fence is a linux futex. However, version 1.1
changes the exported datatype to 'struct xshmfence *'

Require libxshmfence version 1.1 and switch the API around.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-12-20 16:17:54 -08:00
Kenneth Graunke
9f330481c3 i965: Use RED for depth texture formats rather than INTENSITY.
While looking through the documentation, I found this in the Sandybridge
PRM (Volume 4, Part 1, Page 140):
"Use of sample_c with SURFTYPE_CUBE surfaces is undefined with the
 following surface formats: I24X8_UNORM, L24X8_UNORM, A24X8_UNORM,
 I32_FLOAT, L32_FLOAT, A32_FLOAT."

I haven't observed this to be true, but it suggests that we may want to
use other formats.

We already perform DEPTH_TEXTURE_MODE swizzling in the shaders, and
don't rely on the surface format to splat things appropriately.  So
using RED should work just as well as INTENSITY.

A few notes about the formats:
- R24_UNORM_X8_TYPELESS has the exact same properties as I24X8_UNORM.
- R16_UNORM and R32_FLOAT are additionally supported as a render target,
  while the old I16_UNORM/I32_FLOAT formats are not.
- R32_FLOAT_X8X24_TYPELESS is not supported as a render target, while
  the old format (R32G32_FLOAT) was.  However, it shares the same
  properties as the formats we use for Z24, so it should suffice.

This makes translate_tex_format and brw_blorp_surface_info::set
a bit more similar.

No Piglit changes on Sandybridge or Ivybridge.  No oglconform changes on
Sandybridge.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-12-20 16:14:35 -08:00
Chad Versace
1a928816a1 i965/gen6: Fix HiZ hang in WebGL Google Maps
Emitting flushes before depth and hiz resolves at the top of blorp's
state emission fixes the hang. Marchesin and I found the fix
experimentally, as opposed to adhering to a documented hardware
workaround.  A more minimal fix likely exists, but this gets the job
done.

Fixes HiZ hangs in the new WebGL Google maps on Sandybridge Chrome OS.
Tested by zooming in and out continuously for 2 hours.

This patch is based on
8bc07bb701

CC: mesa-stable@lists.freedesktop.org
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=70740
Signed-off-by: Stéphane Marchesin <marcheu@chromium.org>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-12-20 15:20:30 -08:00
Kenneth Graunke
b97fa1e75b i965: Store QPitch in intel_mipmap_tree.
Broadwell allows us to specify an arbitrary value for QPitch, rather
than baking a specific formula into the hardware and requiring software
to lay things out to match.  The only restriction is that the software
provided QPitch needs to be large enough so successive array slices do
not overlap.

In order to support this flexibility, software needs to specify QPitch
in a bunch of packets.  Storing QPitch makes that easy, and allows us to
adjust it in a single place should we wish to change it in the future.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-12-20 12:41:54 -08:00
Kenneth Graunke
1e8e17ccd7 i965: Add support for Broadwell's new register types.
Broadwell introduces support for Q, UQ, and HF types.  It also extends
DF support to allow immediate values.

Irritatingly, although HF and DF both support immediates, they're
represented by a different value depending on the register file.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-12-20 12:34:43 -08:00
Kenneth Graunke
15b9aa22d7 i965: Add BRW_REGISTER_TYPE_DF.
Ivybridge, Baytrail, and Haswell support double float register types,
but do not support them as immediate values.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-12-20 12:34:41 -08:00
Kenneth Graunke
54e91e7420 i965: Abstract BRW_REGISTER_TYPE_* into an enum with unique values.
On released hardware, values 4-6 are overloaded.  For normal registers,
they mean UB/B/DF.  But for immediates, they mean UV/VF/V.

Previously, we just created #defines for each name, reusing the same
value.  This meant we could directly splat the brw_reg::type field into
the assembly encoding, which was fairly nice, and worked well.

Unfortunately, Broadwell makes this infeasible: the HF and DF types are
represented as different numeric values depending on whether the
source register is an immediate or not.

To preserve sanity, I decided to simply convert BRW_REGISTER_TYPE_* to
an abstract enum that has a unique value for each register type, and
write translation functions.  One nice benefit is that we can add
assertions about register files and generations.

I've chosen not to convert brw_reg::type to the enum, since converting
it caused a lot of trouble due to C++ enum rules (even though it's
defined in an extern "C" block...).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-12-20 12:34:39 -08:00
Kenneth Graunke
13454fc3de i965: Decode three-source register types directly.
Three-source instructions use a different encoding for register types
(and have a much more limited set to choose from).

Previously, we translated those into BRW_REGISTER_TYPE_* values, then
reused the existing reg_encoding mapping.

Doing it directly is more straightforward and actually less code.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-12-20 12:34:38 -08:00
Kenneth Graunke
4e95a09937 i965: Disassemble UV types, not UB types.
UB types have never been supported as immediates.  On Gen4-5, register
encoding 4 is "Reserved."  On Gen6+, it means UV.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-12-20 12:34:36 -08:00
Kenneth Graunke
d10242c5f7 i965: Add missing BRW_REGISTER_TYPE_UV.
Sandybridge added support for packed unsigned vectors.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-12-20 12:34:15 -08:00
Kenneth Graunke
51c9cfc296 i965: Fix 3DSTATE_PUSH_CONSTANT_ALLOC_PS packet creation.
When adding geometry shader support, we accidentally reversed the size
and offset parameters.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Cc: "10.0" <mesa-stable@lists.freedesktop.org>
2013-12-20 12:25:43 -08:00
Kenneth Graunke
0d0edf8e4c i965: Use {point_sprite,flat}_enable variable names instead of dw*.
Calling the local variables flat_enable and point_sprite_enable is
clearer than dw16 and such.  It also matches the names used in
calculate_attr_overrides, which computes them.

v2: Add /* dw16 */ and /* dw10 */ comments, requested by Jordan.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2013-12-20 12:25:33 -08:00
Kenneth Graunke
23fc845f81 i965: Zero out {point_sprite,flat}_enables in calculate_attr_overrides.
calculate_attr_overrides is responsible for computing the point sprite
and flat-shading enable bitfields.  It does so by OR'ing in a bunch of
bits.  However, it relied on the caller to set the initial value to
zero.  This is pretty fragile - if the caller neglects to zero out those
variables, then the enable bitfields end up full of garbage, which shows
up as random things being flat-shaded.

This patch moves the zero-initialization into calculate_attr_overrides,
so that the computation is completely in one place.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2013-12-20 12:25:33 -08:00
Kenneth Graunke
da872ddcc6 i965: Delete bogus BRW_REGISTER_TYPE_HF define.
git blame ascribes this to the initial commit of the driver.

No released hardware has ever supported half float, according to the
documentation for SrcType in the ISA reference.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2013-12-20 12:25:33 -08:00
Kevin Rogovin
3b1195f8a6 Report that no function found if signature lookup is empty
If no function signature is found for a function name, report that the
function is not found instead of printing an empty list of candidates.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-12-20 09:03:54 -08:00
Kevin Rogovin
23d294bb60 Use line number information from entire function expression
This patch changes the error reporting behavior for incorrect function
invocation (triggered by match_function_by_name() unable to find a
matching function call) from using the line number information
associated to the function name term to using the line number
information of the entire function expression. Fixes bug #72264.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=72264
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Cc: "10.0" <mesa-stable@lists.freedesktop.org>
2013-12-20 09:03:54 -08:00
Michel Dänzer
d580905000 radeonsi: Only scan pixel shaders for TGSI_PROPERTY_FS_COLOR0_WRITES_ALL_CBUFS
It's not relevant for other shader types.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2013-12-20 18:51:09 +09:00
Aaron Watry
8252847b7b r600g: Fix spelling error
Trivial change, testing commit access
2013-12-19 14:30:51 -06:00
Quanxian Wang
1413a09f34 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>
2013-12-19 12:44:11 -07:00
Juha-Pekka Heikkila
22bf0f3eb4 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>
2013-12-19 08:26:17 -07:00
Juha-Pekka Heikkila
a7d8607d9e mesa: Add asserts into emit_fog_instructions
Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-12-19 08:25:58 -07:00
Juha-Pekka Heikkila
cd6aaf2920 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>
2013-12-19 08:25:45 -07:00
Dave Airlie
149140e922 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>
2013-12-18 22:46:29 +00:00
Juha-Pekka Heikkila
28b552bf6b 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>
2013-12-18 09:40:29 -07:00
Juha-Pekka Heikkila
c02f6c26d3 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>
2013-12-18 09:40:19 -07:00
Brian Paul
a9bf5999d1 mesa: minor simplification in _mesa_es3_error_check_format_and_type()
The type_valid local was set to true and never changed.
2013-12-18 09:06:52 -07:00
Juha-Pekka Heikkila
ca3df5eeda glx: Add missing null check in dri2CreateDrawable
Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-12-18 09:06:52 -07:00
Juha-Pekka Heikkila
56c5ba8f92 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>
2013-12-18 09:06:52 -07:00
Juha-Pekka Heikkila
2a83e4182c 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>
2013-12-18 09:06:52 -07:00
Juha-Pekka Heikkila
d08ac826c5 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>
2013-12-18 09:06:52 -07:00
Brian Paul
aa4001b607 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.
2013-12-18 09:06:52 -07:00
Brian Paul
eaaa9695b2 mesa: 78-column wrapping in extensions.c 2013-12-18 09:06:52 -07:00
Pi Tabred
4bf3afdde9 mesa: Cleanup mesa/main/bufferobj.h
Column wrapping and space between lines.

Reviewed-by: Brian Paul <brianp@vmware.com>
2013-12-18 09:06:52 -07:00
Pi Tabred
3b0f5fc084 Modify release notes to include ARB_clear_buffer_object extension
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-12-18 09:06:52 -07:00
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
Courtney Goeltzenleuchter
375f660e27 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>
2013-12-13 12:31:54 -07:00
Courtney Goeltzenleuchter
1db4cb841b 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>
2013-12-13 12:31:54 -07:00
Courtney Goeltzenleuchter
f07ca59839 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>
2013-12-13 12:31:54 -07:00
Courtney Goeltzenleuchter
bb5947de99 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>
2013-12-13 12:31:54 -07:00
Courtney Goeltzenleuchter
320ec1deac mesa: Add driver entry point for ARB_texture_view
Signed-off-by: Courtney Goeltzenleuchter <courtney@LunarG.com>

Reviewed-by: Brian Paul <brianp@vmware.com>
2013-12-13 12:31:54 -07:00
Courtney Goeltzenleuchter
f1563e6392 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>
2013-12-13 12:31:54 -07:00
Courtney Goeltzenleuchter
668f3614ca 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>
2013-12-13 12:31:53 -07:00
Courtney Goeltzenleuchter
2e8493af51 mesa: Tracking for ARB_texture_view extension
Signed-off-by: Courtney Goeltzenleuchter <courtney@LunarG.com>

Reviewed-by: Brian Paul <brianp@vmware.com>
2013-12-13 12:31:53 -07:00
Courtney Goeltzenleuchter
d77d2af20a 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>
2013-12-13 12:31:53 -07:00
Anuj Phogat
7a73c6acb0 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>
2013-12-13 11:13:25 -08:00
Carl Worth
93e399f641 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 d573899b93)

[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.]
2013-12-13 11:12:23 -08:00
Kristian Høgsberg
38366c0c6e 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>
2013-12-13 08:19:50 -08:00
Carl Worth
d6c8365795 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.
2013-12-12 23:10:53 -08:00
Carl Worth
16c2919972 docs: Fix typo
Simply replacing Extentions with the correct Extensions.
2013-12-12 23:02:54 -08:00
Carl Worth
66d9cbfe6d docs: Import 9.2.5 release notes, add news item. 2013-12-12 22:58:40 -08:00
Carl Worth
79c60999dc docs: Import 10.0.1 release notes, add news item. 2013-12-12 22:21:08 -08:00
Dave Airlie
ba00f2f6f5 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
2013-12-13 14:37:01 +10:00
Brian Paul
40070e72d4 util: fix compile breakage
D'oh!
2013-12-12 11:11:32 -07:00
Brian Paul
ba67d72c64 util: move variable declaration out of for-loop
To fix MSVC build.
2013-12-12 11:09:02 -07:00
Marek Olšák
be909274aa gallium/util: implement new color clear API in u_blitter 2013-12-12 18:48:04 +01:00
Marek Olšák
f09de87735 st/mesa: set correct PIPE_CLEAR_COLORn flags
This also fixes the clear_with_quad function for glClearBuffer.
2013-12-12 18:48:04 +01:00
Marek Olšák
164dc6216a 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.
2013-12-12 18:48:04 +01:00
Marek Olšák
0612005aa6 st/mesa: fix glClear with multiple colorbuffers and different formats
Cc: 10.0 9.2 9.1 <mesa-stable@lists.freedesktop.org>
2013-12-12 18:48:04 +01:00
Marek Olšák
03d848ea10 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>
2013-12-12 18:48:04 +01:00
Marek Olšák
0ad57bef96 docs/GL3: better documentation of GL 3.0 2013-12-12 18:48:04 +01:00
Marek Olšák
e4ef639a57 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>
2013-12-12 18:48:04 +01:00
Marek Olšák
7fa8fb7382 radeonsi: fix binding the dummy pixel shader
This fixes valgrind errors in glxinfo.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2013-12-12 18:48:04 +01:00
Marek Olšák
0eb528abf2 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>
2013-12-12 18:48:04 +01:00
Marek Olšák
cd86f773a7 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>
2013-12-12 18:48:04 +01:00
Marek Olšák
e9fc552837 radeonsi: remove unused variable in si_pipe_shader_ps
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2013-12-12 18:48:04 +01:00
Andreas Hartmetz
8ee7370c9b radeonsi: Write htile state to hardware. 2013-12-12 18:34:11 +01:00
Andreas Hartmetz
a32aa2617d radeon: Allocate htile buffer for SI in r600_texture. 2013-12-12 18:34:11 +01:00
Andreas Hartmetz
ca5812b45c radeon: rearrange r600_texture and related code a bit.
This should make the differences and similarities between color and
depth buffer handling more clear.
2013-12-12 18:34:11 +01:00
Marek Olšák
91aca8c662 r600g,radeonsi: consolidate buffer code, add handling of DISCARD_RANGE for SI
This adds 2 optimizations for radeonsi:
- handling of DISCARD_RANGE
- mapping an uninitialized buffer range is automatically UNSYNCHRONIZED

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2013-12-12 18:34:11 +01:00
Marek Olšák
12806449fa r600g,radeonsi: add common interface for buffer invalidation
This will be used by common code in the next commit.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2013-12-12 18:34:11 +01:00
Marek Olšák
e1374d86fe r600g,radeonsi: consolidate some debug flags
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2013-12-12 18:34:11 +01:00
Marek Olšák
43ea10eb1d r600g: refactor out code for buffer invalidation
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2013-12-12 18:34:11 +01:00
Marek Olšák
bba39d8804 r600g,radeonsi: share flags has_cp_dma and has_streamout
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2013-12-12 18:34:11 +01:00
Marek Olšák
32fd445daa radeonsi: handle PIPE_TRANSFER_DISCARD_WHOLE_RESOURCE
which can come from glBufferData and glMapBufferRange.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2013-12-12 18:34:11 +01:00
Marek Olšák
cc2c100274 radeonsi: implement accelerated buffer copying
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2013-12-12 18:34:11 +01:00
Marek Olšák
171e4842ec r600g: use common interfaces in buffer_transfer_unmap
i.e. dma_copy and resource_copy_region.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2013-12-12 18:34:11 +01:00
Marek Olšák
0aea43db93 radeon: move some functions to r600_buffer_common.c
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Christoph Brill <egore911@gmail.com>

v2: Renamed r600_buffer.c to r600_buffer_common.c. The stupid build system
    doesn't allow 2 files of the same name in different directories.
2013-12-12 18:34:05 +01:00
Marek Olšák
0b37737cc3 winsys/radeon: set/get the scanout flag with the tiling ioctls
If we assume that all buffers allocated by the DDX are scanout, a new flag
that says "this is not scanout" has to be added to support the non-scanout
buffers and maintain backward compatibility.

This fixes bad rendering on Wayland.

The flag is defined as:
  #define RADEON_TILING_R600_NO_SCANOUT   RADEON_TILING_SWAP_16BIT

AFAIK, RADEON_TILING_SWAP_16BIT is not used on SI.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2013-12-12 17:26:41 +01:00
Tapani Pälli
a6345f1559 glsl: modify ir_clone to use memcpy
Patch copies the whole data structure at once instead of
assigning individual variables.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-12-12 17:28:13 +02:00
Tapani Pälli
447bb9029f glsl: move variables in to ir_variable::data, part II
This patch moves following bitfields and variables to the data
structure:

explicit_location, explicit_index, explicit_binding, has_initializer,
is_unmatched_generic_inout, location_frac, from_named_ifc_block_nonarray,
from_named_ifc_block_array, depth_layout, location, index, binding,
max_array_access, atomic

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-12-12 17:28:11 +02:00
Tapani Pälli
33ee2c67c0 glsl: move variables in to ir_variable::data, part I
This patch moves following bitfields in to the data structure:

used, assigned, how_declared, mode, interpolation,
origin_upper_left, pixel_center_integer

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-12-12 17:28:08 +02:00
Tapani Pälli
c1d3080ee8 glsl: introduce data section to ir_variable
Data section helps serialization and cloning of a ir_variable. This
patch includes the helper bits used for read only ir_variables.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-12-12 17:28:06 +02:00
Tapani Pälli
cbe7431cdb mesa: fix a typo in glDetachShader error message
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-12-12 07:50:06 +02:00
Brian Paul
ccd6bf8272 svga: expose HW smooth/stipple/wide lines
Newer virtual HW versions support smooth/stipple/wide lines.
Use that instead of 'draw' fallbacks when possible.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2013-12-11 17:19:44 -08:00
Juha-Pekka Heikkila
84b1716b5e glx: Add missing null check in DRI2WireToEvent
Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-12-11 18:18:43 -07:00
Matthew McClure
e84a1ab3c4 llvmpipe: add plumbing for ARB_depth_clamp
With this patch llvmpipe will adhere to the ARB_depth_clamp enabled state when
clamping the fragment's zw value. To support this, the variant key now includes
the depth_clamp state. key->depth_clamp is derived from pipe_rasterizer_state's
(depth_clip == 0), thus depth clamp is only enabled when depth clip is disabled.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2013-12-11 18:24:21 +00:00
Vadim Girlin
00faf82832 r600g/sb: fix stack size computation on evergreen
On evergreen we have to reserve 1 stack element in some additional cases
besides the ones mentioned in the docs, but stack size computation was
recently reimplemented exactly as described in the docs by the patch that
added workarounds for stack issues on EG/CM, resulting in regressions
with some apps (Serious Sam 3).

This patch fixes it by restoring previous behavior.

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

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Cc: "10.0" <mesa-stable@lists.freedesktop.org>
Tested-by: Andre Heider <a.heider@gmail.com>
2013-12-11 04:08:32 +04:00
Zack Rusin
7a50d38a2b llvmpipe: add a very useful (disabled) debugging output
Disabled by default, but it's very useful when needed.

Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2013-12-10 16:41:11 -05:00
Zack Rusin
48b07fb4fc draw: fix vbuf caching of vertices with inject front face
Caching in the vbuf module meant that once a vertex has been
emitted it was cached, but it's possible for a vertex at the
same location to be emitted again, but this time with a different
front-face semantic. Caching was causing the first version of the
vertex to be emitted, which resulted in the renderer getting
incorrect front-face attributes. By reseting the vertex_id (which
is used for caching) we make sure that once a front-face info
has been injected the vertex will endup getting emitted.

Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2013-12-10 16:40:54 -05:00
Zack Rusin
155139059b llvmpipe: fix blending with half-float formats
The fact that we flush denorms to zero breaks our half-float
conversion and blending. This patches enables denorms for
blending. It's a little tricky due to the llvm bug that makes
it incorrectly reorder the mxcsr intrinsics:
http://llvm.org/bugs/show_bug.cgi?id=6393

Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Signed-off-by: Zack Rusin <zackr@vmware.com>
2013-12-10 16:39:48 -05:00
Thomas Hellstrom
1e71493afa svga/winsys: Implement surface sharing using prime fd handles
This needs a prime-aware vmwgfx kernel module to work properly.

(With additions by Christopher James Halse Rogers <raof@ubuntu.com>)

Signed-off-by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
2013-12-10 09:46:51 +01:00
Christopher James Halse Rogers
db687011e0 gallium/radeon: Implement hooks for DRI Image 7 (v2)
v2: Fix transliteration of lseek arguments
    Ignore busy return from RADEON_GEM_BUSY ioctl; we're only after the domain

Signed-off-by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
2013-12-10 09:46:45 +01:00
Christopher James Halse Rogers
bff6c5d2b5 radeon: Rename bo_handles hashtable to match its actual contents.
It's a map of GEM name->bo, so identify it as such

Signed-off-by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
2013-12-10 09:46:41 +01:00
Christopher James Halse Rogers
7d2c1df99e ilo: Support DRI Image 7
Signed-off-by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
2013-12-10 09:46:29 +01:00
Maarten Lankhorst
3e680de1eb nouveau: Support DRI Image 7 extension
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
2013-12-10 09:46:17 +01:00
Christopher James Halse Rogers
df3b20b2cf gallium/dri: Support DRI Image extension version 7
v2: Fix up queryImage return for ATTRIB_FD
    Use driver_descriptor.configuration to determine whether the driver
    supports DMA-BUF import/export.
v3: Really, truly, fix up queryImage return for ATTRIB_FD

Signed-off-by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
2013-12-10 09:46:13 +01:00
Christopher James Halse Rogers
6b5e15360a gallium/dri2: Set winsys_handle type to KMS for stride query.
Otherwise the default is TYPE_SHARED, which will flink the bo. This seems
rather unnecessary for a simple stride query.

Signed-off-by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
2013-12-10 09:46:09 +01:00
Christopher James Halse Rogers
d5a3a2d2fb gallium/winsys/drm: Prepare for passing prime fds in winsys_handle
Signed-off-by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
2013-12-10 09:46:05 +01:00
Christopher James Halse Rogers
343133167f gallium/dri: Support DRI Image extension version 6
v2: Pick out the correct gl_context pointer
v3: Don't leak pipe_resources on error path
    Set img->dri_format correctly

Signed-off-by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
2013-12-10 09:45:59 +01:00
Ilia Mirkin
bad8871e52 nv50: report 15 max inputs for fragment programs
First off, nv50_program only has 16 in/out varyings. However reporting
16 makes 'm' become 68 in nv50_fp_linkage_validate with the
varying-packing-simple piglit test. (Subverting the assert makes it
compile but fail.) With this patch, varying-packing-simple passes.

See: https://bugs.freedesktop.org/show_bug.cgi?id=69155

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "9.2 10.0" <mesa-stable@lists.freedesktop.org>
2013-12-10 08:45:59 +01:00
Maarten Lankhorst
5576ad11ed nouveau: Fix compiler warning regression
cfg is now unused, remove it.

Cc: "10.0" <mesa-stable@lists.freedesktop.org>
2013-12-10 08:43:41 +01:00
Dave Airlie
0b16042377 swrast: fix readback regression since inversion fix
This readback from the frontbuffer with swrast was broken, that bug
just made it more obviously broken, this fixes it by inverting the
sub image gets. Also fixes a few other piglits.

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=72327
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=72325

(for 9.2 the patches this depends on were asked to be backported separately
 in an email).
Cc: "9.2" "10.0" mesa-stable@lists.fedoraproject.org
Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2013-12-10 13:33:40 +10:00
Jordan Justen
4859d492b2 dri megadriver_stub: add compatibility for older DRI loaders
To help the transition period when DRI loaders are being updated
to support the newer __driDriverExtensions_foo mechanism,
we populate __driDriverExtensions with the extensions returned
by __driDriverExtensions_foo during a library contructor
function.

We find the driver foo's name by using the dladdr function
which gives the path of the dynamic library's name that
was being loaded.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Keith Packard <keithp@keithp.com>
Cc: "10.0" <mesa-stable@lists.freedesktop.org>
2013-12-09 16:33:45 -08:00
Kristian Høgsberg
4ed055b4a6 egl/wayland: Return -1 from get_back_bo to indicate error
A return value of -1 indicate failure to allocate the back buffer and
means we don't segfault on the way out.
2013-12-09 16:14:33 -08:00
Neil Roberts
0b7058c46a egl_dri2: Remove the unused swap_interval member of dri2_egl_surface
The _EGLSurface struct which is embedded into dri2_egl_surface also contains a
swap interval member so the other member is redundant. Nothing was using it as
far as I can tell.
2013-12-09 16:14:32 -08:00
Kenneth Graunke
19190c2b8c i965: Replace OUT_RELOC_FENCED with OUT_RELOC.
On Gen4+, OUT_RELOC_FENCED is equivalent to OUT_RELOC; libdrm silently
ignores the fenced flag:

        /* We never use HW fences for rendering on 965+ */
        if (bufmgr_gem->gen >= 4)
                need_fence = false;

Thanks to Eric for noticing this.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-12-09 13:52:18 -08:00
Paul Berry
088494aa03 glsl/loops: Get rid of lower_bounded_loops and ir_loop::normative_bound.
Now that loop_controls no longer creates normatively bound loops,
there is no need for ir_loop::normative_bound or the
lower_bounded_loops pass.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-12-09 10:55:09 -08:00
Paul Berry
7ea3baa64d glsl/loops: Stop creating normatively bound loops in loop_controls.
Previously, when loop_controls analyzed a loop and found that it had a
fixed bound (known at compile time), it would remove all of the loop
terminators and instead set the loop's normative_bound field to force
the loop to execute the correct number of times.

This made loop unrolling easy, but it had a serious disadvantage.
Since most GPU's don't have a native mechanism for executing a loop a
fixed number of times, in order to implement the normative bound, the
back-ends would have to synthesize a new loop induction variable.  As
a result, many loops wound up having two induction variables instead
of one.  This caused extra register pressure and unnecessary
instructions.

This patch modifies loop_controls so that it doesn't set the loop's
normative_bound anymore.  Instead it leaves one of the terminators in
the loop (the limiting terminator), so the back-end doesn't have to go
to any extra work to ensure the loop terminates at the right time.

This complicates loop unrolling slightly: when deciding whether a loop
can be unrolled, we have to account for the presence of the limiting
terminator.  And when we do unroll the loop, we have to remove the
limiting terminator first.

For an example of how this results in more efficient back end code,
consider the loop:

    for (int i = 0; i < 100; i++) {
      total += i;
    }

Previous to this patch, on i965, this loop would compile down to this
(vec4) native code:

          mov(8)       g4<1>.xD 0D
          mov(8)       g8<1>.xD 0D
    loop:
          cmp.ge.f0(8) null     g8<4;4,1>.xD 100D
    (+f0) if(8)
          break(8)
          endif(8)
          add(8)       g5<1>.xD g5<4;4,1>.xD g4<4;4,1>.xD
          add(8)       g8<1>.xD g8<4;4,1>.xD 1D
          add(8)       g4<1>.xD g4<4;4,1>.xD 1D
          while(8) loop

(notice that both g8 and g4 are loop induction variables; one is used
to terminate the loop, and the other is used to accumulate the total).

After this patch, the same loop compiles to:

          mov(8)       g4<1>.xD 0D
    loop:
          cmp.ge.f0(8) null     g4<4;4,1>.xD 100D
    (+f0) if(8)
          break(8)
          endif(8)
          add(8)       g5<1>.xD g5<4;4,1>.xD g4<4;4,1>.xD
          add(8)       g4<1>.xD g4<4;4,1>.xD 1D
          while(8) loop

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-12-09 10:55:06 -08:00
Paul Berry
4d844cfa56 glsl/loops: Get rid of loop_variable_state::max_iterations.
This value is now redundant with
loop_variable_state::limiting_terminator->iterations and
ir_loop::normative_bound.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-12-09 10:55:03 -08:00
Paul Berry
e734c9f677 glsl/loops: Simplify loop unrolling logic by breaking into functions.
The old logic of loop_unroll_visitor::visit_leave(ir_loop *) was:

    heuristics to skip unrolling in various circumstances;
    if (loop contains more than one jump)
      return;
    else if (loop contains one jump) {
      if (the jump is an unconditional "break" at the end of the loop) {
        remove the break and set iteration count to 1;
        fall through to simple loop unrolling code;
      } else {
        for (each "if" statement in the loop body)
          see if the jump is a "break" at the end of one of its forks;
        if (the "break" wasn't found)
          return;
        splice the remainder of the loop into the other fork of the "if";
        remove the "break";
        complex loop unrolling code;
        return;
      }
    }
    simple loop unrolling code;
    return;

These tasks have been moved to their own functions:
- splice the remainder of the loop into the other fork of the "if"
- simple loop unrolling code
- complex loop unrolling code

And the logic has been flattened to:

    heuristics to skip unrolling in various circumstances;
    if (loop contains more than one jump)
      return;
    if (loop contains no jumps) {
      simple loop unroll;
      return;
    }
    if (the jump is an unconditional "break" at the end of the loop) {
      remove the break;
      simple loop unroll with iteration count of 1;
      return;
    }
    for (each "if" statement in the loop body) {
      if (the jump is a "break" at the end of one of its forks) {
        splice the remainder of the loop into the other fork of the "if";
        remove the "break";
        complex loop unroll;
        return;
      }
    }

This will make it easier to modify the loop unrolling algorithm in a
future patch.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-12-09 10:54:59 -08:00
Paul Berry
ffc29120c4 glsl/loops: Move some analysis from loop_controls to loop_analysis.
Previously, the sole responsibility of loop_analysis was to find all
the variables referenced in the loop that are either loop constant or
induction variables, and find all of the simple if statements that
might terminate the loop.  The remainder of the analysis necessary to
determine how many times a loop executed was performed by
loop_controls.

This patch makes loop_analysis also responsible for determining the
number of iterations after which each loop terminator will terminate
the loop, and for figuring out which terminator will terminate the
loop first (I'm calling this the "limiting terminator").

This will allow loop unrolling to make use of information that was
previously only visible from loop_controls, namely the identity of the
limiting terminator.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-12-09 10:54:56 -08:00
Paul Berry
4bbf6d1d2b glsl/loops: Allocate loop_terminator using new(mem_ctx) syntax.
Patches to follow will introduce code into the loop_terminator
constructor.  Allocating loop_terminator using new(mem_ctx) syntax
will ensure that the constructor runs.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-12-09 10:54:53 -08:00
Paul Berry
714e1b331e glsl/loops: Remove unnecessary list walk from loop_control_visitor.
When loop_control_visitor::visit_leave(ir_loop *) is analyzing a loop
terminator that acts on a certain ir_variable, it doesn't need to walk
the list of induction variables to find the loop_variable entry
corresponding to the variable.  It can just look it up in the
loop_variable_state hashtable and verify that the loop_variable entry
represents an induction variable.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-12-09 10:54:49 -08:00
Paul Berry
115fd75ab0 glsl/loops: Remove unused fields iv_scale and biv from loop_variable class.
These fields were part of some planned optimizations that never
materialized.  Remove them for now to simplify things; if we ever get
round to adding the optimizations that would require them, we can
always re-introduce them.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-12-09 10:54:46 -08:00
Paul Berry
e00b93a1f7 glsl/loops: replace loop controls with a normative bound.
This patch replaces the ir_loop fields "from", "to", "increment",
"counter", and "cmp" with a single integer ("normative_bound") that
serves the same purpose.

I've used the name "normative_bound" to emphasize the fact that the
back-end is required to emit code to prevent the loop from running
more than normative_bound times.  (By contrast, an "informative" bound
would be a bound that is informational only).

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-12-09 10:54:33 -08:00
Paul Berry
2c17f97fe6 glsl/loops: consolidate bounded loop handling into a lowering pass.
Previously, all of the back-ends (ir_to_mesa, st_glsl_to_tgsi, and the
i965 fs and vec4 visitors) had nearly identical logic for handling
bounded loops.  This replaces the duplicate logic with an equivalent
lowering pass that is used by all the back-ends.

Note: on i965, there is a slight increase in instruction count.  For
example, a loop like this:

    for (int i = 0; i < 100; i++) {
      total += i;
    }

would previously compile down to this (vec4) native code:

          mov(8)       g4<1>.xD 0D
          mov(8)       g8<1>.xD 0D
    loop:
          cmp.ge.f0(8) null     g8<4;4,1>.xD 100D
    (+f0) break(8)
          add(8)       g5<1>.xD g5<4;4,1>.xD g4<4;4,1>.xD
          add(8)       g8<1>.xD g8<4;4,1>.xD 1D
          add(8)       g4<1>.xD g4<4;4,1>.xD 1D
          while(8) loop

After this patch, the "(+f0) break(8)" turns into:

    (+f0) if(8)
          break(8)
          endif(8)

because the back-end isn't smart enough to recognize that "if
(condition) break;" can be done using a conditional break instruction.
However, it should be relatively easy for a future peephole
optimization to properly optimize this.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-12-09 10:54:26 -08:00
Paul Berry
97d8b77054 glsl: In loop analysis, handle unconditional second assignment.
Previously, loop analysis would set
this->conditional_or_nested_assignment based on the most recently
visited assignment to the variable.  As a result, if a vaiable was
assigned to more than once in a loop, the flag might be set
incorrectly.  For example, in a loop like this:

    int x;
    for (int i = 0; i < 3; i++) {
      if (i == 0)
        x = 10;
      ...
      x = 20;
      ...
    }

loop analysis would have incorrectly concluded that all assignments to
x were unconditional.

In practice this was a benign bug, because
conditional_or_nested_assignment is only used to disqualify variables
from being considered as loop induction variables or loop constant
variables, and having multiple assignments also disqualifies a
variable from being considered as either of those things.

Still, we should get the analysis correct to avoid future confusion.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-12-09 10:54:23 -08:00
Paul Berry
cb38a0dc0a glsl: Fix handling of function calls inside nested loops.
Previously, when visiting an ir_call, loop analysis would only mark
the innermost enclosing loop as containing a call.  As a result, when
encountering a loop like this:

    for (i = 0; i < 3; i++) {
      for (int j = 0; j < 3; j++) {
        foo();
      }
    }

it would incorrectly conclude that the outer loop ran three times.
(This is not certain; if foo() modifies i, then the outer loop might
run more or fewer times).

Fixes piglit test "vs-call-in-nested-loop.shader_test".

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-12-09 10:54:20 -08:00
Paul Berry
877db5a792 glsl: Fix loop analysis of nested loops.
Previously, when visiting a variable dereference, loop analysis would
only consider its effect on the innermost enclosing loop.  As a
result, when encountering a loop like this:

    for (int i = 0; i < 3; i++) {
      for (int j = 0; j < 3; j++) {
        ...
        i = 2;
      }
    }

it would incorrectly conclude that the outer loop ran three times.

Fixes piglit test "vs-inner-loop-modifies-outer-loop-var.shader_test".

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-12-09 10:54:16 -08:00
Paul Berry
2e060551bd glsl: Extract functions from loop_analysis::visit(ir_dereference_variable *).
This function is about to get more complex.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-12-09 10:54:13 -08:00
Paul Berry
69c44d65c8 i965/gen7+: Implement fast color clears for MSAA buffers.
Fast color clears of MSAA buffers work just like fast color clears
with non-MSAA buffers, except that the alignment and scaledown
requirements are different.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2013-12-09 10:54:10 -08:00
Paul Berry
0ac622accf i965/blorp: Refactor code for computing fast clear align/scaledown factors.
This will make it easier to add fast color clear support to MSAA
buffers, since they have different alignment and scaling requirements.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-12-09 10:54:07 -08:00
Paul Berry
da08ee8e3b i965/blorp: allow multisample blorp clears
Previously, we didn't do multisample blorp clears because we couldn't
figure out how to get them to work.  The reason for this was because
we weren't setting the brw_blorp_params num_samples field consistently
with dst.num_samples.  Now that those two fields have been collapsed
down into one, we can do multisample blorp clears.

However, we need to do a few other pieces of bookkeeping to make them
work correctly in all circumstances:

- Since blorp clears may now operate on multisampled window system
  framebuffers, they need to call
  intel_renderbuffer_set_needs_downsample() to ensure that a
  downsample happens before buffer swap (or glReadPixels()).

- When clearing a layered multisample buffer attachment using UMS or
  CMS layout, we need to advance layer by multiples of num_samples
  (since each logical layer is associated with num_samples physical
  layers).

Note: we still don't do multisample fast color clears; more work needs
to be done to enable those.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-12-09 10:54:03 -08:00
Paul Berry
73e8bd9f5c i965/blorp: Get rid of redundant num_samples blorp param.
Previously, brw_blorp_params contained two fields for determining
sample count: num_samples (which determined the multisample
configuration of the rendering pipeline) and dst.num_samples (which
determined the multisample configuration of the render target
surface).  This was redundant, since both fields had to be set to the
same value to avoid rendering errors.

This patch eliminates num_samples to avoid future confusion.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-12-09 10:54:00 -08:00
Paul Berry
25195b0041 i965/gen7+: Disentangle MSAA layout from fast clear state.
This patch renames the enum that's used to keep track of fast clear
state from "mcs_state" to "fast_clear_state", and it removes the enum
value INTEL_MCS_STATE_MSAA (which previously meant, "this is an MSAA
buffer, so we're not keeping track of fast clear state").  The only
real purpose that enum value was serving was to prevent us from trying
to do fast clear resolves on MSAA buffers, and it's just as easy to
prevent that by checking the buffer's msaa_layout.

This paves the way for implementing fast clears of MSAA buffers.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-12-09 10:51:10 -08:00
Paul Berry
f416a15096 i965: Don't try to use HW blitter for glCopyPixels() when multisampled.
The hardware blitter doesn't understand multisampled layouts, so
there's no way this could possibly succeed.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-12-09 10:51:07 -08:00
Paul Berry
b5fe413b4d i965: Document conventions for counting layers in 2D multisample buffers.
The "layer" parameters used in blorp, and the
intel_renderbuffer::mt_layer field, represent a physical layer rather
than a logical layer.  This is important for 2D multisample arrays on
Gen7+ because the UMS and CMS multisample layouts use N physical
layers to represent each logical layer, where N is the number of
samples.

Also add an assertion to blorp to help catch bugs if we fail to follow
these conventions.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-12-09 10:51:03 -08:00
Paul Berry
3a2925bfa9 i965/blorp: Improve fast color clear comment.
Clarify the fact that we only optimize full buffer clears using fast
color clear, and why.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-12-09 10:51:00 -08:00
Tom Stellard
9a5ce0c4c9 r300/compiler/tests: Fix line length check in test parser
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>

CC: "9.2" "10.0" <mesa-stable@lists.freedesktop.org>
2013-12-09 09:40:15 -05:00
Tom Stellard
1896431f79 r300/compiler/tests: Fix segfault
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>

CC: "9.2" "10.0" <mesa-stable@lists.freedesktop.org>
2013-12-09 09:40:15 -05:00
Ilia Mirkin
2cd2b9705e nouveau/video: update a few more h264 picparm field names
Based on comments by Benjamin Morris <bmorris@nvidia.com> in
http://lists.freedesktop.org/archives/nouveau/2013-December/015328.html

This adds setting of is_long_term, and updates a few field names we were
unclear about.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.0" <mesa-stable@lists.freedesktop.org>
2013-12-09 15:11:50 +01:00
Ilia Mirkin
78525dae8a nouveau/video: update h264 picparm field names based on usage
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.0" <mesa-stable@lists.freedesktop.org>
2013-12-09 15:11:42 +01:00
Ilia Mirkin
e01ba9d6b0 nv50: enable h264 and mpeg4 for nv98+ (vp3, vp4.0)
Create the ref_bo without any storage type flags set for now. The issue
probably arises from our use of the additional buffer space at the end
of the ref_bo. It should probably be split up in the future.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Tested-by: Martin Peres <martin.peres@labri.fr>
Cc: "10.0" <mesa-stable@lists.freedesktop.org>
2013-12-09 15:11:20 +01:00
Ilia Mirkin
e796fa22d4 nvc0: make sure nvd7 gets NVC8_3D_CLASS as well
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2013-12-09 15:10:37 +01:00
Ilia Mirkin
1386cb9488 nv50: TXF already has integer arguments, don't try to convert from f32
Fixes the texelFetch piglit tests

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2013-12-09 15:10:37 +01:00
Matthew McClure
0319ea9ff6 llvmpipe: clamp fragment shader depth write to the current viewport depth range.
With this patch, generate_fs_loop will clamp any fragment shader depth writes
to the viewport's min and max depth values. Viewport selection is determined
by the geometry shader output for the viewport array index. If no index is
specified, then the default viewport index is zero. Semantics for this path
can be found in draw_clamp_viewport_idx and lp_clamp_viewport_idx.

lp_jit_viewport was created to store viewport information visible to JIT code,
and is validated when the LP_NEW_VIEWPORT dirty flag is set.

lp_rast_shader_inputs is responsible for passing the viewport_index through
the rasterizer stage to fragment stage (via lp_jit_thread_data).

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2013-12-09 12:57:02 +00:00
Neil Roberts
992a2dbba8 wayland: Add support for eglSwapInterval
The Wayland EGL platform now respects the eglSwapInterval value. The value is
clamped to either 0 or 1 because it is difficult (and probably not useful) to
sync to more than 1 redraw.

The main change is that if the swap interval is 0 then Mesa won't install a
frame callback so that eglSwapBuffers can be executed as often as necessary.
Instead it will do a sync request after the swap buffers. It will block for
sync complete event in get_back_bo instead of the frame callback. The
compositor is likely to send a release event while processing the new buffer
attach and this makes sure we will receive that before deciding whether to
allocate a new buffer.

If there are no buffers available then instead of returning with an error,
get_back_bo will now poll the compositor by repeatedly sending sync requests
every 10ms. This is a last resort and in theory this shouldn't happen because
there should be no reason for the compositor to hold on to more than three
buffers. That means whenever we attach the fourth buffer we should always get
an immediate release event which should come in with the notification for the
first sync request that we are throttled to.

When the compositor is directly scanning out from the application's buffer it
may end up holding on to three buffers. These are the one that is is currently
scanning out from, one that has been given to DRM as the next buffer to flip
to, and one that has been attached and will be given to DRM as soon as the
previous flip completes. When we attach a fourth buffer to the compositor it
should replace that third buffer so we should get a release event immediately
after that. This patch therefore also changes the number of buffer slots to 4
so that we can accomodate that situation.

If DRM eventually gets a way to cancel a pending page flip then the compositors
can be changed to only need to hold on to two buffers and this value can be
put back to 3.

This also moves the vblank configuration defines from platform_x11.c to the
common egl_dri2.h header so they can be shared by both platforms.
2013-12-07 22:36:02 -08:00
Neil Roberts
25cc889004 wayland: Block for the frame callback in get_back_bo not dri2_swap_buffers
Consider a typical game-style main loop which might be like this:

while (1) {
	draw_something();
	eglSwapBuffers();
}

In this case the game is relying on eglSwapBuffers to throttle to a sensible
frame rate. Previously this game would end up using three buffers even though
it should only need two. This is because Mesa decides whether to allocate a
new buffer in get_back_bo which would be before it has tried to read any
events from the compositor so it wouldn't have seen any buffer release events
yet.

This patch just moves the block for the frame callback to get_back_bo.
Typically the compositor will send a release event immediately after one of
the attaches so if we block for the frame callback here then we can be sure to
have completed at least one roundtrip and received that release event after
attaching the previous buffer before deciding whether to allocate a new one.

dri2_swap_buffers always calls get_back_bo so even if the client doesn't
render anything we will still be sure to block to the frame callback. The code
to create the new frame callback has been moved to after this call so that we
can be sure to have cleared the previous frame callback before requesting a
new one.
2013-12-07 22:36:02 -08:00
Vinson Lee
965cde9232 glapi: Do not include dlfcn.h on Windows.
This patch fixes this MinGW build error.

  CC     glapi_gentable.lo
glapi_gentable.c:47:19: fatal error: dlfcn.h: No such file or directory

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-12-07 14:31:01 -08:00
Vincent Lejeune
797894036d r600/llvm: Allow arbitrary amount of temps in tgsi to llvm 2013-12-07 18:39:10 +01:00
Rob Clark
a1d808638d freedreno/a3xx: add adreno 330 support
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2013-12-07 09:37:24 -05:00
Rob Clark
d36ae204d5 freedreno/a3xx/compiler: add ROUND
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2013-12-07 08:45:27 -05:00
Chris Forbes
88dc246630 mesa: Require per-sample shading if the sample qualifier is used.
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2013-12-07 17:15:05 +13:00
Chris Forbes
2625a34bfc glsl: Populate gl_fragment_program::IsSample bitfield
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2013-12-07 17:15:03 +13:00
Chris Forbes
6429cc05ca mesa: add IsSample bitfield to gl_fragment_program
Drivers will need to look at this to decide if they need to do
per-sample fragment shader dispatch.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2013-12-07 17:15:01 +13:00
Chris Forbes
5d326fa963 glsl: Put sample-qualified varyings in their own packing classes
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2013-12-07 17:14:59 +13:00
Chris Forbes
51c5fc85e1 glsl: Add ir support for sample qualifier; adjust compiler and linker
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2013-12-07 17:14:58 +13:00
Chris Forbes
51aa15aca2 glsl: Add frontend support for sample auxiliary storage qualifier
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2013-12-07 17:14:39 +13:00
Chris Forbes
a1ca580240 i965: Don't flag gather quirks for Gen8+
My understanding is that Broadwell retains the same SCS mechanism
that Haswell has, so even if the underlying issue with this format
is not fixed, the w/a will be applied in SCS rather than needing
shader code.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Cc: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-12-07 16:17:27 +13:00
Chris Forbes
83b83fb984 i965/Gen7: Allow CMS layout for multisample textures
Now that all the pieces are in place, this should provide
a nice performance boost for apps using multisample textures.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-12-07 16:10:04 +13:00
Chris Forbes
3122c2421a i965/vs: Sample from MCS surface when required
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-12-07 16:10:02 +13:00
Chris Forbes
7810162053 i965/fs: Sample from MCS surface when required
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-12-07 16:09:49 +13:00
Chris Forbes
7629c489c8 i965: Add shader opcode for sampling MCS surface
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-12-07 16:09:32 +13:00
Chris Forbes
27359b8079 i965/Gen7: Include bitfield in the sampler key for CMS layout
We need to emit extra shader code in this case to sample the
MCS surface first; we can't just blindly do this all the time
since IVB will sometimes try to access the MCS surface even if
disabled.

V3: Use actual MSAA layout from the texture's mt, rather
then computing what would have been used based on the format.
This is simpler and less fragile - there's at least one case where
we might want to have a texture's MSAA layout change based on what
the app does (CMS SINT falling back to UMS if the app ever attempts
to render to it with a channel disabled.)

This also obsoletes V2's 1/10 -- compute_msaa_layout can now remain
an implementation detail of the miptree code.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-12-07 16:09:12 +13:00
Chris Forbes
b1604841c2 i965/Gen7: Move decision to allocate MCS surface into intel_mipmap_create
This gives us correct behavior for both renderbuffers (which previously
worked) and multisample textures (which would never get an MCS surface
allocated, even if CMS layout was selected)

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-12-07 16:08:55 +13:00
Chris Forbes
6ca9a6f4d7 i965/Gen7: emit mcs info for multisample textures
Previously this was only done for render targets.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-12-07 16:08:52 +13:00
Chris Forbes
dfa952da97 i965/wm: Set copy of sample mask in 3DSTATE_PS correctly for Haswell
The bspec says:

"SW must program the sample mask value in this field so that it matches
with 3DSTATE_SAMPLE_MASK"

I haven't observed this to actually fix anything, but stumbled across it
while adding the rest of the support for CMS layout for multisample
   textures.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-12-07 16:08:47 +13:00
Chris Forbes
8064b0f2c4 i965: refactor sample mask calculation
Haswell needs a copy of the sample mask in 3DSTATE_PS; this makes that
convenient.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-12-07 16:07:53 +13:00
Ian Romanick
758658850b glsl: Don't emit empty declaration warning for a struct specifier
The intention is that things like

   int;

will generate a warning.  However, we were also accidentally emitting
the same warning for things like

  struct Foo { int x; };

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=68838
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: Aras Pranckevicius <aras@unity3d.com>
Cc: "9.2 10.0" <mesa-stable@lists.freedesktop.org>
2013-12-06 08:06:54 -08:00
Thomas Hellstrom
453651e521 st/xa: Bump major version number to 2
For some reason this was left out when the version was changed...

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2013-12-06 06:18:03 -08:00
Ben Skeggs
92ceb327ba nvc0: fixup gk110 and up not being listed in various switch statements
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2013-12-06 11:28:45 +10:00
Kenneth Graunke
26f3ff8a91 i965: Replace non-standard INLINE macro with "inline".
These are identical: main/compiler.h defines INLINE to "inline".

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2013-12-05 13:59:18 -08:00
Kenneth Graunke
11d9af7c0a i965: Don't use GL types in files shared with intel-gpu-tools.
sed -i -e 's/GLuint/unsigned/g' -e 's/GLint/int/g' \
       -e 's/GLfloat/float/g' -e 's/GLubyte/uint8_t/g' \
       -e 's/GLshort/int16_t/g' \
       brw_eu* brw_disasm.c brw_structs.h

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2013-12-05 13:59:18 -08:00
Kenneth Graunke
a7bdd4cba8 i965: Drop trailing whitespace from the rest of the driver.
Performed via:
$ for file in *; do sed -i 's/  *//g'; done

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2013-12-05 13:59:18 -08:00
Kenneth Graunke
d542c45c75 i965: Drop trailing whitespace from files shared with intel-gpu-tools.
Performed via s/  *$//g.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2013-12-05 13:59:18 -08:00
José Fonseca
3be333ed30 tools/trace: More tweaks to state dumping.
- Ignore buffer format (it is totally arbitrary)
- Initialize state.
- Handle begin/end_query statements.
2013-12-05 13:35:06 +00:00
José Fonseca
9648b76dc4 trace: Reorder dumping of pipe_rasterizer_state.
Such that it matches the pipe_rasterizer_state declaration, making it
easier to double-check that all state is being actually dumped.

Trivial.
2013-12-05 13:35:06 +00:00
José Fonseca
10450cbbe6 trace: Dump pipe_sampler_state::seamless_cube_map.
Trivial.
2013-12-05 13:35:06 +00:00
Michel Dänzer
7435d9f77c radeonsi: Remove some stale XXX / FIXME comments
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2013-12-05 13:50:07 +09:00
Matt Turner
cbb49cb2f7 i965: Emit better code for ir_unop_sign.
total instructions in shared programs: 1550449 -> 1550048 (-0.03%)
instructions in affected programs:     15207 -> 14806 (-2.64%)

Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2013-12-04 20:05:44 -08:00
Matt Turner
d30b2ed5f8 i965/fs: New peephole optimization to flatten IF/BREAK/ENDIF.
total instructions in shared programs: 1550713 -> 1550449 (-0.02%)
instructions in affected programs:     7931 -> 7667 (-3.33%)

Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-12-04 20:05:44 -08:00
Matt Turner
9658b04fc4 i965/fs: Emit a MOV instead of a SEL if the sources are the same.
One program affected.

instructions in affected programs:     436 -> 428 (-1.83%)

Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-12-04 20:05:44 -08:00
Matt Turner
4532cac06a i965/fs: Extend SEL peephole to handle only matching MOVs.
Before this patch, the following code would not be optimized even though
the first two instructions were common to the then and else blocks:

   (+f0) IF
   MOV dst0 ...
   MOV dst1 ...
   MOV dst2 ...
   ELSE
   MOV dst0 ...
   MOV dst1 ...
   MOV dst3 ...
   ENDIF

This commit extends the peephole to handle this case.

No shader-db changes.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-12-04 20:05:44 -08:00
Matt Turner
13de9f03f1 i965/fs: New peephole optimization to generate SEL.
fs_visitor::try_replace_with_sel optimizes only if statements whose
"then" and "else" bodies contain a single MOV instruction. It also
could not handle constant arguments, since they cause an extra MOV
immediate to be generated (since we haven't run constant propagation,
there are more than the single MOV).

This peephole fixes both of these and operates as a normal optimization
pass.

fs_visitor::try_replace_with_sel is still arguably necessary, since it
runs before pull constant loads are lowered.

total instructions in shared programs: 1559129 -> 1545833 (-0.85%)
instructions in affected programs:     167120 -> 153824 (-7.96%)
GAINED:                                13
LOST:                                  6

Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-12-04 20:05:44 -08:00
Matt Turner
fa227e7cbc i965/fs: Add SEL() convenience function.
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-12-04 20:05:43 -08:00
Matt Turner
4b0ef4bf38 glsl: Use fabs() on floating point values.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-12-04 20:05:43 -08:00
Matt Turner
8814806c97 i965: Print conditional mod in dump_instruction().
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-12-04 20:05:43 -08:00
Matt Turner
b9af66528e i965: Externalize conditional_modifier for use in dump_instruction().
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-12-04 20:05:43 -08:00
Matt Turner
637dda1c30 i965: Print argument types in dump_instruction().
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-12-04 20:05:43 -08:00
Matt Turner
21e92e74c8 i965: Externalize reg_encoding for use in dump_instruction().
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-12-04 20:05:43 -08:00
Matt Turner
729fe77e3b i965/vec4: Don't print swizzles for immediate values.
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-12-04 20:05:43 -08:00
Matt Turner
2b8e0a73fb i965/vec4: Print negate and absolute value for src args.
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-12-04 20:05:43 -08:00
Matt Turner
a85f1b7adf i965/vec4: Add support for printing HW_REGs in dump_instruction().
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-12-04 20:05:43 -08:00
Matt Turner
942151af30 i965/fs: Print ARF registers properly in dump_instruction().
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-12-04 20:05:43 -08:00
Matt Turner
0e4053234d i965: Don't print extra (null) arguments in dump_instruction().
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-12-04 20:05:42 -08:00
Matt Turner
d79e711718 glsl: Remove silly OR(..., 0x0) from ldexp() lowering.
I translated copysign(0.0f, x) a little too literally.

Reviewed-by: Eric Anholt <eric@anholt.net>
2013-12-04 20:05:42 -08:00
Matt Turner
b1eb2ad8d1 i965: Allow commuting the operands of ADDC for const propagation.
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-12-04 20:05:42 -08:00
Matt Turner
04d83396ee i965/fs: Rename register_coalesce_2() -> register_coalesce().
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-12-04 20:05:42 -08:00
Matt Turner
9a6b14f674 i965/fs: Remove now useless register_coalesce() pass.
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-12-04 20:05:42 -08:00
Matt Turner
1520ae48b8 i965/fs: Let register_coalesce_2() eliminate self-moves.
This is the last thing that register_coalesce() still handled.

total instructions in shared programs: 1561060 -> 1560908 (-0.01%)
instructions in affected programs:     15758 -> 15606 (-0.96%)

Reviewed-by: Eric Anholt <eric@anholt.net>
2013-12-04 20:05:42 -08:00
Matt Turner
8786f381ec i965: Allow constant propagation into ASR and BFI1.
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-12-04 20:05:42 -08:00
Matt Turner
ba84800275 i965/cfg: Document cur_* variables.
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-12-04 20:05:42 -08:00
Matt Turner
7642c3c6ff i965/cfg: Remove ip & cur from brw_cfg.
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-12-04 20:05:42 -08:00
Matt Turner
d2fcdd0973 i965/cfg: Clean up cfg_t constructors.
parent_mem_ctx was unused since db47074a, so remove the two wrappers
around create() and make create() the constructor.

Reviewed-by: Eric Anholt <eric@anholt.net>
2013-12-04 20:05:42 -08:00
Matt Turner
c6450fa963 i965/cfg: Throw out confusing make_list method.
make_list is just a one-line wrapper and was confusingly called by
NULL objects. E.g., cur_if == NULL; cur_if->make_list(mem_ctx).

Reviewed-by: Eric Anholt <eric@anholt.net>
2013-12-04 20:05:42 -08:00
Matt Turner
f3bce19f6c i965/cfg: Include only needed headers.
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-12-04 20:05:42 -08:00
Matt Turner
f4b50a1466 i965/cfg: Remove unnecessary endif_stack.
Unnecessary since last commit.

Reviewed-by: Eric Anholt <eric@anholt.net>
2013-12-04 20:05:41 -08:00
Matt Turner
2eb9bbfb68 i965/cfg: Rework to make IF & ELSE blocks flow into ENDIF.
Previously we made the basic block following an ENDIF instruction a
successor of the basic blocks ending with IF and ELSE. The PRM says that
IF and ELSE instructions jump *to* the ENDIF, rather than over it.

This should be immaterial to dataflow analysis, except for if, break,
endif sequences:

   START B1 <-B0 <-B9
0x00000100: cmp.g.f0(8)     null            g15<8,8,1>F     g4<0,1,0>F
0x00000110: (+f0) if(8) 0 0                 null            0x00000000UD
   END B1 ->B2 ->B4
   START B2 <-B1
   break
0x00000120: break(8) 0 0                    null            0D
   END B2 ->B10
   START B3
0x00000130: endif(8) 2                      null            0x00000002UD
   END B3 ->B4

The ENDIF block would have no parents, so dataflow analysis would
generate incorrect results, preventing copy propagation from eliminating
some instructions.

This patch changes the CFG to make ENDIF start rather than end basic
blocks, so that it can be the jump target of the IF and ELSE
instructions.

It helps three programs (including two fs8/fs16 pairs).

total instructions in shared programs: 1561126 -> 1561060 (-0.00%)
instructions in affected programs:     837 -> 771 (-7.89%)

More importantly, it allows copy propagation to handle more cases.
Disabling the register_coalesce() pass before this patch hurts 58
programs, while afterward it only hurts 11 programs.

Reviewed-by: Eric Anholt <eric@anholt.net>
2013-12-04 20:05:41 -08:00
Matt Turner
ed85c0f409 i965/cfg: Keep pointers to IF/ELSE/ENDIF instructions in the cfg.
Useful for finding the associated control flow instructions, given a
block ending in one.

Reviewed-by: Eric Anholt <eric@anholt.net>
2013-12-04 20:05:41 -08:00
Matt Turner
51194932d3 i965/cfg: Add code to dump blocks and cfg.
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-12-04 20:05:41 -08:00
Ian Romanick
fa1923ac3a mesa: Remove GL_MESA_texture_array cruft from gl.h
glext.h has had all the necessary bits for years.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-12-04 17:22:43 -08:00
Ian Romanick
2a3d1e2e06 mesa: Remove support for GL_MESA_texture_array
This extension enabled the use of texture array with fixed-function and
assembly fragment shaders.  No applications are known to use this
extension.

NOTE: This patch regresses GL_TEXTURE_1D_ARRAY and GL_TEXTURE_2D_ARRAY
cases of the copyteximage piglit test.  The test is incorrectly using
texture arrays with fixed function while only requiring the
GL_EXT_texture_array extension.  A fix for the test has been posted to
the piglit mailing list.

http://lists.freedesktop.org/archives/piglit/2013-November/008639.html

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-12-04 17:22:42 -08:00
Ian Romanick
538a7f2a80 mesa: Use a single enable for GL_EXT_texture_array and GL_MESA_texture_array
Every driver that enables one also enables the other.  The difference
between the two is MESA adds support for fixed-function and assembly
fragment shaders, but EXT only adds support for GLSL.  The MESA
extension was created back when Mesa did not support GLSL.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-12-04 17:22:42 -08:00
Ian Romanick
e0587fb9d0 mesa: Minor clean-up of target_enum_to_index
Constify the gl_context parameter, and remove suffixes from enums that
have non-suffix versions.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-12-04 17:22:42 -08:00
Ian Romanick
b092af40a5 mesa: Silence GCC warning in count_tex_size
main/texobj.c: In function 'count_tex_size':
main/texobj.c:886:23: warning: unused parameter 'key' [-Wunused-parameter]

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-12-04 17:22:42 -08:00
Ian Romanick
6c84fc2dbf mesa: Silence GCC warning in _mesa_test_texobj_completeness
main/texobj.c: In function '_mesa_test_texobj_completeness':
main/texobj.c:553:34: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
main/texobj.c:553:193: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
main/texobj.c:553:254: warning: signed and unsigned type in conditional expression [-Wsign-compare]
main/texobj.c:553:148: warning: signed and unsigned type in conditional expression [-Wsign-compare]

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-12-04 17:22:42 -08:00
Ian Romanick
7144b76872 mesa: Add missing API check for GL_TEXTURE_3D
There are no 3D textures in OpenGL ES 1.x.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-12-04 17:22:42 -08:00
Ian Romanick
01bbebce4d mesa: Add missing checks for GL_TEXTURE_CUBE_MAP_ARRAY
That enum requires GL_ARB_texture_cube_map_array, and it is only
available on desktop GL.  It looks like this has been an un-noticed
issue since GL_ARB_texture_cube_map_array support was added in commit
e0e7e295.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-12-04 17:22:42 -08:00
Neil Roberts
5cddb1ce3c wayland: Add an extension to create wl_buffers from EGLImages
This adds an extension called EGL_WL_create_wayland_buffer_from_image
which adds the following single function:

struct wl_buffer *
eglCreateWaylandBufferFromImageWL(EGLDisplay dpy, EGLImageKHR image);

The function creates a wl_buffer which shares its contents with the given
EGLImage. The expected use case for this is in a nested Wayland compositor
which is using subsurfaces to present buffers from its clients. Using this
extension it can attach the client buffers directly to the subsurface without
having to blit the contents into an intermediate buffer. The compositing can
then be done in the parent compositor.

The extension is only implemented in the Wayland EGL platform because of
course it wouldn't make sense anywhere else.
2013-12-04 17:04:57 -08:00
Kristian Høgsberg
bce64c6c83 egl/wayland: Damage INT32_MAX x INT32_MAX region for eglSwapBuffers
If we're not using EGL_EXT_swap_buffers_with_damage, we have to
damage the full extent.  EGL operates on buffer coordinates, but
wl_surface.damage takes surface coordinates.  EGL doesn't know the
buffer transformation (rotated or scaled) and can't post accurate
damage in surface coordinates.  The damage event however is clipped to
the surface extents so we can just damage the maximum rectangle.

In case of EGL_EXT_swap_buffers_with_damage, the application knows
the buffer transform and is expected to pass in rectangles in
surface space.

https://bugs.freedesktop.org/show_bug.cgi?id=70250
Cc: "10.0" mesa-stable@lists.freedesktop.org
2013-12-04 16:13:42 -08:00
Axel Davy
afcce46fd5 Enable throttling in SwapBuffers
flush_with_flags, when available, allows the driver to throttle.
Using this suppress input lag issues that can be observed in heavy
rendering situations on non-intel cards.

Signed-off-by: Axel Davy <axel.davy@ens.fr>
Cc: "10.0" mesa-stable@lists.freedesktop.org
2013-12-04 15:58:29 -08:00
Kristian Høgsberg
33eb5eabee egl/wayland: Send commit after flushing the driver context
This typically won't make a difference, since we only send the requests at
wl_display_flush() time.  There might be a small race
with another thread calling wl_display_flush() after our commit request,
but before we flush the DRI driver.  Moving the commit below the DRI
driver flush call looks more natural and eliminates the small race.

Cc: "10.0" mesa-stable@lists.freedesktop.org
2013-12-04 15:48:28 -08:00
Axel Davy
402bf6e8d0 egl/wayland: Flush the wl_display at the end of SwapBuffers
We would like the compositor to receive the commited buffer
as soon as possible, so it has the time to treat it, and
release old ones. We shouldn't rely on the client
to flush the queue for us.

Signed-off-by: Axel Davy <axel.davy@ens.fr>
Cc: "10.0" mesa-stable@lists.freedesktop.org
2013-12-04 15:48:28 -08:00
Brian Paul
50205e11c6 mesa: reduce memory used for short display lists
Display lists allocate memory in chunks of 256 tokens (1KB) at a time.
If an app creates many short display lists or uses glXUseXFont() this
can waste quite a bit of memory.

This patch uses realloc() to trim short lists and reduce the memory
used.

Also, null/zero-out some list construction fields in _mesa_EndList().

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-12-04 15:40:32 -07:00
Brian Paul
314ccf6901 mesa: update/remove display list comments
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-12-04 09:46:07 -07:00
Brian Paul
483dc973c4 mesa: remove gl_dlist_node::next pointer to reduce dlist memory use
Now, sizeof(gl_dlist_node)==4 even on 64-bit systems.  This can
halve the memory used by some display lists on 64-bit systems.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-12-04 09:46:07 -07:00
Brian Paul
b6468b4597 mesa: begin reducing memory used by display lists
This is a first step in reducing memory used by display lists on
64-bit systems.  On 64-bit systems, the gl_dlist_node union type
is 8 bytes because of the 'data' and 'next' fields.  This causes
every display list node/token to occupy 8 bytes instead of 4 as
originally designed.  This basically doubles the memory used by
some display lists on 64-bit systems.

The fix is to remove the 64-bit 'data' and 'next' pointer fields
from the union and instead store them as a pair of 32-bit values.
Easily done with a few helper functions.

The next patch will take care of the 'next' field.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-12-04 09:46:07 -07:00
Ilia Mirkin
06359e368b nouveau: Add lots of comments to the buffer transfer logic
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2013-12-04 16:38:50 +01:00
Ilia Mirkin
0e5bf85651 nv50: wait on the buf's fence before sticking it into pushbuf
This resolves some rendering issues in source games.
See https://bugs.freedesktop.org/show_bug.cgi?id=64323

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "9.2 10.0" <mesa-stable@lists.freedesktop.org>
2013-12-04 16:38:50 +01:00
Ilia Mirkin
ce6dd69697 nouveau: avoid leaking fences while waiting
This fixes a memory leak in some situations. Also avoids emitting an
extra fence if the kick handler does the call to nouveau_fence_next
itself.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "9.2 10.0" <mesa-stable@lists.freedesktop.org>
2013-12-04 16:38:50 +01:00
Ilia Mirkin
f50a45452a nv50: fix a small leak on context destroy
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2013-12-04 16:38:50 +01:00
Brian Paul
657466a3f6 docs: put MD5 sums in 9.2.4 relnotes file
Signed-off-by: Brian Paul <brianp@vmware.com>
2013-12-04 07:47:13 -07:00
Brian Paul
2732d0d21d docs: use --disable-dri3 for VMware guest driver build
For the time being at least.  Suggested by Adrian Rangel.

Signed-off-by: Brian Paul <brianp@vmware.com>
2013-12-04 07:41:29 -07:00
Siavash Eliasi
f0cc59d68a mesa: modified _mesa_align_free() to accept NULL pointer
So that it acts like ordinary free().  This lets us remove a bunch of
if statements where the function is called.

v2:
- Avoiding compile error on MSVC and possible warnings on other compilers.
- Added comment regards passing NULL pointer being safe.

Reviewed-by: Brian Paul <brianp@vmware.com>
2013-12-04 07:31:27 -07:00
Ilia Mirkin
267679be84 mesa: don't leak performance monitors on context destroy
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: "10.0" <mesa-stable@lists.freedesktop.org>
2013-12-04 06:20:36 -08:00
Ilia Mirkin
c45cf6199f nv50: Fix GPU_READING/WRITING bit removal
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
CC: "9.1, 9.2, 10.0" <mesa-stable@lists.freedesktop.org>
2013-12-04 14:24:30 +01:00
Michel Dänzer
79e6512629 pipe-loader: Fix llvmpipe.la path
Fixes

 make[3]: *** No rule to make target `.../src/gallium/drivers/softpipe/libllvmpipe.la', needed by `pipe_swrast.la'.  Stop.
2013-12-04 11:56:10 +09:00
Kenneth Graunke
26b7b50afe i965: Fix BRW_BATCH_STRUCT to specify RENDER_RING, not UNKNOWN_RING.
I missed this in the boolean -> enum conversion.  C cheerfully casts
false -> 0 -> UNKNOWN_RING.  On Gen4-5, this causes the render ring
prelude hook to get called in the middle of the batch, which is crazy.

BRW_BATCH_STRUCT is not used on Gen6+.

Fixes regressions since 395a32717d
("i965: Introduce an UNKNOWN_RING state.").

Fixes "fips -v glxgears" on Ironlake.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-12-03 16:24:58 -08:00
Kenneth Graunke
e03994bf47 Revert "i965: Move brw_emit_query_begin() to the render ring prelude."
This reverts commit a4bf7f6b6e.
It breaks occlusion queries on Gen4-5.  Doing this right will likely
require larger changes, which should be done at a future date.

Some Piglit tests still passed due to other bugs; fixing those revealed
this problem.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-12-03 16:24:53 -08:00
Kenneth Graunke
da07e1b683 i965: Fix OACONTROL assertion failures on Ironlake.
I guarded half of the callers to start/stop_oa_counters with generation
checks, but missed the other half (which were added later).  OACONTROL
doesn't exist on Ironlake, so we better not write it.  Also, there's no
need---Ironlake's performance counters are always running.

This patch moves the generation checks into start/stop_oa_counters,
rather than requiring the caller to do them.

Fixes assertion failures in Piglit's AMD_performance_monitor/measure.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-12-03 16:24:49 -08:00
Emil Velikov
4c11099453 gallium/radeon: use PRIu64 macro for printing uint64_t
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2013-12-03 21:44:26 +00:00
Emil Velikov
f60737a525 pipe-loader: build llvmpipe on top of softpipe
One can select if they want to fallback to softpipe.
Current approach makes this not possible, whereas other
targets (dri-swrast) handle this approapriately.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2013-12-03 21:44:26 +00:00
Emil Velikov
bc2627a98a mesa: resolve typo DTXn/DXTn
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2013-12-03 21:44:26 +00:00
Emil Velikov
507c2356e3 automake: include only one copy VERSION in tarball
The VERSION file is tracked by git (git ls-files), thus
adding it to EXTRA_FILES will result in a duplicate copy
within the final tarball.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=72230
Cc: "10.0" <mesa-stable@lists.freedesktop.org>
Reported-by: Patrick Steinhardt <ps@pks.im>
Tested-by: Patrick Steinhardt <ps@pks.im>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2013-12-03 21:44:26 +00:00
Juha-Pekka Heikkila
03ef57950a glx: Add missing null check in gxl/dri2_glx.c
Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>

Reviewed-by: Brian Paul <brianp@vmware.com>
2013-12-03 14:35:41 -07:00
Juha-Pekka Heikkila
b8875cb7c8 glx: Check malloc return value before accessing memory in glx/clientattrib.c
Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>

Reviewed-by: Brian Paul <brianp@vmware.com>
2013-12-03 14:35:41 -07:00
Chad Versace
998018d7be i965: Add extra-alignment for non-msrt fast color clear for all hw (v2)
The BSpec states that the aligment for the non-msrt clear rectangle must
be doubled; the BSpec does not restricit the workaround to specific
hardware.

Commit 9a1a67b applied the workaround to Haswell GT3.  Commit 8b659ce
expanded the workaround to all Haswell variants. This commit expands it
to all hardware.

No Piglit regressions on Ivybridge 0x0166. No fixes either.

I know no Ivybridge nor Baytrail bug related to this workaround.
However, the BSpec says the extra alignment is required, so let's do it.

v2: Apply to all hardware, not just gen7.

CC: "9.2, 10.0" <mesa-stable@lists.freedesktop.org>
CC: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2013-12-03 13:19:54 -08:00
Marek Olšák
40e2856123 configure.ac: require libdrm_radeon 2.4.50 2013-12-03 20:07:35 +01:00
Marek Olšák
e47af58bb4 st/mesa: implement layered framebuffer clear for the clear_with_quad fallback
Same approach as in u_blitter.
2013-12-03 19:39:13 +01:00
Marek Olšák
6b919b1b2d gallium/util: implement layered framebuffer clear in u_blitter
All bound layers (from first_layer to last_layer) should be cleared.

This uses a vertex shader which outputs gl_Layer = gl_InstanceID, so each
instance goes to a different layer. By rendering a quad and setting
the instance count to the number of layers, it will trivially clear all
layers.

This requires AMD_vertex_shader_layer (or PIPE_CAP_TGSI_VS_LAYER), which only
radeonsi supports at the moment. r600 could do this too. Standard DX11
hardware will have to use a geometry shader though, which has higher overhead.
2013-12-03 19:39:13 +01:00
Marek Olšák
1a02bb71dd gallium: add support for AMD_vertex_shader_layer 2013-12-03 19:39:13 +01:00
Marek Olšák
d52791a708 radeonsi: add driver support for layered rendering and AMD_vertex_shader_layer
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2013-12-03 19:39:13 +01:00
Marek Olšák
053606ddae radeonsi: implement OpenGL edge flags
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2013-12-03 19:39:13 +01:00
Marek Olšák
d8d67d2e1f st/mesa: add support for layered framebuffers and consolidate code
This is a subset of geometry shaders. It's all about setting first_layer and
last_layer correctly.

Also some code between st_render_texture and update_framebuffer_state is
consolidated. It doesn't use rtt_level and derives the level from dimensions
instead as the code in st_atom_framebuffer.c did.
2013-12-03 19:39:13 +01:00
Marek Olšák
0b3b901cff mesa: expose AMD_vertex_shader_layer in the core profile only
It needs glFramebufferTexture, which isn't available in the compatibility
profile.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-12-03 19:39:13 +01:00
Tapani Pälli
a057b837dd egl: add HAVE_LIBDRM define, fix EGL X11 platform
Commit a594cec broke EGL X11 backend by adding dependency between
X11 and DRM backends requiring HAVE_EGL_PLATFORM_DRM defined for X11.

This patch fixes the issue by adding additional define for libdrm
detection independent of which backend is being compiled. Tested by
compiling Mesa with '--with-egl-platforms=x11' and running es2gears_x11
+ glbenchmark2.7 successfully.

v2: return true for dri2_auth if running without libdrm (Samuel)
v3: check libdrm when building EGL drm platform + AM_CFLAGS fix (Emil)

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=72062
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Cc: Samuel Thibault <samuel.thibault@ens-lyon.org>
Cc: mesa-stable@lists.freedesktop.org
2013-12-03 09:21:24 -08:00
Andreas Heider
ad3937fd4e freedreno: Add a few texture formats 2013-12-02 17:37:03 -05:00
Kenneth Graunke
decf070258 i965: Skip the register write check on Broadwell.
MI_STORE_REGISTER_MEM has to take a 48-bit address, so the existing code
doesn't work.  But supposedly Broadwell has a register whitelist and
just works out of the box anyway, so there's no need to check.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-12-02 13:26:03 -08:00
Kenneth Graunke
8ed9f69b36 i965: Fix texture border color on Broadwell.
The Gen7 sampler state code still works.  Increasing the alignment to
64 bytes makes bit 5 zero, which is good because it's now reserved.

Since we don't use the new filter bits, we can leave those as zero too,
which means we don't need to update the code to update the pointer.
(We probably should anyway, for clarity, but alas, another day.)

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-12-02 13:25:52 -08:00
Kenneth Graunke
bc9d3a0254 i965: Don't use MACH for integer multiplies on Gen8+.
The documentation is really hard to follow, but apparently a 32-bit x
32-bit multiply just works without the MACH macro.  The macro apparently
is only necessary to get the full 64-bit value.

Fixes Piglit tests [vf]s-op-mult-int-int.shader_test.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-12-02 13:25:32 -08:00
Kenneth Graunke
5720832f23 i965: Fix texture swizzling on Broadwell.
Like Haswell, we do this in SURFACE_STATE rather than shader
workarounds.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-12-02 13:25:23 -08:00
Kenneth Graunke
1110ba4c08 i965: Set vertical alignment unit to 4 on Broadwell.
Broadwell doesn't support a surface vertical alignment of 2.  It only
supports VALIGN_4, VALIGN_8, or VALIGN_16.  I chose 4 since it's the
least wasteful.

v2: Replace my comment with a better one from Eric.  Move Broadwell
    checks earlier so it's more obvious that "return 2" won't be hit.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-12-02 13:25:11 -08:00
Kenneth Graunke
93658054c0 i965/vs: Always store pull constant offsets in GRFs on Gen8.
We need to SEND from a GRF, and we can only obtain those prior to
register allocation.

This allows us to do pull constant loads without the MRF hack.

v2: Reword comments (suggested by Paul).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-12-02 13:19:10 -08:00
Kenneth Graunke
dd159f25e4 i965/vs: Don't copy propagate into SEND-from-GRF messages.
SEND can't deal with swizzles, source modifiers, and so on.  This should
avoid problems with VS pull constant loads on Broadwell.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-12-02 13:10:12 -08:00
Francisco Jerez
ce34158680 clover: Fix missing minus sign in 'iterator_adaptor::operator-='.
The method is currently unused, this probably doesn't fix anything at
this point.
2013-12-02 11:55:02 -08:00
Chad Versace
8b659cef3a i965/hsw: Apply non-msrt fast color clear w/a to all HSW GTs
Pre-patch, the workaround was applied to only HSW GT3. However, the
workaround also fixes render corruption on the HSW GT1 Chromebook,
codenamed Falco.

Also, update the BSpec quote that discusses the workaround to reflect
the latest BSpec.

The BSpec states that the workaround is required for Ivybridge and
Baytrail as well as Haswell. But, we apply the workaround to only
Haswell because (a) we suspect that is the only hardware where it is
actually required and (b) we haven't yet validated the workaround for
the other hardware.

CC: "9.2, 10.0" <mesa-stable@lists.freedesktop.org>
CC: Anuj Phogat <anuj.phogat@gmail.com>
OTC-Tracker: CHRMOS-812
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2013-12-02 10:53:33 -08:00
Kenneth Graunke
5b331f6fcb glsl: Simplify the built-in function linking code.
Previously, we stored an array of up to 16 additional shaders to link,
as well as a count of how many each shader actually needed.

Since the built-in functions rewrite, all the built-ins are stored in a
single shader.  So all we need is a boolean indicating whether a shader
needs to link against built-ins or not.

During linking, we can avoid creating the temporary array if none of the
shaders being linked need built-ins.  Otherwise, it's simply a copy of
the array that has one additional element.  This is much simpler.

This patch saves approximately 128 bytes of memory per gl_shader object.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-12-01 15:33:04 -08:00
Kenneth Graunke
1b557b1606 glsl: Create an accessor for the built-in function shader.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-12-01 15:33:02 -08:00
Kenneth Graunke
5af97b43c9 glsl: Drop crazy looping from no_matching_function_error().
Since the built-in functions rewrite, num_builtins_to_link is always either
0 or 1, so we don't need tho crazy loop starting at -1 with a special
case.

All we need to do is print the prototypes from the current shader, and
the single built-in function shader (if present).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-12-01 15:33:00 -08:00
Kenneth Graunke
e04a97ff23 glsl: Merge "candidates are: " message to the previous line.
Previously, when we hit a "no matching function" error, it looked like:

0:0(0): error: no matching function for call to `cos()'
0:0(0): error: candidates are: float cos(float)
0:0(0): error:                vec2 cos(vec2)
0:0(0): error:                vec3 cos(vec3)
0:0(0): error:                vec4 cos(vec4)

Now it looks like:

0:0(0): error: no matching function for call to `cos()'; candidates are:
0:0(0): error:    float cos(float)
0:0(0): error:    vec2 cos(vec2)
0:0(0): error:    vec3 cos(vec3)
0:0(0): error:    vec4 cos(vec4)

This is not really any worse and removes the need for the prefix variable.
It will also help with the next commit's refactoring.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-12-01 15:32:59 -08:00
Kenneth Graunke
e5e191a6b1 glsl: Drop unused call_ir parameter from generate_call().
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-12-01 15:32:57 -08:00
Kenneth Graunke
c5adc1c8b5 glsl: Remove useless iteration through function parameters.
There's no need to loop through the "parameters" list and remove every
element; move_nodes_to(&parameters) already throws away all elements of
the destination list.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-12-01 15:32:55 -08:00
Jon TURNEY
61e0f11170 Fix 'make check' in src/mapi/glapi/tests when builddir != srcdir
make[5]: Entering directory `/jhbuild/build/mesa/mesa/src/mapi/glapi/tests'
  CXX      check_table.o
/jhbuild/checkout/mesa/mesa/src/mapi/glapi/tests/check_table.cpp:29:30: fatal error: glapi/glapitable.h: No such file or directory

We should look for the generated file glapi/glapitable.h in builddir, not srcdir

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2013-12-01 12:30:25 +00:00
Ian Romanick
862044c7f7 docs: Import 10.0 release notes, add news item
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2013-11-30 23:42:51 -08:00
Paul Berry
c4cf487315 i965/gen6: Fix multisample resolve blits for luminance/intensity 32F formats.
On gen6, multisamble resolve blits use the SAMPLE message to blend
together the 4 samples for each texel.  For some reason, SAMPLE
doesn't blend together the proper samples when the source format is
L32_FLOAT or I32_FLOAT, resulting in blocky artifacts.

To work around this problem, sample from the source surface using
R32_FLOAT.  This shouldn't affect rendering correctness, because when
doing these resolve blits, the destination format is R32_FLOAT, so the
channel replication done by L32_FLOAT and I32_FLOAT is unnecessary.

Fixes piglit tests on Sandy Bridge:
- spec/ARB_texture_float/multisample-formats 2 GL_ARB_texture_float
- spec/ARB_texture_float/multisample-formats 4 GL_ARB_texture_float

No piglit regressions on Sandy Bridge.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=70601

Cc: Kenneth Graunke <kenneth@whitecape.org>
Cc: mesa-stable@lists.freedesktop.org

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-11-29 21:46:31 -08:00
Paul Berry
26498e0f0c glsl: Remove unused field loop_variable_state::loop.
This field was neither initialized nor used.  It was just dead memory.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-11-29 21:46:28 -08:00
Paul Berry
af9af2965b glsl: Improve documentation of ir_loop counter/control fields.
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-11-29 21:46:23 -08:00
Paul Berry
a810db7b84 glsl: In ir_validate, check that ir_loop::counter always refers to a new var.
The compiler back-ends (i965's fs_visitor and brw_visitor,
ir_to_mesa_visitor, and glsl_to_tgsi_visitor) have been assuming this
for some time.  Thanks to the preceding patch, the compiler front-end
no longer breaks this assumption.

This patch adds code to validate the assumption so that if we have
future bugs, we'll be able to catch them earlier.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-11-29 21:46:20 -08:00
Paul Berry
d6eb4321d0 glsl: Fix inconsistent assumptions about ir_loop::counter.
The compiler back-ends (i965's fs_visitor and brw_visitor,
ir_to_mesa_visitor, and glsl_to_tgsi_visitor) assume that when
ir_loop::counter is non-null, it points to a fresh ir_variable that
should be used as the loop counter (as opposed to an ir_variable that
exists elsewhere in the instruction stream).

However, previous to this patch:

(1) loop_control_visitor did not create a new variable for
    ir_loop::counter; instead it re-used the existing ir_variable.
    This caused the loop counter to be double-incremented (once
    explicitly by the body of the loop, and once implicitly by
    ir_loop::increment).

(2) ir_clone did not clone ir_loop::counter properly, resulting in the
    cloned ir_loop pointing to the source ir_loop's counter.

(3) ir_hierarchical_visitor did not visit ir_loop::counter, resulting
    in the ir_variable being missed by reparenting.

Additionally, most optimization passes (e.g. loop unrolling) assume
that the variable mentioned by ir_loop::counter is not accessed in the
body of the loop (an assumption which (1) violates).

The combination of these factors caused a perfect storm in which the
code worked properly nearly all of the time: for loops that got
unrolled, (1) would introduce a double-increment, but loop unrolling
would fail to notice it (since it assumes that ir_loop::counter is not
accessed in the body of the loop), so it would unroll the loop the
correct number of times.  For loops that didn't get unrolled, (1)
would introduce a double-increment, but then later when the IR was
cloned for linking, (2) would prevent the loop counter from being
cloned properly, so it would look to further analysis stages like an
independent variable (and hence the double-increment would stop
occurring).  At the end of linking, (3) would prevent the loop counter
from being reparented, so it would still belong to the shader object
rather than the linked program object.  Provided that the client
program didn't delete the shader object, the memory would never get
reclaimed, and so the shader would function properly.

However, for loops that didn't get unrolled, if the client program did
delete the shader object, and the memory belonging to the loop counter
got re-used, this could cause a use-after-free bug, leading to a
crash.

This patch fixes loop_control_visitor, ir_clone, and
ir_hierarchical_visitor to treat ir_loop::counter the same way the
back-ends treat it: as a freshly allocated ir_variable that needs to
be visited and cloned independently of other ir_variables.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=72026

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-11-29 21:46:17 -08:00
Paul Berry
9d2951ea0a glsl: Teach ir_variable_refcount about ir_loop::counter variables.
If an ir_loop has a non-null "counter" field, the variable referred to
by this field is implicitly read and written by the loop.  We need to
account for this in ir_variable_refcount, otherwise there is a danger
we will try to dead-code-eliminate the loop counter variable.

Note: at the moment the dead code elimination bug doesn't occur due to
a bug in ir_hierarchical_visitor: it doesn't visit the "counter"
field, so dead code elimination doesn't treat it as a candidate for
elimination.  But the patch to follow will fix that bug, so we need to
fix ir_variable_refcount first in order to avoid breaking dead code
elimination.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-11-29 21:46:13 -08:00
Brian Paul
1fb106527f mesa: fix mem leak of glPixelMap data in display list
And simplify save_PixelMapfv() by using the memdup() function.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-11-29 06:41:14 -07:00
Brian Paul
90d85aa16c mesa: added memory-related comment in save_error()
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-11-29 06:41:14 -07:00
Brian Paul
95d6ed22b3 mesa: fix flags assignment in save_WaitSync()
The flags value is a bitfield so use the union's 'bf' field, not 'e'
(enum) field.  There's no actual change in behavior here since both
fields of the union are the same size.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-11-29 06:41:14 -07:00
Brian Paul
efe7257ea7 mesa: remove old colortable, histogram, etc. code from dlist.c
Trying to compile any of these functions into a display list
now just generates a GL_INVALID_OPERATION error.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-11-29 06:41:13 -07:00
Brian Paul
90891091cd mesa: have old convolution functions generate GL_INVALID_OPERATION
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-11-29 06:41:13 -07:00
Brian Paul
214399a3bc mesa: have old glColorTable functions generate GL_INVALID_OPERATION
As is done for the old histogram functions.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-11-29 06:41:12 -07:00
José Fonseca
fb5f5b8188 trace: Dump PIPE_QUERY_* enums.
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2013-11-28 12:19:42 +00:00
José Fonseca
eb040bd54a trace: Dump query results faithfully.
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2013-11-28 12:19:30 +00:00
Carl Worth
eeaa7a05a1 docs: Import 9.2.4 release notes, add news item. 2013-11-28 00:02:52 -08:00
Roland Scheidegger
ca39f4eee2 gallium/cso: fix sampler / sampler_view counts
Now that it is possible to query drivers for the max sampler view it should
be safe to increase this without crashing.
Not entirely convinced this really works correctly though if state trackers
using non-linked sampler / sampler_views use this.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2013-11-28 04:02:41 +01:00
Roland Scheidegger
2983c039df gallium: new shader cap bit for the amount of sampler views
Ever since introducing separate sampler and sampler view max this was really
missing.
Every driver but llvmpipe reports the same number as number of samplers for
now, so nothing should break.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2013-11-28 04:02:18 +01:00
Roland Scheidegger
e4d8084cbd gallium/drivers: support more sampler views than samplers for more drivers
This adds support for this to more drivers, in particular for all the "special"
ones useful for debugging.
HW drivers are left alone, some should be able to support it if they want but
they may not be interested at this point.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2013-11-28 04:01:54 +01:00
Ian Romanick
53a65e547c i965: Properly reject __DRI_CTX_FLAG_ROBUST_BUFFER_ACCESS when __DRI2_ROBUSTNESS is not enabled
Only allow __DRI_CTX_FLAG_ROBUST_BUFFER_ACCESS in brwCreateContext if
intelInitScreen2 also enabled __DRI2_ROBUSTNESS (thereby enabling
GLX_ARB_create_context).

This fixes a regression in the piglit test
"glx/GLX_ARB_create_context/invalid flag"

v2: Remove commented debug code.  Noticed by Jordan.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reported-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Cc: "10.0" <mesa-stable@lists.freedesktop.org>
2013-11-27 15:09:01 -08:00
Matt Turner
0822b2dfbd Revert "drop old INTEL_DEBUG names for perf (fall) and fs (wm)"
This reverts commit 195994fe4c.

It wasn't sent to the list, Ken didn't review it, and it breaks
shader-db.
2013-11-27 13:38:42 -08:00
Vinson Lee
9bf41f09ab glsl: Link glcpp with math library.
This patch fixes this build error with Oracle Solaris Studio.

libtool: link: /opt/solarisstudio12.3/bin/cc -g -o glcpp/glcpp glcpp.o prog_hash_table.o  ./.libs/libglcpp.a
Undefined			first referenced
 symbol  			    in file
sqrt                                prog_hash_table.o

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2013-11-27 10:37:37 -08:00
Kenneth Graunke
c4815f6cd6 i965: Always reserve binding table space for at least one render target.
In brw_update_renderbuffer_surfaces(), if there are no color draw
buffers, we always set up a null render target at surface index 0 so we
have something to use with the FB write marking the end of thread.

However, when we recently began computing surface indexes dynamically,
we failed to reserve space for it.  This meant that the first texture
would be assigned surface index 0, and our closing FB write would
clobber the texture.

Fixes Piglit's EXT_packed_depth_stencil/fbo-blit-d24s8 test on Gen4-5,
which regressed as of commit 4e5306453d
("i965/fs: Dynamically set up the WM binding table offsets.")

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=70605
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Tested-by: lu hua <huax.lu@intel.com>
Cc: "10.0" mesa-stable@lists.freedesktop.org
2013-11-27 10:28:43 -08:00
Francisco Jerez
6b2b4cc885 glsl: Initialize _mesa_glsl_parse_state::atomic_counter_offsets before using it.
Cc: Ian Romanick <ian.d.romanick@intel.com>
Cc: "10.0" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-11-26 19:34:24 -08:00
Francisco Jerez
4f64dabb5f i965/fs: Fix misleading comment.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-11-26 19:34:02 -08:00
Francisco Jerez
32f69ad86c i965: Bump number of supported atomic counter buffers.
Now that we have dynamic binding tables there's no good reason anymore
to expose so few atomic counter buffers.  Increase it to 16.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-11-26 19:34:02 -08:00
Paul Berry
d7fa9eb003 glsl/linker: Validate IR just before reparenting.
If reparent_ir() is called on invalid IR, then there's a danger that
it will fail to reparent all of the necessary nodes.  For example, if
the IR contains an ir_dereference_variable which refers to an
ir_variable that's not in the tree, that ir_variable won't get
reparented, resulting in subtle use-after-free bugs once the
non-reparented nodes are freed.  (This is exactly what happened in the
bug fixed by the previous commit).

This patch makes this kind of bug far easier to track down, by
transforming it from a use-after-free bug into an explicit IR
validation error.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-11-26 13:22:24 -08:00
Paul Berry
9dfcb05fa6 glsl: Fix lowering of direct assignment in lower_clip_distance.
In commit 065da16 (glsl: Convert lower_clip_distance_visitor to be an
ir_rvalue_visitor), we failed to notice that since
lower_clip_distance_visitor overrides visit_leave(ir_assignment *),
ir_rvalue_visitor::visit_leave(ir_assignment *) wasn't getting called.
As a result, clip distance dereferences appearing directly on the
right hand side of an assignment (not in a subexpression) weren't
getting properly lowered.  This caused an ir_dereference_variable node
to be left in the IR that referred to the old gl_ClipDistance
variable.  However, since the lowering pass replaces gl_ClipDistance
with gl_ClipDistanceMESA, this turned into a dangling pointer when the
IR got reparented.

Prior to the introduction of geometry shaders, this bug was unlikely
to arise, because (a) reading from gl_ClipDistance[i] in the fragment
shader was rare, and (b) when it happened, it was likely that it would
either appear in a subexpression, or be hoisted into a subexpression
by tree grafting.

However, in a geometry shader, we're likely to see a statement like
this, which would trigger the bug:

    gl_ClipDistance[i] = gl_in[j].gl_ClipDistance[i];

This patch causes
lower_clip_distance_visitor::visit_leave(ir_assignment *) to call the
base class visitor, so that the right hand side of the assignment is
properly lowered.

Fixes piglit test:
- spec/glsl-1.50/execution/geometry/clip-distance-itemized-copy

Cc: Ian Romanick <idr@freedesktop.org>
Cc: "9.2" <mesa-stable@lists.freedesktop.org>
Cc: "10.0" <mesa-stable@lists.freedesktop.org>

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-11-26 13:22:24 -08:00
Paul Berry
37bdde1087 i965/gs: Set GS prog_data to NULL if there is no GS program.
The previous commit fixes a bug wherein we would incorrectly refer to
stale geometry shader prog_data when no geometry shader was active.

This patch reduces the likelihood of that sort of bug occurring in the
future by setting prog_data to NULL whenever there is no GS program.

Cc: mesa-stable@lists.freedesktop.org

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-11-26 13:22:23 -08:00
Paul Berry
2714ca81b9 i965/gs: Properly skip GS binding table upload when no GS active.
Previously, in brw_gs_upload_binding_table(), we checked whether
brw->gs.prog_data was NULL in order to determine whether a geometry
shader was active.  This didn't work: brw->gs.prog_data starts off as
NULL, but it is set to non-NULL when a geometry shader program is
built, and then never set to NULL again.  As a result, if we called
brw_gs_upload_binding_table() while there was no geometry shader
active, but a geometry shader had previously been active, it would
refer to a stale (and possibly freed) prog_data structure.

This patch fixes the problem by modifying
brw_gs_upload_binding_table() to use the proper technique to determine
whether a geometry shader is active: by checking whether
brw->geometry_program is NULL.

This fixes the crash reported in comment 2 of bug 71870 (the incorrect
rendering remains, however).

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=71870

Cc: mesa-stable@lists.freedesktop.org

Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-11-26 13:21:56 -08:00
Ian Romanick
73e9aa9e3f dri: Allow __DRI_CTX_FLAG_ROBUST_BUFFER_ACCESS in driCreateContextAttribs
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reported-by: Zhenyu Wang <zhenyuw@linux.intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: "10.0" <mesa-stable@lists.freedesktop.org>
2013-11-26 13:13:38 -08:00
Ian Romanick
9b1c68638d i965: Only enable __DRI2_ROBUSTNESS if kernel support is available
Rather than always advertising the extension but failing to create a
context with reset notifiction, just don't advertise it.  I don't know
why it didn't occur to me to do it this way in the first place.

NOTE: Kristian requested that I provide a follow-up for master that
dynamically generates the list of DRI extensions instead of selected
between two hardcoded lists.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Suggested-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Cc: "10.0" <mesa-stable@lists.freedesktop.org>
2013-11-26 13:10:52 -08:00
Ian Romanick
0ae8439906 Revert "i965: Make the driver compile until a proper libdrm can be released."
libdrm 2.4.48 has been released.

This reverts commit bd4596efac.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-11-26 13:10:52 -08:00
Ian Romanick
cb728bb028 i965: Bump libdrm requirement
drm_intel_get_reset_stats is only available in libdrm-2.4.48, and
libdrm-2.4.49 contains an important bug fix in that function.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: "10.0" <mesa-stable@lists.freedesktop.org>
2013-11-26 13:10:52 -08:00
Chad Versace
97851145bc egl: Kill macro _EGL_DECLARE_MUTEX
Replace all occurences of the macro with its expansion.

It seems that the macro intended to provide cross-platform static mutex
intialization. However, it had the same definition in all pre-processor
paths:
    #define _EGL_DECLARE_MUTEX(m) _EGLMutex m = _EGL_MUTEX_INITIALIZER

Therefore this abstraction obscured rather than helped.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-11-26 12:50:30 -08:00
Chad Versace
3c58d4c700 egl: Enable EGL_EXT_client_extensions
Insert two fields into _egl_global to hold the client extensions and
statically initialize them:
    ClientExtensions // a struct of bools
    ClientExtensionString

Post-patch, Mesa supports exactly one client extension,
EGL_EXT_client_extensions.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-11-26 12:50:29 -08:00
Tom Stellard
ddc77c5092 radeon/compute: Unconditionally inline all functions v2
We need to do this until function calls are supported.

v2:
  - Fix loop conditional

https://bugs.freedesktop.org/show_bug.cgi?id=64225

CC: "10.0" <mesa-stable@lists.freedesktop.org>
2013-11-25 20:42:49 -08:00
Kenneth Graunke
ad542a10c5 i965: Use __attribute__((flatten)) on fast tiled teximage code.
The fast tiled texture upload code does not compile with GCC 4.8's -Og
optimization flag.

memcpy() has the always_inline attribute set.  This poses a problem,
since {x,y}tile_copy_faster calls it indirectly via {x,y}tile_copy,
and {x,y}tile_copy normally aren't inlined at -Og.

Using __attribute__((flatten)) tells GCC to inline every function call
inside the function, which I believe was the author's intent.

Fix suggested by Alexander Monakov.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Cc: mesa-stable@lists.freedesktop.org
2013-11-25 19:13:23 -08:00
Zack Rusin
0510ec67e2 llvmpipe: support 8bit subpixel precision
8 bit precision is required by d3d10 but unfortunately
requires 64 bit rasterizer. This commit implements
64 bit rasterization with full support for 8bit subpixel
precision. It's a combination of all individual commits
from the llvmpipe-rast-64 branch.

Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2013-11-25 13:05:03 -05:00
Maarten Lankhorst
5455c818b5 gbm/dri: hide extension loader symbols
They should not be exposed.

Cc: "10.0" <mesa-stable@lists.freedesktop.org>
2013-11-25 13:13:47 +01:00
Chris Forbes
e6a0eca45e i965: Enable ARB_draw_indirect (and ARB_multi_draw_indirect) on Gen7+
.. and mark them off on the extensions list as done.

V2: Enable only if pipelined register writes work.
V3: Also update relnotes

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-11-25 22:01:36 +13:00
Chris Forbes
093965f9e3 vbo: map indirect buffer and extract params if doing sw primitive restart
V2: Check for mapping failure (thanks Brian)
V3: - Change error on mapping failure to OUT_OF_MEMORY (Brian)
    - Unconst; remove casting away of const.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-11-25 22:01:36 +13:00
Chris Forbes
3953766e57 mesa: pass indirect buffer to sw primitive restart
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-11-25 22:01:36 +13:00
Chris Forbes
803fcc3298 i965: pass indirect buffer to primitive restart check
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-11-25 22:01:35 +13:00
Chris Forbes
02f9757ab5 i965: implement indirect drawing for Gen7
Just prior to emitting the 3DPRIMITIVE command, we load each of the
indirect registers. The values loaded are either from offsets into the
current indirect BO, or constant zero if the parameter is not used for
this draw.

Enabling use of the indirect registers is done by turning on a bit in
the first dword of the 3DPRIMITIVE command itself.

V3: - Deduplicate the common part of both indexed and nonindexed indirect
setup.
    - Just refer to the indirect bo out of the context directly.

V4: - Fix bo reference to specify the range we care about.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-11-25 22:01:35 +13:00
Chris Forbes
1a00317169 i965: Add new defines for indirect draws
- MMIO registers for draw parameters
- New bit in 3DPRIMITIVE command to enable indirection

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-11-25 22:01:35 +13:00
Chris Forbes
5a798e73b5 vbo: Flesh out implementation of indirect draws
Based on part of Patch 2 of Christoph Bumiller's ARB_draw_indirect series.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-11-25 22:01:35 +13:00
Chris Forbes
aadbb0f275 mesa: add indirect_offset, is_indirect to _mesa_prim
V3: Add missing cases
V4: Add indirect_offset here too

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-11-25 22:01:35 +13:00
Chris Forbes
36046ae278 mesa: Add validation helpers for new indirect draws
Based on part of Patch 2 of Christoph Bumiller's ARB_draw_indirect series.

V3: - Disallow primcount==0 for DrawMulti*Indirect. The spec is unclear
      on this, but it's silly. We might go back on this later if it
      turns out to be a problem.

    - Make it clear that the caller has dealt with stride==0

V4: - Allow primcount==0 again.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-11-25 22:01:35 +13:00
Chris Forbes
a95236cfc1 mesa: Add binding point for indirect buffer
Based on part of Patch 2 of Christoph Bumiller's ARB_draw_indirect series.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-11-25 22:01:35 +13:00
Chris Forbes
56e98fe2fe mesa: Add extension scaffolding for ARB_draw_indirect
We will reuse the same extension flag for ARB_multi_draw_indirect since
it can always be supported by looping.

Based on part of Patch 2 of Christoph Bumiller's ARB_draw_indirect series.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-11-25 22:01:35 +13:00
Chris Forbes
5127318ae8 glapi: add plumbing for GL_ARB_draw_indirect and GL_ARB_multi_draw_indirect
Based on part of Patch 2 of Christoph Bumiller's ARB_draw_indirect series.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-11-25 22:01:35 +13:00
Christoph Bumiller
80ac616fca mesa: add indirect drawing buffer parameter to draw functions
Split from patch implementing ARB_draw_indirect.

v2: Const-qualify the struct gl_buffer_object *indirect argument.
v3: Fix up some more draw calls for new argument.
v4: Fix up rebase conflicts in i965.
v5: Undo const-qualification

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-11-25 22:01:35 +13:00
José Fonseca
eb0892b4b1 docs/llvmpipe: Add one other good reference. 2013-11-25 08:28:23 +00:00
Chris Forbes
90d185544c docs: describe the INTEL_* envvars that do exist
V2: drop description of `fall` and `wm`, which have been removed by the
previous patch; describe `stats`.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-11-25 21:18:33 +13:00
Chris Forbes
195994fe4c drop old INTEL_DEBUG names for perf (fall) and fs (wm)
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-11-25 21:18:33 +13:00
Chris Forbes
452721c1fa i965: remove unused DEBUG_IOCTL
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-11-25 21:18:33 +13:00
Chris Forbes
e0c98fa401 radeon: change last instance of DEBUG_IOCTL to use RADEON_IOCTL
DEBUG_IOCTL comes from i965, and is about to be removed. Both defines
have the same value (4).

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2013-11-25 21:18:33 +13:00
Chris Forbes
26eb6ad831 docs: drop INTEL_* envvars which no longer exist
These were removed back in 2012.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-11-25 21:18:33 +13:00
Chris Forbes
f6159afa19 docs: bump supported shading language version
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-11-25 21:18:33 +13:00
Dave Airlie
72cae2a599 st/mesa: respect higher GLSL levels. (v2)
Limit the max glsl version level to what the state tracker supports.

Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2013-11-25 13:03:02 +10:00
Timothy Arceri
3c9f0096c7 glsl: Improve error message when attemping assignment to unsized array
V2: Return after error to avoid cascading error messages and
removed redundant "to" from error message

Signed-off-by: Timothy Arceri <t_arceri@yahoo.com.au>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-11-23 15:52:27 -08:00
Jordan Justen
bd00c66500 intel: enable GL_AMD_vertex_shader_layer extension for gen7+
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-11-23 10:49:56 -08:00
Marek Olšák
751e8697f2 radeonsi: implement MSAA for CIK
There are also some changes to the printfs.

Reviewed-and-Tested-by: Michel Dänzer <michel.daenzer@amd.com>
2013-11-23 01:54:58 +01:00
Marek Olšák
7b136de79a radeonsi: enable 2D tiling on CIK
libdrm does the DRM version check and decides if 2D tiling is used.

Reviewed-and-Tested-by: Michel Dänzer <michel.daenzer@amd.com>
2013-11-23 01:54:58 +01:00
Marek Olšák
a3969aa125 mesa: initialize gl_renderbuffer::Depth in core
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Tested-by: Ian Romanick <ian.d.romanick@intel.com>
2013-11-23 01:54:57 +01:00
Eric Anholt
46cf80fb36 i965/fs: Make the first pre-allocation heuristic be the post heuristic.
I recently made us try two different things that tried to reduce register
pressure so that we would be more likely to allocate successfully.  But
now that we have the logic for trying two, we can make the first thing we
try be the normal, not-prioritizing-register-pressure heuristic.

This means one less scheduling pass in the common case of that heuristic
not producing spills, plus the best schedule we know how to produce, if
that one happens to succeed.  This is important, because our register
allocation produces a lot of possibly avoidable dependencies for the
post-register-allocation schedule, despite ra_set_allocate_round_robin().

GLB2.7: 1.04127% +/- 0.732461% fps improvement (n=31)
nexuiz: No difference (n=5)
lightsmark: 0.838512% +/- 0.300147% fps improvement (n=86)
minecraft apitrace: No difference (n=15)

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2013-11-22 16:36:27 -08:00
Eric Anholt
09db4940ee mesa: Remove the ralloc canary on release builds.
The canary is basically just to give a better debugging message when you
ralloc_free() something that wasn't rallocated.  Reduces maximum memory
usage of apitrace replay of the dota2 demo by 60MB on my 64-bit system (so
half that on a real 32-bit dota2 environment).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-11-22 16:36:27 -08:00
Eric Anholt
5891f98145 i965: Fix streamed state dumping/annotation after the blorp-flush change.
I think I was thinking of the batch command packet cache when I pasted
this in, but this counter is only used for dumping out streamed state for
INTEL_DEBUG=batch and for putting annotations in our aub files.

Cc: "10.0" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-11-22 16:36:27 -08:00
Chad Versace
315b06ff62 i965: Let driconf clamp_max_samples affect context version
Commit 2f89662 added the driconf option 'clamp_max_samples'.  In that
commit, the option did not alter the context version. The neglect to
alter the context version is a fatal issue for some apps.

For example, consider running Chromium with clamp_max_samples=0.
Pre-patch, Mesa creates a GL 3.0 context but clamps GL_MAX_SAMPLES to
0. This violates the GL 3.0 spec, which requires GL_MAX_SAMPLES >= 4.
The spec violation causes WebGL context creation to fail in many
scenarios because Chromium correctly assumes that a GL 3.0 context
supports at least 4 samples.

Since the driconf option was introduced largely for Chromium, the issue
really needs fixing.

This patch fixes calculation of the context version to respect the
post-clamped value of GL_MAX_SAMPLES. This in turn fixes WebGL on
Chromium when clamp_max_samples=0.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2013-11-22 15:27:03 -08:00
Chad Versace
95ebabbc5f i965: Share code between intel_quantize_num_samples and clamp_max_samples
clamp_max_samples() and intel_quantize_num_samples() each maintained
their own list of which MSAA modes the hardware supports. This patch
removes the duplication by making intel_quantize_num_samples() use the
same list as clamp_max_samples(), the list maintained in
brw_supported_msaa_modes().

By removing the duplication, we prevent the scenario where someone
updates one list but forgets to update the other.

Move function `brw_context.c:static brw_supported_msaa_modes()` to
`intel_screen.c:(non-static) intel_supported_msaa_modes()` and patch
intel_quantize_num_samples() to use the list returned by that function.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2013-11-22 14:56:15 -08:00
Chad Versace
8d1a8d65b5 i965: Terminate brw_supported_msaa_modes() list with -1, not 0
This simplifies the loop logic in a subsqequent patch that refactors
intel_quantize_num_samples() to use brw_supported_msaa_modes().

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2013-11-22 14:56:02 -08:00
Brian Paul
aad2511c6d st/mesa: simplify writemask for emitting fog result
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2013-11-22 09:01:13 -07:00
Brian Paul
73b19be32d mesa: fix indentation in ffvertex_prog.c
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2013-11-22 08:52:09 -07:00
José Fonseca
69049555af tgsi: Prevent emission of instructions with empty writemask.
These degenerate instructions can often be emitted by state trackers
when the semantics of instructions don't match precisely.

Reviewed-by: Brian Paul <brianp@vmware.com>
2013-11-22 15:03:36 +00:00
José Fonseca
4ade77f625 tgsi: Rework calls to ureg_emit_insn().
Mere syntactical change.

Reviewed-by: Brian Paul <brianp@vmware.com>
2013-11-22 15:03:36 +00:00
José Fonseca
68b696e595 docs: Add a section with recommended reading for llvmpipe development.
Several of links the were contributed by Keith Whitwell and Roland Scheidegger.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2013-11-22 15:03:36 +00:00
Roland Scheidegger
f69d2c857d llvmpipe: (trivial) disable new accurate origin calculation
It looks like there's some bugs in it...
2013-11-22 11:29:00 +00:00
Vinson Lee
bb354c6c27 meta: Move declaration before code.
Fixes MSVC build.

meta.c(2411) : error C2143: syntax error : missing ';' before 'type'
meta.c(2411) : error C2143: syntax error : missing ')' before 'type'
meta.c(2411) : error C2065: 'layer' : undeclared identifier
meta.c(2411) : error C2059: syntax error : ')'
meta.c(2411) : error C2143: syntax error : missing ';' before '{'
meta.c(2413) : error C2065: 'layer' : undeclared identifier
meta.c(2415) : error C2065: 'layer' : undeclared identifier

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
2013-11-21 20:29:38 -08:00
Paul Berry
ec79c05cbf mesa: Implement GL_FRAMEBUFFER_ATTACHMENT_LAYERED query.
From section 6.1.18 (Renderbuffer Object Queries) of the GL 3.2 spec,
under the heading "If the value of FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE
is TEXTURE, then":

    If pname is FRAMEBUFFER_ATTACHMENT_LAYERED, then params will
    contain TRUE if an entire level of a three-dimesional texture,
    cube map texture, or one-or two-dimensional array texture is
    attached. Otherwise, params will contain FALSE.

Fixes piglit tests:
- spec/!OpenGL 3.2/layered-rendering/framebuffer-layered-attachments
- spec/!OpenGL 3.2/layered-rendering/framebuffertexture-defaults

Cc: "10.0" <mesa-stable@lists.freedesktop.org>

Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>

v2: Don't include "EXT" in the error message, since this query only
makes sensen in context versions that have adopted
glGetFramebufferAttachmentParameteriv().

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-11-21 18:16:47 -08:00
Paul Berry
af1471dc04 mesa: Fix texture target validation for glFramebufferTexture()
Previously we were using the code path for validating
glFramebufferTextureLayer().  But glFramebufferTexture() allows
additional texture types.

Fixes piglit tests:
- spec/!OpenGL 3.2/layered-rendering/gl-layer-cube-map
- spec/!OpenGL 3.2/layered-rendering/framebuffertexture

Cc: "10.0" <mesa-stable@lists.freedesktop.org>

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>

v2: Clarify comment above framebuffer_texture().

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-11-21 18:16:44 -08:00
Paul Berry
0831523350 i965: Fix fast clear of depth buffers.
From section 4.4.7 (Layered Framebuffers) of the GLSL 3.2 spec:

    When the Clear or ClearBuffer* commands are used to clear a
    layered framebuffer attachment, all layers of the attachment are
    cleared.

This patch fixes the fast depth clear path.

Fixes piglit test "spec/!OpenGL 3.2/layered-rendering/clear-depth".

Cc: "10.0" <mesa-stable@lists.freedesktop.org>

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2013-11-21 18:16:42 -08:00
Paul Berry
c1019670ea i965: Fix blorp clear of layered framebuffers.
From section 4.4.7 (Layered Framebuffers) of the GLSL 3.2 spec:

    When the Clear or ClearBuffer* commands are used to clear a
    layered framebuffer attachment, all layers of the attachment are
    cleared.

This patch fixes the blorp clear path for color buffers.

Fixes piglit test "spec/!OpenGL 3.2/layered-rendering/clear-color".

Cc: "10.0" <mesa-stable@lists.freedesktop.org>

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2013-11-21 18:16:39 -08:00
Paul Berry
1ec5365429 i965: refactor blorp clear code in preparation for layered clears.
Cc: "10.0" <mesa-stable@lists.freedesktop.org>

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2013-11-21 18:16:36 -08:00
Paul Berry
068a073c1d meta: fix meta clear of layered framebuffers
From section 4.4.7 (Layered Framebuffers) of the GLSL 3.2 spec:

    When the Clear or ClearBuffer* commands are used to clear a
    layered framebuffer attachment, all layers of the attachment are
    cleared.

This patch fixes meta clears to properly clear all layers of a layered
framebuffer attachment.  We accomplish this by adding a geometry
shader to the meta clear program which sets gl_Layer to a uniform
value.  When clearing a layered framebuffer, we execute in a loop,
setting the uniform to point to each layer in turn.

Cc: "10.0" <mesa-stable@lists.freedesktop.org>

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2013-11-21 18:16:34 -08:00
Paul Berry
95140740ad mesa: Track number of layers in layered framebuffers.
In order to properly clear layered framebuffers, we need to know how
many layers they have.  The easiest way to do this is to record it in
the gl_framebuffer struct when we check framebuffer completeness.

This patch replaces the gl_framebuffer::Layered boolean with a
gl_framebuffer::NumLayers integer, which is 0 if the framebuffer is
not layered, and equal to the number of layers otherwise.

v2: Remove gl_framebuffer::Layered and make gl_framebuffer::NumLayers
always have a defined value.  Fix factor of 6 error in the number of
layers in a cube map array.

Cc: "10.0" <mesa-stable@lists.freedesktop.org>

Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-11-21 18:16:25 -08:00
Ben Skeggs
085ad4821e nvc0: inform kernel about buffers that screen_create touches
Prevents a GPU page fault if somehow the uniform bo gets evicted
before the screen_create pushbuf has been submitted.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2013-11-22 11:34:43 +10:00
Tom Stellard
1bdb99330a radeonsi/compute: Fix LDS size calculation
We need to include the number of LDS bytes allocated by the state tracker.

CC: "10.0" <mesa-stable@lists.freedesktop.org>
2013-11-21 16:14:58 -08:00
Tom Stellard
7a30cd7085 r600g/compute: Add a work-around for flushing issues on Cayman
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>

https://bugs.freedesktop.org/show_bug.cgi?id=69321

CC: "10.0" <mesa-stable@lists.freedesktop.org>
2013-11-21 15:55:16 -08:00
Paul Berry
544e3129c5 glsl: Fix interstage uniform interface block link error detection.
Previously, we checked for interstage uniform interface block link
errors in validate_interstage_interface_blocks(), which is only called
on pairs of adjacent shader stages.  Therefore, we failed to detect
uniform interface block mismatches between non-adjacent shader stages.

Before the introduction of geometry shaders, this wasn't a problem,
because the only supported shader stages were vertex and fragment
shaders, therefore they were always adjacent.  However, now that we
allow a program to contain vertex, geometry, and fragment shaders,
that is no longer the case.

Fixes piglit test "skip-stage-uniform-block-array-size-mismatch".

Cc: "10.0" <mesa-stable@lists.freedesktop.org>

v2: Rename validate_interstage_interface_blocks() to
validate_interstage_inout_blocks() to reflect the fact that it no
longer validates uniform blocks.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>

v3: Make validate_interstage_inout_blocks() skip uniform blocks.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-11-21 15:05:09 -08:00
Paul Berry
0f4cacbb53 glsl: Fix cross-version linking between VS and GS.
Previously, when attempting to link a vertex shader and a geometry
shader that use different GLSL versions, we would sometimes generate a
link error due to the implicit declaration of gl_PerVertex being
different between the two GLSL versions.

This patch fixes that problem by only requiring interface block
definitions to match when they are explicitly declared.

Fixes piglit test "shaders/version-mixing vs-gs".

Cc: "10.0" <mesa-stable@lists.freedesktop.org>

v2: In the interface_block_definition constructor, move the assignment
to explicitly_declared after the existing if block.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-11-21 15:05:06 -08:00
Paul Berry
2bbcf19aca glsl: Prohibit illegal mixing of redeclarations inside/outside gl_PerVertex.
From section 7.1 (Built-In Language Variables) of the GLSL 4.10
spec:

    Also, if a built-in interface block is redeclared, no member of
    the built-in declaration can be redeclared outside the block
    redeclaration.

We have been regarding this text as a clarification to the behaviour
established for gl_PerVertex by GLSL 1.50, so we apply it regardless
of GLSL version.

This patch enforces the rule by adding an enum to ir_variable to track
how the variable was declared: implicitly, normally, or in an
interface block.

Fixes piglit tests:
- gs-redeclares-pervertex-out-after-global-redeclaration.geom
- vs-redeclares-pervertex-out-after-global-redeclaration.vert
- gs-redeclares-pervertex-out-after-other-global-redeclaration.geom
- vs-redeclares-pervertex-out-after-other-global-redeclaration.vert
- gs-redeclares-pervertex-out-before-global-redeclaration
- vs-redeclares-pervertex-out-before-global-redeclaration

Cc: "10.0" <mesa-stable@lists.freedesktop.org>

v2: Don't set "how_declared" redundantly in builtin_variables.cpp.
Properly clone "how_declared".

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-11-21 15:04:59 -08:00
Kenneth Graunke
7a70f033b5 i965: Enable the AMD_performance_monitor extension on Gen5+.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-11-21 15:01:14 -08:00
Kenneth Graunke
2af1aedeca i965: Take "bookend" OA snapshots at the start/end of each batch.
Unfortunately, our hardware only has one set of aggregating performance
counters shared between all 3D programs, and their values are not saved
or restored by hardware contexts.  Also, at least on Sandybridge and
Ivybridge, the counters lose their values if the GPU goes to sleep.

To work around both of these problems, we have to snapshot the
performance counters at the beginning and end of each batch, similar to
how we handle query objects on platforms that don't support hardware
contexts.  I call these "bookend" snapshots.

Since there can be multiple performance monitors active at a time, we
store the bookend snapshots in a global BO, shared by all monitors.

For monitors that span multiple batches, acquiring results involves
adding up three segments:

   BeginPerfMonitor   --> End of Batch 1    ("head")
   Start of Batch 2   --> End of Batch 2
                      ...                   ("middle")
   Start of Batch N-1 --> End of Batch N-1
   Start of Batch N   --> EndPerfMonitor    ("tail")

Monitors that refer to bookend BO snapshots are considered "unresolved".
We delay resolving them (and adding up deltas to obtain the results) as
long as possible to avoid blocking on mapping monitor->oa_bo.

We can also run out of space in the bookend BO, at which point we have
to resolve all unresolved monitors.  Then we can throw away the
snapshots and begin writing at the beginning of the buffer.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-11-21 15:01:14 -08:00
Kenneth Graunke
1172974ddd i965: Reserve batchbuffer space for a closing MI_REPORT_PERF_COUNT.
In order to use the Observability Architecture effectively, we'll need
to take snapshots of the OA counters via MI_REPORT_PERF_COUNT at the
start and end of each batch.

Experimentation reveals that we need to flush before and after each
MI_REPORT_PERF_COUNT to get working values.  For simplicitly, I chose to
use intel_batchbuffer_emit_mi_flush(), which unfortunately expands to
triple pipe controls on Sandybridge.

We may want to start computing per-generation reserved batch space to
avoid the insanity of Sandybridge's PIPE_CONTROL cost.  That said, much
of this cost existed before I rewrote the query object support to use
hardware contexts, so it's at least not entirely new.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-11-21 15:01:14 -08:00
Kenneth Graunke
fedc14a050 i965: Add some plumbing for gathering OA results.
Currently, this only considers the monitor start and end snapshots.
This is woefully insufficient, but allows me to add a bunch of the
infrastructure now and flesh it out later.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-11-21 15:01:14 -08:00
Kenneth Graunke
c289c70ce1 i965: Start and stop OA counters as necessary.
We need to start OA at the beginning of each batch where monitors are
active.  OACONTROL isn't part of the hardware context, so to avoid
leaving counters enabled for other applications, we turn them off at the
end of the batch too.

We also need to start them at BeginPerfMonitor time (unless they've
already been started).  We stop them when the monitor last ends as well.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-11-21 15:01:14 -08:00
Kenneth Graunke
834c9575b2 i965: Add functions to start and stop the OA counters.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-11-21 15:01:14 -08:00
Kenneth Graunke
367c7c2d7c i965: Add #defines for the OACONTROL register and fields.
We'll need to write this register to start/stop performance counters.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-11-21 15:01:14 -08:00
Kenneth Graunke
901cae07ff i965: Take OA counter snapshots at Begin/EndPerfMonitor time.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-11-21 15:01:14 -08:00
Kenneth Graunke
093ecbfe3b i965: Add a function to emit the MI_REPORT_PERF_COUNT packet.
MI_REPORT_PERF_COUNT writes a snapshot of the Observability Architecture
counters to a buffer.  Exactly how it works varies between generations:
Ironlake requires two packets, Sandybridge has to use GGTT, and Ivybridge
and later use PPGTT.

v2: Assert that we didn't use more space than we reserved (suggested
    by Eric Anholt).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-11-21 15:01:14 -08:00
Kenneth Graunke
b05b1eff1c i965: Track the number of monitors that need OA counters.
Using the OA counters requires some per-batch work.  When starting and
ending a batch, it's useful to know whether any monitors are actually
interested in OA data.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-11-21 15:01:14 -08:00
Kenneth Graunke
7329f8dd10 i965: Enumerate Observability Architecture counters on Gen5+.
In addition to listing the counter names, we include several "remap"
tables.  Confusingly, counters are documented with names like "A23",
are written to some buffer offset other than 23, and exposed by core
Mesa under a counter ID that is different still.

The first is inevitable; MI_REPORT_PERF_COUNT writes certain counters to
fixed locations in the buffer.  The latter could be avoided, but core
Mesa uses the "Counters" array index as the ID for a counter.  We could
do remapping there, but it would just complicate the core Mesa code.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-11-21 15:01:14 -08:00
Kenneth Graunke
9f41585eb5 i965: Expose pipeline statistics registers via performance monitors.
This is fairly simple:
- At BeginPerfMonitor time, take an opening snapshot.
- At EndPerfMonitor time, take a closing snapshot.
- The first time the application asks for results, subtract the two and
  store that value.  Then free the BO containing the snapshots.
- On subsequent requests for the results, just return the saved value.
- On reset, throw away the results.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-11-21 15:01:14 -08:00
Kenneth Graunke
91950d1aea i965: Enumerate the pipeline statistics register counters on Gen6+.
For now, we only support these on Gen6+, since that's what currently
uses hardware contexts.  When we add Ironlake hardware context support,
we can add pipeline statistics register support for that as well.

In theory, we could support pipeline statistics counters even without
hardware contexts, but it would be annoyingly painful.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-11-21 15:01:14 -08:00
Kenneth Graunke
569adb40d7 i965: Initialize performance monitor Groups/NumGroups.
Since we don't support any counters, there are zero groups.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-11-21 15:01:13 -08:00
Kenneth Graunke
7bf3cd4315 i965: Add macros for creating performance monitor counters and groups.
The Observability Architecture counters are 32-bit unsigned values, and
the Pipeline Statistics Register counters are 64-bit unsigned values.

These convenience macros make it easy to create those types of counters.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-11-21 15:01:13 -08:00
Kenneth Graunke
63b8ce612f i965: Periodically dump the list of monitors if INTEL_DEBUG=perfmon.
It's useful to see the state of all outstanding monitors; the start
of a new batch seems like a reasonable time to print them out.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-11-21 15:01:13 -08:00
Kenneth Graunke
379a246fc1 i965: Add basic driver hooks and plumbing for AMD_performance_monitor.
These stub functions will be filled out in later patches.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-11-21 15:01:13 -08:00
Kenneth Graunke
b64eb100b0 i965: Add INTEL_DEBUG=perfmon support.
This will enable debugging printfs for the AMD_performance_monitor code.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-11-21 15:01:13 -08:00
Kenneth Graunke
a4bf7f6b6e i965: Move brw_emit_query_begin() to the render ring prelude.
Without hardware contexts, the pipeline statistics registers are
free-running and include data from every 3D application running.

In order to find out the contributions of one particular context, we
need to take a snapshot at the start and end of each batch.

Previously, we emitted the PIPE_CONTROL necessary to capture
PS_DEPTH_COUNT when drawing primitives.  Special tracking ensured it
happened only on the first draw of the batch, rather than on every draw.

Moving this to brw_new_batch increases symmetry, since the final
snapshot has always been in brw_finish_batch, which is just a few lines
below.  It should be basically equivalent.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-11-21 15:01:13 -08:00
Kenneth Graunke
bb9d2eab89 i965: Introduce a "render ring prelude" hook.
The new intel_batchbuffer_emit_render_ring_prelude() hook will be called
when switching from BLT or UNKNOWN_RING to RENDER_RING.  This provides a
place to emit state that should go at the start of each render ring
batch, with minimal overhead.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-11-21 15:01:13 -08:00
Kenneth Graunke
395a32717d i965: Introduce an UNKNOWN_RING state.
When we first create a batch buffer, it's empty.  We don't actually
know what ring it will be targeted at until the first BEGIN_BATCH or
BEGIN_BATCH_BLT macro.

Previously, one could determine the state of the batch by checking
brw->batch.ring (blit vs. render) and brw->batch.used != 0 (known vs.
unknown).

This should be functionally equivalent, but the tri-state enum is a bit
clearer.

v2: Catch three explicit require_space callers (thanks to Carl and Eric).
v3: Split the boolean -> enum change from the UNKNOWN_RING change.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-11-21 15:01:13 -08:00
Kenneth Graunke
6bc40f9af5 i965: Convert brw->batch.is_blit to a BLT_RING/RENDER_RING enum.
Passing BLT_RING or RENDER_RING to batchbuffer functions is a lot more
obvious than passing true or false.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-11-21 15:01:13 -08:00
Roland Scheidegger
28d7b4147d llvmpipe: calculate more accurate interpolation value at origin
Some rounding errors could crop up when calculating a0. Use a more accurate
method (barycentric interpolation essentially) to fix this, though to fix
the REAL problem (which is that our interpolation will give very bad results
with small triangles far away from the origin when they have steep gradients)
this does absolutely nothing (actually makes it worse). (To fix the real
problem, either would need to use a vertex corner (or some other point inside
the tri) as starting point value instead of fb origin and pass that down to
interpolation, or mimic what hw does, use barycentric interpolation (using
the coordinates extracted from the rasterizer edge functions) - maybe another
time.)
Some (silly) tests though really want a high accuracy at fb origin and don't
care much about anything else (Just. Don't. Ask.).

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2013-11-21 20:39:19 +00:00
Brian Paul
9d1c71e34d svga: remove special-case code for texkil w component
Not actually needed.  Fixes piglit ARB_fragment_program/kil-swizzle test.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2013-11-21 09:08:17 -07:00
José Fonseca
2d5f21ba65 gallium: Make TGSI_SEMANTIC_FOG register four-component wide.
D3D9 Shader Model 2 restricted the fog register to one component,
http://msdn.microsoft.com/en-us/library/windows/desktop/bb172945.aspx ,
but that restriction no longer exists in Shader Model 3, and several
WHCK tests enforce that.

So this change:
- lifts the single-component restriction TGSI_SEMANTIC_FOG
  from Gallium interface
- updates the Mesa state tracker to enforce output fog has (f, 0, 0, 1)
- draw module was updated to leave TGSI_SEMANTIC_FOG output registers
  alone

Several gallium drivers that are going out of their way to clear
TGSI_SEMANTIC_FOG components could be simplified in the future.

Thanks to Si Chen and Michal Krol for identifying the problem.

Testing done: piglit fogcoord-*.vpfp tests

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2013-11-21 14:00:05 +00:00
José Fonseca
edd9efc2fb tgsi_exec: Fix mask calculation for emit_kill_if.
Same as Si Chen's commit e7a5905d8a for
tgsi_exec module.

Not actually tested, because softpipe is failing the test that caught
this bug due to unrelated issues.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2013-11-21 13:56:10 +00:00
José Fonseca
bba8f10598 mesa: Use IROUND instead of roundf.
roundf is not available on MSVC.
2013-11-21 13:56:00 +00:00
Tapani Pälli
7e61b44dcd mesa: enable GL_TEXTURE_LOD_BIAS set/get
Earlier comments suggest this was removed from GL core spec but it is
still there. Enabling makes 'texture_lod_bias_getter' Khronos
conformance tests pass, also removes some errors from Metro Last Light
game which is using this API.

v2: leave NOTE comment (Ian)

Cc: "9.0 9.1 9.2 10.0" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
2013-11-21 12:49:18 +02:00
Christian König
ecb37a6e77 winsys/radeon: cleanup virtual memory nonsense
The alignment of a virtual memory area must always be at least 4096 bytes.

It only worked because size was aligned to 4096 outside of the function.

Signed-off-by: Christian König <christian.koenig@amd.com>
2013-11-21 10:24:20 +01:00
Courtney Goeltzenleuchter
f56f875b8b mesa: Update MESA_INFO to eliminate error
If a user set MESA_INFO and the OpenGL application uses a
3.0 or later context then the MESA_INFO debug output will have
an error when it queries for extensions using the deprecated
enum GL_EXTENSIONS. Passing context argument allows code
to return extension list directly regardless of profile.
Commit title updated as recommended by Kenneth Graunke.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-11-21 00:26:20 -08:00
Kenneth Graunke
36c3faf4bf i965: Disable BLORP on Broadwell for now.
BLORP is essential.  However, porting it to Gen8 is a huge amount of
work.  Disabling it for now allows us to proceed with basic hardware
enablement.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-11-21 00:26:11 -08:00
Kenneth Graunke
01ae16a0e7 i965: Disable HiZ on Broadwell for now.
HiZ is difficult to implement, and while it's essential for performance,
we don't need it right away for purposes of hardware enabling.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-11-21 00:26:11 -08:00
Kenneth Graunke
232140a47a i965: Claim OpenGL 3.3 support on Broadwell.
Bugs aside, basically everything ought to work.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-11-21 00:26:11 -08:00
Kenneth Graunke
b61ff94032 i965: Add device info structs for Broadwell.
As always, the chipset limits here are placeholders, rather than the
actual values.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-11-21 00:26:11 -08:00
Vinson Lee
b7c0b61782 glsl: Use more portable bash invocation construct.
Fixes 'make check' on distros where bash is not at /bin/bash.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Tested-by: Ian Romanick <ian.d.romanick@intel.com>
2013-11-20 22:39:59 -08:00
Vinson Lee
7f56780915 gallivm: Ignore unknown file type in non-debug builds.
Fixes "Uninitialized pointer read" defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2013-11-20 22:35:36 -08:00
Dave Airlie
b01a3a9b72 glx: don't fail out when no configs if we have visuals
GLX 1.2 servers with no SGIX_fbconfigs exist (some citrix thing),
and we fail glxinfo completely in those cases.

CC: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2013-11-21 10:50:48 +10:00
Dave Airlie
a43b49dfb1 mesa/swrast: fix inverted front buffer rendering with old-school swrast
I've no idea when this broke, but we have some people who wanted it fixed,
so here's my attempt.

reproducer, run readpix with swrast hit f, or run trival tri -sb things are
upside down, after this patch they aren't.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=62142
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=66213

Cc: <mesa-stable@lists.freedesktop.org>"
Signed-off-by: Dave Airlie <airlied@redhat.com>
2013-11-21 10:50:17 +10:00
Eric Anholt
81ff29e30c mesa: Fix setup of LocalParams array.
i965 passed piglit, but swrast and gallium both segfaulted without this.
i965 happened to work because it never ran _mesa_load_state_parameters()
on the new program before the test called glProgramLocalParameter(), which
was allocating a LocalParams array for the fallback path.

v2: Since v1 threw away old localparams data, leaked old LocalParams
    memory, only fixed fragment programs, and I was dubious of my previous
    invariants already (nothing but program_parse.y will generate
    LocalParams, and only that one path of program_parse.y will), just
    late-allocate localparams at the other point of dereferencing them.
    This adds overhead to _mesa_load_state_parameter, which is
    uncomfortable, but I'm pretty sure that giant switch statement is
    super slow already.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=71734
Tested-by: Michel Dänzer <michel.daenzer@amd.com>
2013-11-20 16:12:46 -08:00
Matt Turner
5fe49d99f2 i965/test: Use unreachable() to silence warning. 2013-11-20 15:04:53 -08:00
Matt Turner
1f9092958d i965: Link -ldl after libmesa.la
DLOPEN_LIBS is part of DRI_LIB_DEPS.

Cc: "10.0" <mesa-stable@lists.freedesktop.org>"
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=71512
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-11-20 15:04:53 -08:00
Matt Turner
a97cd0f4d7 i965: Add a pass to remove dead control flow.
Removes IF/ENDIF and IF/ELSE/ENDIF with no intervening instructions.

total instructions in shared programs: 1360393 -> 1360387 (-0.00%)
instructions in affected programs:     157 -> 151 (-3.82%)

(no change in vertex shaders)

Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-11-20 15:04:53 -08:00
Matt Turner
b63d6aae55 i965: Make invalidate_live_intervals() a virtual method of backend_visitor.
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-11-20 15:04:53 -08:00
Matt Turner
1c263f8f4f i965/vec4: Add invalidate_live_intervals method.
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-11-20 15:04:53 -08:00
Matt Turner
c4464c9eea i965/fs: Don't emit SIMD16 BFI instructions.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-11-20 15:04:52 -08:00
Matt Turner
9bbedf6146 i965/fs: Emit compressed 3-source instructions on Haswell.
For commit 4df56177 Paul discovered that the hardware restriction that
Align16 instructions cannot be compressed was lifted on Haswell. This
has prevented us from emitting compressed three-source instructions.

For added confirmation, the bspec lists a work around called
WaBreakSimd16TernaryInstructionsIntoSimd8 that hasn't been applicable
since very early Haswell silicon.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-11-20 15:04:52 -08:00
Matt Turner
82bfb45e24 i965: Fix disassembled names of BFI1 and BFI2 instructions.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-11-20 15:04:52 -08:00
Matt Turner
9793fc1335 i965/fs: Use source's original type in register_coalesce().
Previously, register_coalesce() would modify

   mov   vgrf1:f  vgrf2:f
   cmp   null     vgrf3:d  vgrf1:d

to be

   cmp   null     vgrf3:d  vgrf2:f

and incorrectly use vgrf2's type in the instruction that the mov was
coalesced into.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-11-20 15:04:52 -08:00
José Fonseca
060159820c u_gen_mipmap: Use untampered cubemap texture coords when generating mipmaps.
It's not necessary to scale down cubemap texture coords when generating
mipmaps: we are doing a 2x minification therefore it's guaranteed that
the texture coords will always be at least 1 texel away of the edges.

Scaling down can actually be harmful, as it may cause artefacts when
generating mipmaps with nearest filtering.  Sample points will lie
exactly in the middle each 2x2 texels, so the scaling factor was causing
different texels to be take on each quadrant of the cube face.  This is
apparent with a 1x1 checkerboard pattern in the base mipmap level:
instead of next mipmap level receiving a constant color throughout the
face, it will have different colors for each quadrant of the face.

The behaviour for blits is left untouched for now, but the cubemap
texture coord scaling hack should be reconsidered eventually.

Reviewed-by: Brian Paul <brianp@vmware.com>
2013-11-20 07:12:59 +00:00
Brian Paul
15d8e05e1e st/mesa: fix GL_FEEDBACK mode inverted Y coordinate bug
We need to check the drawbuffer's orientation before inverting Y
coordinates.  Fixes piglit feedback tests when running with the
-fbo option.

Cc: "9.2" "10.0" <mesa-stable@lists.freedesktop.org>

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2013-11-19 13:21:35 -07:00
Si Chen
e7a5905d8a gallivm: Fix mask calculation for emit_kill_if.
The exec_mask must be taken in consideration, just like emit_kill above.

The tgsi_exec module has the same bug and should be fixed in a future
change.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2013-11-19 19:16:18 +00:00
Paul Berry
81b998ca48 i965/gen7: Disallow Y tiling of renderable surfaces with valign of 2.
Gen7 does not allow render targets to have a vertical alignment of 2.
So, when creating a surface, if its format is renderable, and its
vertical alignment is 2, force it to use X tiling.

Reviewed-by: Eric Anholt <eric@anholt.net>
2013-11-19 09:48:51 -08:00
Paul Berry
6b40dd17cf i965/gen7: Prefer vertical alignment of 4 when possible.
Gen6+ allows for color buffers to use a vertical alignment of either 4
or 2.  Previously we defaulted to 2.  This may have caused problems on
Gen7 because Y-tiled render targets are not allowed to use a vertical
alignment of 2.

This patch changes the vertical alignment to 4 on Gen7, except for the
few formats where a vertical alignment of 2 is required.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-11-19 09:48:48 -08:00
Paul Berry
60b1a118e1 i965/vec4: Fix broken IR annotation in debug output.
Commit 70953b5 (i965: Initialize all member variables of
vec4_instruction on construction) inadvertently added a line to the
vec4_instruction constructor setting this->ir to NULL, wiping out the
previously set value.  As a result, ever since then, the output of
INTEL_DEBUG=vs and INTEL_DEBUG=gs has been missing IR annotations.

Cc: "10.0" <mesa-stable@lists.freedesktop.org>

Reviewed-by: Eric Anholt <eric@anholt.net>
2013-11-19 09:40:57 -08:00
Brian Paul
92c3d5acf7 svga: improve check for 3D compressed textures
This is basically a a respin of f1dfcf4bce35e6796f873d9a00103b280da81e4c
per Jose's suggestion.

Just set the SVGA3dSurfaceFormatCaps flags for 3D and cube textures
when checking the texture format capabilities.  This will filter out
unsupported combinations like 3D+DXT.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2013-11-19 09:03:41 -07:00
Jon TURNEY
5ab59e5332 glx/tests: Provide __glXGetCurrentContext() stub when needed
Refine 8c533022.  Provide a stub __glXGetCurrentContext() function when
$(DEFINES) are such that it is not a macro.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2013-11-19 15:28:22 +00:00
Brian Paul
21ae5135dd svga: we don't supported 3D compressed textures
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2013-11-18 16:34:02 -07:00
Brian Paul
7eab897d4d st/mesa: pass correct pipe_texture_target to st_choose_format()
We were always passing PIPE_TEXTURE_2D, but not all formats are
supported for all types of textures.  In particular, the driver may
not supported texture compression for all types of textures.

Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2013-11-18 16:34:02 -07:00
Tom Stellard
1b9511d7ce r600g/compute: Fix handling of global buffers in r600_resource_copy_region()
Global buffers do not have an associate cs_buf handle, so
we can't copy them using r600_copy_buffer()

https://bugs.freedesktop.org/show_bug.cgi?id=64226

Reviewed-by: Marek Ol????k <marek.olsak@amd.com>

CC: "10.0" <mesa-stable@lists.freedesktop.org>
2013-11-18 12:28:13 -08:00
Tom Stellard
17930a66aa gallium: Pass version scripts to linker using --version-script=
This fixes build failures with the gold linker.

CC: "10.0" <mesa-stable@lists.freedesktop.org>
2013-11-18 12:19:04 -08:00
Tom Stellard
a84dd2398f clover: Optionally return context's devices from clGetProgramInfo()
The spec allows clGetProgramInfo() to return information about either
the devices associated with the program or the devices associated
with the context.  If there are no devices associated with the program,
then we return devices associated with the context.

https://bugs.freedesktop.org/show_bug.cgi?id=52171

Reviewed-by: Francisco Jerez <currojerez@riseup.net>

CC: "10.0" <mesa-stable@lists.freedesktop.org>
2013-11-18 11:54:28 -08:00
Paul Berry
7dfb4b2d00 i965/gen7: Emit workaround flush when changing GS enable state.
v2: Don't go to extra work to avoid extraneous flushes.  (Previous
experiments in the kernel have suggested that flushing the pipeline
when it is already empty is extremely cheap).

Cc: "10.0" <mesa-stable@lists.freedesktop.org>

Reviewed-by: Eric Anholt <eric@anholt.net>
2013-11-18 10:09:11 -08:00
Brian Paul
d222202193 osmesa: add missing comma 2013-11-18 09:14:48 -07:00
Brian Paul
cadec45c3d osmesa: add support for postprocess filters
Add new OSMesaPostprocess() function to allow using the gallium
postprocessing filters.  This only works for OSMesa with gallium
drivers, not the legacy swrast OSMesa.

Bump OSMESA_MAJOR/MINOR_VERSION numbers to 10.0

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2013-11-18 08:56:35 -07:00
Brian Paul
7cf40c1cb3 postprocess: document the pp_init() function.
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2013-11-18 08:56:34 -07:00
Brian Paul
b7e5678fe5 postprocess: move #defines to filters.h
They're not needed in postprocess.h

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2013-11-18 08:56:34 -07:00
Brian Paul
c27d8cc0c9 postprocess: refactor header files, etc
Move private data structures and function prototypes out of the
public postprocess.h header file.
Create a pp_private.h for the shared, private data structures, functions.
Remove pp_program.h header.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2013-11-18 08:56:34 -07:00
Brian Paul
de2fd7dd0b postprocess: rename program to pp_program
To match the pp_ namespace convention.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2013-11-18 08:56:34 -07:00
Brian Paul
401f2d6ea8 postprocess: simplify pp_free() code
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2013-11-18 08:56:34 -07:00
Emil Velikov
d33d260b90 docs: indicate GLX_MESA_query_renderer's completion
Cc: "10.0" <mesa-stable@lists.freedesktop.org>
Acked-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2013-11-18 15:38:37 +00:00
Emil Velikov
b8a1115132 docs: update nv50, nvc0 current status
Acked-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2013-11-18 15:38:29 +00:00
Joerg Mayer
f9868926ee docs: restructure GL3.txt
- Indent items under a GL version to allow context diffs to do their work.
- Move complete drivers into the GL version line - this should make the
  stuff a little bit easier to read.

v2: keep the fd.o link (Emil Velikov)

Acked-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Joerg Mayer <jmayer@loplof.de>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2013-11-18 15:38:16 +00:00
Emil Velikov
ca9794658e docs: add a note about removed state tracker/targets
The X.Org state tracker is gone, as well as the xvmc/vdpau
r300 and softpipe targets.

Cc: "10.0" <mesa-stable@lists.freedesktop.org>
Acked-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2013-11-18 15:37:39 +00:00
Emil Velikov
0faaed2112 targets/xvmc: export only necessary symbols
Export only XvMC* symbols for the xvmc targets.

Tested-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2013-11-18 15:35:21 +00:00
Emil Velikov
5896100a38 drivers/radeon: remove unused CXXFLAGS, LLVM_CPP_FILES
The above two variables are unused as of commit

  commit 024fe6852a
  Author: Tom Stellard <thomas.stellard@amd.com>
  Date:   Tue Apr 2 10:42:50 2013 -0700

      radeon/llvm: Use LLVM C API for compiling LLVM IR to ISA v2

which removed the only cpp file from drivers/radeon, but missed to
remove the CXXFLAGS. The sequential commit reintroduced and empty
LLVM_CPP_FILES.

Lets cleanup and remove both.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2013-11-18 15:35:21 +00:00
José Fonseca
1e67ee8c9a mesa/main: Move declaration to beginning of scope.
Should fix MSVC build.

Trivial.
2013-11-18 14:43:31 +00:00
Courtney Goeltzenleuchter
2cfbf84dad mesa: Add API debug logging to TexStorage
Give glTexStorage* equivalent debug logging to glTexImage*.

Signed-off-by: Courtney Goeltzenleuchter <courtney@LunarG.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-11-17 19:57:17 -08:00
Tapani Pälli
53f89a436f glsl: cleanup, remove duplicate assignment
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-11-17 18:51:37 -08:00
Kenneth Graunke
d12e0e8972 mesa: Handle !m->Ended for performance monitor result availability.
If a performance monitor has never ended, then no result can be
available.  Core Mesa can easily handle this, saving drivers a tiny bit
of complexity.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-11-17 18:51:07 -08:00
Kenneth Graunke
bde5e4a1e6 mesa: Track whether a performance monitor has ever ended.
If a monitor has ended, it means a result should eventually become
available, pending some flushing.

This is distinct from !m->Active; if a monitor has not been started,
then m->Active == false and m->Ended == false.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-11-17 18:51:07 -08:00
Kenneth Graunke
a6712f5109 mesa: Also initialize gl_performance_monitor::Active.
The i965 implementation uses calloc, so I missed this.  It's best to
simply initialize it to avoid requiring a zeroing allocator, though.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-11-17 18:51:06 -08:00
Kenneth Graunke
145138fb3c mesa: Store the performance monitor object's name.
Being able to print monitor->Name is really useful for debugging.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-11-17 18:51:06 -08:00
Chris Forbes
45a56ce399 mesa: bump version to 10.1 (devel)
Now that branch 10.0 is created, bump the minor version in
master.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-11-17 20:31:49 +13:00
Chris Forbes
61143b87c1 i965: Fix broken asserts
These would never fire.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-11-17 18:56:57 +13:00
Chris Forbes
0741997ff0 st/vega: Fix broken assert
This would never fire.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-11-17 18:56:55 +13:00
Chris Forbes
6f7c693a85 r600/sb: Fix broken assert
This would never fire.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-11-17 18:56:40 +13:00
Vadim Girlin
4cb04aa0df r600g/sb: work around hw issues with stack on eg/cm
v2: make it actually work, improve condition

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=68503
Cc: "10.0" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2013-11-17 01:36:28 +04:00
Kenneth Graunke
04856ceb5c i965: Make swizzle_to_scs non-static.
We'll need this for Broadwell code as well.

Normally, when we make things public, we add the "brw" prefix.  I'm not
crazy about that in this case, since it deals with prog_instruction.h's
SWIZZLE_XYZW values, rather than the BRW_SWIZZLE_XYZW enums.  However,
I can't think of a better name, and at least the comments and code make
it clear.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Acked-by: Anuj Phogat <anuj.phogat@gmail.com>
2013-11-16 09:12:58 -08:00
Kenneth Graunke
717241bf4a i965: Move enum brw_urb_write_flags from brw_eu.h to brw_defines.h.
Broadwell code should not include brw_eu.h (since it is for Gen4-7
assembly encoding), but needs the URB write flags enum.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Acked-by: Anuj Phogat <anuj.phogat@gmail.com>
2013-11-16 09:12:58 -08:00
Kenneth Graunke
ec8cc65926 i965/fs: Remove force_sechalf stack
Only Gen4 color write setup uses the force_sechalf flag, and it only
sets it on a single instruction.  It also already has to get a pointer
to the instruction and manually set the saturate flag, so we may as well
just set force_sechalf the same way and avoid the complexity of a stack.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Acked-by: Anuj Phogat <anuj.phogat@gmail.com>
2013-11-16 09:12:57 -08:00
Emil Velikov
02fdb5cb51 targets/dri: move linker flags out of configure into Automake.inc
Previous assumption was that the same set of flags can be reused
for both classic and gallium drivers. With megadriver work done
the classic drivers ended up using their own (single) instance of
the flags.

Move these into Automake.inc and rename to indicate that those
are gallium specific. Additionally silence an automake/autoconf
warning "XXX is not a standard libtool library name", due to
the parsing issues of the module tag.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2013-11-16 16:31:04 +00:00
Emil Velikov
5b8c2c8f00 targets/dri: compact compiler flags into Automake.inc
Greatly reduce duplication and provide a sane minimum of
CFLAGS for all DRI targets.

Note: This commit adds VISIBILITY_CFLAGS to the following:
* freedreno
* i915
* ilo
* nouveau
* vmwgfx

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2013-11-16 16:31:04 +00:00
Emil Velikov
38e0b7eeaa targets/xvmc: do not link against libtrace.la
In order to use the trace driver, one needs to define
GALLIUM_TRACE. Neither one of the two targets was
defining it, thus we're safe to remove libtrace.la.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2013-11-16 16:31:04 +00:00
Emil Velikov
dfcdece7c5 targets/xvmc: consolidate lib deps into Automake.inc
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2013-11-16 16:31:04 +00:00
Emil Velikov
bfda1460b1 targets/xvmc: move linker flags to Automake.inc
Minimise duplication and sources of error
(eg nouveau was missing shared and no-undefined)

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2013-11-16 16:31:03 +00:00
Emil Velikov
5d7d120af1 targets/xvmc: use drop duplicated compiler flags
Automake.inc already has GALLIUM_VIDEO_CFLAGS, which
provide the essential compiler flags needed.

Note: this commit adds VISIBILITY_CFLAGS to nouveau.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2013-11-16 16:31:03 +00:00
Emil Velikov
f7ac1d5989 gallium/winsys: compact compiler flags into Automake.inc
Cleanup the duplicating flags and consolidate into a sigle variable.

Note: this patch adds VISIBILITY_CFLAGS to the following targets
* freedreno/drm
* i915/{drm,sw}
* nouveau/drm
* sw/fbdev
* sw/null
* sw/wayland
* sw/wrapper
* sw/xlib

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2013-11-16 16:31:03 +00:00
Emil Velikov
096b988360 targets/vdpau: drop unused libraries from linker
In order for one to use trace, noop, rbug and/or galahad, they must
set the corresponding GALLIUM_* CFLAG.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2013-11-16 16:31:03 +00:00
Emil Velikov
3f920a91f3 targets/vdpau: consolidate lib deps into Automake.inc
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2013-11-16 16:31:03 +00:00
Emil Velikov
5f0df8ab22 targets/vdpau: move linker flags to Automake.inc
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2013-11-16 16:31:02 +00:00
Emil Velikov
23588a9c04 targets/vdpau: compact compiler flags into Automake.inc
Store the compiler flags into a variable, in order to minimise
flags duplication (amongst vdpau and xvmc).

Note: this commit add VISIBILITY_CFLAGS to the nouveau target

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2013-11-16 16:31:02 +00:00
Emil Velikov
7dac1b470a gallium/drivers: compact compiler flags into Automake.inc
* minimise flags duplication
* distingush between VISIBILITY C and CXX flags
* set only required flags - C and/or CXX

v2: add LLVM_CFLAGS back to AM_CFLAGS (add missing backslash)

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2013-11-16 16:29:28 +00:00
Emil Velikov
ad501a535a targets/radeonsi: move drm_target.c to a common folder
... and symlink to each target.
Make automake's subdir-objects work for radeonsi.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2013-11-16 14:02:52 +00:00
Emil Velikov
23cdf8de32 targets/r600: move drm_target.c to common folder
... and symlink for each target.
Make automake's subdir-objects work for r600.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2013-11-16 14:02:52 +00:00
Emil Velikov
a9a3029541 targets/r300: move drm_target.c to common folder
... and symlink for each target.
Make automake's subdir-objects work for r300.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2013-11-16 14:02:52 +00:00
Emil Velikov
589e0b2305 gallium/drivers: enable automake subdir-objects
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2013-11-16 14:02:51 +00:00
Emil Velikov
d5e79a9d2b r300: move the final sources list to Makefile.sources
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2013-11-16 14:02:47 +00:00
Emil Velikov
2c1bb79213 r300: add symlink to ralloc.c and register_allocate.c
Make automake's subdir-objects work.
Update includes.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2013-11-16 14:02:15 +00:00
Emil Velikov
b3c60ff5d0 st/xvmc: enable automake subdir-objects
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2013-11-16 14:02:15 +00:00
Emil Velikov
01d35eb372 dri/common: move source file lists to Makefile.sources
* Allow the lists to be shared among build systems.
* Update automake and Android build systems.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-11-16 14:02:15 +00:00
Emil Velikov
b51b3fc537 gtest: enable subdir-objects to prevent automake warnings
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2013-11-16 14:01:27 +00:00
Emil Velikov
b5773ee043 gbm: enable subdir-objects to prevent automake warnings
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2013-11-16 14:00:16 +00:00
Emil Velikov
0b57da0211 scons: move SConscript from gallium/targets/ to mesa/drivers/dri/common/
Store scons side by side with the other build systems.

v2: cleanup after a failed rebase

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2013-11-16 14:00:16 +00:00
Johannes Obermayr
595bd01eb1 freedreno: compact a2xx and a3xx makefiles into parent ones
Nearly everything within the three Makefile.am's is identical.
Let's simplify things a little.

v2: Rebase and rewrite the commit message (Emil Velikov)

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2013-11-16 14:00:16 +00:00
Emil Velikov
c5062726f1 scons: drop obsolete enabled_apis variable
The variable was forgotten during the FEATURE_* removal.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2013-11-16 14:00:15 +00:00
Emil Velikov
1aeafcb7c5 Android: remove unused MESA_ENABLED_APIS variable
The variable was forgotten during the FEATURE_* removal.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2013-11-16 14:00:15 +00:00
Emil Velikov
9560d34fcf st/egl: use *_FILE over *_SOURCES names for filelists
Silence automake warnings about missing program/library whenever
the _SOURCES suffix is used for temporary variable names.

  warning: variable 'gdi_SOURCES' is defined but no program or
  library has 'gdi' as canonical name (possible typo)

Acked-by: Matt Turner <mattst88@gmail.com>
Reported-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reported-by: Johannes Obermayr <johannesobermayr@gmx.de>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=70581
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2013-11-16 13:53:31 +00:00
Matt Turner
e133c0103d i965: Assert that IF with cmod is Gen6 only.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-11-15 23:31:42 -08:00
Vinson Lee
b570c4229f i965: Add missing break in SHADER_OPCODE_GEN7_SCRATCH_READ case.
Fixes "Missing break in switch" defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Cc: "10.0" <mesa-stable@lists.freedesktop.org>
2013-11-15 18:29:34 -08:00
Eric Anholt
e5885c119d mesa: Dynamically allocate the storage for program local parameters.
The array was 64kb per struct gl_program, plus we statically stored a copy
of one on disk for _mesa_DummyProgram.  Given that most struct gl_programs
we generate are for GLSL shaders that don't have local parameters, this
was a waste.

Since you can store and fetch parameters beyond what the program actually
uses, we do have to do a late allocation if necessary at
GetProgramLocalParameter time.

Reduces peak memory usage in the dota2 trace I made by 76MB (4.5%)

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-11-15 11:35:01 -08:00
Eric Anholt
bb1f096975 mesa: Remove PROGRAM_ENV_PARAM enum.
This has been replaced with referring to env parameters using
PROGRAM_STATE_VAR and _mesa_load_state_parameters.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-11-15 11:34:59 -08:00
Eric Anholt
33b0455211 mesa: Remove PROGRAM_LOCAL_PARAM enum.
This has been replaced with referring to local parameters using
PROGRAM_STATE_VAR and _mesa_load_state_parameters.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-11-15 11:34:57 -08:00
Eric Anholt
fddc17ab36 mesa: Update a comment about valid values of a field.
Notably, ENV and LOCAL aren't used any more (replaced by STATE_VAR), but
apparently CONSTANT is.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-11-15 11:34:49 -08:00
Eric Anholt
aa6d7bc6d6 glsl: Apply the transformation "1/rsq(x) == sqrt(x)" in opt_algebraic.
The comment was stale, because the lowering in question wasn't happening
in lower_instructions.cpp.  Presumably if the lowering ever moves there,
we can plumb the lowering mask through to opt_algebraic.

total instructions in shared programs: 1618696 -> 1616810 (-0.12%)
instructions in affected programs:     243018 -> 241132 (-0.78%)
GAINED:                                0
LOST:                                  0

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2013-11-15 11:33:07 -08:00
Eric Anholt
477f8cd08b glsl: Apply the transformation "(a ^^ a) -> false" in opt_algebraic.
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2013-11-15 11:33:07 -08:00
Eric Anholt
58a98d32e4 glsl: Apply the transformation "(a && a) -> a" in opt_algebraic.
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2013-11-15 11:33:07 -08:00
Eric Anholt
ee27048262 glsl: Apply the transformation "(a || a) -> a" in opt_algebraic.
total instructions in shared programs: 1732385 -> 1732373 (-0.00%)
instructions in affected programs:     416 -> 404 (-2.88%)
GAINED:                                0
LOST:                                  0

(That's 4 already-short fragment shaders in dota2)

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2013-11-15 11:33:07 -08:00
Eric Anholt
8957c6b887 glsl: Move the CSE equality functions to the ir class.
I want to reuse them in opt_algebraic.

v2: Merge in Chris Forbes's break fix.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2013-11-15 11:33:07 -08:00
Matt Turner
fc51e7ac58 clover: Remove dead file from Makefile.sources.
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2013-11-15 11:10:32 -08:00
Kenneth Graunke
4ec982ad01 i965: Rework brw_new_batch to actually start a new batch.
Previously, brw_new_batch was called just after execbuf, but before
intel_batchbuffer_reset.  Essentially, it prepared for the creation of a
new batch, that wasn't yet available, and which it didn't create.  This
was a bit awkward.

This patch makes brw_new_batch call intel_batchbuffer_reset as the very
first operation.  This means that brw_new_batch actually creates a new
batchbuffer, and thus has it available.  It brings the creation of the
new batchbuffer and BRW_NEW_BATCH flagging together into one place.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-11-15 10:24:07 -08:00
Kenneth Graunke
720d935fff i965: Move cache_used_by_gpu flag setting to brw_finish_batch.
It really makes more sense here.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-11-15 10:24:07 -08:00
Ian Romanick
96a3527a63 i915: Actually enable __DRI2rendererQueryExtensionRec
More rebase fail.  This code was written long before i915 and i965 were
split, so most of the code in i9[16]5/intel_screen.c only needed to
exist in one place.  It looks like I fixed n-1 of those places after
rebasing on the split.

I only found this from the defined-but-not-used warning for
intelRendererQueryExtension.  I noticed this while fixing the other,
related warnings.

(Note: During review, we decided to *not* pick this back to 10.0.)

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Cc: Daniel Vetter <daniel@ffwll.ch>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Paul Berry <stereotype441@gmail.com>
2013-11-15 10:10:29 -08:00
Aaron Watry
2be85e2492 radeon/llvm: Free elf_buffer after use
Prevents a memory leak.

v2: Remove null check

CC: "10.0" <mesa-stable@lists.freedesktop.org>
2013-11-15 09:53:31 -08:00
Aaron Watry
01f3622c74 r600/llvm: Free binary.code/binary.config in r600_llvm_compile
radeon_llvm_compile allocates memory for binary.code, binary.config,
or neither depending on what's being done.

We need to make sure to free that memory after it's no longer needed.

v2: Don't bother checking for null before FREE()

CC: "10.0" <mesa-stable@lists.freedesktop.org>
2013-11-15 09:53:31 -08:00
Aaron Watry
dd73b99420 r600/llvm: initialize radeon_llvm_binary
use memset to initialize to 0's... otherwise code_size and config_size
could be uninitialized when read later in this method.

It's also hard to do NULL checks on uninitialized pointers.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>

v2: Fix indentation

CC: "10.0" <mesa-stable@lists.freedesktop.org>
2013-11-15 09:53:31 -08:00
Brian Paul
2bc1680665 svga: remove unused vars in svga_hwtnl_simple_draw_range_elements()
And simplify the code.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2013-11-15 10:27:01 -07:00
Brian Paul
1a36dfb21e svga: print warning for unsupported indirect dest reg indexing
For DX9-level shaders, there's only limited support for indirect
indexing of registers (with the loop counter register, not the
general address register.)

Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2013-11-15 10:23:49 -07:00
Brian Paul
3969330b47 svga: mark dest image as defined in svga_surface_copy()
After we blit/copy to a dest texture image we need to mark it as
being defined.  This fixes broken mipmap generation for quite a
few texture formats.  Mipgen involves making texture views and
svga_texture_view_surface() skips texture images that are undefined.

Cc: "10.0" <mesa-stable@lists.freedesktop.org>

Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2013-11-15 10:23:48 -07:00
Brian Paul
79984b9928 svga: do primitive trimming in translate_indices()
The index translation code expects the number of indexes to be
consistent with the primitive type (ex: a multiple of 3 for
PIPE_PRIM_TRIANGLES).  If it's not, we can write out of bounds
in the destination buffer.

Fixes failed assertions in the pipebuffer debug code found with
Piglit primitive-restart-draw-mode test.

Cc: "10.0" <mesa-stable@lists.freedesktop.org>

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2013-11-15 10:23:48 -07:00
Brian Paul
491d6397fc indices: add comments, assertions in u_indices.c file
Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2013-11-15 10:23:48 -07:00
Brian Paul
2253fed4a0 mesa: remove duplicated prototypes in varray.h 2013-11-15 10:23:48 -07:00
Aaron Watry
598f61ba28 gallium/pipe_loader: un-reference udev resources when we're done with them.
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>

CC: "10.0" <mesa-stable@lists.freedesktop.org>
2013-11-15 09:16:49 -08:00
Aaron Watry
4c6ac9e614 radeonsi/compute: Dispose of LLVM module after compiling kernels
v2: Fix indentation

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>

CC: "10.0" <mesa-stable@lists.freedesktop.org>
2013-11-15 09:16:49 -08:00
Aaron Watry
35dad4a1e2 radeonsi/compute: Free program and program.kernels on shutdown
v2: Fix indentation

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>

CC: "10.0" <mesa-stable@lists.freedesktop.org>
2013-11-15 09:16:49 -08:00
Aaron Watry
d41b10f811 radeon/llvm: Free created llvm memory buffer
v2: Fix indentation

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>

CC: "10.0" <mesa-stable@lists.freedesktop.org>
2013-11-15 09:16:49 -08:00
Aaron Watry
a2b93da84b radeon/llvm: Free libelf resources
v2: Fix indentation

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>

CC: "10.0" <mesa-stable@lists.freedesktop.org>
2013-11-15 09:16:49 -08:00
Aaron Watry
df482fe02f radeon/llvm: fix spelling error
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>

CC: "10.0" <mesa-stable@lists.freedesktop.org>
2013-11-15 09:16:49 -08:00
Tom Stellard
17af4dd52b clover: Support multiple devices in clCreateContextFromType() v2
v2:
  - Use clGetDeviceIDs to query devices.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>

CC: "10.0" <mesa-stable@lists.freedesktop.org>
2013-11-15 09:16:48 -08:00
Paul Berry
f38ac41ed4 glsl: Rework interface block linking.
Previously, when doing intrastage and interstage interface block
linking, we only checked the interface type; this prevented us from
catching some link errors.

We now check the following additional constraints:

- For intrastage linking, the presence/absence of interface names must
  match.

- For shader ins/outs, the interface names themselves must match when
  doing intrastage linking (note: it's not clear from the spec whether
  this is necessary, but Mesa's implementation currently relies on
  it).

- Array vs. nonarray must be consistent, taking into account the
  special rules for vertex-geometry linkage.

- Array sizes must be consistent (exception: during intrastage
  linking, an unsized array matches a sized array).

Note: validate_interstage_interface_blocks currently handles both
uniforms and in/out variables.  As a result, if all three shader types
are present (VS, GS, and FS), and a uniform interface block is
mentioned in the VS and FS but not the GS, it won't be validated.  I
plan to address this in later patches.

Fixes the following piglit tests in spec/glsl-1.50/linker:
- interface-blocks-vs-fs-array-size-mismatch
- interface-vs-array-to-fs-unnamed
- interface-vs-unnamed-to-fs-array
- intrastage-interface-unnamed-array

v2: Simplify logic in intrastage_match() for handling array sizes.
Make extra_array_level const.  Use an unnamed temporary
interface_block_definition in validate_interstage_interface_blocks()'s
first call to definitions->store().

Cc: "10.0" <mesa-stable@lists.freedesktop.org>

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2013-11-15 08:56:28 -08:00
Paul Berry
b4c3b833ec i965: Fix vertical alignment for multisampled buffers.
From the Sandy Bridge PRM, Vol 1 Part 1 7.18.3.4 (Alignment Unit
Size):

    j [vertical alignment] = 4 for any render target surface is
    multisampled (4x)

From the Ivy Bridge PRM, Vol 4 Part 1 2.12.2.1 (SURFACE_STATE for most
messages), under the "Surface Vertical Alignment" heading:

    This field is intended to be set to VALIGN_4 if the surface was
    rendered as a depth buffer, for a multisampled (4x) render target,
    or for a multisampled (8x) render target, since these surfaces
    support only alignment of 4.

Back in 2012 when we added multisampling support to the i965 driver,
we forgot to update the logic for computing the vertical alignment, so
we were often using a vertical alignment of 2 for multisampled
buffers, leading to subtle rendering errors.

Note that the specs also require a vertical alignment of 4 for all
Y-tiled render target surfaces; I plan to address that in a separate
patch.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=53077
Cc: mesa-stable@lists.freedesktop.org

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-11-15 08:54:15 -08:00
Paul Berry
46e9f78efc main: Fix MaxUniformComponents for geometry shaders.
For both vertex and fragment shaders we default MaxUniformComponents
to 4 * MAX_UNIFORMS.  It makes sense to do this for geometry shaders
too; if back-ends have different limits they can override them as
necessary.

Fixes piglit test:
spec/glsl-1.50/built-in constants/gl_MaxGeometryUniformComponents

Cc: "10.0" <mesa-stable@lists.freedesktop.org>

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2013-11-15 08:47:41 -08:00
José Fonseca
420ccf7b8f tools/trace: Several bugfixes/improvements to dump_state.py
- Don't crash with user memory pointers.

- Support old bind_*_sampler_* methods.  Useful when comparing dumps
  from old branches.

- Misc.
2013-11-15 15:42:02 +00:00
José Fonseca
c5a05a6aef trace: Dump user_buffer members. 2013-11-15 15:32:33 +00:00
Fredrik Höglund
ff353c218a mesa: Fix derived vertex state not being updated in glCallList()
AEcontext::NewState is not always set when the vertex array state
is changed.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=71492
Cc: "10.0" <mesa-stable@lists.freedesktop.org>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-11-15 15:23:23 +00:00
Alex Deucher
469b42ee21 radeonsi: add Hawaii pci ids
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-11-15 08:51:20 -05:00
Alex Deucher
f5778f152b radeonsi: add support for Hawaii asics (v2)
Update additional register fields.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-11-15 08:51:09 -05:00
Vinson Lee
78fc159d68 i965: Initialize schedule_node::delay.
Fixes "Uninitialized scalar field" defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-11-14 22:36:26 -08:00
Alexander von Gluck IV
f7ce1d772d haiku/swrast: Inherit gl_config, fix flush
* Inherit gl_context so we always have access to it
* Thanks curro for the idea.
* Last Haiku cannidate for 10.0.0

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2013-11-14 12:33:03 -06:00
Roland Scheidegger
473cb3fe4a llvmpipe: (trivial) fix more fallout from the setup cleanup.
Oops... Should have done some more testing.
2013-11-14 15:49:42 +00:00
Roland Scheidegger
5190c16a04 llvmpipe: (trivial) fix misplaced bld context assignment.
Should fix polygon offset crashes...
2013-11-14 14:44:15 +00:00
José Fonseca
a29e40a423 gallivm: Compile flag to debug TGSI execution through printfs.
It is similar to tgsi_exec.c's DEBUG_EXECUTION compile flag.

I had prototyped this for a while while debugging an issue, but finally
cleaned this up and added a few more bells and whistles.

v2: Use '$' as marker; better output. Thanks to Brian, Zack and Roland
reviews.

Here is a sample output.

    CONST[0].x =  0.00625000009 0.00625000009 0.00625000009 0.00625000009
    CONST[0].y =  -0.00714285718 -0.00714285718 -0.00714285718 -0.00714285718
    CONST[0].z =  -1 -1 -1 -1
    CONST[0].w =  1 1 1 1
    IN[0].x =  143.5 175.5 175.5 143.5
    IN[0].y =  123.5 123.5 155.5 155.5
    IN[0].z =  0 0 0 0
    IN[0].w =  1 1 1 1
$   1: RCP TEMP[0].w, IN[0].wwww
    TEMP[0].w =  1 1 1 1
$   2: MAD TEMP[0].xy, IN[0], CONST[0], CONST[0].zwzw
    TEMP[0].x =  -0.103124976 0.0968750715 0.0968750715 -0.103124976
    TEMP[0].y =  0.117857158 0.117857158 -0.110714316 -0.110714316
$   3: MUL OUT[0].xy, TEMP[0], TEMP[0].wwww
    OUT[0].x =  -0.103124976 0.0968750715 0.0968750715 -0.103124976
    OUT[0].y =  0.117857158 0.117857158 -0.110714316 -0.110714316
$   4: MUL OUT[0].z, IN[0].zzzz, TEMP[0].wwww
    OUT[0].z =  0 0 0 0
$   5: MOV OUT[0].w, TEMP[0]
    OUT[0].w =  1 1 1 1
$   6: END
    OUT[0].x =  -0.103124976 0.0968750715 0.0968750715 -0.103124976
    OUT[0].y =  0.117857158 0.117857158 -0.110714316 -0.110714316
    OUT[0].z =  0 0 0 0
    OUT[0].w =  1 1 1 1
2013-11-14 14:04:28 +00:00
Roland Scheidegger
673d5391a2 softpipe: (trivial) fix debug code
The debug printfs wouldn't actually compile when enabled, so kill them off
and insert some new one in another place, and make sure it keeps compiling
by enclosing it in a if-0 clause.
2013-11-14 12:24:55 +00:00
Roland Scheidegger
2dd693412a llvmpipe: clean up state setup code a bit
In particular get rid of home-grown vector helpers which didn't add much.
And while here fix formatting a bit. No functional change.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2013-11-14 12:24:55 +00:00
Roland Scheidegger
754319490f gallivm,llvmpipe: fix float->srgb conversion to handle NaNs
d3d10 requires us to convert NaNs to zero for any float->int conversion.
We don't really do that but mostly seems to work. In particular I suspect the
very common float->unorm8 path only really passes because it relies on sse2
pack intrinsics which just happen to work by luck for NaNs (float->int
conversion in hw gives integer indeterminate value, which just happens to be
-0x80000000 hence gets converted to zero in the end after pack intrinsics).
However, float->srgb didn't get so lucky, because we need to clamp before
blending and clamping resulted in NaN behavior being undefined (and actually
got converted to 1.0 by clamping with sse2). Fix this by using a zero/one clamp
with defined nan behavior as we can handle the NaN for free this way.
I suspect there's more bugs lurking in this area (e.g. converting floats to
snorm) as we don't really use defined NaN behavior everywhere but this seems
to be good enough.
While here respecify nan behavior modes a bit, in particular the return_second
mode didn't really do what we wanted. From the caller's perspective, we really
wanted to say we need the non-nan result, but we already know the second arg
isn't a NaN. So we use this now instead, which means that cpu architectures
which actually implement min/max by always returning non-nan (that is adhering
to ieee754-2008 rules) don't need to bend over backwards for nothing.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2013-11-14 12:24:55 +00:00
Ian Romanick
a15a19f0d1 dri: Change value param to unsigned
This silences some compiler warnings in i915 and i965.  See also
75982a5.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: "10.0" <mesa-stable@lists.freedesktop.org>
2013-11-13 14:49:27 -08:00
Ian Romanick
cb6182bdfa i965: Use drm_intel_get_aperture_sizes instead of hard-coded 2GiB
Systems with little physical memory installed will report less than
2GiB, and some systems may (hypothetically?) have a larger address space
for the GPU.  My IVB still reports 1534.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: "10.0" <mesa-stable@lists.freedesktop.org>
2013-11-13 14:49:27 -08:00
Ian Romanick
9fe108db09 i915: Use drm_intel_get_aperture_sizes instead of drmAgpSize
Send the zombie back to the grave before it infects the townsfolk.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: "10.0" <mesa-stable@lists.freedesktop.org>
2013-11-13 14:49:26 -08:00
Alexander Monakov
279e8d2641 i965: implement blit path for PBO glDrawPixels
This patch implements accelerated path for glDrawPixels from a PBO in
i965. The code follows what intel_pixel_read, intel_pixel_copy,
intel_pixel_bitmap and intel_tex_image are doing. Piglit quick.tests
show no regressions. In my testing on IVB, performance improvement is
huge (about 30x, didn't measure exactly) since generic path goes via
_mesa_unpack_color_span_float, memcpy, extract_float_rgba.

Signed-off-by: Alexander Monakov <amonakov@ispras.ru>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-11-13 12:20:59 -08:00
Brian Paul
19c2f40649 docs: fill in md5 checksums for 9.2.3 release 2013-11-13 10:06:23 -07:00
Brian Paul
c093cd3984 docs: fix 9.2.2 -> 9.2.3 typos 2013-11-13 10:03:35 -07:00
Alexander von Gluck IV
df91144a6d haiku: add swrast driver
* This is pretty small and upkeep should be minimal.
* Currently fully working.
* Cannidate for 10.0.0 branch

Acked-by: Brian Paul <brianp@vmware.com>
2013-11-13 10:41:10 -06:00
Carl Worth
9976a176ae docs: Import 9.2.3 release notes, add news item. 2013-11-13 07:32:47 -08:00
Kristian Høgsberg
e048953145 dri: Remove redundant createNewContext function from __DRIimageDriverExtension
createContextAttribs is a superset of what createNewContext provides.
Also remove the function typedef, since createNewContext is deprecated
and no longer used in  multiple interfaces.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
Cc: "10.0" <mesa-stable@lists.freedesktop.org>
2013-11-12 16:08:17 -08:00
Kristian Høgsberg
68bb26bead wayland: Use __DRIimage based getBuffers implementation when available
This lets us allocate color buffers as __DRIimages and pass them into
the driver instead of having to create a __DRIbuffer with the flink
that requires.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Cc: "10.0" <mesa-stable@lists.freedesktop.org>
2013-11-12 16:08:17 -08:00
Kristian Høgsberg
04e3ef00db gbm: Add support for __DRIimage based getBuffers when available
This lets us allocate color buffers as __DRIimages and pass them into
the driver instead of having to create a __DRIbuffer with the flink
that requires.

With this patch, we can now run gbm on render-nodes.  A render-node is a
drm device that doesn't support modesetting and all the legacy DRI ioctls.
flink is also not supported, but now that gbm doesn't need flink, we can
run piglit on head-less gbm or head-less GPGPU.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Tested-by: Jordan Justen <jordan.l.justen@intel.com>
Cc: "10.0" <mesa-stable@lists.freedesktop.org>
2013-11-12 16:01:40 -08:00
Ander Conselvan de Oliveira
5ba6be2617 dri/i915, dri/i965: Fix support for planar images
Planar images have format __DRI_IMAGE_FORMAT_NONE, but the patch that
moved the conversion from dri_format to the mesa format made it
impossible to allocate a image with that format.

Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
Cc: "10.0" <mesa-stable@lists.freedesktop.org>
2013-11-12 15:57:39 -08:00
Eric Anholt
e9daead784 i965/fs: Try a different pre-scheduling heuristic if the first spills.
Since LIFO fails on some shaders in one particular way, and non-LIFO
systematically fails in another way on different kinds of shaders, try
them both, and pick whichever one successfully register allocates first.
Slightly prefer non-LIFO in case we produce extra dependencies in register
allocation, since it should start out with fewer stalls than LIFO.

This is madness, but I haven't come up with another way to get unigine
tropics to not spill while keeping other programs from not spilling and
retaining the non-unigine performance wins from texture-grf.

total instructions in shared programs: 1626728 -> 1626288 (-0.03%)
instructions in affected programs:     1015 -> 575 (-43.35%)
GAINED:                                50
LOST:                                  0

Improves Unigine Tropics performance by 14.5257% +/- 0.241838% (n=38)

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=70445
Cc: "10.0" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2013-11-12 15:06:28 -08:00
Eric Anholt
fbd8303a94 i965/fs: Do instruction pre-scheduling just before register allocation.
Long ago, the HW_REG usage in assign_curb/urb_setup() were scheduling
barriers, so we had to run scheduler before them in order for it to be
able to do basically anything.  Now that that's fixed, we can delay the
scheduling until we go to allocate (which will make the next change less
scary).

Cc: "10.0" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2013-11-12 15:06:21 -08:00
Eric Anholt
f72a0d99fe i965/fs: Ignore actual latency pre-reg-alloc.
We care about depth-until-program-end, as a proxy for "make sure I
schedule those early instructions that open up the other things that can
make progress while keeping register pressure low", not actual latency
(since we're relying on the post-register-alloc scheduling to actually
schedule for the hardware).

total instructions in shared programs: 1609931 -> 1609931 (0.00%)
instructions in affected programs:     0 -> 0
GAINED:                                55
LOST:                                  43

Cc: "10.0" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2013-11-12 15:06:00 -08:00
Eric Anholt
7c90947a0b i965/fs: Fix message setup for SIMD8 spills.
In the SIMD16 spilling changes, I replaced a "1" in the spill path with
"mlen", but obviously it wasn't mlen before because spills have the g0
header along with the payload. The interface I was trying to use was
asking for how many physical regs we're writing, so we're looking for "1"
or "2".

I'm guessing this actually passed piglit because the high 8 bits of the
execution mask in SIMD8 mode are all 0s.

Cc: "10.0" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-11-12 15:05:07 -08:00
Eric Anholt
bc0e3bb4d0 i965/fs: Prefer things we know reduce reg pressure when pre-scheduling.
Previously, the best thing we had was to schedule the things unblocked by
the last chosen instruction, on the hope that it would be consuming two
values at the end of their live intervals while only producing one new
value.  But that's just a guess, and we can do counting of usage of
registers to know when an instruction would (almost surely) reduce
register pressure.

The only failure mode I know of in this new dominant heuristic is that
inside of a loop when scheduling the iterator (for example), choosing the
last use of the iterator doesn't actually reduce the live interval of the
iterator.  But it doesn't seem to matter in shader-db:

total instructions in shared programs: 1618700 -> 1618700 (0.00%)
instructions in affected programs:     0 -> 0
GAINED:                                13
LOST:                                  0

Note: The new functions are made virtual because I expect we'll soon lift
the pre-regalloc scheduling heuristic over to the vec4 backend.

Cc: "10.0" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2013-11-12 15:04:32 -08:00
Eric Anholt
9b3e1592c2 i965: Fix undefined value usage in ABO setup.
Fixes a compiler warning.

Cc: "10.0" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2013-11-12 15:04:28 -08:00
Eric Anholt
8bd45a7e7e i965: Add a warning if something ever hits a bug I noticed.
We'd have to map the VBO and rewrite things to a lower stride to fix it.

Reviewed-by: Matt Turner <mattst88@gmail.com>
2013-11-12 15:04:25 -08:00
Ben Skeggs
c944bde5be nvc0: release 3d bufctx after drawing
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2013-11-13 08:09:29 +10:00
Francisco Jerez
99d447cc5d clover: Fix the const variant of adaptor_range::end to deal with mismatching range sizes.
Fixes infinite loop in find_grid_optimal_factor() in cases where the
user specifies a grid size with less dimensions than the device
supports.

Reported-by: Tom Stellard <thomas.stellard@amd.com>
Cc: "10.0" <mesa-stable@lists.freedesktop.org>
2013-11-12 11:52:47 -08:00
Roland Scheidegger
50f19e3a66 draw,llvmpipe: use exponent manipulation instead of exp2 for polygon offset
Since we explicitly require a integer input we should avoid using exp2 math
(even if we were using optimized versions), which turns the exp2 into a int
sub (plus some casts).

v2: fix bogus uint (needs to be int) math spotted by Matthew, fix comments

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2013-11-12 19:08:58 +00:00
Cyril Brulebois
2d77e4f922 gallium: fix build on GNU/Hurd due to missing PIPE_OS_HURD detection
Thanks to Pino Toscano.  Patch from Debian package.

Cc: "10.0" <mesa-stable@lists.freedesktop.org>

Reviewed-by: Brian Paul <brianp@vmware.com>
2013-11-12 11:57:21 -07:00
Petr Sebor
f2b844f59d meta: enable vertex attributes in the context of the newly created array object
Otherwise, the function would enable generic vertex attributes 0
and 1 of the array object it does not own. This was causing crashes
in Euro Truck Simulator 2, since the incorrectly enabled generic
attribute 0 in the foreign context got precedence before vertex
position attribute at later time, leading to NULL pointer dereference.

Cc: "9.2" <mesa-stable@lists.freedesktop.org>
Cc: "10.0" <mesa-stable@lists.freedesktop.org>

Signed-off-by: Petr Sebor <petr@scssoft.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-11-12 11:56:30 -07:00
Brian Paul
76317355bd mesa: 80-column wrapping, remove trailing whitespace in arrayobj.c 2013-11-12 11:05:25 -07:00
Brian Paul
c8f3722129 mesa: add comment for struct gl_vertex_buffer_binding 2013-11-12 11:05:25 -07:00
Brian Paul
ce193d4f01 mesa: call update_array_format() after error checking
We try to do all error checking before changing any GL state.

Cc: "10.0" <mesa-stable@lists.freedesktop.org>

Jordan Justen <jordan.l.justen@intel.com>
2013-11-12 11:05:19 -07:00
Brian Paul
5f22f3207e mesa: use _mesa_is_bufferobj() helper in _mesa_vertex_attrib_address()
And use a regular if statment to slightly improve readability.

Jordan Justen <jordan.l.justen@intel.com>
2013-11-12 11:05:14 -07:00
Brian Paul
e032abcb27 mesa: add const qualifiers to vertex array helper functions
Jordan Justen <jordan.l.justen@intel.com>
2013-11-12 11:05:04 -07:00
Ilia Mirkin
08122e151a nouveau/video: mark bitstream-level acceleration as unsupported
Adding a vl_mpeg-based helper didn't seem to work, as it produced data
that the card couldn't handle. (And I didn't investigate further.) This
makes the decoding functionality only accessible via XvMC and avoids
crashes when attempting to use VDPAU.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.0" <mesa-stable@lists.freedesktop.org>
2013-11-12 10:11:41 +01:00
Ilia Mirkin
e8d5d3409c nouveau/video: don't try on nv3x
It doesn't work, I don't know why, but no point in hanging people's
displays until it gets figured out.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.0" <mesa-stable@lists.freedesktop.org>
2013-11-12 10:10:54 +01:00
Tom Stellard
594fa4a208 egl-static: Only export necessary symbols v3
This fixes a crash in glamor when mesa links against static LLVM.

v2:
  - Inline LINKER_SCRIPT variable

v3: Kai Wasserbäch
  - Fix out out-of-tree-builds

Tested-by: Kai Wasserbäch <kai@dev.carbon-project.or>
2013-11-11 17:21:35 -05:00
Tom Stellard
cb080a10b6 configure.ac: Don't require shared LLVM when building OpenCL
This works now that pipe_*.so is no longer exporting LLVM symbols.

Tested-by: Kai Wasserbäch <kai@dev.carbon-project.or>
2013-11-11 17:21:35 -05:00
Tom Stellard
6d6c749215 pipe-loader: Only export necessary symbols v3
This makes it possible to use clover with statically linked LLVM.

v2:
  - Inline LINKER_SCRIPT variable

v3: Kai Wasserbäch
  - Fix out out-of-tree-builds

Tested-by: Kai Wasserbäch <kai@dev.carbon-project.or>
2013-11-11 17:21:34 -05:00
Tom Stellard
a859131003 radeonsi/compute: Add Sea Islands support 2013-11-11 17:21:34 -05:00
Vincent Lejeune
88c8f19729 r600/llvm: Store inputs in function arguments 2013-11-11 23:14:42 +01:00
Rico Schüller
23afe71f44 tests: Fix make check for out of tree builds.
Cc: "10.0" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Rico Schüller <kgbricola@web.de>
2013-11-11 14:06:17 -08:00
Anuj Phogat
348b91b7dc i965: Move #define's inside function as local variables
X_f, Y_f, Xp_f, Yp_f variables are used just inside
translate_dst_to_src().So, they can be defined just
as local variables.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2013-11-11 13:35:37 -08:00
Vinson Lee
227872571a i915, i965: Fix memory leak in intel_miptree_create_for_bo.
Fixes "Resource leak" defects reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2013-11-11 13:11:07 -08:00
Brian Paul
ab2da985b6 osmesa: assorted code clean-ups 2013-11-11 08:17:46 -07:00
Brian Paul
a66a008b17 osmesa: fix broken triangle/line drawing when using float color buffer
Doesn't seem to help with bug 71363 but it fixed a failure I found in
my testing.

Cc: "9.2" <mesa-stable@lists.freedesktop.org>
Cc: "10.0" <mesa-stable@lists.freedesktop.org>
2013-11-11 08:17:24 -07:00
Brian Paul
34ce1a8502 svga: improve loops over color buffers
Only loop over the actual number of color buffers supported, not
PIPE_MAX_COLOR_BUFS.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2013-11-11 08:12:18 -07:00
Brian Paul
2182d2db28 svga: document magic number of 8 render targets per batch
Grab the comments from commit message b84b7f19df to explain
what the code is doing.
2013-11-11 08:12:18 -07:00
Brian Paul
dc21b36daf util: set all unused cbufs to NULL in util_copy_framebuffer_state()
This helps fix an issue in the svga driver, and is just safer all-around.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2013-11-11 08:12:18 -07:00
Brian Paul
944eebbdb4 glx: declare glx_screen struct to silence warning 2013-11-11 08:12:05 -07:00
Brian Paul
75982a5df4 glx: change query_renderer_integer() value param to unsigned
When this function was added, the returned value was signed in some
places, unsigned in others.

v2: also add unsigned in the unit test, per Ian.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-11-11 08:10:12 -07:00
José Fonseca
6c6f4aa6fd glx: Fix scons build.
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-11-11 07:30:07 +00:00
Samuel Thibault
a594cec7e3 EGL: fix build without libdrm
This fixes building EGL without libdrm support.

Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
2013-11-10 22:11:42 +01:00
Chris Forbes
5442c0eae3 i965: convert brw_lower_offset_array_visitor to ir_rvalue_visitor
Previously, we would bogusly replace the entire statement containing the
ir_texture node with an ir_dereference_variable.

Correct this to just replace the ir_texture node itself as intended.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-11-10 16:57:07 +13:00
Chris Forbes
d257350949 glsl: fix missing breaks in equals(ir_texture,..)
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Cc: "10.0" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-11-10 10:20:02 +13:00
Eric Anholt
bd4596efac i965: Make the driver compile until a proper libdrm can be released.
No depending on unreleased code.
2013-11-09 13:00:53 -08:00
Armin K
f0f202e6b7 glx: conditionaly build dri3 and present loader (v3)
This patch makes it possible to disable DRI3 if desired.

Tested with:

./configure --disable-dri3 --with-dri-drivers=i965 \
--with-gallium-drivers= --disable-vdpau --disable-egl \
--disable-gbm --disable-xvmc

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=71397
Cc: 10.0 <mesa-stable@lists.freedesktop.org>
2013-11-09 09:12:46 -08:00
Matt Turner
68349e5219 i965/fs: Don't perform CSE on inst HW_REG dests (unless it's null)
Commit b16b3c87 began performing CSE on CMP instructions with null
destinations. I relaxed the restrictions a bit too much, thereby
allowing CSE to be performed on instructions with, for instance, an
explicit accumulator destination.

This broke the arb_gpu_shader5/fs-imulExtended shader tests because
they emit MUL instructions with the accumulator as the destination. CSE
would instead cause the MUL to write to a GRF, which is lower precision
than the accumulator.

Reviewed-by: Eric Anholt <eric@anholt.net>
Cc: 10.0 <mesa-stable@lists.freedesktop.org>
2013-11-09 09:10:24 -08:00
Chad Versace
b7dfb8528f i965: Remove some tiny dead code from intel_miptree_map_movntdqa
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2013-11-08 14:34:41 -08:00
Brian Paul
f41c01c688 swrast: add missing notify_reset parameter to dri_create_context()
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2013-11-08 08:57:03 -07:00
Christian König
754eb6a67d vl: use a separate context for shader based decode v2
This makes VDPAU thread save again.

v2: fix some memory leaks reported by Aaron Watry.

Signed-off-by: Christian König <christian.koenig@amd.com>
2013-11-08 14:50:27 +01:00
José Fonseca
cb3c57df3a scons: Add dri2_query_renderer.c to sources. 2013-11-08 12:22:22 +00:00
José Fonseca
caf1d96862 st/dri: Fix dri_create_context declaration prototype. 2013-11-08 12:20:00 +00:00
2297 changed files with 143027 additions and 68634 deletions

View File

@@ -8,4 +8,5 @@
(c-set-offset 'innamespace '0)
(c-set-offset 'inline-open '0)))
)
(makefile-mode (indent-tabs-mode . t))
)

View File

@@ -24,7 +24,7 @@
# BOARD_GPU_DRIVERS should be defined. The valid values are
#
# classic drivers: i915 i965
# gallium drivers: swrast i915g ilo nouveau r300g r600g radeonsi vmwgfx
# gallium drivers: swrast freedreno i915g ilo nouveau r300g r600g radeonsi vmwgfx
#
# The main target is libGLES_mesa. For each classic driver enabled, a DRI
# module will also be built. DRI modules will be loaded by libGLES_mesa.
@@ -42,7 +42,7 @@ DRM_TOP := external/drm
DRM_GRALLOC_TOP := hardware/drm_gralloc
classic_drivers := i915 i965
gallium_drivers := swrast i915g ilo nouveau r300g r600g radeonsi vmwgfx
gallium_drivers := swrast freedreno i915g ilo nouveau r300g r600g radeonsi vmwgfx
MESA_GPU_DRIVERS := $(strip $(BOARD_GPU_DRIVERS))
@@ -78,6 +78,7 @@ endif
ifneq ($(strip $(MESA_GPU_DRIVERS)),)
SUBDIRS := \
src/loader \
src/mapi \
src/glsl \
src/mesa \

View File

@@ -36,7 +36,6 @@ PACKAGE_NAME = MesaLib-$(PACKAGE_VERSION)
EXTRA_FILES = \
aclocal.m4 \
configure \
VERSION \
bin/ar-lib \
bin/compile \
bin/config.sub \
@@ -46,6 +45,7 @@ EXTRA_FILES = \
bin/ltmain.sh \
bin/missing \
bin/ylwrap \
bin/test-driver \
src/glsl/glsl_parser.cpp \
src/glsl/glsl_parser.h \
src/glsl/glsl_lexer.cpp \
@@ -64,14 +64,13 @@ IGNORE_FILES = \
parsers: configure
$(MAKE) -C src/glsl glsl_parser.cpp glsl_parser.h glsl_lexer.cpp glcpp/glcpp-lex.c glcpp/glcpp-parse.c glcpp/glcpp-parse.h
$(MAKE) -C src/mesa program/lex.yy.c program/program_parse.tab.c program/program_parse.tab.h
# Everything for new a Mesa release:
ARCHIVES = $(PACKAGE_NAME).tar.gz \
$(PACKAGE_NAME).tar.bz2 \
$(PACKAGE_NAME).zip
tarballs: md5
tarballs: checksums
rm -f ../$(PACKAGE_DIR) $(PACKAGE_NAME).tar
manifest.txt: .git
@@ -98,9 +97,9 @@ $(PACKAGE_NAME).zip: parsers ../$(PACKAGE_DIR) manifest.txt
zip -q -@ $(PACKAGE_NAME).zip < $(PACKAGE_DIR)/manifest.txt ; \
mv $(PACKAGE_NAME).zip $(PACKAGE_DIR)
md5: $(ARCHIVES)
@-md5sum $(PACKAGE_NAME).tar.gz
@-md5sum $(PACKAGE_NAME).tar.bz2
@-md5sum $(PACKAGE_NAME).zip
checksums: $(ARCHIVES)
@-sha256sum $(PACKAGE_NAME).tar.gz
@-sha256sum $(PACKAGE_NAME).tar.bz2
@-sha256sum $(PACKAGE_NAME).zip
.PHONY: tarballs md5

View File

@@ -59,13 +59,6 @@ else:
Help(opts.GenerateHelpText(env))
# fail early for a common error on windows
if env['gles']:
try:
import libxml2
except ImportError:
raise SCons.Errors.UserError, "GLES requires libxml2-python to build"
#######################################################################
# Environment setup
@@ -87,9 +80,6 @@ env.Append(CPPPATH = [
'#/src/gallium/winsys',
])
if env['msvc']:
env.Append(CPPPATH = ['#include/c99'])
# for debugging
#print env.Dump()
@@ -122,9 +112,6 @@ if env['crosscompile'] and not env['embedded']:
host_env['hostonly'] = True
assert host_env['crosscompile'] == False
if host_env['msvc']:
host_env.Append(CPPPATH = ['#include/c99'])
target_env = env
env = host_env
Export('env')

View File

@@ -1 +1 @@
10.0.0-devel
10.2.7

30
bin/.cherry-ignore Normal file
View File

@@ -0,0 +1,30 @@
# The first is the change, and the second is the revert of that change.
e6967270c75a5b669152127bb7a746d55f4407a6 i965: Fix depth (array slices) computation for 1D_ARRAY render targets.
155f98d49fdc2f46c760f8214327b3804ee60079 Revert "i965: Fix depth (array slices) computation for 1D_ARRAY render targets."
# This patch didn't have enough in the commit message to convince me it
# is a bug fix, (email sent to author asking for more information).
41d759d076737f94976f5294b734dbc437a12bae
# These patch were already cherry-picked before the 10.2.4 release.
#
# But get-pick-list.sh doesn't realize that because the commit messages for
# these on the stable branch reference commit IDs that don't actually appear
# on master. I'm not sure what happened, (perhaps master was force-pushed at
# some point?).
2eaf3f670fea4ce4466340141244e41a45542c13
e5adc560cc8544200faa3e04504202839626ab37
cf1b5eee7f36af29d1d5caba3538ad4985e51f81
# The patch depends on earlier ones that are not part of 10.2.
b3121bfd413973f460e2cc9a9f852bdfa1265fcf mesa: guard better when building with sse4.1 optimisations
# The PIPE_CAP is not in mesa 10.2 - breaks the build.
72969e0efb7a5a011629c1001e81aa2329ede6b1 radeon/compute: Report a value for PIPE_SHADER_CAP_MAX_CONST_BUFFER_SIZE
# No whitespace fixes for the stable branches.
38fccc37c1fa57c1fd373e8d71621bb4aed31083 radeonsi/compute: Whitespace fixes
# The commit relies of patches restructuring r600_resource, which never made
# it in the 10.2 branch.
a15088338ebe544efd90bfa7934cb99521488141 radeonsi/compute: Stop leaking the input buffer

View File

@@ -14,7 +14,7 @@ git log --reverse --grep="cherry picked from commit" origin/master..HEAD |\
sed -e 's/^[[:space:]]*(cherry picked from commit[[:space:]]*//' -e 's/)//' > already_picked
# Grep for commits that were marked as a candidate for the stable tree.
git log --reverse --pretty=%H -i --grep='^\([[:space:]]*NOTE: .*[Cc]andidate\|CC:.*mesa-stable\)' HEAD..origin/master |\
git log --reverse --pretty=%H -i --grep='^\([[:space:]]*NOTE: .*[Cc]andidate\|CC:.*10\.2.*mesa-stable\)' HEAD..origin/master |\
while read sha
do
# Check to see whether the patch is on the ignore list.

View File

@@ -91,6 +91,7 @@ def AddOptions(opts):
opts.Add(EnumOption('platform', 'target platform', host_platform,
allowed_values=('cygwin', 'darwin', 'freebsd', 'haiku', 'linux', 'sunos', 'windows')))
opts.Add(BoolOption('embedded', 'embedded build', 'no'))
opts.Add(BoolOption('analyze', 'enable static code analysis where available', 'no'))
opts.Add('toolchain', 'compiler toolchain', default_toolchain)
opts.Add(BoolOption('gles', 'EXPERIMENTAL: enable OpenGL ES support', 'no'))
opts.Add(BoolOption('llvm', 'use LLVM', default_llvm))
@@ -100,4 +101,4 @@ def AddOptions(opts):
opts.Add(BoolOption('quiet', 'DEPRECATED: profile build', 'yes'))
opts.Add(BoolOption('texture_float', 'enable floating-point textures and renderbuffers', 'no'))
if host_platform == 'windows':
opts.Add(EnumOption('MSVC_VERSION', 'MS Visual C++ version', None, allowed_values=('7.1', '8.0', '9.0', '10.0', '11.0')))
opts.Add('MSVC_VERSION', 'Microsoft Visual C/C++ version')

File diff suppressed because it is too large Load Diff

View File

@@ -18,164 +18,178 @@ are exposed in the 3.0 context as extensions.
Feature Status
----------------------------------------------------- ------------------------
GL 3.0:
GL 3.0 --- all DONE: i965, nv50, nvc0, r600, radeonsi
GLSL 1.30 DONE (i965, r600, radeonsi)
glBindFragDataLocation, glGetFragDataLocation DONE
Conditional rendering (GL_NV_conditional_render) DONE (i965, r300, r600, radeonsi, swrast)
Map buffer subranges (GL_ARB_map_buffer_range) DONE (i965, r300, r600, radeonsi, swrast)
Clamping controls (GL_ARB_color_buffer_float) DONE (i965, r300, r600, radeonsi)
Float textures, renderbuffers (GL_ARB_texture_float) DONE (i965, r300, r600, radeonsi)
GL_EXT_packed_float DONE (i965, r600, radeonsi)
GL_EXT_texture_shared_exponent DONE (i965, r600, radeonsi, swrast)
Float depth buffers (GL_ARB_depth_buffer_float) DONE (i965, r600, radeonsi)
Framebuffer objects (GL_ARB_framebuffer_object) DONE (i965, r300, r600, radeonsi, swrast)
Half-float DONE (i965, r300, r600, radeonsi, swrast)
Non-normalized Integer texture/framebuffer formats DONE (i965, r600, radeonsi)
1D/2D Texture arrays DONE (i965, r600, radeonsi)
Per-buffer blend and masks (GL_EXT_draw_buffers2) DONE (i965, r600, radeonsi, swrast)
GL_EXT_texture_compression_rgtc DONE (i965, r300, r600, radeonsi, swrast)
Red and red/green texture formats DONE (i965, r300, r600, radeonsi, swrast)
Transform feedback (GL_EXT_transform_feedback) DONE (i965, r600, radeonsi)
Vertex array objects (GL_APPLE_vertex_array_object) DONE (all drivers)
sRGB framebuffer format (GL_EXT_framebuffer_sRGB) DONE (i965, r600, radeonsi)
glClearBuffer commands DONE
glGetStringi command DONE
glTexParameterI, glGetTexParameterI commands DONE
glVertexAttribI commands DONE
Depth format cube textures DONE (i965, r600, radeonsi)
GLX_ARB_create_context (GLX 1.4 is required) DONE
GLSL 1.30 DONE ()
glBindFragDataLocation, glGetFragDataLocation DONE
Conditional rendering (GL_NV_conditional_render) DONE (r300, swrast)
Map buffer subranges (GL_ARB_map_buffer_range) DONE (r300, swrast)
Clamping controls (GL_ARB_color_buffer_float) DONE (r300)
Float textures, renderbuffers (GL_ARB_texture_float) DONE (r300)
GL_EXT_packed_float DONE ()
GL_EXT_texture_shared_exponent DONE (swrast)
Float depth buffers (GL_ARB_depth_buffer_float) DONE ()
Framebuffer objects (GL_ARB_framebuffer_object) DONE (r300, swrast)
GL_ARB_half_float_pixel DONE (all drivers)
GL_ARB_half_float_vertex DONE (r300, swrast)
GL_EXT_texture_integer DONE ()
GL_EXT_texture_array DONE ()
Per-buffer blend and masks (GL_EXT_draw_buffers2) DONE (swrast)
GL_EXT_texture_compression_rgtc DONE (r300, swrast)
GL_ARB_texture_rg DONE (r300, swrast)
Transform feedback (GL_EXT_transform_feedback) DONE ()
Vertex array objects (GL_ARB_vertex_array_object) DONE (all drivers)
sRGB framebuffer format (GL_EXT_framebuffer_sRGB) DONE ()
glClearBuffer commands DONE
glGetStringi command DONE
glTexParameterI, glGetTexParameterI commands DONE
glVertexAttribI commands DONE
Depth format cube textures DONE ()
GLX_ARB_create_context (GLX 1.4 is required) DONE
Multisample anti-aliasing DONE (r300)
GL 3.1:
GL 3.1 --- all DONE: i965, nv50, nvc0, r600, radeonsi
GLSL 1.40 DONE (i965, r600, radeonsi)
Forward compatible context support/deprecations DONE (i965, r600, radeonsi)
Instanced drawing (GL_ARB_draw_instanced) DONE (i965, r600, radeonsi, swrast)
Buffer copying (GL_ARB_copy_buffer) DONE (i965, r300, r600, radeonsi, swrast)
Primitive restart (GL_NV_primitive_restart) DONE (i965, r300, r600, radeonsi)
16 vertex texture image units DONE (i965, r600, radeonsi)
Texture buffer objs (GL_ARB_texture_buffer_object) DONE for OpenGL 3.1 contexts (i965, r600, radeonsi)
Rectangular textures (GL_ARB_texture_rectangle) DONE (i965, r300, r600, radeonsi, swrast)
Uniform buffer objs (GL_ARB_uniform_buffer_object) DONE (i965, r600, radeonsi, swrast)
Signed normalized textures (GL_EXT_texture_snorm) DONE (i965, r300, r600, radeonsi)
GLSL 1.40 DONE ()
Forward compatible context support/deprecations DONE ()
Instanced drawing (GL_ARB_draw_instanced) DONE (swrast)
Buffer copying (GL_ARB_copy_buffer) DONE (r300, swrast)
Primitive restart (GL_NV_primitive_restart) DONE (r300)
16 vertex texture image units DONE ()
Texture buffer objs (GL_ARB_texture_buffer_object) DONE for OpenGL 3.1 contexts ()
Rectangular textures (GL_ARB_texture_rectangle) DONE (r300, swrast)
Uniform buffer objs (GL_ARB_uniform_buffer_object) DONE (swrast)
Signed normalized textures (GL_EXT_texture_snorm) DONE (r300)
GL 3.2:
GL 3.2 --- all DONE: i965, nv50, nvc0, r600, radeonsi
Core/compatibility profiles DONE
GLSL 1.50 DONE (i965)
Geometry shaders DONE (i965)
BGRA vertex order (GL_ARB_vertex_array_bgra) DONE (i965, r300, r600, radeonsi, swrast)
Base vertex offset(GL_ARB_draw_elements_base_vertex) DONE (i965, r300, r600, radeonsi, swrast)
Frag shader coord (GL_ARB_fragment_coord_conventions) DONE (i965, r300, r600, radeonsi, swrast)
Provoking vertex (GL_ARB_provoking_vertex) DONE (i965, r300, r600, radeonsi, swrast)
Seamless cubemaps (GL_ARB_seamless_cube_map) DONE (i965, r600, radeonsi)
Multisample textures (GL_ARB_texture_multisample) DONE (i965, r600, radeonsi)
Frag depth clamp (GL_ARB_depth_clamp) DONE (i965, r600, swrast, radeonsi)
Fence objects (GL_ARB_sync) DONE (i965, r300, r600, radeonsi, swrast)
GLX_ARB_create_context_profile DONE
Core/compatibility profiles DONE
GLSL 1.50 DONE ()
Geometry shaders DONE ()
BGRA vertex order (GL_ARB_vertex_array_bgra) DONE (r300, swrast)
Base vertex offset(GL_ARB_draw_elements_base_vertex) DONE (r300, swrast)
Frag shader coord (GL_ARB_fragment_coord_conventions) DONE (r300, swrast)
Provoking vertex (GL_ARB_provoking_vertex) DONE (r300, swrast)
Seamless cubemaps (GL_ARB_seamless_cube_map) DONE ()
Multisample textures (GL_ARB_texture_multisample) DONE ()
Frag depth clamp (GL_ARB_depth_clamp) DONE (swrast)
Fence objects (GL_ARB_sync) DONE (r300, swrast)
GLX_ARB_create_context_profile DONE
GL 3.3:
GL 3.3 --- all DONE: i965, nv50, nvc0, r600, radeonsi
GLSL 3.30 DONE (i965)
GL_ARB_blend_func_extended DONE (i965, r600, radeonsi, softpipe)
GL_ARB_explicit_attrib_location DONE (i915, i965, r300, r600, radeonsi, swrast)
GL_ARB_occlusion_query2 DONE (i965, r300, r600, radeonsi, swrast)
GL_ARB_sampler_objects DONE (i965, r300, r600, radeonsi)
GL_ARB_shader_bit_encoding DONE (i965, r600, radeonsi)
GL_ARB_texture_rgb10_a2ui DONE (i965, r600, radeonsi)
GL_ARB_texture_swizzle DONE (i965, r300, r600, radeonsi, swrast)
GL_ARB_timer_query DONE (i965, r600, radeonsi)
GL_ARB_instanced_arrays DONE (i965, r300, r600, radeonsi)
GL_ARB_vertex_type_2_10_10_10_rev DONE (i965, r600, radeonsi)
GLSL 3.30 DONE ()
GL_ARB_blend_func_extended DONE (softpipe)
GL_ARB_explicit_attrib_location DONE (all drivers that support GLSL)
GL_ARB_occlusion_query2 DONE (r300, swrast)
GL_ARB_sampler_objects DONE (all drivers)
GL_ARB_shader_bit_encoding DONE ()
GL_ARB_texture_rgb10_a2ui DONE ()
GL_ARB_texture_swizzle DONE (r300, swrast)
GL_ARB_timer_query DONE ()
GL_ARB_instanced_arrays DONE (r300)
GL_ARB_vertex_type_2_10_10_10_rev DONE ()
GL 4.0:
GLSL 4.0 not started
GL_ARB_texture_query_lod DONE (i965)
GL_ARB_draw_buffers_blend DONE (i965, r600, radeonsi, softpipe)
GL_ARB_draw_indirect started (Christoph)
GL_ARB_gpu_shader5 started
GL_ARB_gpu_shader_fp64 not started
GL_ARB_sample_shading DONE (i965)
GL_ARB_shader_subroutine not started
GL_ARB_tessellation_shader not started
GL_ARB_texture_buffer_object_rgb32 DONE (i965, r600, radeonsi, softpipe)
GL_ARB_texture_cube_map_array DONE (i965, r600, softpipe)
GL_ARB_texture_gather DONE (i965)
GL_ARB_transform_feedback2 DONE (i965, r600, radeonsi)
GL_ARB_transform_feedback3 DONE (i965, r600, radeonsi)
GLSL 4.0 not started
GL_ARB_texture_query_lod DONE (i965, nv50, nvc0)
GL_ARB_draw_buffers_blend DONE (i965, nv50, nvc0, r600, radeonsi, softpipe)
GL_ARB_draw_indirect DONE (i965)
GL_ARB_gpu_shader5 started
- 'precise' qualifier not started
- Dynamically uniform sampler array indices not started
- Dynamically uniform UBO array indices not started
- Implicit signed -> unsigned conversions not started
- Fused multiply-add DONE
- Packing/bitfield/conversion functions DONE
- Enhanced textureGather DONE
- Geometry shader instancing DONE
- Geometry shader multiple streams not started
- Enhanced per-sample shading DONE
- Interpolation functions started
- New overload resolution rules not started
GL_ARB_gpu_shader_fp64 not started
GL_ARB_sample_shading DONE (i965, nv50, nvc0)
GL_ARB_shader_subroutine not started
GL_ARB_tessellation_shader not started
GL_ARB_texture_buffer_object_rgb32 DONE (i965, nvc0, r600, radeonsi, softpipe)
GL_ARB_texture_cube_map_array DONE (i965, nv50, nvc0, r600, softpipe)
GL_ARB_texture_gather DONE (i965, nv50, nvc0)
GL_ARB_transform_feedback2 DONE (i965, nv50, nvc0, r600, radeonsi)
GL_ARB_transform_feedback3 DONE (i965, nv50, nvc0, r600, radeonsi)
GL 4.1:
GLSL 4.1 not started
GL_ARB_ES2_compatibility DONE (i965, r300, r600, radeonsi)
GL_ARB_get_program_binary DONE (0 binary formats)
GL_ARB_separate_shader_objects some infrastructure done
GL_ARB_shader_precision not started
GL_ARB_vertex_attrib_64bit not started
GL_ARB_viewport_array not started
GLSL 4.1 not started
GL_ARB_ES2_compatibility DONE (i965, nv50, nvc0, r300, r600, radeonsi)
GL_ARB_get_program_binary DONE (0 binary formats)
GL_ARB_separate_shader_objects DONE (all drivers)
GL_ARB_shader_precision not started
GL_ARB_vertex_attrib_64bit not started
GL_ARB_viewport_array DONE (i965, nv50, r600)
GL 4.2:
GLSL 4.2 not started
GL_ARB_texture_compression_bptc not started
GL_ARB_compressed_texture_pixel_storage not started
GL_ARB_shader_atomic_counters DONE (i965)
GL_ARB_texture_storage DONE (all drivers)
GL_ARB_transform_feedback_instanced DONE (i965, r600, radeonsi)
GL_ARB_base_instance DONE (i965, nv50, nvc0, r600, radeonsi)
GL_ARB_shader_image_load_store not started
GL_ARB_conservative_depth DONE (all drivers that support GLSL 1.30)
GL_ARB_shading_language_420pack DONE (all drivers that support GLSL 1.30)
GL_ARB_internalformat_query DONE (i965, r300, r600, radeonsi)
GL_ARB_map_buffer_alignment DONE (r300, r600, radeonsi)
GLSL 4.2 not started
GL_ARB_texture_compression_bptc not started
GL_ARB_compressed_texture_pixel_storage not started
GL_ARB_shader_atomic_counters DONE (i965)
GL_ARB_texture_storage DONE (all drivers)
GL_ARB_transform_feedback_instanced DONE (i965, nv50, nvc0, r600, radeonsi)
GL_ARB_base_instance DONE (i965, nv50, nvc0, r600, radeonsi)
GL_ARB_shader_image_load_store in progress (curro)
GL_ARB_conservative_depth DONE (all drivers that support GLSL 1.30)
GL_ARB_shading_language_420pack DONE (all drivers that support GLSL 1.30)
GL_ARB_internalformat_query DONE (i965, nv50, nvc0, r300, r600, radeonsi)
GL_ARB_map_buffer_alignment DONE (all drivers)
GL 4.3:
GLSL 4.3 not started
GL_ARB_arrays_of_arrays not started
GL_ARB_ES3_compatibility DONE (i965)
GL_ARB_clear_buffer_object not started
GL_ARB_compute_shader not started
GL_ARB_copy_image not started
GL_KHR_debug DONE (all drivers)
GL_ARB_explicit_uniform_location not started
GL_ARB_fragment_layer_viewport not started
GL_ARB_framebuffer_no_attachments not started
GL_ARB_internalformat_query2 not started
GL_ARB_invalidate_subdata DONE (all drivers)
GL_ARB_multi_draw_indirect not started
GL_ARB_program_interface_query not started
GL_ARB_robust_buffer_access_behavior not started
GL_ARB_shader_image_size not started
GL_ARB_shader_storage_buffer_object not started
GL_ARB_stencil_texturing not started
GL_ARB_texture_buffer_range DONE (nv50, nvc0, i965, r600, radeonsi)
GL_ARB_texture_query_levels DONE (i965)
GL_ARB_texture_storage_multisample DONE (all drivers that support GL_ARB_texture_multisample)
GL_ARB_texture_view not started
GL_ARB_vertex_attrib_binding DONE (all drivers)
GLSL 4.3 not started
GL_ARB_arrays_of_arrays started
GL_ARB_ES3_compatibility DONE (i965)
GL_ARB_clear_buffer_object DONE (all drivers)
GL_ARB_compute_shader started (Paul Berry)
GL_ARB_copy_image not started
GL_KHR_debug DONE (all drivers)
GL_ARB_explicit_uniform_location not started
GL_ARB_fragment_layer_viewport not started
GL_ARB_framebuffer_no_attachments not started
GL_ARB_internalformat_query2 not started
GL_ARB_invalidate_subdata DONE (all drivers)
GL_ARB_multi_draw_indirect DONE (i965)
GL_ARB_program_interface_query not started
GL_ARB_robust_buffer_access_behavior not started
GL_ARB_shader_image_size not started
GL_ARB_shader_storage_buffer_object not started
GL_ARB_stencil_texturing DONE (i965/gen8+)
GL_ARB_texture_buffer_range DONE (nv50, nvc0, i965, r600, radeonsi)
GL_ARB_texture_query_levels DONE (i965)
GL_ARB_texture_storage_multisample DONE (all drivers that support GL_ARB_texture_multisample)
GL_ARB_texture_view DONE (i965)
GL_ARB_vertex_attrib_binding DONE (all drivers)
GL 4.4:
GLSL 4.4 not started
GL_MAX_VERTEX_ATTRIB_STRIDE not started
GL_ARB_buffer_storage not started
GL_ARB_clear_texture not started
GL_ARB_enhanced_layouts not started
GL_ARB_multi_bind not started
GL_ARB_query_buffer_object not started
GL_ARB_texture_mirror_clamp_to_edge DONE (i965, nv30, nv50, nvc0, r300, r600, radeonsi, swrast)
GL_ARB_texture_stencil8 not started
GL_ARB_vertex_type_10f_11f_11f_rev DONE (i965, r600)
GLSL 4.4 not started
GL_MAX_VERTEX_ATTRIB_STRIDE not started
GL_ARB_buffer_storage DONE (i965, nv30, nv50, nvc0, r300, r600, radeonsi)
GL_ARB_clear_texture not started
GL_ARB_enhanced_layouts not started
GL_ARB_multi_bind DONE (all drivers)
GL_ARB_query_buffer_object not started
GL_ARB_texture_mirror_clamp_to_edge DONE (i965, nv30, nv50, nvc0, r300, r600, radeonsi, swrast)
GL_ARB_texture_stencil8 not started
GL_ARB_vertex_type_10f_11f_11f_rev DONE (i965, nv50, nvc0, r600, radeonsi)
More info about these features and the work involved can be found at

View File

@@ -1,256 +0,0 @@
Mesa Cygwin/X11 Information
WARNING
=======
If you installed X11 (packages xorg-x11-devel and xorg-x11-bin-dlls ) with the
latest setup.exe from Cygwin the GL (Mesa) libraries and include are already
installed in /usr/X11R6.
The following will explain how to "replace" them.
Installation
============
How to compile Mesa on Cygwin/X11 systems:
1. Shared libs:
type 'make cygwin-sl'.
When finished, the Mesa DLL will be in the Mesa-x.y/lib/ and
Mesa-x.y/bin directories.
2. Static libs:
type 'make cygwin-static'.
When finished, the Mesa libraries will be in the Mesa-x.y/lib/ directory.
Header and library files:
After you've compiled Mesa and tried the demos I recommend the following
procedure for "installing" Mesa.
Copy the Mesa include/GL directory to /usr/X11R6/include:
cp -a include/GL /usr/X11R6/include
Copy the Mesa library files to /usr/X11R6/lib:
cp -a lib/* /usr/X11R6ocal/lib
Copy the Mesa bin files (used by the DLL stuff) to /usr/X11R6/bin:
cp -a lib/cyg* /usr/X11R6/bin
Xt/Motif widgets:
If you want to use Mesa or OpenGL in your Xt/Motif program you can build
the widgets found in either the widgets-mesa or widgets-sgi directories.
The former were written for Mesa and the later are the original SGI
widgets. Look in those directories for more information.
For the Motif widgets you must have downloaded the lesstif package.
Using the library
=================
Configuration options:
The file src/mesa/main/config.h has many parameters which you can adjust
such as maximum number of lights, clipping planes, maximum texture size,
etc. In particular, you may want to change DEPTH_BITS from 16 to 32
if a 16-bit depth buffer isn't precise enough for your application.
Shared libraries:
If you compile shared libraries (Win32 DLLS) you may have to set an
environment variable to specify where the Mesa libraries are located.
Set the PATH variable to include /your-dir/Mesa-2.6/bin.
Otherwise, when you try to run a demo it may fail with a message saying
that one or more DLL couldn't be found.
Xt/Motif Widgets:
Two versions of the Xt/Motif OpenGL drawing area widgets are included:
widgets-sgi/ SGI's stock widgets
widgets-mesa/ Mesa-tuned widgets
Look in those directories for details
Togl:
Togl is an OpenGL/Mesa widget for Tcl/Tk.
See http://togl.sourceforge.net for more information.
X Display Modes:
Mesa supports RGB(A) rendering into almost any X visual type and depth.
The glXChooseVisual function tries its best to pick an appropriate visual
for the given attribute list. However, if this doesn't suit your needs
you can force Mesa to use any X visual you want (any supported by your
X server that is) by setting the MESA_RGB_VISUAL and MESA_CI_VISUAL
environment variables. When an RGB visual is requested, glXChooseVisual
will first look if the MESA_RGB_VISUAL variable is defined. If so, it
will try to use the specified visual. Similarly, when a color index
visual is requested, glXChooseVisual will look for the MESA_CI_VISUAL
variable.
The format of accepted values is: <visual-class> <depth>
Here are some examples:
using the C-shell:
% setenv MESA_RGB_VISUAL "TrueColor 8" // 8-bit TrueColor
% setenv MESA_CI_VISUAL "PseudoColor 12" // 12-bit PseudoColor
% setenv MESA_RGB_VISUAL "PseudoColor 8" // 8-bit PseudoColor
using the KornShell:
$ export MESA_RGB_VISUAL="TrueColor 8"
$ export MESA_CI_VISUAL="PseudoColor 12"
$ export MESA_RGB_VISUAL="PseudoColor 8"
Double buffering:
Mesa can use either an X Pixmap or XImage as the backbuffer when in
double buffer mode. Using GLX, the default is to use an XImage. The
MESA_BACK_BUFFER environment variable can override this. The valid
values for MESA_BACK_BUFFER are: Pixmap and XImage (only the first
letter is checked, case doesn't matter).
A pixmap is faster when drawing simple lines and polygons while an
XImage is faster when Mesa has to do pixel-by-pixel rendering. If you
need depth buffering the XImage will almost surely be faster. Exper-
iment with the MESA_BACK_BUFFER variable to see which is faster for
your application.
Colormaps:
When using Mesa directly or with GLX, it's up to the application writer
to create a window with an appropriate colormap. The aux, tk, and GLUT
toolkits try to minimize colormap "flashing" by sharing colormaps when
possible. Specifically, if the visual and depth of the window matches
that of the root window, the root window's colormap will be shared by
the Mesa window. Otherwise, a new, private colormap will be allocated.
When sharing the root colormap, Mesa may be unable to allocate the colors
it needs, resulting in poor color quality. This can happen when a
large number of colorcells in the root colormap are already allocated.
To prevent colormap sharing in aux, tk and GLUT, define the environment
variable MESA_PRIVATE_CMAP. The value isn't significant.
Gamma correction:
To compensate for the nonlinear relationship between pixel values
and displayed intensities, there is a gamma correction feature in
Mesa. Some systems, such as Silicon Graphics, support gamma
correction in hardware (man gamma) so you won't need to use Mesa's
gamma facility. Other systems, however, may need gamma adjustment
to produce images which look correct. If in the past you thought
Mesa's images were too dim, read on.
Gamma correction is controlled with the MESA_GAMMA environment
variable. Its value is of the form "Gr Gg Gb" or just "G" where
Gr is the red gamma value, Gg is the green gamma value, Gb is the
blue gamma value and G is one gamma value to use for all three
channels. Each value is a positive real number typically in the
range 1.0 to 2.5. The defaults are all 1.0, effectively disabling
gamma correction. Examples using csh:
% setenv MESA_GAMMA "2.3 2.2 2.4" // separate R,G,B values
% setenv MESA_GAMMA "2.0" // same gamma for R,G,B
The demos/gamma.c program may help you to determine reasonable gamma
value for your display. With correct gamma values, the color intensities
displayed in the top row (drawn by dithering) should nearly match those
in the bottom row (drawn as grays).
Alex De Bruyn reports that gamma values of 1.6, 1.6 and 1.9 work well
on HP displays using the HP-ColorRecovery technology.
Mesa implements gamma correction with a lookup table which translates
a "linear" pixel value to a gamma-corrected pixel value. There is a
small performance penalty. Gamma correction only works in RGB mode.
Also be aware that pixel values read back from the frame buffer will
not be "un-corrected" so glReadPixels may not return the same data
drawn with glDrawPixels.
For more information about gamma correction see:
http://www.inforamp.net/~poynton/notes/colour_and_gamma/GammaFAQ.html
Overlay Planes
Overlay planes in the frame buffer are supported by Mesa but require
hardware and X server support. To determine if your X server has
overlay support you can test for the SERVER_OVERLAY_VISUALS property:
xprop -root | grep SERVER_OVERLAY_VISUALS
HPCR glClear(GL_COLOR_BUFFER_BIT) dithering
If you set the MESA_HPCR_CLEAR environment variable then dithering
will be used when clearing the color buffer. This is only applicable
to HP systems with the HPCR (Color Recovery) system.
Extensions
==========
There are three Mesa-specific GLX extensions at this time.
GLX_MESA_pixmap_colormap
This extension adds the GLX function:
GLXPixmap glXCreateGLXPixmapMESA( Display *dpy, XVisualInfo *visual,
Pixmap pixmap, Colormap cmap )
It is an alternative to the standard glXCreateGLXPixmap() function.
Since Mesa supports RGB rendering into any X visual, not just True-
Color or DirectColor, Mesa needs colormap information to convert RGB
values into pixel values. An X window carries this information but a
pixmap does not. This function associates a colormap to a GLX pixmap.
See the xdemos/glxpixmap.c file for an example of how to use this
extension.
GLX_MESA_release_buffers
Mesa associates a set of ancillary (depth, accumulation, stencil and
alpha) buffers with each X window it draws into. These ancillary
buffers are allocated for each X window the first time the X window
is passed to glXMakeCurrent(). Mesa, however, can't detect when an
X window has been destroyed in order to free the ancillary buffers.
The best it can do is to check for recently destroyed windows whenever
the client calls the glXCreateContext() or glXDestroyContext()
functions. This may not be sufficient in all situations though.
The GLX_MESA_release_buffers extension allows a client to explicitly
deallocate the ancillary buffers by calling glxReleaseBuffersMESA()
just before an X window is destroyed. For example:
#ifdef GLX_MESA_release_buffers
glXReleaseBuffersMESA( dpy, window );
#endif
XDestroyWindow( dpy, window );
This extension is new in Mesa 2.0.
GLX_MESA_copy_sub_buffer
This extension adds the glXCopySubBufferMESA() function. It works
like glXSwapBuffers() but only copies a sub-region of the window
instead of the whole window.
This extension is new in Mesa version 2.6
Summary of X-related environment variables:
MESA_RGB_VISUAL - specifies the X visual and depth for RGB mode (X only)
MESA_CI_VISUAL - specifies the X visual and depth for CI mode (X only)
MESA_BACK_BUFFER - specifies how to implement the back color buffer (X only)
MESA_PRIVATE_CMAP - force aux/tk libraries to use private colormaps (X only)
MESA_GAMMA - gamma correction coefficients (X only)
----------------------------------------------------------------------
README.CYGWIN - lassauge April 2004 - based on README.X11

View File

@@ -1,102 +0,0 @@
Mesa 3.0 MITS Information
This software is distributed under the terms of the GNU Library
General Public License, see the LICENSE file for details.
This document is a preliminary introduction to help you get
started. For more detaile information consult the web page.
http://10-dencies.zkm.de/~mesa/
Version 0.1 (Yes it's very alpha code so be warned!)
Contributors:
Emil Briggs (briggs@bucky.physics.ncsu.edu)
David Bucciarelli (tech.hmw@plus.it)
Andreas Schiffler (schiffler@zkm.de)
1. Requirements:
Mesa 3.0.
An SMP capable machine running Linux 2.x
libpthread installed on your machine.
2. What does MITS stand for?
MITS stands for Mesa Internal Threading System. By adding
internal threading to Mesa it should be possible to improve
performance of OpenGL applications on SMP machines.
3. Do applications have to be recoded to take advantage of MITS?
No. The threading is internal to Mesa and transparent to
applications.
4. Will all applications benefit from the current implementation of MITS?
No. This implementation splits the processing of the vertex buffer
over two threads. There is a certain amount of overhead involved
with the thread synchronization and if there is not enough work
to be done the extra overhead outweighs any speedup from using
dual processors. You will not for example see any speedup when
running Quake because it uses GL_POLYGON and there is only one
polygon for each vertex buffer processed. Test results on a
dual 200 Mhz. Pentium Pro system show that one needs around
100-200 vertices in the vertex buffer before any there is any
appreciable benefit from the threading.
5. Are there any parameters that I can tune to try to improve performance.
Yes. You can try to vary the size of the vertex buffer which is
define in VB_MAX located in the file src/vb.h from your top level
Mesa distribution. The number needs to be a multiple of 12 and
the optimum value will probably depend on the capabilities of
your machine and the particular application you are running.
6. Are there any ways I can modify the application to improve its
performance with the MITS?
Yes. Try to use as many vertices between each Begin/End pair
as possbile. This will reduce the thread synchronization
overhead.
7. What sort of speedups can I expect?
On some benchmarks performance gains of up to 30% have been
observerd. Others may see no gain at all and in a few rare
cases even some degradation.
8. What still needs to be done?
Lots of testing and benchmarking.
A portable implementation that works within the Mesa thread API.
Threading of additional areas of Mesa to improve performance
even more.
Installation:
1. This assumes that you already have a working Mesa 3.0 installation
from source.
2. Place the tarball MITS.tar.gz in your top level Mesa directory.
3. Unzip it and untar it. It will replace the following files in
your Mesa source tree so back them up if you want to save them.
README.MITS
Make-config
Makefile
mklib.glide
src/vbxform.c
src/vb.h
4. Rebuild Mesa using the command
make linux-386-glide-mits

View File

@@ -1,207 +0,0 @@
Info on using Mesa 3.0 with Linux Quake I and Quake II
Disclaimer
----------
I am _not_ a Quake expert by any means. I pretty much only run it to
test Mesa. There have been a lot of questions about Linux Quake and
Mesa so I'm trying to provide some useful info here. If this file
doesn't help you then you should look elsewhere for help. The Mesa
mailing list or the news://news.3dfx.com/3dfx.linux.glide newsgroup
might be good.
Again, all the information I have is in this file. Please don't email
me with questions.
If you have information to contribute to this file please send it to
me at brianp@elastic.avid.com
Linux Quake
-----------
You can get Linux Quake from http://www.idsoftware.com/
Quake I and II for Linux were tested with, and include, Mesa 2.6. You
shouldn't have too many problems if you simply follow the instructions
in the Quake distribution.
RedHat 5.0 Linux problems
-------------------------
RedHat Linux 5.x uses the GNU C library ("glibc" or "libc6") whereas
previous RedHat and other Linux distributions use "libc5" for its
runtime C library.
Linux Quake I and II were compiled for libc5. If you compile Mesa
on a RedHat 5.x system the resulting libMesaGL.so file will not work
with Linux Quake because of the different C runtime libraries.
The symptom of this is a segmentation fault soon after starting Quake.
If you want to use a newer version of Mesa (like 3.x) with Quake on
RedHat 5.x then read on.
The solution to the C library problem is to force Mesa to use libc5.
libc5 is in /usr/i486-linux-libc5/lib on RedHat 5.x systems.
Emil Briggs (briggs@tick.physics.ncsu.edu) nicely gave me the following
info:
> I only know what works on a RedHat 5.0 distribution. RH5 includes
> a full set of libraries for both libc5 and glibc. The loader ld.so
> uses the libc5 libraries in /usr/i486-linux-libc5/lib for programs
> linked against libc5 while it uses the glibc libraries in /lib and
> /usr/lib for programs linked against glibc.
>
> Anyway I changed line 41 of mklib.glide to
> GLIDELIBS="-L/usr/local/glide/lib -lglide2x -L/usr/i486-linux-libc5/lib"
>
> And I started quake2 up with a script like this
> #!/bin/csh
> setenv LD_LIBRARY_PATH /usr/i486-linux-libc5/lib
> setenv MESA_GLX_FX f
> ./quake2 +set vid_ref gl
> kbd_mode -a
> reset
I've already patched the mklib.glide file. You'll have to start Quake
with the script shown above though.
**********************
Daryll Strauss writes:
Here's my thoughts on the problem. On a RH 5.x system, you can NOT build
a libc5 executable or library. Red Hat just doesn't include the right
stuff to do it.
Since Quake is a libc5 based application, you are in trouble. You need
libc5 libraries.
What can you do about it? Well there's a package called gcc5 that does
MOST of the right stuff to compile with libc5. (It brings back older
header files, makes appropriate symbolic links for libraries, and sets
up the compiler to use the correct directories) You can find gcc5 here:
ftp://ecg.mit.edu/pub/linux/gcc5-1.0-1.i386.rpm
No, this isn't quite enough. There are still a few tricks to getting
Mesa to compile as a libc5 application. First you have to make sure that
every compile uses gcc5 instead of gcc. Second, in some cases the link
line actually lists -L/usr/lib which breaks gcc5 (because it forces you
to use the glibc version of things)
If you get all the stuff correctly compiled with gcc5 it should work.
I've run Mesa 3.0B6 and its demos in a window with my Rush on a Red Hat
5.1 system. It is a big hassle, but it can be done. I've only made Quake
segfault, but I think that's from my libRush using the wrong libc.
Yes, mixing libc5 and glibc is a major pain. I've been working to get
all my libraries compiling correctly with this setup. Someone should
make an RPM out of it and feed changes back to Brian once they get it
all working. If no one else has done so by the time I get the rest of my
stuff straightened out, I'll try to do it myself.
- |Daryll
*********************
David Bucciarelli (tech.hmw@plus.it) writes:
I'm using the Mesa-3.0beta7 and the RedHat 5.1 and QuakeII is
working fine for me. I had only to make a small change to the
Mesa-3.0/mklib.glide file, from:
GLIDELIBS="-L/usr/local/glide/lib -lglide2x
-L/usr/i486-linux-libc5/lib -lm"
to:
GLIDELIBS="-L/usr/i486-linux-libc5/lib -lglide2x"
and to make two symbolic links:
[david@localhost Mesa]$ ln -s libMesaGL.so libMesaGL.so.2
[david@localhost Mesa]$ ln -s libMesaGLU.so libMesaGLU.so.2
I'm using the Daryll's Linux glide rpm for the Voodoo2 and glibc (it
includes also the Glide for the libc5). I'm not using the /dev/3Dfx and
running QuakeII as root with the following env. var:
export
LD_LIBRARY_PATH=/dsk1/home/david/src/gl/Mesa/lib:/usr/i486-linux-libc5/lib
I think that all problems are related to the glibc, Quake will never
work if you get the following output:
[david@localhost Mesa]$ ldd lib/libMesaGL.so
libglide2x.so => /usr/lib/libglide2x.so (0x400f8000)
libm.so.6 => /lib/libm.so.6 (0x40244000)
libc.so.6 => /lib/libc.so.6 (0x4025d000)
/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x00000000)
You must get the following outputs:
[david@localhost Mesa]# ldd lib/libMesaGL.so
libglide2x.so => /usr/i486-linux-libc5/lib/libglide2x.so
(0x400f3000)
[root@localhost quake2]# ldd quake2
libdl.so.1 => /lib/libdl.so.1 (0x40005000)
libm.so.5 => /usr/i486-linux-libc5/lib/libm.so.5 (0x40008000)
libc.so.5 => /usr/i486-linux-libc5/lib/libc.so.5 (0x40010000)
[root@localhost quake2]# ldd ref_gl.so
libMesaGL.so.2 =>
/dsk1/home/david/src/gl/Mesa/lib/libMesaGL.so.2 (0x400eb000)
libglide2x.so => /usr/i486-linux-libc5/lib/libglide2x.so
(0x401d9000)
libX11.so.6 => /usr/i486-linux-libc5/lib/libX11.so.6
(0x40324000)
libXext.so.6 => /usr/i486-linux-libc5/lib/libXext.so.6
(0x403b7000)
libvga.so.1 => /usr/i486-linux-libc5/lib/libvga.so.1
(0x403c1000)
libm.so.5 => /usr/i486-linux-libc5/lib/libm.so.5 (0x403f5000)
libc.so.5 => /usr/i486-linux-libc5/lib/libc.so.5 (0x403fd000)
***********************
Steve Davies (steve@one47.demon.co.uk) writes:
Try using:
export LD_LIBRARY_PATH=/usr/i486-linux-libc5/lib
./quake2 +set vid_ref gl
to start the game... Works for me, but assumes that you have the
compatability libc5 RPMs installed.
***************************
WWW resources - you may find additional Linux Quake help at these URLs:
http://quake.medina.net/howto
http://webpages.mr.net/bobz
http://www.linuxgames.com/quake2/
----------------------------------------------------------------------

View File

@@ -1,52 +0,0 @@
Mesa Threads README
-------------------
Thread safety was introduced in Mesa 2.6 by John Stone and
Christoph Poliwoda.
It was redesigned in Mesa 3.3 so that thread safety is
supported by default (on systems which support threads,
that is). There is no measurable penalty on single
threaded applications.
NOTE that the only _driver_ which is thread safe at this time
is the OS/Mesa driver!
At present the mthreads code supports three thread APIS:
1) POSIX threads (aka pthreads).
2) Solaris / Unix International threads.
3) Win32 threads (Win 95/NT).
Support for other thread libraries can be added src/glthread.[ch]
In order to guarantee proper operation, it is
necessary for both Mesa and application code to use the same threads API.
So, if your application uses Sun's thread API, then you should build Mesa
using one of the targets for Sun threads.
The mtdemos directory contains some example programs which use
multiple threads to render to osmesa rendering context(s).
Linux users should be aware that there exist many different POSIX
threads packages. The best solution is the linuxthreads package
(http://pauillac.inria.fr/~xleroy/linuxthreads/) as this package is the
only one that really supports multiprocessor machines (AFAIK). See
http://pauillac.inria.fr/~xleroy/linuxthreads/README for further
information about the usage of linuxthreads.
If you are interested in helping with thread safety work in Mesa
join the Mesa developers mailing list and post your proposal.
Regards,
John Stone -- j.stone@acm.org johns@cs.umr.edu
Christoph Poliwoda -- poliwoda@volumegraphics.com
Version info:
Mesa 2.6 - initial thread support.
Mesa 3.3 - thread support mostly rewritten (Brian Paul)

View File

@@ -11,3 +11,34 @@ INFORMATION FOR PACKAGED MEDIA IS EXPRESSLY PROHIBITED WITHOUT A LICENSE
UNDER APPLICABLE PATENTS IN THE MPEG-2 PATENT PORTFOLIO, WHICH LICENSES IS
AVAILABLE FROM MPEG LA, LLC, 6312 S. Fiddlers Green Circle, Suite 400E,
Greenwood Village, Colorado 80111 U.S.A.
WARRANTY DISCLAIMER: THE SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
KIND. AMD DISCLAIMS ALL WARRANTIES, EXPRESS, IMPLIED, OR STATUTORY, INCLUDING
BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
PARTICULAR PURPOSE, TITLE, NON-INFRINGEMENT, THAT THE SOFTWARE WILL RUN
UNINTERRUPTED OR ERROR-FREE OR WARRANTIES ARISING FROM CUSTOM OF TRADE OR
COURSE OF USAGE. THE ENTIRE RISK ASSOCIATED WITH THE USE OF THE SOFTWARE IS
ASSUMED BY YOU. Some jurisdictions do not allow the exclusion of implied
warranties, so the above exclusion may not apply to You.
LIMITATION OF LIABILITY AND INDEMNIFICATION: AMD AND ITS LICENSORS WILL NOT,
UNDER ANY CIRCUMSTANCES BE LIABLE FOR ANY PUNITIVE, DIRECT, INCIDENTAL,
INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING FROM USE OF THE SOFTWARE OR
THIS AGREEMENT EVEN IF AMD AND ITS LICENSORS HAVE BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES. In no event shall AMD's total liability to You
for all damages, losses, and causes of action (whether in contract, tort
(including negligence) or otherwise) exceed the amount of $100 USD. You agree
to defend, indemnify and hold harmless AMD and its licensors, and any of their
directors, officers, employees, affiliates or agents from and against any and
all loss, damage, liability and other expenses (including reasonable
attorneys' fees), resulting from Your use of the Software or violation of the
terms and conditions of this Agreement.
U.S. GOVERNMENT RESTRICTED RIGHTS: The Software is provided with "RESTRICTED
RIGHTS." Use, duplication, or disclosure by the Government is subject to the
restrictions as set forth in FAR 52.227-14 and DFAR252.227-7013, et seq., or
its successor. Use of the Software by the Government constitutes
acknowledgement of AMD's proprietary rights in them.
EXPORT RESTRICTIONS: The Software may be subject to export restrictions as
stated in the Software License Agreement.

43
docs/README.VCE Normal file
View File

@@ -0,0 +1,43 @@
The software may implement third party technologies (e.g. third party
libraries) that are not licensed to you by AMD and for which you may need
to obtain licenses from other parties. Unless explicitly stated otherwise,
these third party technologies are not licensed hereunder. Such third
party technologies include, but are not limited, to H.264, MPEG-2, MPEG-4,
AVC, and VC-1.
For MPEG-2 Intermediate Products: ANY USE OF THIS PRODUCT IN ANY MANNER OTHER
THAN PERSONAL USE THAT COMPLIES WITH THE MPEG-2 STANDARD IS EXPRESSLY
PROHIBITED WITHOUT A LICENSE UNDER APPLICABLE PATENTS IN THE MPEG-2 PATENT
PORTFOLIO, WHICH LICENSES IS AVAILABLE FROM MPEG LA, LLC, 6312 S. Fiddlers
Green Circle, Suite 400E, Greenwood Village, Colorado 80111 U.S.A.
WARRANTY DISCLAIMER: THE SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
KIND. AMD DISCLAIMS ALL WARRANTIES, EXPRESS, IMPLIED, OR STATUTORY, INCLUDING
BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
PARTICULAR PURPOSE, TITLE, NON-INFRINGEMENT, THAT THE SOFTWARE WILL RUN
UNINTERRUPTED OR ERROR-FREE OR WARRANTIES ARISING FROM CUSTOM OF TRADE OR
COURSE OF USAGE. THE ENTIRE RISK ASSOCIATED WITH THE USE OF THE SOFTWARE IS
ASSUMED BY YOU. Some jurisdictions do not allow the exclusion of implied
warranties, so the above exclusion may not apply to You.
LIMITATION OF LIABILITY AND INDEMNIFICATION: AMD AND ITS LICENSORS WILL NOT,
UNDER ANY CIRCUMSTANCES BE LIABLE FOR ANY PUNITIVE, DIRECT, INCIDENTAL,
INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING FROM USE OF THE SOFTWARE OR
THIS AGREEMENT EVEN IF AMD AND ITS LICENSORS HAVE BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES. In no event shall AMD's total liability to You
for all damages, losses, and causes of action (whether in contract, tort
(including negligence) or otherwise) exceed the amount of $100 USD. You agree
to defend, indemnify and hold harmless AMD and its licensors, and any of their
directors, officers, employees, affiliates or agents from and against any and
all loss, damage, liability and other expenses (including reasonable
attorneys' fees), resulting from Your use of the Software or violation of the
terms and conditions of this Agreement.
U.S. GOVERNMENT RESTRICTED RIGHTS: The Software is provided with "RESTRICTED
RIGHTS." Use, duplication, or disclosure by the Government is subject to the
restrictions as set forth in FAR 52.227-14 and DFAR252.227-7013, et seq., or
its successor. Use of the Software by the Government constitutes
acknowledgement of AMD's proprietary rights in them.
EXPORT RESTRICTIONS: The Software may be subject to export restrictions as
stated in the Software License Agreement.

View File

@@ -36,17 +36,15 @@ Recipe
Building on windows requires several open-source packages. These are
steps that work as of this writing.
1) install python 2.7
2) install scons (latest)
3) install mingw, flex, and bison
4) install libxml2 from here: http://www.lfd.uci.edu/~gohlke/pythonlibs
get libxml2-python-2.9.1.win-amd64-py2.7.exe
5) install pywin32 from here: http://www.lfd.uci.edu/~gohlke/pythonlibs
- install python 2.7
- install scons (latest)
- install mingw, flex, and bison
- install pywin32 from here: http://www.lfd.uci.edu/~gohlke/pythonlibs
get pywin32-218.4.win-amd64-py2.7.exe
6) install git
7) download mesa from git
- install git
- download mesa from git
see http://www.mesa3d.org/repository.html
8) run scons
- run scons
General
-------

View File

@@ -19,7 +19,7 @@
<p>
The SGI OpenGL conformance tests verify correct operation of OpenGL
implementations. I, Brian Paul, have been given a copy of the tests
for testing Mesa. The tests are not publically available.
for testing Mesa. The tests are not publicly available.
</p>
<p>
This file has the latest results of testing Mesa with the OpenGL 1.2

View File

@@ -17,7 +17,7 @@
<h1>Development Notes</h1>
<h2>Adding Extentions</h2>
<h2>Adding Extensions</h2>
<p>
To add a new GL extension to Mesa you have to do at least the following.
@@ -56,6 +56,11 @@ To add a new GL extension to Mesa you have to do at least the following.
If the new extension adds new GL state, the functions in get.c, enable.c
and attrib.c will most likely require new code.
</li>
<li>
The dispatch tests check_table.cpp and dispatch_sanity.cpp
should be updated with details about the new extensions functions. These
tests are run using 'make check'
</li>
</ul>
@@ -190,11 +195,31 @@ you should add an appropriate note to the commit message.
Here are some examples of such a note:
</p>
<ul>
<li>NOTE: This is a candidate for the 9.0 branch.</li>
<li>NOTE: This is a candidate for the 8.0 and 9.0 branches.</li>
<li>NOTE: This is a candidate for the stable branches.</li>
<li>CC: &lt;mesa-stable@lists.freedesktop.org&gt;</li>
<li>CC: "9.2 10.0" &lt;mesa-stable@lists.freedesktop.org&gt;</li>
<li>CC: "10.0" &lt;mesa-stable@lists.freedesktop.org&gt;</li>
</ul>
Simply adding the CC to the mesa-stable list address is adequate to nominate
the commit for the most-recently-created stable branch. It is only necessary
to specify a specific branch name, (such as "9.2 10.0" or "10.0" in the
examples above), if you want to nominate the commit for an older stable
branch. And, as in these examples, you can nominate the commit for the older
branch in addition to the more recent branch, or nominate the commit
exclusively for the older branch.
This "CC" syntax for patch nomination will cause patches to automatically be
copied to the mesa-stable@ mailing list when you use "git send-email" to send
patches to the mesa-dev@ mailing list. Also, if you realize that a commit
should be nominated for the stable branch after it has already been committed,
you can send a note directly to the mesa-stable@lists.freedesktop.org where
the Mesa stable-branch maintainers will receive it. Be sure to mention the
commit ID of the commit of interest (as it appears in the mesa master branch).
The latest set of patches that have been nominated, accepted, or rejected for
the upcoming stable release can always be seen on the
<a href=http://cworth.org/~cworth/mesa-stable-queue/">Mesa Stable Queue</a>
page.
<h2>Cherry-picking candidates for a stable branch</h2>

View File

@@ -25,7 +25,7 @@ href="#overview">overview of Mesa's implementation</a>.</p>
<h2>1. Complexity of GL Dispatch</h2>
<p>Every GL application has at least one object called a GL <em>context</em>.
This object, which is an implicit parameter to ever GL function, stores all
This object, which is an implicit parameter to every GL function, stores all
of the GL related state for the application. Every texture, every buffer
object, every enable, and much, much more is stored in the context. Since
an application can have more than one context, the context to be used is
@@ -51,7 +51,7 @@ example, <tt>glFogCoordf</tt> may operate differently depending on whether
or not fog is enabled.</p>
<p>In multi-threaded environments, it is possible for each thread to have a
differnt GL context current. This means that poor old <tt>glVertex3fv</tt>
different GL context current. This means that poor old <tt>glVertex3fv</tt>
has to know which GL context is current in the thread where it is being
called.</p>
@@ -207,13 +207,13 @@ few preprocessor defines.</p>
<li>If <tt>GLX_USE_TLS</tt> is defined, method #4 is used.</li>
<li>If <tt>HAVE_PTHREAD</tt> is defined, method #3 is used.</li>
<li>If <tt>WIN32_THREADS</tt> is defined, method #2 is used.</li>
<li>If none of the preceeding are defined, method #1 is used.</li>
<li>If none of the preceding are defined, method #1 is used.</li>
</ul>
<p>Two different techniques are used to handle the various different cases.
On x86 and SPARC, a macro called <tt>GL_STUB</tt> is used. In the preamble
of the assembly source file different implementations of the macro are
selected based on the defined preprocessor variables. The assmebly code
selected based on the defined preprocessor variables. The assembly code
then consists of a series of invocations of the macros such as:
<blockquote>
@@ -242,7 +242,7 @@ first technique, is to insert <tt>#ifdef</tt> within the assembly
implementation of each function. This makes the assembly file considerably
larger (e.g., 29,332 lines for <tt>glapi_x86-64.S</tt> versus 1,155 lines for
<tt>glapi_x86.S</tt>) and causes simple changes to the function
implementation to generate many lines of diffs. Since the assmebly files
implementation to generate many lines of diffs. Since the assembly files
are typically generated by scripts (see <a href="#autogen">below</a>), this
isn't a significant problem.</p>

View File

@@ -88,7 +88,7 @@ drivers will be installed to <code>${libdir}/egl</code>.</p>
<dd>
<p>List the platforms (window systems) to support. Its argument is a comma
seprated string such as <code>--with-egl-platforms=x11,drm</code>. It decides
separated string such as <code>--with-egl-platforms=x11,drm</code>. It decides
the platforms a driver may support. The first listed platform is also used by
the main library to decide the native platform: the platform the EGL native
types such as <code>EGLNativeDisplayType</code> or
@@ -223,7 +223,7 @@ the X server directly using (XCB-)DRI2 protocol.</p>
<dd>
<p>This driver is based on Gallium3D. It supports all rendering APIs and
hardwares supported by Gallium3D. It is the only driver that supports OpenVG.
hardware supported by Gallium3D. It is the only driver that supports OpenVG.
The supported platforms are X11, DRM, FBDEV, and GDI.</p>
<p>This driver comes with its own hardware drivers
@@ -232,16 +232,6 @@ The supported platforms are X11, DRM, FBDEV, and GDI.</p>
</dd>
<dt><code>egl_glx</code></dt>
<dd>
<p>This driver provides a wrapper to GLX. It uses exclusively GLX to implement
the EGL API. It supports both direct and indirect rendering when the GLX does.
It is accelerated when the GLX is. As such, it cannot provide functions that
is not available in GLX or GLX extensions.</p>
</dd>
</dl>
<h2>Packaging</h2>
<p>The ABI between the main library and its drivers are not stable. Nor is
@@ -262,10 +252,6 @@ is disabled by default.</p>
<code>src/egl/</code>. The sources of the <code>egl</code> state tracker can
be found at <code>src/gallium/state_trackers/egl/</code>.</p>
<p>The suggested way to learn to write a EGL driver is to see how other drivers
are written. <code>egl_glx</code> should be a good reference. It works in any
environment that has GLX support, and it is simpler than most drivers.</p>
<h3>Lifetime of Display Resources</h3>
<p>Contexts and surfaces are examples of display resources. They might live
@@ -273,8 +259,8 @@ longer than the display that creates them.</p>
<p>In EGL, when a display is terminated through <code>eglTerminate</code>, all
display resources should be destroyed. Similarly, when a thread is released
throught <code>eglReleaseThread</code>, all current display resources should be
released. Another way to destory or release resources is through functions
through <code>eglReleaseThread</code>, all current display resources should be
released. Another way to destroy or release resources is through functions
such as <code>eglDestroySurface</code> or <code>eglMakeCurrent</code>.</p>
<p>When a resource that is current to some thread is destroyed, the resource

View File

@@ -47,7 +47,7 @@ sometimes be useful for debugging end-user issues.
<li>MESA_NO_SSE - if set, disables Intel SSE optimizations
<li>MESA_DEBUG - if set, error messages are printed to stderr. For example,
if the application generates a GL_INVALID_ENUM error, a corresponding error
message indicating where the error occured, and possibly why, will be
message indicating where the error occurred, and possibly why, will be
printed to stderr.<br>
If the value of MESA_DEBUG is 'FP' floating point arithmetic errors will
generate exceptions.
@@ -121,10 +121,38 @@ See the <a href="xlibdriver.html">Xlib software driver page</a> for details.
<h2>i945/i965 driver environment variables (non-Gallium)</h2>
<ul>
<li>INTEL_STRICT_CONFORMANCE - if set to 1, enable sw fallbacks to improve
OpenGL conformance. If set to 2, always use software rendering.
<li>INTEL_NO_BLIT - if set, disable hardware-accelerated glBitmap,
glCopyPixels, glDrawPixels.
<li>INTEL_NO_HW - if set to 1, prevents batches from being submitted to the hardware.
This is useful for debugging hangs, etc.</li>
<li>INTEL_DEBUG - a comma-separated list of named flags, which do various things:
<ul>
<li>tex - emit messages about textures.</li>
<li>state - emit messages about state flag tracking</li>
<li>blit - emit messages about blit operations</li>
<li>miptree - emit messages about miptrees</li>
<li>perf - emit messages about performance issues</li>
<li>perfmon - emit messages about AMD_performance_monitor</li>
<li>bat - emit batch information</li>
<li>pix - emit messages about pixel operations</li>
<li>buf - emit messages about buffer objects</li>
<li>reg - emit messages about regions</li>
<li>fbo - emit messages about framebuffers</li>
<li>fs - dump shader assembly for fragment shaders</li>
<li>gs - dump shader assembly for geometry shaders</li>
<li>sync - emit messages about synchronization</li>
<li>prim - emit messages about drawing primitives</li>
<li>vert - emit messages about vertex assembly</li>
<li>dri - emit messages about the DRI interface</li>
<li>sf - emit messages about the strips &amp; fans unit (for old gens, includes the SF program)</li>
<li>stats - enable statistics counters. you probably actually want perfmon or intel_gpu_top instead.</li>
<li>urb - emit messages about URB setup</li>
<li>vs - dump shader assembly for vertex shaders</li>
<li>clip - emit messages about the clip unit (for old gens, includes the CLIP program)</li>
<li>aub - dump batches into an AUB trace for use with simulation tools</li>
<li>shader_time - record how much GPU time is spent in each shader</li>
<li>no16 - suppress generation of 16-wide fragment shaders. useful for debugging broken shaders</li>
<li>blorp - emit messages about the blorp operations (blits &amp; clears)</li>
<li>nodualobj - suppress generation of dual-object geometry shader code</li>
</ul>
</ul>
@@ -173,14 +201,14 @@ See src/mesa/state_tracker/st_debug.c for other options.
to stderr
<li>SOFTPIPE_NO_RAST - if set, rasterization is no-op'd. For profiling purposes.
<li>SOFTPIPE_USE_LLVM - if set, the softpipe driver will try to use LLVM JIT for
vertex shading procesing.
vertex shading processing.
</ul>
<h3>LLVMpipe driver environment variables</h3>
<ul>
<li>LP_NO_RAST - if set LLVMpipe will no-op rasterization
<li>LP_DEBUG - a comma-separated list of debug options is acceptec. See the
<li>LP_DEBUG - a comma-separated list of debug options is accepted. See the
source code for details.
<li>LP_PERF - a comma-separated list of options to selectively no-op various
parts of the driver. See the source code for details.

View File

@@ -137,7 +137,7 @@ Just follow the Mesa <a href="install.html">compilation instructions</a>.
<h2>1.6 Are there other open-source implementations of OpenGL?</h2>
<p>
Yes, SGI's <a href="http://oss.sgi.com/projects/ogl-sample/index.html">
OpenGL Sample Implemenation (SI)</a> is available.
OpenGL Sample Implementation (SI)</a> is available.
The SI was written during the time that OpenGL was originally designed.
Unfortunately, development of the SI has stagnated.
Mesa is much more up to date with modern features and extensions.
@@ -353,7 +353,7 @@ That's where Mesa development is discussed.
</p>
<p>
The <a href="http://www.opengl.org/documentation">
OpenGL Specification</a> is the bible for OpenGL implemention work.
OpenGL Specification</a> is the bible for OpenGL implementation work.
You should read it.
</p>
<p>Most of the Mesa development work involves implementing new OpenGL
@@ -375,7 +375,7 @@ For a Gallium3D hardware driver, the r300g, r600g and the i915g are good example
</p>
<p>The DRI website has more information about writing hardware drivers.
The process isn't well document because the Mesa driver interface changes
over time, and we seldome have spare time for writing documentation.
over time, and we seldom have spare time for writing documentation.
That being said, many people have managed to figure out the process.
</p>
<p>
@@ -390,7 +390,7 @@ The <a href="http://oss.sgi.com/projects/ogl-sample/registry/EXT/texture_compres
indicates that there are intellectual property (IP) and/or patent issues
to be dealt with.
</p>
<p>We've been unsucessful in getting a response from S3 (or whoever owns
<p>We've been unsuccessful in getting a response from S3 (or whoever owns
the IP nowadays) to indicate whether or not an open source project can
implement the extension (specifically the compression/decompression
algorithms).

View File

@@ -16,6 +16,88 @@
<h1>News</h1>
<h2>June 6, 2014</h2>
<p>
<a href="relnotes/10.2.1.html">Mesa 10.2.1</a> is released. This release
only fixes a build error in the radeonsi driver that was introduced between
10.2-rc5 and the 10.2 final release.
</p>
<h2>June 6, 2014</h2>
<p>
<a href="relnotes/10.2.html">Mesa 10.2</a> is released. This is a new
development release. See the release notes for more information about
the release.
</p>
<h2>April 18, 2014</h2>
<p>
<a href="relnotes/10.1.1.html">Mesa 10.1.1</a> is released.
This is a bug-fix release.
</p>
<h2>April 18, 2014</h2>
<p>
<a href="relnotes/10.0.5.html">Mesa 10.0.5</a> is released.
This is a bug-fix release.
<br>
NOTE: Since the 10.1.1 release is being released concurrently, it is
anticipated that 10.0.5 will be the final release in the 10.0
series. Users of 10.0 are encouraged to migrate to the 10.1 series in
order to obtain future fixes.
</p>
<h2>March 12, 2014</h2>
<p>
<a href="relnotes/10.0.4.html">Mesa 10.0.4</a> is released.
This is a bug-fix release.
</p>
<h2>March 4, 2014</h2>
<p>
<a href="relnotes/10.1.html">Mesa 10.1</a> is released.
This is a new development release.
See the release notes for more information about the release.
</p>
<h2>February 3, 2014</h2>
<p>
<a href="relnotes/10.0.3.html">Mesa 10.0.3</a> is released.
This is a bug-fix release.
</p>
<h2>January 9, 2014</h2>
<p>
<a href="relnotes/10.0.2.html">Mesa 10.0.2</a> is released.
This is a bug-fix release.
</p>
<h2>December 12, 2013</h2>
<p>
<a href="relnotes/10.0.1.html">Mesa 10.0.1</a>
and <a href="relnotes/9.2.5.html">Mesa 9.2.5</a> are released.
These are both bug-fix releases.
</p>
<h2>November 30, 2013</h2>
<p>
<a href="relnotes/10.0.html">Mesa 10.0</a> is released.
This is a new development release.
See the release notes for more information about the release.
</p>
<h2>November 27, 2013</h2>
<p>
<a href="relnotes/9.2.4.html">Mesa 9.2.4</a> is released.
This is a bug fix release.
</p>
<h2>November 13, 2013</h2>
<p>
<a href="relnotes/9.2.3.html">Mesa 9.2.3</a> is released.
This is a bug fix release.
</p>
<h2>October 18, 2013</h2>
<p>
<a href="relnotes/9.2.2.html">Mesa 9.2.2</a> is released.

View File

@@ -44,10 +44,6 @@ On Windows with MinGW, install flex and bison with:
</li>
<li>python - Python is needed for building the Gallium components.
Version 2.6.4 or later should work.
<br>
<br>
To build OpenGL ES 1.1 and 2.0 you'll also need
<a href="http://xmlsoft.org/sources/win32/python/libxml2-python-2.7.7.win32-py2.7.exe">libxml2-python</a>.
</li>
</ul>

View File

@@ -103,6 +103,9 @@ Device drivers src/mesa/drivers/* MIT, generally
Ext headers include/GL/glext.h Khronos
include/GL/glxext.h
C11 thread include/c11/threads*.h Boost (permissive)
emulation
</pre>
<p>

View File

@@ -203,11 +203,66 @@ for posterior analysis, e.g.:
We use LLVM-C bindings for now. They are not documented, but follow the C++
interfaces very closely, and appear to be complete enough for code
generation. See
http://npcontemplation.blogspot.com/2008/06/secret-of-llvm-c-bindings.html
for a stand-alone example. See the llvm-c/Core.h file for reference.
<a href="http://npcontemplation.blogspot.com/2008/06/secret-of-llvm-c-bindings.html">
this stand-alone example</a>. See the llvm-c/Core.h file for reference.
</li>
</ul>
<h1 id="recommended_reading">Recommended Reading</h1>
<ul>
<li>
<p>Rasterization</p>
<ul>
<li><a href="http://www.cs.unc.edu/~olano/papers/2dh-tri/">Triangle Scan Conversion using 2D Homogeneous Coordinates</a></li>
<li><a href="http://www.drdobbs.com/parallel/rasterization-on-larrabee/217200602">Rasterization on Larrabee</a> (<a href="http://devmaster.net/posts/2887/rasterization-on-larrabee">DevMaster copy</a>)</li>
<li><a href="http://devmaster.net/posts/6133/rasterization-using-half-space-functions">Rasterization using half-space functions</a></li>
<li><a href="http://devmaster.net/posts/6145/advanced-rasterization">Advanced Rasterization</a></li>
<li><a href="http://fgiesen.wordpress.com/2013/02/17/optimizing-sw-occlusion-culling-index/">Optimizing Software Occlusion Culling</a></li>
</ul>
</li>
<li>
<p>Texture sampling</p>
<ul>
<li><a href="http://chrishecker.com/Miscellaneous_Technical_Articles#Perspective_Texture_Mapping">Perspective Texture Mapping</a></li>
<li><a href="http://www.flipcode.com/archives/Texturing_As_In_Unreal.shtml">Texturing As In Unreal</a></li>
<li><a href="http://www.gamasutra.com/view/feature/3301/runtime_mipmap_filtering.php">Run-Time MIP-Map Filtering</a></li>
<li><a href="http://alt.3dcenter.org/artikel/2003/10-26_a_english.php">Will "brilinear" filtering persist?</a></li>
<li><a href="http://ixbtlabs.com/articles2/gffx/nv40-rx800-3.html">Trilinear filtering</a></li>
<li><a href="http://devmaster.net/posts/12785/texture-swizzling">Texture Swizzling</a></li>
</ul>
</li>
<li>
<p>SIMD</p>
<ul>
<li><a href="http://www.cdl.uni-saarland.de/projects/wfv/#header4">Whole-Function Vectorization</a></li>
</ul>
</li>
<li>
<p>Optimization</p>
<ul>
<li><a href="http://www.drdobbs.com/optimizing-pixomatic-for-modern-x86-proc/184405807">Optimizing Pixomatic For Modern x86 Processors</a></li>
<li><a href="http://www.intel.com/content/www/us/en/architecture-and-technology/64-ia-32-architectures-optimization-manual.html">Intel 64 and IA-32 Architectures Optimization Reference Manual</a></li>
<li><a href="http://www.agner.org/optimize/">Software optimization resources</a></li>
<li><a href="http://software.intel.com/en-us/articles/intel-intrinsics-guide">Intel Intrinsics Guide</a><li>
</ul>
</li>
<li>
<p>LLVM</p>
<ul>
<li><a href="http://llvm.org/docs/LangRef.html">LLVM Language Reference Manual</a></li>
<li><a href="http://npcontemplation.blogspot.co.uk/2008/06/secret-of-llvm-c-bindings.html">The secret of LLVM C bindings</a></li>
</ul>
</li>
<li>
<p>General</p>
<ul>
<li><a href="http://fgiesen.wordpress.com/2011/07/09/a-trip-through-the-graphics-pipeline-2011-index/">A trip through the Graphics Pipeline</a></li>
<li><a href="http://msdn.microsoft.com/en-us/library/gg615082.aspx#architecture">WARP Architecture and Performance</a></li>
</ul>
</li>
</ul>
</div>
</body>
</html>

View File

@@ -16,7 +16,7 @@
<h1>OpenGL ES</h1>
<p>Mesa implements OpenGL ES 1.1 and OpenGL ES 2.0. More informations about
<p>Mesa implements OpenGL ES 1.1 and OpenGL ES 2.0. More information about
OpenGL ES can be found at <a href="http://www.khronos.org/opengles/">
http://www.khronos.org/opengles/</a>.</p>
@@ -48,7 +48,7 @@ EGL drivers for your hardware.</p>
<h3>Dispatch Table</h3>
<p>OpenGL ES has an additional indirection when dispatching fucntions</p>
<p>OpenGL ES has an additional indirection when dispatching functions</p>
<pre>
Mesa: glFoo() --&gt; _mesa_Foo()

View File

@@ -20,7 +20,7 @@
The current version of the OpenVG state tracker implements OpenVG 1.1.
</p>
<p>
More informations about OpenVG can be found at
More information about OpenVG can be found at
<a href="http://www.khronos.org/openvg/">
http://www.khronos.org/openvg/</a> .
</p>

View File

@@ -21,7 +21,19 @@ The release notes summarize what's new or changed in each Mesa release.
</p>
<ul>
<li><a href="relnotes/10.2.1.html">10.2.1 release notes</a>
<li><a href="relnotes/10.2.html">10.2 release notes</a>
<li><a href="relnotes/10.1.1.html">10.1.1 release notes</a>
<li><a href="relnotes/10.1.html">10.1 release notes</a>
<li><a href="relnotes/10.0.5.html">10.0.5 release notes</a>
<li><a href="relnotes/10.0.4.html">10.0.4 release notes</a>
<li><a href="relnotes/10.0.3.html">10.0.3 release notes</a>
<li><a href="relnotes/10.0.2.html">10.0.2 release notes</a>
<li><a href="relnotes/10.0.1.html">10.0.1 release notes</a>
<li><a href="relnotes/10.0.html">10.0 release notes</a>
<li><a href="relnotes/9.2.5.html">9.2.5 release notes</a>
<li><a href="relnotes/9.2.4.html">9.2.4 release notes</a>
<li><a href="relnotes/9.2.3.html">9.2.3 release notes</a>
<li><a href="relnotes/9.2.2.html">9.2.2 release notes</a>
<li><a href="relnotes/9.2.1.html">9.2.1 release notes</a>
<li><a href="relnotes/9.2.html">9.2 release notes</a>

150
docs/relnotes/10.0.1.html Normal file
View File

@@ -0,0 +1,150 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Mesa Release Notes</title>
<link rel="stylesheet" type="text/css" href="../mesa.css">
</head>
<body>
<div class="header">
<h1>The Mesa 3D Graphics Library</h1>
</div>
<iframe src="../contents.html"></iframe>
<div class="content">
<h1>Mesa 10.0.1 Release Notes / (December 12, 2013)</h1>
<p>
Mesa 10.0.1 is a bug fix release which fixes bugs found since the 10.0 release.
</p>
<p>
Mesa 10.0.1 implements the OpenGL 3.3 API, but the version reported by
glGetString(GL_VERSION) or glGetIntegerv(GL_MAJOR_VERSION) /
glGetIntegerv(GL_MINOR_VERSION) depends on the particular driver being used.
Some drivers don't support all the features required in OpenGL 3.3. OpenGL
3.3 is <strong>only</strong> available if requested at context creation
because compatibility contexts not supported.
</p>
<h2>MD5 checksums</h2>
<pre>
0a72ca5b36046a658bf6038326ff32ed MesaLib-10.0.1.tar.bz2
01bde35c912e504ba62caf1ef9f7022c MesaLib-10.0.1.tar.gz
59a174a11a89e6b1b8ee9c3f7e3c388c MesaLib-10.0.1.zip
</pre>
<h2>New features</h2>
<p>None</p>
<h2>Bug fixes</h2>
<p>This list is likely incomplete.</p>
<ul>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=64323">Bug 64323</a> - Severe misrendering in Left 4 Dead 2</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=68838">Bug 68838</a> - GLSL: struct declarations produce a &quot;empty declaration warning&quot; in 9.2</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=69155">Bug 69155</a> - [NV50 gallium] [piglit] bin/varying-packing-simple triggers memory corruption/failures</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=70250">Bug 70250</a> - weston-terminal rendering corrupted with output transform 90 and 270</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=70601">Bug 70601</a> - [SNB Bisected]Piglit spec/ARB_texture_float/multisample-formats 2 GL_ARB_texture_float fails</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=72230">Bug 72230</a> - Unable to extract MesaLib-10.0.0.tar.{gz,bz2} with bsdtar</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=72325">Bug 72325</a> - [swrast] piglit glean fbo regression</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=72327">Bug 72327</a> - [swrast] piglit glean pointSprite regression</li>
</ul>
<h2>Changes</h2>
<p>The full set of changes can be viewed by using the following git command:</p>
<pre>
git log mesa-10.0..mesa-10.0.1
</pre>
<p>Axel Davy (2):</p>
<ul>
<li>egl/wayland: Flush the wl_display at the end of SwapBuffers</li>
<li>Enable throttling in SwapBuffers</li>
</ul>
<p>Chad Versace (2):</p>
<ul>
<li>i965/hsw: Apply non-msrt fast color clear w/a to all HSW GTs</li>
<li>i965: Add extra-alignment for non-msrt fast color clear for all hw (v2)</li>
</ul>
<p>Dave Airlie (1):</p>
<ul>
<li>swrast: fix readback regression since inversion fix</li>
</ul>
<p>Emil Velikov (1):</p>
<ul>
<li>automake: include only one copy VERSION in tarball</li>
</ul>
<p>Ian Romanick (3):</p>
<ul>
<li>docs: Add 10.0 release md5sums</li>
<li>Remove a057b83 from the pick list</li>
<li>glsl: Don't emit empty declaration warning for a struct specifier</li>
</ul>
<p>Ilia Mirkin (8):</p>
<ul>
<li>mesa: don't leak performance monitors on context destroy</li>
<li>nv50: Fix GPU_READING/WRITING bit removal</li>
<li>nouveau: avoid leaking fences while waiting</li>
<li>nv50: wait on the buf's fence before sticking it into pushbuf</li>
<li>nv50: enable h264 and mpeg4 for nv98+ (vp3, vp4.0)</li>
<li>nouveau/video: update h264 picparm field names based on usage</li>
<li>nouveau/video: update a few more h264 picparm field names</li>
<li>nv50: report 15 max inputs for fragment programs</li>
</ul>
<p>Jordan Justen (1):</p>
<ul>
<li>dri megadriver_stub: add compatibility for older DRI loaders</li>
</ul>
<p>Kristian Høgsberg (2):</p>
<ul>
<li>egl/wayland: Damage INT32_MAX x INT32_MAX region for eglSwapBuffers</li>
<li>egl/wayland: Send commit after flushing the driver context</li>
</ul>
<p>Maarten Lankhorst (1):</p>
<ul>
<li>nouveau: Fix compiler warning regression</li>
</ul>
<p>Paul Berry (1):</p>
<ul>
<li>i965/gen6: Fix multisample resolve blits for luminance/intensity 32F formats.</li>
</ul>
<p>Thomas Hellstrom (1):</p>
<ul>
<li>st/xa: Bump major version number to 2</li>
</ul>
<p>Tom Stellard (2):</p>
<ul>
<li>r300/compiler/tests: Fix segfault</li>
<li>r300/compiler/tests: Fix line length check in test parser</li>
</ul>
</div>
</body>
</html>

161
docs/relnotes/10.0.2.html Normal file
View File

@@ -0,0 +1,161 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Mesa Release Notes</title>
<link rel="stylesheet" type="text/css" href="../mesa.css">
</head>
<body>
<div class="header">
<h1>The Mesa 3D Graphics Library</h1>
</div>
<iframe src="../contents.html"></iframe>
<div class="content">
<h1>Mesa 10.0.2 Release Notes / (January 9, 2014)</h1>
<p>
Mesa 10.0.2 is a bug fix release which fixes bugs found since the 10.0.1 release.
</p>
<p>
Mesa 10.0.2 implements the OpenGL 3.3 API, but the version reported by
glGetString(GL_VERSION) or glGetIntegerv(GL_MAJOR_VERSION) /
glGetIntegerv(GL_MINOR_VERSION) depends on the particular driver being used.
Some drivers don't support all the features required in OpenGL 3.3. OpenGL
3.3 is <strong>only</strong> available if requested at context creation
because compatibility contexts not supported.
</p>
<h2>MD5 checksums</h2>
<pre>
de7d14baf0101b697c140d2f47ef27e9 MesaLib-10.0.2.tar.gz
8544c0ab3e438a08b5103421ea15b6d2 MesaLib-10.0.2.tar.bz2
181b0d6c1afca38e98a930d0e564ed90 MesaLib-10.0.2.zip
</pre>
<h2>New features</h2>
<p>None</p>
<h2>Bug fixes</h2>
<p>This list is likely incomplete.</p>
<ul>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=70740">Bug 70740</a> - HiZ on SNB causes GPU hang with WebGL web app</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=72026">Bug 72026</a> - SIGSEGV in fs_visitor::visit(ir_dereference_variable*)</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=72264">Bug 72264</a> - GLSL error reporting</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=72369">Bug 72369</a> - glitches in serious sam 3 with the sb shader backend</li>
</ul>
<h2>Changes</h2>
<p>The full set of changes can be viewed by using the following git command:</p>
<pre>
git log mesa-10.0.1..mesa-10.0.2
</pre>
<p>Aaron Watry (8):</p>
<ul>
<li>clover: Remove unused variable</li>
<li>pipe_loader/sw: close dev-&gt;lib when initialization fails</li>
<li>radeon/compute: Stop leaking LLVMContexts in radeon_llvm_parse_bitcode</li>
<li>r600/compute: Free compiled kernels when deleting compute state</li>
<li>r600/compute: Use the correct FREE macro when deleting compute state</li>
<li>radeon/llvm: Free target data at end of optimization</li>
<li>st/vdpau: Destroy context when initialization fails</li>
<li>r600/pipe: Stop leaking context-&gt;start_compute_cs_cmd.buf on EG/CM</li>
</ul>
<p>Alex Deucher (1):</p>
<ul>
<li>r600g: fix SUMO2 pci id</li>
</ul>
<p>Alexander von Gluck IV (1):</p>
<ul>
<li>Haiku: Add in public GL kit headers</li>
</ul>
<p>Anuj Phogat (1):</p>
<ul>
<li>mesa: Fix error code generation in glBeginConditionalRender()</li>
</ul>
<p>Carl Worth (2):</p>
<ul>
<li>docs: Add md5sums for the 10.0.1 release.</li>
<li>Update version to 10.0.2</li>
</ul>
<p>Chad Versace (1):</p>
<ul>
<li>i965/gen6: Fix HiZ hang in WebGL Google Maps</li>
</ul>
<p>Erik Faye-Lund (1):</p>
<ul>
<li>glcpp: error on multiple #else/#elif directives</li>
</ul>
<p>Henri Verbeet (1):</p>
<ul>
<li>i915: Add support for gl_FragData[0] reads.</li>
</ul>
<p>Ilia Mirkin (1):</p>
<ul>
<li>nv50: fix a small leak on context destroy</li>
</ul>
<p>Jonathan Liu (2):</p>
<ul>
<li>st/mesa: use pipe_sampler_view_release()</li>
<li>llvmpipe: use pipe_sampler_view_release() to avoid segfault</li>
</ul>
<p>Kenneth Graunke (2):</p>
<ul>
<li>i965: Fix 3DSTATE_PUSH_CONSTANT_ALLOC_PS packet creation.</li>
<li>Revert "mesa: Remove GLXContextID typedef from glx.h."</li>
</ul>
<p>Kevin Rogovin (1):</p>
<ul>
<li>Use line number information from entire function expression</li>
</ul>
<p>Kristian Høgsberg (1):</p>
<ul>
<li>dri_util: Don't assume __DRIcontext-&gt;driverPrivate is a gl_context</li>
</ul>
<p>Marek Olšák (2):</p>
<ul>
<li>mesa: fix interpretation of glClearBuffer(drawbuffer)</li>
<li>st/mesa: fix glClear with multiple colorbuffers and different formats</li>
</ul>
<p>Paul Berry (2):</p>
<ul>
<li>glsl: Teach ir_variable_refcount about ir_loop::counter variables.</li>
<li>glsl: Fix inconsistent assumptions about ir_loop::counter.</li>
</ul>
<p>Vadim Girlin (1):</p>
<ul>
<li>r600g/sb: fix stack size computation on evergreen</li>
</ul>
</div>
</body>
</html>

206
docs/relnotes/10.0.3.html Normal file
View File

@@ -0,0 +1,206 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Mesa Release Notes</title>
<link rel="stylesheet" type="text/css" href="../mesa.css">
</head>
<body>
<div class="header">
<h1>The Mesa 3D Graphics Library</h1>
</div>
<iframe src="../contents.html"></iframe>
<div class="content">
<h1>Mesa 10.0.3 Release Notes / (February 3, 2014)</h1>
<p>
Mesa 10.0.3 is a bug fix release which fixes bugs found since the 10.0.2 release.
</p>
<p>
Mesa 10.0.3 implements the OpenGL 3.3 API, but the version reported by
glGetString(GL_VERSION) or glGetIntegerv(GL_MAJOR_VERSION) /
glGetIntegerv(GL_MINOR_VERSION) depends on the particular driver being used.
Some drivers don't support all the features required in OpenGL 3.3. OpenGL
3.3 is <strong>only</strong> available if requested at context creation
because compatibility contexts not supported.
</p>
<h2>MD5 checksums</h2>
<pre>
5f9f463ef08129f6762106b434910adb MesaLib-10.0.3.tar.bz2
fb3997b6500e153bc32370cb3fc4ca9e MesaLib-10.0.3.tar.gz
a07b4b6b9eb449b88a6cb5061e51c331 MesaLib-10.0.3.zip
</pre>
<h2>New features</h2>
<p>None</p>
<h2>Bug fixes</h2>
<p>This list is likely incomplete.</p>
<ul>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=72708">Bug 72708</a> - Master fails to build with older gcc due to -msse4.1</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=72926">Bug 72926</a> - [REGRESSION,swrast] Memory-related crash with anti-aliasing enabled</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=73096">Bug 73096</a> - Query GL_RGBA_SIGNED_COMPONENTS_EXT missing</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=73100">Bug 73100</a> - Please use AC_PATH_TOOL instead of AC_PATH_PROG for llvm-config</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=73418">Bug 73418</a> - OpenCL hangs graphics on CAYMAN</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=73473">Bug 73473</a> - Potential crash bug in src/gallium/auxiliary/rtasm/rtasm_execmem.c</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=73915">Bug 73915</a> - sample shading + centroid broken since f5cfb4a</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=73956">Bug 73956</a> - SIGSEGV when passing GL_NONE to glReadBuffer</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=74026">Bug 74026</a> - Compiler rejects chained assignments involving array dereferences</li>
</ul>
<h2>Changes</h2>
<p>The full set of changes can be viewed by using the following git command:</p>
<pre>
git log mesa-10.0.2..mesa-10.0.3
</pre>
<p>Aaron Watry (2):</p>
<ul>
<li>radeon: Move gfx/dma cs cleanup to r600_common_context_cleanup</li>
<li>st/dri: prevent leak of dri option default values</li>
</ul>
<p>Andreas Fänger (1):</p>
<ul>
<li>swrast: fix delayed texel buffer allocation regression for OpenMP</li>
</ul>
<p>Anuj Phogat (3):</p>
<ul>
<li>glsl: Disable ARB_texture_rectangle in shader version 100.</li>
<li>i965: Use sample barycentric coordinates with per sample shading</li>
<li>i965: Ignore 'centroid' interpolation qualifier in case of persample shading</li>
</ul>
<p>Brian Paul (3):</p>
<ul>
<li>mesa: implement missing glGet(GL_RGBA_SIGNED_COMPONENTS_EXT) query</li>
<li>st/mesa: fix glReadBuffer(GL_NONE) segfault</li>
<li>draw: fix incorrect vertex size computation in LLVM drawing code</li>
</ul>
<p>Carl Worth (5):</p>
<ul>
<li>Add md5sums for 10.0.2. release.</li>
<li>cherry-ignore: Ignore several patches not yet ready for the stable branch</li>
<li>Drop another couple of patches.</li>
<li>cherry-ignore: Ignore 4 patches at teh request of the author, (Anuj).</li>
<li>Update version to 10.0.3</li>
</ul>
<p>Chad Versace (1):</p>
<ul>
<li>i965/gen6/blorp: Emit more flushes to workaround hangs</li>
</ul>
<p>Chris Forbes (1):</p>
<ul>
<li>i965: fold offset into coord for textureOffset(gsampler2DRect)</li>
</ul>
<p>Emil Velikov (5):</p>
<ul>
<li>mesa: use signed temporary variable to store _ColorDrawBufferIndexes</li>
<li>st/mesa: use signed temporary variable to store _ColorDrawBufferIndexes</li>
<li>nv50: access only the available amount of textures</li>
<li>nv50: access only the available amount of constbuf</li>
<li>gallium/rtasm: handle mmap failures appropriately</li>
</ul>
<p>Eric Anholt (2):</p>
<ul>
<li>i965: Fix handling of MESA_pack_invert in blit (PBO) readpixels.</li>
<li>i965: Don't do the temporary-and-blit-copy for INVALIDATE_RANGE maps.</li>
</ul>
<p>Ian Romanick (2):</p>
<ul>
<li>mesa: Add COMPRESSED_RGBA_S3TC_DXT1_EXT to COMPRESSED_TEXTURE_FORMATS for GLES</li>
<li>radeon / r200: Pass the API into _mesa_initialize_context</li>
</ul>
<p>Ilia Mirkin (2):</p>
<ul>
<li>mesa: fix GL_COLOR_SUM enum for drivers without ARB_vertex_program</li>
<li>st/vdpau: don't return a device if the screen doesn't support NPOT</li>
</ul>
<p>José Fonseca (1):</p>
<ul>
<li>mesa: Use IROUND instead of roundf.</li>
</ul>
<p>Kenneth Graunke (2):</p>
<ul>
<li>glsl: Rename "expr" to "lhs_expr" in vector_extract munging code.</li>
<li>glsl: Fix chained assignments of vector channels.</li>
</ul>
<p>Lauri Kasanen (1):</p>
<ul>
<li>mesa: Fix build to properly check for supported compiler flags</li>
</ul>
<p>Marek Olšák (2):</p>
<ul>
<li>st/mesa: use sRGB formats for MSAA resolving if destination is sRGB</li>
<li>gallium/util: util_format_srgb should not return FORMAT_NONE for sRGB formats</li>
</ul>
<p>Matt Turner (2):</p>
<ul>
<li>glcpp: Define GL_EXT_shader_integer_mix in both GL and ES.</li>
<li>glx: Update glxext.h to revision 24777.</li>
</ul>
<p>Michał Górny (1):</p>
<ul>
<li>Use AC_PATH_TOOL instead of AC_PATH_PROG for llvm-config.</li>
</ul>
<p>Paul Berry (1):</p>
<ul>
<li>i965: Ensure that all necessary state is re-emitted if we run out of aperture.</li>
</ul>
<p>Paul Seidler (1):</p>
<ul>
<li>build: move ARCH_LIBS definition outside of ASM definition</li>
</ul>
<p>Thomas Sondergaard (4):</p>
<ul>
<li>mesa: Preliminary support for MSVC_VERSION=12.0</li>
<li>mesa: Fix compile error with MSVC 2013</li>
<li>mesa: Work around internal compiler error</li>
<li>mesa: Namespace qualify fma to override ambiguity with fma from math.h</li>
</ul>
<p>Tom Stellard (1):</p>
<ul>
<li>r600g/compute: Emit DEALLOC_STATE on cayman after dispatching a compute shader.</li>
</ul>
</div>
</body>
</html>

191
docs/relnotes/10.0.4.html Normal file
View File

@@ -0,0 +1,191 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Mesa Release Notes</title>
<link rel="stylesheet" type="text/css" href="../mesa.css">
</head>
<body>
<div class="header">
<h1>The Mesa 3D Graphics Library</h1>
</div>
<iframe src="../contents.html"></iframe>
<div class="content">
<h1>Mesa 10.0.4 Release Notes / (March 12, 2014)</h1>
<p>
Mesa 10.0.4 is a bug fix release which fixes bugs found since the 10.0.3 release.
</p>
<p>
Mesa 10.0.4 implements the OpenGL 3.3 API, but the version reported by
glGetString(GL_VERSION) or glGetIntegerv(GL_MAJOR_VERSION) /
glGetIntegerv(GL_MINOR_VERSION) depends on the particular driver being used.
Some drivers don't support all the features required in OpenGL 3.3. OpenGL
3.3 is <strong>only</strong> available if requested at context creation
because compatibility contexts not supported.
</p>
<h2>MD5 checksums</h2>
<pre>
5a3c5b90776ec8a9fcd777c99e0607e2 MesaLib-10.0.4.tar.gz
8b148869d2620b0720c8a8d2b7eb3e38 MesaLib-10.0.4.tar.bz2
da2418d25bfbc273660af7e755fb367e MesaLib-10.0.4.zip
</pre>
<h2>New features</h2>
<p>None</p>
<h2>Bug fixes</h2>
<p>This list is likely incomplete.</p>
<ul>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=71870">Bug 71870</a> - Metro: Last Light rendering issues</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=72895">Bug 72895</a> - Missing trees in flightgear 2.12.1 with mesa 10.0.1</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=74251">Bug 74251</a> - Segfault in st_finalize_texture with Texture Buffer</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=74723">Bug 74723</a> - main/shaderapi.c:407: detach_shader: Assertion `shProg-&gt;Shaders[j]-&gt;Type == 0x8B31 || shProg-&gt;Shaders[j]-&gt;Type == 0x8B30' failed.</li>
</ul>
<h2>Changes</h2>
<p>The full set of changes can be viewed by using the following git command:</p>
<pre>
git log mesa-10.0.3..mesa-10.0.4
</pre>
<p>Anuj Phogat (4):</p>
<ul>
<li>mesa: Generate correct error code in glDrawBuffers()</li>
<li>mesa: Add GL_TEXTURE_CUBE_MAP_ARRAY to legal_get_tex_level_parameter_target()</li>
<li>glsl: Fix condition to generate shader link error</li>
<li>i965: Fix the region's pitch condition to use blitter</li>
</ul>
<p>Brian Paul (8):</p>
<ul>
<li>r200: move driContextSetFlags(ctx) call after ctx var is initialized</li>
<li>radeon: move driContextSetFlags(ctx) call after ctx var is initialized</li>
<li>gallium/auxiliary/indices: replace free() with FREE()</li>
<li>draw: fix incorrect color of flat-shaded clipped lines</li>
<li>st/mesa: avoid sw fallback for getting/decompressing textures</li>
<li>mesa: update assertion in detach_shader() for geom shaders</li>
<li>mesa: do depth/stencil format conversion in glGetTexImage</li>
<li>softpipe: use 64-bit arithmetic in softpipe_resource_layout()</li>
</ul>
<p>Carl Worth (4):</p>
<ul>
<li>docs: Add md5sums for 10.0.3 release</li>
<li>main: Avoid double-free of shader Label</li>
<li>get-pick-list: Update to only find patches nominated for the 10.0 branch</li>
<li>Update version to 10.0.4</li>
</ul>
<p>Chris Forbes (1):</p>
<ul>
<li>i965: Validate (and resolve) all the bound textures.</li>
</ul>
<p>Christian König (1):</p>
<ul>
<li>radeon/uvd: fix feedback buffer handling v2</li>
</ul>
<p>Daniel Kurtz (1):</p>
<ul>
<li>glsl: Add locking to builtin_builder singleton</li>
</ul>
<p>Emil Velikov (3):</p>
<ul>
<li>dri/nouveau: Pass the API into _mesa_initialize_context</li>
<li>nv50: correctly calculate the number of vertical blocks during transfer map</li>
<li>dri/i9*5: correctly calculate the amount of system memory</li>
</ul>
<p>Fredrik Höglund (3):</p>
<ul>
<li>mesa: Preserve the NewArrays state when copying a VAO</li>
<li>glx: Fix the default values for GLXFBConfig attributes</li>
<li>glx: Fix the GLXFBConfig attrib sort priorities</li>
</ul>
<p>Hans (2):</p>
<ul>
<li>util: don't define isfinite(), isnan() for MSVC &gt;= 1800</li>
<li>mesa: don't define c99 math functions for MSVC &gt;= 1800</li>
</ul>
<p>Ian Romanick (6):</p>
<ul>
<li>meta: Release resources used by decompress_texture_image</li>
<li>meta: Release resources used by _mesa_meta_DrawPixels</li>
<li>meta: Fallback to software for GetTexImage of compressed GL_TEXTURE_CUBE_MAP_ARRAY</li>
<li>meta: Consistenly use non-Apple VAO functions</li>
<li>glcpp: Only warn for macro names containing __</li>
<li>glsl: Only warn for macro names containing __</li>
</ul>
<p>Ilia Mirkin (3):</p>
<ul>
<li>nv30: report 8 maximum inputs</li>
<li>nouveau/video: make sure that firmware is present when checking caps</li>
<li>nouveau: fix chipset checks for nv1a by using the oclass instead</li>
</ul>
<p>Julien Cristau (1):</p>
<ul>
<li>glx/dri2: fix build failure on HURD</li>
</ul>
<p>Kenneth Graunke (2):</p>
<ul>
<li>glsl: Don't lose precision qualifiers when encountering "centroid".</li>
<li>i965: Create a hardware context before initializing state module.</li>
</ul>
<p>Kusanagi Kouichi (1):</p>
<ul>
<li>targets/vdpau: Always use c++ to link</li>
</ul>
<p>Marek Olšák (1):</p>
<ul>
<li>st/mesa: fix crash when a shader uses a TBO and it's not bound</li>
</ul>
<p>Matt Turner (1):</p>
<ul>
<li>glsl: Initialize ubo_binding_mask flags to zero.</li>
</ul>
<p>Paul Berry (2):</p>
<ul>
<li>glsl: Make condition_to_hir() callable from outside ast_iteration_statement.</li>
<li>glsl: Fix continue statements in do-while loops.</li>
</ul>
<p>Tom Stellard (1):</p>
<ul>
<li>r600g/compute: PIPE_CAP_COMPUTE should be false for pre-evergreen GPUs</li>
</ul>
<p>Topi Pohjolainen (1):</p>
<ul>
<li>i965/blorp: do not use unnecessary hw-blending support</li>
</ul>
</div>
</body>
</html>

173
docs/relnotes/10.0.5.html Normal file
View File

@@ -0,0 +1,173 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Mesa Release Notes</title>
<link rel="stylesheet" type="text/css" href="../mesa.css">
</head>
<body>
<div class="header">
<h1>The Mesa 3D Graphics Library</h1>
</div>
<iframe src="../contents.html"></iframe>
<div class="content">
<h1>Mesa 10.0.5 Release Notes / April 18, 2014</h1>
<p>
Mesa 10.0.5 is a bug fix release which fixes bugs found since the 10.0.4 release.
</p>
<p>
Mesa 10.0.5 implements the OpenGL 3.3 API, but the version reported by
glGetString(GL_VERSION) or glGetIntegerv(GL_MAJOR_VERSION) /
glGetIntegerv(GL_MINOR_VERSION) depends on the particular driver being used.
Some drivers don't support all the features required in OpenGL 3.3. OpenGL
3.3 is <strong>only</strong> available if requested at context creation
because compatibility contexts not supported.
</p>
<h2>MD5 checksums</h2>
<pre>
db606aadd0fe321f3664099677d159bc MesaLib-10.0.5.tar.gz
e6009ccd8898d7104bb325b6af9ec354 MesaLib-10.0.5.tar.bz2
c8ab9e502542bf32299a4df85b0b704d MesaLib-10.0.5.zip
</pre>
<h2>New features</h2>
<p>None</p>
<h2>Bug fixes</h2>
<p>This list is likely incomplete.</p>
<ul>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=58660">Bug 58660</a> - CAYMAN broken with HyperZ on</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=64471">Bug 64471</a> - Radeon HD6570 lockup in Brütal Legend with HyperZ</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=66352">Bug 66352</a> - GPU lockup in L4D2 on TURKS with HyperZ</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=68799">Bug 68799</a> - [APITRACE] Hyper-Z lockup with Falcon BMS 4.32u6 on CAYMAN</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=71547">Bug 71547</a> - compilation failure :#error &quot;SSE4.1 instruction set not enabled&quot;</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=72685">Bug 72685</a> - [radeonsi hyperz] Artifacts in Unigine Sanctuary</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=73088">Bug 73088</a> - [HyperZ] Juniper (6770): Gone Home / Unigine Heaven 4.0 lock up system after several minutes of use</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=74428">Bug 74428</a> - hyperz causes gpu hang in Counter-strike: Source</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=74803">Bug 74803</a> - [r600g] HyperZ broken on RV630 (Cogs shadows are broken)</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=74863">Bug 74863</a> - [r600g] HyperZ broken on RV770 and CYPRESS (Left 4 Dead 2 trees corruption) bisected!</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=74892">Bug 74892</a> - HyperZ GPU lockup with radeonsi 7970M PITCAIRN and Distance Alpha game</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=74988">Bug 74988</a> - Buffer overrun (segfault) decompressing ETC2 texture in GLBenchmark 3.0 Manhattan</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=75279">Bug 75279</a> - XCloseDisplay() takes one minute around nouveau_dri.so, freezing Firefox startup</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=77102">Bug 77102</a> - gallium nouveau has no profile in vdpau and libva</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=77207">Bug 77207</a> - [ivb/hsw] batch overwritten with garbage</li>
</ul>
<h2>Changes</h2>
<p>The full set of changes can be viewed by using the following git command:</p>
<pre>
git log mesa-10.0.4..mesa-10.0.5
</pre>
<p>Alex Deucher (1):</p>
<ul>
<li>radeon: reverse DBG_NO_HYPERZ logic</li>
</ul>
<p>Brian Paul (9):</p>
<ul>
<li>mesa: add unpacking code for MESA_FORMAT_Z32_FLOAT_S8X24_UINT</li>
<li>mesa: fix copy &amp; paste bugs in pack_ubyte_SARGB8()</li>
<li>mesa: fix copy &amp; paste bugs in pack_ubyte_SRGB8()</li>
<li>mesa: fix unpack_Z32_FLOAT_X24S8() / unpack_Z32_FLOAT() mix-up</li>
<li>st/mesa: add null pointer checking in query object functions</li>
<li>mesa: fix glMultiDrawArrays inside a display list</li>
<li>cso: fix sampler view count in cso_set_sampler_views()</li>
<li>svga: replace sampler assertion with conditional</li>
<li>svga: move LIST_INITHEAD(dirty_buffers) earlier in svga_context_create()</li>
</ul>
<p>Carl Worth (3):</p>
<ul>
<li>docs: Add md5sums for the 10.0.4 release.</li>
<li>Ignore patches which don't apply.</li>
<li>Update version to 10.0.5</li>
</ul>
<p>Christian König (2):</p>
<ul>
<li>st/mesa: recreate sampler view on context change v3</li>
<li>st/mesa: fix sampler view handling with shared textures v4</li>
</ul>
<p>Courtney Goeltzenleuchter (1):</p>
<ul>
<li>mesa: add bounds checking to eliminate buffer overrun</li>
</ul>
<p>Emil Velikov (2):</p>
<ul>
<li>mesa: return v.value_int64 when the requested type is TYPE_INT64</li>
<li>glx: drop obsolete _XUnlock_Mutex in __glXInitialize error path</li>
</ul>
<p>Eric Anholt (1):</p>
<ul>
<li>i965: Fix buffer overruns in MSAA MCS buffer clearing.</li>
</ul>
<p>Ilia Mirkin (6):</p>
<ul>
<li>nouveau: fix fence waiting logic in screen destroy</li>
<li>nv50: adjust blit_3d handling of ms output textures</li>
<li>mesa/main: condition GL_DEPTH_STENCIL on ARB_depth_texture</li>
<li>nouveau: add forgotten GL_COMPRESSED_INTENSITY to texture format list</li>
<li>nouveau: there may not have been a texture if the fbo was incomplete</li>
<li>nouveau: fix firmware check on nvd7/nvd9</li>
</ul>
<p>Johannes Nixdorf (1):</p>
<ul>
<li>configure.ac: fix the detection of expat with pkg-config</li>
</ul>
<p>Jonathan Gray (1):</p>
<ul>
<li>gallium: add endian detection for OpenBSD</li>
</ul>
<p>José Fonseca (1):</p>
<ul>
<li>draw: Duplicate TGSI tokens in draw_pipe_pstipple module.</li>
</ul>
<p>Matt Turner (1):</p>
<ul>
<li>mesa: Wrap SSE4.1 code in #ifdef __SSE4_1__.</li>
</ul>
<p>Paul Berry (1):</p>
<ul>
<li>i965/gen7: Prefer vertical alignment of 4 when possible.</li>
</ul>
</div>
</body>
</html>

View File

@@ -14,7 +14,7 @@
<iframe src="../contents.html"></iframe>
<div class="content">
<h1>Mesa 10.0 Release Notes / TBD</h1>
<h1>Mesa 10.0 Release Notes / (November 30th, 2013)</h1>
<p>
Mesa 10.0 is a new development release.
@@ -33,7 +33,9 @@ because compatibility contexts are not supported.
<h2>MD5 checksums</h2>
<pre>
TBD.
b38626b96c664db67a534d7859682436 MesaLib-10.0.0.tar.gz
f3fe55d9735bea158bbe97ed9a0da819 MesaLib-10.0.0.tar.bz2
c6ee1ce51e3bf35947d2978b872daf51 MesaLib-10.0.0.zip
</pre>
@@ -55,16 +57,89 @@ Note: some of the new features are only available with certain drivers.
<li>GL_ARB_vertex_attrib_binding</li>
<li>GL_ARB_vertex_type_10f_11f_11f_rev on i965 and r600g</li>
<li>GL_KHR_debug</li>
<li>GLX_MESA_query_renderer</li>
</ul>
<h2>Bug fixes</h2>
TBD.
<p>Attempts have been made to <b>not</b> include bugs fixed in previous 9.2
releases or bugs that were regressions during 10.0 development. This list is
likely incomplete.</p>
<ul>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=47755">Bug 47755</a> - [glsl-compiler] no error checking when Interpolation qualifier for built-in variable is different in vertex and fragment shader</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=52171">Bug 52171</a> - [gallium/r600/clover] Simple benchmarks failed to run</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=53077">Bug 53077</a> - [IVB] Output error with msaa when both of framebuffer and source color's alpha are not 1</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=54867">Bug 54867</a> - bug in r300 compiler</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=60929">Bug 60929</a> - [r600-llvm] mono games with opengl are blocking on start</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=62142">Bug 62142</a> - Mesa/demo mipmap_limits upside down with running by SOFTWARE</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=62698">Bug 62698</a> - [bisected] WebGL demo &quot;Consumed&quot;: texstate.c:628: update_texture_state: Assertion „__builtin_popcount(enabledTargets) == 1“ failed.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=64225">Bug 64225</a> - bfgminer --scyte generates Segmentation Fault on Northern Island</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=64226">Bug 64226</a> - python-opencl package generate segmentation fault at pipe_r600.so</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=64261">Bug 64261</a> - [SNB Bisected]Ogles3conform GL3Tests_color_buffer_float_color_buffer_float_clamp_fixed.test fail</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=66213">Bug 66213</a> - Certain Mesa Demos Rendering Inverted (vertically)</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=66806">Bug 66806</a> - [softpipe] glxgears floating point exception</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=67921">Bug 67921</a> - [bisected commit 883987] crosscompiling fails with util/u_cpu_detect.c:247:4: error: 'asm' undeclared (first use in this function)</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=68162">Bug 68162</a> - [radeonsi] texture rendering is broken in Source-Engine games</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=68451">Bug 68451</a> - Texture flicker in native Dota2 in mesa 9.2.0rc1</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=68503">Bug 68503</a> - Graphical glitches in Serious Sam 3 when SB is enabled</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=68792">Bug 68792</a> - Problems during playback of h264 files using UVD and VLC on AMD E-350 CPU</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=68845">Bug 68845</a> - VDPAU/UVD regression</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=69078">Bug 69078</a> - Modern Warfare (1, 2 and 3) broken in Wine on SNB</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=69321">Bug 69321</a> - starting openCL crashes/boots system</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=70042">Bug 70042</a> - Major texture flickering in Dota 2 (r600g on HD 6950)</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=70088">Bug 70088</a> - Glamor on r600g crashes Xserver</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=70123">Bug 70123</a> - Freeze caused by 'winsys/radeon: remove cs_queue_empty' commit</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=70327">Bug 70327</a> - Casting floating point variable to integer not working properly while constant gets converted properly</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=70891">Bug 70891</a> - CL_INVALID_BUILD_OPTIONS results in CL_INVALID_DEVICE when asking for build log</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=70913">Bug 70913</a> - [PIGLIT,radeonsi] crash in &quot;spec/EXT_framebuffer_multisample/sample-alpha-to-coverage 4 depth&quot; (buffer overflow)</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=71022">Bug 71022</a> - configure: error: Expat required for DRI.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=71110">Bug 71110</a> - xorg_driver.c:1030:2: error: too many arguments to function DamageUnregister</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=71172">Bug 71172</a> - Segfault when running glxinfo. NV25GL [Quadro4 900 XGL]</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=71512">Bug 71512</a> - dlopen.h:54: undefined reference to `dlopen'</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=71870">Bug 71870</a> - Metro: Last Light rendering issues</li>
</ul>
<h2>Changes</h2>
TBD.
<ul>
<li>Removed X.Org state tracker (unmaintained and broken)</li>
<li>Removed the video-accel r300 targets</li>
<li>Removed the video-accel softpipe targets</li>
</ul>
</div>
</body>

254
docs/relnotes/10.1.1.html Normal file
View File

@@ -0,0 +1,254 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Mesa Release Notes</title>
<link rel="stylesheet" type="text/css" href="../mesa.css">
</head>
<body>
<div class="header">
<h1>The Mesa 3D Graphics Library</h1>
</div>
<iframe src="../contents.html"></iframe>
<div class="content">
<h1>Mesa 10.1.1 Release Notes / April 18, 2014</h1>
<p>
Mesa 10.1.1 is a bug fix release which fixes bugs found since the 10.1 release.
</p>
<p>
Mesa 10.1.1 implements the OpenGL 3.3 API, but the version reported by
glGetString(GL_VERSION) or glGetIntegerv(GL_MAJOR_VERSION) /
glGetIntegerv(GL_MINOR_VERSION) depends on the particular driver being used.
Some drivers don't support all the features required in OpenGL 3.3. OpenGL
3.3 is <strong>only</strong> available if requested at context creation
because compatibility contexts are not supported.
</p>
<h2>MD5 checksums</h2>
<pre>
96e63674ccfa98e7ec6eb4fee3f770c3 MesaLib-10.1.1.tar.gz
1fde7ed079df7aeb9b6a744ca033de8d MesaLib-10.1.1.tar.bz2
e64d0a562638664b13d2edf22321df59 MesaLib-10.1.1.zip
</pre>
<h2>New features</h2>
<p>None</p>
<h2>Bug fixes</h2>
<ul>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=71547">Bug 71547</a> - compilation failure :#error &quot;SSE4.1 instruction set not enabled&quot;</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=74868">Bug 74868</a> - r600g: Diablo III Crashes After a few minutes</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=74988">Bug 74988</a> - Buffer overrun (segfault) decompressing ETC2 texture in GLBenchmark 3.0 Manhattan</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=75279">Bug 75279</a> - XCloseDisplay() takes one minute around nouveau_dri.so, freezing Firefox startup</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=75543">Bug 75543</a> - OSMesa Gallium OSMesaMakeCurrent</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=75660">Bug 75660</a> - u_inlines.h:277:pipe_buffer_map_range: Assertion `length' failed.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=76323">Bug 76323</a> - GLSL compiler ignores layout(binding=N) on uniform blocks</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=76377">Bug 76377</a> - DRI3 should only be enabled on Linux due to a udev dependency</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=76749">Bug 76749</a> - [HSW] DOTA world lighting has no effect</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=77102">Bug 77102</a> - gallium nouveau has no profile in vdpau and libva</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=77207">Bug 77207</a> - [ivb/hsw] batch overwritten with garbage</li>
</ul>
<h2>Changes</h2>
<p>Aaron Watry (1):</p>
<ul>
<li>gallium/util: Fix memory leak</li>
</ul>
<p>Alexander von Gluck IV (1):</p>
<ul>
<li>haiku: Fix build through scons corrections and viewport fixes</li>
</ul>
<p>Anuj Phogat (2):</p>
<ul>
<li>mesa: Set initial internal format of a texture to GL_RGBA</li>
<li>mesa: Allow GL_DEPTH_COMPONENT and GL_DEPTH_STENCIL combinations in glTexImage{123}D()</li>
</ul>
<p>Brian Paul (12):</p>
<ul>
<li>softpipe: use 64-bit arithmetic in softpipe_resource_layout()</li>
<li>mesa: don't call ctx-&gt;Driver.ClearBufferSubData() if size==0</li>
<li>st/osmesa: check buffer size when searching for buffers</li>
<li>mesa: fix copy &amp; paste bugs in pack_ubyte_SARGB8()</li>
<li>mesa: fix copy &amp; paste bugs in pack_ubyte_SRGB8()</li>
<li>c11/threads: don't include assert.h if the assert macro is already defined</li>
<li>mesa: fix unpack_Z32_FLOAT_X24S8() / unpack_Z32_FLOAT() mix-up</li>
<li>st/mesa: add null pointer checking in query object functions</li>
<li>mesa: fix glMultiDrawArrays inside a display list</li>
<li>cso: fix sampler view count in cso_set_sampler_views()</li>
<li>svga: replace sampler assertion with conditional</li>
<li>svga: move LIST_INITHEAD(dirty_buffers) earlier in svga_context_create()</li>
</ul>
<p>Carl Worth (3):</p>
<ul>
<li>cherry-ignore: Ignore a few patches</li>
<li>glsl: Allow explicit binding on atomics again</li>
<li>Update VERSION to 10.1.1</li>
</ul>
<p>Chia-I Wu (1):</p>
<ul>
<li>i965/vec4: fix record clearing in copy propagation</li>
</ul>
<p>Christian König (2):</p>
<ul>
<li>st/mesa: recreate sampler view on context change v3</li>
<li>st/mesa: fix sampler view handling with shared textures v4</li>
</ul>
<p>Courtney Goeltzenleuchter (1):</p>
<ul>
<li>mesa: add bounds checking to eliminate buffer overrun</li>
</ul>
<p>Emil Velikov (5):</p>
<ul>
<li>nv50: add missing brackets when handling the samplers array</li>
<li>mesa: return v.value_int64 when the requested type is TYPE_INT64</li>
<li>configure: enable dri3 only for linux</li>
<li>glx: drop obsolete _XUnlock_Mutex in __glXInitialize error path</li>
<li>configure: cleanup libudev handling</li>
</ul>
<p>Eric Anholt (1):</p>
<ul>
<li>i965: Fix buffer overruns in MSAA MCS buffer clearing.</li>
</ul>
<p>Hans (2):</p>
<ul>
<li>util: don't define isfinite(), isnan() for MSVC &gt;= 1800</li>
<li>mesa: don't define c99 math functions for MSVC &gt;= 1800</li>
</ul>
<p>Ian Romanick (7):</p>
<ul>
<li>linker: Split set_uniform_binding into separate functions for blocks and samplers</li>
<li>linker: Various trivial clean-ups in set_sampler_binding</li>
<li>linker: Fold set_uniform_binding into call site</li>
<li>linker: Clean up "unused parameter" warnings</li>
<li>linker: Set block bindings based on UniformBlocks rather than UniformStorage</li>
<li>linker: Set binding for all elements of UBO array</li>
<li>glsl: Propagate explicit binding information from the AST all the way to the linker</li>
</ul>
<p>Ilia Mirkin (8):</p>
<ul>
<li>nouveau: fix fence waiting logic in screen destroy</li>
<li>nv50: adjust blit_3d handling of ms output textures</li>
<li>loader: add special logic to distinguish nouveau from nouveau_vieux</li>
<li>mesa/main: condition GL_DEPTH_STENCIL on ARB_depth_texture</li>
<li>nouveau: add forgotten GL_COMPRESSED_INTENSITY to texture format list</li>
<li>nouveau: there may not have been a texture if the fbo was incomplete</li>
<li>nvc0/ir: move sample id to second source arg to fix sampler2DMS</li>
<li>nouveau: fix firmware check on nvd7/nvd9</li>
</ul>
<p>Johannes Nixdorf (1):</p>
<ul>
<li>configure.ac: fix the detection of expat with pkg-config</li>
</ul>
<p>Jonathan Gray (7):</p>
<ul>
<li>gallium: add endian detection for OpenBSD</li>
<li>loader: use 0 instead of FALSE which isn't defined</li>
<li>loader: don't limit the non-udev path to only android</li>
<li>megadriver_stub.c: don't use _GNU_SOURCE to gate the compat code</li>
<li>egl/dri2: don't require libudev to build drm/wayland platforms</li>
<li>egl/dri2: use drm macros to construct device name</li>
<li>configure: don't require libudev for gbm or egl drm/wayland</li>
</ul>
<p>José Fonseca (4):</p>
<ul>
<li>c11/threads: Fix nano to milisecond conversion.</li>
<li>mapi/u_thread: Use GetCurrentThreadId</li>
<li>c11/threads: Don't implement thrd_current on Windows.</li>
<li>draw: Duplicate TGSI tokens in draw_pipe_pstipple module.</li>
</ul>
<p>Kenneth Graunke (4):</p>
<ul>
<li>i965/fs: Fix register comparisons in saturate propagation.</li>
<li>glsl: Fix lack of i2u in lower_ubo_reference.</li>
<li>i965: Stop advertising GL_MESA_ycbcr_texture.</li>
<li>glsl: Try vectorizing when seeing a repeated assignment to a channel.</li>
</ul>
<p>Marek Olšák (13):</p>
<ul>
<li>r600g: fix texelFetchOffset GLSL functions</li>
<li>r600g: fix blitting the last 2 mipmap levels for Evergreen</li>
<li>mesa: fix the format of glEdgeFlagPointer</li>
<li>r600g,radeonsi: fix MAX_TEXTURE_3D_LEVELS and MAX_TEXTURE_ARRAY_LAYERS limits</li>
<li>st/mesa: fix per-vertex edge flags and GLSL support (v2)</li>
<li>mesa: mark GL_RGB9_E5 as not color-renderable</li>
<li>mesa: fix texture border handling for cube arrays</li>
<li>mesa: allow generating mipmaps for cube arrays</li>
<li>mesa: fix software fallback for generating mipmaps for cube arrays</li>
<li>mesa: fix software fallback for generating mipmaps for 3D textures</li>
<li>st/mesa: fix generating mipmaps for cube arrays</li>
<li>st/mesa: drop the lowering of quad strips to triangle strips</li>
<li>r600g: implement edge flags</li>
</ul>
<p>Matt Turner (4):</p>
<ul>
<li>mesa: Wrap SSE4.1 code in #ifdef __SSE4_1__.</li>
<li>i965/fs: Fix off-by-one in saturate propagation.</li>
<li>i965/fs: Don't propagate saturate modifiers into partial writes.</li>
<li>i965/fs: Don't propagate saturation modifiers if there are source modifiers.</li>
</ul>
<p>Michel Dänzer (1):</p>
<ul>
<li>r600g: Don't leak bytecode on shader compile failure</li>
</ul>
<p>Mike Stroyan (1):</p>
<ul>
<li>i965: Avoid dependency hints on math opcodes</li>
</ul>
<p>Thomas Hellstrom (5):</p>
<ul>
<li>winsys/svga: Replace the query mm buffer pool with a slab pool v3</li>
<li>winsys/svga: Update the vmwgfx_drm.h header to latest version from kernel</li>
<li>winsys/svga: Fix prime surface references also for guest-backed surfaces</li>
<li>st/xa: Bind destination before setting new state</li>
<li>st/xa: Make sure unused samplers are set to NULL</li>
</ul>
<p>Tom Stellard (1):</p>
<ul>
<li>configure: Use LLVM shared libraries by default</li>
</ul>
</div>
</body>
</html>

75
docs/relnotes/10.1.html Normal file
View File

@@ -0,0 +1,75 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Mesa Release Notes</title>
<link rel="stylesheet" type="text/css" href="../mesa.css">
</head>
<body>
<div class="header">
<h1>The Mesa 3D Graphics Library</h1>
</div>
<iframe src="../contents.html"></iframe>
<div class="content">
<h1>Mesa 10.1 Release Notes / March 4, 2014</h1>
<p>
Mesa 10.1 is a new development release.
People who are concerned with stability and reliability should stick
with a previous release or wait for Mesa 10.1.1.
</p>
<p>
Mesa 10.1 implements the OpenGL 3.3 API, but the version reported by
glGetString(GL_VERSION) or glGetIntegerv(GL_MAJOR_VERSION) /
glGetIntegerv(GL_MINOR_VERSION) depends on the particular driver being used.
Some drivers don't support all the features required in OpenGL 3.3. OpenGL
3.3 is <strong>only</strong> available if requested at context creation
because compatibility contexts are not supported.
</p>
<h2>MD5 checksums</h2>
<pre>
3ec43f79dbcd9aa2a4a27bf1f51655b6 MesaLib-10.1.0.tar.bz2
08e796ec7122aa299d32d4f67a254315 MesaLib-10.1.0.tar.gz
bd365356543f4b38e57c1ddf7a317c40 MesaLib-10.1.0.zip
</pre>
<h2>New features</h2>
<p>
Note: some of the new features are only available with certain drivers.
</p>
<ul>
<li>GL_ARB_draw_indirect on i965.</li>
<li>GL_ARB_clear_buffer_object</li>
<li>GL_ARB_viewport_array on i965.</li>
<li>GL_ARB_map_buffer_alignment on all drivers that did not previously support
it.</li>
<li>GL_AMD_shader_trinary_minmax.</li>
<li>GL_EXT_framebuffer_blit on r200 and radeon.</li>
<li>Reduced memory usage for display lists.</li>
<li>OpenGL 3.3 support on nv50, nvc0, r600 and radeonsi</li>
</ul>
<h2>Bug fixes</h2>
TBD.
<h2>Changes</h2>
<ul>
<li>Removed support for the GL_MESA_texture_array extension. This extension
enabled the use of texture array with fixed-function and assembly fragment
shaders. No applications are known to use this extension.</li>
</ul>
</div>
</body>
</html>

61
docs/relnotes/10.2.1.html Normal file
View File

@@ -0,0 +1,61 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Mesa Release Notes</title>
<link rel="stylesheet" type="text/css" href="../mesa.css">
</head>
<body>
<div class="header">
<h1>The Mesa 3D Graphics Library</h1>
</div>
<iframe src="../contents.html"></iframe>
<div class="content">
<h1>Mesa 10.2.1 Release Notes / June 6, 2014</h1>
<p>
Mesa 10.2.1 is a bug fix release which fixes bugs found since the 10.1 release.
</p>
<p>
Mesa 10.2.1 implements the OpenGL 3.3 API, but the version reported by
glGetString(GL_VERSION) or glGetIntegerv(GL_MAJOR_VERSION) /
glGetIntegerv(GL_MINOR_VERSION) depends on the particular driver being used.
Some drivers don't support all the features required in OpenGL 3.3. OpenGL
3.3 is <strong>only</strong> available if requested at context creation
because compatibility contexts are not supported.
</p>
<h2>MD5 checksums</h2>
<pre>
96f892dae2d0bb14ac9c2113f586c909 MesaLib-10.2.1.tar.gz
093f9b5d077e5f6061dcd7b01b7aa51a MesaLib-10.2.1.tar.bz2
6ab76c1608e5deed1eb8b54c62d7a48a MesaLib-10.2.1.zip
</pre>
<h2>New features</h2>
<p>None</p>
<h2>Bug fixes</h2>
<p>
Mesa 10.2 had a build problem in the radeonsi driver due to an error resolving
conflicts in a patch cherry-pick from master. The build error is fixed.
</p>
<h2>Changes</h2>
<p>Ian Romanick (3):</p>
<ul>
<li>docs: Add MD5 checksum, etc. for 10.1 release</li>
<li>radeonsi: Fix build error introduced in 5ab9a9c</li>
<li>Bump version to 10.2.1</li>
</ul>
</div>
</body>
</html>

181
docs/relnotes/10.2.2.html Normal file
View File

@@ -0,0 +1,181 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Mesa Release Notes</title>
<link rel="stylesheet" type="text/css" href="../mesa.css">
</head>
<body>
<div class="header">
<h1>The Mesa 3D Graphics Library</h1>
</div>
<iframe src="../contents.html"></iframe>
<div class="content">
<h1>Mesa 10.2.2 Release Notes / June 24, 2014</h1>
<p>
Mesa 10.2.2 is a bug fix release which fixes bugs found since the 10.2.1 release.
</p>
<p>
Mesa 10.2.2 implements the OpenGL 3.3 API, but the version reported by
glGetString(GL_VERSION) or glGetIntegerv(GL_MAJOR_VERSION) /
glGetIntegerv(GL_MINOR_VERSION) depends on the particular driver being used.
Some drivers don't support all the features required in OpenGL 3.3. OpenGL
3.3 is <strong>only</strong> available if requested at context creation
because compatibility contexts are not supported.
</p>
<h2>SHA256 checksums</h2>
<pre>
38c4a40364000f89cddaa1694f6f3cfb444981d1110238ce603093585477399c MesaLib-10.2.2.tar.bz2
2af2ec8b4db624c352e961eefbcce6c8d1f86d44c5542f6f378c50e1b958d453 MesaLib-10.2.2.tar.gz
d4c0372da59367a344d62ebcdf5cf61039c9cae6925f40f2dab8f8d95cf22da9 MesaLib-10.2.2.zip
</pre>
<h2>New features</h2>
<p>None</p>
<h2>Bug fixes</h2>
<p>This list is likely incomplete.</p>
<ul>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=54372">Bug 54372</a> - GLX_INTEL_swap_event crashes driver when swapping window buffers</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=66452">Bug 66452</a> - JUNIPER UVD accelerated playback of WMV3 streams does not work</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=74005">Bug 74005</a> - [i965 Bisected]Piglit/glx_glx-make-glxdrawable-current fails</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=77865">Bug 77865</a> - [BDW] Many Ogles3conform framebuffer_blit cases fail</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=78581">Bug 78581</a> - OpenCL: clBuildProgram prints error messages directly rather than storing them</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=79029">Bug 79029</a> - INTEL_DEBUG=shader_time is full of lies</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=79729">Bug 79729</a> - [i965] glClear on a multisample texture doesn't work</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=79907">Bug 79907</a> - Mesa 10.2.1 --enable-vdpau default=auto broken</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=80115">Bug 80115</a> - MESA_META_DRAW_BUFFERS induced GL_INVALID_VALUE errors</li>
</ul>
<h2>Changes</h2>
<p>Adrian Negreanu (8):</p>
<ul>
<li>add megadriver_stub_FILES</li>
<li>android: adapt to the megadriver mechanism</li>
<li>android: add libloader to libGLES_mesa and libmesa_egl_dri2</li>
<li>android: add src/gallium/auxiliary as include path for libmesa_dricore</li>
<li>android, egl: add correct drm include for libmesa_egl_dri2</li>
<li>android, egl: typo dri2_fallback_pixmap_surface -&gt; dri2_fallback_create_pixmap_surface</li>
<li>android, mesa_gen_matypes: pull in timespec POSIX definition</li>
<li>android, dricore: undefined reference to _mesa_streaming_load_memcpy</li>
</ul>
<p>Carl Worth (1):</p>
<ul>
<li>Update VERSION to 10.2.2</li>
</ul>
<p>Daniel Manjarres (1):</p>
<ul>
<li>glx: Don't crash on swap event for a Window (non-GLXWindow)</li>
</ul>
<p>Emil Velikov (3):</p>
<ul>
<li>targets/xa: limit the amount of exported symbols</li>
<li>configure: error out when building opencl without LLVM</li>
<li>configure: correctly autodetect xvmc/vdpau/omx</li>
</ul>
<p>Grigori Goronzy (1):</p>
<ul>
<li>radeon/uvd: disable VC-1 simple/main on UVD 2.x</li>
</ul>
<p>Iago Toral Quiroga (1):</p>
<ul>
<li>mesa: Copy Geom.UsesEndPrimitive when cloning a geometry program.</li>
</ul>
<p>Ian Romanick (3):</p>
<ul>
<li>docs: Add initial 10.2.1 release notes</li>
<li>docs: Add MD5 checksum, etc. for 10.2.1 release</li>
<li>meta: Respect the driver's maximum number of draw buffers</li>
</ul>
<p>Ilia Mirkin (7):</p>
<ul>
<li>gk110/ir: emit saturate flag on fadd when needed</li>
<li>gk110/ir: fix emitting constbuf file index</li>
<li>gk110/ir: fix bfind emission</li>
<li>nv50: make sure to mark first scissor dirty after blit</li>
<li>nv30: plug some memory leaks on screen destroy and shader compile</li>
<li>nv30: avoid dangling references to deleted contexts</li>
<li>nv30: hack to avoid errors on unexpected color/zeta combinations</li>
</ul>
<p>Jason Ekstrand (1):</p>
<ul>
<li>meta_blit: properly compute texture width for the CopyTexSubImage fallback</li>
</ul>
<p>José Fonseca (1):</p>
<ul>
<li>mesa/main: Prevent sefgault on glGetIntegerv(GL_ATOMIC_COUNTER_BUFFER_BINDING).</li>
</ul>
<p>Kenneth Graunke (9):</p>
<ul>
<li>i965: Don't use the head sentinel as an fs_inst in Gen4 workaround code.</li>
<li>i965: Invalidate live intervals when inserting Gen4 SEND workarounds.</li>
<li>i965/vec4: Fix dead code elimination for VGRFs of size &gt; 1.</li>
<li>i965: Add missing MOCS setup for 3DSTATE_INDEX_BUFFER on Broadwell.</li>
<li>i965: Drop Broadwell perf_debugs about missing MOCS that aren't missing.</li>
<li>i965: Add missing newlines to a few perf_debug messages.</li>
<li>i965/vec4: Use the sampler for pull constant loads on Broadwell.</li>
<li>i965: Use 8x4 aligned rectangles for HiZ operations on Broadwell.</li>
<li>i965: Save meta stencil blit programs in the context.</li>
</ul>
<p>Kristian Høgsberg (1):</p>
<ul>
<li>mesa: Remove glClear optimization based on drawable size</li>
</ul>
<p>Michel Dänzer (1):</p>
<ul>
<li>configure: Only check for OpenCL without LLVM when the latter is certain</li>
</ul>
<p>Neil Roberts (1):</p>
<ul>
<li>i965: Set the fast clear color value for texture surfaces</li>
</ul>
<p>Tom Stellard (2):</p>
<ul>
<li>clover: Prevent Clang from printing number of errors and warnings to stderr.</li>
<li>clover: Don't use llvm's global context</li>
</ul>
<p>Ville Syrjälä (1):</p>
<ul>
<li>i915: Fix gen2 texblend setup</li>
</ul>
</div>
</body>
</html>

130
docs/relnotes/10.2.3.html Normal file
View File

@@ -0,0 +1,130 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Mesa Release Notes</title>
<link rel="stylesheet" type="text/css" href="../mesa.css">
</head>
<body>
<div class="header">
<h1>The Mesa 3D Graphics Library</h1>
</div>
<iframe src="../contents.html"></iframe>
<div class="content">
<h1>Mesa 10.2.3 Release Notes / July 7, 2014</h1>
<p>
Mesa 10.2.3 is a bug fix release which fixes bugs found since the 10.2.2 release.
</p>
<p>
Mesa 10.2.3 implements the OpenGL 3.3 API, but the version reported by
glGetString(GL_VERSION) or glGetIntegerv(GL_MAJOR_VERSION) /
glGetIntegerv(GL_MINOR_VERSION) depends on the particular driver being used.
Some drivers don't support all the features required in OpenGL 3.3. OpenGL
3.3 is <strong>only</strong> available if requested at context creation
because compatibility contexts are not supported.
</p>
<h2>SHA256 checksums</h2>
<pre>
e482a96170c98b17d6aba0d6e4dda4b9a2e61c39587bb64ac38cadfa4aba4aeb MesaLib-10.2.3.tar.bz2
96cffacaa1c52ae659b3b0f91be2eebf5528b748934256751261fb79ea3d6636 MesaLib-10.2.3.tar.gz
82cab6ff14c8038ee39842dbdea0d447a78d119efd8d702d1497bc7c246434e9 MesaLib-10.2.3.zip
</pre>
<h2>New features</h2>
<p>None</p>
<h2>Bug fixes</h2>
<p>This list is likely incomplete.</p>
<ul>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=76223">Bug 76223</a> - </li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=79823">Bug 79823</a> - </li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=80015">Bug 80015</a> - </li>
</ul>
<h2>Changes</h2>
<p>Aaron Watry (1):</p>
<ul>
<li>radeon/llvm: Allocate space for kernel metadata operands</li>
</ul>
<p>Carl Worth (2):</p>
<ul>
<li>docs: Add sha256 sums for the 10.2.2 release</li>
<li>cherry-ignore: Add a patch that's been rejected</li>
</ul>
<p>Ilia Mirkin (4):</p>
<ul>
<li>nouveau: dup fd before passing it to device</li>
<li>nv50: disable dedicated ubo upload method</li>
<li>nv50: do an explicit flush on draw when there are persistent buffers</li>
<li>nvc0: add a memory barrier when there are persistent UBOs</li>
</ul>
<p>Jasper St. Pierre (1):</p>
<ul>
<li>glxext: Send the Drawable's ID in the GLX_BufferSwapComplete event</li>
</ul>
<p>Kenneth Graunke (3):</p>
<ul>
<li>i965: Don't emit SURFACE_STATEs for gather workarounds on Broadwell.</li>
<li>i965: Include marketing names for Broadwell GPUs.</li>
<li>i965/disasm: Fix INTEL_DEBUG=fs on Broadwell for ARB_fp applications.</li>
</ul>
<p>Michel Dänzer (1):</p>
<ul>
<li>radeon/llvm: Use the llvm.rsq.clamped intrinsic for RSQ</li>
</ul>
<p>Rob Clark (9):</p>
<ul>
<li>xa: fix segfault</li>
<li>freedreno: use OUT_RELOCW when buffer is written</li>
<li>freedreno/a3xx: fix depth/stencil GMEM positioning</li>
<li>freedreno/a3xx: fix depth/stencil gmem restore</li>
<li>freedreno/a3xx: fix blend opcode</li>
<li>freedreno: few caps fixes</li>
<li>freedreno/a3xx: texture fixes</li>
<li>freedreno: fix for null textures</li>
<li>freedreno/a3xx: vtx formats</li>
</ul>
<p>Roland Scheidegger (1):</p>
<ul>
<li>draw: (trivial) fix clamping of viewport index</li>
</ul>
<p>Takashi Iwai (1):</p>
<ul>
<li>llvmpipe: Fix zero-division in llvmpipe_texture_layout()</li>
</ul>
<p>Thomas Hellstrom (1):</p>
<ul>
<li>st/xa: Don't close the drm fd on failure v2</li>
</ul>
<p>Tobias Klausmann (1):</p>
<ul>
<li>nv50/ir: allow gl_ViewportIndex to work on non-provoking vertices</li>
</ul>
</div>
</body>
</html>

127
docs/relnotes/10.2.4.html Normal file
View File

@@ -0,0 +1,127 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Mesa Release Notes</title>
<link rel="stylesheet" type="text/css" href="../mesa.css">
</head>
<body>
<div class="header">
<h1>The Mesa 3D Graphics Library</h1>
</div>
<iframe src="../contents.html"></iframe>
<div class="content">
<h1>Mesa 10.2.4 Release Notes / July 18, 2014</h1>
<p>
Mesa 10.2.4 is a bug fix release which fixes bugs found since the 10.2.3 release.
</p>
<p>
Mesa 10.2.4 implements the OpenGL 3.3 API, but the version reported by
glGetString(GL_VERSION) or glGetIntegerv(GL_MAJOR_VERSION) /
glGetIntegerv(GL_MINOR_VERSION) depends on the particular driver being used.
Some drivers don't support all the features required in OpenGL 3.3. OpenGL
3.3 is <strong>only</strong> available if requested at context creation
because compatibility contexts are not supported.
</p>
<h2>SHA256 checksums</h2>
<pre>
06a2341244eb85c283f59f70161e06ded106f835ed9b6be1ef0243bd9344811a MesaLib-10.2.4.tar.bz2
33e3c8b4343503e7d7d17416c670438860a2fd99ec93ea3327f73c3abe33b5e4 MesaLib-10.2.4.tar.gz
e26791a4a62a61b82e506e6ba031812d09697d1a831e8239af67e5722a8ee538 MesaLib-10.2.4.zip
</pre>
<h2>New features</h2>
<p>None</p>
<h2>Bug fixes</h2>
<p>This list is likely incomplete.</p>
<ul>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=81157">Bug 81157</a> - [BDW]Piglit some spec_glsl-1.50_execution_built-in-functions* cases fail</li>
</ul>
<h2>Changes</h2>
<p>Abdiel Janulgue (3):</p>
<ul>
<li>i965/fs: Refactor check for potential copy propagated instructions.</li>
<li>i965/fs: skip copy-propate for logical instructions with negated src entries</li>
<li>i965/vec4: skip copy-propate for logical instructions with negated src entries</li>
</ul>
<p>Brian Paul (3):</p>
<ul>
<li>mesa: fix geometry shader memory leaks</li>
<li>st/mesa: fix geometry shader memory leak</li>
<li>gallium/u_blitter: fix some shader memory leaks</li>
</ul>
<p>Carl Worth (2):</p>
<ul>
<li>docs: Add sha256 checksums for the 10.2.3 release</li>
<li>Update VERSION to 10.2.4</li>
</ul>
<p>Eric Anholt (1):</p>
<ul>
<li>i965: Generalize the pixel_x/y workaround for all UW types.</li>
</ul>
<p>Ilia Mirkin (4):</p>
<ul>
<li>nv50/ir: retrieve shadow compare from first arg</li>
<li>nv50/ir: ignore bias for samplerCubeShadow on nv50</li>
<li>nvc0/ir: do quadops on the right texture coordinates for TXD</li>
<li>nvc0/ir: use manual TXD when offsets are involved</li>
</ul>
<p>Jordan Justen (1):</p>
<ul>
<li>i965: Add auxiliary surface field #defines for Broadwell.</li>
</ul>
<p>Kenneth Graunke (9):</p>
<ul>
<li>i965: Don't copy propagate abs into Broadwell logic instructions.</li>
<li>i965: Set execution size to 8 for instructions with force_sechalf set.</li>
<li>i965/fs: Set force_uncompressed and force_sechalf on samplepos setup.</li>
<li>i965/fs: Use WE_all for gl_SampleID header register munging.</li>
<li>i965: Add plumbing for Broadwell's auxiliary surface support.</li>
<li>i965: Drop SINT workaround for CMS layout on Broadwell.</li>
<li>i965: Hook up the MCS buffers in SURFACE_STATE on Broadwell.</li>
<li>i965: Add 2x MSAA support to the MCS allocation function.</li>
<li>i965: Enable compressed multisample support (CMS) on Broadwell.</li>
</ul>
<p>Marek Olšák (4):</p>
<ul>
<li>gallium: fix u_default_transfer_inline_write for textures</li>
<li>st/mesa: fix samplerCubeShadow with bias</li>
<li>radeonsi: fix samplerCubeShadow with bias</li>
<li>radeonsi: add support for TXB2</li>
</ul>
<p>Matt Turner (8):</p>
<ul>
<li>i965/vec4: Don't return void from a void function.</li>
<li>i965/vec4: Don't fix_math_operand() on Gen &gt;= 8.</li>
<li>i965/fs: Don't fix_math_operand() on Gen &gt;= 8.</li>
<li>i965/fs: Make try_constant_propagate() static.</li>
<li>i965/fs: Constant propagate into 2-src math instructions on Gen8.</li>
<li>i965/vec4: Constant propagate into 2-src math instructions on Gen8.</li>
<li>i965/fs: Don't use brw_imm_* unnecessarily.</li>
<li>i965/fs: Set correct number of regs_written for MCS fetches.</li>
</ul>
</div>
</body>
</html>

188
docs/relnotes/10.2.5.html Normal file
View File

@@ -0,0 +1,188 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Mesa Release Notes</title>
<link rel="stylesheet" type="text/css" href="../mesa.css">
</head>
<body>
<div class="header">
<h1>The Mesa 3D Graphics Library</h1>
</div>
<iframe src="../contents.html"></iframe>
<div class="content">
<h1>Mesa 10.2.5 Release Notes / August 2, 2014</h1>
<p>
Mesa 10.2.5 is a bug fix release which fixes bugs found since the 10.2.4 release.
</p>
<p>
Mesa 10.2.5 implements the OpenGL 3.3 API, but the version reported by
glGetString(GL_VERSION) or glGetIntegerv(GL_MAJOR_VERSION) /
glGetIntegerv(GL_MINOR_VERSION) depends on the particular driver being used.
Some drivers don't support all the features required in OpenGL 3.3. OpenGL
3.3 is <strong>only</strong> available if requested at context creation
because compatibility contexts are not supported.
</p>
<h2>SHA256 checksums</h2>
<pre>
b4459f0bf7f4a3c8fb78ece3c9d2eac3d0e5bf38cb470f2a72705e744bd0310d MesaLib-10.2.5.tar.bz2
7b4dd0cb683f8c7dc48a3e7a315742bed58ddcd7b756c462aca4177bd1acdc79 MesaLib-10.2.5.tar.gz
6180565914fb238dd77ccdaff96b6155d9a6e1b3e981ebbf6a6851301b384fed MesaLib-10.2.5.zip
</pre>
<h2>New features</h2>
<p>None</p>
<h2>Bug fixes</h2>
<p>This list is likely incomplete.</p>
<ul>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=80991">Bug 80991</a> - [BDW]Piglit spec_ARB_sample_shading_builtin-gl-sample-mask_2 fails</li>
</ul>
<h2>Changes</h2>
<p>Abdiel Janulgue (3):</p>
<ul>
<li>i965/fs: Refactor check for potential copy propagated instructions.</li>
<li>i965/fs: skip copy-propate for logical instructions with negated src entries</li>
<li>i965/vec4: skip copy-propate for logical instructions with negated src entries</li>
</ul>
<p>Adel Gadllah (1):</p>
<ul>
<li>i915: Fix up intelInitScreen2 for DRI3</li>
</ul>
<p>Anuj Phogat (2):</p>
<ul>
<li>i965: Fix z_offset computation in intel_miptree_unmap_depthstencil()</li>
<li>mesa: Don't use memcpy() in _mesa_texstore() for float depth texture data</li>
</ul>
<p>Brian Paul (3):</p>
<ul>
<li>mesa: fix geometry shader memory leaks</li>
<li>st/mesa: fix geometry shader memory leak</li>
<li>gallium/u_blitter: fix some shader memory leaks</li>
</ul>
<p>Carl Worth (6):</p>
<ul>
<li>docs: Add sha256 checksums for the 10.2.3 release</li>
<li>Update VERSION to 10.2.4</li>
<li>Add release notes for 10.2.4</li>
<li>docs: Add SHA256 checksums for the 10.2.4 release</li>
<li>cherry-ignore: Ignore a few patches picked in the previous stable release</li>
<li>Update version to 10.2.5</li>
</ul>
<p>Christian König (1):</p>
<ul>
<li>radeonsi: fix order of r600_need_dma_space and r600_context_bo_reloc</li>
</ul>
<p>Eric Anholt (1):</p>
<ul>
<li>i965: Generalize the pixel_x/y workaround for all UW types.</li>
</ul>
<p>Ian Romanick (2):</p>
<ul>
<li>mesa: Don't allow GL_TEXTURE_BORDER queries outside compat profile</li>
<li>mesa: Don't allow GL_TEXTURE_{LUMINANCE,INTENSITY}_* queries outside compat profile</li>
</ul>
<p>Ilia Mirkin (5):</p>
<ul>
<li>nv50/ir: retrieve shadow compare from first arg</li>
<li>nv50/ir: ignore bias for samplerCubeShadow on nv50</li>
<li>nvc0/ir: do quadops on the right texture coordinates for TXD</li>
<li>nvc0/ir: use manual TXD when offsets are involved</li>
<li>nvc0: make sure that the local memory allocation is aligned to 0x10</li>
</ul>
<p>Jason Ekstrand (2):</p>
<ul>
<li>main/format_pack: Fix a wrong datatype in pack_ubyte_R8G8_UNORM</li>
<li>main/get_hash_params: Add GL_SAMPLE_SHADING_ARB</li>
</ul>
<p>Jordan Justen (1):</p>
<ul>
<li>i965: Add auxiliary surface field #defines for Broadwell.</li>
</ul>
<p>José Fonseca (1):</p>
<ul>
<li>st/wgl: Clamp wglChoosePixelFormatARB's output nNumFormats to nMaxFormats.</li>
</ul>
<p>Kenneth Graunke (13):</p>
<ul>
<li>i965: Don't copy propagate abs into Broadwell logic instructions.</li>
<li>i965: Set execution size to 8 for instructions with force_sechalf set.</li>
<li>i965/fs: Set force_uncompressed and force_sechalf on samplepos setup.</li>
<li>i965/fs: Use WE_all for gl_SampleID header register munging.</li>
<li>i965: Add plumbing for Broadwell's auxiliary surface support.</li>
<li>i965: Drop SINT workaround for CMS layout on Broadwell.</li>
<li>i965: Hook up the MCS buffers in SURFACE_STATE on Broadwell.</li>
<li>i965: Add 2x MSAA support to the MCS allocation function.</li>
<li>i965: Enable compressed multisample support (CMS) on Broadwell.</li>
<li>i965: Add missing persample_shading field to brw_wm_debug_recompile.</li>
<li>i965/fs: Fix gl_SampleID for 2x MSAA and SIMD16 mode.</li>
<li>i965/fs: Fix gl_SampleMask handling for SIMD16 on Gen8+.</li>
<li>i965/fs: Set LastRT on the final FB write on Broadwell.</li>
</ul>
<p>Marek Olšák (14):</p>
<ul>
<li>gallium: fix u_default_transfer_inline_write for textures</li>
<li>st/mesa: fix samplerCubeShadow with bias</li>
<li>radeonsi: fix samplerCubeShadow with bias</li>
<li>radeonsi: add support for TXB2</li>
<li>r600g: switch SNORM conversion to DX and GLES behavior</li>
<li>radeonsi: fix CMASK and HTILE calculations for Hawaii</li>
<li>gallium/util: add a helper for calculating primitive count from vertex count</li>
<li>radeonsi: fix a hang with instancing on Hawaii</li>
<li>radeonsi: fix a hang with streamout on Hawaii</li>
<li>winsys/radeon: fix vram_size overflow with Hawaii</li>
<li>radeonsi: fix occlusion queries on Hawaii</li>
<li>r600g,radeonsi: switch all occurences of array_size to util_max_layer</li>
<li>radeonsi: fix build because of lack of draw_indirect infrastructure in 10.2</li>
<li>radeonsi: use DRAW_PREAMBLE on CIK</li>
</ul>
<p>Matt Turner (8):</p>
<ul>
<li>i965/vec4: Don't return void from a void function.</li>
<li>i965/vec4: Don't fix_math_operand() on Gen &gt;= 8.</li>
<li>i965/fs: Don't fix_math_operand() on Gen &gt;= 8.</li>
<li>i965/fs: Make try_constant_propagate() static.</li>
<li>i965/fs: Constant propagate into 2-src math instructions on Gen8.</li>
<li>i965/vec4: Constant propagate into 2-src math instructions on Gen8.</li>
<li>i965/fs: Don't use brw_imm_* unnecessarily.</li>
<li>i965/fs: Set correct number of regs_written for MCS fetches.</li>
</ul>
<p>Thorsten Glaser (1):</p>
<ul>
<li>nv50: fix build failure on m68k due to invalid struct alignment assumptions</li>
</ul>
<p>Tom Stellard (1):</p>
<ul>
<li>clover: Call end_query before getting timestamp result v2</li>
</ul>
</div>
</body>
</html>

118
docs/relnotes/10.2.6.html Normal file
View File

@@ -0,0 +1,118 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Mesa Release Notes</title>
<link rel="stylesheet" type="text/css" href="../mesa.css">
</head>
<body>
<div class="header">
<h1>The Mesa 3D Graphics Library</h1>
</div>
<iframe src="../contents.html"></iframe>
<div class="content">
<h1>Mesa 10.2.6 Release Notes / August 19, 2014</h1>
<p>
Mesa 10.2.6 is a bug fix release which fixes bugs found since the 10.2.5 release.
</p>
<p>
Mesa 10.2.6 implements the OpenGL 3.3 API, but the version reported by
glGetString(GL_VERSION) or glGetIntegerv(GL_MAJOR_VERSION) /
glGetIntegerv(GL_MINOR_VERSION) depends on the particular driver being used.
Some drivers don't support all the features required in OpenGL 3.3. OpenGL
3.3 is <strong>only</strong> available if requested at context creation
because compatibility contexts are not supported.
</p>
<h2>SHA256 checksums</h2>
<pre>
193314d2adba98e43697d726739ac46b4299aae324fa1821aa226890c28ac806 MesaLib-10.2.6.tar.bz2
f7a45a5977b485eb95ac024205c584a0c112fe3951c2313c797579bb16a7a448 MesaLib-10.2.6.tar.gz
6d086d6fcda8f317adfaaae40011decf2f2e2dc80819c4a7a77c76f73512e8d8 MesaLib-10.2.6.zip
</pre>
<h2>New features</h2>
<p>None</p>
<h2>Bug fixes</h2>
<p>This list is likely incomplete.</p>
<ul>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=81450">Bug 81450</a> - [BDW]Piglit spec_glsl-1.30_execution_tex-miplevel-selection_textureGrad_1DArray cases intel_do_flush_locked failed</li>
</ul>
<h2>Changes</h2>
<p>Anuj Phogat (15):</p>
<ul>
<li>mesa: Fix error condition for valid texture targets in glTexStorage* functions</li>
<li>mesa: Turn target_can_be_compressed() in to a utility function</li>
<li>mesa: Add error condition for using compressed internalformat in glTexStorage3D()</li>
<li>mesa: Fix condition for using compressed internalformat in glCompressedTexImage3D()</li>
<li>mesa: Add utility function _mesa_is_enum_format_snorm()</li>
<li>mesa: Don't allow snorm internal formats in glCopyTexImage*() in GLES3</li>
<li>mesa: Add a helper function _mesa_is_enum_format_unsized()</li>
<li>mesa: Add a gles3 error condition for sized internalformat in glCopyTexImage*()</li>
<li>mesa: Add gles3 error condition for GL_RGBA10_A2 buffer format in glCopyTexImage*()</li>
<li>mesa: Add utility function _mesa_is_enum_format_unorm()</li>
<li>mesa: Add gles3 condition for normalized internal formats in glCopyTexImage*()</li>
<li>mesa: Allow GL_TEXTURE_CUBE_MAP target with compressed internal formats</li>
<li>meta: Use _mesa_get_format_bits() to get the GL_RED_BITS</li>
<li>egl: Fix OpenGL ES version checks in _eglParseContextAttribList()</li>
<li>meta: Fix datatype computation in get_temp_image_type()</li>
</ul>
<p>Brian Paul (1):</p>
<ul>
<li>mesa: fix assertion in _mesa_drawbuffers()</li>
</ul>
<p>Carl Worth (2):</p>
<ul>
<li>docs: Add sha256 sums to the 10.2.5 release notes</li>
<li>Update VERSION to 10.2.6</li>
</ul>
<p>Ilia Mirkin (1):</p>
<ul>
<li>mesa/st: only convert AND(a, NOT(b)) into MAD when not using native integers</li>
</ul>
<p>Jordan Justen (1):</p>
<ul>
<li>i965/miptree: Layout 1D Array as 2D Array with height of 1</li>
</ul>
<p>Maarten Lankhorst (1):</p>
<ul>
<li>configure.ac: Do not require llvm on x32</li>
</ul>
<p>Marek Olšák (4):</p>
<ul>
<li>st/mesa: fix blit-based partial TexSubImage for 1D arrays</li>
<li>radeon,r200: fix buffer validation after CS flush</li>
<li>radeonsi: fix a hang with instancing in Unigine Heaven/Valley on Hawaii</li>
<li>radeonsi: fix CMASK and HTILE allocation on Tahiti</li>
</ul>
<p>Pali Rohár (1):</p>
<ul>
<li>configure: check for dladdr via AC_CHECK_FUNC/AC_CHECK_LIB</li>
</ul>
<p>Roland Scheidegger (1):</p>
<ul>
<li>gallivm: fix up out-of-bounds level when using conformant out-of-bound behavior</li>
</ul>
</div>
</body>
</html>

208
docs/relnotes/10.2.7.html Normal file
View File

@@ -0,0 +1,208 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Mesa Release Notes</title>
<link rel="stylesheet" type="text/css" href="../mesa.css">
</head>
<body>
<div class="header">
<h1>The Mesa 3D Graphics Library</h1>
</div>
<iframe src="../contents.html"></iframe>
<div class="content">
<h1>Mesa 10.2.7 Release Notes / September 06, 2014</h1>
<p>
Mesa 10.2.7 is a bug fix release which fixes bugs found since the 10.2.6 release.
</p>
<p>
Mesa 10.2.7 implements the OpenGL 3.3 API, but the version reported by
glGetString(GL_VERSION) or glGetIntegerv(GL_MAJOR_VERSION) /
glGetIntegerv(GL_MINOR_VERSION) depends on the particular driver being used.
Some drivers don't support all the features required in OpenGL 3.3. OpenGL
3.3 is <strong>only</strong> available if requested at context creation
because compatibility contexts are not supported.
</p>
<h2>SHA256 checksums</h2>
<pre>
</pre>
<h2>New features</h2>
<p>None</p>
<h2>Bug fixes</h2>
<p>This list is likely incomplete.</p>
<ul>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=36193">Bug 36193</a> - [i965] brw_eu_emit.c:182: validate_reg: Assertion `execsize &gt;= width' failed.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=66184">Bug 66184</a> - src/mesa/state_tracker/st_glsl_to_tgsi.cpp:3216:simplify_cmp: Assertion `inst-&gt;dst.index &lt; 4096' failed.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=70441">Bug 70441</a> - [Gen4-5 clip] Piglit spec_OpenGL_1.1_polygon-offset hits (execsize &gt;= width) assertion</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=76188">Bug 76188</a> - EGL_EXT_image_dma_buf_import fd ownership is incorrect</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=76789">Bug 76789</a> - [radeonsi] si_descriptors.c requires -std=gnu99 or -fms-extensions</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=82139">Bug 82139</a> - [r600g, bisected] multiple ubo piglit regressions</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=82255">Bug 82255</a> - [VP2] Chroma planes are vertically stretched during VDPAU playback</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=82671">Bug 82671</a> - [r600g-evergreen][compute]Empty kernel execution causes crash</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=82709">Bug 82709</a> - OpenCL not working on radeon hainan</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=82814">Bug 82814</a> - glDrawBuffers(0, NULL) segfaults in _mesa_drawbuffers</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=83079">Bug 83079</a> - [NVC0] Dota 2 (Linux native and Wine) crash with Nouveau Drivers</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=83355">Bug 83355</a> - FTBFS: src/mesa/program/program_lexer.l:122:64: error: unknown type name 'YYSTYPE'</li>
</ul>
<h2>Changes</h2>
<p>Adam Jackson (1):</p>
<ul>
<li>radeonsi: Don't use anonymous struct trick in atom tracking</li>
</ul>
<p>Alex Deucher (2):</p>
<ul>
<li>radeonsi: add new CIK pci ids</li>
<li>radeonsi: add new SI pci ids</li>
</ul>
<p>Andreas Boll (1):</p>
<ul>
<li>winsys/radeon: fix nop packet padding for hawaii</li>
</ul>
<p>Anuj Phogat (1):</p>
<ul>
<li>i965: Bail on vec4 copy propagation for scratch writes with source modifiers</li>
</ul>
<p>Brian Paul (1):</p>
<ul>
<li>mesa: fix NULL pointer deref bug in _mesa_drawbuffers()</li>
</ul>
<p>Carl Worth (2):</p>
<ul>
<li>docs: Add sha256 sums for the 10.2.6 release</li>
<li>Makefile: Switch from md5sums to sha256sums</li>
</ul>
<p>Dave Airlie (1):</p>
<ul>
<li>i965: add missing parens in vec4 visitor</li>
</ul>
<p>Emil Velikov (17):</p>
<ul>
<li>configure.ac: bail out if building gallium_gbm without gallium_egl</li>
<li>android: gallium/nouveau: fix include folders, link against libstlport</li>
<li>android: egl/main: fixup the nouveau build</li>
<li>automake: gallium/freedreno: drop spurious include dirs</li>
<li>android: gallium/freedreno: add preliminary build</li>
<li>android: egl/main: add/enable freedreno</li>
<li>android: gallium/auxiliary: drop log2/log2f redefitions</li>
<li>android: drop HAL_PIXEL_FORMAT_RGBA_{5551,4444}</li>
<li>android: glsl: the stlport over the limited Android STL</li>
<li>android: dri/i915: do not build an 'empty' driver</li>
<li>cherry-ignore: remove patch that lacking previous dependencies</li>
<li>cherry-ignore: PIPE_SHADER_CAP_MAX_CONST_BUFFER_SIZE is not it 10.2</li>
<li>cherry-ignore: drop whitespace fix</li>
<li>cherry-ignore: reject a15088338eb</li>
<li>get-pick-list.sh: Require explicit "10.2" for nominating stable patches</li>
<li>mesa: fix make tarballs</li>
<li>Update VERSION to 10.2.7</li>
</ul>
<p>Ian Romanick (1):</p>
<ul>
<li>mesa: Handle uninitialized textures like other textures in get_tex_level_parameter_image</li>
</ul>
<p>Ilia Mirkin (9):</p>
<ul>
<li>nouveau: make sure to invalidate any vbo state as well</li>
<li>nouveau: don't keep stale pointer to free'd data</li>
<li>nvc0/ir: avoid infinite recursion when finding first uses of tex</li>
<li>nv50: zero out unbound samplers</li>
<li>nvc0: don't make 1d staging textures linear</li>
<li>nv50/ir: avoid creating instructions that can't be emitted</li>
<li>nv50: set the miptree address when clearing bo's in vp2 init</li>
<li>nv50: mt address may not be the underlying bo's start address</li>
<li>nv50: attach the buffer bo to the miptree structures</li>
</ul>
<p>Jan Vesely (1):</p>
<ul>
<li>gallivm: Fix build with latest LLVM</li>
</ul>
<p>José Fonseca (1):</p>
<ul>
<li>mesa: Move declaration to top of block.</li>
</ul>
<p>Kenneth Graunke (3):</p>
<ul>
<li>i965/vec4: Set NoMask for GS_OPCODE_SET_VERTEX_COUNT on Gen8+.</li>
<li>i965/vec4: Respect ir-&gt;force_writemask_all in Gen8 code generation.</li>
<li>i965/clip: Fix brw_clip_unfilled.c/compute_offset's assembly.</li>
</ul>
<p>Marek Olšák (3):</p>
<ul>
<li>r600g: fix constant buffer fetches</li>
<li>radeonsi: save scissor state and sample mask for u_blitter</li>
<li>glsl_to_tgsi: allocate and enlarge arrays for temporaries on demand</li>
</ul>
<p>Paulo Sergio Travaglia (2):</p>
<ul>
<li>android: gallium/radeon: attempt to fix the android build</li>
<li>android: egl/main: resolve radeon linking issues</li>
</ul>
<p>Pekka Paalanen (1):</p>
<ul>
<li>egl_dri2: fix EXT_image_dma_buf_import fds</li>
</ul>
<p>Robert Bragg (1):</p>
<ul>
<li>meta: save and restore swizzle for _GenerateMipmap</li>
</ul>
<p>Tom Stellard (7):</p>
<ul>
<li>radeon/compute: Fix reported values for MAX_GLOBAL_SIZE and MAX_MEM_ALLOC_SIZE</li>
<li>radeonsi/compute: Update reference counts for buffers in si_set_global_binding()</li>
<li>radeonsi/compute: Call si_pm4_free_state() after emitting compute state</li>
<li>clover: Flush the command queue in clReleaseCommandQueue()</li>
<li>radeon: Add work-around for missing Hainan support in clang &lt; 3.6 v2</li>
<li>pipe-loader: Fix memory leak v2</li>
<li>r600g/compute: Don't initialize vertex_buffer_state masks to 0x2</li>
</ul>
<p>Vinson Lee (1):</p>
<ul>
<li>gallivm: Fix build with LLVM &gt;= 3.6 r215967.</li>
</ul>
</div>
</body>
</html>

95
docs/relnotes/10.2.html Normal file
View File

@@ -0,0 +1,95 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Mesa Release Notes</title>
<link rel="stylesheet" type="text/css" href="../mesa.css">
</head>
<body>
<div class="header">
<h1>The Mesa 3D Graphics Library</h1>
</div>
<iframe src="../contents.html"></iframe>
<div class="content">
<h1>Mesa 10.2 Release Notes / June 6, 2014</h1>
<p>
Mesa 10.2 is a new development release.
People who are concerned with stability and reliability should stick
with a previous release or wait for Mesa 10.2.1.
</p>
<p>
Mesa 10.2 implements the OpenGL 3.3 API, but the version reported by
glGetString(GL_VERSION) or glGetIntegerv(GL_MAJOR_VERSION) /
glGetIntegerv(GL_MINOR_VERSION) depends on the particular driver being used.
Some drivers don't support all the features required in OpenGL 3.3. OpenGL
3.3 is <strong>only</strong> available if requested at context creation
because compatibility contexts are not supported.
</p>
<h2>MD5 checksums</h2>
<pre>
c87bfb6dd5cbcf1fdef42e5ccd972581 MesaLib-10.2.0.tar.gz
7aaba90bd7169a94ae2fe83febdec963 MesaLib-10.2.0.tar.bz2
58b203aca15dadc25ab4d1126db1052b MesaLib-10.2.0.zip
</pre>
<h2>New features</h2>
<p>
Note: some of the new features are only available with certain drivers.
</p>
<ul>
<li>GL_ARB_buffer_storage on i965, nv30, nv50, nvc0, r300, r600, and radeonsi</li>
<li>GL_ARB_multi_bind on all drivers</li>
<li>GL_ARB_sample_shading on nv50 (GT21x only), nvc0</li>
<li>GL_ARB_separate_shader_objects (desktop OpenGL) and
GL_EXT_separate_shader_objects (OpenGL ES 2.0 and 3.0) on all drivers</li>
<li>GL_ARB_stencil_texturing on i965/gen8+</li>
<li>GL_ARB_texture_cube_map_array on nv50 (GT21x only)</li>
<li>GL_ARB_texture_gather on nv50 (GT21x only), nvc0</li>
<li>GL_ARB_texture_query_lod on nv50 (GT21x only), nvc0</li>
<li>GL_ARB_texture_view on i965/gen7</li>
<li>GL_ARB_vertex_type_10f_11f_11f_rev on nv50, nvc0, radeonsi</li>
<li>GL_ARB_viewport_array on nv50, r600</li>
<li>GL_INTEL_performance_query on i965/gen5+</li>
</ul>
<h2>Bug fixes</h2>
TBD.
<h2>Changes</h2>
<ul>
<li>Renamed <i>--with-llvm-shared-libs</i> to <i>--enable-llvm-shared-libs</i></li>
<p>
The option is used to control how mesa is linked against LLVM, and now
defaults to enabled (shared linking).
</p>
<li>Split <i>libxatracker.so</i> into a standalone library which can be used
with any gallium driver.</li>
<p>
Previously the library was linked statically against vmware's virtual gpu
driver(svga), whereas now it loads a shared pipe_*.so driver. Provide the
following options during configure, if you would like support for svga driver
<i>--enable-xa --with-gallium-drivers=svga</i>
</p>
<p>
Note: The files are installed in $(libdir)/gallium-pipe/ and the interface
between them and libxatracker.so is <strong>not</strong> stable.
</p>
</ul>
</div>
</body>
</html>

115
docs/relnotes/9.2.3.html Normal file
View File

@@ -0,0 +1,115 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Mesa Release Notes</title>
<link rel="stylesheet" type="text/css" href="../mesa.css">
</head>
<body>
<div class="header">
<h1>The Mesa 3D Graphics Library</h1>
</div>
<iframe src="../contents.html"></iframe>
<div class="content">
<h1>Mesa 9.2.3 Release Notes / (November 13, 2013)</h1>
<p>
Mesa 9.2.3 is a bug fix release which fixes bugs found since the 9.2.2 release.
</p>
<p>
Mesa 9.2 implements the OpenGL 3.1 API, but the version reported by
glGetString(GL_VERSION) or glGetIntegerv(GL_MAJOR_VERSION) /
glGetIntegerv(GL_MINOR_VERSION) depends on the particular driver being used.
Some drivers don't support all the features required in OpenGL 3.1. OpenGL
3.1 is <strong>only</strong> available if requested at context creation
because GL_ARB_compatibility is not supported.
</p>
<h2>MD5 checksums</h2>
<pre>
66e9a33a414f801e1c33398bf627d56b MesaLib-9.2.3.tar.gz
f56b6beb556e4b9072814419f7c554e3 MesaLib-9.2.3.tar.bz2
ed852dab576faac237ac4298bf55d0a1 MesaLib-9.2.3.zip
</pre>
<h2>New features</h2>
<p>None</p>
<h2>Bug fixes</h2>
<p>This list is likely incomplete.</p>
<ul>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=69437">Bug 69437</a> - Composite Bypass no longer works</li>
</ul>
<h2>Changes</h2>
<p>The full set of changes can be viewed by using the following GIT command:</p>
<pre>
git log mesa-9.2.2..mesa-9.2.3
</pre>
<p>Brian Paul (2):</p>
<ul>
<li>st/mesa: move out of memory check in st_draw_vbo()</li>
<li>osmesa: fix broken triangle/line drawing when using float color buffer</li>
</ul>
<p>Carl Worth (7):</p>
<ul>
<li>Remove error when calling glGenQueries/glDeleteQueries while a query is active</li>
<li>Bump version to 9.2.3</li>
</ul>
<p>Daniel Vetter (1):</p>
<ul>
<li>i965: CS writes/reads should use I915_GEM_INSTRUCTION</li>
</ul>
<p>Eric Anholt (1):</p>
<ul>
<li>i965: Fix texture buffer rendering after a whole buffer replacement.</li>
</ul>
<p>Kenneth Graunke (6):</p>
<ul>
<li>i965: Emit post-sync non-zero flush before 3DSTATE_GS_SVB_INDEX.</li>
<li>i965: Emit post-sync non-zero flush before 3DSTATE_DRAWING_RECTANGLE.</li>
<li>i965: Also guard 3DSTATE_DRAWING_RECTANGLE with a flush in blorp.</li>
<li>i965: Move post-sync non-zero flush for 3DSTATE_MULTISAMPLE.</li>
<li>i965: Also emit HIER_DEPTH and STENCIL packets when disabling depth.</li>
<li>i965: Also emit HiZ and Stencil packets when disabling depth on Gen6.</li>
</ul>
<p>Kristian Høgsberg (1):</p>
<ul>
<li>wayland: Don't rely on static variable for identifying wl_drm buffers</li>
</ul>
<p>Marek Olšák (1):</p>
<ul>
<li>radeonsi: fix blitting the last 2 mipmap levels of compressed textures</li>
</ul>
<p>Petr Sebor (1):</p>
<ul>
<li>meta: enable vertex attributes in the context of the newly created array object</li>
</ul>
<p>Scott Graham (1):</p>
<ul>
<li>mesa: fixes for MSVC 2013</li>
</ul>
</div>
</body>
</html>

102
docs/relnotes/9.2.4.html Normal file
View File

@@ -0,0 +1,102 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Mesa Release Notes</title>
<link rel="stylesheet" type="text/css" href="../mesa.css">
</head>
<body>
<div class="header">
<h1>The Mesa 3D Graphics Library</h1>
</div>
<iframe src="../contents.html"></iframe>
<div class="content">
<h1>Mesa 9.2.4 Release Notes / (November 27, 2013)</h1>
<p>
Mesa 9.2.4 is a bug fix release which fixes bugs found since the 9.2.3 release.
</p>
<p>
Mesa 9.2 implements the OpenGL 3.1 API, but the version reported by
glGetString(GL_VERSION) or glGetIntegerv(GL_MAJOR_VERSION) /
glGetIntegerv(GL_MINOR_VERSION) depends on the particular driver being used.
Some drivers don't support all the features required in OpenGL 3.1. OpenGL
3.1 is <strong>only</strong> available if requested at context creation
because GL_ARB_compatibility is not supported.
</p>
<h2>MD5 checksums</h2>
<pre>
28190b831b0271d69dbc44b2686eab1c MesaLib-9.2.4.tar.gz
e630c0a307cec4f0f70ddd029d2fe084 MesaLib-9.2.4.tar.bz2
8ef5e1e92e1d30fbedec31f716a7619e MesaLib-9.2.4.zip
</pre>
<h2>New features</h2>
<p>None</p>
<h2>Bug fixes</h2>
<p>This list is likely incomplete.</p>
<ul>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=53077">Bug 53077</a> - [IVB] Output error with msaa when both of framebuffer and source color's alpha are not 1</li>
<li>Fix freedreno to compile with recent libdrm.</li>
</ul>
<h2>Changes</h2>
<p>The full set of changes can be viewed by using the following GIT command:</p>
<pre>
git log mesa-9.2.3..mesa-9.2.4
</pre>
<p>Brian Paul (1):</p>
<ul>
<li>st/mesa: fix GL_FEEDBACK mode inverted Y coordinate bug</li>
</ul>
<p>Paul Berry (2):</p>
<ul>
<li>i965: Fix vertical alignment for multisampled buffers.</li>
<li>glsl: Fix lowering of direct assignment in lower_clip_distance.</li>
</ul>
<p>Rob Clark (17):</p>
<ul>
<li>freedreno/a3xx: fix color inversion on mem-&gt;gmem restore</li>
<li>freedreno/a3xx: fix viewport on gmem-&gt;mem resolve</li>
<li>freedreno: add debug option to disable scissor optimization</li>
<li>freedreno: update register headers</li>
<li>freedreno/a3xx: some texture fixes</li>
<li>freedreno/a3xx/compiler: fix CMP</li>
<li>freedreno/a3xx/compiler: handle saturate on dst</li>
<li>freedreno/a3xx/compiler: use max_reg rather than file_count</li>
<li>freedreno/a3xx/compiler: cat4 cannot use const reg as src</li>
<li>freedreno: fix segfault when no color buffer bound</li>
<li>freedreno/a3xx/compiler: make compiler errors more useful</li>
<li>freedreno/a3xx/compiler: bit of re-arrange/cleanup</li>
<li>freedreno/a3xx/compiler: fix SGT/SLT/etc</li>
<li>freedreno/a3xx: don't leak so much</li>
<li>freedreno/a3xx/compiler: better const handling</li>
<li>freedreno/a3xx/compiler: handle sync flags better</li>
<li>freedreno: updates for msm drm/kms driver</li>
</ul>
<p>Tapani Pälli (1):</p>
<ul>
<li>mesa: enable GL_TEXTURE_LOD_BIAS set/get</li>
</ul>
</div>
</body>
</html>

120
docs/relnotes/9.2.5.html Normal file
View File

@@ -0,0 +1,120 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Mesa Release Notes</title>
<link rel="stylesheet" type="text/css" href="../mesa.css">
</head>
<body>
<div class="header">
<h1>The Mesa 3D Graphics Library</h1>
</div>
<iframe src="../contents.html"></iframe>
<div class="content">
<h1>Mesa 9.2.5 Release Notes / (December 12, 2013)</h1>
<p>
Mesa 9.2.5 is a bug fix release which fixes bugs found since the 9.2.4 release.
</p>
<p>
Mesa 9.2 implements the OpenGL 3.1 API, but the version reported by
glGetString(GL_VERSION) or glGetIntegerv(GL_MAJOR_VERSION) /
glGetIntegerv(GL_MINOR_VERSION) depends on the particular driver being used.
Some drivers don't support all the features required in OpenGL 3.1. OpenGL
3.1 is <strong>only</strong> available if requested at context creation
because GL_ARB_compatibility is not supported.
</p>
<h2>MD5 checksums</h2>
<pre>
9fb4de29ca1d9cfd03cbdefa123ba336 MesaLib-9.2.5.tar.bz2
1146c7c332767174f3de782b88d8e8ca MesaLib-9.2.5.tar.gz
a9a6c46dac7ea26fd272bf14894d95f3 MesaLib-9.2.5.zip
</pre>
<h2>New features</h2>
<p>None</p>
<h2>Bug fixes</h2>
<p>This list is likely incomplete.</p>
<ul>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=62142">Bug 62142</a> - Mesa/demo mipmap_limits upside down with running by SOFTWARE</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=64323">Bug 64323</a> - Severe misrendering in Left 4 Dead 2</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=66213">Bug 66213</a> - Certain Mesa Demos Rendering Inverted (vertically)</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=68838">Bug 68838</a> - GLSL: struct declarations produce a &quot;empty declaration warning&quot; in 9.2</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=69155">Bug 69155</a> - [NV50 gallium] [piglit] bin/varying-packing-simple triggers memory corruption/failures</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=72325">Bug 72325</a> - [swrast] piglit glean fbo regression</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=72327">Bug 72327</a> - [swrast] piglit glean pointSprite regression</li>
</ul>
<h2>Changes</h2>
<p>The full set of changes can be viewed by using the following GIT command:</p>
<pre>
git log mesa-9.2.4..mesa-9.2.5
</pre>
<p>Chad Versace (2):</p>
<ul>
<li>i965/hsw: Apply non-msrt fast color clear w/a to all HSW GTs</li>
<li>i965: Add extra-alignment for non-msrt fast color clear for all hw (v2)</li>
</ul>
<p>Chris Forbes (4):</p>
<ul>
<li>i965: Gen4-5: Don't enable hardware alpha test with MRT</li>
<li>i965: Gen4-5: Include alpha func/ref in program key</li>
<li>i965/fs: Gen4-5: Setup discard masks for MRT alpha test</li>
<li>i965/fs: Gen4-5: Implement alpha test in shader for MRT</li>
</ul>
<p>Chí-Thanh Christopher Nguyễn (1):</p>
<ul>
<li>st/xorg: Handle new DamageUnregister API which has only one argument</li>
</ul>
<p>Dave Airlie (3):</p>
<ul>
<li>mesa/swrast: fix inverted front buffer rendering with old-school swrast</li>
<li>glx: don't fail out when no configs if we have visuals</li>
<li>swrast: fix readback regression since inversion fix</li>
</ul>
<p>Ian Romanick (1):</p>
<ul>
<li>glsl: Don't emit empty declaration warning for a struct specifier</li>
</ul>
<p>Ilia Mirkin (4):</p>
<ul>
<li>nv50: Fix GPU_READING/WRITING bit removal</li>
<li>nouveau: avoid leaking fences while waiting</li>
<li>nv50: wait on the buf's fence before sticking it into pushbuf</li>
<li>nv50: report 15 max inputs for fragment programs</li>
</ul>
<p>Tom Stellard (2):</p>
<ul>
<li>r300/compiler/tests: Fix segfault</li>
<li>r300/compiler/tests: Fix line length check in test parser</li>
</ul>
</div>
</body>
</html>

View File

@@ -156,7 +156,7 @@ each time you do a pull.
</p>
<li>Small changes to master
<p>
If you are an experienced git user working on substancial modifications,
If you are an experienced git user working on substantial modifications,
you are probably
working on a separate branch and would rebase your branch prior to
merging with master.

View File

@@ -67,7 +67,7 @@ Example: export MESA_GLSL=dump,nopt
<h2 id="support">GLSL Version</h2>
<p>
The GLSL compiler currently supports version 1.40 of the shading language.
The GLSL compiler currently supports version 3.30 of the shading language.
</p>
<p>
@@ -234,7 +234,7 @@ This option is only relevant if EmitHighLevelInstructions is set.
<dt>EmitComments</dt>
<dd>
If set, instructions will be annoted with comments to help with debugging.
If set, instructions will be annotated with comments to help with debugging.
Extra NOP instructions will also be inserted.
</dd>
</dl>

View File

@@ -123,7 +123,7 @@ each directory.
Currently there's run-time code generation for x86/SSE, PowerPC
and Cell SPU.
<li><b>tgsi</b> - TG Shader Infrastructure. Code for encoding,
manipulating and interpretting GPU programs.
manipulating and interpreting GPU programs.
<li><b>translate</b> - module for translating vertex data from one format
to another.
<li><b>util</b> - assorted utilities for arithmetic, hashing, surface

View File

@@ -0,0 +1,125 @@
Name
MESA_configless_context
Name Strings
EGL_MESA_configless_context
Contact
Neil Roberts <neil.s.roberts@intel.com>
Status
Proposal
Version
Version 1, February 28, 2014
Number
EGL Extension #not assigned
Dependencies
Requires EGL 1.4 or later. This extension is written against the
wording of the EGL 1.4 specification.
Overview
This extension provides a means to use a single context to render to
multiple surfaces which have different EGLConfigs. Without this extension
the EGLConfig for every surface used by the context must be compatible
with the one used by the context. The only way to render to surfaces with
different formats would be to create multiple contexts but this is
inefficient with modern GPUs where this restriction is unnecessary.
IP Status
Open-source; freely implementable.
New Procedures and Functions
None.
New Tokens
Accepted as <config> in eglCreateContext
EGL_NO_CONFIG_MESA ((EGLConfig)0)
Additions to the EGL Specification section "2.2 Rendering Contexts and Drawing
Surfaces"
Add the following to the 3rd paragraph:
"EGLContexts can also optionally be created with respect to an EGLConfig
depending on the parameters used at creation time. If a config is provided
then additional restrictions apply on what surfaces can be used with the
context."
Replace the last sentence of the 6th paragraph with:
"In order for a context to be compatible with a surface they both must have
been created with respect to the same EGLDisplay. If the context was
created without respect to an EGLConfig then there are no further
constraints. Otherwise they are only compatible if:"
Remove the last bullet point in the list of constraints.
Additions to the EGL Specification section "3.7.1 Creating Rendering Contexts"
Replace the paragraph starting "If config is not a valid EGLConfig..."
with
"The config argument can either be a valid EGLConfig or EGL_NO_CONFIG_MESA.
If it is neither of these then an EGL_BAD_CONFIG error is generated. If a
valid config is passed then the error will also be generated if the config
does not support the requested client API (this includes requesting
creation of an OpenGL ES 1.x context when the EGL_RENDERABLE_TYPE
attribute of config does not contain EGL_OPENGL_ES_BIT, or creation of an
OpenGL ES 2.x context when the attribute does not contain
EGL_OPENGL_ES2_BIT).
Passing EGL_NO_CONFIG_MESA will create a configless context. When a
configless context is used with the OpenGL API it can be assumed that the
initial values of the context's state will be decided when the context is
first made current. In particular this means that the decision of whether
to use GL_BACK or GL_FRONT for the initial value of the first output in
glDrawBuffers will be decided based on the config of the draw surface when
it is first bound."
Additions to the EGL Specification section "3.7.3 Binding Contexts and
Drawables"
Replace the first bullet point with the following:
"* If draw or read are not compatible with ctx as described in section 2.2,
then an EGL_BAD_MATCH error is generated."
Add a second bullet point after that:
"* If draw and read are not compatible with each other as described in
section 2.2, then an EGL_BAD_MATCH error is generated."
Issues
1. What happens when an OpenGL context with a double-buffered surface and
draw buffer set to GL_BACK is made current with a single-buffered
surface?
NOT RESOLVED: There are a few options here. An implementation can
raise an error, change the drawbuffer state to GL_FRONT or just do
nothing, expecting the application to set GL_FRONT drawbuffer before
drawing. However, this extension deliberately does not specify any
required behavior in this corner case and applications should avoid
mixing single- and double-buffered surfaces with configless contexts.
Future extensions may specify required behavior in this case.
Revision History
Version 1, February 28, 2014
Initial draft (Neil Roberts)

View File

@@ -16,11 +16,11 @@ IP Status
Status
Incomplete. DO NOT SHIP.
Shipping as of Mesa 10.0
Version
Version 6, 7-November-2013
Version 8, 14-February-2014
Number
@@ -211,7 +211,7 @@ Additions to the GLX 1.4 Specification
The attribute name GLX_RENDERER_ID_MESA specified the index of the render
against which the context should be created. The default value of
GLX_RENDER_ID_MESA is 0.
GLX_RENDERER_ID_MESA is 0.
[Add to list of errors for glXCreateContextAttribsARB in section section
@@ -373,7 +373,7 @@ Issues
should make every attempt to return as much information as is
possible. For example, if the implementation is running on a non-PCI
SoC with a Qualcomm GPU, GLX_RENDERER_VENDOR_ID_MESA should return
0x168C, but GLX_RENDERER_DEVICE_ID_MESA will return 0x0000.
0x5143, but GLX_RENDERER_DEVICE_ID_MESA will return 0xFFFFFFFF.
Revision History
@@ -403,3 +403,8 @@ Revision History
Version 7, 2013/11/07 - Fix a couple more typos. Add issue #17 regarding
the PCI queries on systems that don't have PCI.
Version 8, 2014/02/14 - Fix a couple typos. GLX_RENDER_ID_MESA should
read GLX_RENDERER_ID_MESA. The VENDOR/DEVICE_ID
example given in issue #17 should be 0x5143 and
0xFFFFFFFF respectively.

View File

@@ -16,7 +16,7 @@ IP Status
Status
Shipping in Mesa 7.1
DEPRECATED - Support removed in Mesa 10.1.
Version

View File

@@ -0,0 +1,101 @@
Name
WL_create_wayland_buffer_from_image
Name Strings
EGL_WL_create_wayland_buffer_from_image
Contributors
Neil Roberts
Axel Davy
Daniel Stone
Contact
Neil Roberts <neil.s.roberts@intel.com>
Status
Proposal
Version
Version 2, October 25, 2013
Number
EGL Extension #not assigned
Dependencies
Requires EGL 1.4 or later. This extension is written against the
wording of the EGL 1.4 specification.
EGL_KHR_base_image is required.
Overview
This extension provides an entry point to create a wl_buffer which shares
its contents with a given EGLImage. The expected use case for this is in a
nested Wayland compositor which is using subsurfaces to present buffers
from its clients. Using this extension it can attach the client buffers
directly to the subsurface without having to blit the contents into an
intermediate buffer. The compositing can then be done in the parent
compositor.
The nested compositor can create an EGLImage from a client buffer resource
using the existing WL_bind_wayland_display extension. It should also be
possible to create buffers using other types of images although there is
no expected use case for that.
IP Status
Open-source; freely implementable.
New Procedures and Functions
struct wl_buffer *eglCreateWaylandBufferFromImageWL(EGLDisplay dpy,
EGLImageKHR image);
New Tokens
None.
Additions to the EGL 1.4 Specification:
To create a client-side wl_buffer from an EGLImage call
struct wl_buffer *eglCreateWaylandBufferFromImageWL(EGLDisplay dpy,
EGLImageKHR image);
The returned buffer will share the contents with the given EGLImage. Any
updates to the image will also be updated in the wl_buffer. Typically the
EGLImage will be generated in a nested Wayland compositor using a buffer
resource from a client via the EGL_WL_bind_wayland_display extension.
If there was an error then the function will return NULL. In particular it
will generate EGL_BAD_MATCH if the implementation is not able to represent
the image as a wl_buffer. The possible reasons for this error are
implementation-dependant but may include problems such as an unsupported
format or tiling mode or that the buffer is in memory that is inaccessible
to the GPU that the given EGLDisplay is using.
Issues
1) Under what circumstances can the EGL_BAD_MATCH error be generated? Does
this include for example unsupported tiling modes?
RESOLVED: Yes, the EGL_BAD_MATCH error can be generated for any reason
which prevents the implementation from representing the image as a
wl_buffer. For example, these problems can be but are not limited to
unsupported tiling modes, inaccessible memory or an unsupported pixel
format.
Revision History
Version 1, September 6, 2013
Initial draft (Neil Roberts)
Version 2, October 25, 2013
Added a note about more possible reasons for returning EGL_BAD_FORMAT.

View File

@@ -14,7 +14,7 @@
<iframe src="contents.html"></iframe>
<div class="content">
<h1>Acknowledgments</h1>
<h1>Acknowledgements</h1>
The following individuals and groups are to be acknowledged for their

View File

@@ -27,9 +27,10 @@ MacOS are all supported.
</p>
<p>
End users shouldn't have to go through all these steps once the driver is
included in newer Linux distributions.
Fedora 18 and Ubuntu 12.10 include the VMware guest GL driver, for example.
Most modern Linux distros include the SVGA3D driver so end users shouldn't
be concerned with this information.
But if your distro lacks the driver or you want to update to the latest code
these instructions explain what to do.
</p>
<p>
@@ -53,6 +54,13 @@ The components involved in this include:
<li>Mesa/gallium OpenGL driver: "svga"
</ul>
<p>
All of these components reside in the guest Linux virtual machine.
On the host, all you're doing is running VMware
<a href="http://www.vmware.com/products/workstation/">Workstation</a> or
<a href="http://www.vmware.com/products/fusion/">Fusion</a>.
</p>
<h2>Prerequisites</h2>
@@ -134,7 +142,7 @@ As before, if you're on a 32-bit system, you should skip the --libdir
configure option.
<pre>
cd $TOP/mesa
./autogen.sh --prefix=/usr --libdir=/usr/lib64 --with-gallium-drivers=svga --with-dri-drivers= --enable-xa
./autogen.sh --prefix=/usr --libdir=/usr/lib64 --with-gallium-drivers=svga --with-dri-drivers= --enable-xa --disable-dri3
make
sudo make install
</pre>

View File

@@ -107,7 +107,7 @@ for your application.
<p>
When using Mesa directly or with GLX, it's up to the application
writer to create a window with an appropriate colormap. The GLUT
toolkit tris to minimize colormap <em>flashing</em> by sharing
toolkit tries to minimize colormap <em>flashing</em> by sharing
colormaps when possible. Specifically, if the visual and depth of the
window matches that of the root window, the root window's colormap
will be shared by the Mesa window. Otherwise, a new, private colormap

View File

@@ -73,7 +73,6 @@ FILE_PATTERNS = \
fog.h \
get.h \
glheader.h \
glthread.h \
hash.[ch] \
hint.h \
histogram.h \

View File

@@ -34,7 +34,7 @@ SEARCH_INCLUDES = YES
INCLUDE_PATH = ../include/
INCLUDE_FILE_PATTERNS =
PREDEFINED =
EXPAND_AS_DEFINED = _glthread_DECLARE_STATIC_MUTEX
EXPAND_AS_DEFINED =
SKIP_FUNCTION_MACROS = YES
#---------------------------------------------------------------------------
# Configuration::addtions related to external references

View File

@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2008-2010 The Khronos Group Inc.
* Copyright (c) 2008 - 2012 The Khronos Group Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and/or associated documentation files (the
@@ -21,8 +21,6 @@
* MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
******************************************************************************/
/* $Revision: 11985 $ on $Date: 2010-07-15 11:16:06 -0700 (Thu, 15 Jul 2010) $ */
#ifndef __OPENCL_CL_H
#define __OPENCL_CL_H
@@ -58,8 +56,10 @@ typedef cl_uint cl_device_mem_cache_type;
typedef cl_uint cl_device_local_mem_type;
typedef cl_bitfield cl_device_exec_capabilities;
typedef cl_bitfield cl_command_queue_properties;
typedef intptr_t cl_device_partition_property;
typedef cl_bitfield cl_device_affinity_domain;
typedef intptr_t cl_context_properties;
typedef intptr_t cl_context_properties;
typedef cl_uint cl_context_info;
typedef cl_uint cl_command_queue_info;
typedef cl_uint cl_channel_order;
@@ -67,6 +67,7 @@ typedef cl_uint cl_channel_type;
typedef cl_bitfield cl_mem_flags;
typedef cl_uint cl_mem_object_type;
typedef cl_uint cl_mem_info;
typedef cl_bitfield cl_mem_migration_flags;
typedef cl_uint cl_image_info;
typedef cl_uint cl_buffer_create_type;
typedef cl_uint cl_addressing_mode;
@@ -75,24 +76,43 @@ typedef cl_uint cl_sampler_info;
typedef cl_bitfield cl_map_flags;
typedef cl_uint cl_program_info;
typedef cl_uint cl_program_build_info;
typedef cl_uint cl_program_binary_type;
typedef cl_int cl_build_status;
typedef cl_uint cl_kernel_info;
typedef cl_uint cl_kernel_arg_info;
typedef cl_uint cl_kernel_arg_address_qualifier;
typedef cl_uint cl_kernel_arg_access_qualifier;
typedef cl_bitfield cl_kernel_arg_type_qualifier;
typedef cl_uint cl_kernel_work_group_info;
typedef cl_uint cl_event_info;
typedef cl_uint cl_command_type;
typedef cl_uint cl_profiling_info;
typedef struct _cl_image_format {
cl_channel_order image_channel_order;
cl_channel_type image_channel_data_type;
} cl_image_format;
typedef struct _cl_image_desc {
cl_mem_object_type image_type;
size_t image_width;
size_t image_height;
size_t image_depth;
size_t image_array_size;
size_t image_row_pitch;
size_t image_slice_pitch;
cl_uint num_mip_levels;
cl_uint num_samples;
cl_mem buffer;
} cl_image_desc;
typedef struct _cl_buffer_region {
size_t origin;
size_t size;
} cl_buffer_region;
/******************************************************************************/
/* Error Codes */
@@ -111,6 +131,11 @@ typedef struct _cl_buffer_region {
#define CL_MAP_FAILURE -12
#define CL_MISALIGNED_SUB_BUFFER_OFFSET -13
#define CL_EXEC_STATUS_ERROR_FOR_EVENTS_IN_WAIT_LIST -14
#define CL_COMPILE_PROGRAM_FAILURE -15
#define CL_LINKER_NOT_AVAILABLE -16
#define CL_LINK_PROGRAM_FAILURE -17
#define CL_DEVICE_PARTITION_FAILED -18
#define CL_KERNEL_ARG_INFO_NOT_AVAILABLE -19
#define CL_INVALID_VALUE -30
#define CL_INVALID_DEVICE_TYPE -31
@@ -147,14 +172,21 @@ typedef struct _cl_buffer_region {
#define CL_INVALID_MIP_LEVEL -62
#define CL_INVALID_GLOBAL_WORK_SIZE -63
#define CL_INVALID_PROPERTY -64
#define CL_INVALID_IMAGE_DESCRIPTOR -65
#define CL_INVALID_COMPILER_OPTIONS -66
#define CL_INVALID_LINKER_OPTIONS -67
#define CL_INVALID_DEVICE_PARTITION_COUNT -68
/* OpenCL Version */
#define CL_VERSION_1_0 1
#define CL_VERSION_1_1 1
#define CL_VERSION_1_2 1
/* cl_bool */
#define CL_FALSE 0
#define CL_TRUE 1
#define CL_BLOCKING CL_TRUE
#define CL_NON_BLOCKING CL_FALSE
/* cl_platform_info */
#define CL_PLATFORM_PROFILE 0x0900
@@ -168,6 +200,7 @@ typedef struct _cl_buffer_region {
#define CL_DEVICE_TYPE_CPU (1 << 1)
#define CL_DEVICE_TYPE_GPU (1 << 2)
#define CL_DEVICE_TYPE_ACCELERATOR (1 << 3)
#define CL_DEVICE_TYPE_CUSTOM (1 << 4)
#define CL_DEVICE_TYPE_ALL 0xFFFFFFFF
/* cl_device_info */
@@ -221,7 +254,7 @@ typedef struct _cl_buffer_region {
#define CL_DEVICE_VERSION 0x102F
#define CL_DEVICE_EXTENSIONS 0x1030
#define CL_DEVICE_PLATFORM 0x1031
/* 0x1032 reserved for CL_DEVICE_DOUBLE_FP_CONFIG */
#define CL_DEVICE_DOUBLE_FP_CONFIG 0x1032
/* 0x1033 reserved for CL_DEVICE_HALF_FP_CONFIG */
#define CL_DEVICE_PREFERRED_VECTOR_WIDTH_HALF 0x1034
#define CL_DEVICE_HOST_UNIFIED_MEMORY 0x1035
@@ -233,6 +266,20 @@ typedef struct _cl_buffer_region {
#define CL_DEVICE_NATIVE_VECTOR_WIDTH_DOUBLE 0x103B
#define CL_DEVICE_NATIVE_VECTOR_WIDTH_HALF 0x103C
#define CL_DEVICE_OPENCL_C_VERSION 0x103D
#define CL_DEVICE_LINKER_AVAILABLE 0x103E
#define CL_DEVICE_BUILT_IN_KERNELS 0x103F
#define CL_DEVICE_IMAGE_MAX_BUFFER_SIZE 0x1040
#define CL_DEVICE_IMAGE_MAX_ARRAY_SIZE 0x1041
#define CL_DEVICE_PARENT_DEVICE 0x1042
#define CL_DEVICE_PARTITION_MAX_SUB_DEVICES 0x1043
#define CL_DEVICE_PARTITION_PROPERTIES 0x1044
#define CL_DEVICE_PARTITION_AFFINITY_DOMAIN 0x1045
#define CL_DEVICE_PARTITION_TYPE 0x1046
#define CL_DEVICE_REFERENCE_COUNT 0x1047
#define CL_DEVICE_PREFERRED_INTEROP_USER_SYNC 0x1048
#define CL_DEVICE_PRINTF_BUFFER_SIZE 0x1049
#define CL_DEVICE_IMAGE_PITCH_ALIGNMENT 0x104A
#define CL_DEVICE_IMAGE_BASE_ADDRESS_ALIGNMENT 0x104B
/* cl_device_fp_config - bitfield */
#define CL_FP_DENORM (1 << 0)
@@ -242,6 +289,7 @@ typedef struct _cl_buffer_region {
#define CL_FP_ROUND_TO_INF (1 << 4)
#define CL_FP_FMA (1 << 5)
#define CL_FP_SOFT_FLOAT (1 << 6)
#define CL_FP_CORRECTLY_ROUNDED_DIVIDE_SQRT (1 << 7)
/* cl_device_mem_cache_type */
#define CL_NONE 0x0
@@ -266,8 +314,23 @@ typedef struct _cl_buffer_region {
#define CL_CONTEXT_PROPERTIES 0x1082
#define CL_CONTEXT_NUM_DEVICES 0x1083
/* cl_context_info + cl_context_properties */
/* cl_context_properties */
#define CL_CONTEXT_PLATFORM 0x1084
#define CL_CONTEXT_INTEROP_USER_SYNC 0x1085
/* cl_device_partition_property */
#define CL_DEVICE_PARTITION_EQUALLY 0x1086
#define CL_DEVICE_PARTITION_BY_COUNTS 0x1087
#define CL_DEVICE_PARTITION_BY_COUNTS_LIST_END 0x0
#define CL_DEVICE_PARTITION_BY_AFFINITY_DOMAIN 0x1088
/* cl_device_affinity_domain */
#define CL_DEVICE_AFFINITY_DOMAIN_NUMA (1 << 0)
#define CL_DEVICE_AFFINITY_DOMAIN_L4_CACHE (1 << 1)
#define CL_DEVICE_AFFINITY_DOMAIN_L3_CACHE (1 << 2)
#define CL_DEVICE_AFFINITY_DOMAIN_L2_CACHE (1 << 3)
#define CL_DEVICE_AFFINITY_DOMAIN_L1_CACHE (1 << 4)
#define CL_DEVICE_AFFINITY_DOMAIN_NEXT_PARTITIONABLE (1 << 5)
/* cl_command_queue_info */
#define CL_QUEUE_CONTEXT 0x1090
@@ -282,6 +345,14 @@ typedef struct _cl_buffer_region {
#define CL_MEM_USE_HOST_PTR (1 << 3)
#define CL_MEM_ALLOC_HOST_PTR (1 << 4)
#define CL_MEM_COPY_HOST_PTR (1 << 5)
/* reserved (1 << 6) */
#define CL_MEM_HOST_WRITE_ONLY (1 << 7)
#define CL_MEM_HOST_READ_ONLY (1 << 8)
#define CL_MEM_HOST_NO_ACCESS (1 << 9)
/* cl_mem_migration_flags - bitfield */
#define CL_MIGRATE_MEM_OBJECT_HOST (1 << 0)
#define CL_MIGRATE_MEM_OBJECT_CONTENT_UNDEFINED (1 << 1)
/* cl_channel_order */
#define CL_R 0x10B0
@@ -297,6 +368,8 @@ typedef struct _cl_buffer_region {
#define CL_Rx 0x10BA
#define CL_RGx 0x10BB
#define CL_RGBx 0x10BC
#define CL_DEPTH 0x10BD
#define CL_DEPTH_STENCIL 0x10BE
/* cl_channel_type */
#define CL_SNORM_INT8 0x10D0
@@ -314,11 +387,16 @@ typedef struct _cl_buffer_region {
#define CL_UNSIGNED_INT32 0x10DC
#define CL_HALF_FLOAT 0x10DD
#define CL_FLOAT 0x10DE
#define CL_UNORM_INT24 0x10DF
/* cl_mem_object_type */
#define CL_MEM_OBJECT_BUFFER 0x10F0
#define CL_MEM_OBJECT_IMAGE2D 0x10F1
#define CL_MEM_OBJECT_IMAGE3D 0x10F2
#define CL_MEM_OBJECT_IMAGE2D_ARRAY 0x10F3
#define CL_MEM_OBJECT_IMAGE1D 0x10F4
#define CL_MEM_OBJECT_IMAGE1D_ARRAY 0x10F5
#define CL_MEM_OBJECT_IMAGE1D_BUFFER 0x10F6
/* cl_mem_info */
#define CL_MEM_TYPE 0x1100
@@ -339,6 +417,10 @@ typedef struct _cl_buffer_region {
#define CL_IMAGE_WIDTH 0x1114
#define CL_IMAGE_HEIGHT 0x1115
#define CL_IMAGE_DEPTH 0x1116
#define CL_IMAGE_ARRAY_SIZE 0x1117
#define CL_IMAGE_BUFFER 0x1118
#define CL_IMAGE_NUM_MIP_LEVELS 0x1119
#define CL_IMAGE_NUM_SAMPLES 0x111A
/* cl_addressing_mode */
#define CL_ADDRESS_NONE 0x1130
@@ -361,6 +443,7 @@ typedef struct _cl_buffer_region {
/* cl_map_flags - bitfield */
#define CL_MAP_READ (1 << 0)
#define CL_MAP_WRITE (1 << 1)
#define CL_MAP_WRITE_INVALIDATE_REGION (1 << 2)
/* cl_program_info */
#define CL_PROGRAM_REFERENCE_COUNT 0x1160
@@ -370,11 +453,20 @@ typedef struct _cl_buffer_region {
#define CL_PROGRAM_SOURCE 0x1164
#define CL_PROGRAM_BINARY_SIZES 0x1165
#define CL_PROGRAM_BINARIES 0x1166
#define CL_PROGRAM_NUM_KERNELS 0x1167
#define CL_PROGRAM_KERNEL_NAMES 0x1168
/* cl_program_build_info */
#define CL_PROGRAM_BUILD_STATUS 0x1181
#define CL_PROGRAM_BUILD_OPTIONS 0x1182
#define CL_PROGRAM_BUILD_LOG 0x1183
#define CL_PROGRAM_BINARY_TYPE 0x1184
/* cl_program_binary_type */
#define CL_PROGRAM_BINARY_TYPE_NONE 0x0
#define CL_PROGRAM_BINARY_TYPE_COMPILED_OBJECT 0x1
#define CL_PROGRAM_BINARY_TYPE_LIBRARY 0x2
#define CL_PROGRAM_BINARY_TYPE_EXECUTABLE 0x4
/* cl_build_status */
#define CL_BUILD_SUCCESS 0
@@ -388,6 +480,32 @@ typedef struct _cl_buffer_region {
#define CL_KERNEL_REFERENCE_COUNT 0x1192
#define CL_KERNEL_CONTEXT 0x1193
#define CL_KERNEL_PROGRAM 0x1194
#define CL_KERNEL_ATTRIBUTES 0x1195
/* cl_kernel_arg_info */
#define CL_KERNEL_ARG_ADDRESS_QUALIFIER 0x1196
#define CL_KERNEL_ARG_ACCESS_QUALIFIER 0x1197
#define CL_KERNEL_ARG_TYPE_NAME 0x1198
#define CL_KERNEL_ARG_TYPE_QUALIFIER 0x1199
#define CL_KERNEL_ARG_NAME 0x119A
/* cl_kernel_arg_address_qualifier */
#define CL_KERNEL_ARG_ADDRESS_GLOBAL 0x119B
#define CL_KERNEL_ARG_ADDRESS_LOCAL 0x119C
#define CL_KERNEL_ARG_ADDRESS_CONSTANT 0x119D
#define CL_KERNEL_ARG_ADDRESS_PRIVATE 0x119E
/* cl_kernel_arg_access_qualifier */
#define CL_KERNEL_ARG_ACCESS_READ_ONLY 0x11A0
#define CL_KERNEL_ARG_ACCESS_WRITE_ONLY 0x11A1
#define CL_KERNEL_ARG_ACCESS_READ_WRITE 0x11A2
#define CL_KERNEL_ARG_ACCESS_NONE 0x11A3
/* cl_kernel_arg_type_qualifer */
#define CL_KERNEL_ARG_TYPE_NONE 0
#define CL_KERNEL_ARG_TYPE_CONST (1 << 0)
#define CL_KERNEL_ARG_TYPE_RESTRICT (1 << 1)
#define CL_KERNEL_ARG_TYPE_VOLATILE (1 << 2)
/* cl_kernel_work_group_info */
#define CL_KERNEL_WORK_GROUP_SIZE 0x11B0
@@ -395,6 +513,7 @@ typedef struct _cl_buffer_region {
#define CL_KERNEL_LOCAL_MEM_SIZE 0x11B2
#define CL_KERNEL_PREFERRED_WORK_GROUP_SIZE_MULTIPLE 0x11B3
#define CL_KERNEL_PRIVATE_MEM_SIZE 0x11B4
#define CL_KERNEL_GLOBAL_WORK_SIZE 0x11B5
/* cl_event_info */
#define CL_EVENT_COMMAND_QUEUE 0x11D0
@@ -425,13 +544,17 @@ typedef struct _cl_buffer_region {
#define CL_COMMAND_WRITE_BUFFER_RECT 0x1202
#define CL_COMMAND_COPY_BUFFER_RECT 0x1203
#define CL_COMMAND_USER 0x1204
#define CL_COMMAND_BARRIER 0x1205
#define CL_COMMAND_MIGRATE_MEM_OBJECTS 0x1206
#define CL_COMMAND_FILL_BUFFER 0x1207
#define CL_COMMAND_FILL_IMAGE 0x1208
/* command execution status */
#define CL_COMPLETE 0x0
#define CL_RUNNING 0x1
#define CL_SUBMITTED 0x2
#define CL_QUEUED 0x3
/* cl_buffer_create_type */
#define CL_BUFFER_CREATE_TYPE_REGION 0x1220
@@ -470,22 +593,35 @@ clGetDeviceInfo(cl_device_id /* device */,
size_t /* param_value_size */,
void * /* param_value */,
size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0;
extern CL_API_ENTRY cl_int CL_API_CALL
clCreateSubDevices(cl_device_id /* in_device */,
const cl_device_partition_property * /* properties */,
cl_uint /* num_devices */,
cl_device_id * /* out_devices */,
cl_uint * /* num_devices_ret */) CL_API_SUFFIX__VERSION_1_2;
extern CL_API_ENTRY cl_int CL_API_CALL
clRetainDevice(cl_device_id /* device */) CL_API_SUFFIX__VERSION_1_2;
extern CL_API_ENTRY cl_int CL_API_CALL
clReleaseDevice(cl_device_id /* device */) CL_API_SUFFIX__VERSION_1_2;
/* Context APIs */
extern CL_API_ENTRY cl_context CL_API_CALL
clCreateContext(const cl_context_properties * /* properties */,
cl_uint /* num_devices */,
const cl_device_id * /* devices */,
cl_uint /* num_devices */,
const cl_device_id * /* devices */,
void (CL_CALLBACK * /* pfn_notify */)(const char *, const void *, size_t, void *),
void * /* user_data */,
cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
void * /* user_data */,
cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
extern CL_API_ENTRY cl_context CL_API_CALL
clCreateContextFromType(const cl_context_properties * /* properties */,
cl_device_type /* device_type */,
cl_device_type /* device_type */,
void (CL_CALLBACK * /* pfn_notify*/ )(const char *, const void *, size_t, void *),
void * /* user_data */,
cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
void * /* user_data */,
cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
extern CL_API_ENTRY cl_int CL_API_CALL
clRetainContext(cl_context /* context */) CL_API_SUFFIX__VERSION_1_0;
@@ -520,25 +656,6 @@ clGetCommandQueueInfo(cl_command_queue /* command_queue */,
void * /* param_value */,
size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0;
#ifdef CL_USE_DEPRECATED_OPENCL_1_0_APIS
#warning CL_USE_DEPRECATED_OPENCL_1_0_APIS is defined. These APIs are unsupported and untested in OpenCL 1.1!
/*
* WARNING:
* This API introduces mutable state into the OpenCL implementation. It has been REMOVED
* to better facilitate thread safety. The 1.0 API is not thread safe. It is not tested by the
* OpenCL 1.1 conformance test, and consequently may not work or may not work dependably.
* It is likely to be non-performant. Use of this API is not advised. Use at your own risk.
*
* Software developers previously relying on this API are instructed to set the command queue
* properties when creating the queue, instead.
*/
extern CL_API_ENTRY cl_int CL_API_CALL
clSetCommandQueueProperty(cl_command_queue /* command_queue */,
cl_command_queue_properties /* properties */,
cl_bool /* enable */,
cl_command_queue_properties * /* old_properties */) CL_EXT_SUFFIX__VERSION_1_0_DEPRECATED;
#endif /* CL_USE_DEPRECATED_OPENCL_1_0_APIS */
/* Memory Object APIs */
extern CL_API_ENTRY cl_mem CL_API_CALL
clCreateBuffer(cl_context /* context */,
@@ -555,26 +672,12 @@ clCreateSubBuffer(cl_mem /* buffer */,
cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_1;
extern CL_API_ENTRY cl_mem CL_API_CALL
clCreateImage2D(cl_context /* context */,
cl_mem_flags /* flags */,
const cl_image_format * /* image_format */,
size_t /* image_width */,
size_t /* image_height */,
size_t /* image_row_pitch */,
void * /* host_ptr */,
cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
extern CL_API_ENTRY cl_mem CL_API_CALL
clCreateImage3D(cl_context /* context */,
cl_mem_flags /* flags */,
const cl_image_format * /* image_format */,
size_t /* image_width */,
size_t /* image_height */,
size_t /* image_depth */,
size_t /* image_row_pitch */,
size_t /* image_slice_pitch */,
void * /* host_ptr */,
cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
clCreateImage(cl_context /* context */,
cl_mem_flags /* flags */,
const cl_image_format * /* image_format */,
const cl_image_desc * /* image_desc */,
void * /* host_ptr */,
cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_2;
extern CL_API_ENTRY cl_int CL_API_CALL
clRetainMemObject(cl_mem /* memobj */) CL_API_SUFFIX__VERSION_1_0;
@@ -609,7 +712,7 @@ clSetMemObjectDestructorCallback( cl_mem /* memobj */,
void (CL_CALLBACK * /*pfn_notify*/)( cl_mem /* memobj */, void* /*user_data*/),
void * /*user_data */ ) CL_API_SUFFIX__VERSION_1_1;
/* Sampler APIs */
/* Sampler APIs */
extern CL_API_ENTRY cl_sampler CL_API_CALL
clCreateSampler(cl_context /* context */,
cl_bool /* normalized_coords */,
@@ -647,6 +750,13 @@ clCreateProgramWithBinary(cl_context /* context */,
cl_int * /* binary_status */,
cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
extern CL_API_ENTRY cl_program CL_API_CALL
clCreateProgramWithBuiltInKernels(cl_context /* context */,
cl_uint /* num_devices */,
const cl_device_id * /* device_list */,
const char * /* kernel_names */,
cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_2;
extern CL_API_ENTRY cl_int CL_API_CALL
clRetainProgram(cl_program /* program */) CL_API_SUFFIX__VERSION_1_0;
@@ -662,7 +772,30 @@ clBuildProgram(cl_program /* program */,
void * /* user_data */) CL_API_SUFFIX__VERSION_1_0;
extern CL_API_ENTRY cl_int CL_API_CALL
clUnloadCompiler(void) CL_API_SUFFIX__VERSION_1_0;
clCompileProgram(cl_program /* program */,
cl_uint /* num_devices */,
const cl_device_id * /* device_list */,
const char * /* options */,
cl_uint /* num_input_headers */,
const cl_program * /* input_headers */,
const char ** /* header_include_names */,
void (CL_CALLBACK * /* pfn_notify */)(cl_program /* program */, void * /* user_data */),
void * /* user_data */) CL_API_SUFFIX__VERSION_1_2;
extern CL_API_ENTRY cl_program CL_API_CALL
clLinkProgram(cl_context /* context */,
cl_uint /* num_devices */,
const cl_device_id * /* device_list */,
const char * /* options */,
cl_uint /* num_input_programs */,
const cl_program * /* input_programs */,
void (CL_CALLBACK * /* pfn_notify */)(cl_program /* program */, void * /* user_data */),
void * /* user_data */,
cl_int * /* errcode_ret */ ) CL_API_SUFFIX__VERSION_1_2;
extern CL_API_ENTRY cl_int CL_API_CALL
clUnloadPlatformCompiler(cl_platform_id /* platform */) CL_API_SUFFIX__VERSION_1_2;
extern CL_API_ENTRY cl_int CL_API_CALL
clGetProgramInfo(cl_program /* program */,
@@ -710,6 +843,14 @@ clGetKernelInfo(cl_kernel /* kernel */,
void * /* param_value */,
size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0;
extern CL_API_ENTRY cl_int CL_API_CALL
clGetKernelArgInfo(cl_kernel /* kernel */,
cl_uint /* arg_indx */,
cl_kernel_arg_info /* param_name */,
size_t /* param_value_size */,
void * /* param_value */,
size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_2;
extern CL_API_ENTRY cl_int CL_API_CALL
clGetKernelWorkGroupInfo(cl_kernel /* kernel */,
cl_device_id /* device */,
@@ -718,7 +859,7 @@ clGetKernelWorkGroupInfo(cl_kernel /* kernel */,
void * /* param_value */,
size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0;
/* Event Object APIs */
/* Event Object APIs */
extern CL_API_ENTRY cl_int CL_API_CALL
clWaitForEvents(cl_uint /* num_events */,
const cl_event * /* event_list */) CL_API_SUFFIX__VERSION_1_0;
@@ -750,7 +891,7 @@ clSetEventCallback( cl_event /* event */,
void (CL_CALLBACK * /* pfn_notify */)(cl_event, cl_int, void *),
void * /* user_data */) CL_API_SUFFIX__VERSION_1_1;
/* Profiling APIs */
/* Profiling APIs */
extern CL_API_ENTRY cl_int CL_API_CALL
clGetEventProfilingInfo(cl_event /* event */,
cl_profiling_info /* param_name */,
@@ -771,7 +912,7 @@ clEnqueueReadBuffer(cl_command_queue /* command_queue */,
cl_mem /* buffer */,
cl_bool /* blocking_read */,
size_t /* offset */,
size_t /* cb */,
size_t /* size */,
void * /* ptr */,
cl_uint /* num_events_in_wait_list */,
const cl_event * /* event_wait_list */,
@@ -781,8 +922,8 @@ extern CL_API_ENTRY cl_int CL_API_CALL
clEnqueueReadBufferRect(cl_command_queue /* command_queue */,
cl_mem /* buffer */,
cl_bool /* blocking_read */,
const size_t * /* buffer_origin */,
const size_t * /* host_origin */,
const size_t * /* buffer_offset */,
const size_t * /* host_offset */,
const size_t * /* region */,
size_t /* buffer_row_pitch */,
size_t /* buffer_slice_pitch */,
@@ -798,7 +939,7 @@ clEnqueueWriteBuffer(cl_command_queue /* command_queue */,
cl_mem /* buffer */,
cl_bool /* blocking_write */,
size_t /* offset */,
size_t /* cb */,
size_t /* size */,
const void * /* ptr */,
cl_uint /* num_events_in_wait_list */,
const cl_event * /* event_wait_list */,
@@ -808,8 +949,8 @@ extern CL_API_ENTRY cl_int CL_API_CALL
clEnqueueWriteBufferRect(cl_command_queue /* command_queue */,
cl_mem /* buffer */,
cl_bool /* blocking_write */,
const size_t * /* buffer_origin */,
const size_t * /* host_origin */,
const size_t * /* buffer_offset */,
const size_t * /* host_offset */,
const size_t * /* region */,
size_t /* buffer_row_pitch */,
size_t /* buffer_slice_pitch */,
@@ -820,13 +961,24 @@ clEnqueueWriteBufferRect(cl_command_queue /* command_queue */,
const cl_event * /* event_wait_list */,
cl_event * /* event */) CL_API_SUFFIX__VERSION_1_1;
extern CL_API_ENTRY cl_int CL_API_CALL
clEnqueueFillBuffer(cl_command_queue /* command_queue */,
cl_mem /* buffer */,
const void * /* pattern */,
size_t /* pattern_size */,
size_t /* offset */,
size_t /* size */,
cl_uint /* num_events_in_wait_list */,
const cl_event * /* event_wait_list */,
cl_event * /* event */) CL_API_SUFFIX__VERSION_1_2;
extern CL_API_ENTRY cl_int CL_API_CALL
clEnqueueCopyBuffer(cl_command_queue /* command_queue */,
cl_mem /* src_buffer */,
cl_mem /* dst_buffer */,
size_t /* src_offset */,
size_t /* dst_offset */,
size_t /* cb */,
size_t /* size */,
cl_uint /* num_events_in_wait_list */,
const cl_event * /* event_wait_list */,
cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0;
@@ -872,6 +1024,16 @@ clEnqueueWriteImage(cl_command_queue /* command_queue */,
const cl_event * /* event_wait_list */,
cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0;
extern CL_API_ENTRY cl_int CL_API_CALL
clEnqueueFillImage(cl_command_queue /* command_queue */,
cl_mem /* image */,
const void * /* fill_color */,
const size_t * /* origin[3] */,
const size_t * /* region[3] */,
cl_uint /* num_events_in_wait_list */,
const cl_event * /* event_wait_list */,
cl_event * /* event */) CL_API_SUFFIX__VERSION_1_2;
extern CL_API_ENTRY cl_int CL_API_CALL
clEnqueueCopyImage(cl_command_queue /* command_queue */,
cl_mem /* src_image */,
@@ -911,7 +1073,7 @@ clEnqueueMapBuffer(cl_command_queue /* command_queue */,
cl_bool /* blocking_map */,
cl_map_flags /* map_flags */,
size_t /* offset */,
size_t /* cb */,
size_t /* size */,
cl_uint /* num_events_in_wait_list */,
const cl_event * /* event_wait_list */,
cl_event * /* event */,
@@ -939,6 +1101,15 @@ clEnqueueUnmapMemObject(cl_command_queue /* command_queue */,
const cl_event * /* event_wait_list */,
cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0;
extern CL_API_ENTRY cl_int CL_API_CALL
clEnqueueMigrateMemObjects(cl_command_queue /* command_queue */,
cl_uint /* num_mem_objects */,
const cl_mem * /* mem_objects */,
cl_mem_migration_flags /* flags */,
cl_uint /* num_events_in_wait_list */,
const cl_event * /* event_wait_list */,
cl_event * /* event */) CL_API_SUFFIX__VERSION_1_2;
extern CL_API_ENTRY cl_int CL_API_CALL
clEnqueueNDRangeKernel(cl_command_queue /* command_queue */,
cl_kernel /* kernel */,
@@ -959,7 +1130,7 @@ clEnqueueTask(cl_command_queue /* command_queue */,
extern CL_API_ENTRY cl_int CL_API_CALL
clEnqueueNativeKernel(cl_command_queue /* command_queue */,
void (*user_func)(void *),
void (CL_CALLBACK * /*user_func*/)(void *),
void * /* args */,
size_t /* cb_args */,
cl_uint /* num_mem_objects */,
@@ -970,16 +1141,17 @@ clEnqueueNativeKernel(cl_command_queue /* command_queue */,
cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0;
extern CL_API_ENTRY cl_int CL_API_CALL
clEnqueueMarker(cl_command_queue /* command_queue */,
cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0;
clEnqueueMarkerWithWaitList(cl_command_queue /* command_queue */,
cl_uint /* num_events_in_wait_list */,
const cl_event * /* event_wait_list */,
cl_event * /* event */) CL_API_SUFFIX__VERSION_1_2;
extern CL_API_ENTRY cl_int CL_API_CALL
clEnqueueWaitForEvents(cl_command_queue /* command_queue */,
cl_uint /* num_events */,
const cl_event * /* event_list */) CL_API_SUFFIX__VERSION_1_0;
clEnqueueBarrierWithWaitList(cl_command_queue /* command_queue */,
cl_uint /* num_events_in_wait_list */,
const cl_event * /* event_wait_list */,
cl_event * /* event */) CL_API_SUFFIX__VERSION_1_2;
extern CL_API_ENTRY cl_int CL_API_CALL
clEnqueueBarrier(cl_command_queue /* command_queue */) CL_API_SUFFIX__VERSION_1_0;
/* Extension function access
*
@@ -988,7 +1160,51 @@ clEnqueueBarrier(cl_command_queue /* command_queue */) CL_API_SUFFIX__VERSION_1_
* check to make sure the address is not NULL, before using or
* calling the returned function address.
*/
extern CL_API_ENTRY void * CL_API_CALL clGetExtensionFunctionAddress(const char * /* func_name */) CL_API_SUFFIX__VERSION_1_0;
extern CL_API_ENTRY void * CL_API_CALL
clGetExtensionFunctionAddressForPlatform(cl_platform_id /* platform */,
const char * /* func_name */) CL_API_SUFFIX__VERSION_1_2;
/* Deprecated OpenCL 1.1 APIs */
extern CL_API_ENTRY CL_EXT_PREFIX__VERSION_1_1_DEPRECATED cl_mem CL_API_CALL
clCreateImage2D(cl_context /* context */,
cl_mem_flags /* flags */,
const cl_image_format * /* image_format */,
size_t /* image_width */,
size_t /* image_height */,
size_t /* image_row_pitch */,
void * /* host_ptr */,
cl_int * /* errcode_ret */) CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED;
extern CL_API_ENTRY CL_EXT_PREFIX__VERSION_1_1_DEPRECATED cl_mem CL_API_CALL
clCreateImage3D(cl_context /* context */,
cl_mem_flags /* flags */,
const cl_image_format * /* image_format */,
size_t /* image_width */,
size_t /* image_height */,
size_t /* image_depth */,
size_t /* image_row_pitch */,
size_t /* image_slice_pitch */,
void * /* host_ptr */,
cl_int * /* errcode_ret */) CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED;
extern CL_API_ENTRY CL_EXT_PREFIX__VERSION_1_1_DEPRECATED cl_int CL_API_CALL
clEnqueueMarker(cl_command_queue /* command_queue */,
cl_event * /* event */) CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED;
extern CL_API_ENTRY CL_EXT_PREFIX__VERSION_1_1_DEPRECATED cl_int CL_API_CALL
clEnqueueWaitForEvents(cl_command_queue /* command_queue */,
cl_uint /* num_events */,
const cl_event * /* event_list */) CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED;
extern CL_API_ENTRY CL_EXT_PREFIX__VERSION_1_1_DEPRECATED cl_int CL_API_CALL
clEnqueueBarrier(cl_command_queue /* command_queue */) CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED;
extern CL_API_ENTRY CL_EXT_PREFIX__VERSION_1_1_DEPRECATED cl_int CL_API_CALL
clUnloadCompiler(void) CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED;
extern CL_API_ENTRY CL_EXT_PREFIX__VERSION_1_1_DEPRECATED void * CL_API_CALL
clGetExtensionFunctionAddress(const char * /* func_name */) CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED;
#ifdef __cplusplus
}

126
include/CL/cl_d3d10.h Normal file
View File

@@ -0,0 +1,126 @@
/**********************************************************************************
* Copyright (c) 2008-2012 The Khronos Group Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and/or associated documentation files (the
* "Materials"), to deal in the Materials without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Materials, and to
* permit persons to whom the Materials are furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Materials.
*
* THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
**********************************************************************************/
/* $Revision: 11708 $ on $Date: 2010-06-13 23:36:24 -0700 (Sun, 13 Jun 2010) $ */
#ifndef __OPENCL_CL_D3D10_H
#define __OPENCL_CL_D3D10_H
#include <d3d10.h>
#include <CL/cl.h>
#include <CL/cl_platform.h>
#ifdef __cplusplus
extern "C" {
#endif
/******************************************************************************
* cl_khr_d3d10_sharing */
#define cl_khr_d3d10_sharing 1
typedef cl_uint cl_d3d10_device_source_khr;
typedef cl_uint cl_d3d10_device_set_khr;
/******************************************************************************/
/* Error Codes */
#define CL_INVALID_D3D10_DEVICE_KHR -1002
#define CL_INVALID_D3D10_RESOURCE_KHR -1003
#define CL_D3D10_RESOURCE_ALREADY_ACQUIRED_KHR -1004
#define CL_D3D10_RESOURCE_NOT_ACQUIRED_KHR -1005
/* cl_d3d10_device_source_nv */
#define CL_D3D10_DEVICE_KHR 0x4010
#define CL_D3D10_DXGI_ADAPTER_KHR 0x4011
/* cl_d3d10_device_set_nv */
#define CL_PREFERRED_DEVICES_FOR_D3D10_KHR 0x4012
#define CL_ALL_DEVICES_FOR_D3D10_KHR 0x4013
/* cl_context_info */
#define CL_CONTEXT_D3D10_DEVICE_KHR 0x4014
#define CL_CONTEXT_D3D10_PREFER_SHARED_RESOURCES_KHR 0x402C
/* cl_mem_info */
#define CL_MEM_D3D10_RESOURCE_KHR 0x4015
/* cl_image_info */
#define CL_IMAGE_D3D10_SUBRESOURCE_KHR 0x4016
/* cl_command_type */
#define CL_COMMAND_ACQUIRE_D3D10_OBJECTS_KHR 0x4017
#define CL_COMMAND_RELEASE_D3D10_OBJECTS_KHR 0x4018
/******************************************************************************/
typedef CL_API_ENTRY cl_int (CL_API_CALL *clGetDeviceIDsFromD3D10KHR_fn)(
cl_platform_id platform,
cl_d3d10_device_source_khr d3d_device_source,
void * d3d_object,
cl_d3d10_device_set_khr d3d_device_set,
cl_uint num_entries,
cl_device_id * devices,
cl_uint * num_devices) CL_API_SUFFIX__VERSION_1_0;
typedef CL_API_ENTRY cl_mem (CL_API_CALL *clCreateFromD3D10BufferKHR_fn)(
cl_context context,
cl_mem_flags flags,
ID3D10Buffer * resource,
cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_0;
typedef CL_API_ENTRY cl_mem (CL_API_CALL *clCreateFromD3D10Texture2DKHR_fn)(
cl_context context,
cl_mem_flags flags,
ID3D10Texture2D * resource,
UINT subresource,
cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_0;
typedef CL_API_ENTRY cl_mem (CL_API_CALL *clCreateFromD3D10Texture3DKHR_fn)(
cl_context context,
cl_mem_flags flags,
ID3D10Texture3D * resource,
UINT subresource,
cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_0;
typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueAcquireD3D10ObjectsKHR_fn)(
cl_command_queue command_queue,
cl_uint num_objects,
const cl_mem * mem_objects,
cl_uint num_events_in_wait_list,
const cl_event * event_wait_list,
cl_event * event) CL_API_SUFFIX__VERSION_1_0;
typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueReleaseD3D10ObjectsKHR_fn)(
cl_command_queue command_queue,
cl_uint num_objects,
const cl_mem * mem_objects,
cl_uint num_events_in_wait_list,
const cl_event * event_wait_list,
cl_event * event) CL_API_SUFFIX__VERSION_1_0;
#ifdef __cplusplus
}
#endif
#endif /* __OPENCL_CL_D3D10_H */

126
include/CL/cl_d3d11.h Normal file
View File

@@ -0,0 +1,126 @@
/**********************************************************************************
* Copyright (c) 2008-2012 The Khronos Group Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and/or associated documentation files (the
* "Materials"), to deal in the Materials without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Materials, and to
* permit persons to whom the Materials are furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Materials.
*
* THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
**********************************************************************************/
/* $Revision: 11708 $ on $Date: 2010-06-13 23:36:24 -0700 (Sun, 13 Jun 2010) $ */
#ifndef __OPENCL_CL_D3D11_H
#define __OPENCL_CL_D3D11_H
#include <d3d11.h>
#include <CL/cl.h>
#include <CL/cl_platform.h>
#ifdef __cplusplus
extern "C" {
#endif
/******************************************************************************
* cl_khr_d3d11_sharing */
#define cl_khr_d3d11_sharing 1
typedef cl_uint cl_d3d11_device_source_khr;
typedef cl_uint cl_d3d11_device_set_khr;
/******************************************************************************/
/* Error Codes */
#define CL_INVALID_D3D11_DEVICE_KHR -1006
#define CL_INVALID_D3D11_RESOURCE_KHR -1007
#define CL_D3D11_RESOURCE_ALREADY_ACQUIRED_KHR -1008
#define CL_D3D11_RESOURCE_NOT_ACQUIRED_KHR -1009
/* cl_d3d11_device_source */
#define CL_D3D11_DEVICE_KHR 0x4019
#define CL_D3D11_DXGI_ADAPTER_KHR 0x401A
/* cl_d3d11_device_set */
#define CL_PREFERRED_DEVICES_FOR_D3D11_KHR 0x401B
#define CL_ALL_DEVICES_FOR_D3D11_KHR 0x401C
/* cl_context_info */
#define CL_CONTEXT_D3D11_DEVICE_KHR 0x401D
#define CL_CONTEXT_D3D11_PREFER_SHARED_RESOURCES_KHR 0x402D
/* cl_mem_info */
#define CL_MEM_D3D11_RESOURCE_KHR 0x401E
/* cl_image_info */
#define CL_IMAGE_D3D11_SUBRESOURCE_KHR 0x401F
/* cl_command_type */
#define CL_COMMAND_ACQUIRE_D3D11_OBJECTS_KHR 0x4020
#define CL_COMMAND_RELEASE_D3D11_OBJECTS_KHR 0x4021
/******************************************************************************/
typedef CL_API_ENTRY cl_int (CL_API_CALL *clGetDeviceIDsFromD3D11KHR_fn)(
cl_platform_id platform,
cl_d3d11_device_source_khr d3d_device_source,
void * d3d_object,
cl_d3d11_device_set_khr d3d_device_set,
cl_uint num_entries,
cl_device_id * devices,
cl_uint * num_devices) CL_API_SUFFIX__VERSION_1_2;
typedef CL_API_ENTRY cl_mem (CL_API_CALL *clCreateFromD3D11BufferKHR_fn)(
cl_context context,
cl_mem_flags flags,
ID3D11Buffer * resource,
cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_2;
typedef CL_API_ENTRY cl_mem (CL_API_CALL *clCreateFromD3D11Texture2DKHR_fn)(
cl_context context,
cl_mem_flags flags,
ID3D11Texture2D * resource,
UINT subresource,
cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_2;
typedef CL_API_ENTRY cl_mem (CL_API_CALL *clCreateFromD3D11Texture3DKHR_fn)(
cl_context context,
cl_mem_flags flags,
ID3D11Texture3D * resource,
UINT subresource,
cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_2;
typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueAcquireD3D11ObjectsKHR_fn)(
cl_command_queue command_queue,
cl_uint num_objects,
const cl_mem * mem_objects,
cl_uint num_events_in_wait_list,
const cl_event * event_wait_list,
cl_event * event) CL_API_SUFFIX__VERSION_1_2;
typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueReleaseD3D11ObjectsKHR_fn)(
cl_command_queue command_queue,
cl_uint num_objects,
const cl_mem * mem_objects,
cl_uint num_events_in_wait_list,
const cl_event * event_wait_list,
cl_event * event) CL_API_SUFFIX__VERSION_1_2;
#ifdef __cplusplus
}
#endif
#endif /* __OPENCL_CL_D3D11_H */

View File

@@ -0,0 +1,127 @@
/**********************************************************************************
* Copyright (c) 2008-2012 The Khronos Group Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and/or associated documentation files (the
* "Materials"), to deal in the Materials without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Materials, and to
* permit persons to whom the Materials are furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Materials.
*
* THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
**********************************************************************************/
/* $Revision: 11708 $ on $Date: 2010-06-13 23:36:24 -0700 (Sun, 13 Jun 2010) $ */
#ifndef __OPENCL_CL_DX9_MEDIA_SHARING_H
#define __OPENCL_CL_DX9_MEDIA_SHARING_H
#include <CL/cl.h>
#include <CL/cl_platform.h>
#ifdef __cplusplus
extern "C" {
#endif
/******************************************************************************
/* cl_khr_dx9_media_sharing */
#define cl_khr_dx9_media_sharing 1
typedef cl_uint cl_dx9_media_adapter_type_khr;
typedef cl_uint cl_dx9_media_adapter_set_khr;
#if defined(_WIN32)
#include <d3d9.h>
typedef struct _cl_dx9_surface_info_khr
{
IDirect3DSurface9 *resource;
HANDLE shared_handle;
} cl_dx9_surface_info_khr;
#endif
/******************************************************************************/
/* Error Codes */
#define CL_INVALID_DX9_MEDIA_ADAPTER_KHR -1010
#define CL_INVALID_DX9_MEDIA_SURFACE_KHR -1011
#define CL_DX9_MEDIA_SURFACE_ALREADY_ACQUIRED_KHR -1012
#define CL_DX9_MEDIA_SURFACE_NOT_ACQUIRED_KHR -1013
/* cl_media_adapter_type_khr */
#define CL_ADAPTER_D3D9_KHR 0x2020
#define CL_ADAPTER_D3D9EX_KHR 0x2021
#define CL_ADAPTER_DXVA_KHR 0x2022
/* cl_media_adapter_set_khr */
#define CL_PREFERRED_DEVICES_FOR_DX9_MEDIA_ADAPTER_KHR 0x2023
#define CL_ALL_DEVICES_FOR_DX9_MEDIA_ADAPTER_KHR 0x2024
/* cl_context_info */
#define CL_CONTEXT_ADAPTER_D3D9_KHR 0x2025
#define CL_CONTEXT_ADAPTER_D3D9EX_KHR 0x2026
#define CL_CONTEXT_ADAPTER_DXVA_KHR 0x2027
/* cl_mem_info */
#define CL_MEM_DX9_MEDIA_ADAPTER_TYPE_KHR 0x2028
#define CL_MEM_DX9_MEDIA_SURFACE_INFO_KHR 0x2029
/* cl_image_info */
#define CL_IMAGE_DX9_MEDIA_PLANE_KHR 0x202A
/* cl_command_type */
#define CL_COMMAND_ACQUIRE_DX9_MEDIA_SURFACES_KHR 0x202B
#define CL_COMMAND_RELEASE_DX9_MEDIA_SURFACES_KHR 0x202C
/******************************************************************************/
typedef CL_API_ENTRY cl_int (CL_API_CALL *clGetDeviceIDsFromDX9MediaAdapterKHR_fn)(
cl_platform_id platform,
cl_uint num_media_adapters,
cl_dx9_media_adapter_type_khr * media_adapter_type,
void * media_adapters,
cl_dx9_media_adapter_set_khr media_adapter_set,
cl_uint num_entries,
cl_device_id * devices,
cl_uint * num_devices) CL_API_SUFFIX__VERSION_1_2;
typedef CL_API_ENTRY cl_mem (CL_API_CALL *clCreateFromDX9MediaSurfaceKHR_fn)(
cl_context context,
cl_mem_flags flags,
cl_dx9_media_adapter_type_khr adapter_type,
void * surface_info,
cl_uint plane,
cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_2;
typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueAcquireDX9MediaSurfacesKHR_fn)(
cl_command_queue command_queue,
cl_uint num_objects,
const cl_mem * mem_objects,
cl_uint num_events_in_wait_list,
const cl_event * event_wait_list,
cl_event * event) CL_API_SUFFIX__VERSION_1_2;
typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueReleaseDX9MediaSurfacesKHR_fn)(
cl_command_queue command_queue,
cl_uint num_objects,
const cl_mem * mem_objects,
cl_uint num_events_in_wait_list,
const cl_event * event_wait_list,
cl_event * event) CL_API_SUFFIX__VERSION_1_2;
#ifdef __cplusplus
}
#endif
#endif /* __OPENCL_CL_DX9_MEDIA_SHARING_H */

133
include/CL/cl_egl.h Normal file
View File

@@ -0,0 +1,133 @@
/*******************************************************************************
* Copyright (c) 2008-2010 The Khronos Group Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and/or associated documentation files (the
* "Materials"), to deal in the Materials without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Materials, and to
* permit persons to whom the Materials are furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Materials.
*
* THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
******************************************************************************/
#ifndef __OPENCL_CL_EGL_H
#define __OPENCL_CL_EGL_H
#ifdef __APPLE__
#else
#include <CL/cl.h>
#include <EGL/egl.h>
#include <EGL/eglext.h>
#endif
#ifdef __cplusplus
extern "C" {
#endif
/* Command type for events created with clEnqueueAcquireEGLObjectsKHR */
#define CL_COMMAND_EGL_FENCE_SYNC_OBJECT_KHR 0x202F
#define CL_COMMAND_ACQUIRE_EGL_OBJECTS_KHR 0x202D
#define CL_COMMAND_RELEASE_EGL_OBJECTS_KHR 0x202E
/* Error type for clCreateFromEGLImageKHR */
#define CL_INVALID_EGL_OBJECT_KHR -1093
#define CL_EGL_RESOURCE_NOT_ACQUIRED_KHR -1092
/* CLeglImageKHR is an opaque handle to an EGLImage */
typedef void* CLeglImageKHR;
/* CLeglDisplayKHR is an opaque handle to an EGLDisplay */
typedef void* CLeglDisplayKHR;
/* CLeglSyncKHR is an opaque handle to an EGLSync object */
typedef void* CLeglSyncKHR;
/* properties passed to clCreateFromEGLImageKHR */
typedef intptr_t cl_egl_image_properties_khr;
#define cl_khr_egl_image 1
extern CL_API_ENTRY cl_mem CL_API_CALL
clCreateFromEGLImageKHR(cl_context /* context */,
CLeglDisplayKHR /* egldisplay */,
CLeglImageKHR /* eglimage */,
cl_mem_flags /* flags */,
const cl_egl_image_properties_khr * /* properties */,
cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
typedef CL_API_ENTRY cl_mem (CL_API_CALL *clCreateFromEGLImageKHR_fn)(
cl_context context,
CLeglDisplayKHR egldisplay,
CLeglImageKHR eglimage,
cl_mem_flags flags,
const cl_egl_image_properties_khr * properties,
cl_int * errcode_ret);
extern CL_API_ENTRY cl_int CL_API_CALL
clEnqueueAcquireEGLObjectsKHR(cl_command_queue /* command_queue */,
cl_uint /* num_objects */,
const cl_mem * /* mem_objects */,
cl_uint /* num_events_in_wait_list */,
const cl_event * /* event_wait_list */,
cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0;
typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueAcquireEGLObjectsKHR_fn)(
cl_command_queue command_queue,
cl_uint num_objects,
const cl_mem * mem_objects,
cl_uint num_events_in_wait_list,
const cl_event * event_wait_list,
cl_event * event);
extern CL_API_ENTRY cl_int CL_API_CALL
clEnqueueReleaseEGLObjectsKHR(cl_command_queue /* command_queue */,
cl_uint /* num_objects */,
const cl_mem * /* mem_objects */,
cl_uint /* num_events_in_wait_list */,
const cl_event * /* event_wait_list */,
cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0;
typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueReleaseEGLObjectsKHR_fn)(
cl_command_queue command_queue,
cl_uint num_objects,
const cl_mem * mem_objects,
cl_uint num_events_in_wait_list,
const cl_event * event_wait_list,
cl_event * event);
#define cl_khr_egl_event 1
extern CL_API_ENTRY cl_event CL_API_CALL
clCreateEventFromEGLSyncKHR(cl_context /* context */,
CLeglSyncKHR /* sync */,
CLeglDisplayKHR /* display */,
cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
typedef CL_API_ENTRY cl_event (CL_API_CALL *clCreateEventFromEGLSyncKHR_fn)(
cl_context context,
CLeglSyncKHR sync,
CLeglDisplayKHR display,
cl_int * errcode_ret);
#ifdef __cplusplus
}
#endif
#endif /* __OPENCL_CL_EGL_H */

View File

@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2008-2010 The Khronos Group Inc.
* Copyright (c) 2008-2013 The Khronos Group Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and/or associated documentation files (the
@@ -34,15 +34,12 @@ extern "C" {
#endif
#ifdef __APPLE__
#include <OpenCL/cl.h>
#include <OpenCL/cl.h>
#include <AvailabilityMacros.h>
#else
#include <CL/cl.h>
#include <CL/cl.h>
#endif
/* cl_khr_fp64 extension - no extension #define since it has no functions */
#define CL_DEVICE_DOUBLE_FP_CONFIG 0x1032
/* cl_khr_fp16 extension - no extension #define since it has no functions */
#define CL_DEVICE_HALF_FP_CONFIG 0x1033
@@ -64,7 +61,7 @@ extern "C" {
* before using.
*/
#define cl_APPLE_SetMemObjectDestructor 1
cl_int CL_API_ENTRY clSetMemObjectDestructorAPPLE( cl_mem /* memobj */,
cl_int CL_API_ENTRY clSetMemObjectDestructorAPPLE( cl_mem /* memobj */,
void (* /*pfn_notify*/)( cl_mem /* memobj */, void* /*user_data*/),
void * /*user_data */ ) CL_EXT_SUFFIX__VERSION_1_0;
@@ -118,6 +115,52 @@ typedef CL_API_ENTRY cl_int (CL_API_CALL *clIcdGetPlatformIDsKHR_fn)(
cl_uint * /* num_platforms */);
/* Extension: cl_khr_image2D_buffer
*
* This extension allows a 2D image to be created from a cl_mem buffer without a copy.
* The type associated with a 2D image created from a buffer in an OpenCL program is image2d_t.
* Both the sampler and sampler-less read_image built-in functions are supported for 2D images
* and 2D images created from a buffer. Similarly, the write_image built-ins are also supported
* for 2D images created from a buffer.
*
* When the 2D image from buffer is created, the client must specify the width,
* height, image format (i.e. channel order and channel data type) and optionally the row pitch
*
* The pitch specified must be a multiple of CL_DEVICE_IMAGE_PITCH_ALIGNMENT pixels.
* The base address of the buffer must be aligned to CL_DEVICE_IMAGE_BASE_ADDRESS_ALIGNMENT pixels.
*/
/*************************************
* cl_khr_initalize_memory extension *
*************************************/
#define CL_CONTEXT_MEMORY_INITIALIZE_KHR 0x200E
/**************************************
* cl_khr_terminate_context extension *
**************************************/
#define CL_DEVICE_TERMINATE_CAPABILITY_KHR 0x200F
#define CL_CONTEXT_TERMINATE_KHR 0x2010
#define cl_khr_terminate_context 1
extern CL_API_ENTRY cl_int CL_API_CALL clTerminateContextKHR(cl_context /* context */) CL_EXT_SUFFIX__VERSION_1_2;
typedef CL_API_ENTRY cl_int (CL_API_CALL *clTerminateContextKHR_fn)(cl_context /* context */) CL_EXT_SUFFIX__VERSION_1_2;
/*
* Extension: cl_khr_spir
*
* This extension adds support to create an OpenCL program object from a
* Standard Portable Intermediate Representation (SPIR) instance
*/
#define CL_DEVICE_SPIR_VERSIONS 0x40E0
#define CL_PROGRAM_BINARY_TYPE_INTERMEDIATE 0x40E1
/******************************************
* cl_nv_device_attribute_query extension *
******************************************/
@@ -130,12 +173,16 @@ typedef CL_API_ENTRY cl_int (CL_API_CALL *clIcdGetPlatformIDsKHR_fn)(
#define CL_DEVICE_KERNEL_EXEC_TIMEOUT_NV 0x4005
#define CL_DEVICE_INTEGRATED_MEMORY_NV 0x4006
/*********************************
* cl_amd_device_attribute_query *
*********************************/
#define CL_DEVICE_PROFILING_TIMER_OFFSET_AMD 0x4036
/*********************************
* cl_arm_printf extension
*********************************/
#define CL_PRINTF_CALLBACK_ARM 0x40B0
#define CL_PRINTF_BUFFERSIZE_ARM 0x40B1
#ifdef CL_VERSION_1_1
/***********************************
@@ -201,7 +248,63 @@ typedef CL_API_ENTRY cl_int (CL_API_CALL *clIcdGetPlatformIDsKHR_fn)(
#define CL_PARTITION_BY_COUNTS_LIST_END_EXT ((cl_device_partition_property_ext) 0)
#define CL_PARTITION_BY_NAMES_LIST_END_EXT ((cl_device_partition_property_ext) 0 - 1)
/*********************************
* cl_qcom_ext_host_ptr extension
*********************************/
#define CL_MEM_EXT_HOST_PTR_QCOM (1 << 29)
#define CL_DEVICE_EXT_MEM_PADDING_IN_BYTES_QCOM 0x40A0
#define CL_DEVICE_PAGE_SIZE_QCOM 0x40A1
#define CL_IMAGE_ROW_ALIGNMENT_QCOM 0x40A2
#define CL_IMAGE_SLICE_ALIGNMENT_QCOM 0x40A3
#define CL_MEM_HOST_UNCACHED_QCOM 0x40A4
#define CL_MEM_HOST_WRITEBACK_QCOM 0x40A5
#define CL_MEM_HOST_WRITETHROUGH_QCOM 0x40A6
#define CL_MEM_HOST_WRITE_COMBINING_QCOM 0x40A7
typedef cl_uint cl_image_pitch_info_qcom;
extern CL_API_ENTRY cl_int CL_API_CALL
clGetDeviceImageInfoQCOM(cl_device_id device,
size_t image_width,
size_t image_height,
const cl_image_format *image_format,
cl_image_pitch_info_qcom param_name,
size_t param_value_size,
void *param_value,
size_t *param_value_size_ret);
typedef struct _cl_mem_ext_host_ptr
{
/* Type of external memory allocation. */
/* Legal values will be defined in layered extensions. */
cl_uint allocation_type;
/* Host cache policy for this external memory allocation. */
cl_uint host_cache_policy;
} cl_mem_ext_host_ptr;
/*********************************
* cl_qcom_ion_host_ptr extension
*********************************/
#define CL_MEM_ION_HOST_PTR_QCOM 0x40A8
typedef struct _cl_mem_ion_host_ptr
{
/* Type of external memory allocation. */
/* Must be CL_MEM_ION_HOST_PTR_QCOM for ION allocations. */
cl_mem_ext_host_ptr ext_host_ptr;
/* ION file descriptor */
int ion_filedesc;
/* Host pointer to the ION allocated memory */
void* ion_hostptr;
} cl_mem_ion_host_ptr;
#endif /* CL_VERSION_1_1 */

View File

@@ -1,5 +1,5 @@
/**********************************************************************************
* Copyright (c) 2008-2010 The Khronos Group Inc.
* Copyright (c) 2008 - 2012 The Khronos Group Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and/or associated documentation files (the
@@ -21,20 +21,11 @@
* MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
**********************************************************************************/
/* $Revision: 11708 $ on $Date: 2010-06-13 23:36:24 -0700 (Sun, 13 Jun 2010) $ */
/*
* cl_gl.h contains Khronos-approved (KHR) OpenCL extensions which have
* OpenGL dependencies. The application is responsible for #including
* OpenGL or OpenGL ES headers before #including cl_gl.h.
*/
#ifndef __OPENCL_CL_GL_H
#define __OPENCL_CL_GL_H
#ifdef __APPLE__
#include <OpenCL/cl.h>
#include <OpenGL/CGLDevice.h>
#else
#include <CL/cl.h>
#endif
@@ -48,15 +39,21 @@ typedef cl_uint cl_gl_texture_info;
typedef cl_uint cl_gl_platform_info;
typedef struct __GLsync *cl_GLsync;
/* cl_gl_object_type */
#define CL_GL_OBJECT_BUFFER 0x2000
#define CL_GL_OBJECT_TEXTURE2D 0x2001
#define CL_GL_OBJECT_TEXTURE3D 0x2002
#define CL_GL_OBJECT_RENDERBUFFER 0x2003
/* cl_gl_object_type = 0x2000 - 0x200F enum values are currently taken */
#define CL_GL_OBJECT_BUFFER 0x2000
#define CL_GL_OBJECT_TEXTURE2D 0x2001
#define CL_GL_OBJECT_TEXTURE3D 0x2002
#define CL_GL_OBJECT_RENDERBUFFER 0x2003
#define CL_GL_OBJECT_TEXTURE2D_ARRAY 0x200E
#define CL_GL_OBJECT_TEXTURE1D 0x200F
#define CL_GL_OBJECT_TEXTURE1D_ARRAY 0x2010
#define CL_GL_OBJECT_TEXTURE_BUFFER 0x2011
/* cl_gl_texture_info */
#define CL_GL_TEXTURE_TARGET 0x2004
#define CL_GL_MIPMAP_LEVEL 0x2005
#define CL_GL_NUM_SAMPLES 0x2012
/* cl_gl_texture_info */
#define CL_GL_TEXTURE_TARGET 0x2004
#define CL_GL_MIPMAP_LEVEL 0x2005
extern CL_API_ENTRY cl_mem CL_API_CALL
clCreateFromGLBuffer(cl_context /* context */,
@@ -65,21 +62,13 @@ clCreateFromGLBuffer(cl_context /* context */,
int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
extern CL_API_ENTRY cl_mem CL_API_CALL
clCreateFromGLTexture2D(cl_context /* context */,
cl_mem_flags /* flags */,
cl_GLenum /* target */,
cl_GLint /* miplevel */,
cl_GLuint /* texture */,
cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
extern CL_API_ENTRY cl_mem CL_API_CALL
clCreateFromGLTexture3D(cl_context /* context */,
cl_mem_flags /* flags */,
cl_GLenum /* target */,
cl_GLint /* miplevel */,
cl_GLuint /* texture */,
cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
clCreateFromGLTexture(cl_context /* context */,
cl_mem_flags /* flags */,
cl_GLenum /* target */,
cl_GLint /* miplevel */,
cl_GLuint /* texture */,
cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_2;
extern CL_API_ENTRY cl_mem CL_API_CALL
clCreateFromGLRenderbuffer(cl_context /* context */,
cl_mem_flags /* flags */,
@@ -89,7 +78,7 @@ clCreateFromGLRenderbuffer(cl_context /* context */,
extern CL_API_ENTRY cl_int CL_API_CALL
clGetGLObjectInfo(cl_mem /* memobj */,
cl_gl_object_type * /* gl_object_type */,
cl_GLuint * /* gl_object_name */) CL_API_SUFFIX__VERSION_1_0;
cl_GLuint * /* gl_object_name */) CL_API_SUFFIX__VERSION_1_0;
extern CL_API_ENTRY cl_int CL_API_CALL
clGetGLTextureInfo(cl_mem /* memobj */,
@@ -114,33 +103,51 @@ clEnqueueReleaseGLObjects(cl_command_queue /* command_queue */,
const cl_event * /* event_wait_list */,
cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0;
/* Deprecated OpenCL 1.1 APIs */
extern CL_API_ENTRY CL_EXT_PREFIX__VERSION_1_1_DEPRECATED cl_mem CL_API_CALL
clCreateFromGLTexture2D(cl_context /* context */,
cl_mem_flags /* flags */,
cl_GLenum /* target */,
cl_GLint /* miplevel */,
cl_GLuint /* texture */,
cl_int * /* errcode_ret */) CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED;
extern CL_API_ENTRY CL_EXT_PREFIX__VERSION_1_1_DEPRECATED cl_mem CL_API_CALL
clCreateFromGLTexture3D(cl_context /* context */,
cl_mem_flags /* flags */,
cl_GLenum /* target */,
cl_GLint /* miplevel */,
cl_GLuint /* texture */,
cl_int * /* errcode_ret */) CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED;
/* cl_khr_gl_sharing extension */
#define cl_khr_gl_sharing 1
typedef cl_uint cl_gl_context_info;
/* Additional Error Codes */
#define CL_INVALID_GL_SHAREGROUP_REFERENCE_KHR -1000
/* cl_gl_context_info */
#define CL_CURRENT_DEVICE_FOR_GL_CONTEXT_KHR 0x2006
#define CL_DEVICES_FOR_GL_CONTEXT_KHR 0x2007
/* Additional cl_context_properties */
#define CL_GL_CONTEXT_KHR 0x2008
#define CL_EGL_DISPLAY_KHR 0x2009
#define CL_GLX_DISPLAY_KHR 0x200A
#define CL_WGL_HDC_KHR 0x200B
#define CL_CGL_SHAREGROUP_KHR 0x200C
extern CL_API_ENTRY cl_int CL_API_CALL
clGetGLContextInfoKHR(const cl_context_properties * /* properties */,
cl_gl_context_info /* param_name */,
size_t /* param_value_size */,
void * /* param_value */,
size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0;
typedef CL_API_ENTRY cl_int (CL_API_CALL *clGetGLContextInfoKHR_fn)(
const cl_context_properties * properties,
cl_gl_context_info param_name,
@@ -152,4 +159,4 @@ typedef CL_API_ENTRY cl_int (CL_API_CALL *clGetGLContextInfoKHR_fn)(
}
#endif
#endif /* __OPENCL_CL_GL_H */
#endif /* __OPENCL_CL_GL_H */

View File

@@ -1,5 +1,5 @@
/**********************************************************************************
* Copyright (c) 2008-2010 The Khronos Group Inc.
* Copyright (c) 2008-2012 The Khronos Group Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and/or associated documentation files (the
@@ -41,7 +41,7 @@ extern "C" {
/*
* For each extension, follow this template
* /* cl_VEN_extname extension */
* cl_VEN_extname extension */
/* #define cl_VEN_extname 1
* ... define new types, if any
* ... define new tokens, if any

View File

@@ -1,5 +1,5 @@
/**********************************************************************************
* Copyright (c) 2008-2010 The Khronos Group Inc.
* Copyright (c) 2008-2012 The Khronos Group Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and/or associated documentation files (the
@@ -46,19 +46,75 @@ extern "C" {
#endif
#ifdef __APPLE__
#define CL_EXTENSION_WEAK_LINK __attribute__((weak_import))
#define CL_API_SUFFIX__VERSION_1_0 AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER
#define CL_EXT_SUFFIX__VERSION_1_0 CL_EXTENSION_WEAK_LINK AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER
#define CL_API_SUFFIX__VERSION_1_1 CL_EXTENSION_WEAK_LINK
#define CL_EXT_SUFFIX__VERSION_1_1 CL_EXTENSION_WEAK_LINK
#define CL_EXT_SUFFIX__VERSION_1_0_DEPRECATED CL_EXTENSION_WEAK_LINK AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER
#define CL_EXTENSION_WEAK_LINK __attribute__((weak_import))
#define CL_API_SUFFIX__VERSION_1_0 AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER
#define CL_EXT_SUFFIX__VERSION_1_0 CL_EXTENSION_WEAK_LINK AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER
#define CL_API_SUFFIX__VERSION_1_1 AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER
#define GCL_API_SUFFIX__VERSION_1_1 AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER
#define CL_EXT_SUFFIX__VERSION_1_1 CL_EXTENSION_WEAK_LINK AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER
#define CL_EXT_SUFFIX__VERSION_1_0_DEPRECATED CL_EXTENSION_WEAK_LINK AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_7
#ifdef AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER
#define CL_API_SUFFIX__VERSION_1_2 AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER
#define GCL_API_SUFFIX__VERSION_1_2 AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER
#define CL_EXT_SUFFIX__VERSION_1_2 CL_EXTENSION_WEAK_LINK AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER
#define CL_EXT_PREFIX__VERSION_1_1_DEPRECATED
#define CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED CL_EXTENSION_WEAK_LINK AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_8
#else
#warning This path should never happen outside of internal operating system development. AvailabilityMacros do not function correctly here!
#define CL_API_SUFFIX__VERSION_1_2 AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER
#define GCL_API_SUFFIX__VERSION_1_2 AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER
#define CL_EXT_SUFFIX__VERSION_1_2 CL_EXTENSION_WEAK_LINK AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER
#define CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED CL_EXTENSION_WEAK_LINK AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER
#endif
#else
#define CL_EXTENSION_WEAK_LINK
#define CL_EXTENSION_WEAK_LINK
#define CL_API_SUFFIX__VERSION_1_0
#define CL_EXT_SUFFIX__VERSION_1_0
#define CL_API_SUFFIX__VERSION_1_1
#define CL_EXT_SUFFIX__VERSION_1_1
#define CL_EXT_SUFFIX__VERSION_1_0_DEPRECATED
#define CL_API_SUFFIX__VERSION_1_2
#define CL_EXT_SUFFIX__VERSION_1_2
#ifdef __GNUC__
#ifdef CL_USE_DEPRECATED_OPENCL_1_0_APIS
#define CL_EXT_SUFFIX__VERSION_1_0_DEPRECATED
#define CL_EXT_PREFIX__VERSION_1_0_DEPRECATED
#else
#define CL_EXT_SUFFIX__VERSION_1_0_DEPRECATED __attribute__((deprecated))
#define CL_EXT_PREFIX__VERSION_1_0_DEPRECATED
#endif
#ifdef CL_USE_DEPRECATED_OPENCL_1_1_APIS
#define CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED
#define CL_EXT_PREFIX__VERSION_1_1_DEPRECATED
#else
#define CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED __attribute__((deprecated))
#define CL_EXT_PREFIX__VERSION_1_1_DEPRECATED
#endif
#elif _WIN32
#ifdef CL_USE_DEPRECATED_OPENCL_1_0_APIS
#define CL_EXT_SUFFIX__VERSION_1_0_DEPRECATED
#define CL_EXT_PREFIX__VERSION_1_0_DEPRECATED
#else
#define CL_EXT_SUFFIX__VERSION_1_0_DEPRECATED
#define CL_EXT_PREFIX__VERSION_1_0_DEPRECATED __declspec(deprecated)
#endif
#ifdef CL_USE_DEPRECATED_OPENCL_1_1_APIS
#define CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED
#define CL_EXT_PREFIX__VERSION_1_1_DEPRECATED
#else
#define CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED
#define CL_EXT_PREFIX__VERSION_1_1_DEPRECATED __declspec(deprecated)
#endif
#else
#define CL_EXT_SUFFIX__VERSION_1_0_DEPRECATED
#define CL_EXT_PREFIX__VERSION_1_0_DEPRECATED
#define CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED
#define CL_EXT_PREFIX__VERSION_1_1_DEPRECATED
#endif
#endif
#if (defined (_WIN32) && defined(_MSC_VER))
@@ -252,7 +308,7 @@ typedef double cl_double __attribute__((aligned(8)));
#include <stddef.h>
/* Mirror types to GL types. Mirror types allow us to avoid deciding which headers to load based on whether we are using GL or GLES here. */
/* Mirror types to GL types. Mirror types allow us to avoid deciding which 87s to load based on whether we are using GL or GLES here. */
typedef unsigned int cl_GLuint;
typedef int cl_GLint;
typedef unsigned int cl_GLenum;
@@ -395,6 +451,24 @@ typedef unsigned int cl_GLenum;
#define __CL_DOUBLE4__ 1
#endif
/* Define capabilities for anonymous struct members. */
#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
#define __CL_HAS_ANON_STRUCT__ 1
#define __CL_ANON_STRUCT__ __extension__
#elif defined( _WIN32) && (_MSC_VER >= 1500)
/* Microsoft Developer Studio 2008 supports anonymous structs, but
* complains by default. */
#define __CL_HAS_ANON_STRUCT__ 1
#define __CL_ANON_STRUCT__
/* Disable warning C4201: nonstandard extension used : nameless
* struct/union */
#pragma warning( push )
#pragma warning( disable : 4201 )
#else
#define __CL_HAS_ANON_STRUCT__ 0
#define __CL_ANON_STRUCT__
#endif
/* Define alignment keys */
#if defined( __GNUC__ )
#define CL_ALIGNED(_x) __attribute__ ((aligned(_x)))
@@ -410,7 +484,7 @@ typedef unsigned int cl_GLenum;
#endif
/* Indicate whether .xyzw, .s0123 and .hi.lo are supported */
#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
#if __CL_HAS_ANON_STRUCT__
/* .xyzw and .s0123...{f|F} are supported */
#define CL_HAS_NAMED_VECTOR_FIELDS 1
/* .hi and .lo are supported */
@@ -423,10 +497,10 @@ typedef unsigned int cl_GLenum;
typedef union
{
cl_char CL_ALIGNED(2) s[2];
#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
__extension__ struct{ cl_char x, y; };
__extension__ struct{ cl_char s0, s1; };
__extension__ struct{ cl_char lo, hi; };
#if __CL_HAS_ANON_STRUCT__
__CL_ANON_STRUCT__ struct{ cl_char x, y; };
__CL_ANON_STRUCT__ struct{ cl_char s0, s1; };
__CL_ANON_STRUCT__ struct{ cl_char lo, hi; };
#endif
#if defined( __CL_CHAR2__)
__cl_char2 v2;
@@ -436,10 +510,10 @@ typedef union
typedef union
{
cl_char CL_ALIGNED(4) s[4];
#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
__extension__ struct{ cl_char x, y, z, w; };
__extension__ struct{ cl_char s0, s1, s2, s3; };
__extension__ struct{ cl_char2 lo, hi; };
#if __CL_HAS_ANON_STRUCT__
__CL_ANON_STRUCT__ struct{ cl_char x, y, z, w; };
__CL_ANON_STRUCT__ struct{ cl_char s0, s1, s2, s3; };
__CL_ANON_STRUCT__ struct{ cl_char2 lo, hi; };
#endif
#if defined( __CL_CHAR2__)
__cl_char2 v2[2];
@@ -455,10 +529,10 @@ typedef cl_char4 cl_char3;
typedef union
{
cl_char CL_ALIGNED(8) s[8];
#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
__extension__ struct{ cl_char x, y, z, w; };
__extension__ struct{ cl_char s0, s1, s2, s3, s4, s5, s6, s7; };
__extension__ struct{ cl_char4 lo, hi; };
#if __CL_HAS_ANON_STRUCT__
__CL_ANON_STRUCT__ struct{ cl_char x, y, z, w; };
__CL_ANON_STRUCT__ struct{ cl_char s0, s1, s2, s3, s4, s5, s6, s7; };
__CL_ANON_STRUCT__ struct{ cl_char4 lo, hi; };
#endif
#if defined( __CL_CHAR2__)
__cl_char2 v2[4];
@@ -474,10 +548,10 @@ typedef union
typedef union
{
cl_char CL_ALIGNED(16) s[16];
#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
__extension__ struct{ cl_char x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; };
__extension__ struct{ cl_char s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; };
__extension__ struct{ cl_char8 lo, hi; };
#if __CL_HAS_ANON_STRUCT__
__CL_ANON_STRUCT__ struct{ cl_char x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; };
__CL_ANON_STRUCT__ struct{ cl_char s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; };
__CL_ANON_STRUCT__ struct{ cl_char8 lo, hi; };
#endif
#if defined( __CL_CHAR2__)
__cl_char2 v2[8];
@@ -498,10 +572,10 @@ typedef union
typedef union
{
cl_uchar CL_ALIGNED(2) s[2];
#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
__extension__ struct{ cl_uchar x, y; };
__extension__ struct{ cl_uchar s0, s1; };
__extension__ struct{ cl_uchar lo, hi; };
#if __CL_HAS_ANON_STRUCT__
__CL_ANON_STRUCT__ struct{ cl_uchar x, y; };
__CL_ANON_STRUCT__ struct{ cl_uchar s0, s1; };
__CL_ANON_STRUCT__ struct{ cl_uchar lo, hi; };
#endif
#if defined( __cl_uchar2__)
__cl_uchar2 v2;
@@ -511,10 +585,10 @@ typedef union
typedef union
{
cl_uchar CL_ALIGNED(4) s[4];
#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
__extension__ struct{ cl_uchar x, y, z, w; };
__extension__ struct{ cl_uchar s0, s1, s2, s3; };
__extension__ struct{ cl_uchar2 lo, hi; };
#if __CL_HAS_ANON_STRUCT__
__CL_ANON_STRUCT__ struct{ cl_uchar x, y, z, w; };
__CL_ANON_STRUCT__ struct{ cl_uchar s0, s1, s2, s3; };
__CL_ANON_STRUCT__ struct{ cl_uchar2 lo, hi; };
#endif
#if defined( __CL_UCHAR2__)
__cl_uchar2 v2[2];
@@ -530,10 +604,10 @@ typedef cl_uchar4 cl_uchar3;
typedef union
{
cl_uchar CL_ALIGNED(8) s[8];
#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
__extension__ struct{ cl_uchar x, y, z, w; };
__extension__ struct{ cl_uchar s0, s1, s2, s3, s4, s5, s6, s7; };
__extension__ struct{ cl_uchar4 lo, hi; };
#if __CL_HAS_ANON_STRUCT__
__CL_ANON_STRUCT__ struct{ cl_uchar x, y, z, w; };
__CL_ANON_STRUCT__ struct{ cl_uchar s0, s1, s2, s3, s4, s5, s6, s7; };
__CL_ANON_STRUCT__ struct{ cl_uchar4 lo, hi; };
#endif
#if defined( __CL_UCHAR2__)
__cl_uchar2 v2[4];
@@ -549,10 +623,10 @@ typedef union
typedef union
{
cl_uchar CL_ALIGNED(16) s[16];
#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
__extension__ struct{ cl_uchar x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; };
__extension__ struct{ cl_uchar s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; };
__extension__ struct{ cl_uchar8 lo, hi; };
#if __CL_HAS_ANON_STRUCT__
__CL_ANON_STRUCT__ struct{ cl_uchar x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; };
__CL_ANON_STRUCT__ struct{ cl_uchar s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; };
__CL_ANON_STRUCT__ struct{ cl_uchar8 lo, hi; };
#endif
#if defined( __CL_UCHAR2__)
__cl_uchar2 v2[8];
@@ -573,10 +647,10 @@ typedef union
typedef union
{
cl_short CL_ALIGNED(4) s[2];
#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
__extension__ struct{ cl_short x, y; };
__extension__ struct{ cl_short s0, s1; };
__extension__ struct{ cl_short lo, hi; };
#if __CL_HAS_ANON_STRUCT__
__CL_ANON_STRUCT__ struct{ cl_short x, y; };
__CL_ANON_STRUCT__ struct{ cl_short s0, s1; };
__CL_ANON_STRUCT__ struct{ cl_short lo, hi; };
#endif
#if defined( __CL_SHORT2__)
__cl_short2 v2;
@@ -586,10 +660,10 @@ typedef union
typedef union
{
cl_short CL_ALIGNED(8) s[4];
#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
__extension__ struct{ cl_short x, y, z, w; };
__extension__ struct{ cl_short s0, s1, s2, s3; };
__extension__ struct{ cl_short2 lo, hi; };
#if __CL_HAS_ANON_STRUCT__
__CL_ANON_STRUCT__ struct{ cl_short x, y, z, w; };
__CL_ANON_STRUCT__ struct{ cl_short s0, s1, s2, s3; };
__CL_ANON_STRUCT__ struct{ cl_short2 lo, hi; };
#endif
#if defined( __CL_SHORT2__)
__cl_short2 v2[2];
@@ -605,10 +679,10 @@ typedef cl_short4 cl_short3;
typedef union
{
cl_short CL_ALIGNED(16) s[8];
#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
__extension__ struct{ cl_short x, y, z, w; };
__extension__ struct{ cl_short s0, s1, s2, s3, s4, s5, s6, s7; };
__extension__ struct{ cl_short4 lo, hi; };
#if __CL_HAS_ANON_STRUCT__
__CL_ANON_STRUCT__ struct{ cl_short x, y, z, w; };
__CL_ANON_STRUCT__ struct{ cl_short s0, s1, s2, s3, s4, s5, s6, s7; };
__CL_ANON_STRUCT__ struct{ cl_short4 lo, hi; };
#endif
#if defined( __CL_SHORT2__)
__cl_short2 v2[4];
@@ -624,10 +698,10 @@ typedef union
typedef union
{
cl_short CL_ALIGNED(32) s[16];
#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
__extension__ struct{ cl_short x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; };
__extension__ struct{ cl_short s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; };
__extension__ struct{ cl_short8 lo, hi; };
#if __CL_HAS_ANON_STRUCT__
__CL_ANON_STRUCT__ struct{ cl_short x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; };
__CL_ANON_STRUCT__ struct{ cl_short s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; };
__CL_ANON_STRUCT__ struct{ cl_short8 lo, hi; };
#endif
#if defined( __CL_SHORT2__)
__cl_short2 v2[8];
@@ -648,10 +722,10 @@ typedef union
typedef union
{
cl_ushort CL_ALIGNED(4) s[2];
#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
__extension__ struct{ cl_ushort x, y; };
__extension__ struct{ cl_ushort s0, s1; };
__extension__ struct{ cl_ushort lo, hi; };
#if __CL_HAS_ANON_STRUCT__
__CL_ANON_STRUCT__ struct{ cl_ushort x, y; };
__CL_ANON_STRUCT__ struct{ cl_ushort s0, s1; };
__CL_ANON_STRUCT__ struct{ cl_ushort lo, hi; };
#endif
#if defined( __CL_USHORT2__)
__cl_ushort2 v2;
@@ -661,10 +735,10 @@ typedef union
typedef union
{
cl_ushort CL_ALIGNED(8) s[4];
#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
__extension__ struct{ cl_ushort x, y, z, w; };
__extension__ struct{ cl_ushort s0, s1, s2, s3; };
__extension__ struct{ cl_ushort2 lo, hi; };
#if __CL_HAS_ANON_STRUCT__
__CL_ANON_STRUCT__ struct{ cl_ushort x, y, z, w; };
__CL_ANON_STRUCT__ struct{ cl_ushort s0, s1, s2, s3; };
__CL_ANON_STRUCT__ struct{ cl_ushort2 lo, hi; };
#endif
#if defined( __CL_USHORT2__)
__cl_ushort2 v2[2];
@@ -680,10 +754,10 @@ typedef cl_ushort4 cl_ushort3;
typedef union
{
cl_ushort CL_ALIGNED(16) s[8];
#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
__extension__ struct{ cl_ushort x, y, z, w; };
__extension__ struct{ cl_ushort s0, s1, s2, s3, s4, s5, s6, s7; };
__extension__ struct{ cl_ushort4 lo, hi; };
#if __CL_HAS_ANON_STRUCT__
__CL_ANON_STRUCT__ struct{ cl_ushort x, y, z, w; };
__CL_ANON_STRUCT__ struct{ cl_ushort s0, s1, s2, s3, s4, s5, s6, s7; };
__CL_ANON_STRUCT__ struct{ cl_ushort4 lo, hi; };
#endif
#if defined( __CL_USHORT2__)
__cl_ushort2 v2[4];
@@ -699,10 +773,10 @@ typedef union
typedef union
{
cl_ushort CL_ALIGNED(32) s[16];
#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
__extension__ struct{ cl_ushort x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; };
__extension__ struct{ cl_ushort s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; };
__extension__ struct{ cl_ushort8 lo, hi; };
#if __CL_HAS_ANON_STRUCT__
__CL_ANON_STRUCT__ struct{ cl_ushort x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; };
__CL_ANON_STRUCT__ struct{ cl_ushort s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; };
__CL_ANON_STRUCT__ struct{ cl_ushort8 lo, hi; };
#endif
#if defined( __CL_USHORT2__)
__cl_ushort2 v2[8];
@@ -722,10 +796,10 @@ typedef union
typedef union
{
cl_int CL_ALIGNED(8) s[2];
#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
__extension__ struct{ cl_int x, y; };
__extension__ struct{ cl_int s0, s1; };
__extension__ struct{ cl_int lo, hi; };
#if __CL_HAS_ANON_STRUCT__
__CL_ANON_STRUCT__ struct{ cl_int x, y; };
__CL_ANON_STRUCT__ struct{ cl_int s0, s1; };
__CL_ANON_STRUCT__ struct{ cl_int lo, hi; };
#endif
#if defined( __CL_INT2__)
__cl_int2 v2;
@@ -735,10 +809,10 @@ typedef union
typedef union
{
cl_int CL_ALIGNED(16) s[4];
#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
__extension__ struct{ cl_int x, y, z, w; };
__extension__ struct{ cl_int s0, s1, s2, s3; };
__extension__ struct{ cl_int2 lo, hi; };
#if __CL_HAS_ANON_STRUCT__
__CL_ANON_STRUCT__ struct{ cl_int x, y, z, w; };
__CL_ANON_STRUCT__ struct{ cl_int s0, s1, s2, s3; };
__CL_ANON_STRUCT__ struct{ cl_int2 lo, hi; };
#endif
#if defined( __CL_INT2__)
__cl_int2 v2[2];
@@ -754,10 +828,10 @@ typedef cl_int4 cl_int3;
typedef union
{
cl_int CL_ALIGNED(32) s[8];
#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
__extension__ struct{ cl_int x, y, z, w; };
__extension__ struct{ cl_int s0, s1, s2, s3, s4, s5, s6, s7; };
__extension__ struct{ cl_int4 lo, hi; };
#if __CL_HAS_ANON_STRUCT__
__CL_ANON_STRUCT__ struct{ cl_int x, y, z, w; };
__CL_ANON_STRUCT__ struct{ cl_int s0, s1, s2, s3, s4, s5, s6, s7; };
__CL_ANON_STRUCT__ struct{ cl_int4 lo, hi; };
#endif
#if defined( __CL_INT2__)
__cl_int2 v2[4];
@@ -773,10 +847,10 @@ typedef union
typedef union
{
cl_int CL_ALIGNED(64) s[16];
#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
__extension__ struct{ cl_int x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; };
__extension__ struct{ cl_int s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; };
__extension__ struct{ cl_int8 lo, hi; };
#if __CL_HAS_ANON_STRUCT__
__CL_ANON_STRUCT__ struct{ cl_int x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; };
__CL_ANON_STRUCT__ struct{ cl_int s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; };
__CL_ANON_STRUCT__ struct{ cl_int8 lo, hi; };
#endif
#if defined( __CL_INT2__)
__cl_int2 v2[8];
@@ -797,10 +871,10 @@ typedef union
typedef union
{
cl_uint CL_ALIGNED(8) s[2];
#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
__extension__ struct{ cl_uint x, y; };
__extension__ struct{ cl_uint s0, s1; };
__extension__ struct{ cl_uint lo, hi; };
#if __CL_HAS_ANON_STRUCT__
__CL_ANON_STRUCT__ struct{ cl_uint x, y; };
__CL_ANON_STRUCT__ struct{ cl_uint s0, s1; };
__CL_ANON_STRUCT__ struct{ cl_uint lo, hi; };
#endif
#if defined( __CL_UINT2__)
__cl_uint2 v2;
@@ -810,10 +884,10 @@ typedef union
typedef union
{
cl_uint CL_ALIGNED(16) s[4];
#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
__extension__ struct{ cl_uint x, y, z, w; };
__extension__ struct{ cl_uint s0, s1, s2, s3; };
__extension__ struct{ cl_uint2 lo, hi; };
#if __CL_HAS_ANON_STRUCT__
__CL_ANON_STRUCT__ struct{ cl_uint x, y, z, w; };
__CL_ANON_STRUCT__ struct{ cl_uint s0, s1, s2, s3; };
__CL_ANON_STRUCT__ struct{ cl_uint2 lo, hi; };
#endif
#if defined( __CL_UINT2__)
__cl_uint2 v2[2];
@@ -829,10 +903,10 @@ typedef cl_uint4 cl_uint3;
typedef union
{
cl_uint CL_ALIGNED(32) s[8];
#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
__extension__ struct{ cl_uint x, y, z, w; };
__extension__ struct{ cl_uint s0, s1, s2, s3, s4, s5, s6, s7; };
__extension__ struct{ cl_uint4 lo, hi; };
#if __CL_HAS_ANON_STRUCT__
__CL_ANON_STRUCT__ struct{ cl_uint x, y, z, w; };
__CL_ANON_STRUCT__ struct{ cl_uint s0, s1, s2, s3, s4, s5, s6, s7; };
__CL_ANON_STRUCT__ struct{ cl_uint4 lo, hi; };
#endif
#if defined( __CL_UINT2__)
__cl_uint2 v2[4];
@@ -848,10 +922,10 @@ typedef union
typedef union
{
cl_uint CL_ALIGNED(64) s[16];
#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
__extension__ struct{ cl_uint x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; };
__extension__ struct{ cl_uint s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; };
__extension__ struct{ cl_uint8 lo, hi; };
#if __CL_HAS_ANON_STRUCT__
__CL_ANON_STRUCT__ struct{ cl_uint x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; };
__CL_ANON_STRUCT__ struct{ cl_uint s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; };
__CL_ANON_STRUCT__ struct{ cl_uint8 lo, hi; };
#endif
#if defined( __CL_UINT2__)
__cl_uint2 v2[8];
@@ -871,10 +945,10 @@ typedef union
typedef union
{
cl_long CL_ALIGNED(16) s[2];
#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
__extension__ struct{ cl_long x, y; };
__extension__ struct{ cl_long s0, s1; };
__extension__ struct{ cl_long lo, hi; };
#if __CL_HAS_ANON_STRUCT__
__CL_ANON_STRUCT__ struct{ cl_long x, y; };
__CL_ANON_STRUCT__ struct{ cl_long s0, s1; };
__CL_ANON_STRUCT__ struct{ cl_long lo, hi; };
#endif
#if defined( __CL_LONG2__)
__cl_long2 v2;
@@ -884,10 +958,10 @@ typedef union
typedef union
{
cl_long CL_ALIGNED(32) s[4];
#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
__extension__ struct{ cl_long x, y, z, w; };
__extension__ struct{ cl_long s0, s1, s2, s3; };
__extension__ struct{ cl_long2 lo, hi; };
#if __CL_HAS_ANON_STRUCT__
__CL_ANON_STRUCT__ struct{ cl_long x, y, z, w; };
__CL_ANON_STRUCT__ struct{ cl_long s0, s1, s2, s3; };
__CL_ANON_STRUCT__ struct{ cl_long2 lo, hi; };
#endif
#if defined( __CL_LONG2__)
__cl_long2 v2[2];
@@ -903,10 +977,10 @@ typedef cl_long4 cl_long3;
typedef union
{
cl_long CL_ALIGNED(64) s[8];
#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
__extension__ struct{ cl_long x, y, z, w; };
__extension__ struct{ cl_long s0, s1, s2, s3, s4, s5, s6, s7; };
__extension__ struct{ cl_long4 lo, hi; };
#if __CL_HAS_ANON_STRUCT__
__CL_ANON_STRUCT__ struct{ cl_long x, y, z, w; };
__CL_ANON_STRUCT__ struct{ cl_long s0, s1, s2, s3, s4, s5, s6, s7; };
__CL_ANON_STRUCT__ struct{ cl_long4 lo, hi; };
#endif
#if defined( __CL_LONG2__)
__cl_long2 v2[4];
@@ -922,10 +996,10 @@ typedef union
typedef union
{
cl_long CL_ALIGNED(128) s[16];
#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
__extension__ struct{ cl_long x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; };
__extension__ struct{ cl_long s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; };
__extension__ struct{ cl_long8 lo, hi; };
#if __CL_HAS_ANON_STRUCT__
__CL_ANON_STRUCT__ struct{ cl_long x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; };
__CL_ANON_STRUCT__ struct{ cl_long s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; };
__CL_ANON_STRUCT__ struct{ cl_long8 lo, hi; };
#endif
#if defined( __CL_LONG2__)
__cl_long2 v2[8];
@@ -946,10 +1020,10 @@ typedef union
typedef union
{
cl_ulong CL_ALIGNED(16) s[2];
#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
__extension__ struct{ cl_ulong x, y; };
__extension__ struct{ cl_ulong s0, s1; };
__extension__ struct{ cl_ulong lo, hi; };
#if __CL_HAS_ANON_STRUCT__
__CL_ANON_STRUCT__ struct{ cl_ulong x, y; };
__CL_ANON_STRUCT__ struct{ cl_ulong s0, s1; };
__CL_ANON_STRUCT__ struct{ cl_ulong lo, hi; };
#endif
#if defined( __CL_ULONG2__)
__cl_ulong2 v2;
@@ -959,10 +1033,10 @@ typedef union
typedef union
{
cl_ulong CL_ALIGNED(32) s[4];
#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
__extension__ struct{ cl_ulong x, y, z, w; };
__extension__ struct{ cl_ulong s0, s1, s2, s3; };
__extension__ struct{ cl_ulong2 lo, hi; };
#if __CL_HAS_ANON_STRUCT__
__CL_ANON_STRUCT__ struct{ cl_ulong x, y, z, w; };
__CL_ANON_STRUCT__ struct{ cl_ulong s0, s1, s2, s3; };
__CL_ANON_STRUCT__ struct{ cl_ulong2 lo, hi; };
#endif
#if defined( __CL_ULONG2__)
__cl_ulong2 v2[2];
@@ -978,10 +1052,10 @@ typedef cl_ulong4 cl_ulong3;
typedef union
{
cl_ulong CL_ALIGNED(64) s[8];
#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
__extension__ struct{ cl_ulong x, y, z, w; };
__extension__ struct{ cl_ulong s0, s1, s2, s3, s4, s5, s6, s7; };
__extension__ struct{ cl_ulong4 lo, hi; };
#if __CL_HAS_ANON_STRUCT__
__CL_ANON_STRUCT__ struct{ cl_ulong x, y, z, w; };
__CL_ANON_STRUCT__ struct{ cl_ulong s0, s1, s2, s3, s4, s5, s6, s7; };
__CL_ANON_STRUCT__ struct{ cl_ulong4 lo, hi; };
#endif
#if defined( __CL_ULONG2__)
__cl_ulong2 v2[4];
@@ -997,10 +1071,10 @@ typedef union
typedef union
{
cl_ulong CL_ALIGNED(128) s[16];
#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
__extension__ struct{ cl_ulong x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; };
__extension__ struct{ cl_ulong s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; };
__extension__ struct{ cl_ulong8 lo, hi; };
#if __CL_HAS_ANON_STRUCT__
__CL_ANON_STRUCT__ struct{ cl_ulong x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; };
__CL_ANON_STRUCT__ struct{ cl_ulong s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; };
__CL_ANON_STRUCT__ struct{ cl_ulong8 lo, hi; };
#endif
#if defined( __CL_ULONG2__)
__cl_ulong2 v2[8];
@@ -1022,10 +1096,10 @@ typedef union
typedef union
{
cl_float CL_ALIGNED(8) s[2];
#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
__extension__ struct{ cl_float x, y; };
__extension__ struct{ cl_float s0, s1; };
__extension__ struct{ cl_float lo, hi; };
#if __CL_HAS_ANON_STRUCT__
__CL_ANON_STRUCT__ struct{ cl_float x, y; };
__CL_ANON_STRUCT__ struct{ cl_float s0, s1; };
__CL_ANON_STRUCT__ struct{ cl_float lo, hi; };
#endif
#if defined( __CL_FLOAT2__)
__cl_float2 v2;
@@ -1035,10 +1109,10 @@ typedef union
typedef union
{
cl_float CL_ALIGNED(16) s[4];
#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
__extension__ struct{ cl_float x, y, z, w; };
__extension__ struct{ cl_float s0, s1, s2, s3; };
__extension__ struct{ cl_float2 lo, hi; };
#if __CL_HAS_ANON_STRUCT__
__CL_ANON_STRUCT__ struct{ cl_float x, y, z, w; };
__CL_ANON_STRUCT__ struct{ cl_float s0, s1, s2, s3; };
__CL_ANON_STRUCT__ struct{ cl_float2 lo, hi; };
#endif
#if defined( __CL_FLOAT2__)
__cl_float2 v2[2];
@@ -1054,10 +1128,10 @@ typedef cl_float4 cl_float3;
typedef union
{
cl_float CL_ALIGNED(32) s[8];
#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
__extension__ struct{ cl_float x, y, z, w; };
__extension__ struct{ cl_float s0, s1, s2, s3, s4, s5, s6, s7; };
__extension__ struct{ cl_float4 lo, hi; };
#if __CL_HAS_ANON_STRUCT__
__CL_ANON_STRUCT__ struct{ cl_float x, y, z, w; };
__CL_ANON_STRUCT__ struct{ cl_float s0, s1, s2, s3, s4, s5, s6, s7; };
__CL_ANON_STRUCT__ struct{ cl_float4 lo, hi; };
#endif
#if defined( __CL_FLOAT2__)
__cl_float2 v2[4];
@@ -1073,10 +1147,10 @@ typedef union
typedef union
{
cl_float CL_ALIGNED(64) s[16];
#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
__extension__ struct{ cl_float x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; };
__extension__ struct{ cl_float s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; };
__extension__ struct{ cl_float8 lo, hi; };
#if __CL_HAS_ANON_STRUCT__
__CL_ANON_STRUCT__ struct{ cl_float x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; };
__CL_ANON_STRUCT__ struct{ cl_float s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; };
__CL_ANON_STRUCT__ struct{ cl_float8 lo, hi; };
#endif
#if defined( __CL_FLOAT2__)
__cl_float2 v2[8];
@@ -1097,10 +1171,10 @@ typedef union
typedef union
{
cl_double CL_ALIGNED(16) s[2];
#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
__extension__ struct{ cl_double x, y; };
__extension__ struct{ cl_double s0, s1; };
__extension__ struct{ cl_double lo, hi; };
#if __CL_HAS_ANON_STRUCT__
__CL_ANON_STRUCT__ struct{ cl_double x, y; };
__CL_ANON_STRUCT__ struct{ cl_double s0, s1; };
__CL_ANON_STRUCT__ struct{ cl_double lo, hi; };
#endif
#if defined( __CL_DOUBLE2__)
__cl_double2 v2;
@@ -1110,10 +1184,10 @@ typedef union
typedef union
{
cl_double CL_ALIGNED(32) s[4];
#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
__extension__ struct{ cl_double x, y, z, w; };
__extension__ struct{ cl_double s0, s1, s2, s3; };
__extension__ struct{ cl_double2 lo, hi; };
#if __CL_HAS_ANON_STRUCT__
__CL_ANON_STRUCT__ struct{ cl_double x, y, z, w; };
__CL_ANON_STRUCT__ struct{ cl_double s0, s1, s2, s3; };
__CL_ANON_STRUCT__ struct{ cl_double2 lo, hi; };
#endif
#if defined( __CL_DOUBLE2__)
__cl_double2 v2[2];
@@ -1129,10 +1203,10 @@ typedef cl_double4 cl_double3;
typedef union
{
cl_double CL_ALIGNED(64) s[8];
#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
__extension__ struct{ cl_double x, y, z, w; };
__extension__ struct{ cl_double s0, s1, s2, s3, s4, s5, s6, s7; };
__extension__ struct{ cl_double4 lo, hi; };
#if __CL_HAS_ANON_STRUCT__
__CL_ANON_STRUCT__ struct{ cl_double x, y, z, w; };
__CL_ANON_STRUCT__ struct{ cl_double s0, s1, s2, s3, s4, s5, s6, s7; };
__CL_ANON_STRUCT__ struct{ cl_double4 lo, hi; };
#endif
#if defined( __CL_DOUBLE2__)
__cl_double2 v2[4];
@@ -1148,10 +1222,10 @@ typedef union
typedef union
{
cl_double CL_ALIGNED(128) s[16];
#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
__extension__ struct{ cl_double x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; };
__extension__ struct{ cl_double s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; };
__extension__ struct{ cl_double8 lo, hi; };
#if __CL_HAS_ANON_STRUCT__
__CL_ANON_STRUCT__ struct{ cl_double x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; };
__CL_ANON_STRUCT__ struct{ cl_double s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; };
__CL_ANON_STRUCT__ struct{ cl_double8 lo, hi; };
#endif
#if defined( __CL_DOUBLE2__)
__cl_double2 v2[8];
@@ -1170,13 +1244,13 @@ typedef union
/* Macro to facilitate debugging
* Usage:
* Place CL_PROGRAM_STRING_DEBUG_INFO on the line before the first line of your source.
* The first line ends with: CL_PROGRAM_STRING_BEGIN \"
* The first line ends with: CL_PROGRAM_STRING_DEBUG_INFO \"
* Each line thereafter of OpenCL C source must end with: \n\
* The last line ends in ";
*
* Example:
*
* const char *my_program = CL_PROGRAM_STRING_BEGIN "\
* const char *my_program = CL_PROGRAM_STRING_DEBUG_INFO "\
* kernel void foo( int a, float * b ) \n\
* { \n\
* // my comment \n\
@@ -1195,4 +1269,10 @@ typedef union
}
#endif
#undef __CL_HAS_ANON_STRUCT__
#undef __CL_ANON_STRUCT__
#if defined( _WIN32) && (_MSC_VER >= 1500)
#pragma warning( pop )
#endif
#endif /* __CL_PLATFORM_H */

View File

@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2008-2010 The Khronos Group Inc.
* Copyright (c) 2008-2012 The Khronos Group Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and/or associated documentation files (the

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
/**************************************************************************
*
* Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
* Copyright 2008 VMware, Inc.
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
@@ -134,6 +134,16 @@ typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYWAYLANDBUFFERWL) (EGLDisplay dpy, st
#endif
#ifndef EGL_WL_create_wayland_buffer_from_image
#define EGL_WL_create_wayland_buffer_from_image 1
#ifdef EGL_EGLEXT_PROTOTYPES
EGLAPI struct wl_buffer * EGLAPIENTRY eglCreateWaylandBufferFromImageWL(EGLDisplay dpy, EGLImageKHR image);
#endif
typedef struct wl_buffer * (EGLAPIENTRYP PFNEGLCREATEWAYLANDBUFFERFROMIMAGEWL) (EGLDisplay dpy, EGLImageKHR image);
#endif
#ifndef EGL_NOK_swap_region
#define EGL_NOK_swap_region 1
@@ -155,6 +165,11 @@ typedef EGLBoolean (EGLAPIENTRYP PFNEGLSWAPBUFFERSREGIONNOK) (EGLDisplay dpy, EG
#define EGL_NATIVE_BUFFER_ANDROID 0x3140 /* eglCreateImageKHR target */
#endif
#ifndef EGL_MESA_configless_context
#define EGL_MESA_configless_context 1
#define EGL_NO_CONFIG_MESA ((EGLConfig)0)
#endif
#ifdef __cplusplus
}
#endif

View File

@@ -97,10 +97,6 @@
#define GLAPIENTRYP GLAPIENTRY *
#endif
#if defined(PRAGMA_EXPORT_SUPPORTED)
#pragma export on
#endif
/*
* End system-specific stuff.
**********************************************************************/
@@ -694,7 +690,7 @@ typedef double GLclampd; /* double precision float in [0,1] */
#define GL_LIST_BIT 0x00020000
#define GL_TEXTURE_BIT 0x00040000
#define GL_SCISSOR_BIT 0x00080000
#define GL_ALL_ATTRIB_BITS 0x000FFFFF
#define GL_ALL_ATTRIB_BITS 0xFFFFFFFF
/* OpenGL 1.1 */
@@ -2078,39 +2074,6 @@ typedef void (APIENTRYP PFNGLMULTITEXCOORD4SVARBPROC) (GLenum target, const GLsh
#endif /* GL_MESA_packed_depth_stencil */
#ifndef GL_MESA_texture_array
#define GL_MESA_texture_array 1
/* GL_MESA_texture_array uses the same enum values as GL_EXT_texture_array.
*/
#ifndef GL_EXT_texture_array
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glFramebufferTextureLayerEXT(GLenum target,
GLenum attachment, GLuint texture, GLint level, GLint layer);
#endif /* GL_GLEXT_PROTOTYPES */
#if 0
/* (temporarily) disabled because of collision with typedef in glext.h
* that happens if apps include both gl.h and glext.h
*/
typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC) (GLenum target,
GLenum attachment, GLuint texture, GLint level, GLint layer);
#endif
#define GL_TEXTURE_1D_ARRAY_EXT 0x8C18
#define GL_PROXY_TEXTURE_1D_ARRAY_EXT 0x8C19
#define GL_TEXTURE_2D_ARRAY_EXT 0x8C1A
#define GL_PROXY_TEXTURE_2D_ARRAY_EXT 0x8C1B
#define GL_TEXTURE_BINDING_1D_ARRAY_EXT 0x8C1C
#define GL_TEXTURE_BINDING_2D_ARRAY_EXT 0x8C1D
#define GL_MAX_ARRAY_TEXTURE_LAYERS_EXT 0x88FF
#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT 0x8CD4
#endif
#endif
#ifndef GL_ATI_blend_equation_separate
#define GL_ATI_blend_equation_separate 1
@@ -2145,19 +2108,6 @@ typedef void (APIENTRYP PFNGLEGLIMAGETARGETRENDERBUFFERSTORAGEOESPROC) (GLenum t
**/
/**********************************************************************
* Begin system-specific stuff
*/
#if defined(PRAGMA_EXPORT_SUPPORTED)
#pragma export off
#endif
/*
* End system-specific stuff
**********************************************************************/
#ifdef __cplusplus
}
#endif

File diff suppressed because it is too large Load Diff

View File

@@ -6,7 +6,7 @@ extern "C" {
#endif
/*
** Copyright (c) 2013 The Khronos Group Inc.
** Copyright (c) 2013-2014 The Khronos Group Inc.
**
** Permission is hereby granted, free of charge, to any person obtaining a
** copy of this software and/or associated documentation files (the
@@ -33,7 +33,7 @@ extern "C" {
** used to make the header, and the header can be found at
** http://www.opengl.org/registry/
**
** Khronos $Revision: 23422 $ on $Date: 2013-10-08 15:40:45 -0700 (Tue, 08 Oct 2013) $
** Khronos $Revision: 25853 $ on $Date: 2014-03-13 03:40:45 -0700 (Thu, 13 Mar 2014) $
*/
#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__)
@@ -53,7 +53,7 @@ extern "C" {
#define GLAPI extern
#endif
#define GL_GLEXT_VERSION 20131008
#define GL_GLEXT_VERSION 20140313
/* Generated C header for:
* API: gl
@@ -1477,7 +1477,7 @@ typedef GLboolean (APIENTRYP PFNGLISSYNCPROC) (GLsync sync);
typedef void (APIENTRYP PFNGLDELETESYNCPROC) (GLsync sync);
typedef GLenum (APIENTRYP PFNGLCLIENTWAITSYNCPROC) (GLsync sync, GLbitfield flags, GLuint64 timeout);
typedef void (APIENTRYP PFNGLWAITSYNCPROC) (GLsync sync, GLbitfield flags, GLuint64 timeout);
typedef void (APIENTRYP PFNGLGETINTEGER64VPROC) (GLenum pname, GLint64 *params);
typedef void (APIENTRYP PFNGLGETINTEGER64VPROC) (GLenum pname, GLint64 *data);
typedef void (APIENTRYP PFNGLGETSYNCIVPROC) (GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values);
typedef void (APIENTRYP PFNGLGETINTEGER64I_VPROC) (GLenum target, GLuint index, GLint64 *data);
typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERI64VPROC) (GLenum target, GLenum pname, GLint64 *params);
@@ -1485,7 +1485,7 @@ typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREPROC) (GLenum target, GLenum atta
typedef void (APIENTRYP PFNGLTEXIMAGE2DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations);
typedef void (APIENTRYP PFNGLTEXIMAGE3DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations);
typedef void (APIENTRYP PFNGLGETMULTISAMPLEFVPROC) (GLenum pname, GLuint index, GLfloat *val);
typedef void (APIENTRYP PFNGLSAMPLEMASKIPROC) (GLuint index, GLbitfield mask);
typedef void (APIENTRYP PFNGLSAMPLEMASKIPROC) (GLuint maskNumber, GLbitfield mask);
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glDrawElementsBaseVertex (GLenum mode, GLsizei count, GLenum type, const void *indices, GLint basevertex);
GLAPI void APIENTRY glDrawRangeElementsBaseVertex (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices, GLint basevertex);
@@ -1497,7 +1497,7 @@ GLAPI GLboolean APIENTRY glIsSync (GLsync sync);
GLAPI void APIENTRY glDeleteSync (GLsync sync);
GLAPI GLenum APIENTRY glClientWaitSync (GLsync sync, GLbitfield flags, GLuint64 timeout);
GLAPI void APIENTRY glWaitSync (GLsync sync, GLbitfield flags, GLuint64 timeout);
GLAPI void APIENTRY glGetInteger64v (GLenum pname, GLint64 *params);
GLAPI void APIENTRY glGetInteger64v (GLenum pname, GLint64 *data);
GLAPI void APIENTRY glGetSynciv (GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values);
GLAPI void APIENTRY glGetInteger64i_v (GLenum target, GLuint index, GLint64 *data);
GLAPI void APIENTRY glGetBufferParameteri64v (GLenum target, GLenum pname, GLint64 *params);
@@ -1505,7 +1505,7 @@ GLAPI void APIENTRY glFramebufferTexture (GLenum target, GLenum attachment, GLui
GLAPI void APIENTRY glTexImage2DMultisample (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations);
GLAPI void APIENTRY glTexImage3DMultisample (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations);
GLAPI void APIENTRY glGetMultisamplefv (GLenum pname, GLuint index, GLfloat *val);
GLAPI void APIENTRY glSampleMaski (GLuint index, GLbitfield mask);
GLAPI void APIENTRY glSampleMaski (GLuint maskNumber, GLbitfield mask);
#endif
#endif /* GL_VERSION_3_2 */
@@ -2144,6 +2144,10 @@ GLAPI void APIENTRY glGetDoublei_v (GLenum target, GLuint index, GLdouble *data)
#define GL_MAX_GEOMETRY_IMAGE_UNIFORMS 0x90CD
#define GL_MAX_FRAGMENT_IMAGE_UNIFORMS 0x90CE
#define GL_MAX_COMBINED_IMAGE_UNIFORMS 0x90CF
#define GL_COMPRESSED_RGBA_BPTC_UNORM 0x8E8C
#define GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM 0x8E8D
#define GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT 0x8E8E
#define GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT 0x8E8F
#define GL_TEXTURE_IMMUTABLE_FORMAT 0x912F
typedef void (APIENTRYP PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEPROC) (GLenum mode, GLint first, GLsizei count, GLsizei instancecount, GLuint baseinstance);
typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDBASEINSTANCEPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLuint baseinstance);
@@ -4836,6 +4840,20 @@ GLAPI GLboolean APIENTRY glIsNameAMD (GLenum identifier, GLuint name);
#endif
#endif /* GL_AMD_name_gen_delete */
#ifndef GL_AMD_occlusion_query_event
#define GL_AMD_occlusion_query_event 1
#define GL_OCCLUSION_QUERY_EVENT_MASK_AMD 0x874F
#define GL_QUERY_DEPTH_PASS_EVENT_BIT_AMD 0x00000001
#define GL_QUERY_DEPTH_FAIL_EVENT_BIT_AMD 0x00000002
#define GL_QUERY_STENCIL_FAIL_EVENT_BIT_AMD 0x00000004
#define GL_QUERY_DEPTH_BOUNDS_FAIL_EVENT_BIT_AMD 0x00000008
#define GL_QUERY_ALL_EVENT_BITS_AMD 0xFFFFFFFF
typedef void (APIENTRYP PFNGLQUERYOBJECTPARAMETERUIAMDPROC) (GLenum target, GLuint id, GLenum pname, GLuint param);
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glQueryObjectParameteruiAMD (GLenum target, GLuint id, GLenum pname, GLuint param);
#endif
#endif /* GL_AMD_occlusion_query_event */
#ifndef GL_AMD_performance_monitor
#define GL_AMD_performance_monitor 1
#define GL_COUNTER_TYPE_AMD 0x8BC0
@@ -5900,6 +5918,34 @@ GLAPI void APIENTRY glCullParameterfvEXT (GLenum pname, GLfloat *params);
#endif
#endif /* GL_EXT_cull_vertex */
#ifndef GL_EXT_debug_label
#define GL_EXT_debug_label 1
#define GL_PROGRAM_PIPELINE_OBJECT_EXT 0x8A4F
#define GL_PROGRAM_OBJECT_EXT 0x8B40
#define GL_SHADER_OBJECT_EXT 0x8B48
#define GL_BUFFER_OBJECT_EXT 0x9151
#define GL_QUERY_OBJECT_EXT 0x9153
#define GL_VERTEX_ARRAY_OBJECT_EXT 0x9154
typedef void (APIENTRYP PFNGLLABELOBJECTEXTPROC) (GLenum type, GLuint object, GLsizei length, const GLchar *label);
typedef void (APIENTRYP PFNGLGETOBJECTLABELEXTPROC) (GLenum type, GLuint object, GLsizei bufSize, GLsizei *length, GLchar *label);
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glLabelObjectEXT (GLenum type, GLuint object, GLsizei length, const GLchar *label);
GLAPI void APIENTRY glGetObjectLabelEXT (GLenum type, GLuint object, GLsizei bufSize, GLsizei *length, GLchar *label);
#endif
#endif /* GL_EXT_debug_label */
#ifndef GL_EXT_debug_marker
#define GL_EXT_debug_marker 1
typedef void (APIENTRYP PFNGLINSERTEVENTMARKEREXTPROC) (GLsizei length, const GLchar *marker);
typedef void (APIENTRYP PFNGLPUSHGROUPMARKEREXTPROC) (GLsizei length, const GLchar *marker);
typedef void (APIENTRYP PFNGLPOPGROUPMARKEREXTPROC) (void);
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glInsertEventMarkerEXT (GLsizei length, const GLchar *marker);
GLAPI void APIENTRY glPushGroupMarkerEXT (GLsizei length, const GLchar *marker);
GLAPI void APIENTRY glPopGroupMarkerEXT (void);
#endif
#endif /* GL_EXT_debug_marker */
#ifndef GL_EXT_depth_bounds_test
#define GL_EXT_depth_bounds_test 1
#define GL_DEPTH_BOUNDS_TEST_EXT 0x8890
@@ -6135,7 +6181,7 @@ typedef void *(APIENTRYP PFNGLMAPNAMEDBUFFERRANGEEXTPROC) (GLuint buffer, GLintp
typedef void (APIENTRYP PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr length);
typedef void (APIENTRYP PFNGLNAMEDBUFFERSTORAGEEXTPROC) (GLuint buffer, GLsizeiptr size, const void *data, GLbitfield flags);
typedef void (APIENTRYP PFNGLCLEARNAMEDBUFFERDATAEXTPROC) (GLuint buffer, GLenum internalformat, GLenum format, GLenum type, const void *data);
typedef void (APIENTRYP PFNGLCLEARNAMEDBUFFERSUBDATAEXTPROC) (GLuint buffer, GLenum internalformat, GLenum format, GLenum type, GLsizeiptr offset, GLsizeiptr size, const void *data);
typedef void (APIENTRYP PFNGLCLEARNAMEDBUFFERSUBDATAEXTPROC) (GLuint buffer, GLenum internalformat, GLsizeiptr offset, GLsizeiptr size, GLenum format, GLenum type, const void *data);
typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERPARAMETERIEXTPROC) (GLuint framebuffer, GLenum pname, GLint param);
typedef void (APIENTRYP PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVEXTPROC) (GLuint framebuffer, GLenum pname, GLint *params);
typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1DEXTPROC) (GLuint program, GLint location, GLdouble x);
@@ -6391,7 +6437,7 @@ GLAPI void *APIENTRY glMapNamedBufferRangeEXT (GLuint buffer, GLintptr offset, G
GLAPI void APIENTRY glFlushMappedNamedBufferRangeEXT (GLuint buffer, GLintptr offset, GLsizeiptr length);
GLAPI void APIENTRY glNamedBufferStorageEXT (GLuint buffer, GLsizeiptr size, const void *data, GLbitfield flags);
GLAPI void APIENTRY glClearNamedBufferDataEXT (GLuint buffer, GLenum internalformat, GLenum format, GLenum type, const void *data);
GLAPI void APIENTRY glClearNamedBufferSubDataEXT (GLuint buffer, GLenum internalformat, GLenum format, GLenum type, GLsizeiptr offset, GLsizeiptr size, const void *data);
GLAPI void APIENTRY glClearNamedBufferSubDataEXT (GLuint buffer, GLenum internalformat, GLsizeiptr offset, GLsizeiptr size, GLenum format, GLenum type, const void *data);
GLAPI void APIENTRY glNamedFramebufferParameteriEXT (GLuint framebuffer, GLenum pname, GLint param);
GLAPI void APIENTRY glGetNamedFramebufferParameterivEXT (GLuint framebuffer, GLenum pname, GLint *params);
GLAPI void APIENTRY glProgramUniform1dEXT (GLuint program, GLint location, GLdouble x);
@@ -7034,6 +7080,10 @@ GLAPI GLuint APIENTRY glCreateShaderProgramEXT (GLenum type, const GLchar *strin
#define GL_SEPARATE_SPECULAR_COLOR_EXT 0x81FA
#endif /* GL_EXT_separate_specular_color */
#ifndef GL_EXT_shader_image_load_formatted
#define GL_EXT_shader_image_load_formatted 1
#endif /* GL_EXT_shader_image_load_formatted */
#ifndef GL_EXT_shader_image_load_store
#define GL_EXT_shader_image_load_store 1
#define GL_MAX_IMAGE_UNITS_EXT 0x8F38
@@ -8041,6 +8091,10 @@ GLAPI void APIENTRY glBlendFuncSeparateINGR (GLenum sfactorRGB, GLenum dfactorRG
#define GL_INTERLACE_READ_INGR 0x8568
#endif /* GL_INGR_interlace_read */
#ifndef GL_INTEL_fragment_shader_ordering
#define GL_INTEL_fragment_shader_ordering 1
#endif /* GL_INTEL_fragment_shader_ordering */
#ifndef GL_INTEL_map_texture
#define GL_INTEL_map_texture 1
#define GL_TEXTURE_MEMORY_LAYOUT_INTEL 0x83FF
@@ -8076,6 +8130,52 @@ GLAPI void APIENTRY glTexCoordPointervINTEL (GLint size, GLenum type, const void
#endif
#endif /* GL_INTEL_parallel_arrays */
#ifndef GL_INTEL_performance_query
#define GL_INTEL_performance_query 1
#define GL_PERFQUERY_SINGLE_CONTEXT_INTEL 0x00000000
#define GL_PERFQUERY_GLOBAL_CONTEXT_INTEL 0x00000001
#define GL_PERFQUERY_WAIT_INTEL 0x83FB
#define GL_PERFQUERY_FLUSH_INTEL 0x83FA
#define GL_PERFQUERY_DONOT_FLUSH_INTEL 0x83F9
#define GL_PERFQUERY_COUNTER_EVENT_INTEL 0x94F0
#define GL_PERFQUERY_COUNTER_DURATION_NORM_INTEL 0x94F1
#define GL_PERFQUERY_COUNTER_DURATION_RAW_INTEL 0x94F2
#define GL_PERFQUERY_COUNTER_THROUGHPUT_INTEL 0x94F3
#define GL_PERFQUERY_COUNTER_RAW_INTEL 0x94F4
#define GL_PERFQUERY_COUNTER_TIMESTAMP_INTEL 0x94F5
#define GL_PERFQUERY_COUNTER_DATA_UINT32_INTEL 0x94F8
#define GL_PERFQUERY_COUNTER_DATA_UINT64_INTEL 0x94F9
#define GL_PERFQUERY_COUNTER_DATA_FLOAT_INTEL 0x94FA
#define GL_PERFQUERY_COUNTER_DATA_DOUBLE_INTEL 0x94FB
#define GL_PERFQUERY_COUNTER_DATA_BOOL32_INTEL 0x94FC
#define GL_PERFQUERY_QUERY_NAME_LENGTH_MAX_INTEL 0x94FD
#define GL_PERFQUERY_COUNTER_NAME_LENGTH_MAX_INTEL 0x94FE
#define GL_PERFQUERY_COUNTER_DESC_LENGTH_MAX_INTEL 0x94FF
#define GL_PERFQUERY_GPA_EXTENDED_COUNTERS_INTEL 0x9500
typedef void (APIENTRYP PFNGLBEGINPERFQUERYINTELPROC) (GLuint queryHandle);
typedef void (APIENTRYP PFNGLCREATEPERFQUERYINTELPROC) (GLuint queryId, GLuint *queryHandle);
typedef void (APIENTRYP PFNGLDELETEPERFQUERYINTELPROC) (GLuint queryHandle);
typedef void (APIENTRYP PFNGLENDPERFQUERYINTELPROC) (GLuint queryHandle);
typedef void (APIENTRYP PFNGLGETFIRSTPERFQUERYIDINTELPROC) (GLuint *queryId);
typedef void (APIENTRYP PFNGLGETNEXTPERFQUERYIDINTELPROC) (GLuint queryId, GLuint *nextQueryId);
typedef void (APIENTRYP PFNGLGETPERFCOUNTERINFOINTELPROC) (GLuint queryId, GLuint counterId, GLuint counterNameLength, GLchar *counterName, GLuint counterDescLength, GLchar *counterDesc, GLuint *counterOffset, GLuint *counterDataSize, GLuint *counterTypeEnum, GLuint *counterDataTypeEnum, GLuint64 *rawCounterMaxValue);
typedef void (APIENTRYP PFNGLGETPERFQUERYDATAINTELPROC) (GLuint queryHandle, GLuint flags, GLsizei dataSize, GLvoid *data, GLuint *bytesWritten);
typedef void (APIENTRYP PFNGLGETPERFQUERYIDBYNAMEINTELPROC) (GLchar *queryName, GLuint *queryId);
typedef void (APIENTRYP PFNGLGETPERFQUERYINFOINTELPROC) (GLuint queryId, GLuint queryNameLength, GLchar *queryName, GLuint *dataSize, GLuint *noCounters, GLuint *noInstances, GLuint *capsMask);
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glBeginPerfQueryINTEL (GLuint queryHandle);
GLAPI void APIENTRY glCreatePerfQueryINTEL (GLuint queryId, GLuint *queryHandle);
GLAPI void APIENTRY glDeletePerfQueryINTEL (GLuint queryHandle);
GLAPI void APIENTRY glEndPerfQueryINTEL (GLuint queryHandle);
GLAPI void APIENTRY glGetFirstPerfQueryIdINTEL (GLuint *queryId);
GLAPI void APIENTRY glGetNextPerfQueryIdINTEL (GLuint queryId, GLuint *nextQueryId);
GLAPI void APIENTRY glGetPerfCounterInfoINTEL (GLuint queryId, GLuint counterId, GLuint counterNameLength, GLchar *counterName, GLuint counterDescLength, GLchar *counterDesc, GLuint *counterOffset, GLuint *counterDataSize, GLuint *counterTypeEnum, GLuint *counterDataTypeEnum, GLuint64 *rawCounterMaxValue);
GLAPI void APIENTRY glGetPerfQueryDataINTEL (GLuint queryHandle, GLuint flags, GLsizei dataSize, GLvoid *data, GLuint *bytesWritten);
GLAPI void APIENTRY glGetPerfQueryIdByNameINTEL (GLchar *queryName, GLuint *queryId);
GLAPI void APIENTRY glGetPerfQueryInfoINTEL (GLuint queryId, GLuint queryNameLength, GLchar *queryName, GLuint *dataSize, GLuint *noCounters, GLuint *noInstances, GLuint *capsMask);
#endif
#endif /* GL_INTEL_performance_query */
#ifndef GL_MESAX_texture_stack
#define GL_MESAX_texture_stack 1
#define GL_TEXTURE_1D_STACK_MESAX 0x8759
@@ -8170,6 +8270,15 @@ GLAPI void APIENTRY glEndConditionalRenderNVX (void);
#endif
#endif /* GL_NVX_conditional_render */
#ifndef GL_NVX_gpu_memory_info
#define GL_NVX_gpu_memory_info 1
#define GL_GPU_MEMORY_INFO_DEDICATED_VIDMEM_NVX 0x9047
#define GL_GPU_MEMORY_INFO_TOTAL_AVAILABLE_MEMORY_NVX 0x9048
#define GL_GPU_MEMORY_INFO_CURRENT_AVAILABLE_VIDMEM_NVX 0x9049
#define GL_GPU_MEMORY_INFO_EVICTION_COUNT_NVX 0x904A
#define GL_GPU_MEMORY_INFO_EVICTED_MEMORY_NVX 0x904B
#endif /* GL_NVX_gpu_memory_info */
#ifndef GL_NV_bindless_multi_draw_indirect
#define GL_NV_bindless_multi_draw_indirect 1
typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSINDIRECTBINDLESSNVPROC) (GLenum mode, const void *indirect, GLsizei drawCount, GLsizei stride, GLint vertexBufferCount);
@@ -8214,9 +8323,9 @@ GLAPI GLboolean APIENTRY glIsImageHandleResidentNV (GLuint64 handle);
#ifndef GL_NV_blend_equation_advanced
#define GL_NV_blend_equation_advanced 1
#define GL_BLEND_ADVANCED_COHERENT_NV 0x9285
#define GL_BLEND_OVERLAP_NV 0x9281
#define GL_BLEND_PREMULTIPLIED_SRC_NV 0x9280
#define GL_BLUE_NV 0x1905
#define GL_COLORBURN_NV 0x929A
#define GL_COLORDODGE_NV 0x9299
#define GL_CONJOINT_NV 0x9284
@@ -8230,6 +8339,7 @@ GLAPI GLboolean APIENTRY glIsImageHandleResidentNV (GLuint64 handle);
#define GL_DST_OUT_NV 0x928D
#define GL_DST_OVER_NV 0x9289
#define GL_EXCLUSION_NV 0x92A0
#define GL_GREEN_NV 0x1904
#define GL_HARDLIGHT_NV 0x929B
#define GL_HARDMIX_NV 0x92A9
#define GL_HSL_COLOR_NV 0x92AF
@@ -8251,6 +8361,7 @@ GLAPI GLboolean APIENTRY glIsImageHandleResidentNV (GLuint64 handle);
#define GL_PLUS_CLAMPED_NV 0x92B1
#define GL_PLUS_DARKER_NV 0x9292
#define GL_PLUS_NV 0x9291
#define GL_RED_NV 0x1903
#define GL_SCREEN_NV 0x9295
#define GL_SOFTLIGHT_NV 0x929C
#define GL_SRC_ATOP_NV 0x928E
@@ -8260,6 +8371,7 @@ GLAPI GLboolean APIENTRY glIsImageHandleResidentNV (GLuint64 handle);
#define GL_SRC_OVER_NV 0x9288
#define GL_UNCORRELATED_NV 0x9282
#define GL_VIVIDLIGHT_NV 0x92A6
#define GL_XOR_NV 0x1506
typedef void (APIENTRYP PFNGLBLENDPARAMETERINVPROC) (GLenum pname, GLint value);
typedef void (APIENTRYP PFNGLBLENDBARRIERNVPROC) (void);
#ifdef GL_GLEXT_PROTOTYPES
@@ -8270,6 +8382,7 @@ GLAPI void APIENTRY glBlendBarrierNV (void);
#ifndef GL_NV_blend_equation_advanced_coherent
#define GL_NV_blend_equation_advanced_coherent 1
#define GL_BLEND_ADVANCED_COHERENT_NV 0x9285
#endif /* GL_NV_blend_equation_advanced_coherent */
#ifndef GL_NV_blend_square
@@ -9318,6 +9431,17 @@ GLAPI void APIENTRY glProgramUniformui64vNV (GLuint program, GLint location, GLs
#define GL_NV_shader_storage_buffer_object 1
#endif /* GL_NV_shader_storage_buffer_object */
#ifndef GL_NV_shader_thread_group
#define GL_NV_shader_thread_group 1
#define GL_WARP_SIZE_NV 0x9339
#define GL_WARPS_PER_SM_NV 0x933A
#define GL_SM_COUNT_NV 0x933B
#endif /* GL_NV_shader_thread_group */
#ifndef GL_NV_shader_thread_shuffle
#define GL_NV_shader_thread_shuffle 1
#endif /* GL_NV_shader_thread_shuffle */
#ifndef GL_NV_tessellation_program5
#define GL_NV_tessellation_program5 1
#define GL_MAX_PROGRAM_PATCH_ATTRIBS_NV 0x86D8
@@ -9593,7 +9717,7 @@ typedef void (APIENTRYP PFNGLVDPAUINITNVPROC) (const void *vdpDevice, const void
typedef void (APIENTRYP PFNGLVDPAUFININVPROC) (void);
typedef GLvdpauSurfaceNV (APIENTRYP PFNGLVDPAUREGISTERVIDEOSURFACENVPROC) (const void *vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames);
typedef GLvdpauSurfaceNV (APIENTRYP PFNGLVDPAUREGISTEROUTPUTSURFACENVPROC) (const void *vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames);
typedef void (APIENTRYP PFNGLVDPAUISSURFACENVPROC) (GLvdpauSurfaceNV surface);
typedef GLboolean (APIENTRYP PFNGLVDPAUISSURFACENVPROC) (GLvdpauSurfaceNV surface);
typedef void (APIENTRYP PFNGLVDPAUUNREGISTERSURFACENVPROC) (GLvdpauSurfaceNV surface);
typedef void (APIENTRYP PFNGLVDPAUGETSURFACEIVNVPROC) (GLvdpauSurfaceNV surface, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values);
typedef void (APIENTRYP PFNGLVDPAUSURFACEACCESSNVPROC) (GLvdpauSurfaceNV surface, GLenum access);
@@ -9604,7 +9728,7 @@ GLAPI void APIENTRY glVDPAUInitNV (const void *vdpDevice, const void *getProcAdd
GLAPI void APIENTRY glVDPAUFiniNV (void);
GLAPI GLvdpauSurfaceNV APIENTRY glVDPAURegisterVideoSurfaceNV (const void *vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames);
GLAPI GLvdpauSurfaceNV APIENTRY glVDPAURegisterOutputSurfaceNV (const void *vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames);
GLAPI void APIENTRY glVDPAUIsSurfaceNV (GLvdpauSurfaceNV surface);
GLAPI GLboolean APIENTRY glVDPAUIsSurfaceNV (GLvdpauSurfaceNV surface);
GLAPI void APIENTRY glVDPAUUnregisterSurfaceNV (GLvdpauSurfaceNV surface);
GLAPI void APIENTRY glVDPAUGetSurfaceivNV (GLvdpauSurfaceNV surface, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values);
GLAPI void APIENTRY glVDPAUSurfaceAccessNV (GLvdpauSurfaceNV surface, GLenum access);

View File

@@ -168,6 +168,7 @@ typedef XID GLXDrawable;
/* GLX 1.3 and later */
typedef struct __GLXFBConfigRec *GLXFBConfig;
typedef XID GLXFBConfigID;
typedef XID GLXContextID;
typedef XID GLXWindow;
typedef XID GLXPbuffer;
@@ -517,7 +518,7 @@ typedef struct {
unsigned long serial; /* # of last request processed by server */
Bool send_event; /* true if this came from a SendEvent request */
Display *display; /* Display the event was read from */
GLXDrawable drawable; /* drawable on which event was requested in event mask */
Drawable drawable; /* drawable on which event was requested in event mask */
int event_type;
int64_t ust;
int64_t msc;

View File

@@ -6,7 +6,7 @@ extern "C" {
#endif
/*
** Copyright (c) 2013 The Khronos Group Inc.
** Copyright (c) 2013-2014 The Khronos Group Inc.
**
** Permission is hereby granted, free of charge, to any person obtaining a
** copy of this software and/or associated documentation files (the
@@ -33,10 +33,10 @@ extern "C" {
** used to make the header, and the header can be found at
** http://www.opengl.org/registry/
**
** Khronos $Revision: 23422 $ on $Date: 2013-10-08 15:40:45 -0700 (Tue, 08 Oct 2013) $
** Khronos $Revision: 25407 $ on $Date: 2014-02-18 16:51:56 -0800 (Tue, 18 Feb 2014) $
*/
#define GLX_GLXEXT_VERSION 20131008
#define GLX_GLXEXT_VERSION 20140218
/* Generated C header for:
* API: glx
@@ -49,6 +49,7 @@ extern "C" {
#ifndef GLX_VERSION_1_3
#define GLX_VERSION_1_3 1
typedef XID GLXContextID;
typedef struct __GLXFBConfigRec *GLXFBConfig;
typedef XID GLXWindow;
typedef XID GLXPbuffer;
@@ -272,7 +273,6 @@ __GLXextFuncPtr glXGetProcAddressARB (const GLubyte *procName);
#ifndef GLX_EXT_import_context
#define GLX_EXT_import_context 1
typedef XID GLXContextID;
#define GLX_SHARE_CONTEXT_EXT 0x800A
#define GLX_VISUAL_ID_EXT 0x800B
#define GLX_SCREEN_EXT 0x800C
@@ -407,6 +407,32 @@ GLXPixmap glXCreateGLXPixmapMESA (Display *dpy, XVisualInfo *visual, Pixmap pixm
#endif
#endif /* GLX_MESA_pixmap_colormap */
#ifndef GLX_MESA_query_renderer
#define GLX_MESA_query_renderer 1
#define GLX_RENDERER_VENDOR_ID_MESA 0x8183
#define GLX_RENDERER_DEVICE_ID_MESA 0x8184
#define GLX_RENDERER_VERSION_MESA 0x8185
#define GLX_RENDERER_ACCELERATED_MESA 0x8186
#define GLX_RENDERER_VIDEO_MEMORY_MESA 0x8187
#define GLX_RENDERER_UNIFIED_MEMORY_ARCHITECTURE_MESA 0x8188
#define GLX_RENDERER_PREFERRED_PROFILE_MESA 0x8189
#define GLX_RENDERER_OPENGL_CORE_PROFILE_VERSION_MESA 0x818A
#define GLX_RENDERER_OPENGL_COMPATIBILITY_PROFILE_VERSION_MESA 0x818B
#define GLX_RENDERER_OPENGL_ES_PROFILE_VERSION_MESA 0x818C
#define GLX_RENDERER_OPENGL_ES2_PROFILE_VERSION_MESA 0x818D
#define GLX_RENDERER_ID_MESA 0x818E
typedef Bool ( *PFNGLXQUERYCURRENTRENDERERINTEGERMESAPROC) (int attribute, unsigned int *value);
typedef const char *( *PFNGLXQUERYCURRENTRENDERERSTRINGMESAPROC) (int attribute);
typedef Bool ( *PFNGLXQUERYRENDERERINTEGERMESAPROC) (Display *dpy, int screen, int renderer, int attribute, unsigned int *value);
typedef const char *( *PFNGLXQUERYRENDERERSTRINGMESAPROC) (Display *dpy, int screen, int renderer, int attribute);
#ifdef GLX_GLXEXT_PROTOTYPES
Bool glXQueryCurrentRendererIntegerMESA (int attribute, unsigned int *value);
const char *glXQueryCurrentRendererStringMESA (int attribute);
Bool glXQueryRendererIntegerMESA (Display *dpy, int screen, int renderer, int attribute, unsigned int *value);
const char *glXQueryRendererStringMESA (Display *dpy, int screen, int renderer, int attribute);
#endif
#endif /* GLX_MESA_query_renderer */
#ifndef GLX_MESA_release_buffers
#define GLX_MESA_release_buffers 1
typedef Bool ( *PFNGLXRELEASEBUFFERSMESAPROC) (Display *dpy, GLXDrawable drawable);
@@ -433,6 +459,14 @@ void glXCopyImageSubDataNV (Display *dpy, GLXContext srcCtx, GLuint srcName, GLe
#endif
#endif /* GLX_NV_copy_image */
#ifndef GLX_NV_delay_before_swap
#define GLX_NV_delay_before_swap 1
typedef Bool ( *PFNGLXDELAYBEFORESWAPNVPROC) (Display *dpy, GLXDrawable drawable, GLfloat seconds);
#ifdef GLX_GLXEXT_PROTOTYPES
Bool glXDelayBeforeSwapNV (Display *dpy, GLXDrawable drawable, GLfloat seconds);
#endif
#endif /* GLX_NV_delay_before_swap */
#ifndef GLX_NV_float_buffer
#define GLX_NV_float_buffer 1
#define GLX_FLOAT_COMPONENTS_NV 0x20B0

View File

@@ -231,7 +231,7 @@ struct __DRItexOffsetExtensionRec {
#define __DRI_TEXTURE_FORMAT_RGBA 0x20DA
#define __DRI_TEX_BUFFER "DRI_TexBuffer"
#define __DRI_TEX_BUFFER_VERSION 2
#define __DRI_TEX_BUFFER_VERSION 3
struct __DRItexBufferExtensionRec {
__DRIextension base;
@@ -251,6 +251,8 @@ struct __DRItexBufferExtensionRec {
* __DRIdrawable, including the required texture format attribute.
*
* For GLX_EXT_texture_from_pixmap with AIGLX.
*
* \since 2
*/
void (*setTexBuffer2)(__DRIcontext *pDRICtx,
GLint target,
@@ -261,6 +263,8 @@ struct __DRItexBufferExtensionRec {
* need this.
*
* For GLX_EXT_texture_from_pixmap with AIGLX.
*
* \since 3
*/
void (*releaseTexBuffer)(__DRIcontext *pDRICtx,
GLint target,
@@ -437,7 +441,7 @@ struct __DRIdamageExtensionRec {
* SWRast Loader extension.
*/
#define __DRI_SWRAST_LOADER "DRI_SWRastLoader"
#define __DRI_SWRAST_LOADER_VERSION 1
#define __DRI_SWRAST_LOADER_VERSION 2
struct __DRIswrastLoaderExtensionRec {
__DRIextension base;
@@ -461,6 +465,15 @@ struct __DRIswrastLoaderExtensionRec {
void (*getImage)(__DRIdrawable *readable,
int x, int y, int width, int height,
char *data, void *loaderPrivate);
/**
* Put image to drawable
*
* \since 2
*/
void (*putImage2)(__DRIdrawable *drawable, int op,
int x, int y, int width, int height, int stride,
char *data, void *loaderPrivate);
};
/**
@@ -782,12 +795,6 @@ typedef __DRIdrawable *
const __DRIconfig *config,
void *loaderPrivate);
typedef __DRIcontext *
(*__DRIcreateNewContextFunc)(__DRIscreen *screen,
const __DRIconfig *config,
__DRIcontext *shared,
void *loaderPrivate);
typedef __DRIcontext *
(*__DRIcreateContextAttribsFunc)(__DRIscreen *screen,
int api,
@@ -847,6 +854,8 @@ struct __DRIdri2LoaderExtensionRec {
* \param driDrawable Drawable whose front-buffer is to be flushed
* \param loaderPrivate Loader's private data that was previously passed
* into __DRIdri2ExtensionRec::createNewDrawable
*
* \since 2
*/
void (*flushFrontBuffer)(__DRIdrawable *driDrawable, void *loaderPrivate);
@@ -869,6 +878,8 @@ struct __DRIdri2LoaderExtensionRec {
* \c attachments.
* \param loaderPrivate Loader's private data that was previously passed
* into __DRIdri2ExtensionRec::createNewDrawable.
*
* \since 3
*/
__DRIbuffer *(*getBuffersWithFormat)(__DRIdrawable *driDrawable,
int *width, int *height,
@@ -949,7 +960,10 @@ struct __DRIdri2ExtensionRec {
void *loaderPrivate);
__DRIcreateNewDrawableFunc createNewDrawable;
__DRIcreateNewContextFunc createNewContext;
__DRIcontext *(*createNewContext)(__DRIscreen *screen,
const __DRIconfig *config,
__DRIcontext *shared,
void *loaderPrivate);
/* Since version 2 */
__DRIgetAPIMaskFunc getAPIMask;
@@ -1037,6 +1051,7 @@ struct __DRIdri2ExtensionRec {
#define __DRI_IMAGE_FOURCC_XRGB8888 0x34325258
#define __DRI_IMAGE_FOURCC_ABGR8888 0x34324241
#define __DRI_IMAGE_FOURCC_XBGR8888 0x34324258
#define __DRI_IMAGE_FOURCC_SARGB8888 0x83324258
#define __DRI_IMAGE_FOURCC_YUV410 0x39565559
#define __DRI_IMAGE_FOURCC_YUV411 0x31315559
#define __DRI_IMAGE_FOURCC_YUV420 0x32315559
@@ -1405,7 +1420,6 @@ struct __DRIimageDriverExtensionRec {
/* Common DRI functions, shared with DRI2 */
__DRIcreateNewScreen2Func createNewScreen2;
__DRIcreateNewDrawableFunc createNewDrawable;
__DRIcreateNewContextFunc createNewContext;
__DRIcreateContextAttribsFunc createContextAttribs;
__DRIgetAPIMaskFunc getAPIMask;
};

View File

@@ -3,7 +3,7 @@
* SAREA definitions.
*
* \author Kevin E. Martin <kevin@precisioninsight.com>
* \author Jens Owen <jens@tungstengraphics.com>
* \author Jens Owen <jowen@vmware.com>
* \author Rickard E. (Rik) Faith <faith@valinux.com>
*/

View File

@@ -60,8 +60,8 @@ extern "C" {
#include <GL/gl.h>
#define OSMESA_MAJOR_VERSION 6
#define OSMESA_MINOR_VERSION 5
#define OSMESA_MAJOR_VERSION 10
#define OSMESA_MINOR_VERSION 0
#define OSMESA_PATCH_VERSION 0
@@ -270,6 +270,21 @@ OSMesaGetProcAddress( const char *funcName );
GLAPI void GLAPIENTRY
OSMesaColorClamp(GLboolean enable);
/**
* Enable/disable Gallium post-process filters.
* This should be called after a context is created, but before it is
* made current for the first time. After a context has been made
* current, this function has no effect.
* If the enable_value param is zero, the filter is disabled. Otherwise
* the filter is enabled, and the value may control the filter's quality.
* New in Mesa 10.0
*/
GLAPI void GLAPIENTRY
OSMesaPostprocess(OSMesaContext osmesa, const char *filter,
unsigned enable_value);
#ifdef __cplusplus
}
#endif

View File

@@ -1,56 +1,83 @@
#ifndef __gl2_h_
#define __gl2_h_
/* $Revision: 20555 $ on $Date:: 2013-02-12 14:32:47 -0800 #$ */
#include <GLES2/gl2platform.h>
#define __gl2_h_ 1
#ifdef __cplusplus
extern "C" {
#endif
/*
* This document is licensed under the SGI Free Software B License Version
* 2.0. For details, see http://oss.sgi.com/projects/FreeB/ .
** Copyright (c) 2013 The Khronos Group Inc.
**
** Permission is hereby granted, free of charge, to any person obtaining a
** copy of this software and/or associated documentation files (the
** "Materials"), to deal in the Materials without restriction, including
** without limitation the rights to use, copy, modify, merge, publish,
** distribute, sublicense, and/or sell copies of the Materials, and to
** permit persons to whom the Materials are furnished to do so, subject to
** the following conditions:
**
** The above copyright notice and this permission notice shall be included
** in all copies or substantial portions of the Materials.
**
** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
*/
/*
** This header is generated from the Khronos OpenGL / OpenGL ES XML
** API Registry. The current version of the Registry, generator scripts
** used to make the header, and the header can be found at
** http://www.opengl.org/registry/
**
** Khronos $Revision: 24614 $ on $Date: 2013-12-30 04:44:46 -0800 (Mon, 30 Dec 2013) $
*/
#include <GLES2/gl2platform.h>
/* Generated on date 20131230 */
/* Generated C header for:
* API: gles2
* Profile: common
* Versions considered: 2\.[0-9]
* Versions emitted: .*
* Default extensions included: None
* Additional extensions included: _nomatch_^
* Extensions removed: _nomatch_^
*/
/*-------------------------------------------------------------------------
* Data type definitions
*-----------------------------------------------------------------------*/
typedef void GLvoid;
typedef char GLchar;
typedef unsigned int GLenum;
typedef unsigned char GLboolean;
typedef unsigned int GLbitfield;
typedef khronos_int8_t GLbyte;
typedef short GLshort;
typedef int GLint;
typedef int GLsizei;
typedef khronos_uint8_t GLubyte;
typedef unsigned short GLushort;
typedef unsigned int GLuint;
typedef khronos_float_t GLfloat;
typedef khronos_float_t GLclampf;
typedef khronos_int32_t GLfixed;
/* GL types for handling large vertex buffer objects */
#ifndef GL_ES_VERSION_2_0
#define GL_ES_VERSION_2_0 1
#include <KHR/khrplatform.h>
typedef khronos_int8_t GLbyte;
typedef khronos_float_t GLclampf;
typedef khronos_int32_t GLfixed;
typedef short GLshort;
typedef unsigned short GLushort;
typedef void GLvoid;
typedef struct __GLsync *GLsync;
typedef khronos_int64_t GLint64;
typedef khronos_uint64_t GLuint64;
typedef unsigned int GLenum;
typedef unsigned int GLuint;
typedef char GLchar;
typedef khronos_float_t GLfloat;
typedef khronos_ssize_t GLsizeiptr;
typedef khronos_intptr_t GLintptr;
typedef khronos_ssize_t GLsizeiptr;
/* OpenGL ES core versions */
#define GL_ES_VERSION_2_0 1
/* ClearBufferMask */
typedef unsigned int GLbitfield;
typedef int GLint;
typedef unsigned char GLboolean;
typedef int GLsizei;
typedef khronos_uint8_t GLubyte;
#define GL_DEPTH_BUFFER_BIT 0x00000100
#define GL_STENCIL_BUFFER_BIT 0x00000400
#define GL_COLOR_BUFFER_BIT 0x00004000
/* Boolean */
#define GL_FALSE 0
#define GL_TRUE 1
/* BeginMode */
#define GL_POINTS 0x0000
#define GL_LINES 0x0001
#define GL_LINE_LOOP 0x0002
@@ -58,18 +85,6 @@ typedef khronos_ssize_t GLsizeiptr;
#define GL_TRIANGLES 0x0004
#define GL_TRIANGLE_STRIP 0x0005
#define GL_TRIANGLE_FAN 0x0006
/* AlphaFunction (not supported in ES20) */
/* GL_NEVER */
/* GL_LESS */
/* GL_EQUAL */
/* GL_LEQUAL */
/* GL_GREATER */
/* GL_NOTEQUAL */
/* GL_GEQUAL */
/* GL_ALWAYS */
/* BlendingFactorDest */
#define GL_ZERO 0
#define GL_ONE 1
#define GL_SRC_COLOR 0x0300
@@ -78,29 +93,15 @@ typedef khronos_ssize_t GLsizeiptr;
#define GL_ONE_MINUS_SRC_ALPHA 0x0303
#define GL_DST_ALPHA 0x0304
#define GL_ONE_MINUS_DST_ALPHA 0x0305
/* BlendingFactorSrc */
/* GL_ZERO */
/* GL_ONE */
#define GL_DST_COLOR 0x0306
#define GL_ONE_MINUS_DST_COLOR 0x0307
#define GL_SRC_ALPHA_SATURATE 0x0308
/* GL_SRC_ALPHA */
/* GL_ONE_MINUS_SRC_ALPHA */
/* GL_DST_ALPHA */
/* GL_ONE_MINUS_DST_ALPHA */
/* BlendEquationSeparate */
#define GL_FUNC_ADD 0x8006
#define GL_BLEND_EQUATION 0x8009
#define GL_BLEND_EQUATION_RGB 0x8009 /* same as BLEND_EQUATION */
#define GL_BLEND_EQUATION_RGB 0x8009
#define GL_BLEND_EQUATION_ALPHA 0x883D
/* BlendSubtract */
#define GL_FUNC_SUBTRACT 0x800A
#define GL_FUNC_REVERSE_SUBTRACT 0x800B
/* Separate Blend Functions */
#define GL_BLEND_DST_RGB 0x80C8
#define GL_BLEND_SRC_RGB 0x80C9
#define GL_BLEND_DST_ALPHA 0x80CA
@@ -110,38 +111,19 @@ typedef khronos_ssize_t GLsizeiptr;
#define GL_CONSTANT_ALPHA 0x8003
#define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004
#define GL_BLEND_COLOR 0x8005
/* Buffer Objects */
#define GL_ARRAY_BUFFER 0x8892
#define GL_ELEMENT_ARRAY_BUFFER 0x8893
#define GL_ARRAY_BUFFER_BINDING 0x8894
#define GL_ELEMENT_ARRAY_BUFFER_BINDING 0x8895
#define GL_STREAM_DRAW 0x88E0
#define GL_STATIC_DRAW 0x88E4
#define GL_DYNAMIC_DRAW 0x88E8
#define GL_BUFFER_SIZE 0x8764
#define GL_BUFFER_USAGE 0x8765
#define GL_CURRENT_VERTEX_ATTRIB 0x8626
/* CullFaceMode */
#define GL_FRONT 0x0404
#define GL_BACK 0x0405
#define GL_FRONT_AND_BACK 0x0408
/* DepthFunction */
/* GL_NEVER */
/* GL_LESS */
/* GL_EQUAL */
/* GL_LEQUAL */
/* GL_GREATER */
/* GL_NOTEQUAL */
/* GL_GEQUAL */
/* GL_ALWAYS */
/* EnableCap */
#define GL_TEXTURE_2D 0x0DE1
#define GL_CULL_FACE 0x0B44
#define GL_BLEND 0x0BE2
@@ -152,19 +134,13 @@ typedef khronos_ssize_t GLsizeiptr;
#define GL_POLYGON_OFFSET_FILL 0x8037
#define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E
#define GL_SAMPLE_COVERAGE 0x80A0
/* ErrorCode */
#define GL_NO_ERROR 0
#define GL_INVALID_ENUM 0x0500
#define GL_INVALID_VALUE 0x0501
#define GL_INVALID_OPERATION 0x0502
#define GL_OUT_OF_MEMORY 0x0505
/* FrontFaceDirection */
#define GL_CW 0x0900
#define GL_CCW 0x0901
/* GetPName */
#define GL_LINE_WIDTH 0x0B21
#define GL_ALIASED_POINT_SIZE_RANGE 0x846D
#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E
@@ -191,7 +167,6 @@ typedef khronos_ssize_t GLsizeiptr;
#define GL_STENCIL_BACK_WRITEMASK 0x8CA5
#define GL_VIEWPORT 0x0BA2
#define GL_SCISSOR_BOX 0x0C10
/* GL_SCISSOR_TEST */
#define GL_COLOR_CLEAR_VALUE 0x0C22
#define GL_COLOR_WRITEMASK 0x0C23
#define GL_UNPACK_ALIGNMENT 0x0CF5
@@ -206,32 +181,18 @@ typedef khronos_ssize_t GLsizeiptr;
#define GL_DEPTH_BITS 0x0D56
#define GL_STENCIL_BITS 0x0D57
#define GL_POLYGON_OFFSET_UNITS 0x2A00
/* GL_POLYGON_OFFSET_FILL */
#define GL_POLYGON_OFFSET_FACTOR 0x8038
#define GL_TEXTURE_BINDING_2D 0x8069
#define GL_SAMPLE_BUFFERS 0x80A8
#define GL_SAMPLES 0x80A9
#define GL_SAMPLE_COVERAGE_VALUE 0x80AA
#define GL_SAMPLE_COVERAGE_INVERT 0x80AB
/* GetTextureParameter */
/* GL_TEXTURE_MAG_FILTER */
/* GL_TEXTURE_MIN_FILTER */
/* GL_TEXTURE_WRAP_S */
/* GL_TEXTURE_WRAP_T */
#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2
#define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3
/* HintMode */
#define GL_DONT_CARE 0x1100
#define GL_FASTEST 0x1101
#define GL_NICEST 0x1102
/* HintTarget */
#define GL_GENERATE_MIPMAP_HINT 0x8192
/* DataType */
#define GL_GENERATE_MIPMAP_HINT 0x8192
#define GL_BYTE 0x1400
#define GL_UNSIGNED_BYTE 0x1401
#define GL_SHORT 0x1402
@@ -240,44 +201,35 @@ typedef khronos_ssize_t GLsizeiptr;
#define GL_UNSIGNED_INT 0x1405
#define GL_FLOAT 0x1406
#define GL_FIXED 0x140C
/* PixelFormat */
#define GL_DEPTH_COMPONENT 0x1902
#define GL_ALPHA 0x1906
#define GL_RGB 0x1907
#define GL_RGBA 0x1908
#define GL_LUMINANCE 0x1909
#define GL_LUMINANCE_ALPHA 0x190A
/* PixelType */
/* GL_UNSIGNED_BYTE */
#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033
#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034
#define GL_UNSIGNED_SHORT_5_6_5 0x8363
/* Shaders */
#define GL_FRAGMENT_SHADER 0x8B30
#define GL_VERTEX_SHADER 0x8B31
#define GL_MAX_VERTEX_ATTRIBS 0x8869
#define GL_MAX_VERTEX_UNIFORM_VECTORS 0x8DFB
#define GL_MAX_VARYING_VECTORS 0x8DFC
#define GL_FRAGMENT_SHADER 0x8B30
#define GL_VERTEX_SHADER 0x8B31
#define GL_MAX_VERTEX_ATTRIBS 0x8869
#define GL_MAX_VERTEX_UNIFORM_VECTORS 0x8DFB
#define GL_MAX_VARYING_VECTORS 0x8DFC
#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS 0x8B4D
#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS 0x8B4C
#define GL_MAX_TEXTURE_IMAGE_UNITS 0x8872
#define GL_MAX_FRAGMENT_UNIFORM_VECTORS 0x8DFD
#define GL_SHADER_TYPE 0x8B4F
#define GL_DELETE_STATUS 0x8B80
#define GL_LINK_STATUS 0x8B82
#define GL_VALIDATE_STATUS 0x8B83
#define GL_ATTACHED_SHADERS 0x8B85
#define GL_ACTIVE_UNIFORMS 0x8B86
#define GL_ACTIVE_UNIFORM_MAX_LENGTH 0x8B87
#define GL_ACTIVE_ATTRIBUTES 0x8B89
#define GL_ACTIVE_ATTRIBUTE_MAX_LENGTH 0x8B8A
#define GL_SHADING_LANGUAGE_VERSION 0x8B8C
#define GL_CURRENT_PROGRAM 0x8B8D
/* StencilFunction */
#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS 0x8B4C
#define GL_MAX_TEXTURE_IMAGE_UNITS 0x8872
#define GL_MAX_FRAGMENT_UNIFORM_VECTORS 0x8DFD
#define GL_SHADER_TYPE 0x8B4F
#define GL_DELETE_STATUS 0x8B80
#define GL_LINK_STATUS 0x8B82
#define GL_VALIDATE_STATUS 0x8B83
#define GL_ATTACHED_SHADERS 0x8B85
#define GL_ACTIVE_UNIFORMS 0x8B86
#define GL_ACTIVE_UNIFORM_MAX_LENGTH 0x8B87
#define GL_ACTIVE_ATTRIBUTES 0x8B89
#define GL_ACTIVE_ATTRIBUTE_MAX_LENGTH 0x8B8A
#define GL_SHADING_LANGUAGE_VERSION 0x8B8C
#define GL_CURRENT_PROGRAM 0x8B8D
#define GL_NEVER 0x0200
#define GL_LESS 0x0201
#define GL_EQUAL 0x0202
@@ -286,9 +238,6 @@ typedef khronos_ssize_t GLsizeiptr;
#define GL_NOTEQUAL 0x0205
#define GL_GEQUAL 0x0206
#define GL_ALWAYS 0x0207
/* StencilOp */
/* GL_ZERO */
#define GL_KEEP 0x1E00
#define GL_REPLACE 0x1E01
#define GL_INCR 0x1E02
@@ -296,35 +245,21 @@ typedef khronos_ssize_t GLsizeiptr;
#define GL_INVERT 0x150A
#define GL_INCR_WRAP 0x8507
#define GL_DECR_WRAP 0x8508
/* StringName */
#define GL_VENDOR 0x1F00
#define GL_RENDERER 0x1F01
#define GL_VERSION 0x1F02
#define GL_EXTENSIONS 0x1F03
/* TextureMagFilter */
#define GL_NEAREST 0x2600
#define GL_LINEAR 0x2601
/* TextureMinFilter */
/* GL_NEAREST */
/* GL_LINEAR */
#define GL_NEAREST_MIPMAP_NEAREST 0x2700
#define GL_LINEAR_MIPMAP_NEAREST 0x2701
#define GL_NEAREST_MIPMAP_LINEAR 0x2702
#define GL_LINEAR_MIPMAP_LINEAR 0x2703
/* TextureParameterName */
#define GL_TEXTURE_MAG_FILTER 0x2800
#define GL_TEXTURE_MIN_FILTER 0x2801
#define GL_TEXTURE_WRAP_S 0x2802
#define GL_TEXTURE_WRAP_T 0x2803
/* TextureTarget */
/* GL_TEXTURE_2D */
#define GL_TEXTURE 0x1702
#define GL_TEXTURE_CUBE_MAP 0x8513
#define GL_TEXTURE_BINDING_CUBE_MAP 0x8514
#define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515
@@ -334,8 +269,6 @@ typedef khronos_ssize_t GLsizeiptr;
#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519
#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A
#define GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C
/* TextureUnit */
#define GL_TEXTURE0 0x84C0
#define GL_TEXTURE1 0x84C1
#define GL_TEXTURE2 0x84C2
@@ -369,13 +302,9 @@ typedef khronos_ssize_t GLsizeiptr;
#define GL_TEXTURE30 0x84DE
#define GL_TEXTURE31 0x84DF
#define GL_ACTIVE_TEXTURE 0x84E0
/* TextureWrapMode */
#define GL_REPEAT 0x2901
#define GL_CLAMP_TO_EDGE 0x812F
#define GL_MIRRORED_REPEAT 0x8370
/* Uniform Types */
#define GL_FLOAT_VEC2 0x8B50
#define GL_FLOAT_VEC3 0x8B51
#define GL_FLOAT_VEC4 0x8B52
@@ -391,48 +320,34 @@ typedef khronos_ssize_t GLsizeiptr;
#define GL_FLOAT_MAT4 0x8B5C
#define GL_SAMPLER_2D 0x8B5E
#define GL_SAMPLER_CUBE 0x8B60
/* Vertex Arrays */
#define GL_VERTEX_ATTRIB_ARRAY_ENABLED 0x8622
#define GL_VERTEX_ATTRIB_ARRAY_SIZE 0x8623
#define GL_VERTEX_ATTRIB_ARRAY_STRIDE 0x8624
#define GL_VERTEX_ATTRIB_ARRAY_TYPE 0x8625
#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED 0x886A
#define GL_VERTEX_ATTRIB_ARRAY_POINTER 0x8645
#define GL_VERTEX_ATTRIB_ARRAY_ENABLED 0x8622
#define GL_VERTEX_ATTRIB_ARRAY_SIZE 0x8623
#define GL_VERTEX_ATTRIB_ARRAY_STRIDE 0x8624
#define GL_VERTEX_ATTRIB_ARRAY_TYPE 0x8625
#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED 0x886A
#define GL_VERTEX_ATTRIB_ARRAY_POINTER 0x8645
#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING 0x889F
/* Read Format */
#define GL_IMPLEMENTATION_COLOR_READ_TYPE 0x8B9A
#define GL_IMPLEMENTATION_COLOR_READ_TYPE 0x8B9A
#define GL_IMPLEMENTATION_COLOR_READ_FORMAT 0x8B9B
/* Shader Source */
#define GL_COMPILE_STATUS 0x8B81
#define GL_INFO_LOG_LENGTH 0x8B84
#define GL_SHADER_SOURCE_LENGTH 0x8B88
#define GL_SHADER_COMPILER 0x8DFA
/* Shader Binary */
#define GL_SHADER_BINARY_FORMATS 0x8DF8
#define GL_NUM_SHADER_BINARY_FORMATS 0x8DF9
/* Shader Precision-Specified Types */
#define GL_LOW_FLOAT 0x8DF0
#define GL_MEDIUM_FLOAT 0x8DF1
#define GL_HIGH_FLOAT 0x8DF2
#define GL_LOW_INT 0x8DF3
#define GL_MEDIUM_INT 0x8DF4
#define GL_HIGH_INT 0x8DF5
/* Framebuffer Object. */
#define GL_FRAMEBUFFER 0x8D40
#define GL_RENDERBUFFER 0x8D41
#define GL_RGBA4 0x8056
#define GL_RGB5_A1 0x8057
#define GL_RGB565 0x8D62
#define GL_DEPTH_COMPONENT16 0x81A5
#define GL_STENCIL_INDEX8 0x8D48
#define GL_RENDERBUFFER_WIDTH 0x8D42
#define GL_RENDERBUFFER_HEIGHT 0x8D43
#define GL_RENDERBUFFER_INTERNAL_FORMAT 0x8D44
@@ -442,179 +357,169 @@ typedef khronos_ssize_t GLsizeiptr;
#define GL_RENDERBUFFER_ALPHA_SIZE 0x8D53
#define GL_RENDERBUFFER_DEPTH_SIZE 0x8D54
#define GL_RENDERBUFFER_STENCIL_SIZE 0x8D55
#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE 0x8CD0
#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME 0x8CD1
#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL 0x8CD2
#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE 0x8CD0
#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME 0x8CD1
#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL 0x8CD2
#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE 0x8CD3
#define GL_COLOR_ATTACHMENT0 0x8CE0
#define GL_DEPTH_ATTACHMENT 0x8D00
#define GL_STENCIL_ATTACHMENT 0x8D20
#define GL_NONE 0
#define GL_FRAMEBUFFER_COMPLETE 0x8CD5
#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT 0x8CD6
#define GL_FRAMEBUFFER_COMPLETE 0x8CD5
#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT 0x8CD6
#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT 0x8CD7
#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS 0x8CD9
#define GL_FRAMEBUFFER_UNSUPPORTED 0x8CDD
#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS 0x8CD9
#define GL_FRAMEBUFFER_UNSUPPORTED 0x8CDD
#define GL_FRAMEBUFFER_BINDING 0x8CA6
#define GL_RENDERBUFFER_BINDING 0x8CA7
#define GL_MAX_RENDERBUFFER_SIZE 0x84E8
#define GL_INVALID_FRAMEBUFFER_OPERATION 0x0506
/*-------------------------------------------------------------------------
* GL core functions.
*-----------------------------------------------------------------------*/
GL_APICALL void GL_APIENTRY glActiveTexture (GLenum texture);
GL_APICALL void GL_APIENTRY glAttachShader (GLuint program, GLuint shader);
GL_APICALL void GL_APIENTRY glBindAttribLocation (GLuint program, GLuint index, const GLchar* name);
GL_APICALL void GL_APIENTRY glBindBuffer (GLenum target, GLuint buffer);
GL_APICALL void GL_APIENTRY glBindFramebuffer (GLenum target, GLuint framebuffer);
GL_APICALL void GL_APIENTRY glBindRenderbuffer (GLenum target, GLuint renderbuffer);
GL_APICALL void GL_APIENTRY glBindTexture (GLenum target, GLuint texture);
GL_APICALL void GL_APIENTRY glBlendColor (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
GL_APICALL void GL_APIENTRY glBlendEquation ( GLenum mode );
GL_APICALL void GL_APIENTRY glBlendEquationSeparate (GLenum modeRGB, GLenum modeAlpha);
GL_APICALL void GL_APIENTRY glBlendFunc (GLenum sfactor, GLenum dfactor);
GL_APICALL void GL_APIENTRY glBlendFuncSeparate (GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
GL_APICALL void GL_APIENTRY glBufferData (GLenum target, GLsizeiptr size, const GLvoid* data, GLenum usage);
GL_APICALL void GL_APIENTRY glBufferSubData (GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid* data);
GL_APICALL GLenum GL_APIENTRY glCheckFramebufferStatus (GLenum target);
GL_APICALL void GL_APIENTRY glClear (GLbitfield mask);
GL_APICALL void GL_APIENTRY glClearColor (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
GL_APICALL void GL_APIENTRY glClearDepthf (GLclampf depth);
GL_APICALL void GL_APIENTRY glClearStencil (GLint s);
GL_APICALL void GL_APIENTRY glColorMask (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
GL_APICALL void GL_APIENTRY glCompileShader (GLuint shader);
GL_APICALL void GL_APIENTRY glCompressedTexImage2D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid* data);
GL_APICALL void GL_APIENTRY glCompressedTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid* data);
GL_APICALL void GL_APIENTRY glCopyTexImage2D (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
GL_APICALL void GL_APIENTRY glCopyTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
GL_APICALL GLuint GL_APIENTRY glCreateProgram (void);
GL_APICALL GLuint GL_APIENTRY glCreateShader (GLenum type);
GL_APICALL void GL_APIENTRY glCullFace (GLenum mode);
GL_APICALL void GL_APIENTRY glDeleteBuffers (GLsizei n, const GLuint* buffers);
GL_APICALL void GL_APIENTRY glDeleteFramebuffers (GLsizei n, const GLuint* framebuffers);
GL_APICALL void GL_APIENTRY glDeleteProgram (GLuint program);
GL_APICALL void GL_APIENTRY glDeleteRenderbuffers (GLsizei n, const GLuint* renderbuffers);
GL_APICALL void GL_APIENTRY glDeleteShader (GLuint shader);
GL_APICALL void GL_APIENTRY glDeleteTextures (GLsizei n, const GLuint* textures);
GL_APICALL void GL_APIENTRY glDepthFunc (GLenum func);
GL_APICALL void GL_APIENTRY glDepthMask (GLboolean flag);
GL_APICALL void GL_APIENTRY glDepthRangef (GLclampf zNear, GLclampf zFar);
GL_APICALL void GL_APIENTRY glDetachShader (GLuint program, GLuint shader);
GL_APICALL void GL_APIENTRY glDisable (GLenum cap);
GL_APICALL void GL_APIENTRY glDisableVertexAttribArray (GLuint index);
GL_APICALL void GL_APIENTRY glDrawArrays (GLenum mode, GLint first, GLsizei count);
GL_APICALL void GL_APIENTRY glDrawElements (GLenum mode, GLsizei count, GLenum type, const GLvoid* indices);
GL_APICALL void GL_APIENTRY glEnable (GLenum cap);
GL_APICALL void GL_APIENTRY glEnableVertexAttribArray (GLuint index);
GL_APICALL void GL_APIENTRY glFinish (void);
GL_APICALL void GL_APIENTRY glFlush (void);
GL_APICALL void GL_APIENTRY glFramebufferRenderbuffer (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
GL_APICALL void GL_APIENTRY glFramebufferTexture2D (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
GL_APICALL void GL_APIENTRY glFrontFace (GLenum mode);
GL_APICALL void GL_APIENTRY glGenBuffers (GLsizei n, GLuint* buffers);
GL_APICALL void GL_APIENTRY glGenerateMipmap (GLenum target);
GL_APICALL void GL_APIENTRY glGenFramebuffers (GLsizei n, GLuint* framebuffers);
GL_APICALL void GL_APIENTRY glGenRenderbuffers (GLsizei n, GLuint* renderbuffers);
GL_APICALL void GL_APIENTRY glGenTextures (GLsizei n, GLuint* textures);
GL_APICALL void GL_APIENTRY glGetActiveAttrib (GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar* name);
GL_APICALL void GL_APIENTRY glGetActiveUniform (GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar* name);
GL_APICALL void GL_APIENTRY glGetAttachedShaders (GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders);
GL_APICALL GLint GL_APIENTRY glGetAttribLocation (GLuint program, const GLchar* name);
GL_APICALL void GL_APIENTRY glGetBooleanv (GLenum pname, GLboolean* params);
GL_APICALL void GL_APIENTRY glGetBufferParameteriv (GLenum target, GLenum pname, GLint* params);
GL_APICALL GLenum GL_APIENTRY glGetError (void);
GL_APICALL void GL_APIENTRY glGetFloatv (GLenum pname, GLfloat* params);
GL_APICALL void GL_APIENTRY glGetFramebufferAttachmentParameteriv (GLenum target, GLenum attachment, GLenum pname, GLint* params);
GL_APICALL void GL_APIENTRY glGetIntegerv (GLenum pname, GLint* params);
GL_APICALL void GL_APIENTRY glGetProgramiv (GLuint program, GLenum pname, GLint* params);
GL_APICALL void GL_APIENTRY glGetProgramInfoLog (GLuint program, GLsizei bufsize, GLsizei* length, GLchar* infolog);
GL_APICALL void GL_APIENTRY glGetRenderbufferParameteriv (GLenum target, GLenum pname, GLint* params);
GL_APICALL void GL_APIENTRY glGetShaderiv (GLuint shader, GLenum pname, GLint* params);
GL_APICALL void GL_APIENTRY glGetShaderInfoLog (GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* infolog);
GL_APICALL void GL_APIENTRY glGetShaderPrecisionFormat (GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision);
GL_APICALL void GL_APIENTRY glGetShaderSource (GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* source);
GL_APICALL const GLubyte* GL_APIENTRY glGetString (GLenum name);
GL_APICALL void GL_APIENTRY glGetTexParameterfv (GLenum target, GLenum pname, GLfloat* params);
GL_APICALL void GL_APIENTRY glGetTexParameteriv (GLenum target, GLenum pname, GLint* params);
GL_APICALL void GL_APIENTRY glGetUniformfv (GLuint program, GLint location, GLfloat* params);
GL_APICALL void GL_APIENTRY glGetUniformiv (GLuint program, GLint location, GLint* params);
GL_APICALL GLint GL_APIENTRY glGetUniformLocation (GLuint program, const GLchar* name);
GL_APICALL void GL_APIENTRY glGetVertexAttribfv (GLuint index, GLenum pname, GLfloat* params);
GL_APICALL void GL_APIENTRY glGetVertexAttribiv (GLuint index, GLenum pname, GLint* params);
GL_APICALL void GL_APIENTRY glGetVertexAttribPointerv (GLuint index, GLenum pname, GLvoid** pointer);
GL_APICALL void GL_APIENTRY glHint (GLenum target, GLenum mode);
GL_APICALL GLboolean GL_APIENTRY glIsBuffer (GLuint buffer);
GL_APICALL GLboolean GL_APIENTRY glIsEnabled (GLenum cap);
GL_APICALL GLboolean GL_APIENTRY glIsFramebuffer (GLuint framebuffer);
GL_APICALL GLboolean GL_APIENTRY glIsProgram (GLuint program);
GL_APICALL GLboolean GL_APIENTRY glIsRenderbuffer (GLuint renderbuffer);
GL_APICALL GLboolean GL_APIENTRY glIsShader (GLuint shader);
GL_APICALL GLboolean GL_APIENTRY glIsTexture (GLuint texture);
GL_APICALL void GL_APIENTRY glLineWidth (GLfloat width);
GL_APICALL void GL_APIENTRY glLinkProgram (GLuint program);
GL_APICALL void GL_APIENTRY glPixelStorei (GLenum pname, GLint param);
GL_APICALL void GL_APIENTRY glPolygonOffset (GLfloat factor, GLfloat units);
GL_APICALL void GL_APIENTRY glReadPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid* pixels);
GL_APICALL void GL_APIENTRY glReleaseShaderCompiler (void);
GL_APICALL void GL_APIENTRY glRenderbufferStorage (GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
GL_APICALL void GL_APIENTRY glSampleCoverage (GLclampf value, GLboolean invert);
GL_APICALL void GL_APIENTRY glScissor (GLint x, GLint y, GLsizei width, GLsizei height);
GL_APICALL void GL_APIENTRY glShaderBinary (GLsizei n, const GLuint* shaders, GLenum binaryformat, const GLvoid* binary, GLsizei length);
GL_APICALL void GL_APIENTRY glShaderSource (GLuint shader, GLsizei count, const GLchar* const* string, const GLint* length);
GL_APICALL void GL_APIENTRY glStencilFunc (GLenum func, GLint ref, GLuint mask);
GL_APICALL void GL_APIENTRY glStencilFuncSeparate (GLenum face, GLenum func, GLint ref, GLuint mask);
GL_APICALL void GL_APIENTRY glStencilMask (GLuint mask);
GL_APICALL void GL_APIENTRY glStencilMaskSeparate (GLenum face, GLuint mask);
GL_APICALL void GL_APIENTRY glStencilOp (GLenum fail, GLenum zfail, GLenum zpass);
GL_APICALL void GL_APIENTRY glStencilOpSeparate (GLenum face, GLenum fail, GLenum zfail, GLenum zpass);
GL_APICALL void GL_APIENTRY glTexImage2D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid* pixels);
GL_APICALL void GL_APIENTRY glTexParameterf (GLenum target, GLenum pname, GLfloat param);
GL_APICALL void GL_APIENTRY glTexParameterfv (GLenum target, GLenum pname, const GLfloat* params);
GL_APICALL void GL_APIENTRY glTexParameteri (GLenum target, GLenum pname, GLint param);
GL_APICALL void GL_APIENTRY glTexParameteriv (GLenum target, GLenum pname, const GLint* params);
GL_APICALL void GL_APIENTRY glTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid* pixels);
GL_APICALL void GL_APIENTRY glUniform1f (GLint location, GLfloat x);
GL_APICALL void GL_APIENTRY glUniform1fv (GLint location, GLsizei count, const GLfloat* v);
GL_APICALL void GL_APIENTRY glUniform1i (GLint location, GLint x);
GL_APICALL void GL_APIENTRY glUniform1iv (GLint location, GLsizei count, const GLint* v);
GL_APICALL void GL_APIENTRY glUniform2f (GLint location, GLfloat x, GLfloat y);
GL_APICALL void GL_APIENTRY glUniform2fv (GLint location, GLsizei count, const GLfloat* v);
GL_APICALL void GL_APIENTRY glUniform2i (GLint location, GLint x, GLint y);
GL_APICALL void GL_APIENTRY glUniform2iv (GLint location, GLsizei count, const GLint* v);
GL_APICALL void GL_APIENTRY glUniform3f (GLint location, GLfloat x, GLfloat y, GLfloat z);
GL_APICALL void GL_APIENTRY glUniform3fv (GLint location, GLsizei count, const GLfloat* v);
GL_APICALL void GL_APIENTRY glUniform3i (GLint location, GLint x, GLint y, GLint z);
GL_APICALL void GL_APIENTRY glUniform3iv (GLint location, GLsizei count, const GLint* v);
GL_APICALL void GL_APIENTRY glUniform4f (GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
GL_APICALL void GL_APIENTRY glUniform4fv (GLint location, GLsizei count, const GLfloat* v);
GL_APICALL void GL_APIENTRY glUniform4i (GLint location, GLint x, GLint y, GLint z, GLint w);
GL_APICALL void GL_APIENTRY glUniform4iv (GLint location, GLsizei count, const GLint* v);
GL_APICALL void GL_APIENTRY glUniformMatrix2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
GL_APICALL void GL_APIENTRY glUniformMatrix3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
GL_APICALL void GL_APIENTRY glUniformMatrix4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
GL_APICALL void GL_APIENTRY glUseProgram (GLuint program);
GL_APICALL void GL_APIENTRY glValidateProgram (GLuint program);
GL_APICALL void GL_APIENTRY glVertexAttrib1f (GLuint indx, GLfloat x);
GL_APICALL void GL_APIENTRY glVertexAttrib1fv (GLuint indx, const GLfloat* values);
GL_APICALL void GL_APIENTRY glVertexAttrib2f (GLuint indx, GLfloat x, GLfloat y);
GL_APICALL void GL_APIENTRY glVertexAttrib2fv (GLuint indx, const GLfloat* values);
GL_APICALL void GL_APIENTRY glVertexAttrib3f (GLuint indx, GLfloat x, GLfloat y, GLfloat z);
GL_APICALL void GL_APIENTRY glVertexAttrib3fv (GLuint indx, const GLfloat* values);
GL_APICALL void GL_APIENTRY glVertexAttrib4f (GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
GL_APICALL void GL_APIENTRY glVertexAttrib4fv (GLuint indx, const GLfloat* values);
GL_APICALL void GL_APIENTRY glVertexAttribPointer (GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid* ptr);
GL_APICALL void GL_APIENTRY glViewport (GLint x, GLint y, GLsizei width, GLsizei height);
GL_APICALL void GL_APIENTRY glActiveTexture (GLenum texture);
GL_APICALL void GL_APIENTRY glAttachShader (GLuint program, GLuint shader);
GL_APICALL void GL_APIENTRY glBindAttribLocation (GLuint program, GLuint index, const GLchar *name);
GL_APICALL void GL_APIENTRY glBindBuffer (GLenum target, GLuint buffer);
GL_APICALL void GL_APIENTRY glBindFramebuffer (GLenum target, GLuint framebuffer);
GL_APICALL void GL_APIENTRY glBindRenderbuffer (GLenum target, GLuint renderbuffer);
GL_APICALL void GL_APIENTRY glBindTexture (GLenum target, GLuint texture);
GL_APICALL void GL_APIENTRY glBlendColor (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
GL_APICALL void GL_APIENTRY glBlendEquation (GLenum mode);
GL_APICALL void GL_APIENTRY glBlendEquationSeparate (GLenum modeRGB, GLenum modeAlpha);
GL_APICALL void GL_APIENTRY glBlendFunc (GLenum sfactor, GLenum dfactor);
GL_APICALL void GL_APIENTRY glBlendFuncSeparate (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
GL_APICALL void GL_APIENTRY glBufferData (GLenum target, GLsizeiptr size, const void *data, GLenum usage);
GL_APICALL void GL_APIENTRY glBufferSubData (GLenum target, GLintptr offset, GLsizeiptr size, const void *data);
GL_APICALL GLenum GL_APIENTRY glCheckFramebufferStatus (GLenum target);
GL_APICALL void GL_APIENTRY glClear (GLbitfield mask);
GL_APICALL void GL_APIENTRY glClearColor (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
GL_APICALL void GL_APIENTRY glClearDepthf (GLfloat d);
GL_APICALL void GL_APIENTRY glClearStencil (GLint s);
GL_APICALL void GL_APIENTRY glColorMask (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
GL_APICALL void GL_APIENTRY glCompileShader (GLuint shader);
GL_APICALL void GL_APIENTRY glCompressedTexImage2D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *data);
GL_APICALL void GL_APIENTRY glCompressedTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data);
GL_APICALL void GL_APIENTRY glCopyTexImage2D (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
GL_APICALL void GL_APIENTRY glCopyTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
GL_APICALL GLuint GL_APIENTRY glCreateProgram (void);
GL_APICALL GLuint GL_APIENTRY glCreateShader (GLenum type);
GL_APICALL void GL_APIENTRY glCullFace (GLenum mode);
GL_APICALL void GL_APIENTRY glDeleteBuffers (GLsizei n, const GLuint *buffers);
GL_APICALL void GL_APIENTRY glDeleteFramebuffers (GLsizei n, const GLuint *framebuffers);
GL_APICALL void GL_APIENTRY glDeleteProgram (GLuint program);
GL_APICALL void GL_APIENTRY glDeleteRenderbuffers (GLsizei n, const GLuint *renderbuffers);
GL_APICALL void GL_APIENTRY glDeleteShader (GLuint shader);
GL_APICALL void GL_APIENTRY glDeleteTextures (GLsizei n, const GLuint *textures);
GL_APICALL void GL_APIENTRY glDepthFunc (GLenum func);
GL_APICALL void GL_APIENTRY glDepthMask (GLboolean flag);
GL_APICALL void GL_APIENTRY glDepthRangef (GLfloat n, GLfloat f);
GL_APICALL void GL_APIENTRY glDetachShader (GLuint program, GLuint shader);
GL_APICALL void GL_APIENTRY glDisable (GLenum cap);
GL_APICALL void GL_APIENTRY glDisableVertexAttribArray (GLuint index);
GL_APICALL void GL_APIENTRY glDrawArrays (GLenum mode, GLint first, GLsizei count);
GL_APICALL void GL_APIENTRY glDrawElements (GLenum mode, GLsizei count, GLenum type, const void *indices);
GL_APICALL void GL_APIENTRY glEnable (GLenum cap);
GL_APICALL void GL_APIENTRY glEnableVertexAttribArray (GLuint index);
GL_APICALL void GL_APIENTRY glFinish (void);
GL_APICALL void GL_APIENTRY glFlush (void);
GL_APICALL void GL_APIENTRY glFramebufferRenderbuffer (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
GL_APICALL void GL_APIENTRY glFramebufferTexture2D (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
GL_APICALL void GL_APIENTRY glFrontFace (GLenum mode);
GL_APICALL void GL_APIENTRY glGenBuffers (GLsizei n, GLuint *buffers);
GL_APICALL void GL_APIENTRY glGenerateMipmap (GLenum target);
GL_APICALL void GL_APIENTRY glGenFramebuffers (GLsizei n, GLuint *framebuffers);
GL_APICALL void GL_APIENTRY glGenRenderbuffers (GLsizei n, GLuint *renderbuffers);
GL_APICALL void GL_APIENTRY glGenTextures (GLsizei n, GLuint *textures);
GL_APICALL void GL_APIENTRY glGetActiveAttrib (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name);
GL_APICALL void GL_APIENTRY glGetActiveUniform (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name);
GL_APICALL void GL_APIENTRY glGetAttachedShaders (GLuint program, GLsizei maxCount, GLsizei *count, GLuint *shaders);
GL_APICALL GLint GL_APIENTRY glGetAttribLocation (GLuint program, const GLchar *name);
GL_APICALL void GL_APIENTRY glGetBooleanv (GLenum pname, GLboolean *data);
GL_APICALL void GL_APIENTRY glGetBufferParameteriv (GLenum target, GLenum pname, GLint *params);
GL_APICALL GLenum GL_APIENTRY glGetError (void);
GL_APICALL void GL_APIENTRY glGetFloatv (GLenum pname, GLfloat *data);
GL_APICALL void GL_APIENTRY glGetFramebufferAttachmentParameteriv (GLenum target, GLenum attachment, GLenum pname, GLint *params);
GL_APICALL void GL_APIENTRY glGetIntegerv (GLenum pname, GLint *data);
GL_APICALL void GL_APIENTRY glGetProgramiv (GLuint program, GLenum pname, GLint *params);
GL_APICALL void GL_APIENTRY glGetProgramInfoLog (GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
GL_APICALL void GL_APIENTRY glGetRenderbufferParameteriv (GLenum target, GLenum pname, GLint *params);
GL_APICALL void GL_APIENTRY glGetShaderiv (GLuint shader, GLenum pname, GLint *params);
GL_APICALL void GL_APIENTRY glGetShaderInfoLog (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
GL_APICALL void GL_APIENTRY glGetShaderPrecisionFormat (GLenum shadertype, GLenum precisiontype, GLint *range, GLint *precision);
GL_APICALL void GL_APIENTRY glGetShaderSource (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source);
GL_APICALL const GLubyte *GL_APIENTRY glGetString (GLenum name);
GL_APICALL void GL_APIENTRY glGetTexParameterfv (GLenum target, GLenum pname, GLfloat *params);
GL_APICALL void GL_APIENTRY glGetTexParameteriv (GLenum target, GLenum pname, GLint *params);
GL_APICALL void GL_APIENTRY glGetUniformfv (GLuint program, GLint location, GLfloat *params);
GL_APICALL void GL_APIENTRY glGetUniformiv (GLuint program, GLint location, GLint *params);
GL_APICALL GLint GL_APIENTRY glGetUniformLocation (GLuint program, const GLchar *name);
GL_APICALL void GL_APIENTRY glGetVertexAttribfv (GLuint index, GLenum pname, GLfloat *params);
GL_APICALL void GL_APIENTRY glGetVertexAttribiv (GLuint index, GLenum pname, GLint *params);
GL_APICALL void GL_APIENTRY glGetVertexAttribPointerv (GLuint index, GLenum pname, void **pointer);
GL_APICALL void GL_APIENTRY glHint (GLenum target, GLenum mode);
GL_APICALL GLboolean GL_APIENTRY glIsBuffer (GLuint buffer);
GL_APICALL GLboolean GL_APIENTRY glIsEnabled (GLenum cap);
GL_APICALL GLboolean GL_APIENTRY glIsFramebuffer (GLuint framebuffer);
GL_APICALL GLboolean GL_APIENTRY glIsProgram (GLuint program);
GL_APICALL GLboolean GL_APIENTRY glIsRenderbuffer (GLuint renderbuffer);
GL_APICALL GLboolean GL_APIENTRY glIsShader (GLuint shader);
GL_APICALL GLboolean GL_APIENTRY glIsTexture (GLuint texture);
GL_APICALL void GL_APIENTRY glLineWidth (GLfloat width);
GL_APICALL void GL_APIENTRY glLinkProgram (GLuint program);
GL_APICALL void GL_APIENTRY glPixelStorei (GLenum pname, GLint param);
GL_APICALL void GL_APIENTRY glPolygonOffset (GLfloat factor, GLfloat units);
GL_APICALL void GL_APIENTRY glReadPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void *pixels);
GL_APICALL void GL_APIENTRY glReleaseShaderCompiler (void);
GL_APICALL void GL_APIENTRY glRenderbufferStorage (GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
GL_APICALL void GL_APIENTRY glSampleCoverage (GLfloat value, GLboolean invert);
GL_APICALL void GL_APIENTRY glScissor (GLint x, GLint y, GLsizei width, GLsizei height);
GL_APICALL void GL_APIENTRY glShaderBinary (GLsizei count, const GLuint *shaders, GLenum binaryformat, const void *binary, GLsizei length);
GL_APICALL void GL_APIENTRY glShaderSource (GLuint shader, GLsizei count, const GLchar *const*string, const GLint *length);
GL_APICALL void GL_APIENTRY glStencilFunc (GLenum func, GLint ref, GLuint mask);
GL_APICALL void GL_APIENTRY glStencilFuncSeparate (GLenum face, GLenum func, GLint ref, GLuint mask);
GL_APICALL void GL_APIENTRY glStencilMask (GLuint mask);
GL_APICALL void GL_APIENTRY glStencilMaskSeparate (GLenum face, GLuint mask);
GL_APICALL void GL_APIENTRY glStencilOp (GLenum fail, GLenum zfail, GLenum zpass);
GL_APICALL void GL_APIENTRY glStencilOpSeparate (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass);
GL_APICALL void GL_APIENTRY glTexImage2D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void *pixels);
GL_APICALL void GL_APIENTRY glTexParameterf (GLenum target, GLenum pname, GLfloat param);
GL_APICALL void GL_APIENTRY glTexParameterfv (GLenum target, GLenum pname, const GLfloat *params);
GL_APICALL void GL_APIENTRY glTexParameteri (GLenum target, GLenum pname, GLint param);
GL_APICALL void GL_APIENTRY glTexParameteriv (GLenum target, GLenum pname, const GLint *params);
GL_APICALL void GL_APIENTRY glTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels);
GL_APICALL void GL_APIENTRY glUniform1f (GLint location, GLfloat v0);
GL_APICALL void GL_APIENTRY glUniform1fv (GLint location, GLsizei count, const GLfloat *value);
GL_APICALL void GL_APIENTRY glUniform1i (GLint location, GLint v0);
GL_APICALL void GL_APIENTRY glUniform1iv (GLint location, GLsizei count, const GLint *value);
GL_APICALL void GL_APIENTRY glUniform2f (GLint location, GLfloat v0, GLfloat v1);
GL_APICALL void GL_APIENTRY glUniform2fv (GLint location, GLsizei count, const GLfloat *value);
GL_APICALL void GL_APIENTRY glUniform2i (GLint location, GLint v0, GLint v1);
GL_APICALL void GL_APIENTRY glUniform2iv (GLint location, GLsizei count, const GLint *value);
GL_APICALL void GL_APIENTRY glUniform3f (GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
GL_APICALL void GL_APIENTRY glUniform3fv (GLint location, GLsizei count, const GLfloat *value);
GL_APICALL void GL_APIENTRY glUniform3i (GLint location, GLint v0, GLint v1, GLint v2);
GL_APICALL void GL_APIENTRY glUniform3iv (GLint location, GLsizei count, const GLint *value);
GL_APICALL void GL_APIENTRY glUniform4f (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
GL_APICALL void GL_APIENTRY glUniform4fv (GLint location, GLsizei count, const GLfloat *value);
GL_APICALL void GL_APIENTRY glUniform4i (GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
GL_APICALL void GL_APIENTRY glUniform4iv (GLint location, GLsizei count, const GLint *value);
GL_APICALL void GL_APIENTRY glUniformMatrix2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
GL_APICALL void GL_APIENTRY glUniformMatrix3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
GL_APICALL void GL_APIENTRY glUniformMatrix4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
GL_APICALL void GL_APIENTRY glUseProgram (GLuint program);
GL_APICALL void GL_APIENTRY glValidateProgram (GLuint program);
GL_APICALL void GL_APIENTRY glVertexAttrib1f (GLuint index, GLfloat x);
GL_APICALL void GL_APIENTRY glVertexAttrib1fv (GLuint index, const GLfloat *v);
GL_APICALL void GL_APIENTRY glVertexAttrib2f (GLuint index, GLfloat x, GLfloat y);
GL_APICALL void GL_APIENTRY glVertexAttrib2fv (GLuint index, const GLfloat *v);
GL_APICALL void GL_APIENTRY glVertexAttrib3f (GLuint index, GLfloat x, GLfloat y, GLfloat z);
GL_APICALL void GL_APIENTRY glVertexAttrib3fv (GLuint index, const GLfloat *v);
GL_APICALL void GL_APIENTRY glVertexAttrib4f (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
GL_APICALL void GL_APIENTRY glVertexAttrib4fv (GLuint index, const GLfloat *v);
GL_APICALL void GL_APIENTRY glVertexAttribPointer (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void *pointer);
GL_APICALL void GL_APIENTRY glViewport (GLint x, GLint y, GLsizei width, GLsizei height);
#endif /* GL_ES_VERSION_2_0 */
#ifdef __cplusplus
}
#endif
#endif /* __gl2_h_ */
#endif

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

1184
include/GLES3/gl31.h Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -1,7 +1,7 @@
#ifndef __gl3platform_h_
#define __gl3platform_h_
/* $Revision: 18437 $ on $Date:: 2012-07-08 23:31:39 -0700 #$ */
/* $Revision: 23328 $ on $Date:: 2013-10-02 02:28:28 -0700 #$ */
/*
* This document is licensed under the SGI Free Software B License Version

View File

@@ -0,0 +1,76 @@
/*
* Copyright 2006, Philippe Houdoin. All rights reserved.
* Distributed under the terms of the MIT License.
* This header defines BGLRenderer, the base class making up
* the Haiku GL renderer add-ons (essentially selfcontained C++
* shared libraries that do the actual rendering such as
* libswpipe.so and libswrast.so)
*/
#ifndef GLRENDERER_H
#define GLRENDERER_H
#include <BeBuild.h>
#include <GLView.h>
class BGLDispatcher;
class GLRendererRoster;
typedef unsigned long renderer_id;
class BGLRenderer
{
// Private unimplemented copy constructors
BGLRenderer(const BGLRenderer &);
BGLRenderer & operator=(const BGLRenderer &);
public:
BGLRenderer(BGLView *view, ulong bgl_options,
BGLDispatcher *dispatcher);
virtual ~BGLRenderer();
void Acquire();
void Release();
virtual void LockGL();
virtual void UnlockGL();
virtual void SwapBuffers(bool VSync = false);
virtual void Draw(BRect updateRect);
virtual status_t CopyPixelsOut(BPoint source, BBitmap *dest);
virtual status_t CopyPixelsIn(BBitmap *source, BPoint dest);
virtual void FrameResized(float width, float height);
virtual void DirectConnected(direct_buffer_info *info);
virtual void EnableDirectMode(bool enabled);
inline int32 ReferenceCount() const { return fRefCount; };
inline ulong Options() const { return fOptions; };
inline BGLView* GLView() { return fView; };
inline BGLDispatcher* GLDispatcher() { return fDispatcher; };
private:
friend class GLRendererRoster;
virtual status_t _Reserved_Renderer_0(int32, void *);
virtual status_t _Reserved_Renderer_1(int32, void *);
virtual status_t _Reserved_Renderer_2(int32, void *);
virtual status_t _Reserved_Renderer_3(int32, void *);
virtual status_t _Reserved_Renderer_4(int32, void *);
int32 fRefCount; // How much we're still useful
BGLView* fView; // Never forget who is the boss!
ulong fOptions; // Keep that tune in memory
BGLDispatcher* fDispatcher;// Our personal GL API call dispatcher
GLRendererRoster* fOwningRoster;
renderer_id fID;
};
extern "C" _EXPORT BGLRenderer* instantiate_gl_renderer(BGLView *view, ulong options, BGLDispatcher *dispatcher);
#endif // GLRENDERER_H

193
include/HaikuGL/GLView.h Normal file
View File

@@ -0,0 +1,193 @@
/*
* Copyright 2008-2013, Haiku, Inc. All Rights Reserved.
* Distributed under the terms of the MIT License.
*
* This header defines BGLView, the base class making up
* the Haiku GL Kit.
*
*/
#ifndef BGLVIEW_H
#define BGLVIEW_H
#include <GL/gl.h>
#define BGL_RGB 0
#define BGL_INDEX 1
#define BGL_SINGLE 0
#define BGL_DOUBLE 2
#define BGL_DIRECT 0
#define BGL_INDIRECT 4
#define BGL_ACCUM 8
#define BGL_ALPHA 16
#define BGL_DEPTH 32
#define BGL_OVERLAY 64
#define BGL_UNDERLAY 128
#define BGL_STENCIL 512
#ifdef __cplusplus
#include <AppKit.h>
#include <Bitmap.h>
#include <DirectWindow.h>
#include <View.h>
#include <Window.h>
#include <WindowScreen.h>
struct glview_direct_info;
class BGLRenderer;
class GLRendererRoster;
class BGLView : public BView {
public:
BGLView(BRect rect, const char* name,
ulong resizingMode, ulong mode,
ulong options);
virtual ~BGLView();
void LockGL();
void UnlockGL();
void SwapBuffers();
void SwapBuffers(bool vSync);
BView* EmbeddedView(); // deprecated, returns NULL
void* GetGLProcAddress(const char* procName);
status_t CopyPixelsOut(BPoint source, BBitmap *dest);
status_t CopyPixelsIn(BBitmap *source, BPoint dest);
// Mesa's GLenum is uint where Be's ones was ulong!
virtual void ErrorCallback(unsigned long errorCode);
virtual void Draw(BRect updateRect);
virtual void AttachedToWindow();
virtual void AllAttached();
virtual void DetachedFromWindow();
virtual void AllDetached();
virtual void FrameResized(float newWidth, float newHeight);
virtual status_t Perform(perform_code d, void *arg);
virtual status_t Archive(BMessage *data, bool deep = true) const;
virtual void MessageReceived(BMessage *message);
virtual void SetResizingMode(uint32 mode);
virtual void Show();
virtual void Hide();
virtual BHandler* ResolveSpecifier(BMessage *msg, int32 index,
BMessage *specifier, int32 form,
const char *property);
virtual status_t GetSupportedSuites(BMessage *data);
void DirectConnected(direct_buffer_info *info);
void EnableDirectMode(bool enabled);
void* getGC() { return fGc; } // ???
virtual void GetPreferredSize(float* width, float* height);
private:
virtual void _ReservedGLView1();
virtual void _ReservedGLView2();
virtual void _ReservedGLView3();
virtual void _ReservedGLView4();
virtual void _ReservedGLView5();
virtual void _ReservedGLView6();
virtual void _ReservedGLView7();
virtual void _ReservedGLView8();
BGLView(const BGLView &);
BGLView &operator=(const BGLView &);
void _DitherFront();
bool _ConfirmDither();
void _Draw(BRect rect);
void _CallDirectConnected();
void* fGc;
uint32 fOptions;
uint32 fDitherCount;
BLocker fDrawLock;
BLocker fDisplayLock;
glview_direct_info* fClipInfo;
BGLRenderer* fRenderer;
GLRendererRoster* fRoster;
BBitmap* fDitherMap;
BRect fBounds;
int16* fErrorBuffer[2];
uint64 _reserved[8];
void _LockDraw();
void _UnlockDraw();
// BeOS compatibility
private:
BGLView(BRect rect, char* name,
ulong resizingMode, ulong mode,
ulong options);
};
class BGLScreen : public BWindowScreen {
public:
BGLScreen(char* name,
ulong screenMode, ulong options,
status_t *error, bool debug=false);
~BGLScreen();
void LockGL();
void UnlockGL();
void SwapBuffers();
// Mesa's GLenum is uint where Be's ones was ulong!
virtual void ErrorCallback(unsigned long errorCode);
virtual void ScreenConnected(bool connected);
virtual void FrameResized(float width, float height);
virtual status_t Perform(perform_code code, void *arg);
virtual status_t Archive(BMessage *data, bool deep = true) const;
virtual void MessageReceived(BMessage *message);
virtual void Show();
virtual void Hide();
virtual BHandler* ResolveSpecifier(BMessage *message,
int32 index,
BMessage *specifier,
int32 form,
const char *property);
virtual status_t GetSupportedSuites(BMessage *data);
private:
virtual void _ReservedGLScreen1();
virtual void _ReservedGLScreen2();
virtual void _ReservedGLScreen3();
virtual void _ReservedGLScreen4();
virtual void _ReservedGLScreen5();
virtual void _ReservedGLScreen6();
virtual void _ReservedGLScreen7();
virtual void _ReservedGLScreen8();
BGLScreen(const BGLScreen &);
BGLScreen &operator=(const BGLScreen &);
void* fGc;
long fOptions;
BLocker fDrawLock;
int32 fColorSpace;
uint32 fScreenMode;
uint64 _reserved[7];
};
#endif // __cplusplus
#endif // BGLVIEW_H

View File

@@ -0,0 +1,10 @@
/*
* Master include file for the Haiku OpenGL Kit.
*/
#include <GL/gl.h>
#include <GLView.h>
// Projects needing GL/glu.h and GL/glut.h should now
// include these headers independently as glu and glut
// are no longe core parts of mesa

28
include/HaikuGL/README Normal file
View File

@@ -0,0 +1,28 @@
These headers make up the Haiku Op*nGL kit.
Headers in this directory preserve some BeOS™ compatibility
compatibility, so changes should be mentioned to the Haiku
project mailing list.
http://haiku-os.org
Normal Haiku Op*enGL layout:
* headers/os/OpenGLKit.h
* headers/os/opengl/GLView.h
* headers/os/opengl/GLRenderer.h
* headers/os/opengl/GL/gl.h
* headers/os/opengl/GL/gl_mangle.h
* headers/os/opengl/GL/glext.h
* headers/os/opengl/GL/osmesa.h (needed?)
Extras:
* headers/os/opengl/GL/glu.h
* headers/os/opengl/GL/glut.h
OpenGL™ is a trademark of SGI. The usage of this trademark
in the Haiku GL Kit is not a sign of any certification or
endorsement by SGI or its affiliates. Usage is purely to
allow legacy compatibility with the BeOS™ and its 3D GL
rendering subsystem.

79
include/c11/threads.h Normal file
View File

@@ -0,0 +1,79 @@
/*
* C11 <threads.h> emulation library
*
* (C) Copyright yohhoy 2012.
* Distributed under the Boost Software License, Version 1.0.
*
* Permission is hereby granted, free of charge, to any person or organization
* obtaining a copy of the software and accompanying documentation covered by
* this license (the "Software") to use, reproduce, display, distribute,
* execute, and transmit the Software, and to prepare [[derivative work]]s of the
* Software, and to permit third-parties to whom the Software is furnished to
* do so, all subject to the following:
*
* The copyright notices in the Software and this entire statement, including
* the above license grant, this restriction and the following disclaimer,
* must be included in all copies of the Software, in whole or in part, and
* all derivative works of the Software, unless such copies or derivative
* works are solely in the form of machine-executable object code generated by
* a source language processor.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
* SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
* FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/
#ifndef EMULATED_THREADS_H_INCLUDED_
#define EMULATED_THREADS_H_INCLUDED_
#include <time.h>
#ifndef TIME_UTC
#define TIME_UTC 1
#endif
#include "c99_compat.h" /* for `inline` */
/*---------------------------- types ----------------------------*/
typedef void (*tss_dtor_t)(void*);
typedef int (*thrd_start_t)(void*);
struct xtime {
time_t sec;
long nsec;
};
typedef struct xtime xtime;
/*-------------------- enumeration constants --------------------*/
enum {
mtx_plain = 0,
mtx_try = 1,
mtx_timed = 2,
mtx_recursive = 4
};
enum {
thrd_success = 0, // succeeded
thrd_timeout, // timeout
thrd_error, // failed
thrd_busy, // resource busy
thrd_nomem // out of memory
};
/*-------------------------- functions --------------------------*/
#if defined(_WIN32) && !defined(__CYGWIN__)
#include "threads_win32.h"
#elif defined(HAVE_PTHREAD)
#include "threads_posix.h"
#else
#error Not supported on this platform.
#endif
#endif /* EMULATED_THREADS_H_INCLUDED_ */

375
include/c11/threads_posix.h Normal file
View File

@@ -0,0 +1,375 @@
/*
* C11 <threads.h> emulation library
*
* (C) Copyright yohhoy 2012.
* Distributed under the Boost Software License, Version 1.0.
*
* Permission is hereby granted, free of charge, to any person or organization
* obtaining a copy of the software and accompanying documentation covered by
* this license (the "Software") to use, reproduce, display, distribute,
* execute, and transmit the Software, and to prepare [[derivative work]]s of the
* Software, and to permit third-parties to whom the Software is furnished to
* do so, all subject to the following:
*
* The copyright notices in the Software and this entire statement, including
* the above license grant, this restriction and the following disclaimer,
* must be included in all copies of the Software, in whole or in part, and
* all derivative works of the Software, unless such copies or derivative
* works are solely in the form of machine-executable object code generated by
* a source language processor.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
* SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
* FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/
#include <stdlib.h>
#ifndef assert
#include <assert.h>
#endif
#include <limits.h>
#include <errno.h>
#include <unistd.h>
#include <sched.h>
#include <stdint.h> /* for intptr_t */
/*
Configuration macro:
EMULATED_THREADS_USE_NATIVE_TIMEDLOCK
Use pthread_mutex_timedlock() for `mtx_timedlock()'
Otherwise use mtx_trylock() + *busy loop* emulation.
*/
#if !defined(__CYGWIN__) && !defined(__APPLE__) && !defined(__NetBSD__)
#define EMULATED_THREADS_USE_NATIVE_TIMEDLOCK
#endif
#include <pthread.h>
/*---------------------------- macros ----------------------------*/
#define ONCE_FLAG_INIT PTHREAD_ONCE_INIT
#ifdef INIT_ONCE_STATIC_INIT
#define TSS_DTOR_ITERATIONS PTHREAD_DESTRUCTOR_ITERATIONS
#else
#define TSS_DTOR_ITERATIONS 1 // assume TSS dtor MAY be called at least once.
#endif
// FIXME: temporary non-standard hack to ease transition
#define _MTX_INITIALIZER_NP PTHREAD_MUTEX_INITIALIZER
/*---------------------------- types ----------------------------*/
typedef pthread_cond_t cnd_t;
typedef pthread_t thrd_t;
typedef pthread_key_t tss_t;
typedef pthread_mutex_t mtx_t;
typedef pthread_once_t once_flag;
/*
Implementation limits:
- Conditionally emulation for "mutex with timeout"
(see EMULATED_THREADS_USE_NATIVE_TIMEDLOCK macro)
*/
struct impl_thrd_param {
thrd_start_t func;
void *arg;
};
static inline void *
impl_thrd_routine(void *p)
{
struct impl_thrd_param pack = *((struct impl_thrd_param *)p);
free(p);
return (void*)(intptr_t)pack.func(pack.arg);
}
/*--------------- 7.25.2 Initialization functions ---------------*/
// 7.25.2.1
static inline void
call_once(once_flag *flag, void (*func)(void))
{
pthread_once(flag, func);
}
/*------------- 7.25.3 Condition variable functions -------------*/
// 7.25.3.1
static inline int
cnd_broadcast(cnd_t *cond)
{
if (!cond) return thrd_error;
pthread_cond_broadcast(cond);
return thrd_success;
}
// 7.25.3.2
static inline void
cnd_destroy(cnd_t *cond)
{
assert(cond);
pthread_cond_destroy(cond);
}
// 7.25.3.3
static inline int
cnd_init(cnd_t *cond)
{
if (!cond) return thrd_error;
pthread_cond_init(cond, NULL);
return thrd_success;
}
// 7.25.3.4
static inline int
cnd_signal(cnd_t *cond)
{
if (!cond) return thrd_error;
pthread_cond_signal(cond);
return thrd_success;
}
// 7.25.3.5
static inline int
cnd_timedwait(cnd_t *cond, mtx_t *mtx, const xtime *xt)
{
struct timespec abs_time;
int rt;
if (!cond || !mtx || !xt) return thrd_error;
rt = pthread_cond_timedwait(cond, mtx, &abs_time);
if (rt == ETIMEDOUT)
return thrd_busy;
return (rt == 0) ? thrd_success : thrd_error;
}
// 7.25.3.6
static inline int
cnd_wait(cnd_t *cond, mtx_t *mtx)
{
if (!cond || !mtx) return thrd_error;
pthread_cond_wait(cond, mtx);
return thrd_success;
}
/*-------------------- 7.25.4 Mutex functions --------------------*/
// 7.25.4.1
static inline void
mtx_destroy(mtx_t *mtx)
{
assert(mtx);
pthread_mutex_destroy(mtx);
}
// 7.25.4.2
static inline int
mtx_init(mtx_t *mtx, int type)
{
pthread_mutexattr_t attr;
if (!mtx) return thrd_error;
if (type != mtx_plain && type != mtx_timed && type != mtx_try
&& type != (mtx_plain|mtx_recursive)
&& type != (mtx_timed|mtx_recursive)
&& type != (mtx_try|mtx_recursive))
return thrd_error;
pthread_mutexattr_init(&attr);
if ((type & mtx_recursive) != 0) {
#if defined(__linux__) || defined(__linux)
pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE_NP);
#else
pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
#endif
}
pthread_mutex_init(mtx, &attr);
pthread_mutexattr_destroy(&attr);
return thrd_success;
}
// 7.25.4.3
static inline int
mtx_lock(mtx_t *mtx)
{
if (!mtx) return thrd_error;
pthread_mutex_lock(mtx);
return thrd_success;
}
static inline int
mtx_trylock(mtx_t *mtx);
static inline void
thrd_yield(void);
// 7.25.4.4
static inline int
mtx_timedlock(mtx_t *mtx, const xtime *xt)
{
if (!mtx || !xt) return thrd_error;
{
#ifdef EMULATED_THREADS_USE_NATIVE_TIMEDLOCK
struct timespec ts;
int rt;
ts.tv_sec = xt->sec;
ts.tv_nsec = xt->nsec;
rt = pthread_mutex_timedlock(mtx, &ts);
if (rt == 0)
return thrd_success;
return (rt == ETIMEDOUT) ? thrd_busy : thrd_error;
#else
time_t expire = time(NULL);
expire += xt->sec;
while (mtx_trylock(mtx) != thrd_success) {
time_t now = time(NULL);
if (expire < now)
return thrd_busy;
// busy loop!
thrd_yield();
}
return thrd_success;
#endif
}
}
// 7.25.4.5
static inline int
mtx_trylock(mtx_t *mtx)
{
if (!mtx) return thrd_error;
return (pthread_mutex_trylock(mtx) == 0) ? thrd_success : thrd_busy;
}
// 7.25.4.6
static inline int
mtx_unlock(mtx_t *mtx)
{
if (!mtx) return thrd_error;
pthread_mutex_unlock(mtx);
return thrd_success;
}
/*------------------- 7.25.5 Thread functions -------------------*/
// 7.25.5.1
static inline int
thrd_create(thrd_t *thr, thrd_start_t func, void *arg)
{
struct impl_thrd_param *pack;
if (!thr) return thrd_error;
pack = (struct impl_thrd_param *)malloc(sizeof(struct impl_thrd_param));
if (!pack) return thrd_nomem;
pack->func = func;
pack->arg = arg;
if (pthread_create(thr, NULL, impl_thrd_routine, pack) != 0) {
free(pack);
return thrd_error;
}
return thrd_success;
}
// 7.25.5.2
static inline thrd_t
thrd_current(void)
{
return pthread_self();
}
// 7.25.5.3
static inline int
thrd_detach(thrd_t thr)
{
return (pthread_detach(thr) == 0) ? thrd_success : thrd_error;
}
// 7.25.5.4
static inline int
thrd_equal(thrd_t thr0, thrd_t thr1)
{
return pthread_equal(thr0, thr1);
}
// 7.25.5.5
static inline void
thrd_exit(int res)
{
pthread_exit((void*)(intptr_t)res);
}
// 7.25.5.6
static inline int
thrd_join(thrd_t thr, int *res)
{
void *code;
if (pthread_join(thr, &code) != 0)
return thrd_error;
if (res)
*res = (int)(intptr_t)code;
return thrd_success;
}
// 7.25.5.7
static inline void
thrd_sleep(const xtime *xt)
{
struct timespec req;
assert(xt);
req.tv_sec = xt->sec;
req.tv_nsec = xt->nsec;
nanosleep(&req, NULL);
}
// 7.25.5.8
static inline void
thrd_yield(void)
{
sched_yield();
}
/*----------- 7.25.6 Thread-specific storage functions -----------*/
// 7.25.6.1
static inline int
tss_create(tss_t *key, tss_dtor_t dtor)
{
if (!key) return thrd_error;
return (pthread_key_create(key, dtor) == 0) ? thrd_success : thrd_error;
}
// 7.25.6.2
static inline void
tss_delete(tss_t key)
{
pthread_key_delete(key);
}
// 7.25.6.3
static inline void *
tss_get(tss_t key)
{
return pthread_getspecific(key);
}
// 7.25.6.4
static inline int
tss_set(tss_t key, void *val)
{
return (pthread_setspecific(key, val) == 0) ? thrd_success : thrd_error;
}
/*-------------------- 7.25.7 Time functions --------------------*/
// 7.25.6.1
static inline int
xtime_get(xtime *xt, int base)
{
if (!xt) return 0;
if (base == TIME_UTC) {
xt->sec = time(NULL);
xt->nsec = 0;
return base;
}
return 0;
}

642
include/c11/threads_win32.h Normal file
View File

@@ -0,0 +1,642 @@
/*
* C11 <threads.h> emulation library
*
* (C) Copyright yohhoy 2012.
* Distributed under the Boost Software License, Version 1.0.
*
* Permission is hereby granted, free of charge, to any person or organization
* obtaining a copy of the software and accompanying documentation covered by
* this license (the "Software") to use, reproduce, display, distribute,
* execute, and transmit the Software, and to prepare [[derivative work]]s of the
* Software, and to permit third-parties to whom the Software is furnished to
* do so, all subject to the following:
*
* The copyright notices in the Software and this entire statement, including
* the above license grant, this restriction and the following disclaimer,
* must be included in all copies of the Software, in whole or in part, and
* all derivative works of the Software, unless such copies or derivative
* works are solely in the form of machine-executable object code generated by
* a source language processor.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
* SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
* FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/
#ifndef assert
#include <assert.h>
#endif
#include <limits.h>
#include <errno.h>
#include <process.h> // MSVCRT
#include <stdlib.h>
/*
Configuration macro:
EMULATED_THREADS_USE_NATIVE_CALL_ONCE
Use native WindowsAPI one-time initialization function.
(requires WinVista or later)
Otherwise emulate by mtx_trylock() + *busy loop* for WinXP.
EMULATED_THREADS_USE_NATIVE_CV
Use native WindowsAPI condition variable object.
(requires WinVista or later)
Otherwise use emulated implementation for WinXP.
EMULATED_THREADS_TSS_DTOR_SLOTNUM
Max registerable TSS dtor number.
*/
// XXX: Retain XP compatability
#if 0
#if _WIN32_WINNT >= 0x0600
// Prefer native WindowsAPI on newer environment.
#if !defined(__MINGW32__)
#define EMULATED_THREADS_USE_NATIVE_CALL_ONCE
#endif
#define EMULATED_THREADS_USE_NATIVE_CV
#endif
#endif
#define EMULATED_THREADS_TSS_DTOR_SLOTNUM 64 // see TLS_MINIMUM_AVAILABLE
#include <windows.h>
// check configuration
#if defined(EMULATED_THREADS_USE_NATIVE_CALL_ONCE) && (_WIN32_WINNT < 0x0600)
#error EMULATED_THREADS_USE_NATIVE_CALL_ONCE requires _WIN32_WINNT>=0x0600
#endif
#if defined(EMULATED_THREADS_USE_NATIVE_CV) && (_WIN32_WINNT < 0x0600)
#error EMULATED_THREADS_USE_NATIVE_CV requires _WIN32_WINNT>=0x0600
#endif
/*---------------------------- macros ----------------------------*/
#ifdef EMULATED_THREADS_USE_NATIVE_CALL_ONCE
#define ONCE_FLAG_INIT INIT_ONCE_STATIC_INIT
#else
#define ONCE_FLAG_INIT {0}
#endif
#define TSS_DTOR_ITERATIONS 1
// FIXME: temporary non-standard hack to ease transition
#define _MTX_INITIALIZER_NP {(PCRITICAL_SECTION_DEBUG)-1, -1, 0, 0, 0, 0}
/*---------------------------- types ----------------------------*/
typedef struct cnd_t {
#ifdef EMULATED_THREADS_USE_NATIVE_CV
CONDITION_VARIABLE condvar;
#else
int blocked;
int gone;
int to_unblock;
HANDLE sem_queue;
HANDLE sem_gate;
CRITICAL_SECTION monitor;
#endif
} cnd_t;
typedef HANDLE thrd_t;
typedef DWORD tss_t;
typedef CRITICAL_SECTION mtx_t;
#ifdef EMULATED_THREADS_USE_NATIVE_CALL_ONCE
typedef INIT_ONCE once_flag;
#else
typedef struct once_flag_t {
volatile LONG status;
} once_flag;
#endif
static inline void * tss_get(tss_t key);
static inline void thrd_yield(void);
static inline int mtx_trylock(mtx_t *mtx);
static inline int mtx_lock(mtx_t *mtx);
static inline int mtx_unlock(mtx_t *mtx);
/*
Implementation limits:
- Conditionally emulation for "Initialization functions"
(see EMULATED_THREADS_USE_NATIVE_CALL_ONCE macro)
- Emulated `mtx_timelock()' with mtx_trylock() + *busy loop*
*/
static void impl_tss_dtor_invoke(void); // forward decl.
struct impl_thrd_param {
thrd_start_t func;
void *arg;
};
static unsigned __stdcall impl_thrd_routine(void *p)
{
struct impl_thrd_param pack;
int code;
memcpy(&pack, p, sizeof(struct impl_thrd_param));
free(p);
code = pack.func(pack.arg);
impl_tss_dtor_invoke();
return (unsigned)code;
}
static DWORD impl_xtime2msec(const xtime *xt)
{
return (DWORD)((xt->sec * 1000U) + (xt->nsec / 1000000L));
}
#ifdef EMULATED_THREADS_USE_NATIVE_CALL_ONCE
struct impl_call_once_param { void (*func)(void); };
static BOOL CALLBACK impl_call_once_callback(PINIT_ONCE InitOnce, PVOID Parameter, PVOID *Context)
{
struct impl_call_once_param *param = (struct impl_call_once_param*)Parameter;
(param->func)();
((void)InitOnce); ((void)Context); // suppress warning
return TRUE;
}
#endif // ifdef EMULATED_THREADS_USE_NATIVE_CALL_ONCE
#ifndef EMULATED_THREADS_USE_NATIVE_CV
/*
Note:
The implementation of condition variable is ported from Boost.Interprocess
See http://www.boost.org/boost/interprocess/sync/windows/condition.hpp
*/
static void impl_cond_do_signal(cnd_t *cond, int broadcast)
{
int nsignal = 0;
EnterCriticalSection(&cond->monitor);
if (cond->to_unblock != 0) {
if (cond->blocked == 0) {
LeaveCriticalSection(&cond->monitor);
return;
}
if (broadcast) {
cond->to_unblock += nsignal = cond->blocked;
cond->blocked = 0;
} else {
nsignal = 1;
cond->to_unblock++;
cond->blocked--;
}
} else if (cond->blocked > cond->gone) {
WaitForSingleObject(cond->sem_gate, INFINITE);
if (cond->gone != 0) {
cond->blocked -= cond->gone;
cond->gone = 0;
}
if (broadcast) {
nsignal = cond->to_unblock = cond->blocked;
cond->blocked = 0;
} else {
nsignal = cond->to_unblock = 1;
cond->blocked--;
}
}
LeaveCriticalSection(&cond->monitor);
if (0 < nsignal)
ReleaseSemaphore(cond->sem_queue, nsignal, NULL);
}
static int impl_cond_do_wait(cnd_t *cond, mtx_t *mtx, const xtime *xt)
{
int nleft = 0;
int ngone = 0;
int timeout = 0;
DWORD w;
WaitForSingleObject(cond->sem_gate, INFINITE);
cond->blocked++;
ReleaseSemaphore(cond->sem_gate, 1, NULL);
mtx_unlock(mtx);
w = WaitForSingleObject(cond->sem_queue, xt ? impl_xtime2msec(xt) : INFINITE);
timeout = (w == WAIT_TIMEOUT);
EnterCriticalSection(&cond->monitor);
if ((nleft = cond->to_unblock) != 0) {
if (timeout) {
if (cond->blocked != 0) {
cond->blocked--;
} else {
cond->gone++;
}
}
if (--cond->to_unblock == 0) {
if (cond->blocked != 0) {
ReleaseSemaphore(cond->sem_gate, 1, NULL);
nleft = 0;
}
else if ((ngone = cond->gone) != 0) {
cond->gone = 0;
}
}
} else if (++cond->gone == INT_MAX/2) {
WaitForSingleObject(cond->sem_gate, INFINITE);
cond->blocked -= cond->gone;
ReleaseSemaphore(cond->sem_gate, 1, NULL);
cond->gone = 0;
}
LeaveCriticalSection(&cond->monitor);
if (nleft == 1) {
while (ngone--)
WaitForSingleObject(cond->sem_queue, INFINITE);
ReleaseSemaphore(cond->sem_gate, 1, NULL);
}
mtx_lock(mtx);
return timeout ? thrd_busy : thrd_success;
}
#endif // ifndef EMULATED_THREADS_USE_NATIVE_CV
static struct impl_tss_dtor_entry {
tss_t key;
tss_dtor_t dtor;
} impl_tss_dtor_tbl[EMULATED_THREADS_TSS_DTOR_SLOTNUM];
static int impl_tss_dtor_register(tss_t key, tss_dtor_t dtor)
{
int i;
for (i = 0; i < EMULATED_THREADS_TSS_DTOR_SLOTNUM; i++) {
if (!impl_tss_dtor_tbl[i].dtor)
break;
}
if (i == EMULATED_THREADS_TSS_DTOR_SLOTNUM)
return 1;
impl_tss_dtor_tbl[i].key = key;
impl_tss_dtor_tbl[i].dtor = dtor;
return 0;
}
static void impl_tss_dtor_invoke()
{
int i;
for (i = 0; i < EMULATED_THREADS_TSS_DTOR_SLOTNUM; i++) {
if (impl_tss_dtor_tbl[i].dtor) {
void* val = tss_get(impl_tss_dtor_tbl[i].key);
if (val)
(impl_tss_dtor_tbl[i].dtor)(val);
}
}
}
/*--------------- 7.25.2 Initialization functions ---------------*/
// 7.25.2.1
static inline void
call_once(once_flag *flag, void (*func)(void))
{
assert(!flag && !func);
#ifdef EMULATED_THREADS_USE_NATIVE_CALL_ONCE
{
struct impl_call_once_param param;
param.func = func;
InitOnceExecuteOnce(flag, impl_call_once_callback, (PVOID)&param, NULL);
}
#else
if (InterlockedCompareExchange(&flag->status, 1, 0) == 0) {
(func)();
InterlockedExchange(&flag->status, 2);
} else {
while (flag->status == 1) {
// busy loop!
thrd_yield();
}
}
#endif
}
/*------------- 7.25.3 Condition variable functions -------------*/
// 7.25.3.1
static inline int
cnd_broadcast(cnd_t *cond)
{
if (!cond) return thrd_error;
#ifdef EMULATED_THREADS_USE_NATIVE_CV
WakeAllConditionVariable(&cond->condvar);
#else
impl_cond_do_signal(cond, 1);
#endif
return thrd_success;
}
// 7.25.3.2
static inline void
cnd_destroy(cnd_t *cond)
{
assert(cond);
#ifdef EMULATED_THREADS_USE_NATIVE_CV
// do nothing
#else
CloseHandle(cond->sem_queue);
CloseHandle(cond->sem_gate);
DeleteCriticalSection(&cond->monitor);
#endif
}
// 7.25.3.3
static inline int
cnd_init(cnd_t *cond)
{
if (!cond) return thrd_error;
#ifdef EMULATED_THREADS_USE_NATIVE_CV
InitializeConditionVariable(&cond->condvar);
#else
cond->blocked = 0;
cond->gone = 0;
cond->to_unblock = 0;
cond->sem_queue = CreateSemaphore(NULL, 0, LONG_MAX, NULL);
cond->sem_gate = CreateSemaphore(NULL, 1, 1, NULL);
InitializeCriticalSection(&cond->monitor);
#endif
return thrd_success;
}
// 7.25.3.4
static inline int
cnd_signal(cnd_t *cond)
{
if (!cond) return thrd_error;
#ifdef EMULATED_THREADS_USE_NATIVE_CV
WakeConditionVariable(&cond->condvar);
#else
impl_cond_do_signal(cond, 0);
#endif
return thrd_success;
}
// 7.25.3.5
static inline int
cnd_timedwait(cnd_t *cond, mtx_t *mtx, const xtime *xt)
{
if (!cond || !mtx || !xt) return thrd_error;
#ifdef EMULATED_THREADS_USE_NATIVE_CV
if (SleepConditionVariableCS(&cond->condvar, mtx, impl_xtime2msec(xt)))
return thrd_success;
return (GetLastError() == ERROR_TIMEOUT) ? thrd_busy : thrd_error;
#else
return impl_cond_do_wait(cond, mtx, xt);
#endif
}
// 7.25.3.6
static inline int
cnd_wait(cnd_t *cond, mtx_t *mtx)
{
if (!cond || !mtx) return thrd_error;
#ifdef EMULATED_THREADS_USE_NATIVE_CV
SleepConditionVariableCS(&cond->condvar, mtx, INFINITE);
#else
impl_cond_do_wait(cond, mtx, NULL);
#endif
return thrd_success;
}
/*-------------------- 7.25.4 Mutex functions --------------------*/
// 7.25.4.1
static inline void
mtx_destroy(mtx_t *mtx)
{
assert(mtx);
DeleteCriticalSection(mtx);
}
// 7.25.4.2
static inline int
mtx_init(mtx_t *mtx, int type)
{
if (!mtx) return thrd_error;
if (type != mtx_plain && type != mtx_timed && type != mtx_try
&& type != (mtx_plain|mtx_recursive)
&& type != (mtx_timed|mtx_recursive)
&& type != (mtx_try|mtx_recursive))
return thrd_error;
InitializeCriticalSection(mtx);
return thrd_success;
}
// 7.25.4.3
static inline int
mtx_lock(mtx_t *mtx)
{
if (!mtx) return thrd_error;
EnterCriticalSection(mtx);
return thrd_success;
}
// 7.25.4.4
static inline int
mtx_timedlock(mtx_t *mtx, const xtime *xt)
{
time_t expire, now;
if (!mtx || !xt) return thrd_error;
expire = time(NULL);
expire += xt->sec;
while (mtx_trylock(mtx) != thrd_success) {
now = time(NULL);
if (expire < now)
return thrd_busy;
// busy loop!
thrd_yield();
}
return thrd_success;
}
// 7.25.4.5
static inline int
mtx_trylock(mtx_t *mtx)
{
if (!mtx) return thrd_error;
return TryEnterCriticalSection(mtx) ? thrd_success : thrd_busy;
}
// 7.25.4.6
static inline int
mtx_unlock(mtx_t *mtx)
{
if (!mtx) return thrd_error;
LeaveCriticalSection(mtx);
return thrd_success;
}
/*------------------- 7.25.5 Thread functions -------------------*/
// 7.25.5.1
static inline int
thrd_create(thrd_t *thr, thrd_start_t func, void *arg)
{
struct impl_thrd_param *pack;
uintptr_t handle;
if (!thr) return thrd_error;
pack = (struct impl_thrd_param *)malloc(sizeof(struct impl_thrd_param));
if (!pack) return thrd_nomem;
pack->func = func;
pack->arg = arg;
handle = _beginthreadex(NULL, 0, impl_thrd_routine, pack, 0, NULL);
if (handle == 0) {
if (errno == EAGAIN || errno == EACCES)
return thrd_nomem;
return thrd_error;
}
*thr = (thrd_t)handle;
return thrd_success;
}
#if 0
// 7.25.5.2
static inline thrd_t
thrd_current(void)
{
HANDLE hCurrentThread;
BOOL bRet;
/* GetCurrentThread() returns a pseudo-handle, which is useless. We need
* to call DuplicateHandle to get a real handle. However the handle value
* will not match the one returned by thread_create.
*
* Other potential solutions would be:
* - define thrd_t as a thread Ids, but this would mean we'd need to OpenThread for many operations
* - use malloc'ed memory for thrd_t. This would imply using TLS for current thread.
*
* Neither is particularly nice.
*
* Life would be much easier if C11 threads had different abstractions for
* threads and thread IDs, just like C++11 threads does...
*/
bRet = DuplicateHandle(GetCurrentProcess(), // source process (pseudo) handle
GetCurrentThread(), // source (pseudo) handle
GetCurrentProcess(), // target process
&hCurrentThread, // target handle
0,
FALSE,
DUPLICATE_SAME_ACCESS);
assert(bRet);
if (!bRet) {
hCurrentThread = GetCurrentThread();
}
return hCurrentThread;
}
#endif
// 7.25.5.3
static inline int
thrd_detach(thrd_t thr)
{
CloseHandle(thr);
return thrd_success;
}
// 7.25.5.4
static inline int
thrd_equal(thrd_t thr0, thrd_t thr1)
{
return GetThreadId(thr0) == GetThreadId(thr1);
}
// 7.25.5.5
static inline void
thrd_exit(int res)
{
impl_tss_dtor_invoke();
_endthreadex((unsigned)res);
}
// 7.25.5.6
static inline int
thrd_join(thrd_t thr, int *res)
{
DWORD w, code;
w = WaitForSingleObject(thr, INFINITE);
if (w != WAIT_OBJECT_0)
return thrd_error;
if (res) {
if (!GetExitCodeThread(thr, &code)) {
CloseHandle(thr);
return thrd_error;
}
*res = (int)code;
}
CloseHandle(thr);
return thrd_success;
}
// 7.25.5.7
static inline void
thrd_sleep(const xtime *xt)
{
assert(xt);
Sleep(impl_xtime2msec(xt));
}
// 7.25.5.8
static inline void
thrd_yield(void)
{
SwitchToThread();
}
/*----------- 7.25.6 Thread-specific storage functions -----------*/
// 7.25.6.1
static inline int
tss_create(tss_t *key, tss_dtor_t dtor)
{
if (!key) return thrd_error;
*key = TlsAlloc();
if (dtor) {
if (impl_tss_dtor_register(*key, dtor)) {
TlsFree(*key);
return thrd_error;
}
}
return (*key != 0xFFFFFFFF) ? thrd_success : thrd_error;
}
// 7.25.6.2
static inline void
tss_delete(tss_t key)
{
TlsFree(key);
}
// 7.25.6.3
static inline void *
tss_get(tss_t key)
{
return TlsGetValue(key);
}
// 7.25.6.4
static inline int
tss_set(tss_t key, void *val)
{
return TlsSetValue(key, val) ? thrd_success : thrd_error;
}
/*-------------------- 7.25.7 Time functions --------------------*/
// 7.25.6.1
static inline int
xtime_get(xtime *xt, int base)
{
if (!xt) return 0;
if (base == TIME_UTC) {
xt->sec = time(NULL);
xt->nsec = 0;
return base;
}
return 0;
}

View File

@@ -91,3 +91,25 @@ CHIPSET(0x0F32, byt, "Intel(R) Bay Trail")
CHIPSET(0x0F33, byt, "Intel(R) Bay Trail")
CHIPSET(0x0157, byt, "Intel(R) Bay Trail")
CHIPSET(0x0155, byt, "Intel(R) Bay Trail")
CHIPSET(0x1602, bdw_gt1, "Intel(R) Broadwell GT1")
CHIPSET(0x1606, bdw_gt1, "Intel(R) Broadwell GT1")
CHIPSET(0x160A, bdw_gt1, "Intel(R) Broadwell GT1")
CHIPSET(0x160B, bdw_gt1, "Intel(R) Broadwell GT1")
CHIPSET(0x160D, bdw_gt1, "Intel(R) Broadwell GT1")
CHIPSET(0x160E, bdw_gt1, "Intel(R) Broadwell GT1")
CHIPSET(0x1612, bdw_gt2, "Intel(R) HD Graphics 5600 (Broadwell GT2)")
CHIPSET(0x1616, bdw_gt2, "Intel(R) HD Graphics 5500 (Broadwell GT2)")
CHIPSET(0x161A, bdw_gt2, "Intel(R) Broadwell GT2")
CHIPSET(0x161B, bdw_gt2, "Intel(R) Broadwell GT2")
CHIPSET(0x161D, bdw_gt2, "Intel(R) Broadwell GT2")
CHIPSET(0x161E, bdw_gt2, "Intel(R) HD Graphics 5300 (Broadwell GT2)")
CHIPSET(0x1622, bdw_gt3, "Intel(R) Iris Pro 6200 (Broadwell GT3e)")
CHIPSET(0x1626, bdw_gt3, "Intel(R) HD Graphics 6000 (Broadwell GT3)")
CHIPSET(0x162A, bdw_gt3, "Intel(R) Iris Pro P6300 (Broadwell GT3e)")
CHIPSET(0x162B, bdw_gt3, "Intel(R) Iris 6100 (Broadwell GT3)")
CHIPSET(0x162D, bdw_gt3, "Intel(R) Broadwell GT3")
CHIPSET(0x162E, bdw_gt3, "Intel(R) Broadwell GT3")
CHIPSET(0x22B0, chv, "Intel(R) Cherryview")
CHIPSET(0x22B1, chv, "Intel(R) Cherryview")
CHIPSET(0x22B2, chv, "Intel(R) Cherryview")
CHIPSET(0x22B3, chv, "Intel(R) Cherryview")

View File

@@ -208,7 +208,7 @@ CHIPSET(0x9644, SUMO2_9644, SUMO2)
CHIPSET(0x9645, SUMO2_9645, SUMO2)
CHIPSET(0x9647, SUMO_9647, SUMO)
CHIPSET(0x9648, SUMO_9648, SUMO)
CHIPSET(0x9649, SUMO_9649, SUMO)
CHIPSET(0x9649, SUMO2_9649, SUMO2)
CHIPSET(0x964a, SUMO_964A, SUMO)
CHIPSET(0x964b, SUMO_964B, SUMO)
CHIPSET(0x964c, SUMO_964C, SUMO)

View File

@@ -38,6 +38,7 @@ CHIPSET(0x6828, VERDE_6828, VERDE)
CHIPSET(0x6829, VERDE_6829, VERDE)
CHIPSET(0x682A, VERDE_682A, VERDE)
CHIPSET(0x682B, VERDE_682B, VERDE)
CHIPSET(0x682C, VERDE_682C, VERDE)
CHIPSET(0x682D, VERDE_682D, VERDE)
CHIPSET(0x682F, VERDE_682F, VERDE)
CHIPSET(0x6830, VERDE_6830, VERDE)
@@ -54,8 +55,11 @@ CHIPSET(0x6600, OLAND_6600, OLAND)
CHIPSET(0x6601, OLAND_6601, OLAND)
CHIPSET(0x6602, OLAND_6602, OLAND)
CHIPSET(0x6603, OLAND_6603, OLAND)
CHIPSET(0x6604, OLAND_6604, OLAND)
CHIPSET(0x6605, OLAND_6605, OLAND)
CHIPSET(0x6606, OLAND_6606, OLAND)
CHIPSET(0x6607, OLAND_6607, OLAND)
CHIPSET(0x6608, OLAND_6608, OLAND)
CHIPSET(0x6610, OLAND_6610, OLAND)
CHIPSET(0x6611, OLAND_6611, OLAND)
CHIPSET(0x6613, OLAND_6613, OLAND)
@@ -73,6 +77,8 @@ CHIPSET(0x666F, HAINAN_666F, HAINAN)
CHIPSET(0x6640, BONAIRE_6640, BONAIRE)
CHIPSET(0x6641, BONAIRE_6641, BONAIRE)
CHIPSET(0x6646, BONAIRE_6646, BONAIRE)
CHIPSET(0x6647, BONAIRE_6647, BONAIRE)
CHIPSET(0x6649, BONAIRE_6649, BONAIRE)
CHIPSET(0x6650, BONAIRE_6650, BONAIRE)
CHIPSET(0x6651, BONAIRE_6651, BONAIRE)
@@ -97,6 +103,23 @@ CHIPSET(0x983D, KABINI_983D, KABINI)
CHIPSET(0x983E, KABINI_983E, KABINI)
CHIPSET(0x983F, KABINI_983F, KABINI)
CHIPSET(0x9850, MULLINS_9850, MULLINS)
CHIPSET(0x9851, MULLINS_9851, MULLINS)
CHIPSET(0x9852, MULLINS_9852, MULLINS)
CHIPSET(0x9853, MULLINS_9853, MULLINS)
CHIPSET(0x9854, MULLINS_9854, MULLINS)
CHIPSET(0x9855, MULLINS_9855, MULLINS)
CHIPSET(0x9856, MULLINS_9856, MULLINS)
CHIPSET(0x9857, MULLINS_9857, MULLINS)
CHIPSET(0x9858, MULLINS_9858, MULLINS)
CHIPSET(0x9859, MULLINS_9859, MULLINS)
CHIPSET(0x985A, MULLINS_985A, MULLINS)
CHIPSET(0x985B, MULLINS_985B, MULLINS)
CHIPSET(0x985C, MULLINS_985C, MULLINS)
CHIPSET(0x985D, MULLINS_985D, MULLINS)
CHIPSET(0x985E, MULLINS_985E, MULLINS)
CHIPSET(0x985F, MULLINS_985F, MULLINS)
CHIPSET(0x1304, KAVERI_1304, KAVERI)
CHIPSET(0x1305, KAVERI_1305, KAVERI)
CHIPSET(0x1306, KAVERI_1306, KAVERI)
@@ -115,6 +138,20 @@ CHIPSET(0x1313, KAVERI_1313, KAVERI)
CHIPSET(0x1315, KAVERI_1315, KAVERI)
CHIPSET(0x1316, KAVERI_1316, KAVERI)
CHIPSET(0x1317, KAVERI_1317, KAVERI)
CHIPSET(0x1318, KAVERI_1318, KAVERI)
CHIPSET(0x131B, KAVERI_131B, KAVERI)
CHIPSET(0x131C, KAVERI_131C, KAVERI)
CHIPSET(0x131D, KAVERI_131D, KAVERI)
CHIPSET(0x67A0, HAWAII_67A0, HAWAII)
CHIPSET(0x67A1, HAWAII_67A1, HAWAII)
CHIPSET(0x67A2, HAWAII_67A2, HAWAII)
CHIPSET(0x67A8, HAWAII_67A8, HAWAII)
CHIPSET(0x67A9, HAWAII_67A9, HAWAII)
CHIPSET(0x67AA, HAWAII_67AA, HAWAII)
CHIPSET(0x67B0, HAWAII_67B0, HAWAII)
CHIPSET(0x67B1, HAWAII_67B1, HAWAII)
CHIPSET(0x67B8, HAWAII_67B8, HAWAII)
CHIPSET(0x67B9, HAWAII_67B9, HAWAII)
CHIPSET(0x67BA, HAWAII_67BA, HAWAII)
CHIPSET(0x67BE, HAWAII_67BE, HAWAII)

27
install-gallium-links.mk Normal file
View File

@@ -0,0 +1,27 @@
# Provide compatibility with scripts for the old Mesa build system for
# a while by putting a link to the driver into /lib of the build tree.
if BUILD_SHARED
if HAVE_COMPAT_SYMLINKS
all-local : .libs/install-gallium-links
.libs/install-gallium-links : $(dri_LTLIBRARIES) $(vdpau_LTLIBRARIES) $(egl_LTLIBRARIES) $(lib_LTLIBRARIES)
$(AM_V_GEN)$(MKDIR_P) $(top_builddir)/$(LIB_DIR); \
link_dir=$(top_builddir)/$(LIB_DIR)/gallium; \
if test x$(egl_LTLIBRARIES) != x; then \
link_dir=$(top_builddir)/$(LIB_DIR)/egl; \
fi; \
$(MKDIR_P) $$link_dir; \
file_list=$(dri_LTLIBRARIES:%.la=.libs/%.so); \
file_list+=$(vdpau_LTLIBRARIES:%.la=.libs/%.$(LIB_EXT)*); \
file_list+=$(egl_LTLIBRARIES:%.la=.libs/%.$(LIB_EXT)*); \
file_list+=$(lib_LTLIBRARIES:%.la=.libs/%.$(LIB_EXT)*); \
for f in $$file_list; do \
if test -h .libs/$$f; then \
cp -d $$f $$link_dir; \
else \
ln -f $$f $$link_dir; \
fi; \
done && touch $@
endif
endif

18
install-lib-links.mk Normal file
View File

@@ -0,0 +1,18 @@
# Provide compatibility with scripts for the old Mesa build system for
# a while by putting a link to the driver into /lib of the build tree.
if BUILD_SHARED
if HAVE_COMPAT_SYMLINKS
all-local : .libs/install-mesa-links
.libs/install-mesa-links : $(lib_LTLIBRARIES)
$(AM_V_GEN)$(MKDIR_P) $(top_builddir)/$(LIB_DIR); \
for f in $(lib_LTLIBRARIES:%.la=.libs/%.$(LIB_EXT)*); do \
if test -h .libs/$$f; then \
cp -d $$f $(top_builddir)/$(LIB_DIR); \
else \
ln -f $$f $(top_builddir)/$(LIB_DIR); \
fi; \
done && touch $@
endif
endif

View File

@@ -0,0 +1,72 @@
# ===========================================================================
# http://www.gnu.org/software/autoconf-archive/ax_check_compile_flag.html
# ===========================================================================
#
# SYNOPSIS
#
# AX_CHECK_COMPILE_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS])
#
# DESCRIPTION
#
# Check whether the given FLAG works with the current language's compiler
# or gives an error. (Warnings, however, are ignored)
#
# ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
# success/failure.
#
# If EXTRA-FLAGS is defined, it is added to the current language's default
# flags (e.g. CFLAGS) when the check is done. The check is thus made with
# the flags: "CFLAGS EXTRA-FLAGS FLAG". This can for example be used to
# force the compiler to issue an error when a bad flag is given.
#
# NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. Please keep this
# macro in sync with AX_CHECK_{PREPROC,LINK}_FLAG.
#
# LICENSE
#
# Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
# Copyright (c) 2011 Maarten Bosmans <mkbosmans@gmail.com>
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation, either version 3 of the License, or (at your
# option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
# Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program. If not, see <http://www.gnu.org/licenses/>.
#
# As a special exception, the respective Autoconf Macro's copyright owner
# gives unlimited permission to copy, distribute and modify the configure
# scripts that are the output of Autoconf when processing the Macro. You
# need not follow the terms of the GNU General Public License when using
# or distributing such scripts, even though portions of the text of the
# Macro appear in them. The GNU General Public License (GPL) does govern
# all other use of the material that constitutes the Autoconf Macro.
#
# This special exception to the GPL applies to versions of the Autoconf
# Macro released by the Autoconf Archive. When you make and distribute a
# modified version of the Autoconf Macro, you may extend this special
# exception to the GPL to apply to your modified version as well.
#serial 2
AC_DEFUN([AX_CHECK_COMPILE_FLAG],
[AC_PREREQ(2.59)dnl for _AC_LANG_PREFIX
AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_[]_AC_LANG_ABBREV[]flags_$4_$1])dnl
AC_CACHE_CHECK([whether _AC_LANG compiler accepts $1], CACHEVAR, [
ax_check_save_flags=$[]_AC_LANG_PREFIX[]FLAGS
_AC_LANG_PREFIX[]FLAGS="$[]_AC_LANG_PREFIX[]FLAGS $4 $1"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM()],
[AS_VAR_SET(CACHEVAR,[yes])],
[AS_VAR_SET(CACHEVAR,[no])])
_AC_LANG_PREFIX[]FLAGS=$ax_check_save_flags])
AS_IF([test x"AS_VAR_GET(CACHEVAR)" = xyes],
[m4_default([$2], :)],
[m4_default([$3], :)])
AS_VAR_POPDEF([CACHEVAR])dnl
])dnl AX_CHECK_COMPILE_FLAGS

168
m4/ax_gcc_builtin.m4 Normal file
View File

@@ -0,0 +1,168 @@
# ===========================================================================
# http://www.gnu.org/software/autoconf-archive/ax_gcc_builtin.html
# ===========================================================================
#
# SYNOPSIS
#
# AX_GCC_BUILTIN(BUILTIN)
#
# DESCRIPTION
#
# This macro checks if the compiler supports one of GCC's built-in
# functions; many other compilers also provide those same built-ins.
#
# The BUILTIN parameter is the name of the built-in function.
#
# If BUILTIN is supported define HAVE_<BUILTIN>. Keep in mind that since
# builtins usually start with two underscores they will be copied over
# into the HAVE_<BUILTIN> definition (e.g. HAVE___BUILTIN_EXPECT for
# __builtin_expect()).
#
# The macro caches its result in the ax_cv_have_<BUILTIN> variable (e.g.
# ax_cv_have___builtin_expect).
#
# The macro currently supports the following built-in functions:
#
# __builtin_assume_aligned
# __builtin_bswap32
# __builtin_bswap64
# __builtin_choose_expr
# __builtin___clear_cache
# __builtin_clrsb
# __builtin_clrsbl
# __builtin_clrsbll
# __builtin_clz
# __builtin_clzl
# __builtin_clzll
# __builtin_complex
# __builtin_constant_p
# __builtin_ctz
# __builtin_ctzl
# __builtin_ctzll
# __builtin_expect
# __builtin_ffs
# __builtin_ffsl
# __builtin_ffsll
# __builtin_fpclassify
# __builtin_huge_val
# __builtin_huge_valf
# __builtin_huge_vall
# __builtin_inf
# __builtin_infd128
# __builtin_infd32
# __builtin_infd64
# __builtin_inff
# __builtin_infl
# __builtin_isinf_sign
# __builtin_nan
# __builtin_nand128
# __builtin_nand32
# __builtin_nand64
# __builtin_nanf
# __builtin_nanl
# __builtin_nans
# __builtin_nansf
# __builtin_nansl
# __builtin_object_size
# __builtin_parity
# __builtin_parityl
# __builtin_parityll
# __builtin_popcount
# __builtin_popcountl
# __builtin_popcountll
# __builtin_powi
# __builtin_powif
# __builtin_powil
# __builtin_prefetch
# __builtin_trap
# __builtin_types_compatible_p
# __builtin_unreachable
#
# Unsuppored built-ins will be tested with an empty parameter set and the
# result of the check might be wrong or meaningless so use with care.
#
# LICENSE
#
# Copyright (c) 2013 Gabriele Svelto <gabriele.svelto@gmail.com>
#
# Copying and distribution of this file, with or without modification, are
# permitted in any medium without royalty provided the copyright notice
# and this notice are preserved. This file is offered as-is, without any
# warranty.
#serial 2
AC_DEFUN([AX_GCC_BUILTIN], [
AS_VAR_PUSHDEF([ac_var], [ax_cv_have_$1])
AC_CACHE_CHECK([for $1], [ac_var], [
AC_LINK_IFELSE([AC_LANG_PROGRAM([], [
m4_case([$1],
[__builtin_assume_aligned], [$1("", 0)],
[__builtin_bswap32], [$1(0)],
[__builtin_bswap64], [$1(0)],
[__builtin_choose_expr], [$1(0, 0, 0)],
[__builtin___clear_cache], [$1("", "")],
[__builtin_clrsb], [$1(0)],
[__builtin_clrsbl], [$1(0)],
[__builtin_clrsbll], [$1(0)],
[__builtin_clz], [$1(0)],
[__builtin_clzl], [$1(0)],
[__builtin_clzll], [$1(0)],
[__builtin_complex], [$1(0.0, 0.0)],
[__builtin_constant_p], [$1(0)],
[__builtin_ctz], [$1(0)],
[__builtin_ctzl], [$1(0)],
[__builtin_ctzll], [$1(0)],
[__builtin_expect], [$1(0, 0)],
[__builtin_ffs], [$1(0)],
[__builtin_ffsl], [$1(0)],
[__builtin_ffsll], [$1(0)],
[__builtin_fpclassify], [$1(0, 1, 2, 3, 4, 0.0)],
[__builtin_huge_val], [$1()],
[__builtin_huge_valf], [$1()],
[__builtin_huge_vall], [$1()],
[__builtin_inf], [$1()],
[__builtin_infd128], [$1()],
[__builtin_infd32], [$1()],
[__builtin_infd64], [$1()],
[__builtin_inff], [$1()],
[__builtin_infl], [$1()],
[__builtin_isinf_sign], [$1(0.0)],
[__builtin_nan], [$1("")],
[__builtin_nand128], [$1("")],
[__builtin_nand32], [$1("")],
[__builtin_nand64], [$1("")],
[__builtin_nanf], [$1("")],
[__builtin_nanl], [$1("")],
[__builtin_nans], [$1("")],
[__builtin_nansf], [$1("")],
[__builtin_nansl], [$1("")],
[__builtin_object_size], [$1("", 0)],
[__builtin_parity], [$1(0)],
[__builtin_parityl], [$1(0)],
[__builtin_parityll], [$1(0)],
[__builtin_popcount], [$1(0)],
[__builtin_popcountl], [$1(0)],
[__builtin_popcountll], [$1(0)],
[__builtin_powi], [$1(0, 0)],
[__builtin_powif], [$1(0, 0)],
[__builtin_powil], [$1(0, 0)],
[__builtin_prefetch], [$1("")],
[__builtin_trap], [$1()],
[__builtin_types_compatible_p], [$1(int, int)],
[__builtin_unreachable], [$1()],
[m4_warn([syntax], [Unsupported built-in $1, the test may fail])
$1()]
)
])],
[AS_VAR_SET([ac_var], [yes])],
[AS_VAR_SET([ac_var], [no])])
])
AS_IF([test yes = AS_VAR_GET([ac_var])],
[AC_DEFINE_UNQUOTED(AS_TR_CPP(HAVE_$1), 1,
[Define to 1 if the system has the `$1' built-in function])], [])
AS_VAR_POPDEF([ac_var])
])

Some files were not shown because too many files have changed in this diff Show More